@oslokommune/punkt-react 11.0.2 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IconFetcher } from "./IconContext";
|
|
2
|
-
export declare const defaultSvgPath = "https://punkt-cdn.oslo.kommune.no/11.
|
|
2
|
+
export declare const defaultSvgPath = "https://punkt-cdn.oslo.kommune.no/11.1/icons/";
|
|
3
3
|
declare const defaultIconFetcher: IconFetcher;
|
|
4
4
|
export default defaultIconFetcher;
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -631,7 +631,7 @@ Check the top-level render call using <` + m + ">.");
|
|
|
631
631
|
}
|
|
632
632
|
process.env.NODE_ENV === "production" ? Ve.exports = fn() : Ve.exports = dn();
|
|
633
633
|
var Ye = Ve.exports;
|
|
634
|
-
const X = Ye.Fragment, i = Ye.jsx, h = Ye.jsxs, Fe = {}, mn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', hn = "https://punkt-cdn.oslo.kommune.no/11.
|
|
634
|
+
const X = Ye.Fragment, i = Ye.jsx, h = Ye.jsxs, Fe = {}, mn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', hn = "https://punkt-cdn.oslo.kommune.no/11.1/icons/", kn = (e, n) => (!Fe[e] && typeof window.fetch == "function" && (Fe[e] = window.fetch(n + e + ".svg").then((a) => a.ok ? a.text() : (console.error("Missing icon: " + n + e + ".svg"), mn)).then((a) => a)), Promise.resolve(Fe[e])), vn = {
|
|
635
635
|
fetchIcon: async (e, n) => kn(e, n || hn)
|
|
636
636
|
}, _n = sn(vn), E = ({ name: e, path: n, className: a = "", ...l }) => {
|
|
637
637
|
const [r, o] = de(null), s = cn(_n);
|
|
@@ -1776,7 +1776,7 @@ const Lt = /* @__PURE__ */ pn(sr), gr = Y(
|
|
|
1776
1776
|
name: "oslologo",
|
|
1777
1777
|
className: "pkt-header__logo-svg",
|
|
1778
1778
|
"aria-hidden": "true",
|
|
1779
|
-
path: "https://punkt-cdn.oslo.kommune.no/11.
|
|
1779
|
+
path: "https://punkt-cdn.oslo.kommune.no/11.1/logos/"
|
|
1780
1780
|
}
|
|
1781
1781
|
) }) : /* @__PURE__ */ i(
|
|
1782
1782
|
"button",
|
|
@@ -1790,7 +1790,7 @@ const Lt = /* @__PURE__ */ pn(sr), gr = Y(
|
|
|
1790
1790
|
name: "oslologo",
|
|
1791
1791
|
className: "pkt-header__logo-svg",
|
|
1792
1792
|
"aria-hidden": "true",
|
|
1793
|
-
path: "https://punkt-cdn.oslo.kommune.no/11.
|
|
1793
|
+
path: "https://punkt-cdn.oslo.kommune.no/11.1/logos/"
|
|
1794
1794
|
}
|
|
1795
1795
|
)
|
|
1796
1796
|
}
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -24,7 +24,7 @@ Check the render method of \``+t+"`."}return""}}function hr(t){{if(t!==void 0){v
|
|
|
24
24
|
|
|
25
25
|
Check your code at `+u+":"+m+"."}return""}}var It={};function kr(t){{var u=Lt();if(!u){var m=typeof t=="string"?t:t.displayName||t.name;m&&(u=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+m+">.")}return u}}function Ft(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var m=kr(u);if(It[m])return;It[m]=!0;var b="";t&&t._owner&&t._owner!==Ke.current&&(b=" It was passed a child from "+I(t._owner.type)+"."),ie(t),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,b),ie(null)}}function Ut(t,u){{if(typeof t!="object")return;if(Ye(t))for(var m=0;m<t.length;m++){var b=t[m];ze(b)&&Ft(b,u)}else if(ze(t))t._store&&(t._store.validated=!0);else if(t){var T=L(t);if(typeof T=="function"&&T!==t.entries)for(var D=T.call(t),P;!(P=D.next()).done;)ze(P.value)&&Ft(P.value,u)}}}function vr(t){{var u=t.type;if(u==null||typeof u=="string")return;var m;if(typeof u=="function")m=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===f||u.$$typeof===k))m=u.propTypes;else return;if(m){var b=I(u);rr(m,t.props,"prop",b,t)}else if(u.PropTypes!==void 0&&!qe){qe=!0;var T=I(u);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(t){{for(var u=Object.keys(t.props),m=0;m<u.length;m++){var b=u[m];if(b!=="children"&&b!=="key"){ie(t),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),ie(null);break}}t.ref!==null&&(ie(t),w("Invalid attribute `ref` supplied to `React.Fragment`."),ie(null))}}function At(t,u,m,b,T,D){{var P=G(t);if(!P){var C="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=hr(T);Y?C+=Y:C+=Lt();var U;t===null?U="null":Ye(t)?U="array":t!==void 0&&t.$$typeof===n?(U="<"+(I(t.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):U=typeof t,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,C)}var A=mr(t,u,m,T,D);if(A==null)return A;if(P){var H=u.children;if(H!==void 0)if(b)if(Ye(H)){for(var oe=0;oe<H.length;oe++)Ut(H[oe],t);Object.freeze&&Object.freeze(H)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(H,t)}return t===l?_r(A):vr(A),A}}function br(t,u,m){return At(t,u,m,!0)}function gr(t,u,m){return At(t,u,m,!1)}var Nr=gr,yr=br;ce.Fragment=l,ce.jsx=Nr,ce.jsxs=yr}()),ce}process.env.NODE_ENV==="production"?Se.exports=Mt():Se.exports=Yt();var Re=Se.exports;const X=Re.Fragment,i=Re.jsx,h=Re.jsxs,Te={},Jt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Kt="https://punkt-cdn.oslo.kommune.no/11.
|
|
27
|
+
Check the top-level render call using <`+m+">.")}return u}}function Ft(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var m=kr(u);if(It[m])return;It[m]=!0;var b="";t&&t._owner&&t._owner!==Ke.current&&(b=" It was passed a child from "+I(t._owner.type)+"."),ie(t),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,b),ie(null)}}function Ut(t,u){{if(typeof t!="object")return;if(Ye(t))for(var m=0;m<t.length;m++){var b=t[m];ze(b)&&Ft(b,u)}else if(ze(t))t._store&&(t._store.validated=!0);else if(t){var T=L(t);if(typeof T=="function"&&T!==t.entries)for(var D=T.call(t),P;!(P=D.next()).done;)ze(P.value)&&Ft(P.value,u)}}}function vr(t){{var u=t.type;if(u==null||typeof u=="string")return;var m;if(typeof u=="function")m=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===f||u.$$typeof===k))m=u.propTypes;else return;if(m){var b=I(u);rr(m,t.props,"prop",b,t)}else if(u.PropTypes!==void 0&&!qe){qe=!0;var T=I(u);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(t){{for(var u=Object.keys(t.props),m=0;m<u.length;m++){var b=u[m];if(b!=="children"&&b!=="key"){ie(t),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),ie(null);break}}t.ref!==null&&(ie(t),w("Invalid attribute `ref` supplied to `React.Fragment`."),ie(null))}}function At(t,u,m,b,T,D){{var P=G(t);if(!P){var C="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=hr(T);Y?C+=Y:C+=Lt();var U;t===null?U="null":Ye(t)?U="array":t!==void 0&&t.$$typeof===n?(U="<"+(I(t.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):U=typeof t,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,C)}var A=mr(t,u,m,T,D);if(A==null)return A;if(P){var H=u.children;if(H!==void 0)if(b)if(Ye(H)){for(var oe=0;oe<H.length;oe++)Ut(H[oe],t);Object.freeze&&Object.freeze(H)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(H,t)}return t===l?_r(A):vr(A),A}}function br(t,u,m){return At(t,u,m,!0)}function gr(t,u,m){return At(t,u,m,!1)}var Nr=gr,yr=br;ce.Fragment=l,ce.jsx=Nr,ce.jsxs=yr}()),ce}process.env.NODE_ENV==="production"?Se.exports=Mt():Se.exports=Yt();var Re=Se.exports;const X=Re.Fragment,i=Re.jsx,h=Re.jsxs,Te={},Jt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Kt="https://punkt-cdn.oslo.kommune.no/11.1/icons/",qt=(e,n)=>(!Te[e]&&typeof window.fetch=="function"&&(Te[e]=window.fetch(n+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+n+e+".svg"),Jt)).then(r=>r)),Promise.resolve(Te[e])),zt={fetchIcon:async(e,n)=>qt(e,n||Kt)},Xe=E.createContext(zt),x=({name:e,path:n,className:r="",...l})=>{const[a,o]=E.useState(null),s=E.useContext(Xe);return E.useEffect(()=>{e?s.fetchIcon(e,n).then(o):o(null)},[e,n]),a?i("span",{className:`pkt-icon ${r}`,dangerouslySetInnerHTML:{__html:a},...l}):null},Ze=E.forwardRef(({children:e,className:n,skin:r="info",closeAlert:l=!1,onClose:a,title:o,date:s,ariaLive:p="polite",slim:f=!1,...c},d)=>{const k=[n,"pkt-alert",r&&`pkt-alert--${r}`,f&&"pkt-alert--slim"].filter(Boolean).join(" "),[_,R]=E.useState(!0),S=()=>{R(!1),a&&a()};return _?h("div",{...c,className:k,"aria-live":p,ref:d,children:[i(x,{className:"pkt-alert__icon",name:r==="info"?"alert-information":`alert-${r}`}),l&&i("div",{className:"pkt-alert__close",children:i("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:S,children:i(x,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),o&&i("div",{className:"pkt-alert__title",children:o}),i("div",{className:"pkt-alert__text",children:e}),s&&h("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",s]})]}):null}),Gt=E.forwardRef(({href:e,text:n,onClick:r,className:l,...a},o)=>{const s=[l,"pkt-back-link"].filter(Boolean).join(" ");return i("nav",{ref:o,className:s,"aria-label":"Gå tilbake et steg",children:h("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:()=>{r&&r()},...a,children:[i(x,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),i("span",{className:"pkt-back-link__text",children:n||"Forsiden"})]})})});/**
|
|
28
28
|
* @remix-run/router v1.14.0
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,4 +55,4 @@ Check the top-level render call using <`+m+">.")}return u}}function Ft(t,u){{if(
|
|
|
55
55
|
Copyright (c) 2018 Jed Watson.
|
|
56
56
|
Licensed under the MIT License (MIT), see
|
|
57
57
|
http://jedwatson.github.io/classnames
|
|
58
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function r(){for(var l=[],a=0;a<arguments.length;a++){var o=arguments[a];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var p=r.apply(null,o);p&&l.push(p)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(kt);var Wn=kt.exports;const vt=Bt(Wn),Bn=E.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:l=!0,user:a,userMenu:o,representing:s,userOptions:p,userMenuFooter:f,canChangeRepresentation:c=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:_,logOut:R,changeRepresentation:S,...$},L)=>{const y=E.useMemo(()=>typeof(a==null?void 0:a.lastLoggedIn)=="string"?a.lastLoggedIn:a!=null&&a.lastLoggedIn?new Date(a.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[a]),[w,v]=E.useState(!1),[j,V]=E.useState(0),[W,B]=E.useState(!1),K=E.useRef(null);E.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",q),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",q)}));const M=()=>{B(!W)},G=g=>{K.current&&!K.current.contains(g.target)&&B(!1)},q=()=>{if(l){const g=window.pageYOffset||document.documentElement.scrollTop;if(g<0||Math.abs(g-j)<60)return;v(g>j),V(g)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:vt("pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":w}),ref:L,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(x,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.0/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(x,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.0/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:_,children:"Meny"})}),(a||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!w?"pkt-header--open-dropdown":""}`,ref:K,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(x,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(a==null?void 0:a.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(a==null?void 0:a.shortname)}),i(x,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(x,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[a&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:a.name}),a.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:y})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((g,I)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userMenu-${I}`))})}),(s||c)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:c&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(x,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(p||!k)&&h(X,{children:[p==null?void 0:p.map((g,I)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userOptions-${I}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:R,children:[i(x,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((g,I)=>i("li",{children:typeof g.target=="string"?i("a",{href:g.target,className:"pkt-link",children:g.title}):i("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:g.title})},`userMenuFooter-${I}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:R,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),_t=E.forwardRef(({label:e,id:n,children:r,...l},a)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:a}),r]}));_t.displayName="PktInput";const de=E.forwardRef(({forId:e,label:n,helptext:r,helptextDropdown:l,helptextDropdownButton:a,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:p=!1,requiredText:f="Må fylles ut",hasError:c,errorMessage:d,disabled:k,inline:_,ariaDescribedby:R,useWrapper:S=!0,children:$,className:L,hasFieldset:y=!1},w)=>{const[v,j]=E.useState(!1),V=()=>{j(!v)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":p?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:p?f:"",K=k?"pkt-inputwrapper--disabled":"",M=_?"pkt-inputwrapper--inline":"",G=c?"pkt-inputwrapper--error":"",q=!!l&&l!=="",g=a||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',I=y?"fieldset":q?"div":"label",J=y?"legend":q?"h2":"span",z=R||(r?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",L,K,M,G].join(" "),ref:w,children:[S?i(X,{children:h(I,{htmlFor:y?void 0:e,"aria-describedby":q?void 0:R,className:`pkt-inputwrapper__label${y?" pkt-inputwrapper__fieldset":""}`,children:[h(J,{id:`${e}-label`,className:`${y?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),r&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:r}}),q&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:v?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:g}})}),i("div",{className:`pkt-inputwrapper__helptext ${v?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!y&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":z,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!y&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":z,id:`${e}-label`,children:n}),$]}),c&&d&&i("div",{children:i(Ze,{skin:"error","aria-live":"assertive",id:`${e}-error`,slim:!0,children:d})})]})});de.displayName="PktInputWrapper";const bt=E.forwardRef(({children:e,className:n,iconName:r="user",openInNewTab:l=!1,skin:a="normal",href:o="#",external:s=!1,title:p,...f},c)=>{const d=[n,"pkt-linkcard",a&&`pkt-linkcard--${a}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:c,children:[i(x,{className:"pkt-link__icon",name:r}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:p}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});bt.displayName="PktLinkCard";const Mn=({children:e,skin:n="beige",title:r,className:l,...a})=>{const o=["pkt-messagebox",n&&`pkt-messagebox--${n}`,l].filter(Boolean).join(" ");return h("div",{...a,className:o,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},gt=E.forwardRef(({id:e,name:n,label:r,className:l,hasTile:a=!1,disabled:o=!1,checkHelptext:s,hasError:p=!1,...f},c)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${a?"pkt-input-check__input--tile":""} ${o&&a?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:c,className:`pkt-input-check__input-checkbox ${p?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[r,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});gt.displayName="PktRadioButton";const Yn=E.forwardRef(({action:e,appearance:n="local",disabled:r=!1,fullwidth:l=!1,id:a,label:o,method:s="get",name:p,placeholder:f="Søk…",suggestions:c,value:d="",onSearch:k,onSuggestionClick:_,...R},S)=>{const $=(v,j)=>{v?v():_&&_(j)},L=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:L,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:S,...R,children:[h(o?"label":"div",{htmlFor:o?a:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:p||a,id:a,placeholder:f,value:d,disabled:r,onInput:k&&(v=>k(v.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${a}-suggestions`}),i(le,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:r,onClick:k&&(()=>k(d)),onKeyUp:k&&(v=>v.key==="Enter"&&k(d)),children:o||f})]})]}),c&&i("ul",{id:`${a}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((v,j)=>i("li",{children:E.createElement(v.href?"a":v.onClick?"button":"div",{href:v.href,className:`pkt-searchinput__suggestion ${v.onClick?"pkt-link-button":""} ${v.href||v.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:v.onClick?"button":void 0,onClick:()=>$(v.onClick,j),onKeyUp:()=>$(v.onClick,j)},h(X,{children:[v.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:v.title}),v.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:v.text})]}))},`search-suggestion-${j}`))})]})}),Jn=E.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:r,className:l,disabled:a=!1,errorMessage:o,hasError:s,helptext:p,helptextDropdown:f,helptextDropdownButton:c,id:d,inline:k=!1,fullwidth:_=!1,label:R,name:S,optionalTag:$=!1,optionalText:L,requiredTag:y=!1,requiredText:w,...v},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:R,helptext:p,helptextDropdown:f,helptextDropdownButton:c,optionalTag:$,optionalText:L,requiredTag:y,requiredText:w,hasError:s,errorMessage:o,disabled:a,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${_?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:a,id:d,name:S||d,...v,children:r})})}),Kn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),qn=({isResponsive:e,modifiers:{info:n=!1,success:r=!1,strong:l=!1,shadow:a=!1}={},children:o})=>i(Kn,{isResponsive:e,children:i("table",{className:vt("pkt-table",{"pkt-table--info":n,"pkt-table--success":r,"pkt-table--strong":l,"pkt-table--shadow":a}),children:o})}),zn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Gn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),Nt=E.forwardRef(({children:e,className:n,skin:r="blue",textStyle:l="normal-text",size:a="medium",closeTag:o=!1,iconName:s="",type:p="button",ariaLabel:f="close",onClick:c=()=>{}},d)=>{const[k,_]=E.useState(!1),R=y=>{_(!0),c(y)},S=["pkt-tag",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),L=!k;return o&&s?i(X,{children:L&&h("button",{className:$,type:p,"aria-label":f,onClick:R,ref:d,children:[i(x,{className:"pkt-tag__icon",name:s}),e,i(x,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:L&&h("button",{className:$,type:p,"aria-label":f,onClick:R,ref:d,children:[i(x,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:S,children:[i(x,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:S,children:e})});Nt.displayName="PktTag";const Hn=E.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,counter:l,counterMaxLength:a,className:o,disabled:s,errorMessage:p,hasError:f,helptext:c,helptextDropdown:d,helptextDropdownButton:k,inline:_,fullwidth:R=!1,label:S,name:$,optionalTag:L=!1,optionalText:y,requiredTag:w=!1,requiredText:v,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...K},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),q=r||`${e}-label`,g=E.useRef(null),[I,J]=E.useState(0),z=ee=>{var te,me;if(l&&J(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return E.useEffect(()=>{var ee,te;typeof M=="function"&&M(g.current),l&&J(((te=(ee=g==null?void 0:g.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:p,forId:e,hasError:f,helptext:c,helptextDropdown:d,helptextDropdownButton:k,inline:_,label:S,optionalTag:L,optionalText:y,requiredTag:w,requiredText:v,useWrapper:W,children:[i("textarea",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""} ${a&&I>a?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":q,"aria-invalid":f,"aria-errormessage":`${e}-error`,...K,onChange:z}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[I||0,a&&`/${a}`]})]})}),Xn=E.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,autocomplete:l="off",className:a,disabled:o=!1,errorMessage:s,hasError:p=!1,helptext:f,helptextDropdown:c,helptextDropdownButton:d,iconNameRight:k,inline:_=!1,fullwidth:R=!1,label:S,name:$,optionalTag:L=!1,optionalText:y,requiredTag:w=!1,requiredText:v,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:K=!0,omitSearchIcon:M=!1,value:G,...q},g)=>{const I=[a,"pkt-textinput"].join(" "),J=r||`${e}-label`,z=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:I,disabled:o,errorMessage:s,forId:e,hasError:p,helptext:f,helptextDropdown:c,helptextDropdownButton:d,inline:_,label:S,optionalTag:L,optionalText:y,requiredTag:w,requiredText:v,useWrapper:K,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":p,"aria-errormessage":`${e}-error`,"aria-labelledby":J,...q}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(x,{className:"pkt-input-suffix-icon",name:k}),z&&i(x,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(x,{className:"pkt-input-icon",name:k}),!W&&z&&i(x,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});O.PktAlert=Ze,O.PktBackLink=Gt,O.PktBreadcrumbs=Un,O.PktButton=le,O.PktCheckbox=ht,O.PktFooter=An,O.PktFooterSimple=Vn,O.PktHeader=Bn,O.PktIcon=x,O.PktIconContext=Xe,O.PktInput=_t,O.PktInputWrapper=de,O.PktLinkCard=bt,O.PktMessagebox=Mn,O.PktRadioButton=gt,O.PktSearchInput=Yn,O.PktSelect=Jn,O.PktTable=qn,O.PktTableData=zn,O.PktTableHeader=Gn,O.PktTag=Nt,O.PktTextarea=Hn,O.PktTextinput=Xn,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
|
58
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function r(){for(var l=[],a=0;a<arguments.length;a++){var o=arguments[a];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var p=r.apply(null,o);p&&l.push(p)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(kt);var Wn=kt.exports;const vt=Bt(Wn),Bn=E.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:l=!0,user:a,userMenu:o,representing:s,userOptions:p,userMenuFooter:f,canChangeRepresentation:c=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:_,logOut:R,changeRepresentation:S,...$},L)=>{const y=E.useMemo(()=>typeof(a==null?void 0:a.lastLoggedIn)=="string"?a.lastLoggedIn:a!=null&&a.lastLoggedIn?new Date(a.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[a]),[w,v]=E.useState(!1),[j,V]=E.useState(0),[W,B]=E.useState(!1),K=E.useRef(null);E.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",q),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",q)}));const M=()=>{B(!W)},G=g=>{K.current&&!K.current.contains(g.target)&&B(!1)},q=()=>{if(l){const g=window.pageYOffset||document.documentElement.scrollTop;if(g<0||Math.abs(g-j)<60)return;v(g>j),V(g)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:vt("pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":w}),ref:L,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(x,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.1/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(x,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.1/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:_,children:"Meny"})}),(a||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!w?"pkt-header--open-dropdown":""}`,ref:K,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(x,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(a==null?void 0:a.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(a==null?void 0:a.shortname)}),i(x,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(x,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[a&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:a.name}),a.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:y})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((g,I)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userMenu-${I}`))})}),(s||c)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:c&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(x,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(p||!k)&&h(X,{children:[p==null?void 0:p.map((g,I)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(x,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userOptions-${I}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:R,children:[i(x,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((g,I)=>i("li",{children:typeof g.target=="string"?i("a",{href:g.target,className:"pkt-link",children:g.title}):i("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:g.title})},`userMenuFooter-${I}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:R,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),_t=E.forwardRef(({label:e,id:n,children:r,...l},a)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:a}),r]}));_t.displayName="PktInput";const de=E.forwardRef(({forId:e,label:n,helptext:r,helptextDropdown:l,helptextDropdownButton:a,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:p=!1,requiredText:f="Må fylles ut",hasError:c,errorMessage:d,disabled:k,inline:_,ariaDescribedby:R,useWrapper:S=!0,children:$,className:L,hasFieldset:y=!1},w)=>{const[v,j]=E.useState(!1),V=()=>{j(!v)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":p?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:p?f:"",K=k?"pkt-inputwrapper--disabled":"",M=_?"pkt-inputwrapper--inline":"",G=c?"pkt-inputwrapper--error":"",q=!!l&&l!=="",g=a||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',I=y?"fieldset":q?"div":"label",J=y?"legend":q?"h2":"span",z=R||(r?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",L,K,M,G].join(" "),ref:w,children:[S?i(X,{children:h(I,{htmlFor:y?void 0:e,"aria-describedby":q?void 0:R,className:`pkt-inputwrapper__label${y?" pkt-inputwrapper__fieldset":""}`,children:[h(J,{id:`${e}-label`,className:`${y?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),r&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:r}}),q&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:v?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:g}})}),i("div",{className:`pkt-inputwrapper__helptext ${v?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!y&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":z,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!y&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":z,id:`${e}-label`,children:n}),$]}),c&&d&&i("div",{children:i(Ze,{skin:"error","aria-live":"assertive",id:`${e}-error`,slim:!0,children:d})})]})});de.displayName="PktInputWrapper";const bt=E.forwardRef(({children:e,className:n,iconName:r="user",openInNewTab:l=!1,skin:a="normal",href:o="#",external:s=!1,title:p,...f},c)=>{const d=[n,"pkt-linkcard",a&&`pkt-linkcard--${a}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:c,children:[i(x,{className:"pkt-link__icon",name:r}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:p}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});bt.displayName="PktLinkCard";const Mn=({children:e,skin:n="beige",title:r,className:l,...a})=>{const o=["pkt-messagebox",n&&`pkt-messagebox--${n}`,l].filter(Boolean).join(" ");return h("div",{...a,className:o,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},gt=E.forwardRef(({id:e,name:n,label:r,className:l,hasTile:a=!1,disabled:o=!1,checkHelptext:s,hasError:p=!1,...f},c)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${a?"pkt-input-check__input--tile":""} ${o&&a?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:c,className:`pkt-input-check__input-checkbox ${p?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[r,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});gt.displayName="PktRadioButton";const Yn=E.forwardRef(({action:e,appearance:n="local",disabled:r=!1,fullwidth:l=!1,id:a,label:o,method:s="get",name:p,placeholder:f="Søk…",suggestions:c,value:d="",onSearch:k,onSuggestionClick:_,...R},S)=>{const $=(v,j)=>{v?v():_&&_(j)},L=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:L,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:S,...R,children:[h(o?"label":"div",{htmlFor:o?a:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:p||a,id:a,placeholder:f,value:d,disabled:r,onInput:k&&(v=>k(v.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${a}-suggestions`}),i(le,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:r,onClick:k&&(()=>k(d)),onKeyUp:k&&(v=>v.key==="Enter"&&k(d)),children:o||f})]})]}),c&&i("ul",{id:`${a}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((v,j)=>i("li",{children:E.createElement(v.href?"a":v.onClick?"button":"div",{href:v.href,className:`pkt-searchinput__suggestion ${v.onClick?"pkt-link-button":""} ${v.href||v.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:v.onClick?"button":void 0,onClick:()=>$(v.onClick,j),onKeyUp:()=>$(v.onClick,j)},h(X,{children:[v.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:v.title}),v.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:v.text})]}))},`search-suggestion-${j}`))})]})}),Jn=E.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:r,className:l,disabled:a=!1,errorMessage:o,hasError:s,helptext:p,helptextDropdown:f,helptextDropdownButton:c,id:d,inline:k=!1,fullwidth:_=!1,label:R,name:S,optionalTag:$=!1,optionalText:L,requiredTag:y=!1,requiredText:w,...v},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:R,helptext:p,helptextDropdown:f,helptextDropdownButton:c,optionalTag:$,optionalText:L,requiredTag:y,requiredText:w,hasError:s,errorMessage:o,disabled:a,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${_?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:a,id:d,name:S||d,...v,children:r})})}),Kn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),qn=({isResponsive:e,modifiers:{info:n=!1,success:r=!1,strong:l=!1,shadow:a=!1}={},children:o})=>i(Kn,{isResponsive:e,children:i("table",{className:vt("pkt-table",{"pkt-table--info":n,"pkt-table--success":r,"pkt-table--strong":l,"pkt-table--shadow":a}),children:o})}),zn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Gn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),Nt=E.forwardRef(({children:e,className:n,skin:r="blue",textStyle:l="normal-text",size:a="medium",closeTag:o=!1,iconName:s="",type:p="button",ariaLabel:f="close",onClick:c=()=>{}},d)=>{const[k,_]=E.useState(!1),R=y=>{_(!0),c(y)},S=["pkt-tag",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),L=!k;return o&&s?i(X,{children:L&&h("button",{className:$,type:p,"aria-label":f,onClick:R,ref:d,children:[i(x,{className:"pkt-tag__icon",name:s}),e,i(x,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:L&&h("button",{className:$,type:p,"aria-label":f,onClick:R,ref:d,children:[i(x,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:S,children:[i(x,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:S,children:e})});Nt.displayName="PktTag";const Hn=E.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,counter:l,counterMaxLength:a,className:o,disabled:s,errorMessage:p,hasError:f,helptext:c,helptextDropdown:d,helptextDropdownButton:k,inline:_,fullwidth:R=!1,label:S,name:$,optionalTag:L=!1,optionalText:y,requiredTag:w=!1,requiredText:v,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...K},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),q=r||`${e}-label`,g=E.useRef(null),[I,J]=E.useState(0),z=ee=>{var te,me;if(l&&J(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return E.useEffect(()=>{var ee,te;typeof M=="function"&&M(g.current),l&&J(((te=(ee=g==null?void 0:g.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:p,forId:e,hasError:f,helptext:c,helptextDropdown:d,helptextDropdownButton:k,inline:_,label:S,optionalTag:L,optionalText:y,requiredTag:w,requiredText:v,useWrapper:W,children:[i("textarea",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""} ${a&&I>a?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":q,"aria-invalid":f,"aria-errormessage":`${e}-error`,...K,onChange:z}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[I||0,a&&`/${a}`]})]})}),Xn=E.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,autocomplete:l="off",className:a,disabled:o=!1,errorMessage:s,hasError:p=!1,helptext:f,helptextDropdown:c,helptextDropdownButton:d,iconNameRight:k,inline:_=!1,fullwidth:R=!1,label:S,name:$,optionalTag:L=!1,optionalText:y,requiredTag:w=!1,requiredText:v,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:K=!0,omitSearchIcon:M=!1,value:G,...q},g)=>{const I=[a,"pkt-textinput"].join(" "),J=r||`${e}-label`,z=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:I,disabled:o,errorMessage:s,forId:e,hasError:p,helptext:f,helptextDropdown:c,helptextDropdownButton:d,inline:_,label:S,optionalTag:L,optionalText:y,requiredTag:w,requiredText:v,useWrapper:K,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":p,"aria-errormessage":`${e}-error`,"aria-labelledby":J,...q}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(x,{className:"pkt-input-suffix-icon",name:k}),z&&i(x,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(x,{className:"pkt-input-icon",name:k}),!W&&z&&i(x,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});O.PktAlert=Ze,O.PktBackLink=Gt,O.PktBreadcrumbs=Un,O.PktButton=le,O.PktCheckbox=ht,O.PktFooter=An,O.PktFooterSimple=Vn,O.PktHeader=Bn,O.PktIcon=x,O.PktIconContext=Xe,O.PktInput=_t,O.PktInputWrapper=de,O.PktLinkCard=bt,O.PktMessagebox=Mn,O.PktRadioButton=gt,O.PktSearchInput=Yn,O.PktSelect=Jn,O.PktTable=qn,O.PktTableData=zn,O.PktTableHeader=Gn,O.PktTag=Nt,O.PktTextarea=Hn,O.PktTextinput=Xn,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@oslokommune/punkt-assets": "^11.0.0",
|
|
36
|
-
"@oslokommune/punkt-css": "^11.0
|
|
36
|
+
"@oslokommune/punkt-css": "^11.1.0",
|
|
37
37
|
"@testing-library/jest-dom": "^5.16.5",
|
|
38
38
|
"@testing-library/react": "^14.0.0",
|
|
39
39
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
92
92
|
},
|
|
93
93
|
"license": "MIT",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "5be342b1ed48973fbc787c0c9f561439c704e80e"
|
|
95
95
|
}
|