@hari_digitus/sms-ui-library 9.0.4 → 9.0.6
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/dist/SideNavBar.cjs.js +10 -10
- package/dist/SideNavBar.es.js +379 -378
- package/dist/types/icons/icon.d.ts +5 -5
- package/package.json +3 -2
package/dist/SideNavBar.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react");function vr(u){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const d in u)if(d!=="default"){const R=Object.getOwnPropertyDescriptor(u,d);Object.defineProperty(S,d,R.get?R:{enumerable:!0,get:()=>u[d]})}}return S.default=u,Object.freeze(S)}const g=vr(O);var fe={exports:{}},ee={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Me;function hr(){if(Me)return ee;Me=1;var u=O,S=Symbol.for("react.element"),d=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,N=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I={key:!0,ref:!0,__self:!0,__source:!0};function D(b,v,A){var x,C={},P=null,Y=null;A!==void 0&&(P=""+A),v.key!==void 0&&(P=""+v.key),v.ref!==void 0&&(Y=v.ref);for(x in v)R.call(v,x)&&!I.hasOwnProperty(x)&&(C[x]=v[x]);if(b&&b.defaultProps)for(x in v=b.defaultProps,v)C[x]===void 0&&(C[x]=v[x]);return{$$typeof:S,type:b,key:P,ref:Y,props:C,_owner:N.current}}return ee.Fragment=d,ee.jsx=D,ee.jsxs=D,ee}var re={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+i[
|
|
17
|
+
*/var $e;function mr(){return $e||($e=1,process.env.NODE_ENV!=="production"&&(function(){var u=O,S=Symbol.for("react.element"),d=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),E=Symbol.iterator,te="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var r=E&&e[E]||e[te];return typeof r=="function"?r:null}var M=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];de("error",e,t)}}function de(e,r,t){{var a=M.ReactDebugCurrentFrame,s=a.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var pe=!1,ne=!1,ve=!1,ae=!1,ie=!1,$;$=Symbol.for("react.module.reference");function q(e){return!!(typeof e=="string"||typeof e=="function"||e===R||e===I||ie||e===N||e===A||e===x||ae||e===Y||pe||ne||ve||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===C||e.$$typeof===D||e.$$typeof===b||e.$$typeof===v||e.$$typeof===$||e.getModuleId!==void 0))}function oe(e,r,t){var a=e.displayName;if(a)return a;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function H(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case d:return"Portal";case I:return"Profiler";case N:return"StrictMode";case A:return"Suspense";case x:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return H(r)+".Consumer";case D:var t=e;return H(t._context)+".Provider";case v:return oe(e,e.render,"ForwardRef");case C:var a=e.displayName||null;return a!==null?a:k(e.type)||"Memo";case P:{var s=e,c=s._payload,o=s._init;try{return k(o(c))}catch{return null}}}return null}var L=Object.assign,W=0,m,T,F,l,K,z,G;function X(){}X.__reactDisabledLog=!0;function y(){{if(W===0){m=console.log,T=console.info,F=console.warn,l=console.error,K=console.group,z=console.groupCollapsed,G=console.groupEnd;var e={configurable:!0,enumerable:!0,value:X,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function he(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:m}),info:L({},e,{value:T}),warn:L({},e,{value:F}),error:L({},e,{value:l}),group:L({},e,{value:K}),groupCollapsed:L({},e,{value:z}),groupEnd:L({},e,{value:G})})}W<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=M.ReactCurrentDispatcher,me;function se(e,r,t){{if(me===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);me=a&&a[1]||""}return`
|
|
18
|
+
`+me+e}}var ge=!1,le;{var Ue=typeof WeakMap=="function"?WeakMap:Map;le=new Ue}function Re(e,r){if(!e||ge)return"";{var t=le.get(e);if(t!==void 0)return t}var a;ge=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=Z.current,Z.current=null,y();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(_){a=_}Reflect.construct(e,[],o)}else{try{o.call()}catch(_){a=_}e.call(o.prototype)}}else{try{throw Error()}catch(_){a=_}e()}}catch(_){if(_&&a&&typeof _.stack=="string"){for(var i=_.stack.split(`
|
|
19
|
+
`),j=a.stack.split(`
|
|
20
|
+
`),f=i.length-1,p=j.length-1;f>=1&&p>=0&&i[f]!==j[p];)p--;for(;f>=1&&p>=0;f--,p--)if(i[f]!==j[p]){if(f!==1||p!==1)do if(f--,p--,p<0||i[f]!==j[p]){var w=`
|
|
21
|
+
`+i[f].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&le.set(e,w),w}while(f>=1&&p>=0);break}}}finally{ge=!1,Z.current=c,he(),Error.prepareStackTrace=s}var J=e?e.displayName||e.name:"",B=J?se(J):"";return typeof e=="function"&&le.set(e,B),B}function Ve(e,r,t){return Re(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ce(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,Je(e));if(typeof e=="string")return se(e);switch(e){case A:return se("Suspense");case x:return se("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Ve(e.render);case C:return ce(e.type,r,t);case P:{var a=e,s=a._payload,c=a._init;try{return ce(c(s),r,t)}catch{}}}return""}var Q=Object.prototype.hasOwnProperty,_e={},Se=M.ReactDebugCurrentFrame;function ue(e){if(e){var r=e._owner,t=ce(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(t)}else Se.setExtraStackFrame(null)}function qe(e,r,t,a,s){{var c=Function.call.bind(Q);for(var o in e)if(c(e,o)){var i=void 0;try{if(typeof e[o]!="function"){var j=Error((a||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}i=e[o](r,o,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){i=f}i&&!(i instanceof Error)&&(ue(s),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,o,typeof i),ue(null)),i instanceof Error&&!(i.message in _e)&&(_e[i.message]=!0,ue(s),h("Failed %s type: %s",t,i.message),ue(null))}}}var He=Array.isArray;function be(e){return He(e)}function Ke(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return Ce(e),!1}catch{return!0}}function Ce(e){return""+e}function we(e){if(ze(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ke(e)),Ce(e)}var Oe=M.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Te,Pe;function Xe(e){if(Q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(Q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){typeof e.ref=="string"&&Oe.current}function er(e,r){{var t=function(){Te||(Te=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){Pe||(Pe=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,a,s,c,o){var i={$$typeof:S,type:e,key:r,ref:t,props:o,_owner:c};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function nr(e,r,t,a,s){{var c,o={},i=null,j=null;t!==void 0&&(we(t),i=""+t),Ze(r)&&(we(r.key),i=""+r.key),Xe(r)&&(j=r.ref,Qe(r,s));for(c in r)Q.call(r,c)&&!Ge.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var f=e.defaultProps;for(c in f)o[c]===void 0&&(o[c]=f[c])}if(i||j){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&er(o,p),j&&rr(o,p)}return tr(e,i,j,s,a,Oe.current,o)}}var xe=M.ReactCurrentOwner,ke=M.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=ce(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}var Ee;Ee=!1;function ye(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function Ne(){{if(xe.current){var e=k(xe.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var Ie={};function ir(e){{var r=Ne();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(Ie[t])return;Ie[t]=!0;var a="";e&&e._owner&&e._owner!==xe.current&&(a=" It was passed a child from "+k(e._owner.type)+"."),V(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),V(null)}}function Ae(e,r){{if(typeof e!="object")return;if(be(e))for(var t=0;t<e.length;t++){var a=e[t];ye(a)&&De(a,r)}else if(ye(e))e._store&&(e._store.validated=!0);else if(e){var s=U(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),o;!(o=c.next()).done;)ye(o.value)&&De(o.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===v||r.$$typeof===C))t=r.propTypes;else return;if(t){var a=k(r);qe(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!Ee){Ee=!0;var s=k(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){V(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),V(null);break}}e.ref!==null&&(V(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var Le={};function Fe(e,r,t,a,s,c){{var o=q(e);if(!o){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" 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 j=ar();j?i+=j:i+=Ne();var f;e===null?f="null":be(e)?f="array":e!==void 0&&e.$$typeof===S?(f="<"+(k(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,i)}var p=nr(e,r,t,s,c);if(p==null)return p;if(o){var w=r.children;if(w!==void 0)if(a)if(be(w)){for(var J=0;J<w.length;J++)Ae(w[J],e);Object.freeze&&Object.freeze(w)}else h("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 Ae(w,e)}if(Q.call(r,"key")){var B=k(e),_=Object.keys(r).filter(function(pr){return pr!=="key"}),je=_.length>0?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}";if(!Le[B+je]){var dr=_.length>0?"{"+_.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,je,B,dr,B),Le[B+je]=!0}}return e===R?sr(p):or(p),p}}function lr(e,r,t){return Fe(e,r,t,!0)}function cr(e,r,t){return Fe(e,r,t,!1)}var ur=cr,fr=lr;re.Fragment=R,re.jsx=ur,re.jsxs=fr})()),re}var We;function gr(){return We||(We=1,process.env.NODE_ENV==="production"?fe.exports=hr():fe.exports=mr()),fe.exports}var n=gr();const Be=O.createContext(null),br=({children:u})=>{const[S,d]=O.useState(!0),[R,N]=O.useState(null),I=()=>{d(b=>!b),N(null)},D=b=>{N(v=>v===b?null:b)};return n.jsx(Be.Provider,{value:{isExpanded:S,toggleSidebar:I,openSubmenu:R,toggleSubmenu:D},children:u})},Ye=()=>{const u=O.useContext(Be);if(!u)throw new Error("useSidebar must be used inside <SidebarProvider>");return u},xr=u=>g.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...u},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3334 7C20.3334 7.55228 20.0072 8 19.6048 8L4.06194 8C3.65957 8 3.33337 7.55228 3.33337 7C3.33337 6.44772 3.65957 6 4.06194 6L19.6048 6C20.0072 6 20.3334 6.44772 20.3334 7Z",fill:"white"}),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3334 12C20.3334 12.5523 20.0072 13 19.6048 13L4.06194 13C3.65957 13 3.33337 12.5523 3.33337 12C3.33337 11.4477 3.65957 11 4.06194 11L19.6048 11C20.0072 11 20.3334 11.4477 20.3334 12Z",fill:"white"}),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3334 17C20.3334 17.5523 20.0072 18 19.6048 18L4.06194 18C3.65957 18 3.33337 17.5523 3.33337 17C3.33337 16.4477 3.65957 16 4.06194 16L19.6048 16C20.0072 16 20.3334 16.4477 20.3334 17Z",fill:"white"})),Er=u=>g.createElement("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...u},g.createElement("circle",{cx:12,cy:12,r:10}),g.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),g.createElement("line",{x1:12,y1:17,x2:12.01,y2:17})),yr=u=>g.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",...u},g.createElement("rect",{width:32,height:32,rx:8,fill:"currentColor",opacity:.15}),g.createElement("circle",{cx:16,cy:16,r:6,fill:"currentColor"})),jr=u=>g.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",...u},g.createElement("line",{x1:12,y1:5,x2:12,y2:19}),g.createElement("line",{x1:5,y1:12,x2:19,y2:12})),Rr=u=>g.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...u},g.createElement("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),g.createElement("polyline",{points:"16 17 21 12 16 7"}),g.createElement("line",{x1:21,y1:12,x2:9,y2:12})),_r=({config:u})=>{const{navItems:S,user:d,createButtonRoles:R,createButtonLabel:N="Create",createButtonPath:I,brandName:D="Amphenol",brandSubtitle:b="COMMUNICATION SOLUTIONS",logo:v,helpLabel:A="Help Center",helpIcon:x,onSignOut:C,onNavigate:P,className:Y=""}=u,{isExpanded:E,toggleSidebar:te,openSubmenu:U,toggleSubmenu:M}=Ye(),[h,de]=O.useState(window.location.pathname),[pe,ne]=O.useState(!1),[ve,ae]=O.useState(!1),[ie,$]=O.useState(null);O.useEffect(()=>{const m=()=>de(window.location.pathname);return window.addEventListener("popstate",m),()=>window.removeEventListener("popstate",m)},[]);const q=(m,T)=>{m.preventDefault(),T&&(P?P(T):(window.history.pushState({},"",T),window.dispatchEvent(new PopStateEvent("popstate"))))},oe=()=>d.email?d.email.split("@")[0]:"User",H=()=>d.email?d.email.charAt(0).toUpperCase():"U",k=()=>{C?C():window.location.href="/c/portal/logout"},L=!R||R.includes(d.role),W=S.reduce((m,T)=>{const F=T.section||"GENERAL";return m[F]||(m[F]=[]),m[F].push(T),m},{});return n.jsxs("aside",{style:{backgroundColor:"#0f172a"},className:`rdr-sidebar ${E?"expanded":"collapsed"} ${Y}`,children:[n.jsxs("div",{className:"sidebar-header ",style:{paddingTop:"10px"},children:[n.jsxs("div",{className:"logo-section",onClick:te,children:[n.jsx("span",{className:"logo-icon ",style:{color:"var(--sidebar-accent)",marginTop:"15px"},children:v??n.jsx(yr,{})}),E&&n.jsxs("div",{className:"brand-text",children:[n.jsx("h2",{children:D}),b&&n.jsx("span",{children:b})]})]}),E&&n.jsx("button",{className:"menu-toggle",onClick:te,"aria-label":"Collapse sidebar",children:n.jsx(xr,{})})]}),L&&I&&n.jsx("div",{className:"sidebar-actions",children:n.jsxs("button",{className:"sidebar-create-btn",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",width:E?"100%":"44px",height:"44px",padding:E?"0 16px":"0",borderRadius:"10px",border:"none",outline:"none",boxShadow:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"#fff",background:ve?"#149B6E":"#18B885",transition:"background-color 0.2s ease"},onMouseEnter:()=>ae(!0),onMouseLeave:()=>ae(!1),onClick:m=>q(m,I),children:[n.jsx(jr,{}),E&&n.jsx("span",{children:N})]})}),n.jsx("div",{className:"sidebar-nav",children:Object.entries(W).map(([m,T])=>{const F=T.filter(l=>!l.roles||l.roles.includes(d.role));return F.length?n.jsxs("div",{className:"nav-section",style:{listStyleType:"none"},children:[E&&n.jsx("h4",{className:"section-title",children:m}),n.jsx("ul",{className:"nav-items",children:F.map(l=>{var G,X;const K=(G=l.subItems)==null?void 0:G.some(y=>y.path&&h.includes(y.path)),z=l.path?h===l.path:!1;return n.jsx("li",{children:(X=l.subItems)!=null&&X.length?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`nav-item ${U===l.name||K?"active":""}`,"data-label":l.name,onClick:()=>M(l.name),onMouseEnter:()=>$(l.name),onMouseLeave:()=>$(null),style:U===l.name||K||ie===l.name?{backgroundColor:"#10B981",border:"1px solid #10B981",borderRadius:"8px"}:{},children:[n.jsx("span",{className:"nav-icon",children:l.icon}),E&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"nav-text",children:l.name}),n.jsx("span",{className:"submenu-arrow",children:U===l.name?"−":"+"})]})]}),E&&U===l.name&&n.jsx("ul",{className:"submenu",children:l.subItems.map(y=>{const he=y.path?h===y.path:!1;return n.jsx("li",{children:n.jsxs("a",{href:y.path||"/",onClick:Z=>q(Z,y.path),className:`submenu-item ${he?"active-sub":""}`,children:[y.icon&&n.jsx("span",{className:"submenu-icon",children:y.icon}),n.jsx("span",{children:y.name})]})},y.name)})})]}):n.jsxs("a",{href:l.path||"/","data-label":l.name,onClick:y=>q(y,l.path),style:z||ie===l.name?{backgroundColor:"#10B981",border:"none",borderRadius:"8px",outline:"1px solid #10B981",outlineOffset:"0px"}:{border:"none"},onMouseEnter:()=>$(l.name),onMouseLeave:()=>$(null),className:`nav-item ${z?"active":""}`,children:[n.jsx("span",{className:"nav-icon",children:l.icon}),E&&n.jsx("span",{className:"nav-text",children:l.name})]})},l.name)})})]},m):null})}),n.jsxs("div",{className:"sidebar-footer",children:[n.jsxs("div",{className:"footer-link","data-label":A,children:[n.jsx("span",{children:x??n.jsx(Er,{})}),E&&n.jsx("span",{children:A})]}),n.jsxs("div",{className:"user-profile-wrapper",children:[n.jsxs("div",{className:"user-profile",onClick:()=>ne(m=>!m),children:[n.jsx("div",{className:"avatar",children:H()}),E&&n.jsxs("div",{className:"user-info",children:[n.jsx("div",{className:"user-name",children:oe()}),n.jsx("div",{className:"user-role",children:d.roleName})]})]}),pe&&n.jsxs("div",{className:"profile-popup",children:[n.jsx("button",{className:"popup-close",onClick:()=>ne(!1),"aria-label":"Close",children:"✕"}),n.jsxs("div",{className:"popup-header",children:[n.jsx("div",{className:"popup-avatar",children:H()}),n.jsxs("div",{className:"popup-user-details",children:[n.jsx("div",{className:"popup-name",children:oe()}),n.jsx("div",{className:"popup-role",children:d.roleName}),n.jsx("div",{className:"popup-email",children:d.email})]})]}),n.jsx("div",{className:"popup-divider"}),n.jsxs("button",{className:"signout-btn",onClick:k,children:[n.jsx(Rr,{}),n.jsx("span",{children:"Sign Out"})]})]})]})]})]})};exports.SideNavbar=_r;exports.SidebarProvider=br;exports.useSidebar=Ye;
|