@hari_digitus/sms-ui-library 7.0.1 → 7.0.2
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 +1 -1
- package/dist/SideNavBar.es.js +1 -1
- package/package.json +1 -1
package/dist/SideNavBar.cjs.js
CHANGED
|
@@ -27,4 +27,4 @@ Check the top-level render call using <`+n+">.")}return r}}function Ne(e,r){{if(
|
|
|
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===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=pr():oe.exports=vr()),oe.exports}var t=hr();const We=O.createContext(null),mr=({children:w})=>{const[P,m]=O.useState(!0),[C,k]=O.useState(null),N=()=>{m(x=>!x),k(null)},I=x=>{k(p=>p===x?null:x)};return t.jsx(We.Provider,{value:{isExpanded:P,toggleSidebar:N,openSubmenu:C,toggleSubmenu:I},children:w})},Me=()=>{const w=O.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:P,user:m,createButtonRoles:C,createButtonLabel:k="Create",createButtonPath:N,brandName:I="Amphenol",brandSubtitle:x="COMMUNICATION SOLUTIONS",logo:p,helpLabel:D="Help Center",helpIcon:g,onSignOut:R,onNavigate:S,className:$=""}=w,{isExpanded:E,toggleSidebar:G,openSubmenu:Y,toggleSubmenu:F}=Me(),[v,le]=O.useState(window.location.pathname),[ue,z]=O.useState(!1),[ce,X]=O.useState(!1);O.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),T=P.reduce((u,j)=>{const A=j.section||"GENERAL";return u[A]||(u[A]=[]),u[A].push(j),u},{});return t.jsxs("aside",{style:{backgroundColor:"#0f172a"},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)",marginTop:"15px"},children:p??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(T).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&&v.includes(h.path)),re=c.path?v===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?v===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;
|
|
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=pr():oe.exports=vr()),oe.exports}var t=hr();const We=O.createContext(null),mr=({children:w})=>{const[P,m]=O.useState(!0),[C,k]=O.useState(null),N=()=>{m(x=>!x),k(null)},I=x=>{k(p=>p===x?null:x)};return t.jsx(We.Provider,{value:{isExpanded:P,toggleSidebar:N,openSubmenu:C,toggleSubmenu:I},children:w})},Me=()=>{const w=O.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:P,user:m,createButtonRoles:C,createButtonLabel:k="Create",createButtonPath:N,brandName:I="Amphenol",brandSubtitle:x="COMMUNICATION SOLUTIONS",logo:p,helpLabel:D="Help Center",helpIcon:g,onSignOut:R,onNavigate:S,className:$=""}=w,{isExpanded:E,toggleSidebar:G,openSubmenu:Y,toggleSubmenu:F}=Me(),[v,le]=O.useState(window.location.pathname),[ue,z]=O.useState(!1),[ce,X]=O.useState(!1);O.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),T=P.reduce((u,j)=>{const A=j.section||"GENERAL";return u[A]||(u[A]=[]),u[A].push(j),u},{});return t.jsxs("aside",{style:{backgroundColor:"#0f172a"},className:`rdr-sidebar ${E?"expanded":"collapsed"} ${$}`,children:[t.jsxs("div",{className:"sidebar-header ",style:{paddingTop:"10px"},children:[t.jsxs("div",{className:"logo-section",onClick:G,children:[t.jsx("span",{className:"logo-icon ",style:{color:"var(--sidebar-accent)",marginTop:"15px"},children:p??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(T).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&&v.includes(h.path)),re=c.path?v===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?v===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
|
@@ -700,7 +700,7 @@ const Me = pr(null), wr = ({ children: w }) => {
|
|
|
700
700
|
style: { backgroundColor: "#0f172a" },
|
|
701
701
|
className: `rdr-sidebar ${E ? "expanded" : "collapsed"} ${L}`,
|
|
702
702
|
children: [
|
|
703
|
-
/* @__PURE__ */ n.jsxs("div", { className: "sidebar-header", children: [
|
|
703
|
+
/* @__PURE__ */ n.jsxs("div", { className: "sidebar-header ", style: { paddingTop: "10px" }, children: [
|
|
704
704
|
/* @__PURE__ */ n.jsxs("div", { className: "logo-section", onClick: G, children: [
|
|
705
705
|
/* @__PURE__ */ n.jsx("span", { className: "logo-icon ", style: { color: "var(--sidebar-accent)", marginTop: "15px" }, children: p ?? /* @__PURE__ */ n.jsx(Rr, {}) }),
|
|
706
706
|
E && /* @__PURE__ */ n.jsxs("div", { className: "brand-text", children: [
|