@instincthub/react-ui 0.1.13 → 0.1.15
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/node_modules/lucide-react/dist/esm/icons/x.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js.map +1 -1
- package/dist/src/assets/css/main.css +1 -57
- package/dist/src/assets/css/navbar/sidenav.css +28 -12
- package/dist/src/components/auth/PasswordsMatch.js +1 -1
- package/dist/src/components/forms/DropFile.js +1 -1
- package/dist/src/components/navbar/ResponsiveNavbar.js +1 -1
- package/dist/src/components/status/DeleteConfirmationModal.js +1 -1
- package/dist/src/components/status/ModalWrapper.js +2 -0
- package/dist/src/components/status/ModalWrapper.js.map +1 -0
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/components/ui/GetSuccessFailedIcon.js +2 -0
- package/dist/src/components/ui/GetSuccessFailedIcon.js.map +1 -0
- package/dist/src/components/ui/StatusIcon.js +2 -0
- package/dist/src/components/ui/StatusIcon.js.map +1 -0
- package/dist/src/index.js +1 -1
- package/dist/src/types/components/auth/PasswordsMatch.d.ts +9 -1
- package/dist/src/types/components/forms/DropFile.d.ts +2 -0
- package/dist/src/types/components/navbar/ResponsiveNavbar.d.ts +1 -1
- package/dist/src/types/components/status/DeleteConfirmationModal.d.ts +2 -0
- package/dist/src/types/components/status/ModalWrapper.d.ts +10 -0
- package/dist/src/types/components/ui/GetSuccessFailedIcon.d.ts +39 -0
- package/dist/src/types/components/ui/StatusIcon.d.ts +29 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/types/index.d.ts +29 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,5 +4,5 @@ import e from"../createLucideIcon.js";
|
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const t=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]
|
|
7
|
+
*/const t=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],a=e("x",t);export{t as __iconNode,a as default};
|
|
8
8
|
//# sourceMappingURL=x.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x.js","sources":["../../../../../../node_modules/lucide-react/dist/esm/icons/x.js"],"sourcesContent":["/**\n * @license lucide-react v0.525.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n"],"names":["__iconNode","d","key","createLucideIcon"],"mappings":";;;;;;GASK,MAACA,EAAa,CACjB,CAAC,OAAQ,CAAEC,EAAG,aAAcC,IAAK,WACjC,CAAC,OAAQ,CAAED,EAAG,aAAcC,IAAK,
|
|
1
|
+
{"version":3,"file":"x.js","sources":["../../../../../../node_modules/lucide-react/dist/esm/icons/x.js"],"sourcesContent":["/**\n * @license lucide-react v0.525.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n"],"names":["__iconNode","d","key","X","createLucideIcon"],"mappings":";;;;;;GASK,MAACA,EAAa,CACjB,CAAC,OAAQ,CAAEC,EAAG,aAAcC,IAAK,WACjC,CAAC,OAAQ,CAAED,EAAG,aAAcC,IAAK,YAE7BC,EAAIC,EAAiB,IAAKJ"}
|
|
@@ -567,63 +567,7 @@ small {
|
|
|
567
567
|
/* .video_component {
|
|
568
568
|
border: 3px solid blue;
|
|
569
569
|
} */
|
|
570
|
-
|
|
571
|
-
content: "\e7fe";
|
|
572
|
-
font-family: "Material Icons";
|
|
573
|
-
-webkit-font-feature-settings: "liga";
|
|
574
|
-
margin-right: 10px;
|
|
575
|
-
position: absolute;
|
|
576
|
-
left: 15px;
|
|
577
|
-
top: 8px;
|
|
578
|
-
font-size: 20px;
|
|
579
|
-
font-weight: 400;
|
|
580
|
-
margin-right: 10px;
|
|
581
|
-
}
|
|
582
|
-
.stepBackBtn::before {
|
|
583
|
-
content: "\e5c4";
|
|
584
|
-
font-family: "Material Icons";
|
|
585
|
-
-webkit-font-feature-settings: "liga";
|
|
586
|
-
margin-right: 10px;
|
|
587
|
-
position: absolute;
|
|
588
|
-
left: 7px;
|
|
589
|
-
top: 8px;
|
|
590
|
-
font-size: 20px;
|
|
591
|
-
font-weight: 400;
|
|
592
|
-
margin-right: 10px;
|
|
593
|
-
}
|
|
594
|
-
.switch_acct::before {
|
|
595
|
-
content: "\e9ed";
|
|
596
|
-
font-family: "Material Icons";
|
|
597
|
-
-webkit-font-feature-settings: "liga";
|
|
598
|
-
margin-right: 10px;
|
|
599
|
-
position: absolute;
|
|
600
|
-
left: 19px;
|
|
601
|
-
top: 8px;
|
|
602
|
-
font-size: 20px;
|
|
603
|
-
font-weight: 400;
|
|
604
|
-
margin-right: 10px;
|
|
605
|
-
}
|
|
606
|
-
.switch_acct::after {
|
|
607
|
-
content: "\e5e1";
|
|
608
|
-
font-family: "Material Icons";
|
|
609
|
-
-webkit-font-feature-settings: "liga";
|
|
610
|
-
margin-right: 10px;
|
|
611
|
-
position: absolute;
|
|
612
|
-
right: 10px;
|
|
613
|
-
top: 11px;
|
|
614
|
-
}
|
|
615
|
-
.sign_out::before {
|
|
616
|
-
content: "\e9ba";
|
|
617
|
-
font-family: "Material Icons";
|
|
618
|
-
-webkit-font-feature-settings: "liga";
|
|
619
|
-
margin-right: 10px;
|
|
620
|
-
position: absolute;
|
|
621
|
-
left: 14px;
|
|
622
|
-
top: 8px;
|
|
623
|
-
font-size: 20px;
|
|
624
|
-
font-weight: 400;
|
|
625
|
-
margin-right: 10px;
|
|
626
|
-
}
|
|
570
|
+
|
|
627
571
|
.DarkLavender {
|
|
628
572
|
background-color: var(--DarkLavender);
|
|
629
573
|
}
|
|
@@ -184,6 +184,10 @@
|
|
|
184
184
|
padding: 12px;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
.ihub-sidenav-logo img {
|
|
188
|
+
object-fit: contain;
|
|
189
|
+
}
|
|
190
|
+
|
|
187
191
|
/* Toggle button */
|
|
188
192
|
.ihub-sidenav-toggle {
|
|
189
193
|
position: absolute;
|
|
@@ -574,20 +578,30 @@
|
|
|
574
578
|
}
|
|
575
579
|
|
|
576
580
|
/* Desktop: Dynamic margin adjustments based on sidebar state */
|
|
577
|
-
.ihub-sidenav-container-left.ihub-sidenav-container-expanded
|
|
578
|
-
|
|
581
|
+
.ihub-sidenav-container-left.ihub-sidenav-container-expanded
|
|
582
|
+
.ihub-sidenav-main {
|
|
583
|
+
margin-left: var(
|
|
584
|
+
--ihub-sidenav-width,
|
|
585
|
+
240px
|
|
586
|
+
); /* Use CSS variable for dynamic width, fallback to 240px */
|
|
579
587
|
}
|
|
580
588
|
|
|
581
|
-
.ihub-sidenav-container-left.ihub-sidenav-container-collapsed
|
|
589
|
+
.ihub-sidenav-container-left.ihub-sidenav-container-collapsed
|
|
590
|
+
.ihub-sidenav-main {
|
|
582
591
|
margin-left: 64px; /* Match collapsed sidebar width */
|
|
583
592
|
}
|
|
584
593
|
|
|
585
594
|
/* For right-positioned sidebar */
|
|
586
|
-
.ihub-sidenav-container-right.ihub-sidenav-container-expanded
|
|
587
|
-
|
|
595
|
+
.ihub-sidenav-container-right.ihub-sidenav-container-expanded
|
|
596
|
+
.ihub-sidenav-main {
|
|
597
|
+
margin-right: var(
|
|
598
|
+
--ihub-sidenav-width,
|
|
599
|
+
240px
|
|
600
|
+
); /* Use CSS variable for dynamic width, fallback to 240px */
|
|
588
601
|
}
|
|
589
602
|
|
|
590
|
-
.ihub-sidenav-container-right.ihub-sidenav-container-collapsed
|
|
603
|
+
.ihub-sidenav-container-right.ihub-sidenav-container-collapsed
|
|
604
|
+
.ihub-sidenav-main {
|
|
591
605
|
margin-right: 64px; /* Match collapsed sidebar width */
|
|
592
606
|
}
|
|
593
607
|
|
|
@@ -627,12 +641,12 @@
|
|
|
627
641
|
margin-right: 0 !important;
|
|
628
642
|
width: 100%;
|
|
629
643
|
}
|
|
630
|
-
|
|
644
|
+
|
|
631
645
|
/* Ensure sidebar properly overlays on mobile */
|
|
632
646
|
.ihub-sidenav-mobile {
|
|
633
647
|
z-index: 1001; /* Above content and backdrop */
|
|
634
648
|
}
|
|
635
|
-
|
|
649
|
+
|
|
636
650
|
/* No margin adjustments needed on mobile since sidebar overlays */
|
|
637
651
|
.ihub-sidenav-container-left .ihub-sidenav-main,
|
|
638
652
|
.ihub-sidenav-container-right .ihub-sidenav-main {
|
|
@@ -643,14 +657,16 @@
|
|
|
643
657
|
|
|
644
658
|
@media (min-width: 769px) and (max-width: 1024px) {
|
|
645
659
|
/* Tablet adjustments */
|
|
646
|
-
.ihub-sidenav-container-left.ihub-sidenav-container-expanded
|
|
660
|
+
.ihub-sidenav-container-left.ihub-sidenav-container-expanded
|
|
661
|
+
.ihub-sidenav-main {
|
|
647
662
|
margin-left: 200px; /* Slightly smaller on tablet */
|
|
648
663
|
}
|
|
649
|
-
|
|
650
|
-
.ihub-sidenav-container-right.ihub-sidenav-container-expanded
|
|
664
|
+
|
|
665
|
+
.ihub-sidenav-container-right.ihub-sidenav-container-expanded
|
|
666
|
+
.ihub-sidenav-main {
|
|
651
667
|
margin-right: 200px;
|
|
652
668
|
}
|
|
653
|
-
|
|
669
|
+
|
|
654
670
|
.ihub-sidenav-expanded {
|
|
655
671
|
width: 200px; /* Narrower sidebar on tablet */
|
|
656
672
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as
|
|
1
|
+
import{slicedToArray as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as s,jsx as a}from"react/jsx-runtime";import{useState as e}from"react";import o from"../forms/PasswordField.js";function t(t){var l=t.defaultPassword,d=void 0===l?"":l,i=t.onPasswordChange,n=t.onConfirmPasswordChange,u=e(""),m=r(u,2),h=m[0],c=m[1],w=e(""),g=r(w,2),v=g[0],b=g[1],p=e(d),P=r(p,2),f=P[0],C=P[1],_=e(""),y=r(_,2),x=y[0],E=y[1],L=function(r){var s=r.target.name,a=r.target.value;"password"===s&&(C(a),a.length<8?(r.target.style.borderColor="#EA5F5E",r.target.classList.add("ihub-is_invalid"),c("Password too short (it must be above 8 characters)!"),null==i||i(a,!1)):(r.target.style.borderColor="#69779B",r.target.classList.remove("ihub-is_invalid"),c(""),null==i||i(a,!0)),x&&x!==a?(b("Password does not match!"),null==n||n(x,!1)):x&&x===a&&(b(""),null==n||n(x,!0))),"password2"===s&&(E(a),f!==a?(r.target.style.borderColor="#EA5F5E",r.target.classList.add("ihub-is_invalid"),b("Password does not match!"),null==n||n(a,!1)):(r.target.style.borderColor="#69779B",r.target.classList.remove("ihub-is_invalid"),b(""),null==n||n(a,!0)))};return s("div",{children:[a(o,{label:"Password",name:"password",required:!0,onChange:L,id:"password",error:h,helperText:"Password must be above 8 characters",value:f||d}),a(o,{label:"Confirm Password",name:"password2",required:!0,onChange:L,id:"password2",error:v,helperText:"Passwords must match",value:x||d})]})}export{t as default};
|
|
2
2
|
//# sourceMappingURL=PasswordsMatch.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,objectSpread2 as t}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as
|
|
1
|
+
import{slicedToArray as e,objectSpread2 as t}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as o,jsx as a}from"react/jsx-runtime";import{useState as i,useCallback as n}from"react";import{useDropzone as l}from"../../../node_modules/react-dropzone/dist/es/index.js";var p=function(p){var c,r=p.onDrop,s=p.label,d=p.acceptedTypes,m=p.maxSize,u=p.tmplateUrl,f=void 0===u?"https://github.com/instincthub/images/raw/main/leadcontact_upload_template.xlsx":u,x=p.onTemplateDownload,h=p.multiple,v=void 0!==h&&h,g=p.className,b=void 0===g?"":g,w=i(""),j=e(w,2),D=j[0],z=j[1],N=n((function(e){var t=e[0];z(t.name),r(t)}),[r]),T=function(e){return{".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".xls":"application/vnd.ms-excel",".csv":"text/csv",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".txt":"text/plain",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation"}[e.toLowerCase()]||"application/octet-stream"},_=l({onDropAccepted:N,accept:function(){if(!d||0===d.length)return{"application/vnd.ms-excel":[".xlsx",".xls"],"text/csv":[".csv"]};var e={};return d.forEach((function(t){var o=T(t);o&&(e[o]||(e[o]=[]),e[o].push(t))})),e}(),maxFiles:v?void 0:1,maxSize:m}),P=_.getRootProps,S=_.getInputProps,y=_.isDragActive;return o("div",{className:"ihub-dropzone ".concat(b),children:[o("div",t(t({},P()),{},{className:"ihub-dropzone-wrap",children:[a("input",t({},S())),a("p",y?{children:"Drop the files here ..."}:{children:s||(c=(null==d?void 0:d.join(", "))||".xlsx, .xls, .csv","Drag 'n' drop \"".concat(c,'" files here, or click to select files'))}),D&&o("p",{children:["File: ",D]})]})),!D&&(x||f)&&o("div",{className:"ihub-download-template",children:[a("p",{children:"PS: Existing contact will be update while new contacts will be created."}),x?a("button",{type:"button",onClick:x,className:"ihub-template-download-btn",children:"Download Template"}):a("a",{href:f,children:"Download Template"})]})]})};export{p as default};
|
|
2
2
|
//# sourceMappingURL=DropFile.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,typeof as n}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,jsx as r,Fragment as a}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{slicedToArray as e,typeof as n}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,jsx as r,Fragment as a}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import l from"next/link";import c from"next/image";import s from"@mui/icons-material/LightMode";import u from"@mui/icons-material/DarkMode";var h=function(h){var d=h.session,m=h.logoSrc,b=h.logoAlt,v=void 0===b?"Company Logo":b,p=h.navLinks,f=h.userAreaLinks,g=void 0===f?[]:f,N=h.theme,w=void 0===N?"LightMode":N,k=h.containerClass,L=void 0===k?"ihub-container":k,E=h.topBanner,M=h.bottomBanner,D=h.hideTopBanner,x=void 0!==D&&D,_=h.hideBottomBanner,B=void 0!==_&&_,C=h.userDropdownOpen,S=h.onUserDropdownToggle,y=h.renderUserDropdown,A=o(!1),U=e(A,2),j=U[0],T=U[1],z=o(!1),I=e(z,2),O=I[0],P=I[1],H=o(!1),W=e(H,2),Y=W[0],q=W[1],F=o(null),G=e(F,2),J=G[0],K=G[1],Q=o(null),R=e(Q,2),V=R[0],X=R[1],Z=o(w),$=e(Z,2),ee=$[0],ne=$[1],ie=void 0!==C,re=ie?C:Y,ae=d,oe=null==ae?void 0:ae.user,te=function(){if(null==oe||!oe.name)return"";if("string"==typeof oe.name)return oe.name;if("object"===n(oe.name)){var e=oe.name;return e.full_name||"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.email||""}return""}();t((function(){var e=function(){window.scrollY>50?P(!0):P(!1)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]),t((function(){var e=localStorage.getItem("theme");e&&(ne(e),document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e))}),[]),t((function(){var e=function(e){var n=e.target;!j||n.closest(".ihub-navbar-elements")||n.closest(".ihub-hamburger")||T(!1),re&&!n.closest(".ihub-user-dropdown")&&ce(),null===J||n.closest(".ihub-nav-submenu-".concat(J))||K(null)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}),[j,re,J,V]),t((function(){var e=function(){window.innerWidth>768&&j&&T(!1)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[j]);var le=function(){var e=!re;ie?null==S||S(e):q(e),X(null)},ce=function(){ie?null==S||S(!1):q(!1),X(null)};return i("header",{className:"ihub-navbar ".concat(O?"ihub-navbar-scrolled":""," ").concat("DarkMode"===ee?"ihub-navbar-dark":""),children:[E&&!x&&r("div",{className:"ihub-navbar-top-banner",children:E}),r("div",{className:L,children:i("nav",{className:"ihub-navbar-container",children:[r("div",{className:"ihub-navbar-logo",children:r(l,{href:"/",children:r(c,{src:m,alt:v,width:120,height:40,className:"ihub-logo-image"})})}),i("div",{className:"ihub-hamburger",onClick:function(){T(!j),K(null)},children:[r("div",{className:"ihub-hamburger-line ".concat(j?"ihub-active":"")}),r("div",{className:"ihub-hamburger-line ".concat(j?"ihub-active":"")}),r("div",{className:"ihub-hamburger-line ".concat(j?"ihub-active":"")})]}),i("div",{className:"ihub-navbar-elements ".concat(j?"ihub-active":""),children:[i("ul",{className:"ihub-nav-links",children:[p.map((function(e,n){return r("li",{className:"ihub-nav-item ihub-nav-submenu-".concat(n," ").concat(e.submenu?"ihub-has-submenu":""," ").concat(J===n?"ihub-submenu-active":""),children:e.submenu?i(a,{children:[i("a",{href:"#",onClick:function(e){return function(e,n){n.preventDefault(),K(J===e?null:e)}(n,e)},className:"ihub-submenu-toggle ".concat(e.highlight?"ihub-nav-highlight":""),children:[e.title,r("span",{className:"ihub-dropdown-arrow"})]}),J===n&&r("ul",{className:"ihub-submenu",children:e.submenu.map((function(e,n){return r("li",{className:"ihub-submenu-item",children:e.isExternal?i("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",children:[e.icon&&r("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]}):i(l,{href:e.href,children:[e.icon&&r("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]})},n)}))})]}):r(a,{children:e.isExternal?r("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:e.highlight?"ihub-nav-highlight":"",children:e.title}):r(l,{href:e.href,className:e.highlight?"ihub-nav-highlight":"",children:e.title})})},n)})),r("li",{className:"ihub-nav-item",children:r("button",{onClick:function(){var e="LightMode"===ee?"DarkMode":"LightMode";document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e),ne(e),localStorage.setItem("theme",e)},className:"ihub-theme-toggle","aria-label":"Switch to ".concat("LightMode"===ee?"DarkMode":"LightMode"," mode"),children:r("LightMode"===ee?u:s,{})})})]}),r("div",{className:"ihub-navbar-user-area",children:d?i("div",{className:"ihub-user-dropdown",children:[i("div",{className:"ihub-user-profile",onClick:le,children:[null!=oe&&oe.image?r(c,{src:oe.image,alt:"User",width:40,height:40,className:"ihub-user-avatar"}):r("div",{className:"ihub-user-initials",children:te.charAt(0)||"U"}),i("span",{className:"ihub-user-name ihub-hide-sm",children:[te,r("span",{className:"ihub-dropdown-arrow"})]})]}),re&&r("div",{className:"ihub-dropdown ihub-user-menu-dropdown",children:y?y({user:oe,isOpen:re,toggleDropdown:le,closeDropdown:ce}):i(a,{children:[g.map((function(e,n){return r("div",{className:"ihub-dropdown-item-wrapper",children:e.submenu?i("div",{className:"ihub-dropdown-with-submenu",children:[i("a",{href:"#",className:"ihub-dropdown-item ihub-dropdown-parent",onClick:function(e){return function(e,n){n.preventDefault(),n.stopPropagation(),X(V===e?null:e)}(n,e)},target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:[e.icon&&r("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title,r("span",{className:"ihub-submenu-caret ".concat(V===n?"ihub-active":"")})]}),V===n&&r("div",{className:"ihub-user-submenu",children:e.submenu.map((function(e,n){return i(l,{href:e.href,className:"ihub-dropdown-subitem",target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:[e.icon&&r("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title]},n)}))})]}):i(l,{href:e.href,className:"ihub-dropdown-item",children:[e.icon&&r("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title]})},n)})),i(l,{href:"/api/auth/signout",className:"ihub-dropdown-item ihub-signout",children:[r("span",{className:"ihub-dropdown-icon",children:"⤴"}),"Sign out"]})]})})]}):r("div",{className:"ihub-auth-buttons",children:g.map((function(e,n){return e.isButton?r(l,{href:e.href,className:"".concat("outline"===e.buttonStyle?"ihub-outlined-btn":"ihub-important-btn"),target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:e.title},n):r(l,{href:e.href,className:"ihub-auth-link",children:e.title},n)}))})})]})]})}),M&&!B&&r("div",{className:"ihub-navbar-bottom-banner",children:M})]})};export{h as default};
|
|
2
2
|
//# sourceMappingURL=ResponsiveNavbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{objectWithoutProperties as e,slicedToArray as i,asyncToGenerator as t,regeneratorRuntime as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as l,jsxs as s}from"react/jsx-runtime";import{useState as o,useCallback as c,useEffect as n}from"react";import{useSession as a}from"../../../node_modules/next-auth/react.js";import u from"./CopyToClipBoard.js";import{reqOptions as d}from"../lib/helpFunction.js";import{useDispatch as m,useSelector as p}from"../lib/redux/store.js";import"../lib/redux/slices/courseSlice/courseFilterSubject.js";import"../lib/redux/slices/courseSlice/courseFilterLevel.js";import"../lib/redux/slices/courseSlice/courseFilterDuration.js";import"../lib/redux/slices/courseSlice/courseSearch.js";import"../lib/redux/slices/courseSlice/stepQuestions.js";import"../lib/redux/slices/courseSlice/stepContent.js";import"../lib/redux/slices/courseSlice/videoTimestamp.js";import"../lib/redux/slices/courseSlice/videoTimestampObject.js";import"../lib/redux/slices/courseSlice/courseModules.js";import"../lib/redux/slices/courseSlice/courseOverview.js";import"../lib/redux/slices/courseSlice/selectedCourses.js";import"../lib/redux/slices/navigationSlice/appToggle.js";import"../lib/redux/slices/navigationSlice/toggleCreateCourse.js";import"../lib/redux/slices/navigationSlice/toggleCreateCohort.js";import{confirmDelete as b}from"../lib/redux/slices/navigationSlice/confirmDelete.js";import{selectConfirmDelete as h}from"../lib/redux/slices/navigationSlice/selectors.js";import"../lib/redux/slices/navigationSlice/IPAdress.js";import"../lib/redux/slices/navigationSlice/settingsToggle.js";import"../lib/redux/slices/navigationSlice/userLocation.js";import"../lib/redux/slices/navigationSlice/searchValue.js";import"../lib/redux/slices/navigationSlice/currentPromo.js";import"../lib/redux/slices/navigationSlice/courseNextStep.js";import"../lib/redux/slices/channelSlice/activeChannel.js";import"../lib/redux/slices/channelSlice/channelDetails.js";import"../lib/redux/slices/channelSlice/instructorChannelList.js";import"../lib/redux/slices/channelSlice/channelHandle.js";import"../lib/redux/slices/generics/objectSlice.js";import"../lib/redux/slices/generics/arraySlice.js";import"../lib/redux/slices/messageSlice/feedbackToggle.js";import"../lib/redux/slices/messageSlice/statusMessageState.js";import"../lib/redux/slices/utilsSlice/screenSize.js";import"../lib/redux/slices/authSlice/channelCallbackUrl.js";var g=["token"],x=function(x){var j=x.token,S=e(x,g),f=o(""),v=i(f,2),y=v[0],C=v[1],N=m(),T=p(h),k=T.url,D=T.title,P=function(e,l,s,n){var u=a().data,m=o("idle"),p=i(m,2),b=p[0],h=p[1],g=o(null),x=i(g,2),j=x[0],S=x[1],f=u;return{deleteItem:c(t(r().mark((function i(){var t,l;return r().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e){i.next=2;break}return i.abrupt("return");case 2:return h("loading"),S(null),t=d("DELETE",null,s),i.prev=5,i.next=8,fetch(e,t);case 8:204===(l=i.sent).status?(h("success"),n()):401===l.status?(h("error"),S("You don't have permission to delete this item.")):(h("error"),S("Couldn't delete the item. Please try again or report the issue.")),i.next=16;break;case 12:i.prev=12,i.t0=i.catch(5),h("error"),S("Network error. Please check your connection and try again.");case 16:case"end":return i.stop()}}),i,null,[[5,12]])}))),[e,f,n]),status:b,error:j}}(k,0,j,c((function(){N(b.actions.set({deleteStatus:204,title:D}))}),[N,D])),w=P.deleteItem,F=P.status,L=P.error,E=c((function(){N(b.actions.set({}))}),[N]),I=y===D;return n((function(){C("")}),[D]),k?l("div",{className:"ihub-modal",onClick:E,role:"dialog","aria-labelledby":"delete-modal-title","aria-describedby":"delete-modal-description",children:l("div",{className:"ihub-modal-content",onClick:function(e){return e.stopPropagation()},children:s("div",{className:"ihub-delete-modal",children:[s("h4",{id:"delete-modal-title",children:["Delete ",D,"?"]}),l("p",{className:"ihub-delete-warning",id:"delete-modal-description",children:"Warning: This action cannot be undone!"}),s("p",{children:["This will permanently delete the"," ",l("strong",{children:S.itemTitle||D})," repository, including all associated data, feedbacks, schedules, and team associations."]}),s("form",{onSubmit:function(e){e.preventDefault(),I&&w()},children:[s("div",{className:"ihub-delete-confirmation",children:[s("p",{children:["Please type ",l("strong",{children:D})," to confirm deletion."]}),l(u,{text:D||""})]}),s("div",{className:"ihub-form-input",children:[l("input",{type:"text",value:y,onChange:function(e){return C(e.target.value)},className:"ihub-delete-input",placeholder:"Type to confirm","aria-describedby":"confirmation-helper",autoComplete:"off",autoFocus:!0}),l("small",{id:"confirmation-helper",className:"ihub-helper-text",children:"Type the exact name to enable deletion"})]}),L&&l("p",{className:"ihub-delete-message",role:"alert",children:L}),s("div",{className:"ihub-delete-actions",children:[l("button",{type:"submit",disabled:!I||"loading"===F,className:"ihub-danger-btn","aria-busy":"loading"===F,children:"loading"===F?"Deleting...":"Delete"}),l("button",{type:"button",onClick:E,className:"ihub-outlined-btn",children:"Cancel"})]})]})]})})}):null};export{x as default};
|
|
2
2
|
//# sourceMappingURL=DeleteConfirmationModal.js.map
|