@oslokommune/punkt-react 12.1.0 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +3 -3
- package/dist/punkt-react.es.js +5 -5
- package/dist/punkt-react.umd.js +2 -2
- package/package.json +3 -3
- package/src/components/linkcard/LinkCard.test.tsx +2 -0
- package/src/components/linkcard/LinkCard.tsx +1 -1
- package/src/components/tabs/Tabs.tsx +1 -1
- package/src/components/tag/Tag.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.2.0](https://github.com/oslokommune/punkt/compare/12.1.0...12.2.0) (2024-09-30)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Gray skin Tabs, Tags, LinkCard (#1935). Nå er det mulig å bruke `gray` istedenfor `grey` for farger, men vi har beholdt fallback på `grey` for å unngå breaking changes.
|
|
15
|
+
|
|
16
|
+
Co-authored-by: Jan Schjetne <jan.schjetne@origo.oslo.kommune.no>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
### Chores
|
|
23
|
+
Ingen
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
|
|
8
28
|
## [12.0.0](https://github.com/oslokommune/punkt/compare/11.19.3...12.0.0) (2024-09-12)
|
|
9
29
|
|
|
10
30
|
### ⚠ BREAKING CHANGES
|
package/dist/index.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ declare interface IPktInputWrapper extends RefAttributes<HTMLElement> {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
declare interface IPktLinkCard extends default_2.HTMLAttributes<HTMLAnchorElement> {
|
|
184
|
-
skin?: 'normal' | 'blue' | 'beige' | 'beige-outline' | 'green' | 'grey' | 'grey-outline';
|
|
184
|
+
skin?: 'normal' | 'blue' | 'beige' | 'beige-outline' | 'green' | 'grey' | 'gray' | 'grey-outline' | 'gray-outline';
|
|
185
185
|
title?: string;
|
|
186
186
|
href?: string;
|
|
187
187
|
iconName?: string;
|
|
@@ -305,7 +305,7 @@ declare interface IPktStepper extends default_2.HTMLAttributes<HTMLOListElement>
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
declare interface IPktTag extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
308
|
-
skin?: 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'blue-light';
|
|
308
|
+
skin?: 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'gray' | 'blue-light';
|
|
309
309
|
textStyle?: 'normal-text' | 'thin-text';
|
|
310
310
|
size?: 'small' | 'medium' | 'large';
|
|
311
311
|
closeTag?: boolean;
|
|
@@ -597,7 +597,7 @@ declare interface Tab {
|
|
|
597
597
|
active?: boolean;
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
-
declare type TSkin = 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'blue-light';
|
|
600
|
+
declare type TSkin = 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'gray' | 'blue-light';
|
|
601
601
|
|
|
602
602
|
declare type TStepStatus = 'completed' | 'incomplete' | 'current';
|
|
603
603
|
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -664,7 +664,7 @@ const Ub = Ae(
|
|
|
664
664
|
].filter(Boolean).join(" ");
|
|
665
665
|
return /* @__PURE__ */ h.jsx("div", { "data-testid": "pkt-accordion", className: u, ref: o, children: i });
|
|
666
666
|
}
|
|
667
|
-
), Xa = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', vf = "https://punkt-cdn.oslo.kommune.no/12.
|
|
667
|
+
), Xa = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', vf = "https://punkt-cdn.oslo.kommune.no/12.2/icons/";
|
|
668
668
|
function yf(e) {
|
|
669
669
|
return new Promise((t) => setTimeout(t, e));
|
|
670
670
|
}
|
|
@@ -925,7 +925,7 @@ const Vb = Ae(
|
|
|
925
925
|
{
|
|
926
926
|
className: "pkt-btn__icon pkt-btn__spinner",
|
|
927
927
|
name: "spinner-blue",
|
|
928
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
928
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.2/animations/"
|
|
929
929
|
}
|
|
930
930
|
),
|
|
931
931
|
c !== "label-only" && /* @__PURE__ */ h.jsx(Z, { className: "pkt-btn__icon", name: r }),
|
|
@@ -1181,7 +1181,7 @@ const Gb = ({
|
|
|
1181
1181
|
name: "oslologo",
|
|
1182
1182
|
className: "pkt-header__logo-svg",
|
|
1183
1183
|
"aria-hidden": "true",
|
|
1184
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
1184
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.2/logos/"
|
|
1185
1185
|
}
|
|
1186
1186
|
) }) : /* @__PURE__ */ h.jsx(
|
|
1187
1187
|
"button",
|
|
@@ -1195,7 +1195,7 @@ const Gb = ({
|
|
|
1195
1195
|
name: "oslologo",
|
|
1196
1196
|
className: "pkt-header__logo-svg",
|
|
1197
1197
|
"aria-hidden": "true",
|
|
1198
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
1198
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.2/logos/"
|
|
1199
1199
|
}
|
|
1200
1200
|
)
|
|
1201
1201
|
}
|
|
@@ -1453,7 +1453,7 @@ const Ef = Ae(
|
|
|
1453
1453
|
{
|
|
1454
1454
|
name: w(u),
|
|
1455
1455
|
"aria-label": "loading",
|
|
1456
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
1456
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.2/animations/",
|
|
1457
1457
|
className: `pkt-loader__svg pkt-loader__${u}`
|
|
1458
1458
|
}
|
|
1459
1459
|
),
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -27,11 +27,11 @@ Check the top-level render call using <`+H+">.")}return I}}function an(b,I){{if(
|
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,tr,qe,Xr,qe),Yr[qe+tr]=!0}}return b===i?Oi(Fe):st(Fe),Fe}}function Jr(b,I,H){return Kr(b,I,H,!0)}function $i(b,I,H){return Kr(b,I,H,!1)}var Ii=$i,_n=Jr;jn.Fragment=i,jn.jsx=Ii,jn.jsxs=_n}()),jn}process.env.NODE_ENV==="production"?Da.exports=mc():Da.exports=gc();var h=Da.exports;const Dc=R.forwardRef(({compact:e=!1,skin:t="borderless",className:r,children:i},o)=>{const u=[r,"pkt-accordion",e&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`].filter(Boolean).join(" ");return h.jsx("div",{"data-testid":"pkt-accordion",className:u,ref:o,children:i})}),va='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',vc="https://punkt-cdn.oslo.kommune.no/12.
|
|
30
|
+
<%s key={someKey} {...props} />`,tr,qe,Xr,qe),Yr[qe+tr]=!0}}return b===i?Oi(Fe):st(Fe),Fe}}function Jr(b,I,H){return Kr(b,I,H,!0)}function $i(b,I,H){return Kr(b,I,H,!1)}var Ii=$i,_n=Jr;jn.Fragment=i,jn.jsx=Ii,jn.jsxs=_n}()),jn}process.env.NODE_ENV==="production"?Da.exports=mc():Da.exports=gc();var h=Da.exports;const Dc=R.forwardRef(({compact:e=!1,skin:t="borderless",className:r,children:i},o)=>{const u=[r,"pkt-accordion",e&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`].filter(Boolean).join(" ");return h.jsx("div",{"data-testid":"pkt-accordion",className:u,ref:o,children:i})}),va='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',vc="https://punkt-cdn.oslo.kommune.no/12.2/icons/";function yc(e){return new Promise(t=>setTimeout(t,e))}const ya={},bc=async(e,t)=>{let r=0;for(;ya[t+e+".svg"]==="fetching"&&(r++,!(r>50));)await yc(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.fetch=="function"?(ya[t+e+".svg"]="fetching",Promise.resolve(fetch(t+e+".svg").then(i=>i.ok?i.text():(console.error("Missing icon: "+t+e+".svg"),va)).then(i=>(i!==va&&localStorage.setItem(t+e+".svg",i),ya[t+e+".svg"]="fetched",i)))):Promise.resolve(va)},Cc={fetchIcon:async(e,t)=>bc(e,t||vc)},fs=R.createContext(Cc),ee=({name:e,path:t,className:r="",...i})=>{const[o,u]=R.useState(null),p=R.useContext(fs);return R.useEffect(()=>{e?p.fetchIcon(e,t).then(u):u(null)},[e,t]),o?h.jsx("span",{className:`pkt-icon ${r}`,dangerouslySetInnerHTML:{__html:o},...i}):null};var hs={exports:{}};/*!
|
|
31
31
|
Copyright (c) 2018 Jed Watson.
|
|
32
32
|
Licensed under the MIT License (MIT), see
|
|
33
33
|
http://jedwatson.github.io/classnames
|
|
34
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var u="",p=0;p<arguments.length;p++){var c=arguments[p];c&&(u=o(u,i(c)))}return u}function i(u){if(typeof u=="string"||typeof u=="number")return u;if(typeof u!="object")return"";if(Array.isArray(u))return r.apply(null,u);if(u.toString!==Object.prototype.toString&&!u.toString.toString().includes("[native code]"))return u.toString();var p="";for(var c in u)t.call(u,c)&&u[c]&&(p=o(p,c));return p}function o(u,p){return p?u?u+" "+p:u+p:u}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(hs);var kc=hs.exports;const $e=hr(kc),wc=R.forwardRef(({title:e,className:t,children:r,toggleProps:i,defaultOpen:o=!1,id:u},p)=>{const[c,f]=R.useState(o),m=i?i.isOpen:c,g=w=>w??void 0,y=(w,x)=>{w.preventDefault(),i!==void 0&&i.onToggleClick(w,x),f(!m)},v=$e(t,"pkt-accordion-item");return h.jsxs("details",{className:v,ref:p,id:u,open:g(i?i.isOpen:c),children:[h.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${u}`,onClick:w=>y(w,u),children:[e,h.jsx(ee,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),h.jsx("div",{id:`pkt-accordion-item-content-${u}`,role:"region",className:"pkt-accordion-item__content",children:r})]})}),ba=R.forwardRef(({children:e,className:t,skin:r="info",closeAlert:i=!1,onClose:o,title:u,date:p,ariaLive:c="polite",compact:f=!1,...m},g)=>{const y=[t,"pkt-alert",r&&`pkt-alert--${r}`,f&&"pkt-alert--compact"].filter(Boolean).join(" "),[v,w]=R.useState(!0),x=()=>{w(!1),o&&o()};return v?h.jsxs("div",{...m,className:y,"aria-live":c,ref:g,children:[h.jsx(ee,{className:"pkt-alert__icon",name:r==="info"?"alert-information":`alert-${r}`}),i&&h.jsx("div",{className:"pkt-alert__close",children:h.jsx("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:x,children:h.jsx(ee,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),u&&h.jsx("div",{className:"pkt-alert__title",children:u}),h.jsx("div",{className:"pkt-alert__text",children:e}),p&&h.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",p]})]}):null});ba.displayName="PktAlert";const ms=R.forwardRef(({href:e,text:t,onClick:r,className:i,...o},u)=>{const p=[i,"pkt-back-link"].filter(Boolean).join(" "),c=f=>{r&&r(f)};return h.jsx("nav",{ref:u,className:p,"aria-label":"Gå tilbake et steg",children:h.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...o,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),h.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});ms.displayName="PktBackLink";const _c=R.forwardRef(({breadcrumbs:e,navigationType:t,className:r,...i},o)=>{const u=e.slice(0,4),p=u[u.length-2],c=[r,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h.jsxs("nav",{ref:o,"aria-label":"brødsmulemeny",className:c,children:[h.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:u.map((f,m)=>h.jsx("li",{className:"pkt-breadcrumbs__item",children:m===u.length-1?h.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})}):t==="router"?h.jsxs(Wt.Link,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[h.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h.jsxs("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[h.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${m}`))}),t==="router"?h.jsxs(Wt.Link,{to:p.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:p.text})]}):h.jsxs("a",{href:p.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:p.text})]})]})}),Vt=R.forwardRef(({children:e,className:t,iconName:r="user",secondIconName:i="user",size:o="medium",skin:u="primary",type:p="button",variant:c="label-only",state:f,color:m,isLoading:g=!1,...y},v)=>{const w=[t,"pkt-btn",o&&`pkt-btn--${o}`,u&&`pkt-btn--${u}`,c&&`pkt-btn--${c}`,m&&`pkt-btn--${m}`,g&&"pkt-btn--active",f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return h.jsxs("button",{...y,className:w,type:p,ref:v,children:[g&&h.jsx(ee,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.1/animations/"}),c!=="label-only"&&h.jsx(ee,{className:"pkt-btn__icon",name:r}),h.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&h.jsx(ee,{className:"pkt-btn__icon",name:i})]})});Vt.displayName="PktButton";const mr=R.forwardRef(({id:e,hasTile:t=!1,disabled:r=!1,label:i,labelPosition:o="right",hideLabel:u=!1,checkHelptext:p,hasError:c=!1,isSwitch:f=!1,className:m,...g},y)=>{const v=[m,"pkt-input-check"].filter(Boolean).join(" ");return h.jsx("div",{className:v,children:h.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${r&&t?"pkt-input-check__input--tile-disabled":""}`,children:[i&&o==="left"&&h.jsxs("label",{className:`pkt-input-check__input-label ${u?"pkt-sr-only":""}`,htmlFor:e,children:[i,p&&h.jsx("div",{className:"pkt-input-check__input-helptext",children:p})]}),h.jsx("input",{ref:y,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:f?"switch":"checkbox",id:e,disabled:r,...g}),i&&o==="right"&&h.jsxs("label",{className:`pkt-input-check__input-label ${u?"pkt-sr-only":""}`,htmlFor:e,children:[i,p&&h.jsx("div",{className:"pkt-input-check__input-helptext",children:p})]})]})})});mr.displayName="PktCheckbox";const Fc=({columnOne:e,columnTwo:t,socialLinks:r,className:i,personvernOgInfoLink:o="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:u="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const p=[i,"pkt-footer"].filter(Boolean).join(" ");return h.jsx("footer",{className:p,"data-mode":"dark",children:h.jsxs("div",{className:"pkt-footer__container",children:[h.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:e.title}),h.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&h.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((m,g)=>h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:`pkt-footer__link ${m.external?"pkt-link--external":""}`,href:m.href,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),m.text]})},`links-${g}`))]})]}),h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:t.title}),h.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&h.jsx("li",{className:"pkt-footer__text",children:t.text}),(f=t.links)==null?void 0:f.map((m,g)=>h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:`pkt-footer__link ${m.external?"pkt-link--external":""}`,href:m.href,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),m.text]})},`links-${g}`))]})]}),h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h.jsxs("ul",{className:"pkt-footer__list",children:[h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:"pkt-footer__link",href:o,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:"pkt-footer__link",href:u,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),r&&h.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[h.jsx("div",{className:"pkt-footer__social-languages",children:r.filter(m=>m.language).map((m,g)=>h.jsx("div",{className:"pkt-footer__social-language",children:h.jsx("a",{href:m.href,"aria-label":`til ${m.language} versjon av nettsiden`,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:m.language})},`sociallinks-language-${g}`))}),h.jsx("div",{className:"pkt-footer__social-icons",children:r.filter(m=>m.iconName).map((m,g)=>h.jsx(R.Fragment,{children:h.jsx("a",{href:m.href,"aria-label":`til ${m.iconName}`,className:"pkt-footer__social-icon-link",target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:h.jsx(ee,{className:"pkt-footer__social-icon",name:m.iconName})})},`sociallinks-${g}`))})]})]})})},Ec=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",className:i})=>{const o=[i,"pkt-footer-simple"].filter(Boolean).join(" ");return h.jsx("footer",{className:o,"data-mode":"dark",children:h.jsx("div",{className:"pkt-footer-simple__container",children:h.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((u,p)=>h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:`pkt-footer-simple__link ${u.external?" pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),u.text]})},p)),h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:"pkt-footer-simple__link",href:r,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},xc=R.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:r,fixed:i=!0,scrollToHide:o=!0,user:u,userMenu:p,representing:c,userOptions:f,userMenuFooter:m,canChangeRepresentation:g=!0,showMenuButton:y=!1,showLogOutButton:v=!1,openMenu:w,logOut:x,changeRepresentation:A,children:C,...B},F)=>{const k=R.useMemo(()=>typeof(u==null?void 0:u.lastLoggedIn)=="string"?u.lastLoggedIn:u!=null&&u.lastLoggedIn?new Date(u.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[u]),[E,S]=R.useState(!1),[T,L]=R.useState(0),[$,j]=R.useState(!1),U=R.useRef(null);R.useEffect(()=>(document.addEventListener("mouseup",V),window.addEventListener("scroll",O),()=>{document.removeEventListener("mouseup",V),window.removeEventListener("scroll",O)}));const Y=()=>{j(!$)},V=P=>{U.current&&!U.current.contains(P.target)&&j(!1)},O=()=>{if(o){const P=window.pageYOffset||document.documentElement.scrollTop;if(P<0||Math.abs(P-T)<60)return;S(P>T),L(P)}};return h.jsxs("header",{...B,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:$e(e,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":o,"pkt-header--hidden":E}),ref:F,children:[h.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?h.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:h.jsx(ee,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.1/logos/"})}):h.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:h.jsx(ee,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.1/logos/"})}),h.jsx("span",{className:"pkt-header__logo-service",children:r})]}),h.jsx("nav",{className:"pkt-header__actions",children:h.jsxs("ul",{className:"pkt-header__actions-row",children:[y&&h.jsx("li",{children:h.jsx(Vt,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:w,children:"Meny"})}),(u||c)&&h.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${$&&!E?"pkt-header--open-dropdown":""}`,ref:U,children:[h.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":$,onClick:Y,children:[h.jsx(ee,{name:"user",className:"pkt-btn__icon"}),h.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(u==null?void 0:u.name)}),h.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(u==null?void 0:u.shortname)}),h.jsx(ee,{name:"chevron-thin-down",className:"pkt-btn--closed"}),h.jsx(ee,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[u&&h.jsxs("li",{children:[h.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),h.jsx("div",{className:"pkt-user-menu__name",children:u.name}),u.lastLoggedIn&&h.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",h.jsx("time",{children:k})]})]}),p&&h.jsx("li",{children:h.jsx("ul",{className:"pkt-list",children:p.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsxs("a",{href:P.target,className:"pkt-link",children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]}):h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]})},`userMenu-${q}`))})}),(c||g)&&h.jsxs("li",{children:[c&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),h.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&h.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),h.jsx("ul",{className:"pkt-list mt-size-16",children:g&&h.jsx("li",{children:h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:A,children:[h.jsx(ee,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),h.jsx("li",{children:h.jsx("ul",{className:"pkt-list",children:(f||!v)&&h.jsxs(h.Fragment,{children:[f==null?void 0:f.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsxs("a",{href:P.target,className:"pkt-link",children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]}):h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]})},`userOptions-${q}`)),!v&&h.jsx("li",{children:h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[h.jsx(ee,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),m&&h.jsx("li",{className:"footer",children:h.jsx("ul",{className:"pkt-list-horizontal bordered",children:m.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsx("a",{href:P.target,className:"pkt-link",children:P.title}):h.jsx("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:P.title})},`userMenuFooter-${q}`))})})]})]}),C&&h.jsx("li",{children:C}),v&&h.jsx("li",{children:h.jsx(Vt,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:x,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),gs=R.forwardRef(({label:e,id:t,children:r,...i},o)=>h.jsxs("div",{className:"pkt-form-group",children:[h.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),h.jsx("input",{className:"pkt-form-input",id:t,...i,ref:o}),r]}));gs.displayName="PktInput";const cn=R.forwardRef(({forId:e,label:t,helptext:r,helptextDropdown:i,helptextDropdownButton:o,counter:u,counterCurrent:p,counterMaxLength:c,optionalTag:f=!1,optionalText:m="Valgfritt",requiredTag:g=!1,requiredText:y="Må fylles ut",hasError:v,errorMessage:w,disabled:x,inline:A,ariaDescribedby:C,useWrapper:B=!0,children:F,className:k,hasFieldset:E=!1},S)=>{const[T,L]=R.useState(!1),$=()=>{L(!T)},j=()=>f?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":g?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",U=f?m:g?y:"",Y=x?"pkt-inputwrapper--disabled":"",V=A?"pkt-inputwrapper--inline":"",O=v?"pkt-inputwrapper--error":"",P=!!i&&i!=="",q=o||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',J=E?"fieldset":P?"div":"label",pe=E?"legend":P?"h2":"span",X=C||(r?`${e}-helptext`:void 0);return h.jsxs("div",{className:["pkt-inputwrapper",k,Y,V,O].join(" "),ref:S,children:[B?h.jsx(h.Fragment,{children:h.jsxs(J,{htmlFor:E?void 0:e,"aria-describedby":P?void 0:C,className:`pkt-inputwrapper__label${E?" pkt-inputwrapper__fieldset":""}`,children:[h.jsxs(pe,{id:`${e}-label`,className:`${E?" pkt-inputwrapper__legend":""}`,children:[t,U!==""&&h.jsx("span",{className:j(),children:U})]}),r&&h.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:r}),P&&i!==""&&h.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[h.jsx(Vt,{skin:"tertiary",size:"small",variant:"icon-right",iconName:T?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:$,children:h.jsx("span",{dangerouslySetInnerHTML:{__html:q}})}),h.jsx("div",{className:`pkt-inputwrapper__helptext ${T?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i}),!E&&h.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":X,children:t})]}),h.jsx(h.Fragment,{children:F}),u&&h.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[p||0,c&&`/${c}`]})]})}):h.jsxs(h.Fragment,{children:[!E&&h.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":X,id:`${e}-label`,children:t}),F]}),v&&w&&h.jsx("div",{children:h.jsx(ba,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:w})})]})});cn.displayName="PktInputWrapper";const Ds=R.forwardRef(({children:e,className:t,iconName:r,openInNewTab:i=!1,skin:o="normal",href:u="#",external:p=!1,title:c,...f},m)=>{const g=[t,"pkt-linkcard",o&&`pkt-linkcard--${o}`].filter(Boolean).join(" ");return h.jsxs("a",{...f,href:u,className:`pkt-linkcard pkt-link ${g}`,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,ref:m,children:[r&&h.jsx(ee,{className:"pkt-link__icon",name:r}),h.jsx("div",{className:`pkt-linkcard__title ${p?"pkt-link pkt-link--external":""}`,children:c}),h.jsx("div",{className:"pkt-linkcard__text",children:e})]})});Ds.displayName="PktLinkCard";const vs=R.forwardRef(({className:e,message:t,size:r="medium",inline:i=!1,isLoading:o=!0,variant:u="rainbow",delay:p=0,children:c,...f},m)=>{const g=`pkt-loader pkt-loader--${r}`,[y,v]=R.useState(!(p>0));p>0&&setTimeout(()=>{v(!0)},p);const w=x=>x==="shapes"?"loader":x==="blue"?"spinner-blue":"spinner";return h.jsx("div",{role:"status","aria-live":"polite","aria-busy":o,className:`pkt-loader--${i?"inline":"box"} ${e||""}`,children:o?h.jsx(h.Fragment,{children:y?h.jsxs("div",{className:g,"data-testid":"pkt-loader",ref:m,...f,children:[h.jsx(ee,{name:w(u),"aria-label":"loading",path:"https://punkt-cdn.oslo.kommune.no/12.1/animations/",className:`pkt-loader__svg pkt-loader__${u}`}),t&&h.jsx("p",{children:t})]}):null}):c})});vs.displayName="PktLoader";const ys=R.forwardRef(({children:e,className:t,compact:r=!1,closable:i=!1,skin:o="beige",title:u,onClose:p,...c},f)=>{const[m,g]=R.useState(!0),y=()=>{g(!1),p&&p()},v=[t,"pkt-messagebox",o&&`pkt-messagebox--${o}`,r&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return m?h.jsxs("div",{...c,className:v,ref:f,children:[i&&h.jsx("div",{className:"pkt-messagebox__close",children:h.jsx("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:y,children:h.jsx(ee,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),u&&h.jsx("div",{className:"pkt-messagebox__title",children:u}),h.jsx("div",{className:"pkt-messagebox__text",children:e})]}):null});ys.displayName="PktMessagebox";/*!
|
|
34
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var u="",p=0;p<arguments.length;p++){var c=arguments[p];c&&(u=o(u,i(c)))}return u}function i(u){if(typeof u=="string"||typeof u=="number")return u;if(typeof u!="object")return"";if(Array.isArray(u))return r.apply(null,u);if(u.toString!==Object.prototype.toString&&!u.toString.toString().includes("[native code]"))return u.toString();var p="";for(var c in u)t.call(u,c)&&u[c]&&(p=o(p,c));return p}function o(u,p){return p?u?u+" "+p:u+p:u}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(hs);var kc=hs.exports;const $e=hr(kc),wc=R.forwardRef(({title:e,className:t,children:r,toggleProps:i,defaultOpen:o=!1,id:u},p)=>{const[c,f]=R.useState(o),m=i?i.isOpen:c,g=w=>w??void 0,y=(w,x)=>{w.preventDefault(),i!==void 0&&i.onToggleClick(w,x),f(!m)},v=$e(t,"pkt-accordion-item");return h.jsxs("details",{className:v,ref:p,id:u,open:g(i?i.isOpen:c),children:[h.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${u}`,onClick:w=>y(w,u),children:[e,h.jsx(ee,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),h.jsx("div",{id:`pkt-accordion-item-content-${u}`,role:"region",className:"pkt-accordion-item__content",children:r})]})}),ba=R.forwardRef(({children:e,className:t,skin:r="info",closeAlert:i=!1,onClose:o,title:u,date:p,ariaLive:c="polite",compact:f=!1,...m},g)=>{const y=[t,"pkt-alert",r&&`pkt-alert--${r}`,f&&"pkt-alert--compact"].filter(Boolean).join(" "),[v,w]=R.useState(!0),x=()=>{w(!1),o&&o()};return v?h.jsxs("div",{...m,className:y,"aria-live":c,ref:g,children:[h.jsx(ee,{className:"pkt-alert__icon",name:r==="info"?"alert-information":`alert-${r}`}),i&&h.jsx("div",{className:"pkt-alert__close",children:h.jsx("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:x,children:h.jsx(ee,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),u&&h.jsx("div",{className:"pkt-alert__title",children:u}),h.jsx("div",{className:"pkt-alert__text",children:e}),p&&h.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",p]})]}):null});ba.displayName="PktAlert";const ms=R.forwardRef(({href:e,text:t,onClick:r,className:i,...o},u)=>{const p=[i,"pkt-back-link"].filter(Boolean).join(" "),c=f=>{r&&r(f)};return h.jsx("nav",{ref:u,className:p,"aria-label":"Gå tilbake et steg",children:h.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...o,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),h.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});ms.displayName="PktBackLink";const _c=R.forwardRef(({breadcrumbs:e,navigationType:t,className:r,...i},o)=>{const u=e.slice(0,4),p=u[u.length-2],c=[r,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h.jsxs("nav",{ref:o,"aria-label":"brødsmulemeny",className:c,children:[h.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:u.map((f,m)=>h.jsx("li",{className:"pkt-breadcrumbs__item",children:m===u.length-1?h.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})}):t==="router"?h.jsxs(Wt.Link,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[h.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h.jsxs("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[h.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${m}`))}),t==="router"?h.jsxs(Wt.Link,{to:p.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:p.text})]}):h.jsxs("a",{href:p.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[h.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),h.jsx("span",{className:"pkt-breadcrumbs__text",children:p.text})]})]})}),Vt=R.forwardRef(({children:e,className:t,iconName:r="user",secondIconName:i="user",size:o="medium",skin:u="primary",type:p="button",variant:c="label-only",state:f,color:m,isLoading:g=!1,...y},v)=>{const w=[t,"pkt-btn",o&&`pkt-btn--${o}`,u&&`pkt-btn--${u}`,c&&`pkt-btn--${c}`,m&&`pkt-btn--${m}`,g&&"pkt-btn--active",f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return h.jsxs("button",{...y,className:w,type:p,ref:v,children:[g&&h.jsx(ee,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.2/animations/"}),c!=="label-only"&&h.jsx(ee,{className:"pkt-btn__icon",name:r}),h.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&h.jsx(ee,{className:"pkt-btn__icon",name:i})]})});Vt.displayName="PktButton";const mr=R.forwardRef(({id:e,hasTile:t=!1,disabled:r=!1,label:i,labelPosition:o="right",hideLabel:u=!1,checkHelptext:p,hasError:c=!1,isSwitch:f=!1,className:m,...g},y)=>{const v=[m,"pkt-input-check"].filter(Boolean).join(" ");return h.jsx("div",{className:v,children:h.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${r&&t?"pkt-input-check__input--tile-disabled":""}`,children:[i&&o==="left"&&h.jsxs("label",{className:`pkt-input-check__input-label ${u?"pkt-sr-only":""}`,htmlFor:e,children:[i,p&&h.jsx("div",{className:"pkt-input-check__input-helptext",children:p})]}),h.jsx("input",{ref:y,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:f?"switch":"checkbox",id:e,disabled:r,...g}),i&&o==="right"&&h.jsxs("label",{className:`pkt-input-check__input-label ${u?"pkt-sr-only":""}`,htmlFor:e,children:[i,p&&h.jsx("div",{className:"pkt-input-check__input-helptext",children:p})]})]})})});mr.displayName="PktCheckbox";const Fc=({columnOne:e,columnTwo:t,socialLinks:r,className:i,personvernOgInfoLink:o="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:u="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const p=[i,"pkt-footer"].filter(Boolean).join(" ");return h.jsx("footer",{className:p,"data-mode":"dark",children:h.jsxs("div",{className:"pkt-footer__container",children:[h.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:e.title}),h.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&h.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((m,g)=>h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:`pkt-footer__link ${m.external?"pkt-link--external":""}`,href:m.href,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),m.text]})},`links-${g}`))]})]}),h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:t.title}),h.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&h.jsx("li",{className:"pkt-footer__text",children:t.text}),(f=t.links)==null?void 0:f.map((m,g)=>h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:`pkt-footer__link ${m.external?"pkt-link--external":""}`,href:m.href,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),m.text]})},`links-${g}`))]})]}),h.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[h.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h.jsxs("ul",{className:"pkt-footer__list",children:[h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:"pkt-footer__link",href:o,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),h.jsx("li",{className:"pkt-footer__list-item",children:h.jsxs("a",{className:"pkt-footer__link",href:u,children:[h.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),r&&h.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[h.jsx("div",{className:"pkt-footer__social-languages",children:r.filter(m=>m.language).map((m,g)=>h.jsx("div",{className:"pkt-footer__social-language",children:h.jsx("a",{href:m.href,"aria-label":`til ${m.language} versjon av nettsiden`,target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:m.language})},`sociallinks-language-${g}`))}),h.jsx("div",{className:"pkt-footer__social-icons",children:r.filter(m=>m.iconName).map((m,g)=>h.jsx(R.Fragment,{children:h.jsx("a",{href:m.href,"aria-label":`til ${m.iconName}`,className:"pkt-footer__social-icon-link",target:m.openInNewTab?"_blank":"_self",rel:m.openInNewTab?"noopener noreferrer":void 0,children:h.jsx(ee,{className:"pkt-footer__social-icon",name:m.iconName})})},`sociallinks-${g}`))})]})]})})},Ec=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",className:i})=>{const o=[i,"pkt-footer-simple"].filter(Boolean).join(" ");return h.jsx("footer",{className:o,"data-mode":"dark",children:h.jsx("div",{className:"pkt-footer-simple__container",children:h.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((u,p)=>h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:`pkt-footer-simple__link ${u.external?" pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),u.text]})},p)),h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),h.jsx("li",{className:"pkt-footer-simple__list-item",children:h.jsxs("a",{className:"pkt-footer-simple__link",href:r,children:[h.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},xc=R.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:r,fixed:i=!0,scrollToHide:o=!0,user:u,userMenu:p,representing:c,userOptions:f,userMenuFooter:m,canChangeRepresentation:g=!0,showMenuButton:y=!1,showLogOutButton:v=!1,openMenu:w,logOut:x,changeRepresentation:A,children:C,...B},F)=>{const k=R.useMemo(()=>typeof(u==null?void 0:u.lastLoggedIn)=="string"?u.lastLoggedIn:u!=null&&u.lastLoggedIn?new Date(u.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[u]),[E,S]=R.useState(!1),[T,L]=R.useState(0),[$,j]=R.useState(!1),U=R.useRef(null);R.useEffect(()=>(document.addEventListener("mouseup",V),window.addEventListener("scroll",O),()=>{document.removeEventListener("mouseup",V),window.removeEventListener("scroll",O)}));const Y=()=>{j(!$)},V=P=>{U.current&&!U.current.contains(P.target)&&j(!1)},O=()=>{if(o){const P=window.pageYOffset||document.documentElement.scrollTop;if(P<0||Math.abs(P-T)<60)return;S(P>T),L(P)}};return h.jsxs("header",{...B,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:$e(e,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":o,"pkt-header--hidden":E}),ref:F,children:[h.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?h.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:h.jsx(ee,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.2/logos/"})}):h.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:h.jsx(ee,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.2/logos/"})}),h.jsx("span",{className:"pkt-header__logo-service",children:r})]}),h.jsx("nav",{className:"pkt-header__actions",children:h.jsxs("ul",{className:"pkt-header__actions-row",children:[y&&h.jsx("li",{children:h.jsx(Vt,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:w,children:"Meny"})}),(u||c)&&h.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${$&&!E?"pkt-header--open-dropdown":""}`,ref:U,children:[h.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":$,onClick:Y,children:[h.jsx(ee,{name:"user",className:"pkt-btn__icon"}),h.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(u==null?void 0:u.name)}),h.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(u==null?void 0:u.shortname)}),h.jsx(ee,{name:"chevron-thin-down",className:"pkt-btn--closed"}),h.jsx(ee,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[u&&h.jsxs("li",{children:[h.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),h.jsx("div",{className:"pkt-user-menu__name",children:u.name}),u.lastLoggedIn&&h.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",h.jsx("time",{children:k})]})]}),p&&h.jsx("li",{children:h.jsx("ul",{className:"pkt-list",children:p.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsxs("a",{href:P.target,className:"pkt-link",children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]}):h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]})},`userMenu-${q}`))})}),(c||g)&&h.jsxs("li",{children:[c&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),h.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&h.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),h.jsx("ul",{className:"pkt-list mt-size-16",children:g&&h.jsx("li",{children:h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:A,children:[h.jsx(ee,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),h.jsx("li",{children:h.jsx("ul",{className:"pkt-list",children:(f||!v)&&h.jsxs(h.Fragment,{children:[f==null?void 0:f.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsxs("a",{href:P.target,className:"pkt-link",children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]}):h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:[P.iconName&&h.jsx(ee,{name:P.iconName,className:"pkt-link__icon"}),P.title]})},`userOptions-${q}`)),!v&&h.jsx("li",{children:h.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[h.jsx(ee,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),m&&h.jsx("li",{className:"footer",children:h.jsx("ul",{className:"pkt-list-horizontal bordered",children:m.map((P,q)=>h.jsx("li",{children:typeof P.target=="string"?h.jsx("a",{href:P.target,className:"pkt-link",children:P.title}):h.jsx("button",{className:"pkt-link-button pkt-link",onClick:P.target,children:P.title})},`userMenuFooter-${q}`))})})]})]}),C&&h.jsx("li",{children:C}),v&&h.jsx("li",{children:h.jsx(Vt,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:x,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),gs=R.forwardRef(({label:e,id:t,children:r,...i},o)=>h.jsxs("div",{className:"pkt-form-group",children:[h.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),h.jsx("input",{className:"pkt-form-input",id:t,...i,ref:o}),r]}));gs.displayName="PktInput";const cn=R.forwardRef(({forId:e,label:t,helptext:r,helptextDropdown:i,helptextDropdownButton:o,counter:u,counterCurrent:p,counterMaxLength:c,optionalTag:f=!1,optionalText:m="Valgfritt",requiredTag:g=!1,requiredText:y="Må fylles ut",hasError:v,errorMessage:w,disabled:x,inline:A,ariaDescribedby:C,useWrapper:B=!0,children:F,className:k,hasFieldset:E=!1},S)=>{const[T,L]=R.useState(!1),$=()=>{L(!T)},j=()=>f?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":g?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",U=f?m:g?y:"",Y=x?"pkt-inputwrapper--disabled":"",V=A?"pkt-inputwrapper--inline":"",O=v?"pkt-inputwrapper--error":"",P=!!i&&i!=="",q=o||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',J=E?"fieldset":P?"div":"label",pe=E?"legend":P?"h2":"span",X=C||(r?`${e}-helptext`:void 0);return h.jsxs("div",{className:["pkt-inputwrapper",k,Y,V,O].join(" "),ref:S,children:[B?h.jsx(h.Fragment,{children:h.jsxs(J,{htmlFor:E?void 0:e,"aria-describedby":P?void 0:C,className:`pkt-inputwrapper__label${E?" pkt-inputwrapper__fieldset":""}`,children:[h.jsxs(pe,{id:`${e}-label`,className:`${E?" pkt-inputwrapper__legend":""}`,children:[t,U!==""&&h.jsx("span",{className:j(),children:U})]}),r&&h.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:r}),P&&i!==""&&h.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[h.jsx(Vt,{skin:"tertiary",size:"small",variant:"icon-right",iconName:T?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:$,children:h.jsx("span",{dangerouslySetInnerHTML:{__html:q}})}),h.jsx("div",{className:`pkt-inputwrapper__helptext ${T?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i}),!E&&h.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":X,children:t})]}),h.jsx(h.Fragment,{children:F}),u&&h.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[p||0,c&&`/${c}`]})]})}):h.jsxs(h.Fragment,{children:[!E&&h.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":X,id:`${e}-label`,children:t}),F]}),v&&w&&h.jsx("div",{children:h.jsx(ba,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:w})})]})});cn.displayName="PktInputWrapper";const Ds=R.forwardRef(({children:e,className:t,iconName:r,openInNewTab:i=!1,skin:o="normal",href:u="#",external:p=!1,title:c,...f},m)=>{const g=[t,"pkt-linkcard",o&&`pkt-linkcard--${o}`].filter(Boolean).join(" ");return h.jsxs("a",{...f,href:u,className:`pkt-linkcard pkt-link ${g}`,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,ref:m,children:[r&&h.jsx(ee,{className:"pkt-link__icon",name:r}),h.jsx("div",{className:`pkt-linkcard__title ${p?"pkt-link pkt-link--external":""}`,children:c}),h.jsx("div",{className:"pkt-linkcard__text",children:e})]})});Ds.displayName="PktLinkCard";const vs=R.forwardRef(({className:e,message:t,size:r="medium",inline:i=!1,isLoading:o=!0,variant:u="rainbow",delay:p=0,children:c,...f},m)=>{const g=`pkt-loader pkt-loader--${r}`,[y,v]=R.useState(!(p>0));p>0&&setTimeout(()=>{v(!0)},p);const w=x=>x==="shapes"?"loader":x==="blue"?"spinner-blue":"spinner";return h.jsx("div",{role:"status","aria-live":"polite","aria-busy":o,className:`pkt-loader--${i?"inline":"box"} ${e||""}`,children:o?h.jsx(h.Fragment,{children:y?h.jsxs("div",{className:g,"data-testid":"pkt-loader",ref:m,...f,children:[h.jsx(ee,{name:w(u),"aria-label":"loading",path:"https://punkt-cdn.oslo.kommune.no/12.2/animations/",className:`pkt-loader__svg pkt-loader__${u}`}),t&&h.jsx("p",{children:t})]}):null}):c})});vs.displayName="PktLoader";const ys=R.forwardRef(({children:e,className:t,compact:r=!1,closable:i=!1,skin:o="beige",title:u,onClose:p,...c},f)=>{const[m,g]=R.useState(!0),y=()=>{g(!1),p&&p()},v=[t,"pkt-messagebox",o&&`pkt-messagebox--${o}`,r&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return m?h.jsxs("div",{...c,className:v,ref:f,children:[i&&h.jsx("div",{className:"pkt-messagebox__close",children:h.jsx("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:y,children:h.jsx(ee,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),u&&h.jsx("div",{className:"pkt-messagebox__title",children:u}),h.jsx("div",{className:"pkt-messagebox__text",children:e})]}):null});ys.displayName="PktMessagebox";/*!
|
|
35
35
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
36
36
|
*
|
|
37
37
|
* 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.2.0",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@oslokommune/punkt-assets": "^12.1.0",
|
|
43
|
-
"@oslokommune/punkt-css": "^12.
|
|
43
|
+
"@oslokommune/punkt-css": "^12.2.0",
|
|
44
44
|
"@testing-library/jest-dom": "^6.5.0",
|
|
45
45
|
"@testing-library/react": "^16.0.1",
|
|
46
46
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
99
99
|
},
|
|
100
100
|
"license": "MIT",
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "6eb4f246d43111da9142a7c98526d2d5d7dfda4e"
|
|
102
102
|
}
|
|
@@ -40,6 +40,7 @@ describe('PktLinkCard', () => {
|
|
|
40
40
|
<PktLinkCard title="Beige" skin="beige" />
|
|
41
41
|
<PktLinkCard title="Beige outline" skin="beige-outline" />
|
|
42
42
|
<PktLinkCard title="Grey outline" skin="grey-outline" />
|
|
43
|
+
<PktLinkCard title="Gray outline" skin="gray-outline" />
|
|
43
44
|
</div>,
|
|
44
45
|
)
|
|
45
46
|
|
|
@@ -48,6 +49,7 @@ describe('PktLinkCard', () => {
|
|
|
48
49
|
expect(container.querySelectorAll('.pkt-linkcard--beige')).toHaveLength(1)
|
|
49
50
|
expect(container.querySelectorAll('.pkt-linkcard--beige-outline')).toHaveLength(1)
|
|
50
51
|
expect(container.querySelectorAll('.pkt-linkcard--grey-outline')).toHaveLength(1)
|
|
52
|
+
expect(container.querySelectorAll('.pkt-linkcard--gray-outline')).toHaveLength(1)
|
|
51
53
|
})
|
|
52
54
|
})
|
|
53
55
|
|
|
@@ -3,7 +3,7 @@ import React, { ForwardedRef, forwardRef } from 'react'
|
|
|
3
3
|
import { PktIcon } from '../icon/Icon'
|
|
4
4
|
|
|
5
5
|
export interface IPktLinkCard extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
6
|
-
skin?: 'normal' | 'blue' | 'beige' | 'beige-outline' | 'green' | 'grey' | 'grey-outline'
|
|
6
|
+
skin?: 'normal' | 'blue' | 'beige' | 'beige-outline' | 'green' | 'grey' | 'gray' | 'grey-outline'| 'gray-outline'
|
|
7
7
|
title?: string
|
|
8
8
|
href?: string
|
|
9
9
|
iconName?: string
|
|
@@ -4,7 +4,7 @@ import React, { forwardRef, Ref, useRef, useEffect, KeyboardEvent, Fragment } fr
|
|
|
4
4
|
import { PktIcon } from '../icon/Icon'
|
|
5
5
|
import { PktTag } from '../tag/Tag'
|
|
6
6
|
|
|
7
|
-
export type TSkin = 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'blue-light'
|
|
7
|
+
export type TSkin = 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'gray' | 'blue-light'
|
|
8
8
|
|
|
9
9
|
export interface Tab {
|
|
10
10
|
text: string
|
|
@@ -3,7 +3,7 @@ import React, { ForwardedRef, forwardRef, useState } from 'react';
|
|
|
3
3
|
import { PktIcon } from '../icon/Icon'
|
|
4
4
|
|
|
5
5
|
export interface IPktTag extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
skin?: 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'blue-light';
|
|
6
|
+
skin?: 'blue' | 'green' | 'red' | 'beige' | 'yellow' | 'grey'| 'gray' | 'blue-light';
|
|
7
7
|
textStyle?: 'normal-text' | 'thin-text';
|
|
8
8
|
size?: 'small' | 'medium' | 'large';
|
|
9
9
|
closeTag?: boolean;
|