@hari_digitus/sms-ui-library 6.0.5 → 6.0.9
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 +9 -9
- package/dist/SideNavBar.es.js +75 -75
- package/dist/sms-ui-library.css +1 -1
- package/package.json +1 -1
package/dist/SideNavBar.cjs.js
CHANGED
|
@@ -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 Fe;function vr(){if(Fe)return H;Fe=1;var w=P,T=Symbol.for("react.element"),m=Symbol.for("react.fragment"),
|
|
9
|
+
*/var Fe;function vr(){if(Fe)return H;Fe=1;var w=P,T=Symbol.for("react.element"),m=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,k=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,N={key:!0,ref:!0,__self:!0,__source:!0};function I(x,v,D){var g,R={},S=null,$=null;D!==void 0&&(S=""+D),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&($=v.ref);for(g in v)C.call(v,g)&&!N.hasOwnProperty(g)&&(R[g]=v[g]);if(x&&x.defaultProps)for(g in v=x.defaultProps,v)R[g]===void 0&&(R[g]=v[g]);return{$$typeof:T,type:x,key:S,ref:$,props:R,_owner:k.current}}return H.Fragment=m,H.jsx=I,H.jsxs=I,H}var K={};/**
|
|
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 Le;function pr(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&(function(){var w=P,T=Symbol.for("react.element"),m=Symbol.for("react.portal"),
|
|
18
|
-
`+pe+e}}var he=!1,ae;{var Ue=typeof WeakMap=="function"?WeakMap:Map;ae=new Ue}function ye(e,r){if(!e||he)return"";{var
|
|
19
|
-
`),
|
|
20
|
-
`),f=i.length-1,d=
|
|
21
|
-
`+i[f].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&ae.set(e,_),_}while(f>=1&&d>=0);break}}}finally{he=!1,ve.current=l,Ye(),Error.prepareStackTrace=o}var M=e?e.displayName||e.name:"",L=M?
|
|
17
|
+
*/var Le;function pr(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&(function(){var w=P,T=Symbol.for("react.element"),m=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),x=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),E=Symbol.iterator,G="@@iterator";function Y(e){if(e===null||typeof e!="object")return null;var r=E&&e[E]||e[G];return typeof r=="function"?r:null}var F=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];le("error",e,n)}}function le(e,r,n){{var a=F.ReactDebugCurrentFrame,o=a.getStackAddendum();o!==""&&(r+="%s",n=n.concat([o]));var l=n.map(function(s){return String(s)});l.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,l)}}var ue=!1,z=!1,ce=!1,X=!1,U=!1,B;B=Symbol.for("react.module.reference");function Z(e){return!!(typeof e=="string"||typeof e=="function"||e===C||e===N||U||e===k||e===D||e===g||X||e===$||ue||z||ce||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===R||e.$$typeof===I||e.$$typeof===x||e.$$typeof===v||e.$$typeof===B||e.getModuleId!==void 0))}function fe(e,r,n){var a=e.displayName;if(a)return a;var o=r.displayName||r.name||"";return o!==""?n+"("+o+")":n}function Q(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 C:return"Fragment";case m:return"Portal";case N:return"Profiler";case k:return"StrictMode";case D:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return Q(r)+".Consumer";case I:var n=e;return Q(n._context)+".Provider";case v:return fe(e,e.render,"ForwardRef");case R:var a=e.displayName||null;return a!==null?a:O(e.type)||"Memo";case S:{var o=e,l=o._payload,s=o._init;try{return O(s(l))}catch{return null}}}return null}var u=Object.assign,j=0,A,c,ee,re,V,q,h;function te(){}te.__reactDisabledLog=!0;function de(){{if(j===0){A=console.log,c=console.info,ee=console.warn,re=console.error,V=console.group,q=console.groupCollapsed,h=console.groupEnd;var e={configurable:!0,enumerable:!0,value:te,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}j++}}function Ye(){{if(j--,j===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},e,{value:A}),info:u({},e,{value:c}),warn:u({},e,{value:ee}),error:u({},e,{value:re}),group:u({},e,{value:V}),groupCollapsed:u({},e,{value:q}),groupEnd:u({},e,{value:h})})}j<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=F.ReactCurrentDispatcher,pe;function ne(e,r,n){{if(pe===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);pe=a&&a[1]||""}return`
|
|
18
|
+
`+pe+e}}var he=!1,ae;{var Ue=typeof WeakMap=="function"?WeakMap:Map;ae=new Ue}function ye(e,r){if(!e||he)return"";{var n=ae.get(e);if(n!==void 0)return n}var a;he=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=ve.current,ve.current=null,de();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(y){a=y}Reflect.construct(e,[],s)}else{try{s.call()}catch(y){a=y}e.call(s.prototype)}}else{try{throw Error()}catch(y){a=y}e()}}catch(y){if(y&&a&&typeof y.stack=="string"){for(var i=y.stack.split(`
|
|
19
|
+
`),b=a.stack.split(`
|
|
20
|
+
`),f=i.length-1,d=b.length-1;f>=1&&d>=0&&i[f]!==b[d];)d--;for(;f>=1&&d>=0;f--,d--)if(i[f]!==b[d]){if(f!==1||d!==1)do if(f--,d--,d<0||i[f]!==b[d]){var _=`
|
|
21
|
+
`+i[f].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&ae.set(e,_),_}while(f>=1&&d>=0);break}}}finally{he=!1,ve.current=l,Ye(),Error.prepareStackTrace=o}var M=e?e.displayName||e.name:"",L=M?ne(M):"";return typeof e=="function"&&ae.set(e,L),L}function Be(e,r,n){return ye(e,!1)}function Ve(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ie(e,r,n){if(e==null)return"";if(typeof e=="function")return ye(e,Ve(e));if(typeof e=="string")return ne(e);switch(e){case D:return ne("Suspense");case g:return ne("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Be(e.render);case R:return ie(e.type,r,n);case S:{var a=e,o=a._payload,l=a._init;try{return ie(l(o),r,n)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,Ee={},Re=F.ReactDebugCurrentFrame;function se(e){if(e){var r=e._owner,n=ie(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(n)}else Re.setExtraStackFrame(null)}function qe(e,r,n,a,o){{var l=Function.call.bind(J);for(var s in e)if(l(e,s)){var i=void 0;try{if(typeof e[s]!="function"){var b=Error((a||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}i=e[s](r,s,a,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){i=f}i&&!(i instanceof Error)&&(se(o),p("%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",n,s,typeof i),se(null)),i instanceof Error&&!(i.message in Ee)&&(Ee[i.message]=!0,se(o),p("Failed %s type: %s",n,i.message),se(null))}}}var Je=Array.isArray;function me(e){return Je(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Ke(e){try{return _e(e),!1}catch{return!0}}function _e(e){return""+e}function Ce(e){if(Ke(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),_e(e)}var we=F.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Se,Oe;function ze(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){typeof e.ref=="string"&&we.current}function Qe(e,r){{var n=function(){Se||(Se=!0,p("%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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function er(e,r){{var n=function(){Oe||(Oe=!0,p("%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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var rr=function(e,r,n,a,o,l,s){var i={$$typeof:T,type:e,key:r,ref:n,props:s,_owner:l};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:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function tr(e,r,n,a,o){{var l,s={},i=null,b=null;n!==void 0&&(Ce(n),i=""+n),Xe(r)&&(Ce(r.key),i=""+r.key),ze(r)&&(b=r.ref,Ze(r,o));for(l in r)J.call(r,l)&&!Ge.hasOwnProperty(l)&&(s[l]=r[l]);if(e&&e.defaultProps){var f=e.defaultProps;for(l in f)s[l]===void 0&&(s[l]=f[l])}if(i||b){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&Qe(s,d),b&&er(s,d)}return rr(e,i,b,o,a,we.current,s)}}var xe=F.ReactCurrentOwner,Pe=F.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,n=ie(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(n)}else Pe.setExtraStackFrame(null)}var ge;ge=!1;function be(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function Te(){{if(xe.current){var e=O(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 nr(e){return""}var ke={};function ar(e){{var r=Te();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+n+">.")}return r}}function Ne(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=ar(r);if(ke[n])return;ke[n]=!0;var a="";e&&e._owner&&e._owner!==xe.current&&(a=" It was passed a child from "+O(e._owner.type)+"."),W(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,a),W(null)}}function Ie(e,r){{if(typeof e!="object")return;if(me(e))for(var n=0;n<e.length;n++){var a=e[n];be(a)&&Ne(a,r)}else if(be(e))e._store&&(e._store.validated=!0);else if(e){var o=Y(e);if(typeof o=="function"&&o!==e.entries)for(var l=o.call(e),s;!(s=l.next()).done;)be(s.value)&&Ne(s.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===v||r.$$typeof===R))n=r.propTypes;else return;if(n){var a=O(r);qe(n,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!ge){ge=!0;var o=O(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("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),n=0;n<r.length;n++){var a=r[n];if(a!=="children"&&a!=="key"){W(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),W(null);break}}e.ref!==null&&(W(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}var De={};function Ae(e,r,n,a,o,l){{var s=Z(e);if(!s){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 b=nr();b?i+=b:i+=Te();var f;e===null?f="null":me(e)?f="array":e!==void 0&&e.$$typeof===T?(f="<"+(O(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,p("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 d=tr(e,r,n,o,l);if(d==null)return d;if(s){var _=r.children;if(_!==void 0)if(a)if(me(_)){for(var M=0;M<_.length;M++)Ie(_[M],e);Object.freeze&&Object.freeze(_)}else p("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 Ie(_,e)}if(J.call(r,"key")){var L=O(e),y=Object.keys(r).filter(function(dr){return dr!=="key"}),je=y.length>0?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}";if(!De[L+je]){var fr=y.length>0?"{"+y.join(": ..., ")+": ...}":"{}";p(`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} />`,je,L,fr,L),De[L+je]=!0}}return e===
|
|
30
|
+
<%s key={someKey} {...props} />`,je,L,fr,L),De[L+je]=!0}}return e===C?sr(d):ir(d),d}}function or(e,r,n){return Ae(e,r,n,!0)}function lr(e,r,n){return Ae(e,r,n,!1)}var ur=lr,cr=or;K.Fragment=C,K.jsx=ur,K.jsxs=cr})()),K}var $e;function hr(){return $e||($e=1,process.env.NODE_ENV==="production"?oe.exports=vr():oe.exports=pr()),oe.exports}var t=hr();const We=P.createContext(null),mr=({children:w})=>{const[T,m]=P.useState(!0),[C,k]=P.useState(null),N=()=>{m(x=>!x),k(null)},I=x=>{k(v=>v===x?null:x)};return t.jsx(We.Provider,{value:{isExpanded:T,toggleSidebar:N,openSubmenu:C,toggleSubmenu:I},children:w})},Me=()=>{const w=P.useContext(We);if(!w)throw new Error("useSidebar must be used inside <SidebarProvider>");return w},xr=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsx("path",{"fill-rule":"evenodd","clip-rule":"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"}),t.jsx("path",{"fill-rule":"evenodd","clip-rule":"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"}),t.jsx("path",{"fill-rule":"evenodd","clip-rule":"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"})]}),gr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),br=()=>t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),t.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jr=()=>t.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[t.jsx("rect",{width:"32",height:"32",rx:"8",fill:"currentColor",opacity:"0.15"}),t.jsx("circle",{cx:"16",cy:"16",r:"6",fill:"currentColor"})]}),yr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),t.jsx("polyline",{points:"16 17 21 12 16 7"}),t.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),Er=({config:w})=>{const{navItems:T,user:m,createButtonRoles:C,createButtonLabel:k="Create",createButtonPath:N,brandName:I="Amphenol",brandSubtitle:x="COMMUNICATION SOLUTIONS",logo:v,helpLabel:D="Help Center",helpIcon:g,onSignOut:R,onNavigate:S,className:$=""}=w,{isExpanded:E,toggleSidebar:G,openSubmenu:Y,toggleSubmenu:F}=Me(),[p,le]=P.useState(window.location.pathname),[ue,z]=P.useState(!1),[ce,X]=P.useState(!1);P.useEffect(()=>{const u=()=>le(window.location.pathname);return window.addEventListener("popstate",u),()=>window.removeEventListener("popstate",u)},[]);const U=(u,j)=>{u.preventDefault(),j&&(S?S(j):(window.history.pushState({},"",j),window.dispatchEvent(new PopStateEvent("popstate"))))},B=()=>m.email?m.email.split("@")[0]:"User",Z=()=>m.email?m.email.charAt(0).toUpperCase():"U",fe=()=>{R?R():window.location.href="/c/portal/logout"},Q=!C||C.includes(m.role),O=T.reduce((u,j)=>{const A=j.section||"GENERAL";return u[A]||(u[A]=[]),u[A].push(j),u},{});return t.jsxs("aside",{className:`rdr-sidebar ${E?"expanded":"collapsed"} ${$}`,children:[t.jsxs("div",{className:"sidebar-header",children:[t.jsxs("div",{className:"logo-section",onClick:G,children:[t.jsx("span",{className:"logo-icon",style:{color:"var(--sidebar-accent)"},children:v??t.jsx(jr,{})}),E&&t.jsxs("div",{className:"brand-text",children:[t.jsx("h2",{children:I}),x&&t.jsx("span",{children:x})]})]}),E&&t.jsx("button",{className:"menu-toggle",onClick:G,"aria-label":"Collapse sidebar",children:t.jsx(xr,{})})]}),Q&&N&&t.jsx("div",{className:"sidebar-actions",children:t.jsxs("button",{className:"sidebar-create-btn",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",width:"100%",height:"44px",padding:"0 16px",borderRadius:"10px",border:"none",outline:"none",boxShadow:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"#fff",background:ce?"#149B6E":"#18B885",transition:"background-color 0.2s ease"},onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),onClick:u=>U(u,N),children:[t.jsx(gr,{}),E&&t.jsx("span",{children:k})]})}),t.jsx("div",{className:"sidebar-nav",children:Object.entries(O).map(([u,j])=>{const A=j.filter(c=>!c.roles||c.roles.includes(m.role));return A.length?t.jsxs("div",{className:"nav-section",style:{listStyleType:"none"},children:[E&&t.jsx("h4",{className:"section-title",children:u}),t.jsx("ul",{className:"nav-items",children:A.map(c=>{var V,q;const ee=(V=c.subItems)==null?void 0:V.some(h=>h.path&&p.includes(h.path)),re=c.path?p===c.path:!1;return t.jsx("li",{children:(q=c.subItems)!=null&&q.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:`nav-item ${Y===c.name||ee?"active":""}`,"data-label":c.name,onClick:()=>F(c.name),children:[t.jsx("span",{className:"nav-icon",children:c.icon}),E&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"nav-text",children:c.name}),t.jsx("span",{className:"submenu-arrow",children:Y===c.name?"−":"+"})]})]}),E&&Y===c.name&&t.jsx("ul",{className:"submenu",children:c.subItems.map(h=>{const te=h.path?p===h.path:!1;return t.jsx("li",{children:t.jsxs("a",{href:h.path||"/",onClick:de=>U(de,h.path),className:`submenu-item ${te?"active-sub":""}`,children:[h.icon&&t.jsx("span",{className:"submenu-icon",children:h.icon}),t.jsx("span",{children:h.name})]})},h.name)})})]}):t.jsxs("a",{href:c.path||"/","data-label":c.name,onClick:h=>U(h,c.path),className:`nav-item ${re?"active":""}`,children:[t.jsx("span",{className:"nav-icon",children:c.icon}),E&&t.jsx("span",{className:"nav-text",children:c.name})]})},c.name)})})]},u):null})}),t.jsxs("div",{className:"sidebar-footer",children:[t.jsxs("div",{className:"footer-link","data-label":D,children:[t.jsx("span",{children:g??t.jsx(br,{})}),E&&t.jsx("span",{children:D})]}),t.jsxs("div",{className:"user-profile-wrapper",children:[t.jsxs("div",{className:"user-profile",onClick:()=>z(u=>!u),children:[t.jsx("div",{className:"avatar",children:Z()}),E&&t.jsxs("div",{className:"user-info",children:[t.jsx("div",{className:"user-name",children:B()}),t.jsx("div",{className:"user-role",children:m.roleName})]})]}),ue&&t.jsxs("div",{className:"profile-popup",children:[t.jsx("button",{className:"popup-close",onClick:()=>z(!1),"aria-label":"Close",children:"✕"}),t.jsxs("div",{className:"popup-header",children:[t.jsx("div",{className:"popup-avatar",children:Z()}),t.jsxs("div",{className:"popup-user-details",children:[t.jsx("div",{className:"popup-name",children:B()}),t.jsx("div",{className:"popup-role",children:m.roleName}),t.jsx("div",{className:"popup-email",children:m.email})]})]}),t.jsx("div",{className:"popup-divider"}),t.jsxs("button",{className:"signout-btn",onClick:fe,children:[t.jsx(yr,{}),t.jsx("span",{children:"Sign Out"})]})]})]})]})]})};exports.SideNavbar=Er;exports.SidebarProvider=mr;exports.useSidebar=Me;
|
package/dist/SideNavBar.es.js
CHANGED
|
@@ -13,13 +13,13 @@ var Fe;
|
|
|
13
13
|
function mr() {
|
|
14
14
|
if (Fe) return q;
|
|
15
15
|
Fe = 1;
|
|
16
|
-
var
|
|
16
|
+
var w = We, T = Symbol.for("react.element"), m = Symbol.for("react.fragment"), C = Object.prototype.hasOwnProperty, P = w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function N(x, p, I) {
|
|
18
18
|
var g, R = {}, S = null, L = null;
|
|
19
19
|
I !== void 0 && (S = "" + I), p.key !== void 0 && (S = "" + p.key), p.ref !== void 0 && (L = p.ref);
|
|
20
|
-
for (g in p)
|
|
20
|
+
for (g in p) C.call(p, g) && !k.hasOwnProperty(g) && (R[g] = p[g]);
|
|
21
21
|
if (x && x.defaultProps) for (g in p = x.defaultProps, p) R[g] === void 0 && (R[g] = p[g]);
|
|
22
|
-
return { $$typeof:
|
|
22
|
+
return { $$typeof: T, type: x, key: S, ref: L, props: R, _owner: P.current };
|
|
23
23
|
}
|
|
24
24
|
return q.Fragment = m, q.jsx = N, q.jsxs = N, q;
|
|
25
25
|
}
|
|
@@ -36,14 +36,14 @@ var H = {};
|
|
|
36
36
|
var Le;
|
|
37
37
|
function xr() {
|
|
38
38
|
return Le || (Le = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
-
var
|
|
40
|
-
function
|
|
39
|
+
var w = We, T = Symbol.for("react.element"), m = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), N = Symbol.for("react.provider"), x = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), E = Symbol.iterator, G = "@@iterator";
|
|
40
|
+
function M(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
43
|
var r = E && e[E] || e[G];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
|
-
var A =
|
|
46
|
+
var A = w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function v(e) {
|
|
48
48
|
{
|
|
49
49
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
|
|
@@ -61,10 +61,10 @@ function xr() {
|
|
|
61
61
|
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var ce = !1, z = !1, ue = !1, X = !1,
|
|
64
|
+
var ce = !1, z = !1, ue = !1, X = !1, Y = !1, U;
|
|
65
65
|
U = Symbol.for("react.module.reference");
|
|
66
66
|
function Z(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === C || e === k || Y || e === P || e === I || e === g || X || e === L || ce || z || ue || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === R || e.$$typeof === N || e.$$typeof === x || e.$$typeof === p || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
@@ -80,7 +80,7 @@ function xr() {
|
|
|
80
80
|
function Q(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function O(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
86
|
if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -88,13 +88,13 @@ function xr() {
|
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
|
-
case
|
|
91
|
+
case C:
|
|
92
92
|
return "Fragment";
|
|
93
93
|
case m:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case k:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case P:
|
|
98
98
|
return "StrictMode";
|
|
99
99
|
case I:
|
|
100
100
|
return "Suspense";
|
|
@@ -113,11 +113,11 @@ function xr() {
|
|
|
113
113
|
return fe(e, e.render, "ForwardRef");
|
|
114
114
|
case R:
|
|
115
115
|
var a = e.displayName || null;
|
|
116
|
-
return a !== null ? a :
|
|
116
|
+
return a !== null ? a : O(e.type) || "Memo";
|
|
117
117
|
case S: {
|
|
118
118
|
var o = e, l = o._payload, s = o._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return O(s(l));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -152,7 +152,7 @@ function xr() {
|
|
|
152
152
|
j++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Ye() {
|
|
156
156
|
{
|
|
157
157
|
if (j--, j === 0) {
|
|
158
158
|
var e = {
|
|
@@ -272,7 +272,7 @@ function xr() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
he = !1, pe.current = l,
|
|
275
|
+
he = !1, pe.current = l, Ye(), Error.prepareStackTrace = o;
|
|
276
276
|
}
|
|
277
277
|
var W = e ? e.displayName || e.name : "", F = W ? te(W) : "";
|
|
278
278
|
return typeof e == "function" && ae.set(e, F), F;
|
|
@@ -360,16 +360,16 @@ function xr() {
|
|
|
360
360
|
function _e(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Ce(e) {
|
|
364
364
|
if (Ke(e))
|
|
365
365
|
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), _e(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var we = A.ReactCurrentOwner, Ge = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
}, Se,
|
|
372
|
+
}, Se, Oe;
|
|
373
373
|
function ze(e) {
|
|
374
374
|
if (J.call(e, "ref")) {
|
|
375
375
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -387,7 +387,7 @@ function xr() {
|
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
389
|
function Ze(e, r) {
|
|
390
|
-
typeof e.ref == "string" &&
|
|
390
|
+
typeof e.ref == "string" && we.current;
|
|
391
391
|
}
|
|
392
392
|
function Qe(e, r) {
|
|
393
393
|
{
|
|
@@ -403,7 +403,7 @@ function xr() {
|
|
|
403
403
|
function er(e, r) {
|
|
404
404
|
{
|
|
405
405
|
var t = function() {
|
|
406
|
-
|
|
406
|
+
Oe || (Oe = !0, v("%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));
|
|
407
407
|
};
|
|
408
408
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: t,
|
|
@@ -414,7 +414,7 @@ function xr() {
|
|
|
414
414
|
var rr = function(e, r, t, a, o, l, s) {
|
|
415
415
|
var i = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: T,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
420
|
key: r,
|
|
@@ -443,7 +443,7 @@ function xr() {
|
|
|
443
443
|
function nr(e, r, t, a, o) {
|
|
444
444
|
{
|
|
445
445
|
var l, s = {}, i = null, b = null;
|
|
446
|
-
t !== void 0 && (
|
|
446
|
+
t !== void 0 && (Ce(t), i = "" + t), Xe(r) && (Ce(r.key), i = "" + r.key), ze(r) && (b = r.ref, Ze(r, o));
|
|
447
447
|
for (l in r)
|
|
448
448
|
J.call(r, l) && !Ge.hasOwnProperty(l) && (s[l] = r[l]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
@@ -455,26 +455,26 @@ function xr() {
|
|
|
455
455
|
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
456
|
i && Qe(s, d), b && er(s, d);
|
|
457
457
|
}
|
|
458
|
-
return rr(e, i, b, o, a,
|
|
458
|
+
return rr(e, i, b, o, a, we.current, s);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var xe = A.ReactCurrentOwner,
|
|
461
|
+
var xe = A.ReactCurrentOwner, Te = A.ReactDebugCurrentFrame;
|
|
462
462
|
function $(e) {
|
|
463
463
|
if (e) {
|
|
464
464
|
var r = e._owner, t = ie(e.type, e._source, r ? r.type : null);
|
|
465
|
-
|
|
465
|
+
Te.setExtraStackFrame(t);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
Te.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
469
|
var ge;
|
|
470
470
|
ge = !1;
|
|
471
471
|
function be(e) {
|
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === T;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function Pe() {
|
|
475
475
|
{
|
|
476
476
|
if (xe.current) {
|
|
477
|
-
var e =
|
|
477
|
+
var e = O(xe.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -486,10 +486,10 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
function tr(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
489
|
+
var ke = {};
|
|
490
490
|
function ar(e) {
|
|
491
491
|
{
|
|
492
|
-
var r =
|
|
492
|
+
var r = Pe();
|
|
493
493
|
if (!r) {
|
|
494
494
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
495
|
t && (r = `
|
|
@@ -505,11 +505,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
507
|
var t = ar(r);
|
|
508
|
-
if (
|
|
508
|
+
if (ke[t])
|
|
509
509
|
return;
|
|
510
|
-
|
|
510
|
+
ke[t] = !0;
|
|
511
511
|
var a = "";
|
|
512
|
-
e && e._owner && e._owner !== xe.current && (a = " It was passed a child from " +
|
|
512
|
+
e && e._owner && e._owner !== xe.current && (a = " It was passed a child from " + O(e._owner.type) + "."), $(e), v('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), $(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
function Ie(e, r) {
|
|
@@ -524,7 +524,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
524
524
|
else if (be(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var o =
|
|
527
|
+
var o = M(e);
|
|
528
528
|
if (typeof o == "function" && o !== e.entries)
|
|
529
529
|
for (var l = o.call(e), s; !(s = l.next()).done; )
|
|
530
530
|
be(s.value) && Ne(s.value, r);
|
|
@@ -546,11 +546,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (t) {
|
|
549
|
-
var a =
|
|
549
|
+
var a = O(r);
|
|
550
550
|
Je(t, e.props, "prop", a, e);
|
|
551
551
|
} else if (r.PropTypes !== void 0 && !ge) {
|
|
552
552
|
ge = !0;
|
|
553
|
-
var o =
|
|
553
|
+
var o = O(r);
|
|
554
554
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
555
555
|
}
|
|
556
556
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -576,9 +576,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
576
576
|
var i = "";
|
|
577
577
|
(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.");
|
|
578
578
|
var b = tr();
|
|
579
|
-
b ? i += b : i +=
|
|
579
|
+
b ? i += b : i += Pe();
|
|
580
580
|
var f;
|
|
581
|
-
e === null ? f = "null" : me(e) ? f = "array" : e !== void 0 && e.$$typeof ===
|
|
581
|
+
e === null ? f = "null" : me(e) ? f = "array" : e !== void 0 && e.$$typeof === T ? (f = "<" + (O(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, v("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);
|
|
582
582
|
}
|
|
583
583
|
var d = nr(e, r, t, o, l);
|
|
584
584
|
if (d == null)
|
|
@@ -597,7 +597,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
597
597
|
Ie(_, e);
|
|
598
598
|
}
|
|
599
599
|
if (J.call(r, "key")) {
|
|
600
|
-
var F =
|
|
600
|
+
var F = O(e), y = Object.keys(r).filter(function(dr) {
|
|
601
601
|
return dr !== "key";
|
|
602
602
|
}), je = y.length > 0 ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
603
|
if (!De[F + je]) {
|
|
@@ -610,7 +610,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
610
610
|
<%s key={someKey} {...props} />`, je, F, fr, F), De[F + je] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e ===
|
|
613
|
+
return e === C ? sr(d) : ir(d), d;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
function or(e, r, t) {
|
|
@@ -620,7 +620,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
620
620
|
return Ae(e, r, t, !1);
|
|
621
621
|
}
|
|
622
622
|
var cr = lr, ur = or;
|
|
623
|
-
H.Fragment =
|
|
623
|
+
H.Fragment = C, H.jsx = cr, H.jsxs = ur;
|
|
624
624
|
})()), H;
|
|
625
625
|
}
|
|
626
626
|
var $e;
|
|
@@ -628,27 +628,27 @@ function gr() {
|
|
|
628
628
|
return $e || ($e = 1, process.env.NODE_ENV === "production" ? oe.exports = mr() : oe.exports = xr()), oe.exports;
|
|
629
629
|
}
|
|
630
630
|
var n = gr();
|
|
631
|
-
const
|
|
632
|
-
const [
|
|
633
|
-
m((x) => !x),
|
|
631
|
+
const Me = pr(null), wr = ({ children: w }) => {
|
|
632
|
+
const [T, m] = K(!0), [C, P] = K(null), k = () => {
|
|
633
|
+
m((x) => !x), P(null);
|
|
634
634
|
}, N = (x) => {
|
|
635
|
-
|
|
635
|
+
P((p) => p === x ? null : x);
|
|
636
636
|
};
|
|
637
637
|
return /* @__PURE__ */ n.jsx(
|
|
638
|
-
|
|
638
|
+
Me.Provider,
|
|
639
639
|
{
|
|
640
|
-
value: { isExpanded:
|
|
641
|
-
children:
|
|
640
|
+
value: { isExpanded: T, toggleSidebar: k, openSubmenu: C, toggleSubmenu: N },
|
|
641
|
+
children: w
|
|
642
642
|
}
|
|
643
643
|
);
|
|
644
644
|
}, br = () => {
|
|
645
|
-
const
|
|
646
|
-
if (!
|
|
647
|
-
return
|
|
648
|
-
}, jr = () => /* @__PURE__ */ n.jsxs("svg", { width: "
|
|
649
|
-
/* @__PURE__ */ n.jsx("
|
|
650
|
-
/* @__PURE__ */ n.jsx("
|
|
651
|
-
/* @__PURE__ */ n.jsx("
|
|
645
|
+
const w = vr(Me);
|
|
646
|
+
if (!w) throw new Error("useSidebar must be used inside <SidebarProvider>");
|
|
647
|
+
return w;
|
|
648
|
+
}, jr = () => /* @__PURE__ */ n.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: [
|
|
649
|
+
/* @__PURE__ */ n.jsx("path", { "fill-rule": "evenodd", "clip-rule": "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" }),
|
|
650
|
+
/* @__PURE__ */ n.jsx("path", { "fill-rule": "evenodd", "clip-rule": "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" }),
|
|
651
|
+
/* @__PURE__ */ n.jsx("path", { "fill-rule": "evenodd", "clip-rule": "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" })
|
|
652
652
|
] }), yr = () => /* @__PURE__ */ n.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
653
653
|
/* @__PURE__ */ n.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
654
654
|
/* @__PURE__ */ n.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
@@ -663,13 +663,13 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
663
663
|
/* @__PURE__ */ n.jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
664
664
|
/* @__PURE__ */ n.jsx("polyline", { points: "16 17 21 12 16 7" }),
|
|
665
665
|
/* @__PURE__ */ n.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
666
|
-
] }), Sr = ({ config:
|
|
666
|
+
] }), Sr = ({ config: w }) => {
|
|
667
667
|
const {
|
|
668
|
-
navItems:
|
|
668
|
+
navItems: T,
|
|
669
669
|
user: m,
|
|
670
|
-
createButtonRoles:
|
|
671
|
-
createButtonLabel:
|
|
672
|
-
createButtonPath:
|
|
670
|
+
createButtonRoles: C,
|
|
671
|
+
createButtonLabel: P = "Create",
|
|
672
|
+
createButtonPath: k,
|
|
673
673
|
brandName: N = "Amphenol",
|
|
674
674
|
brandSubtitle: x = "COMMUNICATION SOLUTIONS",
|
|
675
675
|
logo: p,
|
|
@@ -678,16 +678,16 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
678
678
|
onSignOut: R,
|
|
679
679
|
onNavigate: S,
|
|
680
680
|
className: L = ""
|
|
681
|
-
} =
|
|
681
|
+
} = w, { isExpanded: E, toggleSidebar: G, openSubmenu: M, toggleSubmenu: A } = br(), [v, le] = K(window.location.pathname), [ce, z] = K(!1), [ue, X] = K(!1);
|
|
682
682
|
hr(() => {
|
|
683
683
|
const c = () => le(window.location.pathname);
|
|
684
684
|
return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
|
|
685
685
|
}, []);
|
|
686
|
-
const
|
|
686
|
+
const Y = (c, j) => {
|
|
687
687
|
c.preventDefault(), j && (S ? S(j) : (window.history.pushState({}, "", j), window.dispatchEvent(new PopStateEvent("popstate"))));
|
|
688
688
|
}, U = () => m.email ? m.email.split("@")[0] : "User", Z = () => m.email ? m.email.charAt(0).toUpperCase() : "U", fe = () => {
|
|
689
689
|
R ? R() : window.location.href = "/c/portal/logout";
|
|
690
|
-
}, Q = !
|
|
690
|
+
}, Q = !C || C.includes(m.role), O = T.reduce(
|
|
691
691
|
(c, j) => {
|
|
692
692
|
const D = j.section || "GENERAL";
|
|
693
693
|
return c[D] || (c[D] = []), c[D].push(j), c;
|
|
@@ -717,7 +717,7 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
717
717
|
}
|
|
718
718
|
)
|
|
719
719
|
] }),
|
|
720
|
-
Q &&
|
|
720
|
+
Q && k && /* @__PURE__ */ n.jsx("div", { className: "sidebar-actions", children: /* @__PURE__ */ n.jsxs(
|
|
721
721
|
"button",
|
|
722
722
|
{
|
|
723
723
|
className: "sidebar-create-btn",
|
|
@@ -742,14 +742,14 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
742
742
|
},
|
|
743
743
|
onMouseEnter: () => X(!0),
|
|
744
744
|
onMouseLeave: () => X(!1),
|
|
745
|
-
onClick: (c) =>
|
|
745
|
+
onClick: (c) => Y(c, k),
|
|
746
746
|
children: [
|
|
747
747
|
/* @__PURE__ */ n.jsx(yr, {}),
|
|
748
|
-
E && /* @__PURE__ */ n.jsx("span", { children:
|
|
748
|
+
E && /* @__PURE__ */ n.jsx("span", { children: P })
|
|
749
749
|
]
|
|
750
750
|
}
|
|
751
751
|
) }),
|
|
752
|
-
/* @__PURE__ */ n.jsx("div", { className: "sidebar-nav", children: Object.entries(
|
|
752
|
+
/* @__PURE__ */ n.jsx("div", { className: "sidebar-nav", children: Object.entries(O).map(([c, j]) => {
|
|
753
753
|
const D = j.filter(
|
|
754
754
|
(u) => !u.roles || u.roles.includes(m.role)
|
|
755
755
|
);
|
|
@@ -766,25 +766,25 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
766
766
|
/* @__PURE__ */ n.jsxs(
|
|
767
767
|
"div",
|
|
768
768
|
{
|
|
769
|
-
className: `nav-item ${
|
|
769
|
+
className: `nav-item ${M === u.name || ee ? "active" : ""}`,
|
|
770
770
|
"data-label": u.name,
|
|
771
771
|
onClick: () => A(u.name),
|
|
772
772
|
children: [
|
|
773
773
|
/* @__PURE__ */ n.jsx("span", { className: "nav-icon", children: u.icon }),
|
|
774
774
|
E && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
775
775
|
/* @__PURE__ */ n.jsx("span", { className: "nav-text", children: u.name }),
|
|
776
|
-
/* @__PURE__ */ n.jsx("span", { className: "submenu-arrow", children:
|
|
776
|
+
/* @__PURE__ */ n.jsx("span", { className: "submenu-arrow", children: M === u.name ? "−" : "+" })
|
|
777
777
|
] })
|
|
778
778
|
]
|
|
779
779
|
}
|
|
780
780
|
),
|
|
781
|
-
E &&
|
|
781
|
+
E && M === u.name && /* @__PURE__ */ n.jsx("ul", { className: "submenu", children: u.subItems.map((h) => {
|
|
782
782
|
const ne = h.path ? v === h.path : !1;
|
|
783
783
|
return /* @__PURE__ */ n.jsx("li", { children: /* @__PURE__ */ n.jsxs(
|
|
784
784
|
"a",
|
|
785
785
|
{
|
|
786
786
|
href: h.path || "/",
|
|
787
|
-
onClick: (de) =>
|
|
787
|
+
onClick: (de) => Y(de, h.path),
|
|
788
788
|
className: `submenu-item ${ne ? "active-sub" : ""}`,
|
|
789
789
|
children: [
|
|
790
790
|
h.icon && /* @__PURE__ */ n.jsx("span", { className: "submenu-icon", children: h.icon }),
|
|
@@ -801,7 +801,7 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
801
801
|
{
|
|
802
802
|
href: u.path || "/",
|
|
803
803
|
"data-label": u.name,
|
|
804
|
-
onClick: (h) =>
|
|
804
|
+
onClick: (h) => Y(h, u.path),
|
|
805
805
|
className: `nav-item ${re ? "active" : ""}`,
|
|
806
806
|
children: [
|
|
807
807
|
/* @__PURE__ */ n.jsx("span", { className: "nav-icon", children: u.icon }),
|
|
@@ -865,6 +865,6 @@ const Ye = pr(null), Cr = ({ children: C }) => {
|
|
|
865
865
|
};
|
|
866
866
|
export {
|
|
867
867
|
Sr as SideNavbar,
|
|
868
|
-
|
|
868
|
+
wr as SidebarProvider,
|
|
869
869
|
br as useSidebar
|
|
870
870
|
};
|
package/dist/sms-ui-library.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--sidebar-width-expanded: 260px;--sidebar-width-collapsed: 64px;--sidebar-transition: .22s cubic-bezier(.4, 0, .2, 1);--sidebar-bg: #0f172a;--sidebar-border: #1e293b !important;--sidebar-text-primary: #ffffff;--sidebar-text-secondary: #cbd5e1;--sidebar-text-muted: #94a3b8;--sidebar-section-label: #64748b;--sidebar-accent: #059669;--sidebar-accent-hover: #047857;--sidebar-accent-dim: rgba(5, 150, 105, .12);--sidebar-accent-bright: #10b981;--sidebar-item-hover: rgba(255, 255, 255, .05);--sidebar-danger: #ef4444;--sidebar-avatar-bg: #059669;--sidebar-avatar-text: #ffffff;--sidebar-popup-bg: #ffffff;--sidebar-popup-border: #e5e7eb;--sidebar-popup-shadow: 0 4px 16px rgba(0, 0, 0, .15);--sidebar-popup-text: #222222;--sidebar-popup-text-secondary: #666666;--sidebar-popup-text-muted: #888888;--sidebar-popup-close-color: #374151}.rdr-sidebar{position:fixed;left:0;top:0;bottom:0;z-index:100;display:flex;flex-direction:column;width:var(--sidebar-width-expanded);height:100vh;background-color:var(--sidebar-bg);color:#e2e8f0;border-right:1px solid var(--sidebar-border);box-sizing:border-box;overflow:hidden;transition:width var(--sidebar-transition);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.rdr-sidebar.expanded{width:var(--sidebar-width-expanded)}.rdr-sidebar.collapsed{width:var(--sidebar-width-collapsed)}.sidebar-header{display:flex;align-items:center;padding:24px 20px;gap:12px;flex-shrink:0}.logo-section{display:flex;align-items:center;gap:12px;cursor:pointer;min-width:0;flex:1;-webkit-user-select:none;user-select:none}.brand-logo{background:linear-gradient(135deg,#60a5fa,#3b82f6);width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px;color:#fff;flex-shrink:0}.logo-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.brand-text{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.brand-text h2{margin:0;font-size:
|
|
1
|
+
body{overflow-y:hidden!important}:root{--sidebar-width-expanded: 260px;--sidebar-width-collapsed: 64px;--sidebar-transition: .22s cubic-bezier(.4, 0, .2, 1);--sidebar-bg: #0f172a;--sidebar-border: #1e293b !important;--sidebar-text-primary: #ffffff;--sidebar-text-secondary: #cbd5e1;--sidebar-text-muted: #94a3b8;--sidebar-section-label: #64748b;--sidebar-accent: #059669;--sidebar-accent-hover: #047857;--sidebar-accent-dim: rgba(5, 150, 105, .12);--sidebar-accent-bright: #10b981;--sidebar-item-hover: rgba(255, 255, 255, .05);--sidebar-danger: #ef4444;--sidebar-avatar-bg: #059669;--sidebar-avatar-text: #ffffff;--sidebar-popup-bg: #ffffff;--sidebar-popup-border: #e5e7eb;--sidebar-popup-shadow: 0 4px 16px rgba(0, 0, 0, .15);--sidebar-popup-text: #222222;--sidebar-popup-text-secondary: #666666;--sidebar-popup-text-muted: #888888;--sidebar-popup-close-color: #374151}.rdr-sidebar{position:fixed;left:0;top:0;bottom:0;z-index:100;display:flex;flex-direction:column;width:var(--sidebar-width-expanded);height:100vh;background-color:var(--sidebar-bg);color:#e2e8f0;border-right:1px solid var(--sidebar-border);box-sizing:border-box;overflow:hidden;transition:width var(--sidebar-transition);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.rdr-sidebar.expanded{width:var(--sidebar-width-expanded)}.rdr-sidebar.collapsed{width:var(--sidebar-width-collapsed)}.sidebar-header{display:flex;align-items:center;padding:24px 20px;gap:12px;flex-shrink:0}.logo-section{display:flex;align-items:center;gap:12px;cursor:pointer;min-width:0;flex:1;-webkit-user-select:none;user-select:none}.brand-logo{background:linear-gradient(135deg,#60a5fa,#3b82f6);width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px;color:#fff;flex-shrink:0}.logo-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.brand-text{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.brand-text h2{margin:0;font-size:23px;font-weight:600;color:var(--sidebar-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand-text span{font-size:9px;color:var(--sidebar-text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:20px!important}.menu-toggle{background:none!important;border:none!important;box-shadow:none!important;color:#cbd5e1;cursor:pointer;padding:0!important;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:6px;width:32px;height:32px;transition:background .15s,color .15s}.menu-toggle:hover{background:var(--sidebar-item-hover)!important;color:var(--sidebar-text-primary)}.sidebar-actions{padding:0 20px 24px;flex-shrink:0}.sidebar-create-btn{width:100%;background-color:var(--sidebar-accent);color:#fff;border:none;border-radius:8px;padding:10px;font-size:14px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;transition:background-color .2s;height:44px;outline:none;box-shadow:none}.sidebar-create-btn:hover{background-color:var(--sidebar-accent-hover)}.sidebar-nav{flex:1;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.08) transparent}.sidebar-nav::-webkit-scrollbar{width:4px}.sidebar-nav::-webkit-scrollbar-track{background:transparent}.sidebar-nav::-webkit-scrollbar-thumb{background:#ffffff14;border-radius:2px}.nav-section{margin-bottom:24px;list-style-type:none!important;padding:0}.section-title{font-size:11px;font-weight:600;color:var(--sidebar-section-label);padding:0 20px;margin:0 0 12px;letter-spacing:.5px;text-transform:uppercase;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden}.nav-items{list-style:none;padding:0;margin:0}.nav-items li{margin:0}.nav-item{display:flex;align-items:center;padding:12px 20px;gap:16px;cursor:pointer;color:#cbd5e1;transition:all .2s;position:relative;text-decoration:none;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden}.nav-item.active{background-color:transparent;color:var(--sidebar-text-primary)}.nav-item.active:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background-color:var(--sidebar-accent)}.nav-item:hover{background-color:#ffffff0d;color:var(--sidebar-text-primary);border:1px solid rgba(255,255,255,.1);border-radius:6px;text-decoration:none}.nav-icon{display:flex;align-items:center;justify-content:center;color:#94a3b8;flex-shrink:0;width:20px;height:20px;transition:color .15s}.nav-icon svg{width:18px;height:18px}.nav-item.active .nav-icon{color:var(--sidebar-accent-bright)}.nav-text{font-size:14px;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.submenu-arrow{flex-shrink:0;font-size:16px;font-weight:400;color:#94a3b8;line-height:1}.submenu{list-style:none;margin:0;padding:0 0 0 56px;background-color:#00000026}.submenu li{margin:0}.submenu-item{display:flex;align-items:center;gap:8px;padding:10px 20px 10px 0;cursor:pointer;text-decoration:none;color:#94a3b8;font-size:13px;font-weight:400;transition:color .15s,background .15s;white-space:nowrap;overflow:hidden}.submenu-item:hover{color:var(--sidebar-text-primary);text-decoration:none}.submenu-item.active-sub{color:var(--sidebar-accent-bright);font-weight:600}.submenu-icon{flex-shrink:0;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.submenu-icon svg{width:14px;height:14px}.sidebar-footer{padding:20px;border-top:1px solid rgba(255,255,255,.05);flex-shrink:0;display:flex;flex-direction:column;gap:0}.footer-link{display:flex;align-items:center;gap:16px;color:#cbd5e1;cursor:pointer;margin-bottom:24px;transition:color .15s;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden}.footer-link:hover{color:var(--sidebar-text-primary)}.footer-link span:first-child{flex-shrink:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center}.footer-link span:first-child svg{width:18px;height:18px}.user-profile-wrapper{position:relative}.user-profile{display:flex;align-items:center;gap:12px;cursor:pointer;transition:background .15s;border-radius:8px;padding:4px;margin:-4px}.user-profile:hover{background:var(--sidebar-item-hover)}.avatar{width:36px;height:36px;border-radius:8px;background-color:var(--sidebar-avatar-bg);color:var(--sidebar-avatar-text);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px;flex-shrink:0;text-transform:uppercase}.user-info{display:flex;flex-direction:column;flex:1;min-width:0;overflow:hidden}.user-name{font-size:14px;font-weight:600;color:var(--sidebar-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-role{font-size:11px;color:var(--sidebar-text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-popup{position:absolute;bottom:60px;left:0;width:320px;min-height:95px;background:var(--sidebar-popup-bg);border-radius:10px;padding:12px 14px;box-shadow:var(--sidebar-popup-shadow);z-index:9999;animation:popupIn .15s cubic-bezier(.4,0,.2,1)}@keyframes popupIn{0%{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}.popup-close{position:absolute;top:10px;right:12px;border:none!important;background:transparent!important;cursor:pointer;color:var(--sidebar-popup-close-color);font-size:18px;font-weight:500;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;padding:0!important;transition:background .12s;box-shadow:none!important}.popup-close:hover{background:#0000000f!important}.popup-header{display:flex;align-items:center;gap:12px;padding-right:28px}.popup-avatar{width:42px;height:42px;border-radius:8px;background:var(--sidebar-accent);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:16px;flex-shrink:0;text-transform:uppercase}.popup-user-details{flex:1;min-width:0}.popup-name{font-size:14px;font-weight:600;color:var(--sidebar-popup-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.popup-role{font-size:12px;color:var(--sidebar-popup-text-secondary)}.popup-email{font-size:12px;color:var(--sidebar-popup-text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.popup-divider{height:1px;background:var(--sidebar-popup-border);margin:10px 0}.signout-btn{width:100%;border:none!important;background:transparent!important;color:var(--sidebar-danger);cursor:pointer;padding:4px 0;font-size:14px;font-weight:500;display:flex;justify-content:flex-end;align-items:center;gap:6px;outline:none;border-radius:6px;transition:background .15s}.signout-btn:hover{background:#ef444414!important}.signout-btn svg{width:15px;height:15px;color:var(--sidebar-danger);flex-shrink:0}.rdr-sidebar.collapsed .sidebar-header{padding:24px 0;justify-content:center}.rdr-sidebar.collapsed .sidebar-actions{padding:0 8px 16px}.rdr-sidebar.collapsed .nav-item{justify-content:center;padding:12px 0;gap:0}.rdr-sidebar.collapsed .nav-item.active:before{width:3px}.rdr-sidebar.collapsed .section-title{padding:0;text-align:center;font-size:0;margin:0 0 8px}.rdr-sidebar.collapsed .sidebar-footer{padding:16px 0;align-items:center}.rdr-sidebar.collapsed .footer-link{justify-content:center;gap:0;padding:0;margin-bottom:16px}.rdr-sidebar.collapsed .user-profile{justify-content:center;padding:4px 0}.rdr-sidebar.collapsed .nav-item[data-label]:hover:after,.rdr-sidebar.collapsed .footer-link[data-label]:hover:after{content:attr(data-label);position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);background:#1e293b;color:#e2e8f0;font-size:12px;font-weight:500;padding:5px 10px;border-radius:6px;white-space:nowrap;box-shadow:0 4px 12px #0006;border:1px solid rgba(255,255,255,.08);pointer-events:none;z-index:300}.rdr-sidebar.collapsed .nav-item,.rdr-sidebar.collapsed .footer-link{position:relative}
|