@oslokommune/punkt-react 12.8.0 → 12.9.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 +35 -0
- package/dist/index.d.ts +6 -1
- package/dist/punkt-react.es.js +18 -16
- package/dist/punkt-react.umd.js +3 -3
- package/package.json +4 -4
- package/src/components/stepper/Stepper.tsx +9 -2
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
|
+
## [12.9.0](https://github.com/oslokommune/punkt/compare/12.8.2...12.9.0) (2024-11-21)
|
|
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
|
+
## [12.8.1](https://github.com/oslokommune/punkt/compare/12.8.0...12.8.1) (2024-11-18)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
* Inkonsekvent spacing i PktInputWrapper (#2030).
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
Ingen
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [12.6.9](https://github.com/oslokommune/punkt/compare/12.6.8...12.6.9) (2024-11-15)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
package/dist/index.d.ts
CHANGED
|
@@ -362,10 +362,15 @@ declare interface IPktStepper extends default_2.HTMLAttributes<HTMLOListElement>
|
|
|
362
362
|
*/
|
|
363
363
|
className?: string;
|
|
364
364
|
/**
|
|
365
|
-
* Boolean to hide the content of non-active steps
|
|
365
|
+
* Boolean to hide the content of non-active steps content
|
|
366
366
|
* @default true
|
|
367
367
|
*/
|
|
368
368
|
hideNonActiveStepsContent?: boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Boolean to hide the content and title of non-active steps
|
|
371
|
+
* @default false
|
|
372
|
+
*/
|
|
373
|
+
hideNonActiveSteps?: boolean;
|
|
369
374
|
/**
|
|
370
375
|
* Orientation of the stepper.
|
|
371
376
|
* @default vertical
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -1857,7 +1857,7 @@ var Pg = Object.defineProperty, Og = Object.getOwnPropertyDescriptor, wa = (e, t
|
|
|
1857
1857
|
return r && i && Pg(t, n, i), i;
|
|
1858
1858
|
};
|
|
1859
1859
|
window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch;
|
|
1860
|
-
window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.
|
|
1860
|
+
window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.9/icons/";
|
|
1861
1861
|
const Ig = (e) => new Promise((t) => setTimeout(t, e)), di = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', $s = {}, Mg = async (e, t) => {
|
|
1862
1862
|
let n = 0;
|
|
1863
1863
|
for (; $s[t + e + ".svg"] === "fetching" && (n++, !(n > 50)); )
|
|
@@ -5515,7 +5515,7 @@ const Wx = je(
|
|
|
5515
5515
|
{
|
|
5516
5516
|
className: "pkt-btn__icon pkt-btn__spinner",
|
|
5517
5517
|
name: "spinner-blue",
|
|
5518
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
5518
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.9/animations/"
|
|
5519
5519
|
}
|
|
5520
5520
|
),
|
|
5521
5521
|
c !== "label-only" && /* @__PURE__ */ g.jsx(pe, { className: "pkt-btn__icon", name: n }),
|
|
@@ -5774,7 +5774,7 @@ const X2 = zn({
|
|
|
5774
5774
|
name: "oslologo",
|
|
5775
5775
|
className: "pkt-header__logo-svg",
|
|
5776
5776
|
"aria-hidden": "true",
|
|
5777
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
5777
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.9/logos/"
|
|
5778
5778
|
}
|
|
5779
5779
|
) }) : /* @__PURE__ */ g.jsx(
|
|
5780
5780
|
"button",
|
|
@@ -5788,7 +5788,7 @@ const X2 = zn({
|
|
|
5788
5788
|
name: "oslologo",
|
|
5789
5789
|
className: "pkt-header__logo-svg",
|
|
5790
5790
|
"aria-hidden": "true",
|
|
5791
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
5791
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.9/logos/"
|
|
5792
5792
|
}
|
|
5793
5793
|
)
|
|
5794
5794
|
}
|
|
@@ -6057,7 +6057,7 @@ const ny = je(
|
|
|
6057
6057
|
pe,
|
|
6058
6058
|
{
|
|
6059
6059
|
name: b(o),
|
|
6060
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
6060
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.9/animations/",
|
|
6061
6061
|
className: `pkt-loader__svg pkt-loader__${o}`
|
|
6062
6062
|
}
|
|
6063
6063
|
),
|
|
@@ -16009,20 +16009,22 @@ const Kx = je(
|
|
|
16009
16009
|
activeStep: e,
|
|
16010
16010
|
className: t,
|
|
16011
16011
|
children: n,
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
|
|
16012
|
+
hideNonActiveSteps: r = !1,
|
|
16013
|
+
hideNonActiveStepsContent: i = !0,
|
|
16014
|
+
orientation: o = "vertical",
|
|
16015
|
+
...u
|
|
16016
|
+
}, c) => {
|
|
16017
|
+
const d = tt(
|
|
16017
16018
|
t,
|
|
16018
16019
|
"pkt-stepper",
|
|
16019
|
-
|
|
16020
|
-
),
|
|
16021
|
-
className: tt(
|
|
16022
|
-
"pkt-step--
|
|
16020
|
+
o === "horizontal" ? "pkt-stepper--horizontal" : "pkt-stepper--vertical"
|
|
16021
|
+
), h = ye.Children.map(n, (m, v) => ye.isValidElement(m) ? ye.cloneElement(m, {
|
|
16022
|
+
className: tt(m.props.className, {
|
|
16023
|
+
"pkt-step--hideStep": r && v !== e,
|
|
16024
|
+
"pkt-step--hideContent": i && v !== e
|
|
16023
16025
|
})
|
|
16024
|
-
}) :
|
|
16025
|
-
return /* @__PURE__ */ g.jsx("ol", { "data-testid": "pkt-stepper", className:
|
|
16026
|
+
}) : m);
|
|
16027
|
+
return /* @__PURE__ */ g.jsx("ol", { "data-testid": "pkt-stepper", className: d, ref: c, ...u, children: h });
|
|
16026
16028
|
}
|
|
16027
16029
|
), fx = /* @__PURE__ */ g.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: /* @__PURE__ */ g.jsx("circle", { cx: "12", cy: "12", r: "7", style: { fill: "var(--pkt-color-grays-grey-200, #CCC)" } }) }), mx = /* @__PURE__ */ g.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: [
|
|
16028
16030
|
/* @__PURE__ */ g.jsx("circle", { opacity: ".15", cx: "12", cy: "12", r: "12", fill: "#2A2859" }),
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -124,7 +124,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright 2017 Google LLC
|
|
126
126
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
127
|
-
*/class ns extends Oa{}ns.directiveName="unsafeSVG",ns.resultType=2;const jl=Mr(ns);var Rh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hr=(e,t,n,r)=>{for(var i=r>1?void 0:r?qh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.
|
|
127
|
+
*/class ns extends Oa{}ns.directiveName="unsafeSVG",ns.resultType=2;const jl=Mr(ns);var Rh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hr=(e,t,n,r)=>{for(var i=r>1?void 0:r?qh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.9/icons/";const Hh=e=>new Promise(t=>setTimeout(t,e)),Ma='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',rs={},Uh=async(e,t)=>{let n=0;for(;rs[t+e+".svg"]==="fetching"&&(n++,!(n>50));)await Hh(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(rs[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+t+e+".svg"),Ma)).then(r=>(r!==Ma&&localStorage.setItem(t+e+".svg",r),rs[t+e+".svg"]="fetched",r)))):Promise.resolve(Ma)};let Nn=class extends Bt{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=jl(Ma),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,n,r){super.attributeChangedCallback(t,n,r),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=jl(await Uh(this.name||"",this.path).then(n=>n)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return K`${this.name&&this.icon}`}};Hr([O({type:String,reflect:!1})],Nn.prototype,"path",2),Hr([O({type:String,reflect:!0})],Nn.prototype,"name",2),Hr([O({type:SVGElement})],Nn.prototype,"icon",2),Hr([O({type:Array,noAccessor:!0})],Nn.prototype,"_updatedProps",2),Nn=Hr([Ot("pkt-icon")],Nn);const Wh="pkt-alert",Vh=!0,zh={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},Gh={title:{name:"Tittel",description:"Tittelen som vises øverst i på meldingen",type:"string"},skin:{name:"Utseende",description:"Hvordan type melding er dette?",type:["info","success","warning","error"],default:"info"},date:{name:"Sist oppdatert",description:"Dato som vises nederst i på meldingen",type:"string"},ariaLive:{name:"aria-live",description:"Hvordan skal skjermleseren lese opp meldingen?",type:["off","polite","assertive"],default:"polite"},compact:{name:"Kompakt",description:"Gjør meldingen mindre",type:"boolean",default:!1},closeAlert:{name:"Vis 'Lukk'-knapp",description:"Viser 'Lukk'-knappen",type:"boolean",default:!1}},Yh={default:{description:"Innholdet i meldingen"}},Ra={name:Wh,"css-class":"pkt-alert","dark-mode":!0,isElement:Vh,events:zh,props:Gh,slots:Yh};var Kh=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,pn=(e,t,n,r)=>{for(var i=r>1?void 0:r?Jh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Kh(t,n,i),i};let It=class extends Bt{constructor(){super(),this.defaultSlot=vt(),this.compact=Ra.props.compact.default,this.title="",this.skin=Ra.props.skin.default,this.ariaLive=Ra.props.ariaLive.default,this.closeAlert=Ra.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new Tn(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return K`
|
|
128
128
|
<div class=${He(t)} aria-live=${this.ariaLive}>
|
|
129
129
|
<pkt-icon
|
|
130
130
|
class="pkt-alert__icon"
|
|
@@ -547,7 +547,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
547
547
|
Copyright (c) 2018 Jed Watson.
|
|
548
548
|
Licensed under the MIT License (MIT), see
|
|
549
549
|
http://jedwatson.github.io/classnames
|
|
550
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",u=0;u<arguments.length;u++){var c=arguments[u];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var u="";for(var c in o)t.call(o,c)&&o[c]&&(u=i(u,c));return u}function i(o,u){return u?o?o+" "+u:o+u:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Jl);var Xm=Jl.exports;const Xe=Ea(Xm),Qm=M.forwardRef(({title:e,className:t,children:n,toggleProps:r,defaultOpen:i=!1,id:o},u)=>{const[c,d]=M.useState(i),h=r?r.isOpen:c,m=b=>b??void 0,v=(b,k)=>{b.preventDefault(),r!==void 0&&r.onToggleClick(b,k),d(!h)},y=Xe(t,"pkt-accordion-item");return g.jsxs("details",{className:y,ref:u,id:o,open:m(r?r.isOpen:c),children:[g.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${o}`,onClick:b=>v(b,o),children:[e,g.jsx(ce,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),g.jsx("div",{id:`pkt-accordion-item-content-${o}`,role:"region",className:"pkt-accordion-item__content",children:n})]})}),Zm=Sn({tagName:"pkt-alert",elementClass:It,react:M,displayName:"PktAlert",events:{onClose:"close"}}),us=M.forwardRef(({children:e,...t},n)=>g.jsx(Zm,{ref:n,...t,children:g.jsx("div",{className:"pkt-contents",children:e})}));us.displayName="PktAlert";const Xl=M.forwardRef(({href:e,text:t,onClick:n,className:r,...i},o)=>{const u=[r,"pkt-back-link"].filter(Boolean).join(" "),c=d=>{n&&n(d)};return g.jsx("nav",{ref:o,className:u,"aria-label":"Gå tilbake et steg",children:g.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...i,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),g.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});Xl.displayName="PktBackLink";const eg=M.forwardRef(({breadcrumbs:e,navigationType:t,className:n,...r},i)=>{const o=e.slice(0,4),u=o[o.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" ");return g.jsxs("nav",{ref:i,"aria-label":"brødsmulemeny",className:c,children:[g.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((d,h)=>g.jsx("li",{className:"pkt-breadcrumbs__item",children:h===o.length-1?g.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?g.jsxs(xn.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):g.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${h}`))}),t==="router"?g.jsxs(xn.Link,{to:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]}):g.jsxs("a",{href:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]})]})}),In=M.forwardRef(({children:e,className:t,iconName:n="user",secondIconName:r="user",size:i="medium",skin:o="primary",type:u="button",variant:c="label-only",state:d,color:h,isLoading:m=!1,...v},y)=>{const b=[t,"pkt-btn",i&&`pkt-btn--${i}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,h&&`pkt-btn--${h}`,m&&"pkt-btn--active",d&&`pkt-btn--${d}`].filter(Boolean).join(" ");return g.jsxs("button",{...v,className:b,type:u,ref:y,children:[m&&g.jsx(ce,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.8/animations/"}),c!=="label-only"&&g.jsx(ce,{className:"pkt-btn__icon",name:n}),g.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&g.jsx(ce,{className:"pkt-btn__icon",name:r})]})});In.displayName="PktButton";const tg=Sn({tagName:"pkt-card",elementClass:Jt,react:M,displayName:"PktCard",events:{}}),Ql=M.forwardRef(({children:e,...t},n)=>g.jsx(tg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));Ql.displayName="PktCard";const Ua=M.forwardRef(({id:e,hasTile:t=!1,disabled:n=!1,label:r,labelPosition:i="right",hideLabel:o=!1,checkHelptext:u,hasError:c=!1,isSwitch:d=!1,className:h,...m},v)=>{const y=[h,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:y,children:g.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${n&&t?"pkt-input-check__input--tile-disabled":""}`,children:[r&&i==="left"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]}),g.jsx("input",{ref:v,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:d?"switch":"checkbox",id:e,disabled:n,...m}),r&&i==="right"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Ua.displayName="PktCheckbox";const Zl=Sn({tagName:"pkt-datepicker",elementClass:Ie,react:M,displayName:"PktDatepicker",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ng=({columnOne:e,columnTwo:t,socialLinks:n,className:r,personvernOgInfoLink:i="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,d;const u=[r,"pkt-footer"].filter(Boolean).join(" ");return g.jsx("footer",{className:u,"data-mode":"dark",children:g.jsxs("div",{className:"pkt-footer__container",children:[g.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:e.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&g.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:t.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&g.jsx("li",{className:"pkt-footer__text",children:t.text}),(d=t.links)==null?void 0:d.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),g.jsxs("ul",{className:"pkt-footer__list",children:[g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:i,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:o,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),n&&g.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[g.jsx("div",{className:"pkt-footer__social-languages",children:n.filter(h=>h.language).map((h,m)=>g.jsx("div",{className:"pkt-footer__social-language",children:g.jsx("a",{href:h.href,"aria-label":`til ${h.language} versjon av nettsiden`,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:h.language})},`sociallinks-language-${m}`))}),g.jsx("div",{className:"pkt-footer__social-icons",children:n.filter(h=>h.iconName).map((h,m)=>g.jsx(M.Fragment,{children:g.jsx("a",{href:h.href,"aria-label":`til ${h.iconName}`,className:"pkt-footer__social-icon-link",target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:g.jsx(ce,{className:"pkt-footer__social-icon",name:h.iconName})})},`sociallinks-${m}`))})]})]})})},rg=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",className:r})=>{const i=[r,"pkt-footer-simple"].filter(Boolean).join(" ");return g.jsx("footer",{className:i,"data-mode":"dark",children:g.jsx("div",{className:"pkt-footer-simple__container",children:g.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((o,u)=>g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},u)),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:n,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},ag=M.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:i=!0,user:o,userMenu:u,representing:c,userOptions:d,userMenuFooter:h,canChangeRepresentation:m=!0,showMenuButton:v=!1,showLogOutButton:y=!1,openMenu:b,logOut:k,changeRepresentation:x,children:C,...T},F)=>{const S=M.useMemo(()=>typeof(o==null?void 0:o.lastLoggedIn)=="string"?o.lastLoggedIn:o!=null&&o.lastLoggedIn?new Date(o.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[o]),[A,_]=M.useState(!1),[$,P]=M.useState(0),[I,j]=M.useState(!1),V=M.useRef(null);M.useEffect(()=>(document&&(document.addEventListener("mouseup",G),window.addEventListener("scroll",L)),()=>{document&&(document.removeEventListener("mouseup",G),window.removeEventListener("scroll",L))}));const J=()=>{j(!I)},G=N=>{V.current&&!V.current.contains(N.target)&&j(!1)},L=()=>{if(i){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-$)<60)return;_(N>$),P(N)}};return g.jsxs("header",{...T,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xe(e,"pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":i,"pkt-header--hidden":A}),ref:F,children:[g.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?g.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.8/logos/"})}):g.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.8/logos/"})}),g.jsx("span",{className:"pkt-header__logo-service",children:n})]}),g.jsx("nav",{className:"pkt-header__actions",children:g.jsxs("ul",{className:"pkt-header__actions-row",children:[v&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(o||c)&&g.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${I&&!A?"pkt-header--open-dropdown":""}`,ref:V,children:[g.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":I,onClick:J,children:[g.jsx(ce,{name:"user",className:"pkt-btn__icon"}),g.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(o==null?void 0:o.name)}),g.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(o==null?void 0:o.shortname)}),g.jsx(ce,{name:"chevron-thin-down",className:"pkt-btn--closed"}),g.jsx(ce,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),g.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[o&&g.jsxs("li",{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),g.jsx("div",{className:"pkt-user-menu__name",children:o.name}),o.lastLoggedIn&&g.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",g.jsx("time",{children:S})]})]}),u&&g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:u.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${H}`))})}),(c||m)&&g.jsxs("li",{children:[c&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),g.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&g.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),g.jsx("ul",{className:"pkt-list mt-size-16",children:m&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[g.jsx(ce,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:(d||!y)&&g.jsxs(g.Fragment,{children:[d==null?void 0:d.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${H}`)),!y&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:k,children:[g.jsx(ce,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),h&&g.jsx("li",{className:"footer",children:g.jsx("ul",{className:"pkt-list-horizontal bordered",children:h.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsx("a",{href:N.target,className:"pkt-link",children:N.title}):g.jsx("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${H}`))})})]})]}),C&&g.jsx("li",{children:C}),y&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:k,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),eu=M.forwardRef(({label:e,id:t,children:n,...r},i)=>g.jsxs("div",{className:"pkt-form-group",children:[g.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),g.jsx("input",{className:"pkt-form-input",id:t,...r,ref:i}),n]}));eu.displayName="PktInput";const ur=M.forwardRef(({forId:e,label:t,helptext:n,helptextDropdown:r,helptextDropdownButton:i,counter:o,counterCurrent:u,counterMaxLength:c,optionalTag:d=!1,optionalText:h="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",hasError:y,errorMessage:b,disabled:k,inline:x,ariaDescribedby:C,useWrapper:T=!0,children:F,className:S,hasFieldset:A=!1},_)=>{const[$,P]=M.useState(!1),I=()=>{P(!$)},j=()=>d?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":m?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",V=d?h:m?v:"",J=k?"pkt-inputwrapper--disabled":"",G=x?"pkt-inputwrapper--inline":"",L=y?"pkt-inputwrapper--error":"",N=!!r&&r!=="",H=i||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',Q=A?"fieldset":N?"div":"label",fe=A?"legend":N?"h2":"span",Z=C||(n?`${e}-helptext`:void 0);return g.jsxs("div",{className:["pkt-inputwrapper",S,J,G,L].join(" "),ref:_,children:[T?g.jsx(g.Fragment,{children:g.jsxs(Q,{htmlFor:A?void 0:e,"aria-describedby":N?void 0:C,className:`pkt-inputwrapper__label${A?" pkt-inputwrapper__fieldset":""}`,children:[g.jsxs(fe,{id:`${e}-label`,className:`${A?" pkt-inputwrapper__legend":""}`,children:[t,V!==""&&g.jsx("span",{className:j(),children:V})]}),n&&g.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:n}),N&&r!==""&&g.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[g.jsx(In,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:I,children:g.jsx("span",{dangerouslySetInnerHTML:{__html:H}})}),g.jsx("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:r}),!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,children:t})]}),g.jsx(g.Fragment,{children:F}),o&&g.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[u||0,c&&`/${c}`]})]})}):g.jsxs(g.Fragment,{children:[!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,id:`${e}-label`,children:t}),F]}),y&&b&&g.jsx("div",{children:g.jsx(us,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:b})})]})});ur.displayName="PktInputWrapper";const ig=Sn({tagName:"pkt-link",elementClass:hn,react:M,displayName:"PktLink",events:{onClick:"click"}}),tu=M.forwardRef(({children:e,...t},n)=>g.jsx(ig,{...t,ref:n,children:g.jsx("span",{className:"pkt-contents",children:e})}));tu.displayName="PktLink";const nu=M.forwardRef(({children:e,className:t,iconName:n,openInNewTab:r=!1,skin:i="normal",href:o="#",external:u=!1,title:c,...d},h)=>{const m=[t,"pkt-linkcard",i&&`pkt-linkcard--${i}`].filter(Boolean).join(" ");return g.jsxs("a",{...d,href:o,className:`pkt-linkcard pkt-link ${m}`,target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,ref:h,children:[n&&g.jsx(ce,{className:"pkt-link__icon",name:n}),g.jsx("div",{className:`pkt-linkcard__title ${u?"pkt-link pkt-link--external":""}`,children:c}),g.jsx("div",{className:"pkt-linkcard__text",children:e})]})});nu.displayName="PktLinkCard";const ru=M.forwardRef(({className:e,message:t,size:n="medium",inline:r=!1,isLoading:i=!0,variant:o="rainbow",delay:u=0,children:c,...d},h)=>{const m=`pkt-loader pkt-loader--${n}`,[v,y]=M.useState(!(u>0));u>0&&setTimeout(()=>{y(!0)},u);const b=k=>k==="shapes"?"loader":k==="blue"?"spinner-blue":"spinner";return g.jsx("div",{role:"status","aria-live":"polite","aria-busy":i,className:`pkt-loader--${r?"inline":"box"} ${e||""}`,children:i?g.jsx(g.Fragment,{children:v?g.jsxs("div",{className:m,"data-testid":"pkt-loader",ref:h,...d,children:[g.jsx(ce,{name:b(o),path:"https://punkt-cdn.oslo.kommune.no/12.8/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),t&&g.jsx("p",{children:t})]}):null}):c})});ru.displayName="PktLoader";const sg=Sn({tagName:"pkt-messagebox",elementClass:fn,react:M,displayName:"PktMessagebox",events:{onClose:"close"}}),au=M.forwardRef(({children:e,...t},n)=>g.jsx(sg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));au.displayName="PktMessagebox";/*!
|
|
550
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",u=0;u<arguments.length;u++){var c=arguments[u];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var u="";for(var c in o)t.call(o,c)&&o[c]&&(u=i(u,c));return u}function i(o,u){return u?o?o+" "+u:o+u:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Jl);var Xm=Jl.exports;const Xe=Ea(Xm),Qm=M.forwardRef(({title:e,className:t,children:n,toggleProps:r,defaultOpen:i=!1,id:o},u)=>{const[c,d]=M.useState(i),h=r?r.isOpen:c,m=b=>b??void 0,v=(b,k)=>{b.preventDefault(),r!==void 0&&r.onToggleClick(b,k),d(!h)},y=Xe(t,"pkt-accordion-item");return g.jsxs("details",{className:y,ref:u,id:o,open:m(r?r.isOpen:c),children:[g.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${o}`,onClick:b=>v(b,o),children:[e,g.jsx(ce,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),g.jsx("div",{id:`pkt-accordion-item-content-${o}`,role:"region",className:"pkt-accordion-item__content",children:n})]})}),Zm=Sn({tagName:"pkt-alert",elementClass:It,react:M,displayName:"PktAlert",events:{onClose:"close"}}),us=M.forwardRef(({children:e,...t},n)=>g.jsx(Zm,{ref:n,...t,children:g.jsx("div",{className:"pkt-contents",children:e})}));us.displayName="PktAlert";const Xl=M.forwardRef(({href:e,text:t,onClick:n,className:r,...i},o)=>{const u=[r,"pkt-back-link"].filter(Boolean).join(" "),c=d=>{n&&n(d)};return g.jsx("nav",{ref:o,className:u,"aria-label":"Gå tilbake et steg",children:g.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...i,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),g.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});Xl.displayName="PktBackLink";const eg=M.forwardRef(({breadcrumbs:e,navigationType:t,className:n,...r},i)=>{const o=e.slice(0,4),u=o[o.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" ");return g.jsxs("nav",{ref:i,"aria-label":"brødsmulemeny",className:c,children:[g.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((d,h)=>g.jsx("li",{className:"pkt-breadcrumbs__item",children:h===o.length-1?g.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?g.jsxs(xn.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):g.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${h}`))}),t==="router"?g.jsxs(xn.Link,{to:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]}):g.jsxs("a",{href:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]})]})}),In=M.forwardRef(({children:e,className:t,iconName:n="user",secondIconName:r="user",size:i="medium",skin:o="primary",type:u="button",variant:c="label-only",state:d,color:h,isLoading:m=!1,...v},y)=>{const b=[t,"pkt-btn",i&&`pkt-btn--${i}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,h&&`pkt-btn--${h}`,m&&"pkt-btn--active",d&&`pkt-btn--${d}`].filter(Boolean).join(" ");return g.jsxs("button",{...v,className:b,type:u,ref:y,children:[m&&g.jsx(ce,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.9/animations/"}),c!=="label-only"&&g.jsx(ce,{className:"pkt-btn__icon",name:n}),g.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&g.jsx(ce,{className:"pkt-btn__icon",name:r})]})});In.displayName="PktButton";const tg=Sn({tagName:"pkt-card",elementClass:Jt,react:M,displayName:"PktCard",events:{}}),Ql=M.forwardRef(({children:e,...t},n)=>g.jsx(tg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));Ql.displayName="PktCard";const Ua=M.forwardRef(({id:e,hasTile:t=!1,disabled:n=!1,label:r,labelPosition:i="right",hideLabel:o=!1,checkHelptext:u,hasError:c=!1,isSwitch:d=!1,className:h,...m},v)=>{const y=[h,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:y,children:g.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${n&&t?"pkt-input-check__input--tile-disabled":""}`,children:[r&&i==="left"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]}),g.jsx("input",{ref:v,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:d?"switch":"checkbox",id:e,disabled:n,...m}),r&&i==="right"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Ua.displayName="PktCheckbox";const Zl=Sn({tagName:"pkt-datepicker",elementClass:Ie,react:M,displayName:"PktDatepicker",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ng=({columnOne:e,columnTwo:t,socialLinks:n,className:r,personvernOgInfoLink:i="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,d;const u=[r,"pkt-footer"].filter(Boolean).join(" ");return g.jsx("footer",{className:u,"data-mode":"dark",children:g.jsxs("div",{className:"pkt-footer__container",children:[g.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:e.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&g.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:t.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&g.jsx("li",{className:"pkt-footer__text",children:t.text}),(d=t.links)==null?void 0:d.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),g.jsxs("ul",{className:"pkt-footer__list",children:[g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:i,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:o,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),n&&g.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[g.jsx("div",{className:"pkt-footer__social-languages",children:n.filter(h=>h.language).map((h,m)=>g.jsx("div",{className:"pkt-footer__social-language",children:g.jsx("a",{href:h.href,"aria-label":`til ${h.language} versjon av nettsiden`,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:h.language})},`sociallinks-language-${m}`))}),g.jsx("div",{className:"pkt-footer__social-icons",children:n.filter(h=>h.iconName).map((h,m)=>g.jsx(M.Fragment,{children:g.jsx("a",{href:h.href,"aria-label":`til ${h.iconName}`,className:"pkt-footer__social-icon-link",target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:g.jsx(ce,{className:"pkt-footer__social-icon",name:h.iconName})})},`sociallinks-${m}`))})]})]})})},rg=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",className:r})=>{const i=[r,"pkt-footer-simple"].filter(Boolean).join(" ");return g.jsx("footer",{className:i,"data-mode":"dark",children:g.jsx("div",{className:"pkt-footer-simple__container",children:g.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((o,u)=>g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},u)),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:n,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},ag=M.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:i=!0,user:o,userMenu:u,representing:c,userOptions:d,userMenuFooter:h,canChangeRepresentation:m=!0,showMenuButton:v=!1,showLogOutButton:y=!1,openMenu:b,logOut:k,changeRepresentation:x,children:C,...T},F)=>{const S=M.useMemo(()=>typeof(o==null?void 0:o.lastLoggedIn)=="string"?o.lastLoggedIn:o!=null&&o.lastLoggedIn?new Date(o.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[o]),[A,_]=M.useState(!1),[$,P]=M.useState(0),[I,j]=M.useState(!1),V=M.useRef(null);M.useEffect(()=>(document&&(document.addEventListener("mouseup",G),window.addEventListener("scroll",L)),()=>{document&&(document.removeEventListener("mouseup",G),window.removeEventListener("scroll",L))}));const J=()=>{j(!I)},G=N=>{V.current&&!V.current.contains(N.target)&&j(!1)},L=()=>{if(i){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-$)<60)return;_(N>$),P(N)}};return g.jsxs("header",{...T,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xe(e,"pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":i,"pkt-header--hidden":A}),ref:F,children:[g.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?g.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.9/logos/"})}):g.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.9/logos/"})}),g.jsx("span",{className:"pkt-header__logo-service",children:n})]}),g.jsx("nav",{className:"pkt-header__actions",children:g.jsxs("ul",{className:"pkt-header__actions-row",children:[v&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(o||c)&&g.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${I&&!A?"pkt-header--open-dropdown":""}`,ref:V,children:[g.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":I,onClick:J,children:[g.jsx(ce,{name:"user",className:"pkt-btn__icon"}),g.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(o==null?void 0:o.name)}),g.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(o==null?void 0:o.shortname)}),g.jsx(ce,{name:"chevron-thin-down",className:"pkt-btn--closed"}),g.jsx(ce,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),g.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[o&&g.jsxs("li",{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),g.jsx("div",{className:"pkt-user-menu__name",children:o.name}),o.lastLoggedIn&&g.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",g.jsx("time",{children:S})]})]}),u&&g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:u.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${H}`))})}),(c||m)&&g.jsxs("li",{children:[c&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),g.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&g.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),g.jsx("ul",{className:"pkt-list mt-size-16",children:m&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[g.jsx(ce,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:(d||!y)&&g.jsxs(g.Fragment,{children:[d==null?void 0:d.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${H}`)),!y&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:k,children:[g.jsx(ce,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),h&&g.jsx("li",{className:"footer",children:g.jsx("ul",{className:"pkt-list-horizontal bordered",children:h.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsx("a",{href:N.target,className:"pkt-link",children:N.title}):g.jsx("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${H}`))})})]})]}),C&&g.jsx("li",{children:C}),y&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:k,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),eu=M.forwardRef(({label:e,id:t,children:n,...r},i)=>g.jsxs("div",{className:"pkt-form-group",children:[g.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),g.jsx("input",{className:"pkt-form-input",id:t,...r,ref:i}),n]}));eu.displayName="PktInput";const ur=M.forwardRef(({forId:e,label:t,helptext:n,helptextDropdown:r,helptextDropdownButton:i,counter:o,counterCurrent:u,counterMaxLength:c,optionalTag:d=!1,optionalText:h="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",hasError:y,errorMessage:b,disabled:k,inline:x,ariaDescribedby:C,useWrapper:T=!0,children:F,className:S,hasFieldset:A=!1},_)=>{const[$,P]=M.useState(!1),I=()=>{P(!$)},j=()=>d?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":m?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",V=d?h:m?v:"",J=k?"pkt-inputwrapper--disabled":"",G=x?"pkt-inputwrapper--inline":"",L=y?"pkt-inputwrapper--error":"",N=!!r&&r!=="",H=i||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',Q=A?"fieldset":N?"div":"label",fe=A?"legend":N?"h2":"span",Z=C||(n?`${e}-helptext`:void 0);return g.jsxs("div",{className:["pkt-inputwrapper",S,J,G,L].join(" "),ref:_,children:[T?g.jsx(g.Fragment,{children:g.jsxs(Q,{htmlFor:A?void 0:e,"aria-describedby":N?void 0:C,className:`pkt-inputwrapper__label${A?" pkt-inputwrapper__fieldset":""}`,children:[g.jsxs(fe,{id:`${e}-label`,className:`${A?" pkt-inputwrapper__legend":""}`,children:[t,V!==""&&g.jsx("span",{className:j(),children:V})]}),n&&g.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:n}),N&&r!==""&&g.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[g.jsx(In,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:I,children:g.jsx("span",{dangerouslySetInnerHTML:{__html:H}})}),g.jsx("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:r}),!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,children:t})]}),g.jsx(g.Fragment,{children:F}),o&&g.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[u||0,c&&`/${c}`]})]})}):g.jsxs(g.Fragment,{children:[!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,id:`${e}-label`,children:t}),F]}),y&&b&&g.jsx("div",{children:g.jsx(us,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:b})})]})});ur.displayName="PktInputWrapper";const ig=Sn({tagName:"pkt-link",elementClass:hn,react:M,displayName:"PktLink",events:{onClick:"click"}}),tu=M.forwardRef(({children:e,...t},n)=>g.jsx(ig,{...t,ref:n,children:g.jsx("span",{className:"pkt-contents",children:e})}));tu.displayName="PktLink";const nu=M.forwardRef(({children:e,className:t,iconName:n,openInNewTab:r=!1,skin:i="normal",href:o="#",external:u=!1,title:c,...d},h)=>{const m=[t,"pkt-linkcard",i&&`pkt-linkcard--${i}`].filter(Boolean).join(" ");return g.jsxs("a",{...d,href:o,className:`pkt-linkcard pkt-link ${m}`,target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,ref:h,children:[n&&g.jsx(ce,{className:"pkt-link__icon",name:n}),g.jsx("div",{className:`pkt-linkcard__title ${u?"pkt-link pkt-link--external":""}`,children:c}),g.jsx("div",{className:"pkt-linkcard__text",children:e})]})});nu.displayName="PktLinkCard";const ru=M.forwardRef(({className:e,message:t,size:n="medium",inline:r=!1,isLoading:i=!0,variant:o="rainbow",delay:u=0,children:c,...d},h)=>{const m=`pkt-loader pkt-loader--${n}`,[v,y]=M.useState(!(u>0));u>0&&setTimeout(()=>{y(!0)},u);const b=k=>k==="shapes"?"loader":k==="blue"?"spinner-blue":"spinner";return g.jsx("div",{role:"status","aria-live":"polite","aria-busy":i,className:`pkt-loader--${r?"inline":"box"} ${e||""}`,children:i?g.jsx(g.Fragment,{children:v?g.jsxs("div",{className:m,"data-testid":"pkt-loader",ref:h,...d,children:[g.jsx(ce,{name:b(o),path:"https://punkt-cdn.oslo.kommune.no/12.9/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),t&&g.jsx("p",{children:t})]}):null}):c})});ru.displayName="PktLoader";const sg=Sn({tagName:"pkt-messagebox",elementClass:fn,react:M,displayName:"PktMessagebox",events:{onClose:"close"}}),au=M.forwardRef(({children:e,...t},n)=>g.jsx(sg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));au.displayName="PktMessagebox";/*!
|
|
551
551
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
552
552
|
*
|
|
553
553
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
@@ -657,4 +657,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
657
657
|
`)})})]}):g.jsxs(g.Fragment,{children:[g.jsx(Dt,{dataLabel:"Beskrivelse",children:g.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),g.jsx(Dt,{dataLabel:"Type",children:g.jsx("pre",{children:i.type&&t(i.type)})}),g.jsx(Dt,{dataLabel:"Standardverdi",children:g.jsx("pre",{children:n(i.default)})})]})]},r))})]}),e.events&&g.jsxs(g.Fragment,{children:[g.jsx("h2",{children:"Hendelser / handlinger"}),g.jsxs(di,{compact:!0,children:[g.jsx(hi,{children:g.jsxs(Kn,{children:[g.jsx(jt,{children:"Event"}),g.jsx(jt,{children:"Beskrivelse"}),g.jsx(jt,{children:"Type"})]})}),g.jsx(fi,{children:Object.entries(e.events||{}).map(([r,i])=>g.jsxs(Kn,{children:[g.jsx(Dt,{dataLabel:"Event",children:g.jsx("pre",{children:r})}),g.jsx(Dt,{dataLabel:"Beskrivelse",children:g.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),g.jsx(Dt,{dataLabel:"Type",children:i.type})]},r))})]})]}),e.slots&&g.jsxs(g.Fragment,{children:[g.jsx("h2",{children:"Innhold"}),g.jsxs(di,{compact:!0,children:[g.jsx(hi,{children:g.jsxs(Kn,{children:[g.jsx(jt,{children:"Slot"}),g.jsx(jt,{children:"Beskrivelse"})]})}),g.jsx(fi,{children:Object.entries(e.slots||{}).map(([r,i])=>g.jsxs(Kn,{children:[g.jsx(Dt,{dataLabel:"Slot",children:g.jsx("pre",{children:r})}),g.jsx(Dt,{dataLabel:"Beskrivelse",children:g.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})})]},r))})]})]})]})};oa.registerLanguage("jsx",ak);const Lp=({specs:e,children:t,fullWidth:n})=>{var J,G;const r=e.props&&typeof e.props=="object"&&!Array.isArray(e.props)?Object.entries(e.props).reduce((L,[N,H])=>(typeof H=="object"&&!Array.isArray(H)&&H.default!==void 0&&H.default!==null&&(H.default==="false"&&(H.default=!1),H.default==="true"&&(H.default=!0),L[N]=H.default),L),{}):{},[i,o]=M.useState(r),[u,c]=M.useState("light"),[d,h]=M.useState(""),[m,v]=M.useState(""),[y,b]=M.useState(""),[k,x]=M.useState("Rediger innhold"),[C,T]=M.useState([{text:"Rediger",icon:"adjust",active:!0},{text:"Kode (React)",icon:"react",active:!1},{text:`Kode (${e.isElement?"Element":"HTML"})`,icon:"code",active:!1},{text:"Egenskaper",icon:"list",active:!1}]),F=L=>{L===1&&_(),L===2&&(_(),A()),b(""),T(N=>N.map((H,Q)=>({...H,active:Q===L})))},S=M.useRef(null),A=async()=>{if(e.isElement&&M.isValidElement(I))_().then(()=>{const L=M.isValidElement(I)?I.type.displayName||I.type.name:e.name;h(`<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
|
|
658
658
|
`+m.replaceAll(L,e.name||"").replaceAll("={","='").replaceAll(`}
|
|
659
659
|
`,`'
|
|
660
|
-
`).replaceAll(/([a-zA-Z0-9]+)(:)/g,'"$1"$2').replaceAll('"https"',"https").replaceAll("className","class"))});else{const L=await Ws(S.current.innerHTML,{parser:"html",plugins:[hD]});h(L.replace(/<\!--.*?-->/g,""))}},_=async()=>{const L=await Xg(I);return v(L),Promise.resolve()},$=(L,N)=>{navigator.clipboard.writeText(N).then(()=>{b(L),console.log("Copied to clipboard",L)})},P=(L,N)=>g.jsxs("div",{className:"pkt-preview__copy",children:[y===L&&g.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),g.jsx(In,{skin:"tertiary",variant:"icon-only",size:"small",iconName:"copy",onClick:()=>$(L,N),children:"Kopier kode"})]}),I=M.isValidElement(t)&&M.cloneElement(t,{...i},t.props.children?t.props.children:(J=e.slots)!=null&&J.default?k:null),j=(L,N,H=!1)=>{if(!H&&(!N||N=="false")){const{[L]:Q,...fe}=i;o(fe)}else o(Q=>({...Q,[L]:N}))},V=(L,N)=>{if(N.type==="boolean")return g.jsx(ur,{label:N.name||L,forId:L,helptext:N.description||null,hasFieldset:!0,requiredTag:N.required,children:g.jsx(Ua,{id:L,label:L,type:"checkbox",checked:i[L],onChange:H=>j(L,H.target.checked,N.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(N.type==="icon")return g.jsxs(mo,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:H=>j(L,H.target.value),requiredTag:N.required,children:[g.jsx("option",{value:""}),sk.map(H=>g.jsx("option",{value:H.id,children:H.id},H.id))]});if(Array.isArray(N)||Array.isArray(N.type)||Array.isArray(N.values)){const H=Array.isArray(N)?N:N.values||N.type;return g.jsxs(mo,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:Q=>j(L,Q.target.value),requiredTag:N.required,children:[g.jsx("option",{value:""}),H.map(Q=>g.jsx("option",{value:Q,children:Q},Q))]})}else return N.type==="ISOdatestring"?g.jsx(Zl,{id:L,label:N.name||L,helptext:N.description||null,value:i[L],multiple:N.variant==="multiple",maxlength:999,onChange:H=>j(L,H.target.value),requiredTag:N.required}):g.jsx(go,{id:L,label:N.name||L,helptext:N.description||null,type:"text",value:i[L],onChange:H=>j(L,N.type==="number"?parseFloat(H.currentTarget.value):H.currentTarget.value),requiredTag:N.required})};return g.jsxs("div",{className:"pkt-preview",children:[g.jsxs("div",{className:"pkt-preview__component-container","data-mode":u,children:[e["dark-mode"]&&g.jsx("div",{className:"pkt-preview__mode",children:g.jsx(Ua,{id:"mode",label:"Dark mode",type:"checkbox",checked:u==="dark",onChange:L=>c(L.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),g.jsx("div",{className:`pkt-preview__component ${n&&"pkt-preview__component--fullwidth"}`,ref:S,children:g.jsx("div",{children:I})})]}),g.jsx(Pp,{tabs:C,onTabSelected:F}),g.jsxs("div",{className:`pkt-grid pkt-preview__opts ${C[0].active?"":"pkt-hide"}`,children:[((G=e.slots)==null?void 0:G.default)&&!t.props.children&&g.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[g.jsx(kr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),g.jsx(go,{id:"slot",label:"Slot",helptext:e.slots.default.description||"Innholdet i slot",type:"text",value:k,onChange:L=>x(L.currentTarget.value)})]}),e.props&&typeof e.props=="object"&&!Array.isArray(e.props)?Object.entries(e.props).map(([L,N])=>g.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[g.jsx(kr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:L}),V(L,N)]},L)):g.jsx("p",{children:"OBS! Specs mangler props!"})]}),g.jsxs("div",{className:`pkt-preview__code ${C[1].active?"":"pkt-hide"}`,children:[g.jsx(oa,{language:"jsx",style:jp,children:m}),P("jsx",m)]}),g.jsxs("div",{className:`pkt-preview__code ${C[2].active?"":"pkt-hide"}`,children:[g.jsx(oa,{language:"html",style:jp,children:d}),P("html",d)]}),g.jsx("div",{className:`pkt-preview__specs ${C[3].active?"":"pkt-hide"}`,children:g.jsx(ok,{specs:e})})]})};Lp.displayName="PktPreview";for(var Ze=[],vo=0;vo<256;++vo)Ze.push((vo+256).toString(16).slice(1));function lk(e,t=0){return(Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]).toLowerCase()}var mi,uk=new Uint8Array(16);function ck(){if(!mi&&(mi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mi(uk)}var pk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Op={randomUUID:pk};function dk(e,t,n){if(Op.randomUUID&&!t&&!e)return Op.randomUUID();e=e||{};var r=e.random||(e.rng||ck)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,lk(r)}const Ip=M.forwardRef(({valueCurrent:e,valueMin:t=0,valueMax:n=100,skin:r="dark-blue",title:i,titlePosition:o="left",statusType:u="none",statusPlacement:c="following",id:d,ariaLabel:h,ariaLabelledby:m,role:v="progressbar",className:y,ariaValueText:b,...k},x)=>{const C=M.useRef(null),[T,F]=M.useState(0),[S,A]=M.useState(d);M.useEffect(()=>{d||A(dk())},[d]),M.useEffect(()=>{if(C.current){const N=C.current;F(N.getBoundingClientRect().width)}});const _=n-t,$=e/_*100,P=n!==100||t!==0?Math.round($):e,I=`${e} av ${n}`,j=u!=="none",V=Xe("pkt-progressbar__bar",{[`pkt-progressbar__bar--${r}`]:r}),J=Xe("pkt-progressbar__title",{"pkt-progressbar__title-center":o==="center"}),G=Xe("pkt-progressbar__status",{"pkt-progressbar__status--center":c==="center"}),L=Xe({"pkt-progressbar__status-placement--following":c==="following","pkt-progressbar__status-placement--center":c==="center","pkt-progressbar__status-placement--left":c==="left"});return g.jsxs("div",{...k,ref:x,className:Xe("pkt-progressbar__container",y),id:S,style:{"--pkt-progress-label-width":`${T}px`,"--pkt-progress-width":`${P}%`},children:[i&&g.jsx("p",{id:`${S}-title`,className:J,children:i}),g.jsx("div",{role:v,className:"pkt-progressbar__bar-wrapper","aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-labelledby":m||i&&`${S}-title`,"aria-label":h,"aria-valuetext":b,children:g.jsx("div",{className:V})}),j&&g.jsx("div",{className:G,children:g.jsx("span",{className:L,ref:C,children:u==="percentage"?`${P}%`:I})})]})});Ip.displayName="PktProgressbar";const Mp=M.forwardRef(({id:e,name:t,label:n,className:r,hasTile:i=!1,disabled:o=!1,checkHelptext:u,hasError:c=!1,...d},h)=>{const m=[r,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:m,children:g.jsxs("div",{className:`pkt-input-check__input ${i?"pkt-input-check__input--tile":""} ${o&&i?"pkt-input-check__input--tile-disabled":""}`,children:[g.jsx("input",{ref:h,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:t,...d}),g.jsxs("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[n,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Mp.displayName="PktRadioButton";const hk=M.forwardRef(({appearance:e="local",disabled:t=!1,fullwidth:n=!1,id:r,label:i,name:o,placeholder:u="Søk…",suggestions:c,value:d="",action:h,method:m,onChange:v,onSearch:y,onSuggestionClick:b,...k},x)=>{const C=(_,$)=>{_?_():b&&b($)},T=_=>{d=_.target.value},F=`pkt-searchinput pkt-searchinput--${e} ${n?"pkt-searchinput--fullwidth":""}`,S=i?"label":"div";let A;return h?A=_=>g.jsx("form",{role:"search",className:F,action:h,method:m,children:_}):A=_=>g.jsx("div",{role:"search",className:F,children:_}),A(g.jsxs(g.Fragment,{children:[g.jsxs(S,{htmlFor:i?r:void 0,className:i?"pkt-inputwrapper__label":"",children:[i&&g.jsx(g.Fragment,{children:i}),g.jsxs("div",{className:e==="local"?"pkt-input__container":"pkt-searchinput__field",children:[g.jsx("input",{className:`pkt-input ${n?"pkt-input--fullwidth":""}`,type:"search",name:o||r,id:r,placeholder:u,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${r}-suggestions`,onChange:v||T,...k}),g.jsx(In,{className:`pkt-searchinput__button ${e==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:e==="local"?"tertiary":"primary",color:e==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:y&&(_=>{_.preventDefault(),y(d)}),onKeyUp:y&&(_=>{_.key==="Enter"&&(_.preventDefault(),y(d))}),children:i||u})]})]}),c&&g.jsx("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((_,$)=>g.jsx("li",{children:M.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:()=>C(_.onClick,$),onKeyUp:()=>C(_.onClick,$)},g.jsxs(g.Fragment,{children:[_.title&&g.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&g.jsx("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${$}`))})]}))}),fk=M.forwardRef(({activeStep:e,className:t,children:n,hideNonActiveStepsContent:r=!0,orientation:i="vertical",...o},u)=>{const c=Xe(t,"pkt-stepper",i==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),d=M.Children.map(n,(h,m)=>M.isValidElement(h)?M.cloneElement(h,{className:Xe(h.props.className,{"pkt-step--hidden":r&&m!==e})}):h);return g.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:u,...o,children:d})}),mk=g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:g.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),gk=g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[g.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),g.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),vk=g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[g.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),g.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),yk=({children:e,className:t,status:n="incomplete",title:r})=>g.jsxs("li",{className:Xe("pkt-step",t,`pkt-step--${n}`),"data-testid":"pkt-step",children:[g.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),g.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),g.jsx("span",{className:Xe("pkt-step__indicator"),children:n==="current"?gk:n==="completed"?vk:mk}),g.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),g.jsxs("div",{className:"pkt-step__wrapper",children:[g.jsx("div",{className:"pkt-step__title",children:r}),g.jsx("div",{className:"pkt-step__content",children:e})]})]}),Dk=M.forwardRef(({id:e,ariaDescribedby:t,ariaLabelledby:n,counter:r,counterMaxLength:i,className:o,disabled:u,errorMessage:c,hasError:d,helptext:h,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:b=!1,label:k,name:x,optionalTag:C=!1,optionalText:T,requiredTag:F=!1,requiredText:S,placeholder:A,rows:_,useWrapper:$=!0,onChange:P,...I},j)=>{const V=[o,"pkt-textinput","pkt-textarea"].join(" "),J=n||`${e}-label`,G=M.useRef(null),[L,N]=M.useState(0),H=Q=>{var fe,Z;if(r&&N(((Z=(fe=Q.currentTarget)==null?void 0:fe.value)==null?void 0:Z.length)||0),P)return P(Q)};return M.useEffect(()=>{var Q,fe;typeof j=="function"&&j(G.current),r&&N(((fe=(Q=G==null?void 0:G.current)==null?void 0:Q.value)==null?void 0:fe.length)||0)},[j]),g.jsx(ur,{ariaDescribedby:t,className:V,disabled:u,errorMessage:c,forId:e,hasError:d,helptext:h,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:k,optionalTag:C,optionalText:T,requiredTag:F,requiredText:S,useWrapper:$,counter:r,counterCurrent:L,counterMaxLength:i,children:g.jsx("textarea",{ref:G,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${i&&L>i?"pkt-input--counter-error":""}`,name:x||e,id:e,placeholder:A,disabled:u,rows:_,"aria-labelledby":J,"aria-invalid":d,"aria-errormessage":`${e}-error`,...I,onChange:H})})});ee.PktAccordion=rh,ee.PktAccordionItem=Qm,ee.PktAlert=us,ee.PktBackLink=Xl,ee.PktBreadcrumbs=eg,ee.PktButton=In,ee.PktCard=Ql,ee.PktCheckbox=Ua,ee.PktDatepicker=Zl,ee.PktFooter=ng,ee.PktFooterSimple=rg,ee.PktHeader=ag,ee.PktIcon=ce,ee.PktInput=eu,ee.PktInputWrapper=ur,ee.PktLink=tu,ee.PktLinkCard=nu,ee.PktLoader=ru,ee.PktMessagebox=au,ee.PktPreview=Lp,ee.PktProgressbar=Ip,ee.PktRadioButton=Mp,ee.PktSearchInput=hk,ee.PktSelect=mo,ee.PktStep=yk,ee.PktStepper=fk,ee.PktTable=di,ee.PktTableBody=fi,ee.PktTableDataCell=Dt,ee.PktTableHeader=hi,ee.PktTableHeaderCell=jt,ee.PktTableRow=Kn,ee.PktTabs=Pp,ee.PktTag=kr,ee.PktTextarea=Dk,ee.PktTextinput=go,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
|
|
660
|
+
`).replaceAll(/([a-zA-Z0-9]+)(:)/g,'"$1"$2').replaceAll('"https"',"https").replaceAll("className","class"))});else{const L=await Ws(S.current.innerHTML,{parser:"html",plugins:[hD]});h(L.replace(/<\!--.*?-->/g,""))}},_=async()=>{const L=await Xg(I);return v(L),Promise.resolve()},$=(L,N)=>{navigator.clipboard.writeText(N).then(()=>{b(L),console.log("Copied to clipboard",L)})},P=(L,N)=>g.jsxs("div",{className:"pkt-preview__copy",children:[y===L&&g.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),g.jsx(In,{skin:"tertiary",variant:"icon-only",size:"small",iconName:"copy",onClick:()=>$(L,N),children:"Kopier kode"})]}),I=M.isValidElement(t)&&M.cloneElement(t,{...i},t.props.children?t.props.children:(J=e.slots)!=null&&J.default?k:null),j=(L,N,H=!1)=>{if(!H&&(!N||N=="false")){const{[L]:Q,...fe}=i;o(fe)}else o(Q=>({...Q,[L]:N}))},V=(L,N)=>{if(N.type==="boolean")return g.jsx(ur,{label:N.name||L,forId:L,helptext:N.description||null,hasFieldset:!0,requiredTag:N.required,children:g.jsx(Ua,{id:L,label:L,type:"checkbox",checked:i[L],onChange:H=>j(L,H.target.checked,N.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(N.type==="icon")return g.jsxs(mo,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:H=>j(L,H.target.value),requiredTag:N.required,children:[g.jsx("option",{value:""}),sk.map(H=>g.jsx("option",{value:H.id,children:H.id},H.id))]});if(Array.isArray(N)||Array.isArray(N.type)||Array.isArray(N.values)){const H=Array.isArray(N)?N:N.values||N.type;return g.jsxs(mo,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:Q=>j(L,Q.target.value),requiredTag:N.required,children:[g.jsx("option",{value:""}),H.map(Q=>g.jsx("option",{value:Q,children:Q},Q))]})}else return N.type==="ISOdatestring"?g.jsx(Zl,{id:L,label:N.name||L,helptext:N.description||null,value:i[L],multiple:N.variant==="multiple",maxlength:999,onChange:H=>j(L,H.target.value),requiredTag:N.required}):g.jsx(go,{id:L,label:N.name||L,helptext:N.description||null,type:"text",value:i[L],onChange:H=>j(L,N.type==="number"?parseFloat(H.currentTarget.value):H.currentTarget.value),requiredTag:N.required})};return g.jsxs("div",{className:"pkt-preview",children:[g.jsxs("div",{className:"pkt-preview__component-container","data-mode":u,children:[e["dark-mode"]&&g.jsx("div",{className:"pkt-preview__mode",children:g.jsx(Ua,{id:"mode",label:"Dark mode",type:"checkbox",checked:u==="dark",onChange:L=>c(L.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),g.jsx("div",{className:`pkt-preview__component ${n&&"pkt-preview__component--fullwidth"}`,ref:S,children:g.jsx("div",{children:I})})]}),g.jsx(Pp,{tabs:C,onTabSelected:F}),g.jsxs("div",{className:`pkt-grid pkt-preview__opts ${C[0].active?"":"pkt-hide"}`,children:[((G=e.slots)==null?void 0:G.default)&&!t.props.children&&g.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[g.jsx(kr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),g.jsx(go,{id:"slot",label:"Slot",helptext:e.slots.default.description||"Innholdet i slot",type:"text",value:k,onChange:L=>x(L.currentTarget.value)})]}),e.props&&typeof e.props=="object"&&!Array.isArray(e.props)?Object.entries(e.props).map(([L,N])=>g.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[g.jsx(kr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:L}),V(L,N)]},L)):g.jsx("p",{children:"OBS! Specs mangler props!"})]}),g.jsxs("div",{className:`pkt-preview__code ${C[1].active?"":"pkt-hide"}`,children:[g.jsx(oa,{language:"jsx",style:jp,children:m}),P("jsx",m)]}),g.jsxs("div",{className:`pkt-preview__code ${C[2].active?"":"pkt-hide"}`,children:[g.jsx(oa,{language:"html",style:jp,children:d}),P("html",d)]}),g.jsx("div",{className:`pkt-preview__specs ${C[3].active?"":"pkt-hide"}`,children:g.jsx(ok,{specs:e})})]})};Lp.displayName="PktPreview";for(var Ze=[],vo=0;vo<256;++vo)Ze.push((vo+256).toString(16).slice(1));function lk(e,t=0){return(Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]).toLowerCase()}var mi,uk=new Uint8Array(16);function ck(){if(!mi&&(mi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mi(uk)}var pk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Op={randomUUID:pk};function dk(e,t,n){if(Op.randomUUID&&!t&&!e)return Op.randomUUID();e=e||{};var r=e.random||(e.rng||ck)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,lk(r)}const Ip=M.forwardRef(({valueCurrent:e,valueMin:t=0,valueMax:n=100,skin:r="dark-blue",title:i,titlePosition:o="left",statusType:u="none",statusPlacement:c="following",id:d,ariaLabel:h,ariaLabelledby:m,role:v="progressbar",className:y,ariaValueText:b,...k},x)=>{const C=M.useRef(null),[T,F]=M.useState(0),[S,A]=M.useState(d);M.useEffect(()=>{d||A(dk())},[d]),M.useEffect(()=>{if(C.current){const N=C.current;F(N.getBoundingClientRect().width)}});const _=n-t,$=e/_*100,P=n!==100||t!==0?Math.round($):e,I=`${e} av ${n}`,j=u!=="none",V=Xe("pkt-progressbar__bar",{[`pkt-progressbar__bar--${r}`]:r}),J=Xe("pkt-progressbar__title",{"pkt-progressbar__title-center":o==="center"}),G=Xe("pkt-progressbar__status",{"pkt-progressbar__status--center":c==="center"}),L=Xe({"pkt-progressbar__status-placement--following":c==="following","pkt-progressbar__status-placement--center":c==="center","pkt-progressbar__status-placement--left":c==="left"});return g.jsxs("div",{...k,ref:x,className:Xe("pkt-progressbar__container",y),id:S,style:{"--pkt-progress-label-width":`${T}px`,"--pkt-progress-width":`${P}%`},children:[i&&g.jsx("p",{id:`${S}-title`,className:J,children:i}),g.jsx("div",{role:v,className:"pkt-progressbar__bar-wrapper","aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-labelledby":m||i&&`${S}-title`,"aria-label":h,"aria-valuetext":b,children:g.jsx("div",{className:V})}),j&&g.jsx("div",{className:G,children:g.jsx("span",{className:L,ref:C,children:u==="percentage"?`${P}%`:I})})]})});Ip.displayName="PktProgressbar";const Mp=M.forwardRef(({id:e,name:t,label:n,className:r,hasTile:i=!1,disabled:o=!1,checkHelptext:u,hasError:c=!1,...d},h)=>{const m=[r,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:m,children:g.jsxs("div",{className:`pkt-input-check__input ${i?"pkt-input-check__input--tile":""} ${o&&i?"pkt-input-check__input--tile-disabled":""}`,children:[g.jsx("input",{ref:h,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:t,...d}),g.jsxs("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[n,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Mp.displayName="PktRadioButton";const hk=M.forwardRef(({appearance:e="local",disabled:t=!1,fullwidth:n=!1,id:r,label:i,name:o,placeholder:u="Søk…",suggestions:c,value:d="",action:h,method:m,onChange:v,onSearch:y,onSuggestionClick:b,...k},x)=>{const C=(_,$)=>{_?_():b&&b($)},T=_=>{d=_.target.value},F=`pkt-searchinput pkt-searchinput--${e} ${n?"pkt-searchinput--fullwidth":""}`,S=i?"label":"div";let A;return h?A=_=>g.jsx("form",{role:"search",className:F,action:h,method:m,children:_}):A=_=>g.jsx("div",{role:"search",className:F,children:_}),A(g.jsxs(g.Fragment,{children:[g.jsxs(S,{htmlFor:i?r:void 0,className:i?"pkt-inputwrapper__label":"",children:[i&&g.jsx(g.Fragment,{children:i}),g.jsxs("div",{className:e==="local"?"pkt-input__container":"pkt-searchinput__field",children:[g.jsx("input",{className:`pkt-input ${n?"pkt-input--fullwidth":""}`,type:"search",name:o||r,id:r,placeholder:u,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${r}-suggestions`,onChange:v||T,...k}),g.jsx(In,{className:`pkt-searchinput__button ${e==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:e==="local"?"tertiary":"primary",color:e==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:y&&(_=>{_.preventDefault(),y(d)}),onKeyUp:y&&(_=>{_.key==="Enter"&&(_.preventDefault(),y(d))}),children:i||u})]})]}),c&&g.jsx("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((_,$)=>g.jsx("li",{children:M.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:()=>C(_.onClick,$),onKeyUp:()=>C(_.onClick,$)},g.jsxs(g.Fragment,{children:[_.title&&g.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&g.jsx("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${$}`))})]}))}),fk=M.forwardRef(({activeStep:e,className:t,children:n,hideNonActiveSteps:r=!1,hideNonActiveStepsContent:i=!0,orientation:o="vertical",...u},c)=>{const d=Xe(t,"pkt-stepper",o==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),h=M.Children.map(n,(m,v)=>M.isValidElement(m)?M.cloneElement(m,{className:Xe(m.props.className,{"pkt-step--hideStep":r&&v!==e,"pkt-step--hideContent":i&&v!==e})}):m);return g.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:c,...u,children:h})}),mk=g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:g.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),gk=g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[g.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),g.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),vk=g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[g.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),g.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),yk=({children:e,className:t,status:n="incomplete",title:r})=>g.jsxs("li",{className:Xe("pkt-step",t,`pkt-step--${n}`),"data-testid":"pkt-step",children:[g.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),g.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),g.jsx("span",{className:Xe("pkt-step__indicator"),children:n==="current"?gk:n==="completed"?vk:mk}),g.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),g.jsxs("div",{className:"pkt-step__wrapper",children:[g.jsx("div",{className:"pkt-step__title",children:r}),g.jsx("div",{className:"pkt-step__content",children:e})]})]}),Dk=M.forwardRef(({id:e,ariaDescribedby:t,ariaLabelledby:n,counter:r,counterMaxLength:i,className:o,disabled:u,errorMessage:c,hasError:d,helptext:h,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:b=!1,label:k,name:x,optionalTag:C=!1,optionalText:T,requiredTag:F=!1,requiredText:S,placeholder:A,rows:_,useWrapper:$=!0,onChange:P,...I},j)=>{const V=[o,"pkt-textinput","pkt-textarea"].join(" "),J=n||`${e}-label`,G=M.useRef(null),[L,N]=M.useState(0),H=Q=>{var fe,Z;if(r&&N(((Z=(fe=Q.currentTarget)==null?void 0:fe.value)==null?void 0:Z.length)||0),P)return P(Q)};return M.useEffect(()=>{var Q,fe;typeof j=="function"&&j(G.current),r&&N(((fe=(Q=G==null?void 0:G.current)==null?void 0:Q.value)==null?void 0:fe.length)||0)},[j]),g.jsx(ur,{ariaDescribedby:t,className:V,disabled:u,errorMessage:c,forId:e,hasError:d,helptext:h,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:k,optionalTag:C,optionalText:T,requiredTag:F,requiredText:S,useWrapper:$,counter:r,counterCurrent:L,counterMaxLength:i,children:g.jsx("textarea",{ref:G,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${i&&L>i?"pkt-input--counter-error":""}`,name:x||e,id:e,placeholder:A,disabled:u,rows:_,"aria-labelledby":J,"aria-invalid":d,"aria-errormessage":`${e}-error`,...I,onChange:H})})});ee.PktAccordion=rh,ee.PktAccordionItem=Qm,ee.PktAlert=us,ee.PktBackLink=Xl,ee.PktBreadcrumbs=eg,ee.PktButton=In,ee.PktCard=Ql,ee.PktCheckbox=Ua,ee.PktDatepicker=Zl,ee.PktFooter=ng,ee.PktFooterSimple=rg,ee.PktHeader=ag,ee.PktIcon=ce,ee.PktInput=eu,ee.PktInputWrapper=ur,ee.PktLink=tu,ee.PktLinkCard=nu,ee.PktLoader=ru,ee.PktMessagebox=au,ee.PktPreview=Lp,ee.PktProgressbar=Ip,ee.PktRadioButton=Mp,ee.PktSearchInput=hk,ee.PktSelect=mo,ee.PktStep=yk,ee.PktStepper=fk,ee.PktTable=di,ee.PktTableBody=fi,ee.PktTableDataCell=Dt,ee.PktTableHeader=hi,ee.PktTableHeaderCell=jt,ee.PktTableRow=Kn,ee.PktTabs=Pp,ee.PktTag=kr,ee.PktTextarea=Dk,ee.PktTextinput=go,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.9.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",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@oslokommune/punkt-assets": "^12.7.3",
|
|
50
|
-
"@oslokommune/punkt-css": "^12.
|
|
51
|
-
"@oslokommune/punkt-elements": "^12.
|
|
50
|
+
"@oslokommune/punkt-css": "^12.9.0",
|
|
51
|
+
"@oslokommune/punkt-elements": "^12.9.0",
|
|
52
52
|
"@testing-library/jest-dom": "^6.5.0",
|
|
53
53
|
"@testing-library/react": "^16.0.1",
|
|
54
54
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "285ab0b5f51f8dd6d8b4cda6d5902e0bdc52f855"
|
|
115
115
|
}
|
|
@@ -17,10 +17,15 @@ export interface IPktStepper extends React.HTMLAttributes<HTMLOListElement> {
|
|
|
17
17
|
*/
|
|
18
18
|
className?: string
|
|
19
19
|
/**
|
|
20
|
-
* Boolean to hide the content of non-active steps
|
|
20
|
+
* Boolean to hide the content of non-active steps content
|
|
21
21
|
* @default true
|
|
22
22
|
*/
|
|
23
23
|
hideNonActiveStepsContent?: boolean
|
|
24
|
+
/**
|
|
25
|
+
* Boolean to hide the content and title of non-active steps
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hideNonActiveSteps?: boolean
|
|
24
29
|
/**
|
|
25
30
|
* Orientation of the stepper.
|
|
26
31
|
* @default vertical
|
|
@@ -34,6 +39,7 @@ export const PktStepper = forwardRef(
|
|
|
34
39
|
activeStep,
|
|
35
40
|
className,
|
|
36
41
|
children,
|
|
42
|
+
hideNonActiveSteps = false,
|
|
37
43
|
hideNonActiveStepsContent = true,
|
|
38
44
|
orientation = 'vertical',
|
|
39
45
|
|
|
@@ -51,7 +57,8 @@ export const PktStepper = forwardRef(
|
|
|
51
57
|
if (React.isValidElement(child)) {
|
|
52
58
|
return React.cloneElement(child, {
|
|
53
59
|
className: classNames(child.props.className, {
|
|
54
|
-
'pkt-step--
|
|
60
|
+
'pkt-step--hideStep': hideNonActiveSteps && index !== activeStep,
|
|
61
|
+
'pkt-step--hideContent': hideNonActiveStepsContent && index !== activeStep,
|
|
55
62
|
}),
|
|
56
63
|
})
|
|
57
64
|
}
|