@oslokommune/punkt-react 11.7.0 → 11.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [11.7.1](https://github.com/oslokommune/punkt/compare/11.7.0...11.7.1) (2024-02-22)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* force active styling if loading (#1533).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [11.7.0](https://github.com/oslokommune/punkt/compare/11.6.0...11.7.0) (2024-02-19)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -1496,7 +1496,8 @@ const _r = B(
|
|
|
1496
1496
|
r && `pkt-btn--${r}`,
|
|
1497
1497
|
o && `pkt-btn--${o}`,
|
|
1498
1498
|
c && `pkt-btn--${c}`,
|
|
1499
|
-
p && `pkt-btn--${p}
|
|
1499
|
+
p && `pkt-btn--${p}`,
|
|
1500
|
+
u && "pkt-btn--active"
|
|
1500
1501
|
].filter(Boolean).join(" ");
|
|
1501
1502
|
return /* @__PURE__ */ h("button", { ...d, className: v, type: s, ref: k, children: [
|
|
1502
1503
|
u && /* @__PURE__ */ l(
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -51,7 +51,7 @@ Check the top-level render call using <`+m+">.")}return p}}function Ft(t,p){{if(
|
|
|
51
51
|
* LICENSE.md file in the root directory of this source tree.
|
|
52
52
|
*
|
|
53
53
|
* @license MIT
|
|
54
|
-
*/function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},ae.apply(this,arguments)}function Ve(e,n){if(e==null)return{};var a={},l=Object.keys(e),r,o;for(o=0;o<l.length;o++)r=l[o],!(n.indexOf(r)>=0)&&(a[r]=e[r]);return a}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function mn(e){return be(e)&&e.tagName.toLowerCase()==="button"}function hn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function kn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function vn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _n(e,n){return e.button===0&&(!n||n==="_self")&&!vn(e)}let ge=null;function bn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const gn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function We(e){return e!=null&&!gn.has(e)?(process.env.NODE_ENV!=="production"&&ne(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function Nn(e,n){let a,l,r,o,s;if(hn(e)){let c=e.getAttribute("action");l=c?ue(c,n):null,a=e.getAttribute("method")||ve,r=We(e.getAttribute("enctype"))||_e,o=new FormData(e)}else if(mn(e)||kn(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(l=f?ue(f,n):null,a=e.getAttribute("formmethod")||c.getAttribute("method")||ve,r=We(e.getAttribute("formenctype"))||We(c.getAttribute("enctype"))||_e,o=new FormData(c,e),!bn()){let{name:u,type:d,value:k}=e;if(d==="image"){let v=u?u+".":"";o.append(v+"x","0"),o.append(v+"y","0")}else u&&o.append(u,k)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ve,l=null,r=_e,s=e}return o&&r==="text/plain"&&(s=o,o=void 0),{action:l,method:a.toLowerCase(),encType:r,formData:o,body:s}}const yn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wn=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],En=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],dt=y.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(dt.displayName="ViewTransition");const Cn=y.createContext(new Map);process.env.NODE_ENV!=="production"&&(Cn.displayName="Fetchers"),process.env.NODE_ENV;const xn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=y.forwardRef(function(n,a){let{onClick:l,relative:r,reloadDocument:o,replace:s,state:c,target:f,to:u,preventScrollReset:d,unstable_viewTransition:k}=n,v=Ve(n,yn),{basename:S}=y.useContext(Z),x,$=!1;if(typeof u=="string"&&Pn.test(u)&&(x=u,xn))try{let _=new URL(window.location.href),j=u.startsWith("//")?new URL(_.protocol+u):new URL(u),V=ue(j.pathname,S);j.origin===_.origin&&V!=null?u=V+j.search+j.hash:$=!0}catch{process.env.NODE_ENV!=="production"&&ne(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let L=on(u,{relative:r}),E=On(u,{replace:s,state:c,target:f,preventScrollReset:d,relative:r,unstable_viewTransition:k});function C(_){l&&l(_),_.defaultPrevented||E(_)}return y.createElement("a",ae({},v,{href:x||L,onClick:$||o?l:C,ref:a,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const Sn=y.forwardRef(function(n,a){let{"aria-current":l="page",caseSensitive:r=!1,className:o="",end:s=!1,style:c,to:f,unstable_viewTransition:u,children:d}=n,k=Ve(n,wn),v=pe(f,{relative:k.relative}),S=fe(),x=y.useContext(ot),{navigator:$}=y.useContext(Z),L=x!=null&&Fn(v)&&u===!0,E=$.encodeLocation?$.encodeLocation(v).pathname:v.pathname,C=S.pathname,_=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(C=C.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase());const j=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let V=C===E||!s&&C.startsWith(E)&&C.charAt(j)==="/",W=_!=null&&(_===E||!s&&_.startsWith(E)&&_.charAt(E.length)==="/"),B={isActive:V,isPending:W,isTransitioning:L},J=V?l:void 0,M;typeof o=="function"?M=o(B):M=[o,V?"active":null,W?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let G=typeof c=="function"?c(B):c;return y.createElement(Ne,ae({},k,{"aria-current":J,className:M,ref:a,style:G,to:f,unstable_viewTransition:u}),typeof d=="function"?d(B):d)});process.env.NODE_ENV!=="production"&&(Sn.displayName="NavLink");const Rn=y.forwardRef((e,n)=>{let{fetcherKey:a,navigate:l,reloadDocument:r,replace:o,state:s,method:c=ve,action:f,onSubmit:u,relative:d,preventScrollReset:k,unstable_viewTransition:v}=e,S=Ve(e,En),x=Ln(),$=In(f,{relative:d}),L=c.toLowerCase()==="get"?"get":"post",E=C=>{if(u&&u(C),C.defaultPrevented)return;C.preventDefault();let _=C.nativeEvent.submitter,j=(_==null?void 0:_.getAttribute("formmethod"))||c;x(_||C.currentTarget,{fetcherKey:a,method:j,navigate:l,replace:o,state:s,relative:d,preventScrollReset:k,unstable_viewTransition:v})};return y.createElement("form",ae({ref:n,method:L,action:$,onSubmit:r?u:E},S))});process.env.NODE_ENV!=="production"&&(Rn.displayName="Form"),process.env.NODE_ENV;var ye;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ye||(ye={}));var mt;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mt||(mt={}));function Tn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ht(e){let n=y.useContext(ke);return n||(process.env.NODE_ENV!=="production"?F(!1,Tn(e)):F(!1)),n}function On(e,n){let{target:a,replace:l,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c}=n===void 0?{}:n,f=sn(),u=fe(),d=pe(e,{relative:s});return y.useCallback(k=>{if(_n(k,a)){k.preventDefault();let v=l!==void 0?l:je(u)===je(d);f(e,{replace:v,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c})}},[u,f,d,l,r,a,e,o,s,c])}function $n(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let jn=0,Dn=()=>"__"+String(++jn)+"__";function Ln(){let{router:e}=ht(ye.UseSubmit),{basename:n}=y.useContext(Z),a=pn();return y.useCallback(function(l,r){r===void 0&&(r={}),$n();let{action:o,method:s,encType:c,formData:f,body:u}=Nn(l,n);if(r.navigate===!1){let d=r.fetcherKey||Dn();e.fetch(d,a,r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,unstable_flushSync:r.unstable_flushSync})}else e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:a,unstable_flushSync:r.unstable_flushSync,unstable_viewTransition:r.unstable_viewTransition})},[e,n,a])}function In(e,n){let{relative:a}=n===void 0?{}:n,{basename:l}=y.useContext(Z),r=y.useContext(re);r||(process.env.NODE_ENV!=="production"?F(!1,"useFormAction must be used inside a RouteContext"):F(!1));let[o]=r.matches.slice(-1),s=ae({},pe(e||".",{relative:a})),c=fe();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search);f.has("index")&&f.get("index")===""&&(f.delete("index"),s.search=f.toString()?"?"+f.toString():"")}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(s.pathname=s.pathname==="/"?l:Le([l,s.pathname])),je(s)}function Fn(e,n){n===void 0&&(n={});let a=y.useContext(dt);a==null&&(process.env.NODE_ENV!=="production"?F(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):F(!1));let{basename:l}=ht(ye.useViewTransitionState),r=pe(e,{relative:n.relative});if(!a.isTransitioning)return!1;let o=ue(a.currentLocation.pathname,l)||a.currentLocation.pathname,s=ue(a.nextLocation.pathname,l)||a.nextLocation.pathname;return rt(r.pathname,s)!=null||rt(r.pathname,o)!=null}const Un=b.forwardRef(({breadcrumbs:e,navigationType:n,className:a,...l},r)=>{const o=e.slice(0,4),s=o[o.length-2],c=[a,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[i("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((f,u)=>i("li",{className:"pkt-breadcrumbs__item",children:u===o.length-1?i("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:i("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?h(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(w,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(w,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${u}`))}),n==="router"?h(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(w,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):h("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(w,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),le=b.forwardRef(({children:e,className:n,iconName:a="user",secondIconName:l="user",size:r="medium",skin:o="primary",type:s="button",variant:c="label-only",color:f,isLoading:u=!1,...d},k)=>{const v=[n,"pkt-btn",r&&`pkt-btn--${r}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return h("button",{...d,className:v,type:s,ref:k,children:[u&&i(w,{className:"pkt-btn__icon",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/11.7/animations/"}),c!=="label-only"&&i(w,{className:"pkt-btn__icon",name:a}),i("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&i(w,{className:"pkt-btn__icon",name:l})]})});le.displayName="PktButton";const kt=b.forwardRef(({id:e,hasTile:n=!1,disabled:a=!1,label:l,labelPosition:r="right",hideLabel:o=!1,checkHelptext:s,hasError:c=!1,isSwitch:f=!1,className:u,...d},k)=>{const v=[u,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:v,children:h("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""} ${a&&n?"pkt-input-check__input--tile-disabled":""}`,children:[l&&r==="left"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]}),i("input",{ref:k,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:f?"switch":"checkbox",id:e,disabled:a,...d}),l&&r==="right"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});kt.displayName="PktCheckbox";const An=({columnOne:e,columnTwo:n,socialLinks:a,className:l,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const s=[l,"pkt-footer"].filter(Boolean).join(" ");return i("footer",{className:s,"data-mode":"dark",children:h("div",{className:"pkt-footer__container",children:[h("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:e.title}),h("ul",{className:"pkt-footer__list",children:[e.text&&i("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:n.title}),h("ul",{className:"pkt-footer__list",children:[n.text&&i("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h("ul",{className:"pkt-footer__list",children:[i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:r,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:o,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),a&&h("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[i("div",{className:"pkt-footer__social-languages",children:a.filter(u=>u.language).map((u,d)=>i("div",{className:"pkt-footer__social-language",children:i("a",{href:u.href,"aria-label":`til ${u.language} versjon av nettsiden`,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:u.language})},`sociallinks-language-${d}`))}),i("div",{className:"pkt-footer__social-icons",children:a.filter(u=>u.iconName).map((u,d)=>i(b.Fragment,{children:i("a",{href:u.href,"aria-label":`til ${u.iconName}`,className:"pkt-footer__social-icon-link",target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:i(w,{className:"pkt-footer__social-icon",name:u.iconName})})},`sociallinks-${d}`))})]})]})})},Vn=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",className:l})=>{const r=[l,"pkt-footer-simple"].filter(Boolean).join(" ");return i("footer",{className:r,"data-mode":"dark",children:i("div",{className:"pkt-footer-simple__container",children:h("ul",{className:"pkt-footer-simple__list",children:[e.map((o,s)=>i("li",{className:"pkt-footer-simple__list-item",children:h("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:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},s)),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:n,children:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:a,children:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var vt={exports:{}};/*!
|
|
54
|
+
*/function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},ae.apply(this,arguments)}function Ve(e,n){if(e==null)return{};var a={},l=Object.keys(e),r,o;for(o=0;o<l.length;o++)r=l[o],!(n.indexOf(r)>=0)&&(a[r]=e[r]);return a}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function mn(e){return be(e)&&e.tagName.toLowerCase()==="button"}function hn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function kn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function vn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _n(e,n){return e.button===0&&(!n||n==="_self")&&!vn(e)}let ge=null;function bn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const gn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function We(e){return e!=null&&!gn.has(e)?(process.env.NODE_ENV!=="production"&&ne(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function Nn(e,n){let a,l,r,o,s;if(hn(e)){let c=e.getAttribute("action");l=c?ue(c,n):null,a=e.getAttribute("method")||ve,r=We(e.getAttribute("enctype"))||_e,o=new FormData(e)}else if(mn(e)||kn(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(l=f?ue(f,n):null,a=e.getAttribute("formmethod")||c.getAttribute("method")||ve,r=We(e.getAttribute("formenctype"))||We(c.getAttribute("enctype"))||_e,o=new FormData(c,e),!bn()){let{name:u,type:d,value:k}=e;if(d==="image"){let v=u?u+".":"";o.append(v+"x","0"),o.append(v+"y","0")}else u&&o.append(u,k)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ve,l=null,r=_e,s=e}return o&&r==="text/plain"&&(s=o,o=void 0),{action:l,method:a.toLowerCase(),encType:r,formData:o,body:s}}const yn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wn=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],En=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],dt=y.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(dt.displayName="ViewTransition");const Cn=y.createContext(new Map);process.env.NODE_ENV!=="production"&&(Cn.displayName="Fetchers"),process.env.NODE_ENV;const xn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=y.forwardRef(function(n,a){let{onClick:l,relative:r,reloadDocument:o,replace:s,state:c,target:f,to:u,preventScrollReset:d,unstable_viewTransition:k}=n,v=Ve(n,yn),{basename:S}=y.useContext(Z),x,$=!1;if(typeof u=="string"&&Pn.test(u)&&(x=u,xn))try{let _=new URL(window.location.href),j=u.startsWith("//")?new URL(_.protocol+u):new URL(u),V=ue(j.pathname,S);j.origin===_.origin&&V!=null?u=V+j.search+j.hash:$=!0}catch{process.env.NODE_ENV!=="production"&&ne(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let L=on(u,{relative:r}),E=On(u,{replace:s,state:c,target:f,preventScrollReset:d,relative:r,unstable_viewTransition:k});function C(_){l&&l(_),_.defaultPrevented||E(_)}return y.createElement("a",ae({},v,{href:x||L,onClick:$||o?l:C,ref:a,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const Sn=y.forwardRef(function(n,a){let{"aria-current":l="page",caseSensitive:r=!1,className:o="",end:s=!1,style:c,to:f,unstable_viewTransition:u,children:d}=n,k=Ve(n,wn),v=pe(f,{relative:k.relative}),S=fe(),x=y.useContext(ot),{navigator:$}=y.useContext(Z),L=x!=null&&Fn(v)&&u===!0,E=$.encodeLocation?$.encodeLocation(v).pathname:v.pathname,C=S.pathname,_=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(C=C.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase());const j=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let V=C===E||!s&&C.startsWith(E)&&C.charAt(j)==="/",W=_!=null&&(_===E||!s&&_.startsWith(E)&&_.charAt(E.length)==="/"),B={isActive:V,isPending:W,isTransitioning:L},J=V?l:void 0,M;typeof o=="function"?M=o(B):M=[o,V?"active":null,W?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let G=typeof c=="function"?c(B):c;return y.createElement(Ne,ae({},k,{"aria-current":J,className:M,ref:a,style:G,to:f,unstable_viewTransition:u}),typeof d=="function"?d(B):d)});process.env.NODE_ENV!=="production"&&(Sn.displayName="NavLink");const Rn=y.forwardRef((e,n)=>{let{fetcherKey:a,navigate:l,reloadDocument:r,replace:o,state:s,method:c=ve,action:f,onSubmit:u,relative:d,preventScrollReset:k,unstable_viewTransition:v}=e,S=Ve(e,En),x=Ln(),$=In(f,{relative:d}),L=c.toLowerCase()==="get"?"get":"post",E=C=>{if(u&&u(C),C.defaultPrevented)return;C.preventDefault();let _=C.nativeEvent.submitter,j=(_==null?void 0:_.getAttribute("formmethod"))||c;x(_||C.currentTarget,{fetcherKey:a,method:j,navigate:l,replace:o,state:s,relative:d,preventScrollReset:k,unstable_viewTransition:v})};return y.createElement("form",ae({ref:n,method:L,action:$,onSubmit:r?u:E},S))});process.env.NODE_ENV!=="production"&&(Rn.displayName="Form"),process.env.NODE_ENV;var ye;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ye||(ye={}));var mt;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mt||(mt={}));function Tn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ht(e){let n=y.useContext(ke);return n||(process.env.NODE_ENV!=="production"?F(!1,Tn(e)):F(!1)),n}function On(e,n){let{target:a,replace:l,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c}=n===void 0?{}:n,f=sn(),u=fe(),d=pe(e,{relative:s});return y.useCallback(k=>{if(_n(k,a)){k.preventDefault();let v=l!==void 0?l:je(u)===je(d);f(e,{replace:v,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c})}},[u,f,d,l,r,a,e,o,s,c])}function $n(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let jn=0,Dn=()=>"__"+String(++jn)+"__";function Ln(){let{router:e}=ht(ye.UseSubmit),{basename:n}=y.useContext(Z),a=pn();return y.useCallback(function(l,r){r===void 0&&(r={}),$n();let{action:o,method:s,encType:c,formData:f,body:u}=Nn(l,n);if(r.navigate===!1){let d=r.fetcherKey||Dn();e.fetch(d,a,r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,unstable_flushSync:r.unstable_flushSync})}else e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:a,unstable_flushSync:r.unstable_flushSync,unstable_viewTransition:r.unstable_viewTransition})},[e,n,a])}function In(e,n){let{relative:a}=n===void 0?{}:n,{basename:l}=y.useContext(Z),r=y.useContext(re);r||(process.env.NODE_ENV!=="production"?F(!1,"useFormAction must be used inside a RouteContext"):F(!1));let[o]=r.matches.slice(-1),s=ae({},pe(e||".",{relative:a})),c=fe();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search);f.has("index")&&f.get("index")===""&&(f.delete("index"),s.search=f.toString()?"?"+f.toString():"")}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(s.pathname=s.pathname==="/"?l:Le([l,s.pathname])),je(s)}function Fn(e,n){n===void 0&&(n={});let a=y.useContext(dt);a==null&&(process.env.NODE_ENV!=="production"?F(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):F(!1));let{basename:l}=ht(ye.useViewTransitionState),r=pe(e,{relative:n.relative});if(!a.isTransitioning)return!1;let o=ue(a.currentLocation.pathname,l)||a.currentLocation.pathname,s=ue(a.nextLocation.pathname,l)||a.nextLocation.pathname;return rt(r.pathname,s)!=null||rt(r.pathname,o)!=null}const Un=b.forwardRef(({breadcrumbs:e,navigationType:n,className:a,...l},r)=>{const o=e.slice(0,4),s=o[o.length-2],c=[a,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[i("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((f,u)=>i("li",{className:"pkt-breadcrumbs__item",children:u===o.length-1?i("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:i("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?h(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(w,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(w,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${u}`))}),n==="router"?h(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(w,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):h("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(w,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),le=b.forwardRef(({children:e,className:n,iconName:a="user",secondIconName:l="user",size:r="medium",skin:o="primary",type:s="button",variant:c="label-only",color:f,isLoading:u=!1,...d},k)=>{const v=[n,"pkt-btn",r&&`pkt-btn--${r}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,f&&`pkt-btn--${f}`,u&&"pkt-btn--active"].filter(Boolean).join(" ");return h("button",{...d,className:v,type:s,ref:k,children:[u&&i(w,{className:"pkt-btn__icon",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/11.7/animations/"}),c!=="label-only"&&i(w,{className:"pkt-btn__icon",name:a}),i("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&i(w,{className:"pkt-btn__icon",name:l})]})});le.displayName="PktButton";const kt=b.forwardRef(({id:e,hasTile:n=!1,disabled:a=!1,label:l,labelPosition:r="right",hideLabel:o=!1,checkHelptext:s,hasError:c=!1,isSwitch:f=!1,className:u,...d},k)=>{const v=[u,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:v,children:h("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""} ${a&&n?"pkt-input-check__input--tile-disabled":""}`,children:[l&&r==="left"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]}),i("input",{ref:k,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:f?"switch":"checkbox",id:e,disabled:a,...d}),l&&r==="right"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});kt.displayName="PktCheckbox";const An=({columnOne:e,columnTwo:n,socialLinks:a,className:l,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const s=[l,"pkt-footer"].filter(Boolean).join(" ");return i("footer",{className:s,"data-mode":"dark",children:h("div",{className:"pkt-footer__container",children:[h("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:e.title}),h("ul",{className:"pkt-footer__list",children:[e.text&&i("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:n.title}),h("ul",{className:"pkt-footer__list",children:[n.text&&i("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h("ul",{className:"pkt-footer__list",children:[i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:r,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:o,children:[i(w,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),a&&h("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[i("div",{className:"pkt-footer__social-languages",children:a.filter(u=>u.language).map((u,d)=>i("div",{className:"pkt-footer__social-language",children:i("a",{href:u.href,"aria-label":`til ${u.language} versjon av nettsiden`,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:u.language})},`sociallinks-language-${d}`))}),i("div",{className:"pkt-footer__social-icons",children:a.filter(u=>u.iconName).map((u,d)=>i(b.Fragment,{children:i("a",{href:u.href,"aria-label":`til ${u.iconName}`,className:"pkt-footer__social-icon-link",target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:i(w,{className:"pkt-footer__social-icon",name:u.iconName})})},`sociallinks-${d}`))})]})]})})},Vn=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",className:l})=>{const r=[l,"pkt-footer-simple"].filter(Boolean).join(" ");return i("footer",{className:r,"data-mode":"dark",children:i("div",{className:"pkt-footer-simple__container",children:h("ul",{className:"pkt-footer-simple__list",children:[e.map((o,s)=>i("li",{className:"pkt-footer-simple__list-item",children:h("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:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},s)),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:n,children:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:a,children:[i(w,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var vt={exports:{}};/*!
|
|
55
55
|
Copyright (c) 2018 Jed Watson.
|
|
56
56
|
Licensed under the MIT License (MIT), see
|
|
57
57
|
http://jedwatson.github.io/classnames
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.1",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
92
92
|
},
|
|
93
93
|
"license": "MIT",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "652f791a2cbb459b107b8f6e230b75652a8112a6"
|
|
95
95
|
}
|