@k8slens/lds 0.51.5 → 0.51.7

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.defaultItems=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"connected-accounts",title:"Your Connected Accounts",href:"/connected-accounts"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}],exports.defaultOrigin="https://app.k8slens.dev";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.defaultItems=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"auth-providers",title:"Your Auth Providers",href:"/auth-providers"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}],exports.defaultOrigin="https://app.k8slens.dev";
@@ -1 +1 @@
1
- var e="https://app.k8slens.dev",t=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"connected-accounts",title:"Your Connected Accounts",href:"/connected-accounts"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}];export{t as defaultItems,e as defaultOrigin};
1
+ var e="https://app.k8slens.dev",t=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"auth-providers",title:"Your Auth Providers",href:"/auth-providers"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}];export{t as defaultItems,e as defaultOrigin};
@@ -16,4 +16,4 @@
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */"production"===process.env.NODE_ENV?function(){if(bc)return yc;bc=1;var e=o.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function l(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var o=t(),u=n({inst:{value:o,getSnapshot:t}}),s=u[0].inst,c=u[1];return a((function(){s.value=o,s.getSnapshot=t,l(s)&&c({inst:s})}),[e,o,t]),r((function(){return l(s)&&c({inst:s}),e((function(){l(s)&&c({inst:s})}))}),[e]),i(o),o};yc.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u}():wc||(wc=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=o.default,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];!function(e,n,r){var a=t.ReactDebugCurrentFrame.getStackAddendum();""!==a&&(n+="%s",r=r.concat([a]));var o=r.map((function(e){return String(e)}));o.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,o)}("error",e,r)}var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,s=!1,c=!1;function d(e){var t=e.getSnapshot,n=e.value;try{var a=t();return!r(n,a)}catch(e){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t,n){return t()}:function(t,o,f){s||void 0!==e.startTransition&&(s=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=o();if(!c){var m=o();r(p,m)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var v=a({inst:{value:p,getSnapshot:o}}),h=v[0].inst,g=v[1];return l((function(){h.value=p,h.getSnapshot=o,d(h)&&g({inst:h})}),[t,p,o]),i((function(){return d(h)&&g({inst:h}),t((function(){d(h)&&g({inst:h})}))}),[t]),u(p),p},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:f;Ec.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}());var xc={exports:{}},Oc={exports:{}};(function(){var e,t,n,r,a,o;"undefined"!=typeof performance&&null!==performance&&performance.now?Oc.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(Oc.exports=function(){return(e()-a)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),o=1e9*process.uptime(),a=r-o):Date.now?(Oc.exports=function(){return Date.now()-n},n=Date.now()):(Oc.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(f);for(var Sc=Oc.exports,Nc="undefined"==typeof window?f:window,Rc=["moz","webkit"],Tc="AnimationFrame",Cc=Nc["request"+Tc],kc=Nc["cancel"+Tc]||Nc["cancelRequest"+Tc],Pc=0;!Cc&&Pc<Rc.length;Pc++)Cc=Nc[Rc[Pc]+"Request"+Tc],kc=Nc[Rc[Pc]+"Cancel"+Tc]||Nc[Rc[Pc]+"CancelRequest"+Tc];if(!Cc||!kc){var Lc=0,Mc=0,Ic=[];Cc=function(e){if(0===Ic.length){var t=Sc(),n=Math.max(0,16.666666666666668-(t-Lc));Lc=n+t,setTimeout((function(){var e=Ic.slice(0);Ic.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(Lc)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return Ic.push({handle:++Mc,callback:e,cancelled:!1}),Mc},kc=function(e){for(var t=0;t<Ic.length;t++)Ic[t].handle===e&&(Ic[t].cancelled=!0)}}xc.exports=function(e){return Cc.call(Nc,e)},xc.exports.cancel=function(){kc.apply(Nc,arguments)},xc.exports.polyfill=function(e){e||(e=Nc),e.requestAnimationFrame=Cc,e.cancelAnimationFrame=kc};var Dc="lds-tooltip",Ac="lds-tooltip--visible",jc="lds-tooltip--caret",_c={subtree:!0,childList:!0,attributes:!1,characterData:!1};var Fc=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"connected-accounts",title:"Your Connected Accounts",href:"/connected-accounts"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}],Bc={userMenuItem:"lds-user-menu-item",button:"lds-user-menu-item--button",disabled:"lds-user-menu-item--disabled",selected:"lds-user-menu-item--selected",icon:"lds-user-menu-item--icon",danger:"lds-user-menu-item--danger",external:"lds-user-menu-item--external",title:"lds-user-menu-item--title"},zc=function(e,t){return new URL(e,t).pathname},Hc=function(e){var t=e.Icon,n=e.title;return o.default.createElement(o.default.Fragment,null,t?o.default.createElement(t,{className:Bc.icon,size:"sm"}):null,o.default.createElement("span",{className:Bc.title},n))};function Vc(e){var n=e.type,r=void 0===n?"default":n,a=e.title,i=e.icon,l=e.disabled,s=e.external,c=e.onClick,f=e.selected,p=e.href,m=e.origin,v=e.className,h=t.useMemo((function(){return s||!p?p:m?"".concat(m).concat((null==p?void 0:p.startsWith("/"))?p:"/".concat(p)):p}),[p,m,s]),g=t.useMemo((function(){return"boolean"==typeof f?f:!(!h||"undefined"==typeof window)&&zc(window.location.href,"undefined"!=typeof window?window.location.origin:void 0)===zc(h,h)}),[h,f]),b=t.useMemo((function(){var e;return d(Bc.userMenuItem,((e={})[Bc[r]]=r&&"default"!==r,e[Bc.disabled]=l,e[Bc.external]=s,e[Bc.selected]=g,e),v)}),[r,l,s,v,g]);return l||f||!h?l||f||!c?o.default.createElement(yn.Item,{disabled:!0},o.default.createElement("span",{className:d(b,Bc.disabled)},o.default.createElement(Hc,{Icon:i,title:a}))):o.default.createElement(yn.Item,null,o.default.createElement("button",{className:d(Bc.button,b),onClick:c},o.default.createElement(Hc,{Icon:i,title:a}))):o.default.createElement(yn.Item,null,o.default.createElement("a",u({className:b,onClick:c,href:h},s?{target:"_blank"}:{},{rel:"noopener noreferrer"}),o.default.createElement(Hc,{Icon:i,title:a})))}var qc={userMenuDropdown:"lds-user-menu-dropdown",content:"lds-user-menu-dropdown--content",open:"lds-user-menu-dropdown--open",group:"lds-user-menu-dropdown--group",last:"lds-user-menu-dropdown--last"},$c=$l("1rem"),Uc={name:"offset",options:{offset:function(e){var t=e.placement;return t.startsWith("top")||t.startsWith("bottom")?[0,-1]:[0,0]}}},Wc={name:"maxSize",enabled:!0,phase:"main",fn:function(e){var t=e.state;if(void 0!==$c&&"undefined"!=typeof window&&"undefined"!=typeof document){var n=t.elements.reference.getBoundingClientRect(),r=document.documentElement,a=t.placement.endsWith("start")?Math.min(r.clientWidth,window.innerWidth)-n.left-$c:n.right-$c,o=t.placement.startsWith("bottom")?Math.min(r.clientHeight,window.innerHeight)-n.bottom-$c:n.top-$c;t.styles.popper=u(u({},t.styles.popper),{maxWidth:"".concat(a,"px"),maxHeight:"".concat(o,"px")})}}};function Gc(e){var n,r,a=e.header,i=e.footer,l=e.origin,s=e.className,c=e.groups,f=e.open,p=e.buttonRef,m=t.useRef(null),v=Gs(null==p?void 0:p.current,null==m?void 0:m.current,{placement:"bottom-start",modifiers:[{name:"flip",options:{fallbackPlacements:["top-start","bottom-end","top-end"]}},{name:"preventOverflow",options:{boundary:"viewport"}},{name:"computeStyles",options:{adaptive:!0}},Uc,Wc]}),h=v.styles,g=v.attributes;return o.default.createElement(er,u({show:f,enter:"transition duration-[".concat(ql,"] ease-in-out"),enterFrom:"transform opacity-0",enterTo:"transform opacity-100",leave:"transition duration-[".concat(ql,"] ease-in-out"),leaveFrom:"transform opacity-100",leaveTo:"transform opacity-0",className:d(qc.userMenuDropdown,s),ref:m,style:u(u({},h.popper),{minWidth:null===(r=null==p?void 0:p.current)||void 0===r?void 0:r.offsetWidth})},g.popper),o.default.createElement(yn.Items,{className:d(qc.content,(n={},n[qc.open]=f,n))},a,c.map((function(e,t){var n,r=e.children;return o.default.createElement("div",{className:d(qc.group,(n={},n[qc.last]=t===c.length-1,n)),key:"group-".concat(t),role:"navigation"},r.map((function(e,t){return o.default.createElement(Vc,{key:"key"in e?e.key:"item-".concat(t),title:e.title,icon:e.icon,type:e.type,disabled:e.disabled,external:e.external,href:e.href,onClick:"onClick"in e?e.onClick:void 0,origin:l})})))})),i))}var Qc="lds-user-menu",Kc="lds-user-menu--button",Yc="lds-user-menu--profile-block",Zc="lds-user-menu--drop-down-icon",Xc="lds-user-menu--open",Jc="lds-user-menu--disabled",ed=nl,td=Xi;var nd="lds-default-header",rd="lds-default-header--header",ad=function(e){var t=wi(e,[]);return o.default.createElement(Ii,yi({icon:Qi},t))},od="lds-switch",id="lds-switch--disabled";e.Avatar=w,e.Badge=function(e){var t,n=e.className,r=e.type,a=void 0===r?"secondary":r,i=e.size,l=void 0===i?"sm":i,c=e.title,f=s(e,["className","type","size","title"]),p="role"in f?f.role:"status",m=!c||f["aria-hidden"];return o.default.createElement("span",u({},f,{"aria-hidden":m,title:c,role:p,className:d(E.badge,(t={},t[E[l]]="sm"!==l,t[E[a]]="secondary"!==a,t),n)}))},e.Button=O,e.ButtonBar=N,e.Checkbox=function(e){var t=e.disabled,n=e.value,r=e.onChange,a=s(e,["disabled","value","onChange"]);return o.default.createElement("input",u({type:"checkbox",checked:n,onChange:function(e){t||r(!n,e)},disabled:t},a,{className:d(R,(null==a?void 0:a.className)||"")}))},e.ConfirmDialog=yl,e.DrawerTransition=wl,e.Input=Nl,e.LinkButton=Cl,e.LoadingIndicator=cl,e.Lozenge=Pl,e.Modal=vl,e.Notification=function(e){var n=e.level,r=void 0===n?"info":n,a=e.type,i=void 0===a?"default":a,l=e.title,u=e.message,s=e.flashDuration,c=void 0===s?5e3:s,f=e.onClose,p=e.className,m=t.useState(!0),v=m[0],h=m[1],g=t.useRef(null),b="flash"===i?300:200,y=t.useCallback((function(){"flash"===i&&setTimeout((function(){try{h(!1)}catch(e){}}),c)}),[i,c]);return o.default.createElement(wl,{open:v,role:"alert",className:d(p,Ll.wrapper,Ll[r],Ll[i]),afterEnter:y,afterExit:f,duration:b},o.default.createElement("div",{ref:g,className:Ll.alert},"success"===r&&o.default.createElement(Il,{size:"xl"}),"info"===r&&o.default.createElement(Al,{size:"xl"}),("error"===r||"warning"===r)&&o.default.createElement(Dl,{size:"xl"}),o.default.createElement("div",null,l&&o.default.createElement("h5",null,l),o.default.createElement("p",null,u)),"closable"===i&&o.default.createElement("button",{type:"button",onClick:function(){return h(!1)},"aria-label":"Close"},o.default.createElement(Ml,{size:"lg",color:"on-dark"}))))},e.NumberBadge=function(e){var t=e.className,n=e.value,r=e.showZero,a=e.displayPlusSign,i=e.title,l=s(e,["className","value","showZero","displayPlusSign","title"]);if(null==n||0===n&&!r)return null;var c=function(e){var t=Math.abs(e),n=e<0?"-":"";return t>=1e6?t>99e6?_l(e/1e6).replace(/\+$/,"M+"):"".concat(n).concat((t/1e6).toFixed(1),"M"):t>=1e3?t>99e3?_l(e/1e3).replace(/\+$/,"k+"):"".concat(n).concat((t/1e3).toFixed(1),"k"):_l(e)}(n);n>0&&a&&(c="+".concat(c));var f="role"in l?l.role:"status",p=!i||l["aria-hidden"];return o.default.createElement(Pl,u({},l,{"aria-hidden":p,title:i,className:d(jl,t),role:f,size:"sm"}),c)},e.Panel=pl,e.ProfileBlock=Hl,e.ProgressBar=function(e){var t,n=e.value,r=e.type,a=void 0===r?"default":r,i=e.max,l=void 0===i?1:i,c=e.title,f=e.className,p=s(e,["value","type","max","title","className"]),m=isNaN(n)?0:Math.max(0,n),v=isNaN(l)||l<=0?1:l,h=Math.min(100,Math.round(m/v*100)),g=c||"".concat(h,"%");return o.default.createElement("progress",u({},p,{className:d(Vl.progressBar,f,(t={},t[Vl[a]]="default"!==a,t)),value:m,max:v,"aria-valuetext":g,title:c}),g)},e.RadioCard=function(e){var t=e.id,n=e["aria-label"],r=e.value,a=e.options,i=e.onChange,l=e.name,c=e.invalid,f=e.disabled,p=e.itemClassName,m=e.className,v=e.renderItem,h=void 0===v?function(e){return o.default.createElement("span",{className:tu},o.default.createElement("span",{className:nu},e.label),o.default.createElement("span",{className:ru},e.subtitle))}:v,g=s(e,["id","aria-label","value","options","onChange","name","invalid","disabled","itemClassName","className","renderItem"]);return o.default.createElement(jn,u({},g,{id:t,by:"id",value:r,onChange:i,"aria-label":n,className:d(Xl,m),name:l}),a.map((function(e){return o.default.createElement(jn.Option,{key:e.id,value:e,disabled:f||e.disabled,className:function(e){var t,n=e.checked;return d(Jl,p,((t={})[au]=n,t[ou]=c,t))}},(function(t){var n=t.checked;return o.default.createElement(o.default.Fragment,null,o.default.createElement("span",{className:eu},o.default.createElement("span",null)),h(e,{invalid:c,selected:n,disabled:f||e.disabled}))}))})))},e.Select=function(e){var n=e.id,r=e["aria-label"],a=e.value,i=e.options,l=e.onChange,u=e.placeholder,c=void 0===u?"":u,f=e.name,p=e.invalid,m=e.disabled,v=e.className,h=e.dropdownClassName,g=e.itemClassName,b=e.renderContent,y=void 0===b?function(e,t,n){return e?e.label:n}:b,w=e.loading,E=e.title,x=e.openingDirection,O=e.maxHeight,S=e.size,N=s(e,["id","aria-label","value","options","onChange","placeholder","name","invalid","disabled","className","dropdownClassName","itemClassName","renderContent","loading","title","openingDirection","maxHeight","size"]),R=t.useRef(null),T=t.useRef(null),C=1===i.length;return t.useEffect((function(){var e,t;(null===(e=N.buttonRef)||void 0===e?void 0:e.current)&&(R.current=null===(t=N.buttonRef)||void 0===t?void 0:t.current)}),[N.buttonRef]),o.default.createElement(nn,{value:a,onChange:l,name:f,disabled:m},(function(e){var t,l,u,s=e.open;return o.default.createElement("div",{className:d(Ql.select,v,(t={},t[Ql.invalid]=p,t[Ql.locked]=C,t[Ql.disabled]=m||w,t[Ql.open]=s,t))},o.default.createElement(nn.Button,{id:n,ref:N.buttonRef?N.buttonRef:R,"aria-label":r,className:d(Ql.selectButton),title:E},o.default.createElement("span",{className:d(Ql.item,Ql.selectedItem,(l={},l[Ql.disabled]=m||w,l[Ql.invalid]=p,l[Ql.placeholder]=!a,l[Ql.lg]="lg"===S,l),null!==(u="function"==typeof g?g({disabled:Boolean(m),invalid:Boolean(p)}):g)&&void 0!==u?u:"")},w?o.default.createElement(cl,{className:Ql.loadingIndicator}):y(a,{invalid:p,disabled:m},c)),s?o.default.createElement(Zl,{className:Ql.dropDownIcon}):o.default.createElement(Yl,{className:Ql.dropDownIcon})),o.default.createElement(Gl,{listRef:T,buttonRef:R,openingDirection:x,maxHeight:O},o.default.createElement(nn.Options,{ref:T,className:d(Ql.dropdown,h)},i.length>0?i.map((function(e){var t;if("options"in e){var n="".concat(e.id,"-label");return o.default.createElement("li",{key:e.id,className:Ql.group,role:"group","aria-labelledby":n},o.default.createElement("span",{id:n,className:d(Ql.groupLabel,(t={},t[Ql.lg]="lg"===S,t))},e.label),o.default.createElement("ul",{className:Ql.groupList},e.options.map((function(e){return o.default.createElement(Kl,{key:e.id,option:e,currentValue:a,size:S,itemClassName:g,renderContent:y,placeholder:c})}))))}return o.default.createElement(Kl,{key:e.id,option:e,currentValue:a,size:S,itemClassName:g,renderContent:y,placeholder:c})})):null)))}))},e.SideNav=uu,e.SideNavGroup=fu,e.SideNavItem=mu,e.Switch=function(e){var t,n=e.className,r=e.children,a=e.disabled,i=e.onChange,l=s(e,["className","children","disabled","onChange"]);return o.default.createElement("label",{className:d(od,n,(t={},t[id]=a,t)),"data-testid":"switch"},r,o.default.createElement("input",u({type:"checkbox",role:"switch",disabled:a,onChange:function(e){return null==i?void 0:i(e.target.checked,e)}},l)))},e.Tooltip=function(e){var n,r=e.id,a=e.wrapper,i=void 0===a?"span":a,l=e.mutationsListenerElement,c=e.popupClassName,f=e.placement,p=void 0===f?"auto":f,m=e.alwaysVisible,v=void 0!==m&&m,h=e.text,g=e.children,b=s(e,["id","wrapper","mutationsListenerElement","popupClassName","placement","alwaysVisible","text","children"]),y=t.useMemo((function(){return"tooltip-".concat(r||Math.random().toString(36).substr(2,9))}),[r]),w=t.useMemo((function(){return l||("undefined"!=typeof document&&"body"in document?document.body:null)}),[l]),E=t.useRef(null),x=t.useRef(null),O=t.useRef(w),S=t.useState(v),N=S[0],R=S[1],T=t.useState(),C=T[0],k=T[1],P=t.useCallback((function(e){k(e)}),[]),L=t.useMemo((function(){return[{name:"offset",options:{offset:[20,0]}},{name:"arrow",options:{padding:6}}]}),[]),M=Gs(null==x?void 0:x.current,C,{placement:p,modifiers:L,strategy:"fixed"}),I=M.styles,D=M.attributes,A=M.update,j=pc((function(){var e;null===(e=null==A?void 0:A())||void 0===e||e.catch((function(e){console.error(e)}))}),250);!function(e,n,r=vc){t.useEffect((()=>{if(e.current){const t=new MutationObserver(n);return t.observe(e.current,r),()=>{t.disconnect()}}return mc}),[n,r,e])}(O,j,_c);var _=function(e){v||(R(!0),j())},F=function(e){v||(R(!1),j())};return o.default.createElement(i,u({id:r,ref:x},b,{onFocus:_,onBlur:F,onMouseEnter:_,onMouseMove:_,onMouseLeave:F,"aria-describedby":y}),g,o.default.createElement("div",u({id:y,ref:P,className:d(c,Dc,(n={"lds-only-aria":!N},n[Ac]=N,n)),style:u({},I.popper)},D.popper),o.default.createElement("div",{"data-popper-arrow":!0,ref:E,className:jc,style:I.arrow}),h))},e.UserMenu=function(e){var n=e.user,r=e.header,a=e.footer,i=e.origin,l=void 0===i?"https://app.k8slens.dev":i,c=e.className,f=e.onLogoutClick,p=e.loading,m=s(e,["user","header","footer","origin","className","onLogoutClick","loading"]),v=t.useRef(null),h=m.buttonRef?m.buttonRef:v,g=t.useMemo((function(){return("items"in m?m.items:Fc).map((function(e){return{children:e.children.map((function(e){return"logout"===e.key?u(u({},e),{onClick:f}):e}))}}))}),[m,f]),b=t.useMemo((function(){return{avatar:n.avatar,avatarTitle:n.name,title:"@".concat(n.username),subtitle:n.name}}),[n]);return o.default.createElement(yn,null,(function(e){var t,n=e.open;return o.default.createElement("div",{className:d(Qc,c)},o.default.createElement(yn.Button,{className:d(Kc,(t={},t[Xc]=n,t[Jc]=p,t)),ref:h,disabled:p},o.default.createElement(Hl,{item:b,loading:p,className:Yc}),n?o.default.createElement(td,{className:Zc}):o.default.createElement(ed,{className:Zc})),o.default.createElement(Gc,{open:n,header:r,footer:a,origin:l,groups:g,buttonRef:h}))}))},e.UserMenuDefaultHeader=function(e){var t=e.licenseText,n=e.noLicenseText,r=void 0===n?"No subscription":n,a=e.onClick,i=e.disabled,l=void 0===i||i;return o.default.createElement(Vc,{className:d(nd,rd),title:t||r,icon:ad,disabled:l,onClick:a})},e.useConfirmDialog=function(){var e=t.useState(null),n=e[0],r=e[1],a=t.useState(""),i=a[0],l=a[1],s=t.useState({}),c=s[0],d=s[1],f=t.useState(""),p=f[0],m=f[1],v=t.useState(!1),h=v[0],g=v[1],b=t.useCallback((function(e,t,n){return void 0===n&&(n={}),g(!0),l(e),m(t||""),d(n),new Promise((function(e){r({resolve:e})}))}),[r,g]),y=t.useCallback((function(){r(null),g(!1),l(""),m(""),d({})}),[r,g,m,l,d]);return{ConfirmDialog:t.useMemo((function(){return h?o.default.createElement(yl,u({title:i,message:p,handleClose:y,handleConfirm:function(){null==n||n.resolve(!0),y()},handleCancel:function(){null==n||n.resolve(!1),y()}},c)):null}),[h,i,p,n,c,y]),confirm:b}},Object.defineProperty(e,"__esModule",{value:!0})}));
19
+ */"production"===process.env.NODE_ENV?function(){if(bc)return yc;bc=1;var e=o.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function l(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var o=t(),u=n({inst:{value:o,getSnapshot:t}}),s=u[0].inst,c=u[1];return a((function(){s.value=o,s.getSnapshot=t,l(s)&&c({inst:s})}),[e,o,t]),r((function(){return l(s)&&c({inst:s}),e((function(){l(s)&&c({inst:s})}))}),[e]),i(o),o};yc.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u}():wc||(wc=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=o.default,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];!function(e,n,r){var a=t.ReactDebugCurrentFrame.getStackAddendum();""!==a&&(n+="%s",r=r.concat([a]));var o=r.map((function(e){return String(e)}));o.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,o)}("error",e,r)}var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,s=!1,c=!1;function d(e){var t=e.getSnapshot,n=e.value;try{var a=t();return!r(n,a)}catch(e){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t,n){return t()}:function(t,o,f){s||void 0!==e.startTransition&&(s=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=o();if(!c){var m=o();r(p,m)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var v=a({inst:{value:p,getSnapshot:o}}),h=v[0].inst,g=v[1];return l((function(){h.value=p,h.getSnapshot=o,d(h)&&g({inst:h})}),[t,p,o]),i((function(){return d(h)&&g({inst:h}),t((function(){d(h)&&g({inst:h})}))}),[t]),u(p),p},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:f;Ec.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}());var xc={exports:{}},Oc={exports:{}};(function(){var e,t,n,r,a,o;"undefined"!=typeof performance&&null!==performance&&performance.now?Oc.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(Oc.exports=function(){return(e()-a)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),o=1e9*process.uptime(),a=r-o):Date.now?(Oc.exports=function(){return Date.now()-n},n=Date.now()):(Oc.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(f);for(var Sc=Oc.exports,Nc="undefined"==typeof window?f:window,Rc=["moz","webkit"],Tc="AnimationFrame",Cc=Nc["request"+Tc],kc=Nc["cancel"+Tc]||Nc["cancelRequest"+Tc],Pc=0;!Cc&&Pc<Rc.length;Pc++)Cc=Nc[Rc[Pc]+"Request"+Tc],kc=Nc[Rc[Pc]+"Cancel"+Tc]||Nc[Rc[Pc]+"CancelRequest"+Tc];if(!Cc||!kc){var Lc=0,Mc=0,Ic=[];Cc=function(e){if(0===Ic.length){var t=Sc(),n=Math.max(0,16.666666666666668-(t-Lc));Lc=n+t,setTimeout((function(){var e=Ic.slice(0);Ic.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(Lc)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return Ic.push({handle:++Mc,callback:e,cancelled:!1}),Mc},kc=function(e){for(var t=0;t<Ic.length;t++)Ic[t].handle===e&&(Ic[t].cancelled=!0)}}xc.exports=function(e){return Cc.call(Nc,e)},xc.exports.cancel=function(){kc.apply(Nc,arguments)},xc.exports.polyfill=function(e){e||(e=Nc),e.requestAnimationFrame=Cc,e.cancelAnimationFrame=kc};var Dc="lds-tooltip",Ac="lds-tooltip--visible",jc="lds-tooltip--caret",_c={subtree:!0,childList:!0,attributes:!1,characterData:!1};var Fc=[{children:[{key:"profile",title:"Your Profile",href:"/profile"},{key:"account",title:"Your Account",href:"/account"},{key:"billing",title:"Your Billing Details",href:"/billing-details"},{key:"email",title:"Your Emails",href:"/emails"},{key:"auth-providers",title:"Your Auth Providers",href:"/auth-providers"},{key:"support",title:"Your Support Portal",href:"https://support.k8slens.dev/hc/en-us",external:!0},{key:"business-id",title:"Lens Business ID",href:"/business"}]},{children:[{key:"logout",title:"Logout",type:"danger"}]}],Bc={userMenuItem:"lds-user-menu-item",button:"lds-user-menu-item--button",disabled:"lds-user-menu-item--disabled",selected:"lds-user-menu-item--selected",icon:"lds-user-menu-item--icon",danger:"lds-user-menu-item--danger",external:"lds-user-menu-item--external",title:"lds-user-menu-item--title"},zc=function(e,t){return new URL(e,t).pathname},Hc=function(e){var t=e.Icon,n=e.title;return o.default.createElement(o.default.Fragment,null,t?o.default.createElement(t,{className:Bc.icon,size:"sm"}):null,o.default.createElement("span",{className:Bc.title},n))};function Vc(e){var n=e.type,r=void 0===n?"default":n,a=e.title,i=e.icon,l=e.disabled,s=e.external,c=e.onClick,f=e.selected,p=e.href,m=e.origin,v=e.className,h=t.useMemo((function(){return s||!p?p:m?"".concat(m).concat((null==p?void 0:p.startsWith("/"))?p:"/".concat(p)):p}),[p,m,s]),g=t.useMemo((function(){return"boolean"==typeof f?f:!(!h||"undefined"==typeof window)&&zc(window.location.href,"undefined"!=typeof window?window.location.origin:void 0)===zc(h,h)}),[h,f]),b=t.useMemo((function(){var e;return d(Bc.userMenuItem,((e={})[Bc[r]]=r&&"default"!==r,e[Bc.disabled]=l,e[Bc.external]=s,e[Bc.selected]=g,e),v)}),[r,l,s,v,g]);return l||f||!h?l||f||!c?o.default.createElement(yn.Item,{disabled:!0},o.default.createElement("span",{className:d(b,Bc.disabled)},o.default.createElement(Hc,{Icon:i,title:a}))):o.default.createElement(yn.Item,null,o.default.createElement("button",{className:d(Bc.button,b),onClick:c},o.default.createElement(Hc,{Icon:i,title:a}))):o.default.createElement(yn.Item,null,o.default.createElement("a",u({className:b,onClick:c,href:h},s?{target:"_blank"}:{},{rel:"noopener noreferrer"}),o.default.createElement(Hc,{Icon:i,title:a})))}var qc={userMenuDropdown:"lds-user-menu-dropdown",content:"lds-user-menu-dropdown--content",open:"lds-user-menu-dropdown--open",group:"lds-user-menu-dropdown--group",last:"lds-user-menu-dropdown--last"},$c=$l("1rem"),Uc={name:"offset",options:{offset:function(e){var t=e.placement;return t.startsWith("top")||t.startsWith("bottom")?[0,-1]:[0,0]}}},Wc={name:"maxSize",enabled:!0,phase:"main",fn:function(e){var t=e.state;if(void 0!==$c&&"undefined"!=typeof window&&"undefined"!=typeof document){var n=t.elements.reference.getBoundingClientRect(),r=document.documentElement,a=t.placement.endsWith("start")?Math.min(r.clientWidth,window.innerWidth)-n.left-$c:n.right-$c,o=t.placement.startsWith("bottom")?Math.min(r.clientHeight,window.innerHeight)-n.bottom-$c:n.top-$c;t.styles.popper=u(u({},t.styles.popper),{maxWidth:"".concat(a,"px"),maxHeight:"".concat(o,"px")})}}};function Gc(e){var n,r,a=e.header,i=e.footer,l=e.origin,s=e.className,c=e.groups,f=e.open,p=e.buttonRef,m=t.useRef(null),v=Gs(null==p?void 0:p.current,null==m?void 0:m.current,{placement:"bottom-start",modifiers:[{name:"flip",options:{fallbackPlacements:["top-start","bottom-end","top-end"]}},{name:"preventOverflow",options:{boundary:"viewport"}},{name:"computeStyles",options:{adaptive:!0}},Uc,Wc]}),h=v.styles,g=v.attributes;return o.default.createElement(er,u({show:f,enter:"transition duration-[".concat(ql,"] ease-in-out"),enterFrom:"transform opacity-0",enterTo:"transform opacity-100",leave:"transition duration-[".concat(ql,"] ease-in-out"),leaveFrom:"transform opacity-100",leaveTo:"transform opacity-0",className:d(qc.userMenuDropdown,s),ref:m,style:u(u({},h.popper),{minWidth:null===(r=null==p?void 0:p.current)||void 0===r?void 0:r.offsetWidth})},g.popper),o.default.createElement(yn.Items,{className:d(qc.content,(n={},n[qc.open]=f,n))},a,c.map((function(e,t){var n,r=e.children;return o.default.createElement("div",{className:d(qc.group,(n={},n[qc.last]=t===c.length-1,n)),key:"group-".concat(t),role:"navigation"},r.map((function(e,t){return o.default.createElement(Vc,{key:"key"in e?e.key:"item-".concat(t),title:e.title,icon:e.icon,type:e.type,disabled:e.disabled,external:e.external,href:e.href,onClick:"onClick"in e?e.onClick:void 0,origin:l})})))})),i))}var Qc="lds-user-menu",Kc="lds-user-menu--button",Yc="lds-user-menu--profile-block",Zc="lds-user-menu--drop-down-icon",Xc="lds-user-menu--open",Jc="lds-user-menu--disabled",ed=nl,td=Xi;var nd="lds-default-header",rd="lds-default-header--header",ad=function(e){var t=wi(e,[]);return o.default.createElement(Ii,yi({icon:Qi},t))},od="lds-switch",id="lds-switch--disabled";e.Avatar=w,e.Badge=function(e){var t,n=e.className,r=e.type,a=void 0===r?"secondary":r,i=e.size,l=void 0===i?"sm":i,c=e.title,f=s(e,["className","type","size","title"]),p="role"in f?f.role:"status",m=!c||f["aria-hidden"];return o.default.createElement("span",u({},f,{"aria-hidden":m,title:c,role:p,className:d(E.badge,(t={},t[E[l]]="sm"!==l,t[E[a]]="secondary"!==a,t),n)}))},e.Button=O,e.ButtonBar=N,e.Checkbox=function(e){var t=e.disabled,n=e.value,r=e.onChange,a=s(e,["disabled","value","onChange"]);return o.default.createElement("input",u({type:"checkbox",checked:n,onChange:function(e){t||r(!n,e)},disabled:t},a,{className:d(R,(null==a?void 0:a.className)||"")}))},e.ConfirmDialog=yl,e.DrawerTransition=wl,e.Input=Nl,e.LinkButton=Cl,e.LoadingIndicator=cl,e.Lozenge=Pl,e.Modal=vl,e.Notification=function(e){var n=e.level,r=void 0===n?"info":n,a=e.type,i=void 0===a?"default":a,l=e.title,u=e.message,s=e.flashDuration,c=void 0===s?5e3:s,f=e.onClose,p=e.className,m=t.useState(!0),v=m[0],h=m[1],g=t.useRef(null),b="flash"===i?300:200,y=t.useCallback((function(){"flash"===i&&setTimeout((function(){try{h(!1)}catch(e){}}),c)}),[i,c]);return o.default.createElement(wl,{open:v,role:"alert",className:d(p,Ll.wrapper,Ll[r],Ll[i]),afterEnter:y,afterExit:f,duration:b},o.default.createElement("div",{ref:g,className:Ll.alert},"success"===r&&o.default.createElement(Il,{size:"xl"}),"info"===r&&o.default.createElement(Al,{size:"xl"}),("error"===r||"warning"===r)&&o.default.createElement(Dl,{size:"xl"}),o.default.createElement("div",null,l&&o.default.createElement("h5",null,l),o.default.createElement("p",null,u)),"closable"===i&&o.default.createElement("button",{type:"button",onClick:function(){return h(!1)},"aria-label":"Close"},o.default.createElement(Ml,{size:"lg",color:"on-dark"}))))},e.NumberBadge=function(e){var t=e.className,n=e.value,r=e.showZero,a=e.displayPlusSign,i=e.title,l=s(e,["className","value","showZero","displayPlusSign","title"]);if(null==n||0===n&&!r)return null;var c=function(e){var t=Math.abs(e),n=e<0?"-":"";return t>=1e6?t>99e6?_l(e/1e6).replace(/\+$/,"M+"):"".concat(n).concat((t/1e6).toFixed(1),"M"):t>=1e3?t>99e3?_l(e/1e3).replace(/\+$/,"k+"):"".concat(n).concat((t/1e3).toFixed(1),"k"):_l(e)}(n);n>0&&a&&(c="+".concat(c));var f="role"in l?l.role:"status",p=!i||l["aria-hidden"];return o.default.createElement(Pl,u({},l,{"aria-hidden":p,title:i,className:d(jl,t),role:f,size:"sm"}),c)},e.Panel=pl,e.ProfileBlock=Hl,e.ProgressBar=function(e){var t,n=e.value,r=e.type,a=void 0===r?"default":r,i=e.max,l=void 0===i?1:i,c=e.title,f=e.className,p=s(e,["value","type","max","title","className"]),m=isNaN(n)?0:Math.max(0,n),v=isNaN(l)||l<=0?1:l,h=Math.min(100,Math.round(m/v*100)),g=c||"".concat(h,"%");return o.default.createElement("progress",u({},p,{className:d(Vl.progressBar,f,(t={},t[Vl[a]]="default"!==a,t)),value:m,max:v,"aria-valuetext":g,title:c}),g)},e.RadioCard=function(e){var t=e.id,n=e["aria-label"],r=e.value,a=e.options,i=e.onChange,l=e.name,c=e.invalid,f=e.disabled,p=e.itemClassName,m=e.className,v=e.renderItem,h=void 0===v?function(e){return o.default.createElement("span",{className:tu},o.default.createElement("span",{className:nu},e.label),o.default.createElement("span",{className:ru},e.subtitle))}:v,g=s(e,["id","aria-label","value","options","onChange","name","invalid","disabled","itemClassName","className","renderItem"]);return o.default.createElement(jn,u({},g,{id:t,by:"id",value:r,onChange:i,"aria-label":n,className:d(Xl,m),name:l}),a.map((function(e){return o.default.createElement(jn.Option,{key:e.id,value:e,disabled:f||e.disabled,className:function(e){var t,n=e.checked;return d(Jl,p,((t={})[au]=n,t[ou]=c,t))}},(function(t){var n=t.checked;return o.default.createElement(o.default.Fragment,null,o.default.createElement("span",{className:eu},o.default.createElement("span",null)),h(e,{invalid:c,selected:n,disabled:f||e.disabled}))}))})))},e.Select=function(e){var n=e.id,r=e["aria-label"],a=e.value,i=e.options,l=e.onChange,u=e.placeholder,c=void 0===u?"":u,f=e.name,p=e.invalid,m=e.disabled,v=e.className,h=e.dropdownClassName,g=e.itemClassName,b=e.renderContent,y=void 0===b?function(e,t,n){return e?e.label:n}:b,w=e.loading,E=e.title,x=e.openingDirection,O=e.maxHeight,S=e.size,N=s(e,["id","aria-label","value","options","onChange","placeholder","name","invalid","disabled","className","dropdownClassName","itemClassName","renderContent","loading","title","openingDirection","maxHeight","size"]),R=t.useRef(null),T=t.useRef(null),C=1===i.length;return t.useEffect((function(){var e,t;(null===(e=N.buttonRef)||void 0===e?void 0:e.current)&&(R.current=null===(t=N.buttonRef)||void 0===t?void 0:t.current)}),[N.buttonRef]),o.default.createElement(nn,{value:a,onChange:l,name:f,disabled:m},(function(e){var t,l,u,s=e.open;return o.default.createElement("div",{className:d(Ql.select,v,(t={},t[Ql.invalid]=p,t[Ql.locked]=C,t[Ql.disabled]=m||w,t[Ql.open]=s,t))},o.default.createElement(nn.Button,{id:n,ref:N.buttonRef?N.buttonRef:R,"aria-label":r,className:d(Ql.selectButton),title:E},o.default.createElement("span",{className:d(Ql.item,Ql.selectedItem,(l={},l[Ql.disabled]=m||w,l[Ql.invalid]=p,l[Ql.placeholder]=!a,l[Ql.lg]="lg"===S,l),null!==(u="function"==typeof g?g({disabled:Boolean(m),invalid:Boolean(p)}):g)&&void 0!==u?u:"")},w?o.default.createElement(cl,{className:Ql.loadingIndicator}):y(a,{invalid:p,disabled:m},c)),s?o.default.createElement(Zl,{className:Ql.dropDownIcon}):o.default.createElement(Yl,{className:Ql.dropDownIcon})),o.default.createElement(Gl,{listRef:T,buttonRef:R,openingDirection:x,maxHeight:O},o.default.createElement(nn.Options,{ref:T,className:d(Ql.dropdown,h)},i.length>0?i.map((function(e){var t;if("options"in e){var n="".concat(e.id,"-label");return o.default.createElement("li",{key:e.id,className:Ql.group,role:"group","aria-labelledby":n},o.default.createElement("span",{id:n,className:d(Ql.groupLabel,(t={},t[Ql.lg]="lg"===S,t))},e.label),o.default.createElement("ul",{className:Ql.groupList},e.options.map((function(e){return o.default.createElement(Kl,{key:e.id,option:e,currentValue:a,size:S,itemClassName:g,renderContent:y,placeholder:c})}))))}return o.default.createElement(Kl,{key:e.id,option:e,currentValue:a,size:S,itemClassName:g,renderContent:y,placeholder:c})})):null)))}))},e.SideNav=uu,e.SideNavGroup=fu,e.SideNavItem=mu,e.Switch=function(e){var t,n=e.className,r=e.children,a=e.disabled,i=e.onChange,l=s(e,["className","children","disabled","onChange"]);return o.default.createElement("label",{className:d(od,n,(t={},t[id]=a,t)),"data-testid":"switch"},r,o.default.createElement("input",u({type:"checkbox",role:"switch",disabled:a,onChange:function(e){return null==i?void 0:i(e.target.checked,e)}},l)))},e.Tooltip=function(e){var n,r=e.id,a=e.wrapper,i=void 0===a?"span":a,l=e.mutationsListenerElement,c=e.popupClassName,f=e.placement,p=void 0===f?"auto":f,m=e.alwaysVisible,v=void 0!==m&&m,h=e.text,g=e.children,b=s(e,["id","wrapper","mutationsListenerElement","popupClassName","placement","alwaysVisible","text","children"]),y=t.useMemo((function(){return"tooltip-".concat(r||Math.random().toString(36).substr(2,9))}),[r]),w=t.useMemo((function(){return l||("undefined"!=typeof document&&"body"in document?document.body:null)}),[l]),E=t.useRef(null),x=t.useRef(null),O=t.useRef(w),S=t.useState(v),N=S[0],R=S[1],T=t.useState(),C=T[0],k=T[1],P=t.useCallback((function(e){k(e)}),[]),L=t.useMemo((function(){return[{name:"offset",options:{offset:[20,0]}},{name:"arrow",options:{padding:6}}]}),[]),M=Gs(null==x?void 0:x.current,C,{placement:p,modifiers:L,strategy:"fixed"}),I=M.styles,D=M.attributes,A=M.update,j=pc((function(){var e;null===(e=null==A?void 0:A())||void 0===e||e.catch((function(e){console.error(e)}))}),250);!function(e,n,r=vc){t.useEffect((()=>{if(e.current){const t=new MutationObserver(n);return t.observe(e.current,r),()=>{t.disconnect()}}return mc}),[n,r,e])}(O,j,_c);var _=function(e){v||(R(!0),j())},F=function(e){v||(R(!1),j())};return o.default.createElement(i,u({id:r,ref:x},b,{onFocus:_,onBlur:F,onMouseEnter:_,onMouseMove:_,onMouseLeave:F,"aria-describedby":y}),g,o.default.createElement("div",u({id:y,ref:P,className:d(c,Dc,(n={"lds-only-aria":!N},n[Ac]=N,n)),style:u({},I.popper)},D.popper),o.default.createElement("div",{"data-popper-arrow":!0,ref:E,className:jc,style:I.arrow}),h))},e.UserMenu=function(e){var n=e.user,r=e.header,a=e.footer,i=e.origin,l=void 0===i?"https://app.k8slens.dev":i,c=e.className,f=e.onLogoutClick,p=e.loading,m=s(e,["user","header","footer","origin","className","onLogoutClick","loading"]),v=t.useRef(null),h=m.buttonRef?m.buttonRef:v,g=t.useMemo((function(){return("items"in m?m.items:Fc).map((function(e){return{children:e.children.map((function(e){return"logout"===e.key?u(u({},e),{onClick:f}):e}))}}))}),[m,f]),b=t.useMemo((function(){return{avatar:n.avatar,avatarTitle:n.name,title:"@".concat(n.username),subtitle:n.name}}),[n]);return o.default.createElement(yn,null,(function(e){var t,n=e.open;return o.default.createElement("div",{className:d(Qc,c)},o.default.createElement(yn.Button,{className:d(Kc,(t={},t[Xc]=n,t[Jc]=p,t)),ref:h,disabled:p},o.default.createElement(Hl,{item:b,loading:p,className:Yc}),n?o.default.createElement(td,{className:Zc}):o.default.createElement(ed,{className:Zc})),o.default.createElement(Gc,{open:n,header:r,footer:a,origin:l,groups:g,buttonRef:h}))}))},e.UserMenuDefaultHeader=function(e){var t=e.licenseText,n=e.noLicenseText,r=void 0===n?"No subscription":n,a=e.onClick,i=e.disabled,l=void 0===i||i;return o.default.createElement(Vc,{className:d(nd,rd),title:t||r,icon:ad,disabled:l,onClick:a})},e.useConfirmDialog=function(){var e=t.useState(null),n=e[0],r=e[1],a=t.useState(""),i=a[0],l=a[1],s=t.useState({}),c=s[0],d=s[1],f=t.useState(""),p=f[0],m=f[1],v=t.useState(!1),h=v[0],g=v[1],b=t.useCallback((function(e,t,n){return void 0===n&&(n={}),g(!0),l(e),m(t||""),d(n),new Promise((function(e){r({resolve:e})}))}),[r,g]),y=t.useCallback((function(){r(null),g(!1),l(""),m(""),d({})}),[r,g,m,l,d]);return{ConfirmDialog:t.useMemo((function(){return h?o.default.createElement(yl,u({title:i,message:p,handleClose:y,handleConfirm:function(){null==n||n.resolve(!0),y()},handleCancel:function(){null==n||n.resolve(!1),y()}},c)):null}),[h,i,p,n,c,y]),confirm:b}},Object.defineProperty(e,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8slens/lds",
3
- "version": "0.51.5",
3
+ "version": "0.51.7",
4
4
  "description": "Lens Design System – Core React Component Library",
5
5
  "author": "Mirantis Inc",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "format": "eslint --fix ."
29
29
  },
30
30
  "devDependencies": {
31
- "@k8slens/lds-tokens": "^0.52.5",
31
+ "@k8slens/lds-tokens": "^0.52.7",
32
32
  "@storybook/react": "6.5.16",
33
33
  "@testing-library/react": "14.0.0",
34
34
  "@types/randomcolor": "0.5.9",
@@ -60,5 +60,5 @@
60
60
  "\\.svg": "<rootDir>/../../__mocks__/SVGStub.js"
61
61
  }
62
62
  },
63
- "gitHead": "569de53678108bd8a37712bad5e598efbd08e7f8"
63
+ "gitHead": "b0761d80ac4ba0c9a3e0665d4d7cb2c8f797dfeb"
64
64
  }
File without changes