@oslokommune/punkt-react 12.3.14 → 12.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [12.3.15](https://github.com/oslokommune/punkt/compare/12.3.14...12.3.15) (2024-10-18)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ * En liten Komponentbygger-endring (#1959).
18
+
19
+
20
+ ### Chores
21
+ Ingen
22
+
23
+ ---
24
+
25
+
8
26
  ## [12.3.14](https://github.com/oslokommune/punkt/compare/12.3.13...12.3.14) (2024-10-15)
9
27
 
10
28
  ### ⚠ BREAKING CHANGES
package/dist/index.d.ts CHANGED
@@ -113,11 +113,11 @@ declare interface IPktCard extends PktElType {
113
113
  subheading?: string;
114
114
  tags?: (Omit<IPktTag, 'closeTag'> & {
115
115
  text: string;
116
- })[];
116
+ })[] | string;
117
117
  image?: {
118
118
  src: string;
119
119
  alt: string;
120
- };
120
+ } | string;
121
121
  }
122
122
 
123
123
  declare interface IPktCheckbox extends default_2.InputHTMLAttributes<HTMLInputElement> {
@@ -2888,7 +2888,7 @@ const lv = "pkt-card", uv = !0, cv = {
2888
2888
  description: "Retningen innholdet skal ligge i forhold til kortet",
2889
2889
  default: "portrait"
2890
2890
  },
2891
- Image: {
2891
+ image: {
2892
2892
  type: "object",
2893
2893
  image: "Image",
2894
2894
  description: "Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",
@@ -15433,7 +15433,10 @@ const Kx = ({ specs: e, children: t, fullWidth: n }) => {
15433
15433
  x().then(() => {
15434
15434
  const L = na(I) ? I.type.displayName || I.type.name : e.name;
15435
15435
  h(
15436
- g.replaceAll(L, e.name || "").replaceAll("{", '"').replaceAll("}", '"')
15436
+ `<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
15437
+ ` + g.replaceAll(L, e.name || "").replaceAll("={", "='").replaceAll(`}
15438
+ `, `'
15439
+ `).replaceAll(/([a-zA-Z0-9]+)(:)/g, '"$1"$2')
15437
15440
  );
15438
15441
  });
15439
15442
  else {
@@ -15444,7 +15447,7 @@ const Kx = ({ specs: e, children: t, fullWidth: n }) => {
15444
15447
  h(L.replace(/<\!--.*?-->/g, ""));
15445
15448
  }
15446
15449
  }, x = async () => {
15447
- const L = ID(I);
15450
+ const L = await ID(I);
15448
15451
  return v(L), Promise.resolve();
15449
15452
  }, $ = (L, N) => {
15450
15453
  navigator.clipboard.writeText(N).then(() => {
@@ -233,7 +233,7 @@ React keys must be passed directly to JSX without using spread:
233
233
  ${this.iconName&&J` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
234
234
  <span ${ot(this.defaultSlot)}> </span>
235
235
  </span>
236
- `}};Yt([O({type:Boolean,reflect:!0})],Pt.prototype,"closeTag",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"size",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"skin",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"textStyle",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"iconName",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"type",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"ariaLabel",2),Yt([Qn()],Pt.prototype,"_isClosed",2),Pt=Yt([Gt("pkt-tag")],Pt);const df="pkt-card",hf=!0,ff={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"string",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag"}},required:["text"]}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},Image:{type:"object",image:"Image",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},mf={default:{description:"Innholdet i kortet"}},Rl={name:df,"css-class":"pkt-card",isElement:hf,props:ff,slots:mf};var gf=Object.defineProperty,vf=Object.getOwnPropertyDescriptor,Tn=(e,t,n,r)=>{for(var i=r>1?void 0:r?vf(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&&gf(t,n,i),i};let Kt=class extends jt{constructor(){super(),this.defaultSlot=_t(),this.skin=Rl.props.skin.default,this.direction=Rl.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new tr(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const t={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return J`
236
+ `}};Yt([O({type:Boolean,reflect:!0})],Pt.prototype,"closeTag",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"size",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"skin",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"textStyle",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"iconName",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"type",2),Yt([O({type:String,reflect:!0})],Pt.prototype,"ariaLabel",2),Yt([Qn()],Pt.prototype,"_isClosed",2),Pt=Yt([Gt("pkt-tag")],Pt);const df="pkt-card",hf=!0,ff={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"string",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag"}},required:["text"]}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},image:{type:"object",image:"Image",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},mf={default:{description:"Innholdet i kortet"}},Rl={name:df,"css-class":"pkt-card",isElement:hf,props:ff,slots:mf};var gf=Object.defineProperty,vf=Object.getOwnPropertyDescriptor,Tn=(e,t,n,r)=>{for(var i=r>1?void 0:r?vf(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&&gf(t,n,i),i};let Kt=class extends jt{constructor(){super(),this.defaultSlot=_t(),this.skin=Rl.props.skin.default,this.direction=Rl.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new tr(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const t={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return J`
237
237
  <div class=${Ge(t)}>
238
238
  ${this.image.src&&J`
239
239
  <div class="pkt-card__image">
@@ -608,4 +608,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
608
608
  * @public
609
609
  */var n=function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,u={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function F(S){return S instanceof d?new d(S.type,F(S.content),S.alias):Array.isArray(S)?S.map(F):S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(F){return Object.prototype.toString.call(F).slice(8,-1)},objId:function(F){return F.__id||Object.defineProperty(F,"__id",{value:++o}),F.__id},clone:function F(S,A){A=A||{};var _,$;switch(c.util.type(S)){case"Object":if($=c.util.objId(S),A[$])return A[$];_={},A[$]=_;for(var P in S)S.hasOwnProperty(P)&&(_[P]=F(S[P],A));return _;case"Array":return $=c.util.objId(S),A[$]?A[$]:(_=[],A[$]=_,S.forEach(function(I,j){_[j]=F(I,A)}),_);default:return S}},getLanguage:function(F){for(;F;){var S=i.exec(F.className);if(S)return S[1].toLowerCase();F=F.parentElement}return"none"},setLanguage:function(F,S){F.className=F.className.replace(RegExp(i,"gi"),""),F.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(_){var F=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(_.stack)||[])[1];if(F){var S=document.getElementsByTagName("script");for(var A in S)if(S[A].src==F)return S[A]}return null}},isActive:function(F,S,A){for(var _="no-"+S;F;){var $=F.classList;if($.contains(S))return!0;if($.contains(_))return!1;F=F.parentElement}return!!A}},languages:{plain:u,plaintext:u,text:u,txt:u,extend:function(F,S){var A=c.util.clone(c.languages[F]);for(var _ in S)A[_]=S[_];return A},insertBefore:function(F,S,A,_){_=_||c.languages;var $=_[F],P={};for(var I in $)if($.hasOwnProperty(I)){if(I==S)for(var j in A)A.hasOwnProperty(j)&&(P[j]=A[j]);A.hasOwnProperty(I)||(P[I]=$[I])}var z=_[F];return _[F]=P,c.languages.DFS(c.languages,function(K,G){G===z&&K!=F&&(this[K]=P)}),P},DFS:function F(S,A,_,$){$=$||{};var P=c.util.objId;for(var I in S)if(S.hasOwnProperty(I)){A.call(S,I,S[I],_||I);var j=S[I],z=c.util.type(j);z==="Object"&&!$[P(j)]?($[P(j)]=!0,F(j,A,null,$)):z==="Array"&&!$[P(j)]&&($[P(j)]=!0,F(j,A,I,$))}}},plugins:{},highlightAll:function(F,S){c.highlightAllUnder(document,F,S)},highlightAllUnder:function(F,S,A){var _={callback:A,container:F,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",_),_.elements=Array.prototype.slice.apply(_.container.querySelectorAll(_.selector)),c.hooks.run("before-all-elements-highlight",_);for(var $=0,P;P=_.elements[$++];)c.highlightElement(P,S===!0,_.callback)},highlightElement:function(F,S,A){var _=c.util.getLanguage(F),$=c.languages[_];c.util.setLanguage(F,_);var P=F.parentElement;P&&P.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(P,_);var I=F.textContent,j={element:F,language:_,grammar:$,code:I};function z(G){j.highlightedCode=G,c.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,c.hooks.run("after-highlight",j),c.hooks.run("complete",j),A&&A.call(j.element)}if(c.hooks.run("before-sanity-check",j),P=j.element.parentElement,P&&P.nodeName.toLowerCase()==="pre"&&!P.hasAttribute("tabindex")&&P.setAttribute("tabindex","0"),!j.code){c.hooks.run("complete",j),A&&A.call(j.element);return}if(c.hooks.run("before-highlight",j),!j.grammar){z(c.util.encode(j.code));return}if(S&&r.Worker){var K=new Worker(c.filename);K.onmessage=function(G){z(G.data)},K.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else z(c.highlight(j.code,j.grammar,j.language))},highlight:function(F,S,A){var _={code:F,grammar:S,language:A};if(c.hooks.run("before-tokenize",_),!_.grammar)throw new Error('The language "'+_.language+'" has no grammar.');return _.tokens=c.tokenize(_.code,_.grammar),c.hooks.run("after-tokenize",_),d.stringify(c.util.encode(_.tokens),_.language)},tokenize:function(F,S){var A=S.rest;if(A){for(var _ in A)S[_]=A[_];delete S.rest}var $=new v;return D($,$.head,F),g(F,$,S,$.head,0),k($)},hooks:{all:{},add:function(F,S){var A=c.hooks.all;A[F]=A[F]||[],A[F].push(S)},run:function(F,S){var A=c.hooks.all[F];if(!(!A||!A.length))for(var _=0,$;$=A[_++];)$(S)}},Token:d};r.Prism=c;function d(F,S,A,_){this.type=F,this.content=S,this.alias=A,this.length=(_||"").length|0}d.stringify=function F(S,A){if(typeof S=="string")return S;if(Array.isArray(S)){var _="";return S.forEach(function(z){_+=F(z,A)}),_}var $={type:S.type,content:F(S.content,A),tag:"span",classes:["token",S.type],attributes:{},language:A},P=S.alias;P&&(Array.isArray(P)?Array.prototype.push.apply($.classes,P):$.classes.push(P)),c.hooks.run("wrap",$);var I="";for(var j in $.attributes)I+=" "+j+'="'+($.attributes[j]||"").replace(/"/g,"&quot;")+'"';return"<"+$.tag+' class="'+$.classes.join(" ")+'"'+I+">"+$.content+"</"+$.tag+">"};function h(F,S,A,_){F.lastIndex=S;var $=F.exec(A);if($&&_&&$[1]){var P=$[1].length;$.index+=P,$[0]=$[0].slice(P)}return $}function g(F,S,A,_,$,P){for(var I in A)if(!(!A.hasOwnProperty(I)||!A[I])){var j=A[I];j=Array.isArray(j)?j:[j];for(var z=0;z<j.length;++z){if(P&&P.cause==I+","+z)return;var K=j[z],G=K.inside,L=!!K.lookbehind,N=!!K.greedy,H=K.alias;if(N&&!K.pattern.global){var Q=K.pattern.toString().match(/[imsuy]*$/)[0];K.pattern=RegExp(K.pattern.source,Q+"g")}for(var fe=K.pattern||K,ee=_.next,ue=$;ee!==S.tail&&!(P&&ue>=P.reach);ue+=ee.value.length,ee=ee.next){var me=ee.value;if(S.length>F.length)return;if(!(me instanceof d)){var ie=1,De;if(N){if(De=h(fe,ue,F,L),!De||De.index>=F.length)break;var Oe=De.index,rt=De.index+De[0].length,Ne=ue;for(Ne+=ee.value.length;Oe>=Ne;)ee=ee.next,Ne+=ee.value.length;if(Ne-=ee.value.length,ue=Ne,ee.value instanceof d)continue;for(var Fe=ee;Fe!==S.tail&&(Ne<rt||typeof Fe.value=="string");Fe=Fe.next)ie++,Ne+=Fe.value.length;ie--,me=F.slice(ue,Ne),De.index-=ue}else if(De=h(fe,0,me,L),!De)continue;var Oe=De.index,de=De[0],ft=me.slice(0,Oe),Ht=me.slice(Oe+de.length),yt=ue+me.length;P&&yt>P.reach&&(P.reach=yt);var bt=ee.prev;ft&&(bt=D(S,bt,ft),ue+=ft.length),b(S,bt,ie);var Dn=new d(I,G?c.tokenize(de,G):de,H,de);if(ee=D(S,bt,Dn),Ht&&D(S,ee,Ht),ie>1){var kt={cause:I+","+z,reach:yt};g(F,S,A,ee.prev,ue,kt),P&&kt.reach>P.reach&&(P.reach=kt.reach)}}}}}}function v(){var F={value:null,prev:null,next:null},S={value:null,prev:F,next:null};F.next=S,this.head=F,this.tail=S,this.length=0}function D(F,S,A){var _=S.next,$={value:A,prev:S,next:_};return S.next=$,_.prev=$,F.length++,$}function b(F,S,A){for(var _=S.next,$=0;$<A&&_!==F.tail;$++)_=_.next;S.next=_,_.prev=S,F.length-=$}function k(F){for(var S=[],A=F.head.next;A!==F.tail;)S.push(A.value),A=A.next;return S}if(!r.document)return r.addEventListener&&(c.disableWorkerMessageHandler||r.addEventListener("message",function(F){var S=JSON.parse(F.data),A=S.language,_=S.code,$=S.immediateClose;r.postMessage(c.highlight(_,c.languages[A],A)),$&&r.close()},!1)),c;var x=c.util.currentScript();x&&(c.filename=x.src,x.hasAttribute("data-manual")&&(c.manual=!0));function C(){c.manual||c.highlightAll()}if(!c.manual){var T=document.readyState;T==="loading"||T==="interactive"&&x&&x.defer?document.addEventListener("DOMContentLoaded",C):window.requestAnimationFrame?window.requestAnimationFrame(C):window.setTimeout(C,16)}return c}(t);e.exports&&(e.exports=n),typeof un<"u"&&(un.Prism=n)})(Ap);var Cb=Ap.exports,_b=io;io.displayName="markup",io.aliases=["html","mathml","svg","xml","ssml","atom","rss"];function io(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&amp;/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var i={};i["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};o["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:o},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var xb=so;so.displayName="css",so.aliases=[];function so(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}var Sb=oo;oo.displayName="clike",oo.aliases=[];function oo(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Eb=lo;lo.displayName="javascript",lo.aliases=["js"];function lo(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var na=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof un=="object"?un:{},Fb=Wb();na.Prism={manual:!0,disableWorkerMessageHandler:!0};var Ab=H0,$b=sb,$p=Cb,Tb=_b,Bb=xb,Nb=Sb,jb=Eb;Fb();var uo={}.hasOwnProperty;function Tp(){}Tp.prototype=$p;var Me=new Tp,Pb=Me;Me.highlight=Ob,Me.register=ra,Me.alias=Lb,Me.registered=Ib,Me.listLanguages=Mb,ra(Tb),ra(Bb),ra(Nb),ra(jb),Me.util.encode=Hb,Me.Token.stringify=Rb;function ra(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Me.languages[e.displayName]===void 0&&e(Me)}function Lb(e,t){var n=Me.languages,r=e,i,o,u,c;t&&(r={},r[e]=t);for(i in r)for(o=r[i],o=typeof o=="string"?[o]:o,u=o.length,c=-1;++c<u;)n[o[c]]=n[i]}function Ob(e,t){var n=$p.highlight,r;if(typeof e!="string")throw new Error("Expected `string` for `value`, got `"+e+"`");if(Me.util.type(t)==="Object")r=t,t=null;else{if(typeof t!="string")throw new Error("Expected `string` for `name`, got `"+t+"`");if(uo.call(Me.languages,t))r=Me.languages[t];else throw new Error("Unknown language: `"+t+"` is not registered")}return n.call(this,e,r,t)}function Ib(e){if(typeof e!="string")throw new Error("Expected `string` for `language`, got `"+e+"`");return uo.call(Me.languages,e)}function Mb(){var e=Me.languages,t=[],n;for(n in e)uo.call(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Rb(e,t,n){var r;return typeof e=="string"?{type:"text",value:e}:Me.util.type(e)==="Array"?qb(e,t):(r={type:e.type,content:Me.Token.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n},e.alias&&(r.classes=r.classes.concat(e.alias)),Me.hooks.run("wrap",r),Ab(r.tag+"."+r.classes.join("."),Ub(r.attributes),r.content))}function qb(e,t){for(var n=[],r=e.length,i=-1,o;++i<r;)o=e[i],o!==""&&o!==null&&o!==void 0&&n.push(o);for(i=-1,r=n.length;++i<r;)o=n[i],n[i]=Me.Token.stringify(o,t,n);return n}function Hb(e){return e}function Ub(e){var t;for(t in e)e[t]=$b(e[t]);return e}function Wb(){var e="Prism"in na,t=e?na.Prism:void 0;return n;function n(){e?na.Prism=t:delete na.Prism,e=void 0,t=void 0}}const co=_a(Pb);var aa=_y(co,{});aa.registerLanguage=function(e,t){return co.register(t)},aa.alias=function(e,t){return co.alias(e,t)};const Bp={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var zb=po;po.displayName="jsx",po.aliases=[];function po(e){(function(t){var n=t.util.clone(t.languages.javascript),r=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,i=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function u(h,g){return h=h.replace(/<S>/g,function(){return r}).replace(/<BRACES>/g,function(){return i}).replace(/<SPREAD>/g,function(){return o}),RegExp(h,g)}o=u(o).source,t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=u(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=n.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:u(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:u(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var c=function(h){return h?typeof h=="string"?h:typeof h.content=="string"?h.content:h.content.map(c).join(""):""},d=function(h){for(var g=[],v=0;v<h.length;v++){var D=h[v],b=!1;if(typeof D!="string"&&(D.type==="tag"&&D.content[0]&&D.content[0].type==="tag"?D.content[0].content[0].content==="</"?g.length>0&&g[g.length-1].tagName===c(D.content[0].content[1])&&g.pop():D.content[D.content.length-1].content==="/>"||g.push({tagName:c(D.content[0].content[1]),openedBraces:0}):g.length>0&&D.type==="punctuation"&&D.content==="{"?g[g.length-1].openedBraces++:g.length>0&&g[g.length-1].openedBraces>0&&D.type==="punctuation"&&D.content==="}"?g[g.length-1].openedBraces--:b=!0),(b||typeof D=="string")&&g.length>0&&g[g.length-1].openedBraces===0){var k=c(D);v<h.length-1&&(typeof h[v+1]=="string"||h[v+1].type==="plain-text")&&(k+=c(h[v+1]),h.splice(v+1,1)),v>0&&(typeof h[v-1]=="string"||h[v-1].type==="plain-text")&&(k=c(h[v-1])+k,h.splice(v-1,1),v--),h[v]=new t.Token("plain-text",k,null,k)}D.content&&typeof D.content!="string"&&d(D.content)}};t.hooks.add("after-tokenize",function(h){h.language!=="jsx"&&h.language!=="tsx"||d(h.tokens)})})(e)}const Vb=_a(zb),ho=M.forwardRef(({ariaDescribedby:e,ariaLabelledby:t,children:n,className:r,disabled:i=!1,errorMessage:o,hasError:u,helptext:c,helptextDropdown:d,helptextDropdownButton:h,id:g,inline:v=!1,fullwidth:D=!1,label:b,name:k,optionalTag:x=!1,optionalText:C,requiredTag:T=!1,requiredText:F,...S},A)=>{const _=[r,"pkt-select"].join(" ");return m.jsx(sr,{className:_,forId:g,label:b,helptext:c,helptextDropdown:d,helptextDropdownButton:h,optionalTag:x,optionalText:C,requiredTag:T,requiredText:F,hasError:u,errorMessage:o,disabled:i,inline:v,ariaDescribedby:e,children:m.jsx("select",{ref:A,className:`pkt-input ${D?"pkt-input--fullwidth":""}`,"aria-invalid":u,"aria-errormessage":`${g}-error`,"aria-labelledby":t||`${g}-label`,disabled:i,id:g,name:k||g,...S,children:n})})}),Dr=M.forwardRef(({children:e,className:t,skin:n="blue",textStyle:r="normal-text",size:i="medium",closeTag:o=!1,iconName:u="",type:c="button",ariaLabel:d="close",onClick:h=()=>{}},g)=>{const[v,D]=M.useState(!1),b=T=>{D(!0),h(T)},k=["pkt-tag",i&&`pkt-tag--${i}`,n&&`pkt-tag--${n}`,r&&`pkt-tag--${r}`,t].filter(Boolean).join(" "),x=["pkt-tag","pkt-btn","pkt-btn--tertiary",i&&`pkt-tag--${i}`,n&&`pkt-tag--${n}`,r&&`pkt-tag--${r}`,u&&o?"pkt-btn--icons-right-and-left":null,o&&!u?"pkt-btn--icon-right":null,t].filter(Boolean).join(" "),C=!v;return o&&u?m.jsx(m.Fragment,{children:C&&m.jsxs("button",{className:x,type:c,"aria-label":d,onClick:b,ref:g,children:[m.jsx(ne,{className:"pkt-tag__icon",name:u}),e,m.jsx(ne,{className:"pkt-tag__close-btn",name:"close"})]})}):o?m.jsx(m.Fragment,{children:C&&m.jsxs("button",{className:x,type:c,"aria-label":d,onClick:b,ref:g,children:[m.jsx(ne,{className:"pkt-tag__close-btn",name:"close"}),e]})}):u?m.jsxs("span",{className:k,children:[m.jsx(ne,{className:"pkt-tag__icon",name:u}),e]}):m.jsx("span",{className:k,children:e})});Dr.displayName="PktTag";const Np=M.forwardRef(({arrowNav:e=!0,tabs:t,onTabSelected:n},r)=>{const i=M.useRef([]);M.useEffect(()=>{i.current=i.current.slice(0,t.length)},[t]);const o=(c,d)=>{d.action&&d.action(c),n&&n(c)},u=(c,d)=>{var h,g;e&&(d.code==="ArrowLeft"&&c!==0&&((h=i.current[c-1])==null||h.focus()),d.code==="ArrowRight"&&c<t.length-1&&((g=i.current[c+1])==null||g.focus()),(d.code==="ArrowDown"||d.code==="Space")&&o(c,t[c]))};return m.jsx("div",{className:"pkt-tabs",ref:r,children:m.jsx("div",{className:"pkt-tabs__list",role:e?"tablist":"navigation",children:t.map((c,d)=>m.jsx(M.Fragment,{children:c.href?m.jsxs("a",{"aria-selected":!!c.active,role:e?"tab":void 0,href:c.href,"aria-controls":c.controls,className:`pkt-tabs__link ${c.active?"active":""}`,onKeyUp:h=>u(d,h),onClick:()=>o(d,c),tabIndex:c.active||!e?void 0:-1,ref:h=>{i.current[d]=h},children:[c.icon&&m.jsx(ne,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&m.jsx(Dr,{skin:c.tag.skin,size:"small",children:c.tag.text})]}):m.jsxs("button",{"aria-selected":!!c.active,role:e?"tab":void 0,type:"button","aria-controls":c.controls,className:`pkt-tabs__button pkt-link-button ${c.active?"active":""}`,onKeyUp:h=>u(d,h),onClick:()=>o(d,c),tabIndex:c.active||!e?void 0:-1,ref:h=>{i.current[d]=h},children:[c.icon&&m.jsx(ne,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&m.jsx(Dr,{skin:c.tag.skin,size:"small",children:c.tag.text})]},"b-"+d)},d))})})}),fo=M.forwardRef(({id:e,ariaDescribedby:t,ariaLabelledby:n,autocomplete:r="off",counter:i,counterMaxLength:o,className:u,disabled:c=!1,errorMessage:d,hasError:h=!1,helptext:g,helptextDropdown:v,helptextDropdownButton:D,iconNameRight:b,inline:k=!1,fullwidth:x=!1,label:C,name:T,optionalTag:F=!1,optionalText:S,requiredTag:A=!1,requiredText:_,placeholder:$,prefix:P,suffix:I,type:j="text",useWrapper:z=!0,omitSearchIcon:K=!1,value:G,onChange:L,...N},H)=>{const Q=[u,"pkt-textinput"].join(" "),fe=n||`${e}-label`,ee=j==="search"&&!b&&!K;M.useRef(null);const[ue,me]=M.useState(0),ie=De=>{var rt,Ne;if(i&&me(((Ne=(rt=De.currentTarget)==null?void 0:rt.value)==null?void 0:Ne.length)||0),L)return L(De)};return m.jsx(sr,{ariaDescribedby:t,className:Q,disabled:c,errorMessage:d,forId:e,hasError:h,helptext:g,helptextDropdown:v,helptextDropdownButton:D,inline:k,label:C,optionalTag:F,optionalText:S,requiredTag:A,requiredText:_,useWrapper:z,counter:i,counterCurrent:ue,counterMaxLength:o,children:m.jsxs("div",{className:"pkt-input__container",children:[P&&m.jsx("div",{className:"pkt-input-prefix",children:P}),m.jsx("input",{ref:H,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${o&&ue>o?"pkt-input--counter-error":""}`,type:j,name:T||e,id:e,placeholder:$,autoComplete:r,value:G,disabled:c,"aria-invalid":h,"aria-errormessage":`${e}-error`,"aria-labelledby":fe,...N,onChange:ie}),I&&m.jsxs("p",{className:"pkt-input-suffix",children:[I,b&&m.jsx(ne,{className:"pkt-input-suffix-icon",name:b}),ee&&m.jsx(ne,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!I&&b&&m.jsx(ne,{className:"pkt-input-icon",name:b}),!I&&ee&&m.jsx(ne,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Gb=[{id:"24h",fn:"24h.svg",cat:"services"},{id:"active-person",fn:"active-person.svg",cat:"people-and-health"},{id:"adjust",fn:"adjust.svg",cat:"ui"},{id:"alert-circle",fn:"alert-circle.svg",cat:"ui"},{id:"alert-error",fn:"alert-error.svg",cat:"ui"},{id:"alert-information",fn:"alert-information.svg",cat:"ui"},{id:"alert-success",fn:"alert-success.svg",cat:"ui"},{id:"alert-warning",fn:"alert-warning.svg",cat:"ui"},{id:"apple",fn:"apple.svg",cat:"ui"},{id:"archive",fn:"archive.svg",cat:"ui"},{id:"arrow-circle",fn:"arrow-circle.svg",cat:"ui"},{id:"arrow",fn:"arrow.svg",cat:"arrows"},{id:"attachment",fn:"attachment.svg",cat:"ui"},{id:"backpack",fn:"backpack.svg",cat:"services"},{id:"balloons",fn:"balloons.svg",cat:"ui"},{id:"books",fn:"books.svg",cat:"services"},{id:"wardrobe-boys",fn:"wardrobe-boys.svg",cat:"sign"},{id:"brain-heart",fn:"brain-heart.svg",cat:"people-and-health"},{id:"brain-signal",fn:"brain-signal.svg",cat:"people-and-health"},{id:"briefcase",fn:"briefcase.svg",cat:"sign"},{id:"bullseye",fn:"bullseye.svg",cat:"ui"},{id:"bus",fn:"bus.svg",cat:"services"},{id:"cafe",fn:"cafe.svg",cat:"sign"},{id:"calendar",fn:"calendar.svg",cat:"ui"},{id:"camera",fn:"camera.svg",cat:"ui"},{id:"car",fn:"car.svg",cat:"sign"},{id:"character-exclamation-mark",fn:"character-exclamation-mark.svg",cat:"ui"},{id:"character-information",fn:"character-information.svg",cat:"ui"},{id:"care-room",fn:"care-room.svg",cat:"sign"},{id:"check-big",fn:"check-big.svg",cat:"ui"},{id:"check-circle",fn:"check-circle.svg",cat:"ui"},{id:"check-medium",fn:"check-medium.svg",cat:"ui"},{id:"check",fn:"check.svg",cat:"ui"},{id:"chevron-down",fn:"chevron-down.svg",cat:"arrows"},{id:"chevron-left",fn:"chevron-left.svg",cat:"arrows"},{id:"chevron-right",fn:"chevron-right.svg",cat:"arrows"},{id:"chevron-thin-down",fn:"chevron-thin-down.svg",cat:"arrows"},{id:"chevron-thin-left",fn:"chevron-thin-left.svg",cat:"arrows"},{id:"chevron-thin-right",fn:"chevron-thin-right.svg",cat:"arrows"},{id:"chevron-thin-up",fn:"chevron-thin-up.svg",cat:"arrows"},{id:"chevron-up-and-down",fn:"chevron-up-and-down.svg",cat:"ui"},{id:"chevron-up",fn:"chevron-up.svg",cat:"arrows"},{id:"clock",fn:"clock.svg",cat:"ui"},{id:"close",fn:"close.svg",cat:"ui"},{id:"cloud",fn:"cloud.svg",cat:"ui"},{id:"code",fn:"code.svg",cat:"ui"},{id:"coffee",fn:"coffee.svg",cat:"sign"},{id:"cogwheel",fn:"cogwheel.svg",cat:"ui"},{id:"coin-stacks",fn:"coin-stacks.svg",cat:"services"},{id:"computer",fn:"computer.svg",cat:"ui"},{id:"copy",fn:"copy.svg",cat:"ui"},{id:"crane",fn:"crane.svg",cat:"services"},{id:"cross-circle-big",fn:"cross-circle-big.svg",cat:"ui"},{id:"cross-circle-fill",fn:"cross-circle-fill.svg",cat:"ui"},{id:"cross-circle",fn:"cross-circle.svg",cat:"ui"},{id:"cross",fn:"cross.svg",cat:"ui"},{id:"data",fn:"data.svg",cat:"ui"},{id:"defibrillators",fn:"defibrillators.svg",cat:"sign"},{id:"district",fn:"district.svg",cat:"ui"},{id:"document-code",fn:"document-code.svg",cat:"ui"},{id:"document-pdf",fn:"document-pdf.svg",cat:"ui"},{id:"document-plain",fn:"document-plain.svg",cat:"ui"},{id:"document-table",fn:"document-table.svg",cat:"ui"},{id:"document-text",fn:"document-text.svg",cat:"ui"},{id:"download",fn:"download.svg",cat:"ui"},{id:"drag",fn:"drag.svg",cat:"ui"},{id:"drinking-area-refreshments",fn:"drinking-area-refreshments.svg",cat:"sign"},{id:"ecg-heart",fn:"ecg-heart.svg",cat:"people-and-health"},{id:"edit",fn:"edit.svg",cat:"ui"},{id:"email",fn:"email.svg",cat:"ui"},{id:"exclamation-mark-circle",fn:"exclamation-mark-circle.svg",cat:"ui"},{id:"exclamation-mark-square",fn:"exclamation-mark-square.svg",cat:"ui"},{id:"exit",fn:"exit.svg",cat:"ui"},{id:"expand",fn:"expand.svg",cat:"ui"},{id:"eye",fn:"eye.svg",cat:"ui"},{id:"face-almost-happy",fn:"face-almost-happy.svg",cat:"feedback"},{id:"face-almost-sad",fn:"face-almost-sad.svg",cat:"feedback"},{id:"face-happy",fn:"face-happy.svg",cat:"feedback"},{id:"face-neutral",fn:"face-neutral.svg",cat:"feedback"},{id:"face-sad",fn:"face-sad.svg",cat:"feedback"},{id:"facebook",fn:"facebook.svg",cat:"social"},{id:"factory-fill",fn:"factory-fill.svg",cat:"ui"},{id:"feedback",fn:"feedback.svg",cat:"ui"},{id:"figma",fn:"figma.svg",cat:"social"},{id:"filter",fn:"filter.svg",cat:"ui"},{id:"fire-emblem",fn:"fire-emblem.svg",cat:"services"},{id:"fire-safety",fn:"fire-safety.svg",cat:"people-and-health"},{id:"folder",fn:"folder.svg",cat:"ui"},{id:"game-console",fn:"game-console.svg",cat:"ui"},{id:"github",fn:"github.svg",cat:"social"},{id:"wardrobe-girls",fn:"wardrobe-girls.svg",cat:"sign"},{id:"graph",fn:"graph.svg",cat:"ui"},{id:"grid",fn:"grid.svg",cat:"ui"},{id:"wheelchair",fn:"wheelchair.svg",cat:"sign"},{id:"hands-globe",fn:"hands-globe.svg",cat:"people-and-health"},{id:"heart-hand",fn:"heart-hand.svg",cat:"people-and-health"},{id:"heart-plus",fn:"heart-plus.svg",cat:"services"},{id:"heart",fn:"heart.svg",cat:"ui"},{id:"holding-hands",fn:"holding-hands.svg",cat:"people-and-health"},{id:"home",fn:"home.svg",cat:"ui"},{id:"horizontal-menu",fn:"horizontal-menu.svg",cat:"ui"},{id:"house-heart",fn:"house-heart.svg",cat:"services"},{id:"information",fn:"information.svg",cat:"ui"},{id:"instagram",fn:"instagram.svg",cat:"social"},{id:"invoice",fn:"invoice.svg",cat:"ui"},{id:"key",fn:"key.svg",cat:"ui"},{id:"language",fn:"language.svg",cat:"ui"},{id:"law-paragraph",fn:"law-paragraph.svg",cat:"ui"},{id:"lecture-workplace",fn:"lecture-workplace.svg",cat:"people-and-health"},{id:"link",fn:"link.svg",cat:"ui"},{id:"linkedin",fn:"linkedin.svg",cat:"social"},{id:"list",fn:"list.svg",cat:"ui"},{id:"location-pin-filled",fn:"location-pin-filled.svg",cat:"ui"},{id:"location-pin",fn:"location-pin.svg",cat:"ui"},{id:"lock-locked",fn:"lock-locked.svg",cat:"ui"},{id:"lock-unlocked",fn:"lock-unlocked.svg",cat:"ui"},{id:"magnifying-glass-big",fn:"magnifying-glass-big.svg",cat:"ui"},{id:"magnifying-glass-small",fn:"magnifying-glass-small.svg",cat:"ui"},{id:"map",fn:"map.svg",cat:"ui"},{id:"menu",fn:"menu.svg",cat:"ui"},{id:"message",fn:"message.svg",cat:"ui"},{id:"minimize",fn:"minimize.svg",cat:"ui"},{id:"minus-circle-fill",fn:"minus-circle-fill.svg",cat:"plusminus"},{id:"minus-circle",fn:"minus-circle.svg",cat:"plusminus"},{id:"minus-sign",fn:"minus-sign.svg",cat:"plusminus"},{id:"mobile-phone",fn:"mobile-phone.svg",cat:"ui"},{id:"music-notes",fn:"music-notes.svg",cat:"ui"},{id:"new-window-small",fn:"new-window-small.svg",cat:"ui"},{id:"new-window",fn:"new-window.svg",cat:"ui"},{id:"nodejs",fn:"nodejs.svg",cat:"social"},{id:"obstacle",fn:"obstacle.svg",cat:"ui"},{id:"organization",fn:"organization.svg",cat:"ui"},{id:"paint-bucket",fn:"paint-bucket.svg",cat:"ui"},{id:"palette",fn:"palette.svg",cat:"ui"},{id:"paste",fn:"paste.svg",cat:"ui"},{id:"park",fn:"park.svg",cat:"services"},{id:"partner-workout",fn:"partner-workout.svg",cat:"people-and-health"},{id:"picture",fn:"picture.svg",cat:"ui"},{id:"placeholder-icon",fn:"placeholder-icon.svg",cat:"ui"},{id:"plus-circle-fill",fn:"plus-circle-fill.svg",cat:"plusminus"},{id:"plus-circle",fn:"plus-circle.svg",cat:"plusminus"},{id:"plus-sign",fn:"plus-sign.svg",cat:"plusminus"},{id:"pride-heart",fn:"pride-heart.svg",cat:"people-and-health"},{id:"print",fn:"print.svg",cat:"ui"},{id:"privacy",fn:"privacy.svg",cat:"ui"},{id:"punkt-circle-blue",fn:"punkt-circle-blue.svg",cat:"social"},{id:"qr-code",fn:"qr-code.svg",cat:"ui"},{id:"question",fn:"question.svg",cat:"ui"},{id:"react",fn:"react.svg",cat:"social"},{id:"receipt",fn:"receipt.svg",cat:"ui"},{id:"recycling",fn:"recycling.svg",cat:"services"},{id:"restaurant",fn:"restaurant.svg",cat:"sign"},{id:"ruler",fn:"ruler.svg",cat:"ui"},{id:"sass",fn:"sass.svg",cat:"social"},{id:"save",fn:"save.svg",cat:"ui"},{id:"share-outline",fn:"share-outline.svg",cat:"ui"},{id:"share",fn:"share.svg",cat:"ui"},{id:"slack",fn:"slack.svg",cat:"social"},{id:"smiley-neutral",fn:"smiley-neutral.svg",cat:"feedback"},{id:"smiley-sad",fn:"smiley-sad.svg",cat:"feedback"},{id:"smiley-smile",fn:"smiley-smile.svg",cat:"feedback"},{id:"sort",fn:"sort.svg",cat:"ui"},{id:"sound-off",fn:"sound-off.svg",cat:"ui"},{id:"sound-on",fn:"sound-on.svg",cat:"ui"},{id:"sparkles",fn:"sparkles.svg",cat:"ui"},{id:"svg-logo",fn:"svg.svg",cat:"social"},{id:"swingset",fn:"swingset.svg",cat:"services"},{id:"table",fn:"table.svg",cat:"ui"},{id:"target",fn:"target.svg",cat:"ui"},{id:"tickets",fn:"tickets.svg",cat:"sign"},{id:"thumbs-down",fn:"thumbs-down.svg",cat:"feedback"},{id:"thumbs-up",fn:"thumbs-up.svg",cat:"feedback"},{id:"trash-can",fn:"trash-can.svg",cat:"ui"},{id:"trail",fn:"trail.svg",cat:"sign"},{id:"twitter",fn:"twitter.svg",cat:"social"},{id:"two-people-dancing",fn:"two-people-dancing.svg",cat:"people-and-health"},{id:"two-people-talking",fn:"two-people-talking.svg",cat:"people-and-health"},{id:"user",fn:"user.svg",cat:"ui"},{id:"vertical-menu",fn:"vertical-menu.svg",cat:"ui"},{id:"vue",fn:"vue.svg",cat:"social"},{id:"wardrobe",fn:"wardrobe.svg",cat:"sign"},{id:"water-faucet",fn:"water-faucet.svg",cat:"services"},{id:"wine-bottle",fn:"wine-bottle.svg",cat:"people-and-health"},{id:"wifi",fn:"wifi.svg",cat:"sign"},{id:"workplace",fn:"workplace.svg",cat:"social"}],li=({className:e,compact:t=!1,skin:n="basic",responsiveView:r=!0,children:i})=>m.jsx("table",{"data-testid":"pkt-table",className:Je(e,"pkt-table",{"pkt-table--responsive":r,"pkt-table--compact":t,"pkt-table--basic":n==="basic","pkt-table--zebra-blue":n==="zebra-blue"}),role:"table",children:i}),ui=({className:e,children:t})=>m.jsx("thead",{className:Je(e,"pkt-table__header",{}),role:"rowgroup",children:t}),ci=({children:e,className:t})=>m.jsx("tbody",{className:Je(t,"pkt-table__body",{}),role:"rowgroup",children:e}),Wn=({className:e,children:t})=>m.jsx("tr",{className:Je(e,"pkt-table__row",{}),role:"row",children:t}),Tt=({className:e,children:t})=>m.jsx("th",{className:Je(e,"pkt-table__header-cell",{}),role:"columnheader",children:t}),Dt=({children:e,className:t,dataLabel:n})=>m.jsx("td",{className:Je(t,"pkt-table__data-cell",{}),"data-label":n,role:"cell","data-testid":"pkt-table__data-cell",children:e}),Yb=({specs:e})=>{const t=r=>Array.isArray(r)?r.join(`
610
610
  `):r,n=r=>typeof r=="boolean"?r?"true":"false":r;return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Egenskaper"}),m.jsxs(li,{compact:!0,children:[m.jsx(ui,{children:m.jsxs(Wn,{children:[m.jsx(Tt,{children:"Navn"}),m.jsx(Tt,{children:"Prop"}),m.jsx(Tt,{children:"Beskrivelse"}),m.jsx(Tt,{children:"Type"}),m.jsx(Tt,{children:"Standardverdi"})]})}),m.jsx(ci,{children:Object.entries(e.props||{}).map(([r,i])=>m.jsxs(Wn,{children:[m.jsx(Dt,{dataLabel:"Prop",children:m.jsx("pre",{children:r})}),m.jsx(Dt,{dataLabel:"Navn",children:!Array.isArray(i)&&i.name||r}),Array.isArray(i)?m.jsxs(m.Fragment,{children:[m.jsx(Dt,{dataLabel:"Beskrivelse"}),m.jsx(Dt,{dataLabel:"Type",children:m.jsx("pre",{children:i.join(`
611
- `)})})]}):m.jsxs(m.Fragment,{children:[m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),m.jsx(Dt,{dataLabel:"Type",children:m.jsx("pre",{children:i.type&&t(i.type)})}),m.jsx(Dt,{dataLabel:"Standardverdi",children:m.jsx("pre",{children:n(i.default)})})]})]},r))})]}),e.events&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Hendelser / handlinger"}),m.jsxs(li,{compact:!0,children:[m.jsx(ui,{children:m.jsxs(Wn,{children:[m.jsx(Tt,{children:"Event"}),m.jsx(Tt,{children:"Beskrivelse"}),m.jsx(Tt,{children:"Type"})]})}),m.jsx(ci,{children:Object.entries(e.events||{}).map(([r,i])=>m.jsxs(Wn,{children:[m.jsx(Dt,{dataLabel:"Event",children:m.jsx("pre",{children:r})}),m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),m.jsx(Dt,{dataLabel:"Type",children:i.type})]},r))})]})]}),e.slots&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Innhold"}),m.jsxs(li,{compact:!0,children:[m.jsx(ui,{children:m.jsxs(Wn,{children:[m.jsx(Tt,{children:"Slot"}),m.jsx(Tt,{children:"Beskrivelse"})]})}),m.jsx(ci,{children:Object.entries(e.slots||{}).map(([r,i])=>m.jsxs(Wn,{children:[m.jsx(Dt,{dataLabel:"Slot",children:m.jsx("pre",{children:r})}),m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})})]},r))})]})]})]})};aa.registerLanguage("jsx",Vb);const jp=({specs:e,children:t,fullWidth:n})=>{var K,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(""),[g,v]=M.useState(""),[D,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(g.replaceAll(L,e.name||"").replaceAll("{",'"').replaceAll("}",'"'))});else{const L=await Us(S.current.innerHTML,{parser:"html",plugins:[ey]});h(L.replace(/<\!--.*?-->/g,""))}},_=async()=>{const L=Ig(I);return v(L),Promise.resolve()},$=(L,N)=>{navigator.clipboard.writeText(N).then(()=>{b(L),console.log("Copied to clipboard",L)})},P=(L,N)=>m.jsxs("div",{className:"pkt-preview__copy",children:[D===L&&m.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),m.jsx(Cn,{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:(K=e.slots)!=null&&K.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}))},z=(L,N)=>{if(N.type==="boolean")return m.jsx(sr,{label:N.name||L,forId:L,helptext:N.description||null,hasFieldset:!0,requiredTag:N.required,children:m.jsx(Ma,{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 m.jsxs(ho,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:H=>j(L,H.target.value),requiredTag:N.required,children:[m.jsx("option",{value:""}),Gb.map(H=>m.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 m.jsxs(ho,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:Q=>j(L,Q.target.value),requiredTag:N.required,children:[m.jsx("option",{value:""}),H.map(Q=>m.jsx("option",{value:Q,children:Q},Q))]})}else return N.type==="ISOdatestring"?m.jsx(Xl,{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}):m.jsx(fo,{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 m.jsxs("div",{className:"pkt-preview",children:[m.jsxs("div",{className:"pkt-preview__component-container","data-mode":u,children:[e["dark-mode"]&&m.jsx("div",{className:"pkt-preview__mode",children:m.jsx(Ma,{id:"mode",label:"Dark mode",type:"checkbox",checked:u==="dark",onChange:L=>c(L.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),m.jsx("div",{className:`pkt-preview__component ${n&&"pkt-preview__component--fullwidth"}`,ref:S,children:m.jsx("div",{children:I})})]}),m.jsx(Np,{tabs:C,onTabSelected:F}),m.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&&m.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[m.jsx(Dr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),m.jsx(fo,{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])=>m.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[m.jsx(Dr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:L}),z(L,N)]},L)):m.jsx("p",{children:"OBS! Specs mangler props!"})]}),m.jsxs("div",{className:`pkt-preview__code ${C[1].active?"":"pkt-hide"}`,children:[m.jsx(aa,{language:"jsx",style:Bp,children:g}),P("jsx",g)]}),m.jsxs("div",{className:`pkt-preview__code ${C[2].active?"":"pkt-hide"}`,children:[m.jsx(aa,{language:"html",style:Bp,children:d}),P("html",d)]}),m.jsx("div",{className:`pkt-preview__specs ${C[3].active?"":"pkt-hide"}`,children:m.jsx(Yb,{specs:e})})]})};jp.displayName="PktPreview";for(var Ze=[],mo=0;mo<256;++mo)Ze.push((mo+256).toString(16).slice(1));function Kb(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 pi,Jb=new Uint8Array(16);function Xb(){if(!pi&&(pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(Jb)}var Qb=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Pp={randomUUID:Qb};function Zb(e,t,n){if(Pp.randomUUID&&!t&&!e)return Pp.randomUUID();e=e||{};var r=e.random||(e.rng||Xb)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Kb(r)}const Lp=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:g,role:v="progressbar",className:D,ariaValueText:b,...k},x)=>{const C=M.useRef(null),[T,F]=M.useState(0),[S,A]=M.useState(d);M.useEffect(()=>{d||A(Zb())},[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",z=Je("pkt-progressbar__bar",{[`pkt-progressbar__bar--${r}`]:r}),K=Je("pkt-progressbar__title",{"pkt-progressbar__title-center":o==="center"}),G=Je("pkt-progressbar__status",{"pkt-progressbar__status--center":c==="center"}),L=Je({"pkt-progressbar__status-placement--following":c==="following","pkt-progressbar__status-placement--center":c==="center","pkt-progressbar__status-placement--left":c==="left"});return m.jsxs("div",{...k,ref:x,className:Je("pkt-progressbar__container",D),id:S,style:{"--pkt-progress-label-width":`${T}px`,"--pkt-progress-width":`${P}%`},children:[i&&m.jsx("p",{id:`${S}-title`,className:K,children:i}),m.jsx("div",{role:v,className:"pkt-progressbar__bar-wrapper","aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-labelledby":g||i&&`${S}-title`,"aria-label":h,"aria-valuetext":b,children:m.jsx("div",{className:z})}),j&&m.jsx("div",{className:G,children:m.jsx("span",{className:L,ref:C,children:u==="percentage"?`${P}%`:I})})]})});Lp.displayName="PktProgressbar";const Op=M.forwardRef(({id:e,name:t,label:n,className:r,hasTile:i=!1,disabled:o=!1,checkHelptext:u,hasError:c=!1,...d},h)=>{const g=[r,"pkt-input-check"].filter(Boolean).join(" ");return m.jsx("div",{className:g,children:m.jsxs("div",{className:`pkt-input-check__input ${i?"pkt-input-check__input--tile":""} ${o&&i?"pkt-input-check__input--tile-disabled":""}`,children:[m.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}),m.jsxs("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[n,u&&m.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Op.displayName="PktRadioButton";const ek=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:g,onChange:v,onSearch:D,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=_=>m.jsx("form",{role:"search",className:F,action:h,method:g,children:_}):A=_=>m.jsx("div",{role:"search",className:F,children:_}),A(m.jsxs(m.Fragment,{children:[m.jsxs(S,{htmlFor:i?r:void 0,className:i?"pkt-inputwrapper__label":"",children:[i&&m.jsx(m.Fragment,{children:i}),m.jsxs("div",{className:e==="local"?"pkt-input__container":"pkt-searchinput__field",children:[m.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}),m.jsx(Cn,{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:D&&(_=>{_.preventDefault(),D(d)}),onKeyUp:D&&(_=>{_.key==="Enter"&&(_.preventDefault(),D(d))}),children:i||u})]})]}),c&&m.jsx("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((_,$)=>m.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,$)},m.jsxs(m.Fragment,{children:[_.title&&m.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&m.jsx("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${$}`))})]}))}),tk=M.forwardRef(({activeStep:e,className:t,children:n,hideNonActiveStepsContent:r=!0,orientation:i="vertical",...o},u)=>{const c=Je(t,"pkt-stepper",i==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),d=M.Children.map(n,(h,g)=>M.isValidElement(h)?M.cloneElement(h,{className:Je(h.props.className,{"pkt-step--hidden":r&&g!==e})}):h);return m.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:u,...o,children:d})}),nk=m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:m.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),rk=m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[m.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),m.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),ak=m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[m.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),m.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"})]}),ik=({children:e,className:t,status:n="incomplete",title:r})=>m.jsxs("li",{className:Je("pkt-step",t,`pkt-step--${n}`),"data-testid":"pkt-step",children:[m.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),m.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),m.jsx("span",{className:Je("pkt-step__indicator"),children:n==="current"?rk:n==="completed"?ak:nk}),m.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),m.jsxs("div",{className:"pkt-step__wrapper",children:[m.jsx("div",{className:"pkt-step__title",children:r}),m.jsx("div",{className:"pkt-step__content",children:e})]})]}),sk=M.forwardRef(({id:e,ariaDescribedby:t,ariaLabelledby:n,counter:r,counterMaxLength:i,className:o,disabled:u,errorMessage:c,hasError:d,helptext:h,helptextDropdown:g,helptextDropdownButton:v,inline:D,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 z=[o,"pkt-textinput","pkt-textarea"].join(" "),K=n||`${e}-label`,G=M.useRef(null),[L,N]=M.useState(0),H=Q=>{var fe,ee;if(r&&N(((ee=(fe=Q.currentTarget)==null?void 0:fe.value)==null?void 0:ee.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]),m.jsx(sr,{ariaDescribedby:t,className:z,disabled:u,errorMessage:c,forId:e,hasError:d,helptext:h,helptextDropdown:g,helptextDropdownButton:v,inline:D,label:k,optionalTag:C,optionalText:T,requiredTag:F,requiredText:S,useWrapper:$,counter:r,counterCurrent:L,counterMaxLength:i,children:m.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":K,"aria-invalid":d,"aria-errormessage":`${e}-error`,...I,onChange:H})})});Z.PktAccordion=th,Z.PktAccordionItem=oh,Z.PktAlert=Wi,Z.PktBackLink=al,Z.PktBreadcrumbs=lh,Z.PktButton=Cn,Z.PktCard=Jl,Z.PktCheckbox=Ma,Z.PktDatepicker=Xl,Z.PktFooter=Wm,Z.PktFooterSimple=zm,Z.PktHeader=Vm,Z.PktIcon=ne,Z.PktIconContext=nl,Z.PktInput=Ql,Z.PktInputWrapper=sr,Z.PktLink=Zl,Z.PktLinkCard=eu,Z.PktLoader=tu,Z.PktMessagebox=nu,Z.PktPreview=jp,Z.PktProgressbar=Lp,Z.PktRadioButton=Op,Z.PktSearchInput=ek,Z.PktSelect=ho,Z.PktStep=ik,Z.PktStepper=tk,Z.PktTable=li,Z.PktTableBody=ci,Z.PktTableDataCell=Dt,Z.PktTableHeader=ui,Z.PktTableHeaderCell=Tt,Z.PktTableRow=Wn,Z.PktTabs=Np,Z.PktTag=Dr,Z.PktTextarea=sk,Z.PktTextinput=fo,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
611
+ `)})})]}):m.jsxs(m.Fragment,{children:[m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),m.jsx(Dt,{dataLabel:"Type",children:m.jsx("pre",{children:i.type&&t(i.type)})}),m.jsx(Dt,{dataLabel:"Standardverdi",children:m.jsx("pre",{children:n(i.default)})})]})]},r))})]}),e.events&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Hendelser / handlinger"}),m.jsxs(li,{compact:!0,children:[m.jsx(ui,{children:m.jsxs(Wn,{children:[m.jsx(Tt,{children:"Event"}),m.jsx(Tt,{children:"Beskrivelse"}),m.jsx(Tt,{children:"Type"})]})}),m.jsx(ci,{children:Object.entries(e.events||{}).map(([r,i])=>m.jsxs(Wn,{children:[m.jsx(Dt,{dataLabel:"Event",children:m.jsx("pre",{children:r})}),m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})}),m.jsx(Dt,{dataLabel:"Type",children:i.type})]},r))})]})]}),e.slots&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Innhold"}),m.jsxs(li,{compact:!0,children:[m.jsx(ui,{children:m.jsxs(Wn,{children:[m.jsx(Tt,{children:"Slot"}),m.jsx(Tt,{children:"Beskrivelse"})]})}),m.jsx(ci,{children:Object.entries(e.slots||{}).map(([r,i])=>m.jsxs(Wn,{children:[m.jsx(Dt,{dataLabel:"Slot",children:m.jsx("pre",{children:r})}),m.jsx(Dt,{dataLabel:"Beskrivelse",children:m.jsx("span",{dangerouslySetInnerHTML:{__html:i.description||""}})})]},r))})]})]})]})};aa.registerLanguage("jsx",Vb);const jp=({specs:e,children:t,fullWidth:n})=>{var K,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(""),[g,v]=M.useState(""),[D,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. -->
612
+ `+g.replaceAll(L,e.name||"").replaceAll("={","='").replaceAll(`}
613
+ `,`'
614
+ `).replaceAll(/([a-zA-Z0-9]+)(:)/g,'"$1"$2'))});else{const L=await Us(S.current.innerHTML,{parser:"html",plugins:[ey]});h(L.replace(/<\!--.*?-->/g,""))}},_=async()=>{const L=await Ig(I);return v(L),Promise.resolve()},$=(L,N)=>{navigator.clipboard.writeText(N).then(()=>{b(L),console.log("Copied to clipboard",L)})},P=(L,N)=>m.jsxs("div",{className:"pkt-preview__copy",children:[D===L&&m.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),m.jsx(Cn,{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:(K=e.slots)!=null&&K.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}))},z=(L,N)=>{if(N.type==="boolean")return m.jsx(sr,{label:N.name||L,forId:L,helptext:N.description||null,hasFieldset:!0,requiredTag:N.required,children:m.jsx(Ma,{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 m.jsxs(ho,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:H=>j(L,H.target.value),requiredTag:N.required,children:[m.jsx("option",{value:""}),Gb.map(H=>m.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 m.jsxs(ho,{label:N.name||L,helptext:N.description||null,id:L,value:i[L],onChange:Q=>j(L,Q.target.value),requiredTag:N.required,children:[m.jsx("option",{value:""}),H.map(Q=>m.jsx("option",{value:Q,children:Q},Q))]})}else return N.type==="ISOdatestring"?m.jsx(Xl,{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}):m.jsx(fo,{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 m.jsxs("div",{className:"pkt-preview",children:[m.jsxs("div",{className:"pkt-preview__component-container","data-mode":u,children:[e["dark-mode"]&&m.jsx("div",{className:"pkt-preview__mode",children:m.jsx(Ma,{id:"mode",label:"Dark mode",type:"checkbox",checked:u==="dark",onChange:L=>c(L.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),m.jsx("div",{className:`pkt-preview__component ${n&&"pkt-preview__component--fullwidth"}`,ref:S,children:m.jsx("div",{children:I})})]}),m.jsx(Np,{tabs:C,onTabSelected:F}),m.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&&m.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[m.jsx(Dr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),m.jsx(fo,{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])=>m.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[m.jsx(Dr,{size:"small",skin:"blue-light",textStyle:"thin-text",children:L}),z(L,N)]},L)):m.jsx("p",{children:"OBS! Specs mangler props!"})]}),m.jsxs("div",{className:`pkt-preview__code ${C[1].active?"":"pkt-hide"}`,children:[m.jsx(aa,{language:"jsx",style:Bp,children:g}),P("jsx",g)]}),m.jsxs("div",{className:`pkt-preview__code ${C[2].active?"":"pkt-hide"}`,children:[m.jsx(aa,{language:"html",style:Bp,children:d}),P("html",d)]}),m.jsx("div",{className:`pkt-preview__specs ${C[3].active?"":"pkt-hide"}`,children:m.jsx(Yb,{specs:e})})]})};jp.displayName="PktPreview";for(var Ze=[],mo=0;mo<256;++mo)Ze.push((mo+256).toString(16).slice(1));function Kb(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 pi,Jb=new Uint8Array(16);function Xb(){if(!pi&&(pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(Jb)}var Qb=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Pp={randomUUID:Qb};function Zb(e,t,n){if(Pp.randomUUID&&!t&&!e)return Pp.randomUUID();e=e||{};var r=e.random||(e.rng||Xb)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Kb(r)}const Lp=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:g,role:v="progressbar",className:D,ariaValueText:b,...k},x)=>{const C=M.useRef(null),[T,F]=M.useState(0),[S,A]=M.useState(d);M.useEffect(()=>{d||A(Zb())},[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",z=Je("pkt-progressbar__bar",{[`pkt-progressbar__bar--${r}`]:r}),K=Je("pkt-progressbar__title",{"pkt-progressbar__title-center":o==="center"}),G=Je("pkt-progressbar__status",{"pkt-progressbar__status--center":c==="center"}),L=Je({"pkt-progressbar__status-placement--following":c==="following","pkt-progressbar__status-placement--center":c==="center","pkt-progressbar__status-placement--left":c==="left"});return m.jsxs("div",{...k,ref:x,className:Je("pkt-progressbar__container",D),id:S,style:{"--pkt-progress-label-width":`${T}px`,"--pkt-progress-width":`${P}%`},children:[i&&m.jsx("p",{id:`${S}-title`,className:K,children:i}),m.jsx("div",{role:v,className:"pkt-progressbar__bar-wrapper","aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-labelledby":g||i&&`${S}-title`,"aria-label":h,"aria-valuetext":b,children:m.jsx("div",{className:z})}),j&&m.jsx("div",{className:G,children:m.jsx("span",{className:L,ref:C,children:u==="percentage"?`${P}%`:I})})]})});Lp.displayName="PktProgressbar";const Op=M.forwardRef(({id:e,name:t,label:n,className:r,hasTile:i=!1,disabled:o=!1,checkHelptext:u,hasError:c=!1,...d},h)=>{const g=[r,"pkt-input-check"].filter(Boolean).join(" ");return m.jsx("div",{className:g,children:m.jsxs("div",{className:`pkt-input-check__input ${i?"pkt-input-check__input--tile":""} ${o&&i?"pkt-input-check__input--tile-disabled":""}`,children:[m.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}),m.jsxs("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[n,u&&m.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Op.displayName="PktRadioButton";const ek=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:g,onChange:v,onSearch:D,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=_=>m.jsx("form",{role:"search",className:F,action:h,method:g,children:_}):A=_=>m.jsx("div",{role:"search",className:F,children:_}),A(m.jsxs(m.Fragment,{children:[m.jsxs(S,{htmlFor:i?r:void 0,className:i?"pkt-inputwrapper__label":"",children:[i&&m.jsx(m.Fragment,{children:i}),m.jsxs("div",{className:e==="local"?"pkt-input__container":"pkt-searchinput__field",children:[m.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}),m.jsx(Cn,{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:D&&(_=>{_.preventDefault(),D(d)}),onKeyUp:D&&(_=>{_.key==="Enter"&&(_.preventDefault(),D(d))}),children:i||u})]})]}),c&&m.jsx("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((_,$)=>m.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,$)},m.jsxs(m.Fragment,{children:[_.title&&m.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&m.jsx("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${$}`))})]}))}),tk=M.forwardRef(({activeStep:e,className:t,children:n,hideNonActiveStepsContent:r=!0,orientation:i="vertical",...o},u)=>{const c=Je(t,"pkt-stepper",i==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),d=M.Children.map(n,(h,g)=>M.isValidElement(h)?M.cloneElement(h,{className:Je(h.props.className,{"pkt-step--hidden":r&&g!==e})}):h);return m.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:u,...o,children:d})}),nk=m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:m.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),rk=m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[m.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),m.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),ak=m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[m.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),m.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"})]}),ik=({children:e,className:t,status:n="incomplete",title:r})=>m.jsxs("li",{className:Je("pkt-step",t,`pkt-step--${n}`),"data-testid":"pkt-step",children:[m.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),m.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),m.jsx("span",{className:Je("pkt-step__indicator"),children:n==="current"?rk:n==="completed"?ak:nk}),m.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),m.jsxs("div",{className:"pkt-step__wrapper",children:[m.jsx("div",{className:"pkt-step__title",children:r}),m.jsx("div",{className:"pkt-step__content",children:e})]})]}),sk=M.forwardRef(({id:e,ariaDescribedby:t,ariaLabelledby:n,counter:r,counterMaxLength:i,className:o,disabled:u,errorMessage:c,hasError:d,helptext:h,helptextDropdown:g,helptextDropdownButton:v,inline:D,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 z=[o,"pkt-textinput","pkt-textarea"].join(" "),K=n||`${e}-label`,G=M.useRef(null),[L,N]=M.useState(0),H=Q=>{var fe,ee;if(r&&N(((ee=(fe=Q.currentTarget)==null?void 0:fe.value)==null?void 0:ee.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]),m.jsx(sr,{ariaDescribedby:t,className:z,disabled:u,errorMessage:c,forId:e,hasError:d,helptext:h,helptextDropdown:g,helptextDropdownButton:v,inline:D,label:k,optionalTag:C,optionalText:T,requiredTag:F,requiredText:S,useWrapper:$,counter:r,counterCurrent:L,counterMaxLength:i,children:m.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":K,"aria-invalid":d,"aria-errormessage":`${e}-error`,...I,onChange:H})})});Z.PktAccordion=th,Z.PktAccordionItem=oh,Z.PktAlert=Wi,Z.PktBackLink=al,Z.PktBreadcrumbs=lh,Z.PktButton=Cn,Z.PktCard=Jl,Z.PktCheckbox=Ma,Z.PktDatepicker=Xl,Z.PktFooter=Wm,Z.PktFooterSimple=zm,Z.PktHeader=Vm,Z.PktIcon=ne,Z.PktIconContext=nl,Z.PktInput=Ql,Z.PktInputWrapper=sr,Z.PktLink=Zl,Z.PktLinkCard=eu,Z.PktLoader=tu,Z.PktMessagebox=nu,Z.PktPreview=jp,Z.PktProgressbar=Lp,Z.PktRadioButton=Op,Z.PktSearchInput=ek,Z.PktSelect=ho,Z.PktStep=ik,Z.PktStepper=tk,Z.PktTable=li,Z.PktTableBody=ci,Z.PktTableDataCell=Dt,Z.PktTableHeader=ui,Z.PktTableHeaderCell=Tt,Z.PktTableRow=Wn,Z.PktTabs=Np,Z.PktTag=Dr,Z.PktTextarea=sk,Z.PktTextinput=fo,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "12.3.14",
3
+ "version": "12.3.15",
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",
@@ -102,5 +102,5 @@
102
102
  "url": "https://github.com/oslokommune/punkt/issues"
103
103
  },
104
104
  "license": "MIT",
105
- "gitHead": "34bceb9bac28135ac27f474d715d1d11f2cd075d"
105
+ "gitHead": "21c4a691e13b11c2b5eb6eb9d467d5acfb0f0cdf"
106
106
  }
@@ -9,8 +9,8 @@ interface IPktCard extends PktElType {
9
9
  skin?: 'outlined' | 'gray' | 'beige' | 'green' | 'blue'
10
10
  heading?: string
11
11
  subheading?: string
12
- tags?: (Omit<IPktTag, 'closeTag'> & { text: string })[]
13
- image?: { src: string; alt: string }
12
+ tags?: (Omit<IPktTag, 'closeTag'> & { text: string })[] | string
13
+ image?: { src: string; alt: string } | string
14
14
  }
15
15
 
16
16
  const LitComponent: FC<IPktCard> = createComponent({
@@ -101,10 +101,12 @@ export const PktPreview: React.FC<PreviewProps> = ({ specs, children, fullWidth
101
101
  ? (component.type as any).displayName || (component.type as any).name
102
102
  : specs.name
103
103
  setHtmlContent(
104
- jsxContent
105
- .replaceAll(componentType, specs.name || '')
106
- .replaceAll('{', '"')
107
- .replaceAll('}', '"'),
104
+ '<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->\n' +
105
+ jsxContent
106
+ .replaceAll(componentType, specs.name || '')
107
+ .replaceAll('={', "='")
108
+ .replaceAll('}\n', "'\n")
109
+ .replaceAll(/([a-zA-Z0-9]+)(:)/g, '"$1"$2'),
108
110
  )
109
111
  })
110
112
  } else {
@@ -117,7 +119,7 @@ export const PktPreview: React.FC<PreviewProps> = ({ specs, children, fullWidth
117
119
  }
118
120
 
119
121
  const fetchJsx = async () => {
120
- const jsx = reactElementToJSXString(component)
122
+ const jsx = await reactElementToJSXString(component)
121
123
  setJsxContent(jsx)
122
124
  return Promise.resolve()
123
125
  }