@6thbridge/hexa 0.0.37 → 0.0.38
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/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +2814 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2755 -2
- package/dist/index.mjs.map +1 -1
- package/dist/output.css +45 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1,2 +1,2755 @@
|
|
1
|
-
var Tt=Object.defineProperty;var Et=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Oe=(t,e,r)=>Et(t,typeof e!="symbol"?e+"":e,r);import Bt from"react";import*as He from"react";import*as we from"@radix-ui/react-label";import{cva as At}from"class-variance-authority";import{clsx as It}from"clsx";import{twMerge as Ft}from"tailwind-merge";function a(...t){return Ft(It(t))}import{jsx as Vt}from"react/jsx-runtime";var Mt=At("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),De=He.forwardRef(({className:t,...e},r)=>Vt(we.Root,{ref:r,className:a(Mt(),t),...e}));De.displayName=we.Root.displayName;import{jsx as Ge,jsxs as Ot}from"react/jsx-runtime";var x=Bt.forwardRef(({className:t,children:e,showAsterisk:r,error:i,...o},n)=>Ge(De,{ref:n,className:a(i&&"text-red-500",t),...o,children:r?Ot("p",{children:[e,Ge("span",{className:"text-red-500",children:"*"})]}):e}));x.displayName="FormLabel";import{jsx as We,jsxs as Ht}from"react/jsx-runtime";var j=({size:t=16,colour:e="primary"})=>Ht("svg",{className:"animate-spin",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:[We("circle",{cx:"10",cy:"10",r:"9.25",stroke:"transparent",strokeWidth:"1.5"}),We("path",{d:"M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",fill:e==="primary"?"#ffffff":"currentColor",className:"rounded"})]});import*as ge from"react";import{Slot as Gt}from"@radix-ui/react-slot";import{cva as Wt}from"class-variance-authority";import{Fragment as ze,jsx as J,jsxs as zt}from"react/jsx-runtime";var ye=Wt("overflow-hidden isolate inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",{variants:{variant:{primary:"border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",danger:"border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",neutral:"!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",outlined:"border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60","danger-outlined":"border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60","light-outlined":"border-white text-white hover:opacity-80 disabled:opacity-60","dark-text":"border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",light:"border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"},size:{default:"py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",sm:"py-[0.375rem] px-[1rem] leading-[1rem] font-normal text-sm rounded-lg",lg:"py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",md:"h-12 py-1 px-5 items-center","icon-sm":"h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",icon:"h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg","icon-lg":"h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"}},defaultVariants:{variant:"primary",size:"default"}}),K=ge.forwardRef(({className:t,variant:e="primary",size:r,asChild:i=!1,isLoading:o=!1,leftNode:n,rightNode:l,LoaderSize:s,...d},c)=>{let m=i?Gt:"button",{children:u,disabled:p,...b}=d,v=ge.useRef(null);return J(m,{className:a(ye({variant:e,size:r,className:t})),ref:v||c,disabled:p||o,...b,children:J("div",{className:"flex font-medium justify-center items-center gap-2",children:o?J(ze,{children:J("span",{className:"mx-auto",children:J(j,{size:s,colour:"secondary"})})}):zt(ze,{children:[n,u,l]})})})});K.displayName="Button";import*as Le from"react";import{cva as ke}from"class-variance-authority";import Kt from"react";import{jsx as _t}from"react/jsx-runtime";var R=Kt.forwardRef(({className:t,children:e,error:r,...i},o)=>{let n=r??e;return n?_t("p",{ref:o,className:a("text-xs font-normal text-[#F04248]",t),...i,children:n}):null});R.displayName="ErrorMessage";import Zt from"react";import{jsx as $t}from"react/jsx-runtime";var w=Zt.forwardRef(({className:t,...e},r)=>$t("div",{ref:r,className:a("text-sm text-[#8E98A8",t),...e}));w.displayName="FormDescription";import{jsx as O,jsxs as _e}from"react/jsx-runtime";var Ut=ke("!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",error:"placeholder:text-red-500 text-red-500",loading:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",prefilled:"",neutral:""}},defaultVariants:{status:"default"}}),Ze=Le.forwardRef(({className:t,status:e,type:r,...i},o)=>O("input",{type:r,className:a(Ut({status:e}),t),ref:o,...i}));Ze.displayName="BaseInnerInput";var I=ke("flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{status:{default:"border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-text-primary focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"}},defaultVariants:{status:"default"}}),Ke=ke("top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{side:{left:"left-0 rounded-l-[8px] border-r",right:"right-0 rounded-r-[8px] border-l"},status:{default:"border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:"bg-transparent border-0 caret-[#DEDEDE] !px-0"}},defaultVariants:{status:"default",side:"left"}}),A=Le.forwardRef(({className:t,status:e="default",disabled:r,error:i,isLoading:o,sideNodeClassName:n,showAsterisk:l,label:s,description:d,...c},m)=>{let u=e;return i&&(u="error"),o&&(u="loading"),r&&(u="prefilled"),_e("div",{className:"relative space-y-1 w-full",children:[s&&O(x,{showAsterisk:l,error:i,children:s}),_e("div",{className:a(I({status:u}),c.leftNode?"pl-0":"",c.rightNode?"pr-0":"",t),children:[c.leftNode?O("div",{className:a(Ke({status:u,side:"left"}),n),children:c.leftNode}):null,O(Ze,{ref:m,disabled:o||r,className:a({"!pl-3":c.leftNode&&e!=="neutral","!pr-3":c.rightNode&&e!=="neutral"}),...c}),c.rightNode?O("div",{className:a(Ke({status:u,side:"right"}),n),children:c.rightNode}):null]}),d&&O(w,{className:"text-gray-400 text-sm !font-normal",children:d}),O(R,{error:i})]})});A.displayName="Input";import{useMemo as jt,useState as et}from"react";import{jsx as $e,jsxs as Xt}from"react/jsx-runtime";var Ue=()=>Xt("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$e("path",{d:"M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),$e("path",{d:"M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as Xe,jsxs as Yt}from"react/jsx-runtime";var Ye=()=>Yt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Xe("path",{d:"M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Xe("path",{d:"M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as je}from"react/jsx-runtime";var Je=()=>je("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:je("path",{d:"M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",fill:"currentColor"})});import{jsx as Qe}from"react/jsx-runtime";var qe=()=>Qe("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Qe("path",{d:"M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});import{jsx as k,jsxs as Jt}from"react/jsx-runtime";var tt=[{label:"Uppercase",key:"uppercase",RegExp:/[A-Z]/,validated:!1},{label:"Lowercase",key:"lowercase",RegExp:/[a-z]/,validated:!1},{label:"Number",key:"number",RegExp:/\d/,validated:!1},{label:"8 Characters",key:"eight-chars",RegExp:/.{8}/,validated:!1}],rt=({onValidate:t,onChange:e,disableValidation:r,...i})=>{let[o,n]=et(!1),[l,s]=et(tt),d=p=>tt.map(b=>({...b,validated:b.RegExp.test(p)})),c=p=>{let b=d(p),v=b.every(P=>P.validated);return s(b),v},m=p=>{if(e&&e(p),r)return;let b=p?.target?.value,v=c(b);t&&t(v,b)},u=jt(()=>k("div",{className:"flex items-center gap-2",children:l?.map(p=>Jt("div",{className:a("text-xs flex items-center gap-0.5",{"text-[#62C554]":p?.validated,"text-[#8E98A8]":!p?.validated}),children:[k("span",{className:"",children:p?.validated?k(Je,{}):k(qe,{})}),k("span",{className:"",children:p?.label})]},p?.key))}),[l]);return k(A,{sideNodeClassName:"!border-l-0",rightNode:o?k("button",{type:"button",onClick:()=>n(p=>!p),children:k(Ue,{})}):k("button",{type:"button",onClick:()=>n(p=>!p),children:k(Ye,{})}),type:o?"text":"password",onChange:m,description:!r&&u,...i})};rt.displayName="PasswordInput";import{cva as Qt}from"class-variance-authority";import{jsx as be,jsxs as qt}from"react/jsx-runtime";var Qo=Qt("flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",loading:"placeholder:text-[#C4C4C4]",prefilled:"resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:""}},defaultVariants:{status:"default"}}),ot=({className:t,status:e="default",disabled:r,error:i,isLoading:o,showAsterisk:n,label:l,description:s,...d})=>{let c=e;return i&&(c="error"),o&&(c="loading"),r&&(c="prefilled"),qt("div",{className:"relative space-y-1",children:[be(x,{showAsterisk:n,error:i,children:l}),be("textarea",{className:a("min-h-[80px]",I({status:c}),t),disabled:o||r,...d}),be(w,{className:"text-gray-400 text-sm !font-normal",children:s}),be(R,{error:i})]})};ot.displayName="Textarea";import*as G from"react";import*as M from"react";import{Command as h}from"cmdk";import{Search as ar}from"lucide-react";import*as Q from"react";import*as g from"@radix-ui/react-dialog";import{jsx as at,jsxs as er}from"react/jsx-runtime";var nt=()=>er("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[at("path",{d:"M18 6 6 18"}),at("path",{d:"m6 6 12 12"})]});import{Fragment as or,jsx as C,jsxs as _}from"react/jsx-runtime";var tr=g.Root,rr=g.Trigger,it=g.Portal,st=Q.forwardRef(({className:t,...e},r)=>C(g.Overlay,{ref:r,className:a("fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));st.displayName=g.Overlay.displayName;var Se=Q.forwardRef(({className:t,hideCloseButton:e,children:r,...i},o)=>_(it,{children:[C(st,{}),_(g.Content,{ref:o,className:a("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",t),...i,children:[r,!e&&_(g.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[C(nt,{}),C("span",{className:"sr-only",children:"Close"})]})]})]}));Se.displayName=g.Content.displayName;var lt=({className:t,...e})=>C("div",{className:a("flex flex-col space-y-1.5 text-left",t),...e});lt.displayName="DialogHeader";var ct=({className:t,...e})=>C("div",{className:a("flex flex-row justify-end sm:space-x-2",t),...e});ct.displayName="DialogFooter";var dt=Q.forwardRef(({className:t,...e},r)=>C(g.Title,{ref:r,className:a("text-xl font-semibold leading-none tracking-tight",t),...e}));dt.displayName=g.Title.displayName;var pt=Q.forwardRef(({className:t,...e},r)=>C(g.Description,{ref:r,className:a("text-sm text-gray-500",t),...e}));pt.displayName=g.Description.displayName;var Te=({trigger:t=void 0,children:e,open:r,onOpenChange:i,hideCloseButton:o,footer:n,title:l,description:s,contentClassName:d,headerClassName:c,titleClassName:m,descriptionClassName:u,footerClassName:p,asChild:b=!0,onOpenAutoFocus:v,onCloseAutoFocus:P,onEscapeKeyDown:fe,onInteractOutside:W,onPointerDownOutside:Pe,...Re})=>_(tr,{...Re,open:r,onOpenChange:i,children:[C(rr,{asChild:b,children:t}),C(it,{children:_(Se,{className:d,hideCloseButton:o,onOpenAutoFocus:v,onCloseAutoFocus:P,onEscapeKeyDown:fe,onPointerDownOutside:Pe,onInteractOutside:W,children:[l||s?_(lt,{className:c,children:[l&&C(dt,{className:m,children:l}),s&&C(pt,{className:u,children:s})]}):C(or,{}),e,n&&C(ct,{className:p,children:n})]})})]});Te.displayName=g.Dialog.displayName;import{Fragment as ua,jsx as S,jsxs as sr}from"react/jsx-runtime";var q=M.forwardRef(({className:t,...e},r)=>S(h,{ref:r,className:a("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));q.displayName=h.displayName;var ee=M.forwardRef(({className:t,CommandInputContainerClassName:e,loading:r,...i},o)=>sr("div",{className:a("flex items-center border-0 px-3 gap-2",e),"cmdk-input-wrapper":"",children:[r?S(j,{size:16,colour:"secondary"}):S(ar,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S(h.Input,{ref:o,className:a("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:r,...i})]}));ee.displayName=h.Input.displayName;var te=M.forwardRef(({className:t,...e},r)=>S(h.List,{ref:r,className:a("overflow-y-auto overflow-x-hidden",t),...e}));te.displayName=h.List.displayName;var re=M.forwardRef((t,e)=>S(h.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));re.displayName=h.Empty.displayName;var oe=M.forwardRef(({className:t,...e},r)=>S(h.Group,{ref:r,className:a("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));oe.displayName=h.Group.displayName;var nr=M.forwardRef(({className:t,...e},r)=>S(h.Separator,{ref:r,className:a("-mx-1 h-px bg-border",t),...e}));nr.displayName=h.Separator.displayName;var ae=M.forwardRef(({className:t,...e},r)=>S(h.Item,{ref:r,className:a("relative text=[#222222] flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...e}));ae.displayName=h.Item.displayName;var ir=({className:t,...e})=>S("span",{className:a("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});ir.displayName="CommandShortcut";import*as mt from"react";import*as D from"@radix-ui/react-popover";import{jsx as ne,jsxs as lr}from"react/jsx-runtime";var Z=D.Root,V=D.Trigger,H=mt.forwardRef(({className:t,align:e="center",sideOffset:r=4,portal:i=!0,...o},n)=>i?ne(D.Portal,{children:ne(D.Content,{ref:n,align:e,sideOffset:r,className:a("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),onOpenAutoFocus:o.onOpenAutoFocus,onCloseAutoFocus:o.onCloseAutoFocus,...o})}):ne(D.Content,{ref:n,align:e,sideOffset:r,className:a("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),onOpenAutoFocus:o.onOpenAutoFocus,onCloseAutoFocus:o.onCloseAutoFocus,...o}));H.displayName=D.Content.displayName;var Ce=({trigger:t,children:e,open:r,onOpenChange:i,contentClassName:o,asChild:n=!0,align:l,side:s,alignOffset:d,triggerClassName:c,sideOffset:m,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:b=!0,...v})=>lr(Z,{...v,open:r,onOpenChange:i,children:[ne(V,{asChild:n,className:c,children:t}),ne(H,{alignOffset:d,sideOffset:m,side:s,align:l,className:o,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:b,children:e})]});Ce.displayName=D.Root.displayName;import*as Ee from"react";import*as N from"@radix-ui/react-scroll-area";import{jsx as ie,jsxs as cr}from"react/jsx-runtime";var se=Ee.forwardRef(({className:t,viewPortClassName:e,children:r,...i},o)=>cr(N.Root,{ref:o,className:a("relative overflow-hidden",t),...i,children:[ie(N.Viewport,{className:a("h-full w-full rounded-[inherit]",e),children:r}),ie(ut,{}),ie(N.Corner,{})]}));se.displayName=N.Root.displayName;var ut=Ee.forwardRef(({className:t,orientation:e="vertical",...r},i)=>ie(N.ScrollAreaScrollbar,{ref:i,orientation:e,className:a("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:ie(N.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]"})}));ut.displayName=N.ScrollAreaScrollbar.displayName;import{jsx as T,jsxs as he}from"react/jsx-runtime";var ft=({className:t,value:e,placeholder:r="",status:i,disabled:o})=>T(V,{asChild:!0,disabled:o,children:he("button",{disabled:o,className:a(I({status:i}),"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",e?"":"text-[#79818C]",t),children:[e??r??"Select options...",T("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:T("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),ve=({options:t=[],value:e,onChange:r,containerClassName:i,placeholder:o,disabled:n,loading:l,optionComponent:s,children:d,modal:c=!1,hideSearch:m,className:u,inputValue:p,onValueChange:b,onInputValueChange:v})=>{let[P,fe]=G.useState(!1),W=G.useRef(null),[Pe,Re]=G.useState(void 0);return G.useLayoutEffect(()=>{W.current&&Re(W.current.clientWidth)},[W.current]),he(Z,{modal:c,open:P,onOpenChange:fe,children:[T("div",{className:a("w-full",u),ref:W,children:d}),T(H,{portal:!c,className:"p-0 min-w-[200px]",style:{width:Pe},children:he(q,{className:a("relative max-h-[270px]",{"mt-2":!m}),children:[!m&&T(ee,{loading:l,placeholder:o??"Search options...",onValueChange:v,value:p,CommandInputContainerClassName:"mx-2 border rounded-md border-[#DEDEDE]"}),T(se,{viewPortClassName:"max-h-[225px]",className:a("w-full px-0 h-full overflow-y-auto",i),children:he(te,{children:[!m&&T(re,{children:"No result found."}),T(oe,{className:"w-full",children:t?.map(z=>T(ae,{defaultValue:e?.label,value:z.label,disabled:n,onSelect:()=>{r(z),fe(!1),b?.(z?.value)},children:s?s(z):z.label},z.value))})]})})]})})]})};var Ie=[{countryCode:"GLOBAL",countryName:"Global",currency:"Dollars",currencyCode:"USD",internetCountryCode:"GLOBAL"},{countryName:"Benin",countryCode:"+229",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BJ"},{countryName:"Burkina Faso",countryCode:"+226",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BF"},{countryName:"Cameroon",countryCode:"+237",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CM"},{countryName:"Chad",countryCode:"+235",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"TD"},{countryName:"DR Congo",countryCode:"+243",currency:"Congolese franc",currencyCode:"CDF",currencyIcon:"FC",internetCountryCode:"CD"},{countryName:"Eswatini",countryCode:"+268",currency:"Swazi lilangeni",currencyCode:"SZL",currencyIcon:"L",internetCountryCode:"SZ"},{countryName:"Gabon",countryCode:"+241",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"GA"},{countryName:"Ghana",countryCode:"+233",currency:"Ghanaian cedi",currencyCode:"GHS",currencyIcon:"\u20B5",internetCountryCode:"GH"},{countryName:"Guinea",countryCode:"+224",currency:"Guinean franc",currencyCode:"GNF",currencyIcon:"Fr",internetCountryCode:"GN"},{countryName:"Ivory Coast",countryCode:"+225",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"CI"},{countryName:"Kenya",countryCode:"+254",currency:"Kenyan shilling",currencyCode:"KES",currencyIcon:"Sh",internetCountryCode:"KE"},{countryName:"Lesotho",countryCode:"+266",currency:"Lesotho loti",currencyCode:"LSL",currencyIcon:"L",internetCountryCode:"LS"},{countryName:"Liberia",countryCode:"+231",currency:"Liberian dollar",currencyCode:"LRD",currencyIcon:"$",internetCountryCode:"LR"},{countryName:"Madagascar",countryCode:"+261",currency:"Malagasy ariary",currencyCode:"MGA",currencyIcon:"Ar",internetCountryCode:"MG"},{countryName:"Malawi",countryCode:"+265",currency:"Malawian kwacha",currencyCode:"MWK",currencyIcon:"MK",internetCountryCode:"MW"},{countryName:"Mali",countryCode:"+223",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"ML"},{countryName:"Mozambique",countryCode:"+258",currency:"Mozambican metical",currencyCode:"MZN",currencyIcon:"MT",internetCountryCode:"MZ"},{countryName:"Namibia",countryCode:"+264",currency:"Namibian dollar",currencyCode:"NAD",currencyIcon:"$",internetCountryCode:"NA"},{countryName:"Niger",countryCode:"+227",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"NE"},{countryName:"Nigeria",countryCode:"+234",currency:"Nigerian naira",currencyCode:"NGN",currencyIcon:"\u20A6",internetCountryCode:"NG"},{countryName:"Republic of the Congo",countryCode:"+242",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CG"},{countryName:"Rwanda",countryCode:"+250",currency:"Rwandan franc",currencyCode:"RWF",currencyIcon:"Fr",internetCountryCode:"RW"},{countryName:"Senegal",countryCode:"+221",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"SN"},{countryName:"Seychelles",countryCode:"+248",currency:"Seychellois rupee",currencyCode:"SCR",currencyIcon:"\u20A8",internetCountryCode:"SC"},{countryName:"South Africa",countryCode:"+27",currency:"South African rand",currencyCode:"ZAR",currencyIcon:"R",internetCountryCode:"ZA"},{countryName:"South Sudan",countryCode:"+211",currency:"South Sudanese pound",currencyCode:"SSP",currencyIcon:"\xA3",internetCountryCode:"SS"},{countryName:"Tanzania",countryCode:"+255",currency:"Tanzanian shilling",currencyCode:"TZS",currencyIcon:"Sh",internetCountryCode:"TZ"},{countryName:"Togo",countryCode:"+228",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"TG"},{countryName:"Uganda",countryCode:"+256",currency:"Ugandan shilling",currencyCode:"UGX",currencyIcon:"Sh",internetCountryCode:"UG"},{countryName:"Zambia",countryCode:"+260",currency:"Zambian kwacha",currencyCode:"ZMW",currencyIcon:"ZK",internetCountryCode:"ZM"}],gt=()=>{let t={};return Ie?.forEach(e=>{t[e?.internetCountryCode]=e?.countryName}),t};import*as de from"react";import*as xe from"react-phone-number-input";import mr from"react-phone-number-input/flags";import{jsx as le,jsxs as pr}from"react/jsx-runtime";var dr=t=>pr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"none",...t,children:[le("rect",{width:"32",height:"32",fill:"#60A5FA"})," ",le("path",{d:"M3 10L7 8L10 9L13 8L16 10L19 9L22 11L25 10L28 12V15L26 17L28 19L27 22L29 24L27 26L24 25L21 26L18 24L15 25L12 23L9 24L6 22L4 23L2 21V18L4 16L3 13L5 11L3 10Z",fill:"#34D399"}),le("rect",{x:"2",y:"28",width:"28",height:"3",fill:"#D1D5DB"}),le("path",{d:"M0 16H32M8 0V32M16 0V32M24 0V32",stroke:"#2563EB",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),le("path",{d:"M0 16H32",stroke:"#2563EB",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]}),yt=dr;import{jsx as f,jsxs as ce}from"react/jsx-runtime";var bt=de.forwardRef(({className:t,onChange:e,defaultCountry:r="NG",modal:i,showAsterisk:o,label:n,description:l,error:s,...d},c)=>{let m=u=>f(ur,{...u,status:d.status,modal:i});return ce("div",{className:"relative space-y-1",children:[f(x,{showAsterisk:o,error:s,children:n}),f(xe.default,{ref:c,className:a("flex",t),flagComponent:B,countrySelectComponent:m,inputComponent:Ct,defaultCountry:r,onChange:u=>{e&&e?.(u)},...d}),f(w,{className:"text-gray-400 text-sm !font-normal",children:l}),f(R,{error:s})]})});bt.displayName="PhoneInput";var Ct=de.forwardRef(({className:t,...e},r)=>f(A,{className:a("!rounded-s-none h-10",t),...e,ref:r}));Ct.displayName="InputComponent";var ur=({disabled:t,value:e,onChange:r,options:i,status:o,modal:n})=>{let l=de.useCallback(s=>{r(s)},[r]);return ce(Z,{modal:n,children:[f(V,{disabled:t,children:ce("div",{className:a(I({status:o}),"transition justify-center items-center disabled:text-base-500 flex gap-3 h-10 rounded-e-none border-e-0 pl-2 pr-2"),children:[f(B,{country:e,countryName:e}),f("svg",{className:a("mr-0.5 h-4 w-4 opacity-50",t?"hidden":"opacity-100"),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:f("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"#959595",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),f(H,{portal:!n,className:"w-[200px] md:w-[300px] p-0",children:f(q,{children:f(te,{children:ce(se,{className:"h-72",children:[f(ee,{placeholder:"Search country..."}),f(re,{children:"No country found."}),f(oe,{children:i.filter(s=>s.value).map(s=>ce(ae,{className:"gap-2",onSelect:()=>l(s.value),children:[f(B,{country:s.value,countryName:s.label}),f("span",{className:"flex-1 text-sm",children:s.label}),s.value&&f("span",{className:"text-[#191919]/50 text-sm dark:text-white",children:`+${xe.getCountryCallingCode(s.value)}`}),f("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:a("ml-auto",s.value===e?"opacity-100":"opacity-0"),children:f("path",{d:"M4 8.00008L6.66353 10.6636L12 5.33655",stroke:"#959595",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${s.value}-${s.label}`))})]})})})})]})},B=({country:t,countryName:e,className:r})=>{let i=mr[t];return t==="GLOBAL"?f("span",{className:a("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:f(yt,{className:"w-full h-[90%]"})}):f("span",{className:a("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:i&&f(i,{title:e})})};B.displayName="FlagComponent";import{jsx as L,jsxs as pe}from"react/jsx-runtime";var fr=gt(),gr=({className:t,value:e,placeholder:r="",status:i,disabled:o})=>L(V,{asChild:!0,disabled:o,children:pe("button",{disabled:o,className:a(I({status:i}),"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",e?"":"text-[#79818C]",t),children:[e?pe("div",{className:"flex gap-2 items-center",children:[L(B,{country:e,countryName:e,className:"ml-1 !w-6 h-5"}),pe("span",{className:"",children:[" ",fr[e]]})]}):r??"Select options...",L("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:L("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),yr=({hideSearch:t=!0,showAsterisk:e,label:r,description:i,error:o,...n})=>{let l=Ie?.map(s=>({value:s?.internetCountryCode,label:s?.countryName,...s}));return pe("div",{className:"relative space-y-1",children:[L(x,{showAsterisk:e,error:o,children:r}),L(ve,{options:l,hideSearch:t,optionComponent:s=>pe("div",{className:"w-full flex items-center gap-2",children:[L(B,{country:s?.internetCountryCode,countryName:s?.label,className:"ml-2 !w-6 !h-5"}),L("span",{className:"flex-1 text-sm",children:s?.label})]}),...n,children:L(gr,{value:n?.value?.value,status:n?.status,placeholder:n?.placeholder??" Select Country"})}),L(w,{className:"text-gray-400 text-sm !font-normal",children:i}),L(R,{error:o})]})};import{jsx as me,jsxs as Cr}from"react/jsx-runtime";var br=({showAsterisk:t,label:e,description:r,error:i,hideSearch:o=!0,status:n,...l})=>Cr("div",{className:"relative space-y-1",children:[me(x,{showAsterisk:t,error:i,children:e}),me(ve,{hideSearch:o,...l,containerClassName:"h-full",children:me(ft,{disabled:l?.disabled,placeholder:"Select or search email",status:n,value:l?.value?.label??l?.value?.value})}),me(w,{className:"text-gray-400 text-sm !font-normal",children:r}),me(R,{error:i})]});import hr from"react-otp-input";import{cva as vr}from"class-variance-authority";import{useMemo as xr}from"react";import{jsx as ht}from"react/jsx-runtime";var Nr=vr("transition cursor-default placeholder:text-black dark:placeholder:text-white rounded-lg !h-14 !w-14 border aspect-square text-base font-semibold tracking-normal outline-none placeholder:text-sm placeholder:font-normal text-black focus:bg-white",{variants:{status:{default:"border-gray-300 dark:border-[#d4d4d4] focus:border-gray-400 focus-visible:!ring-offset-gray-200 focus:ring-offset-gray-200 !ring-gray-200 !focus-visible:ring-1 bg-white dark:!bg-transparent dark:focus-visible:!ring-0 dark:focus-within:!bg-transparent dark:text-white dark:focus-within:border-[#9299A2] dark:border-[#676767] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",loading:"placeholder:text-[#C4C4C4]"}},defaultVariants:{status:"default"}}),Pr=({numInputs:t=4,inputStyle:e,containerStyle:r,placeholder:i="-",status:o,...n})=>{let l=xr(()=>i||new Array(t).fill("").reduce((c,m)=>c+=m,""),[t,i]);return ht(hr,{numInputs:t,placeholder:l,containerStyle:a("w-full",r),inputStyle:a(Nr({status:o}),e),renderInput:s=>ht("input",{...s}),...n})};import{useState as Rr}from"react";import{Copy as wr,CheckIcon as Dr}from"lucide-react";import{motion as Lr,AnimatePresence as kr}from"framer-motion";import{jsx as $,jsxs as Tr}from"react/jsx-runtime";var Sr=({text:t,onCopy:e,iconsPosition:r="right",clampText:i=!0})=>{let[o,n]=Rr(!1),l=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),e?.(),setTimeout(()=>n(!1),2e3)})},s=o?Dr:wr;return Tr("div",{className:"flex items-center space-x-2 cursor-pointer text-[#717171] bg-gray-100 w-fit max-w-full rounded-md p-1 px-2",children:[r==="left"&&$(vt,{Icon:s,onClick:l,copied:o}),$("span",{className:`${i?"truncate max-w-[100px]":""}`,children:t}),r==="right"&&$(vt,{Icon:s,onClick:l,copied:o})]})},vt=({Icon:t,onClick:e,copied:r})=>$(kr,{mode:"wait",children:$(Lr.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},onClick:e,children:$(t,{className:`w-5 h-5 ${r?"text-green-500":"text-gray-500 hover:text-gray-700 transition"}`})},r?"check":"copy")});import{useEffect as xt,useState as Er}from"react";import{Search as Ir}from"lucide-react";import{jsx as Nt}from"react/jsx-runtime";var Fe=({value:t,onChange:e,debounce:r=500,addon:i,...o})=>{let[n,l]=Er(t??""),s=d=>l(d.target.value);return xt(()=>{t&&l(t)},[t]),xt(()=>{let d=setTimeout(()=>{e(n)},r);return()=>clearTimeout(d)},[n,r,e]),Nt(A,{leftNode:i??Nt(Ir,{className:" w-4 h-4 text-gray-400"}),sideNodeClassName:"bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",...o,className:a("!pl-0 py-1 border-[.5px] border-[#E9EBF8] rounded-xl text-sm w-full h-8 focus:outline-none focus:placeholder:hidden focus:!ring-2 !focus:ring-primary-main bg-[#F5F8FF] focus-within:!bg-transparent placeholder:text-xs",o?.className),onChange:s,value:n})};import{jsx as Ae}from"react/jsx-runtime";var Fr=({status:t,variant:e,className:r})=>Ae("div",{children:Ae("div",{className:a("order-first max-w-max flex-none rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ring-current sm:order-none text-[14px] capitalize",{"bg-green-500/20 text-green-500":e==="success"},{"bg-gray-500/20 text-white":e==="abandoned"},{"bg-red-500/20 text-red-500":e==="failed"},{"bg-yellow-500/20 text-yellow-500":e==="pending"},r),children:Ae("p",{children:t.replace("-"," ")})})});import{Download as Or,ListFilter as Hr,Loader as Gr,RotateCw as Wr}from"lucide-react";import{ChevronLeftIcon as Mr,ChevronRightIcon as Vr}from"lucide-react";import{jsx as Me}from"react/jsx-runtime";var Ar=({page:t,currentPage:e,onClick:r})=>typeof t=="string"?Me("span",{className:"px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500",children:t}):Me("button",{onClick:r,className:`p-1 w-8 h-8 text-xs sm:text-sm rounded-full ${t===e?"bg-primary-main text-white":"text-[#717171] hover:bg-primary-main/10"}`,children:t}),Pt=({totalPages:t,currentPage:e,handlePageClick:r})=>{let o=()=>{let d=Math.floor(1.5),c=Math.max(1,e-d),m=Math.min(t,c+3-1);return m>t&&(c=Math.max(1,t-3+1),m=t),{start:c,end:m}},{start:n,end:l}=o(),s=[];return n>1&&s.push(1),n>2&&s.push("..."),s.push(...Array.from({length:l-n+1},(d,c)=>n+c)),l<t-1&&s.push("..."),l<t&&s.push(t),s.map((d,c)=>Me(Ar,{page:d,currentPage:e,onClick:typeof d=="number"?()=>r(d):void 0},c))};import{jsx as U,jsxs as Ve}from"react/jsx-runtime";var Rt=({currentPage:t=1,totalPages:e=1,onPageChange:r,itemsPerPage:i=0,totalItems:o=0})=>{let n=d=>{d>=1&&d<=e&&r?.(d)},l=i===0?1:i*(t-1)+1,s=t===e?o:Math.min(l+i-1,o);return Ve("div",{className:"flex items-center justify-between border-t border-gray-200 px-4 py-3 sm:px-6 w-full flex-wrap gap-y-10 sm:gap-y-0",children:[o&&U("section",{className:"text-[#717171] text-[12px]",children:Ve("p",{className:"",children:["Showing ",l," - ",s," of ",o]})}),U("div",{className:"flex items-center justify-center sm:justify-end ",children:Ve("nav",{className:" inline-flex gap-x-1 sm:gap-x-[10px] items-center",children:[U("button",{onClick:()=>n(t-1),disabled:t===1,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:U(Mr,{className:"size-5"})}),Pt({currentPage:t,totalPages:e,handlePageClick:n}),U("button",{onClick:()=>n(t+1),disabled:t===e,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:U(Vr,{className:"size-5"})})]})})]})};import{flexRender as wt}from"@tanstack/react-table";import{jsx as F,jsxs as Br}from"react/jsx-runtime";var Dt=({table:t,isMobile:e,onRowClick:r,id:i})=>F("div",{className:a("relative w-full rounded-b border-0",{}),children:Br("table",{id:i??"table",className:"w-full overflow-x-scroll",children:[F("thead",{children:t.getHeaderGroups().map(o=>F("tr",{className:a(" rounded text-[#717171] border-b- bg-[#FCFCFC]",{}),children:o.headers.map(n=>F("th",{className:"relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",colSpan:n.colSpan,style:{width:n.getSize()},children:n.isPlaceholder?null:F("div",{className:a("flex items-center",{"cursor-pointer select-none":n.column.getCanSort()}),onClick:n.column.getToggleSortingHandler(),children:n.isPlaceholder?null:wt(n.column.columnDef.header,n.getContext())})},n.id))},o.id))}),F("tbody",{className:" pl-2.5",children:t?.getFilteredRowModel().rows.map(o=>F("tr",{className:a("first-letter border-b border-zinc-100",{"hover:bg-gray-50":!e},{"hover:bg-gray-50 hover:cursor-pointer":r}),onClick:()=>r?r(o):{},children:o.getVisibleCells().map(n=>F("td",{className:a("",{}),children:F("div",{className:a("",{"w-max p-4 pl-2.5 text-black text-sm":!0}),children:wt(n.column.columnDef.cell,n.getContext())})},n.id))},o.id))})]})});import{jsx as y,jsxs as X}from"react/jsx-runtime";var zr=({table:t,isMobile:e=!1,onRowClick:r,id:i,onRefetch:o,isRefetching:n,FilterMenu:l,ExtraNode:s,onExport:d,search:c={enabled:!1,debounceRate:700},download:m={enabled:!1,buttonId:"download_button",buttonText:"Export"},isLoading:u,pagination:p})=>{let b=()=>{try{o?.()}catch(P){console.error("Error while refetching data",P)}},v=P=>{c?.onSearch?.(P)};return X("div",{className:a("relative w-full rounded-b border-0 overflow-x-auto"),children:[(o||c?.enabled||l||s||d)&&X("div",{className:"sticky top-0 z-10 w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2",children:[y("div",{className:"flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start",children:X("div",{className:" w-full flex gap-x-3",children:[c?.enabled&&y("section",{className:"sm:w-56",children:y(Fe,{type:"text",placeholder:"Enter search here...",className:"h-9",onChange:v,debounce:c?.debounceRate})}),X("div",{className:" flex gap-2",children:[o&&y(K,{onClick:b,title:"Refetch Data",disabled:n,variant:"outlined",className:"!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",size:"sm",children:y(Wr,{className:a("w-4 h-4",{"animate-spin":n}),size:5})}),l&&y(Ce,{trigger:y("button",{title:"Filter",className:a("!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",ye({variant:"outlined",size:"sm"})),children:y(Hr,{className:"w-4 h-4",size:5})}),children:l})]})]})}),y("div",{className:"flex items-start flex-col gap-2 justify-center",children:y("section",{className:"flex flex-col-reverse sm:flex-row gap-2",children:X("div",{className:"flex gap-2",children:[s&&s,d&&y(K,{variant:"primary",onClick:d,size:"sm",children:"Export"}),m?.enabled&&y(K,{variant:"primary",leftNode:y(Or,{className:a("w-4 h-4",{"animate-spin":n}),size:5}),onClick:m?.onDownload,id:m.buttonId,size:"sm",children:m?.buttonText})]})})})]}),y("main",{className:"w-full overflow-x-auto mt-5",children:u?X("div",{className:"py-10 flex flex-col justify-center w-full items-center space-x-2",children:[y(Gr,{size:20,className:"animate-spin"}),y("p",{className:"mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse",children:"Loading..."})]}):t.getRowModel().rows.length<1?y("div",{className:"py-10 flex flex-col justify-center w-full items-center",children:y("p",{className:"text-center text-gray-600 text-sm opacity-70",children:"No data available"})}):y("div",{className:"flex flex-col gap-2",children:y(Dt,{table:t,isMobile:e,onRowClick:r,id:i})})}),!u&&p?.enabled&&t.getRowModel().rows.length>0&&y(Rt,{...p,currentPage:p?.currentPage??1,totalPages:p?.totalPages??Math.ceil((p?.totalItems??0)/Math.max(p?.itemsPerPage??1,1))??1,onPageChange:P=>p?.onPageChange?.(P)})]})};import{useEffect as Be}from"react";import{X as Kr}from"lucide-react";import{jsx as E,jsxs as Y}from"react/jsx-runtime";var _r=t=>{let{environment:e,branch:r,version:i,deployTime:o,showBanner:n,onClose:l,initDefault:s,removeFromStorage:d,syncLocalStorageToState:c}=t,m=e||process.env.NEXT_PUBLIC_NODE_ENV;return m!=="staging"&&m!=="sandbox"?(Be(()=>{console.log({environment:e,branch:r,version:i,deployTime:o})},[]),null):(Be(()=>{c()},[]),Be(()=>{let u,p=e||process.env.NEXT_PUBLIC_NODE_ENV;return(p==="staging"||p==="sandbox")&&(u=setInterval(()=>{d(),s()},5*60*1e3)),()=>{u&&clearInterval(u)}},[n,e,l]),n?Y("div",{className:"w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96",children:[E("button",{onClick:l,className:"absolute top-2 right-2",children:E(Kr,{})}),Y("div",{className:"space-y-2 text-sm",children:[Y("div",{className:"flex gap-2",children:[E("span",{className:"font-medium",children:"Environment:"}),E("span",{className:"text-blue-600 capitalize",children:e||process.env.NEXT_PUBLIC_NODE_ENV})]}),Y("div",{className:"flex gap-2",children:[E("span",{className:"font-medium",children:"Branch:"}),E("span",{className:"text-green-600 capitalize",children:r||process.env.NEXT_PUBLIC_DEPLOY_BRANCH})]}),Y("div",{className:"flex gap-2",children:[E("span",{className:"font-medium",children:"Version:"}),E("span",{className:"text-purple-600",children:i||process.env.NEXT_PUBLIC_DEPLOY_VERSION})]}),Y("div",{className:"flex gap-2",children:[E("span",{className:"font-medium",children:"Deploy Time:"}),E("span",{className:"text-orange-600",children:o||process.env.NEXT_PUBLIC_DEPLOY_TIME})]})]})]}):null)};var Lt={USD:"$",CAD:"CA$",EUR:"\u20AC",AED:"AED",AFN:"Af",ALL:"ALL",AMD:"AMD",ARS:"AR$",AUD:"AU$",AZN:"man.",BAM:"KM",BDT:"Tk",BGN:"BGN",BHD:"BD",BIF:"FBu",BND:"BN$",BOB:"Bs",BRL:"R$",BWP:"BWP",BYN:"Br",BZD:"BZ$",CDF:"CDF",CHF:"CHF",CLP:"CL$",CNY:"CN\xA5",COP:"CO$",CRC:"\u20A1",CVE:"CV$",CZK:"K\u010D",DJF:"Fdj",DKK:"Dkr",DOP:"RD$",DZD:"DA",EEK:"Ekr",EGP:"EGP",ERN:"Nfk",ETB:"Br",GBP:"\xA3",GEL:"GEL",GHS:"GH\u20B5",GNF:"FG",GTQ:"GTQ",HKD:"HK$",HNL:"HNL",HRK:"kn",HUF:"Ft",IDR:"Rp",ILS:"\u20AA",INR:"\u20B9",IQD:"IQD",IRR:"IRR",ISK:"Ikr",JMD:"J$",JOD:"JD",JPY:"\xA5",KES:"Ksh",KHR:"KHR",KMF:"CF",KRW:"\u20A9",KWD:"KD",KZT:"KZT",LBP:"L.L.",LKR:"SLRs",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"MDL",MGA:"MGA",MKD:"MKD",MMK:"MMK",MOP:"MOP$",MUR:"MURs",MXN:"MX$",MYR:"RM",MZN:"MTn",NAD:"N$",NGN:"\u20A6",NIO:"C$",NOK:"Nkr",NPR:"NPRs",NZD:"NZ$",OMR:"OMR",PAB:"B/.",PEN:"S/.",PHP:"\u20B1",PKR:"PKRs",PLN:"z\u0142",PYG:"\u20B2",QAR:"QR",RON:"RON",RSD:"din.",RUB:"RUB",RWF:"RWF",SAR:"SR",SDG:"SDG",SEK:"Skr",SGD:"S$",SOS:"Ssh",SYP:"SY\xA3",THB:"\u0E3F",TND:"DT",TOP:"T$",TRY:"TL",TTD:"TT$",TWD:"NT$",TZS:"TSh",UAH:"\u20B4",UGX:"USh",UYU:"$U",UZS:"UZS",VEF:"Bs.F.",VND:"\u20AB",XAF:"F CFA",XOF:"CFA",YER:"YR",ZAR:"R",ZMK:"ZK",ZWL:"ZWL$"},ue=class ue{static getCurrencyLocaleMap(e){return{XOF:"fr",XAF:"fr"}[e]||"en"}static koboToNaira(e){return+e/100}static nairaToKobo(e){return+e*100}static getCurrencySymbol(e){return Lt[e]||e}};Oe(ue,"formatAmountAndCurrency",(e,r,i)=>{let o=new Intl.NumberFormat(i?.locale||ue.getCurrencyLocaleMap(e),{maximumFractionDigits:3,style:"currency",currency:e,currencyDisplay:"symbol"}).format(i?.convertToMajorCurrency?ue.koboToNaira(Number(r)):Number(r)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),n=Lt[e]||e;return o.replace(e,n)});var kt=ue;import*as Ne from"dayjs";var St=class{static getDateLibrary(){return Ne()}static formatTimestampToDate(e,r){return Ne.unix(e).format(r||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(e){return Ne(e).unix()}};export{kt as AmountAction,K as Button,Sr as CopyableLabel,yr as Country,Lt as CurrencySymbolMap,St as DateAction,Fe as DebouncedInput,_r as DevBanner,Te as Dialog,B as FlagComponent,x as FormLabel,A as Input,j as Loader,Pr as OTPInput,rt as PasswordInput,bt as PhoneInput,Ce as Popover,H as PopoverContent,Z as PopoverRoot,V as PopoverTrigger,br as Select,Fr as Status,zr as Table,ot as Textarea,ye as buttonVariants,a as cn};
|
2
|
-
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
4
|
+
|
5
|
+
// src/components/label/FormLabel.tsx
|
6
|
+
import React2 from "react";
|
7
|
+
|
8
|
+
// src/components/label/index.tsx
|
9
|
+
import * as React from "react";
|
10
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
11
|
+
import { cva } from "class-variance-authority";
|
12
|
+
|
13
|
+
// src/utils/index.ts
|
14
|
+
import { clsx } from "clsx";
|
15
|
+
import { twMerge } from "tailwind-merge";
|
16
|
+
function cn(...inputs) {
|
17
|
+
return twMerge(clsx(inputs));
|
18
|
+
}
|
19
|
+
|
20
|
+
// src/components/label/index.tsx
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
22
|
+
var labelVariants = cva(
|
23
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
24
|
+
);
|
25
|
+
var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
26
|
+
LabelPrimitive.Root,
|
27
|
+
{
|
28
|
+
ref,
|
29
|
+
className: cn(labelVariants(), className),
|
30
|
+
...props
|
31
|
+
}
|
32
|
+
));
|
33
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
34
|
+
|
35
|
+
// src/components/label/FormLabel.tsx
|
36
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
37
|
+
var FormLabel = React2.forwardRef(({ className, children, showAsterisk, error, ...props }, ref) => {
|
38
|
+
return /* @__PURE__ */ jsx2(
|
39
|
+
Label,
|
40
|
+
{
|
41
|
+
ref,
|
42
|
+
className: cn(error && "text-red-500", className),
|
43
|
+
...props,
|
44
|
+
children: showAsterisk ? /* @__PURE__ */ jsxs("p", { children: [
|
45
|
+
children,
|
46
|
+
/* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
|
47
|
+
] }) : children
|
48
|
+
}
|
49
|
+
);
|
50
|
+
});
|
51
|
+
FormLabel.displayName = "FormLabel";
|
52
|
+
|
53
|
+
// src/components/loader/index.tsx
|
54
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
55
|
+
var Loader = ({
|
56
|
+
size = 16,
|
57
|
+
colour = "primary"
|
58
|
+
}) => {
|
59
|
+
return /* @__PURE__ */ jsxs2(
|
60
|
+
"svg",
|
61
|
+
{
|
62
|
+
className: "animate-spin",
|
63
|
+
width: size,
|
64
|
+
height: size,
|
65
|
+
viewBox: "0 0 20 20",
|
66
|
+
fill: "none",
|
67
|
+
children: [
|
68
|
+
/* @__PURE__ */ jsx3("circle", { cx: "10", cy: "10", r: "9.25", stroke: "transparent", strokeWidth: "1.5" }),
|
69
|
+
/* @__PURE__ */ jsx3(
|
70
|
+
"path",
|
71
|
+
{
|
72
|
+
d: "M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",
|
73
|
+
fill: colour === "primary" ? "#ffffff" : "currentColor",
|
74
|
+
className: "rounded"
|
75
|
+
}
|
76
|
+
)
|
77
|
+
]
|
78
|
+
}
|
79
|
+
);
|
80
|
+
};
|
81
|
+
|
82
|
+
// src/components/button/index.tsx
|
83
|
+
import * as React3 from "react";
|
84
|
+
import { Slot } from "@radix-ui/react-slot";
|
85
|
+
import { cva as cva2 } from "class-variance-authority";
|
86
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
87
|
+
var buttonVariants = cva2(
|
88
|
+
"overflow-hidden isolate inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",
|
89
|
+
{
|
90
|
+
variants: {
|
91
|
+
variant: {
|
92
|
+
primary: "border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",
|
93
|
+
danger: "border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",
|
94
|
+
neutral: "!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",
|
95
|
+
outlined: "border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60",
|
96
|
+
"danger-outlined": "border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60",
|
97
|
+
"light-outlined": "border-white text-white hover:opacity-80 disabled:opacity-60",
|
98
|
+
"dark-text": "border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",
|
99
|
+
light: "border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"
|
100
|
+
},
|
101
|
+
size: {
|
102
|
+
// lg: "h-15 px-8 items-center",
|
103
|
+
// sm: "h-10 px-3.5 items-center text-sm",
|
104
|
+
default: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
|
105
|
+
sm: "py-[0.375rem] px-[1rem] leading-[1rem] font-normal text-sm rounded-lg",
|
106
|
+
lg: "py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",
|
107
|
+
md: "h-12 py-1 px-5 items-center",
|
108
|
+
"icon-sm": "h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",
|
109
|
+
icon: "h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg",
|
110
|
+
"icon-lg": "h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"
|
111
|
+
}
|
112
|
+
},
|
113
|
+
defaultVariants: {
|
114
|
+
variant: "primary",
|
115
|
+
size: "default"
|
116
|
+
}
|
117
|
+
}
|
118
|
+
);
|
119
|
+
var Button = React3.forwardRef(
|
120
|
+
({
|
121
|
+
className,
|
122
|
+
variant = "primary",
|
123
|
+
size,
|
124
|
+
asChild = false,
|
125
|
+
isLoading = false,
|
126
|
+
leftNode,
|
127
|
+
rightNode,
|
128
|
+
LoaderSize,
|
129
|
+
// ref,
|
130
|
+
...props
|
131
|
+
}, ref) => {
|
132
|
+
const Component = asChild ? Slot : "button";
|
133
|
+
const { children, disabled, ...rest } = props;
|
134
|
+
const reference = React3.useRef(null);
|
135
|
+
return /* @__PURE__ */ jsx4(
|
136
|
+
Component,
|
137
|
+
{
|
138
|
+
className: cn(buttonVariants({ variant, size, className })),
|
139
|
+
ref: reference || ref,
|
140
|
+
disabled: disabled || isLoading,
|
141
|
+
...rest,
|
142
|
+
children: /* @__PURE__ */ jsx4("div", { className: "flex font-medium justify-center items-center gap-2", children: isLoading ? /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsx4("span", { className: "mx-auto", children: /* @__PURE__ */ jsx4(Loader, { size: LoaderSize, colour: "secondary" }) }) }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
143
|
+
leftNode,
|
144
|
+
children,
|
145
|
+
rightNode
|
146
|
+
] }) })
|
147
|
+
}
|
148
|
+
);
|
149
|
+
}
|
150
|
+
);
|
151
|
+
Button.displayName = "Button";
|
152
|
+
|
153
|
+
// src/components/input/index.tsx
|
154
|
+
import * as React6 from "react";
|
155
|
+
import { cva as cva3 } from "class-variance-authority";
|
156
|
+
|
157
|
+
// src/components/form/ErrorMessage.tsx
|
158
|
+
import React4 from "react";
|
159
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
160
|
+
var ErrorMessage = React4.forwardRef(({ className, children, error, ...props }, ref) => {
|
161
|
+
const body = error ?? children;
|
162
|
+
if (!body) {
|
163
|
+
return null;
|
164
|
+
}
|
165
|
+
return /* @__PURE__ */ jsx5(
|
166
|
+
"p",
|
167
|
+
{
|
168
|
+
ref,
|
169
|
+
className: cn("text-xs font-normal text-[#F04248]", className),
|
170
|
+
...props,
|
171
|
+
children: body
|
172
|
+
}
|
173
|
+
);
|
174
|
+
});
|
175
|
+
ErrorMessage.displayName = "ErrorMessage";
|
176
|
+
|
177
|
+
// src/components/form/FormDescription.tsx
|
178
|
+
import React5 from "react";
|
179
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
180
|
+
var FormDescription = React5.forwardRef(({ className, ...props }, ref) => {
|
181
|
+
return /* @__PURE__ */ jsx6(
|
182
|
+
"div",
|
183
|
+
{
|
184
|
+
ref,
|
185
|
+
className: cn("text-sm text-[#8E98A8", className),
|
186
|
+
...props
|
187
|
+
}
|
188
|
+
);
|
189
|
+
});
|
190
|
+
FormDescription.displayName = "FormDescription";
|
191
|
+
|
192
|
+
// src/components/input/index.tsx
|
193
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
194
|
+
var inputVariants = cva3(
|
195
|
+
"!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
|
196
|
+
{
|
197
|
+
variants: {
|
198
|
+
status: {
|
199
|
+
default: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
200
|
+
error: "placeholder:text-red-500 text-red-500",
|
201
|
+
loading: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
202
|
+
prefilled: "",
|
203
|
+
neutral: ""
|
204
|
+
}
|
205
|
+
},
|
206
|
+
defaultVariants: {
|
207
|
+
status: "default"
|
208
|
+
}
|
209
|
+
}
|
210
|
+
);
|
211
|
+
var BaseInnerInput = React6.forwardRef(
|
212
|
+
({ className, status, type, ...props }, ref) => {
|
213
|
+
return /* @__PURE__ */ jsx7(
|
214
|
+
"input",
|
215
|
+
{
|
216
|
+
type,
|
217
|
+
className: cn(inputVariants({ status }), className),
|
218
|
+
ref,
|
219
|
+
...props
|
220
|
+
}
|
221
|
+
);
|
222
|
+
}
|
223
|
+
);
|
224
|
+
BaseInnerInput.displayName = "BaseInnerInput";
|
225
|
+
var inputContainerVariants = cva3(
|
226
|
+
"flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
|
227
|
+
{
|
228
|
+
variants: {
|
229
|
+
status: {
|
230
|
+
default: "border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-text-primary focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
|
231
|
+
error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
|
232
|
+
loading: "",
|
233
|
+
prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
|
234
|
+
neutral: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"
|
235
|
+
}
|
236
|
+
},
|
237
|
+
defaultVariants: {
|
238
|
+
status: "default"
|
239
|
+
}
|
240
|
+
}
|
241
|
+
);
|
242
|
+
var sideVariants = cva3(
|
243
|
+
"top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
|
244
|
+
{
|
245
|
+
variants: {
|
246
|
+
side: {
|
247
|
+
left: "left-0 rounded-l-[8px] border-r",
|
248
|
+
right: "right-0 rounded-r-[8px] border-l"
|
249
|
+
},
|
250
|
+
status: {
|
251
|
+
default: "border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
|
252
|
+
error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
|
253
|
+
loading: "",
|
254
|
+
prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
|
255
|
+
neutral: "bg-transparent border-0 caret-[#DEDEDE] !px-0"
|
256
|
+
}
|
257
|
+
},
|
258
|
+
defaultVariants: {
|
259
|
+
status: "default",
|
260
|
+
side: "left"
|
261
|
+
}
|
262
|
+
}
|
263
|
+
);
|
264
|
+
var Input = React6.forwardRef(
|
265
|
+
({
|
266
|
+
className,
|
267
|
+
status = "default",
|
268
|
+
disabled,
|
269
|
+
error,
|
270
|
+
isLoading,
|
271
|
+
sideNodeClassName,
|
272
|
+
showAsterisk,
|
273
|
+
label,
|
274
|
+
description,
|
275
|
+
...props
|
276
|
+
}, ref) => {
|
277
|
+
let containerStatus = status;
|
278
|
+
if (error) containerStatus = "error";
|
279
|
+
if (isLoading) containerStatus = "loading";
|
280
|
+
if (disabled) containerStatus = "prefilled";
|
281
|
+
return /* @__PURE__ */ jsxs4("div", { className: "relative space-y-1 w-full", children: [
|
282
|
+
label && /* @__PURE__ */ jsx7(FormLabel, { showAsterisk, error, children: label }),
|
283
|
+
/* @__PURE__ */ jsxs4(
|
284
|
+
"div",
|
285
|
+
{
|
286
|
+
className: cn(
|
287
|
+
inputContainerVariants({ status: containerStatus }),
|
288
|
+
props.leftNode ? "pl-0" : "",
|
289
|
+
props.rightNode ? "pr-0" : "",
|
290
|
+
className
|
291
|
+
),
|
292
|
+
children: [
|
293
|
+
props.leftNode ? /* @__PURE__ */ jsx7(
|
294
|
+
"div",
|
295
|
+
{
|
296
|
+
className: cn(
|
297
|
+
sideVariants({
|
298
|
+
status: containerStatus,
|
299
|
+
side: "left"
|
300
|
+
}),
|
301
|
+
sideNodeClassName
|
302
|
+
),
|
303
|
+
children: props.leftNode
|
304
|
+
}
|
305
|
+
) : null,
|
306
|
+
/* @__PURE__ */ jsx7(
|
307
|
+
BaseInnerInput,
|
308
|
+
{
|
309
|
+
ref,
|
310
|
+
disabled: isLoading || disabled,
|
311
|
+
className: cn({
|
312
|
+
"!pl-3": props.leftNode && status !== "neutral",
|
313
|
+
"!pr-3": props.rightNode && status !== "neutral"
|
314
|
+
}),
|
315
|
+
...props
|
316
|
+
}
|
317
|
+
),
|
318
|
+
props.rightNode ? /* @__PURE__ */ jsx7(
|
319
|
+
"div",
|
320
|
+
{
|
321
|
+
className: cn(
|
322
|
+
sideVariants({
|
323
|
+
status: containerStatus,
|
324
|
+
side: "right"
|
325
|
+
}),
|
326
|
+
sideNodeClassName
|
327
|
+
),
|
328
|
+
children: props.rightNode
|
329
|
+
}
|
330
|
+
) : null
|
331
|
+
]
|
332
|
+
}
|
333
|
+
),
|
334
|
+
description && /* @__PURE__ */ jsx7(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
335
|
+
/* @__PURE__ */ jsx7(ErrorMessage, { error })
|
336
|
+
] });
|
337
|
+
}
|
338
|
+
);
|
339
|
+
Input.displayName = "Input";
|
340
|
+
|
341
|
+
// src/components/password-input/index.tsx
|
342
|
+
import { useMemo, useState } from "react";
|
343
|
+
|
344
|
+
// src/components/password-input/icons/Eye.tsx
|
345
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
346
|
+
var Eye = () => {
|
347
|
+
return /* @__PURE__ */ jsxs5(
|
348
|
+
"svg",
|
349
|
+
{
|
350
|
+
width: "18",
|
351
|
+
height: "14",
|
352
|
+
viewBox: "0 0 18 14",
|
353
|
+
fill: "none",
|
354
|
+
xmlns: "http://www.w3.org/2000/svg",
|
355
|
+
children: [
|
356
|
+
/* @__PURE__ */ jsx8(
|
357
|
+
"path",
|
358
|
+
{
|
359
|
+
d: "M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",
|
360
|
+
stroke: "#8E98A8",
|
361
|
+
strokeWidth: "2",
|
362
|
+
strokeLinecap: "round",
|
363
|
+
strokeLinejoin: "round"
|
364
|
+
}
|
365
|
+
),
|
366
|
+
/* @__PURE__ */ jsx8(
|
367
|
+
"path",
|
368
|
+
{
|
369
|
+
d: "M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",
|
370
|
+
stroke: "#8E98A8",
|
371
|
+
strokeWidth: "2",
|
372
|
+
strokeLinecap: "round",
|
373
|
+
strokeLinejoin: "round"
|
374
|
+
}
|
375
|
+
)
|
376
|
+
]
|
377
|
+
}
|
378
|
+
);
|
379
|
+
};
|
380
|
+
|
381
|
+
// src/components/password-input/icons/EyeOff.tsx
|
382
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
383
|
+
var EyeOff = () => {
|
384
|
+
return /* @__PURE__ */ jsxs6(
|
385
|
+
"svg",
|
386
|
+
{
|
387
|
+
width: "18",
|
388
|
+
height: "18",
|
389
|
+
viewBox: "0 0 18 18",
|
390
|
+
fill: "none",
|
391
|
+
xmlns: "http://www.w3.org/2000/svg",
|
392
|
+
children: [
|
393
|
+
/* @__PURE__ */ jsx9(
|
394
|
+
"path",
|
395
|
+
{
|
396
|
+
d: "M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",
|
397
|
+
stroke: "#8E98A8",
|
398
|
+
strokeWidth: "1.5",
|
399
|
+
strokeLinecap: "round",
|
400
|
+
strokeLinejoin: "round"
|
401
|
+
}
|
402
|
+
),
|
403
|
+
/* @__PURE__ */ jsx9(
|
404
|
+
"path",
|
405
|
+
{
|
406
|
+
d: "M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",
|
407
|
+
stroke: "#8E98A8",
|
408
|
+
strokeWidth: "1.5",
|
409
|
+
strokeLinecap: "round",
|
410
|
+
strokeLinejoin: "round"
|
411
|
+
}
|
412
|
+
)
|
413
|
+
]
|
414
|
+
}
|
415
|
+
);
|
416
|
+
};
|
417
|
+
|
418
|
+
// src/components/password-input/icons/Check.tsx
|
419
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
420
|
+
var Check = () => {
|
421
|
+
return /* @__PURE__ */ jsx10(
|
422
|
+
"svg",
|
423
|
+
{
|
424
|
+
width: "12",
|
425
|
+
height: "12",
|
426
|
+
viewBox: "0 0 12 12",
|
427
|
+
fill: "none",
|
428
|
+
xmlns: "http://www.w3.org/2000/svg",
|
429
|
+
children: /* @__PURE__ */ jsx10(
|
430
|
+
"path",
|
431
|
+
{
|
432
|
+
d: "M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",
|
433
|
+
fill: "currentColor"
|
434
|
+
}
|
435
|
+
)
|
436
|
+
}
|
437
|
+
);
|
438
|
+
};
|
439
|
+
|
440
|
+
// src/components/password-input/icons/Fail.tsx
|
441
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
442
|
+
var Fail = () => {
|
443
|
+
return /* @__PURE__ */ jsx11(
|
444
|
+
"svg",
|
445
|
+
{
|
446
|
+
width: "12",
|
447
|
+
height: "12",
|
448
|
+
viewBox: "0 0 12 12",
|
449
|
+
fill: "none",
|
450
|
+
xmlns: "http://www.w3.org/2000/svg",
|
451
|
+
children: /* @__PURE__ */ jsx11(
|
452
|
+
"path",
|
453
|
+
{
|
454
|
+
d: "M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",
|
455
|
+
stroke: "currentColor",
|
456
|
+
strokeWidth: "1.5",
|
457
|
+
strokeLinecap: "round",
|
458
|
+
strokeLinejoin: "round"
|
459
|
+
}
|
460
|
+
)
|
461
|
+
}
|
462
|
+
);
|
463
|
+
};
|
464
|
+
|
465
|
+
// src/components/password-input/index.tsx
|
466
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
467
|
+
var validationOptions = [
|
468
|
+
{
|
469
|
+
label: "Uppercase",
|
470
|
+
key: "uppercase",
|
471
|
+
RegExp: /[A-Z]/,
|
472
|
+
validated: false
|
473
|
+
},
|
474
|
+
{
|
475
|
+
label: "Lowercase",
|
476
|
+
key: "lowercase",
|
477
|
+
RegExp: /[a-z]/,
|
478
|
+
validated: false
|
479
|
+
},
|
480
|
+
{
|
481
|
+
label: "Number",
|
482
|
+
key: "number",
|
483
|
+
RegExp: /\d/,
|
484
|
+
validated: false
|
485
|
+
},
|
486
|
+
{
|
487
|
+
label: "8 Characters",
|
488
|
+
key: "eight-chars",
|
489
|
+
RegExp: /.{8}/,
|
490
|
+
validated: false
|
491
|
+
}
|
492
|
+
];
|
493
|
+
var PasswordInput = ({
|
494
|
+
onValidate,
|
495
|
+
onChange,
|
496
|
+
disableValidation,
|
497
|
+
...props
|
498
|
+
}) => {
|
499
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
500
|
+
const [validatedValues, setValidatedValues] = useState(validationOptions);
|
501
|
+
const validatePassword = (value) => {
|
502
|
+
return validationOptions.map((option) => ({
|
503
|
+
...option,
|
504
|
+
validated: option.RegExp.test(value)
|
505
|
+
}));
|
506
|
+
};
|
507
|
+
const checkPasswordStrength = (value) => {
|
508
|
+
const validatedOptions = validatePassword(value);
|
509
|
+
const allValidated = validatedOptions.every((option) => option.validated);
|
510
|
+
setValidatedValues(validatedOptions);
|
511
|
+
return allValidated;
|
512
|
+
};
|
513
|
+
const handlePaswordInputChange = (e) => {
|
514
|
+
if (onChange) onChange(e);
|
515
|
+
if (disableValidation) return;
|
516
|
+
const value = e?.target?.value;
|
517
|
+
const validated = checkPasswordStrength(value);
|
518
|
+
if (onValidate) onValidate(validated, value);
|
519
|
+
};
|
520
|
+
const ValidateComp = useMemo(() => {
|
521
|
+
return /* @__PURE__ */ jsx12("div", { className: "flex items-center gap-2", children: validatedValues?.map((value) => /* @__PURE__ */ jsxs7(
|
522
|
+
"div",
|
523
|
+
{
|
524
|
+
className: cn("text-xs flex items-center gap-0.5", {
|
525
|
+
"text-[#62C554]": value?.validated,
|
526
|
+
"text-[#8E98A8]": !value?.validated
|
527
|
+
}),
|
528
|
+
children: [
|
529
|
+
/* @__PURE__ */ jsx12("span", { className: "", children: value?.validated ? /* @__PURE__ */ jsx12(Check, {}) : /* @__PURE__ */ jsx12(Fail, {}) }),
|
530
|
+
/* @__PURE__ */ jsx12("span", { className: "", children: value?.label })
|
531
|
+
]
|
532
|
+
},
|
533
|
+
value?.key
|
534
|
+
)) });
|
535
|
+
}, [validatedValues]);
|
536
|
+
return /* @__PURE__ */ jsx12(
|
537
|
+
Input,
|
538
|
+
{
|
539
|
+
sideNodeClassName: "!border-l-0",
|
540
|
+
rightNode: passwordVisible ? /* @__PURE__ */ jsx12(
|
541
|
+
"button",
|
542
|
+
{
|
543
|
+
type: "button",
|
544
|
+
onClick: () => setPasswordVisible((val) => !val),
|
545
|
+
children: /* @__PURE__ */ jsx12(Eye, {})
|
546
|
+
}
|
547
|
+
) : /* @__PURE__ */ jsx12(
|
548
|
+
"button",
|
549
|
+
{
|
550
|
+
type: "button",
|
551
|
+
onClick: () => setPasswordVisible((val) => !val),
|
552
|
+
children: /* @__PURE__ */ jsx12(EyeOff, {})
|
553
|
+
}
|
554
|
+
),
|
555
|
+
type: passwordVisible ? "text" : "password",
|
556
|
+
onChange: handlePaswordInputChange,
|
557
|
+
description: !disableValidation && ValidateComp,
|
558
|
+
...props
|
559
|
+
}
|
560
|
+
);
|
561
|
+
};
|
562
|
+
PasswordInput.displayName = "PasswordInput";
|
563
|
+
|
564
|
+
// src/components/textarea/index.tsx
|
565
|
+
import { cva as cva4 } from "class-variance-authority";
|
566
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
567
|
+
var textareaContainerVariants = cva4(
|
568
|
+
"flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
|
569
|
+
{
|
570
|
+
variants: {
|
571
|
+
status: {
|
572
|
+
default: "border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",
|
573
|
+
error: "placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",
|
574
|
+
loading: "placeholder:text-[#C4C4C4]",
|
575
|
+
prefilled: "resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
|
576
|
+
neutral: ""
|
577
|
+
}
|
578
|
+
},
|
579
|
+
defaultVariants: {
|
580
|
+
status: "default"
|
581
|
+
}
|
582
|
+
}
|
583
|
+
);
|
584
|
+
var Textarea = ({
|
585
|
+
className,
|
586
|
+
status = "default",
|
587
|
+
disabled,
|
588
|
+
error,
|
589
|
+
isLoading,
|
590
|
+
showAsterisk,
|
591
|
+
label,
|
592
|
+
description,
|
593
|
+
...props
|
594
|
+
}) => {
|
595
|
+
let containerStatus = status;
|
596
|
+
if (error) containerStatus = "error";
|
597
|
+
if (isLoading) containerStatus = "loading";
|
598
|
+
if (disabled) containerStatus = "prefilled";
|
599
|
+
return /* @__PURE__ */ jsxs8("div", { className: "relative space-y-1", children: [
|
600
|
+
/* @__PURE__ */ jsx13(FormLabel, { showAsterisk, error, children: label }),
|
601
|
+
/* @__PURE__ */ jsx13(
|
602
|
+
"textarea",
|
603
|
+
{
|
604
|
+
className: cn(
|
605
|
+
"min-h-[80px]",
|
606
|
+
inputContainerVariants({ status: containerStatus }),
|
607
|
+
className
|
608
|
+
),
|
609
|
+
disabled: isLoading || disabled,
|
610
|
+
...props
|
611
|
+
}
|
612
|
+
),
|
613
|
+
/* @__PURE__ */ jsx13(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
614
|
+
/* @__PURE__ */ jsx13(ErrorMessage, { error })
|
615
|
+
] });
|
616
|
+
};
|
617
|
+
Textarea.displayName = "Textarea";
|
618
|
+
|
619
|
+
// src/components/searcheable/index.tsx
|
620
|
+
import * as React11 from "react";
|
621
|
+
|
622
|
+
// src/components/command/index.tsx
|
623
|
+
import * as React8 from "react";
|
624
|
+
import { Command as CommandPrimitive } from "cmdk";
|
625
|
+
import { Search } from "lucide-react";
|
626
|
+
|
627
|
+
// src/components/dialog/index.tsx
|
628
|
+
import * as React7 from "react";
|
629
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
630
|
+
|
631
|
+
// src/components/dialog/icon/CloseIcon.tsx
|
632
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
633
|
+
var CloseIcon = () => {
|
634
|
+
return /* @__PURE__ */ jsxs9(
|
635
|
+
"svg",
|
636
|
+
{
|
637
|
+
xmlns: "http://www.w3.org/2000/svg",
|
638
|
+
width: "24",
|
639
|
+
height: "24",
|
640
|
+
viewBox: "0 0 24 24",
|
641
|
+
fill: "none",
|
642
|
+
stroke: "currentColor",
|
643
|
+
strokeWidth: "2",
|
644
|
+
strokeLinecap: "round",
|
645
|
+
strokeLinejoin: "round",
|
646
|
+
className: "lucide lucide-x",
|
647
|
+
children: [
|
648
|
+
/* @__PURE__ */ jsx14("path", { d: "M18 6 6 18" }),
|
649
|
+
/* @__PURE__ */ jsx14("path", { d: "m6 6 12 12" })
|
650
|
+
]
|
651
|
+
}
|
652
|
+
);
|
653
|
+
};
|
654
|
+
|
655
|
+
// src/components/dialog/index.tsx
|
656
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
657
|
+
var DialogRoot = DialogPrimitive.Root;
|
658
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
659
|
+
var DialogPortal = DialogPrimitive.Portal;
|
660
|
+
var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
661
|
+
DialogPrimitive.Overlay,
|
662
|
+
{
|
663
|
+
ref,
|
664
|
+
className: cn(
|
665
|
+
"fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
666
|
+
className
|
667
|
+
),
|
668
|
+
...props
|
669
|
+
}
|
670
|
+
));
|
671
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
672
|
+
var DialogContent = React7.forwardRef(({ className, hideCloseButton, children, ...props }, ref) => /* @__PURE__ */ jsxs10(DialogPortal, { children: [
|
673
|
+
/* @__PURE__ */ jsx15(DialogOverlay, {}),
|
674
|
+
/* @__PURE__ */ jsxs10(
|
675
|
+
DialogPrimitive.Content,
|
676
|
+
{
|
677
|
+
ref,
|
678
|
+
className: cn(
|
679
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
|
680
|
+
className
|
681
|
+
),
|
682
|
+
...props,
|
683
|
+
children: [
|
684
|
+
children,
|
685
|
+
!hideCloseButton && /* @__PURE__ */ jsxs10(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
686
|
+
/* @__PURE__ */ jsx15(CloseIcon, {}),
|
687
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: "Close" })
|
688
|
+
] })
|
689
|
+
]
|
690
|
+
}
|
691
|
+
)
|
692
|
+
] }));
|
693
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
694
|
+
var DialogHeader = ({
|
695
|
+
className,
|
696
|
+
...props
|
697
|
+
}) => /* @__PURE__ */ jsx15(
|
698
|
+
"div",
|
699
|
+
{
|
700
|
+
className: cn("flex flex-col space-y-1.5 text-left", className),
|
701
|
+
...props
|
702
|
+
}
|
703
|
+
);
|
704
|
+
DialogHeader.displayName = "DialogHeader";
|
705
|
+
var DialogFooter = ({
|
706
|
+
className,
|
707
|
+
...props
|
708
|
+
}) => /* @__PURE__ */ jsx15(
|
709
|
+
"div",
|
710
|
+
{
|
711
|
+
className: cn("flex flex-row justify-end sm:space-x-2", className),
|
712
|
+
...props
|
713
|
+
}
|
714
|
+
);
|
715
|
+
DialogFooter.displayName = "DialogFooter";
|
716
|
+
var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
717
|
+
DialogPrimitive.Title,
|
718
|
+
{
|
719
|
+
ref,
|
720
|
+
className: cn(
|
721
|
+
"text-xl font-semibold leading-none tracking-tight",
|
722
|
+
className
|
723
|
+
),
|
724
|
+
...props
|
725
|
+
}
|
726
|
+
));
|
727
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
728
|
+
var DialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
729
|
+
DialogPrimitive.Description,
|
730
|
+
{
|
731
|
+
ref,
|
732
|
+
className: cn("text-sm text-gray-500", className),
|
733
|
+
...props
|
734
|
+
}
|
735
|
+
));
|
736
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
737
|
+
var Dialog2 = ({
|
738
|
+
trigger = void 0,
|
739
|
+
children,
|
740
|
+
open,
|
741
|
+
onOpenChange,
|
742
|
+
hideCloseButton,
|
743
|
+
footer,
|
744
|
+
title,
|
745
|
+
description,
|
746
|
+
contentClassName,
|
747
|
+
headerClassName,
|
748
|
+
titleClassName,
|
749
|
+
descriptionClassName,
|
750
|
+
footerClassName,
|
751
|
+
asChild = true,
|
752
|
+
onOpenAutoFocus,
|
753
|
+
onCloseAutoFocus,
|
754
|
+
onEscapeKeyDown,
|
755
|
+
onInteractOutside,
|
756
|
+
onPointerDownOutside,
|
757
|
+
...props
|
758
|
+
}) => {
|
759
|
+
return /* @__PURE__ */ jsxs10(DialogRoot, { ...props, open, onOpenChange, children: [
|
760
|
+
/* @__PURE__ */ jsx15(DialogTrigger, { asChild, children: trigger }),
|
761
|
+
/* @__PURE__ */ jsx15(DialogPortal, { children: /* @__PURE__ */ jsxs10(
|
762
|
+
DialogContent,
|
763
|
+
{
|
764
|
+
className: contentClassName,
|
765
|
+
hideCloseButton,
|
766
|
+
onOpenAutoFocus,
|
767
|
+
onCloseAutoFocus,
|
768
|
+
onEscapeKeyDown,
|
769
|
+
onPointerDownOutside,
|
770
|
+
onInteractOutside,
|
771
|
+
children: [
|
772
|
+
title || description ? /* @__PURE__ */ jsxs10(DialogHeader, { className: headerClassName, children: [
|
773
|
+
title && /* @__PURE__ */ jsx15(DialogTitle, { className: titleClassName, children: title }),
|
774
|
+
description && /* @__PURE__ */ jsx15(DialogDescription, { className: descriptionClassName, children: description })
|
775
|
+
] }) : /* @__PURE__ */ jsx15(Fragment2, {}),
|
776
|
+
children,
|
777
|
+
footer && /* @__PURE__ */ jsx15(DialogFooter, { className: footerClassName, children: footer })
|
778
|
+
]
|
779
|
+
}
|
780
|
+
) })
|
781
|
+
] });
|
782
|
+
};
|
783
|
+
Dialog2.displayName = DialogPrimitive.Dialog.displayName;
|
784
|
+
|
785
|
+
// src/components/command/index.tsx
|
786
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
787
|
+
var Command = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
788
|
+
CommandPrimitive,
|
789
|
+
{
|
790
|
+
ref,
|
791
|
+
className: cn(
|
792
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
793
|
+
className
|
794
|
+
),
|
795
|
+
...props
|
796
|
+
}
|
797
|
+
));
|
798
|
+
Command.displayName = CommandPrimitive.displayName;
|
799
|
+
var CommandInput = React8.forwardRef(({ className, CommandInputContainerClassName, loading, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
800
|
+
"div",
|
801
|
+
{
|
802
|
+
className: cn(
|
803
|
+
"flex items-center border-0 px-3 gap-2",
|
804
|
+
CommandInputContainerClassName
|
805
|
+
),
|
806
|
+
"cmdk-input-wrapper": "",
|
807
|
+
children: [
|
808
|
+
loading ? /* @__PURE__ */ jsx16(Loader, { size: 16, colour: "secondary" }) : /* @__PURE__ */ jsx16(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
809
|
+
/* @__PURE__ */ jsx16(
|
810
|
+
CommandPrimitive.Input,
|
811
|
+
{
|
812
|
+
ref,
|
813
|
+
className: cn(
|
814
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
815
|
+
className
|
816
|
+
),
|
817
|
+
disabled: loading,
|
818
|
+
...props
|
819
|
+
}
|
820
|
+
)
|
821
|
+
]
|
822
|
+
}
|
823
|
+
));
|
824
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
825
|
+
var CommandList = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
826
|
+
CommandPrimitive.List,
|
827
|
+
{
|
828
|
+
ref,
|
829
|
+
className: cn("overflow-y-auto overflow-x-hidden", className),
|
830
|
+
...props
|
831
|
+
}
|
832
|
+
));
|
833
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
834
|
+
var CommandEmpty = React8.forwardRef((props, ref) => /* @__PURE__ */ jsx16(
|
835
|
+
CommandPrimitive.Empty,
|
836
|
+
{
|
837
|
+
ref,
|
838
|
+
className: "py-6 text-center text-sm",
|
839
|
+
...props
|
840
|
+
}
|
841
|
+
));
|
842
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
843
|
+
var CommandGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
844
|
+
CommandPrimitive.Group,
|
845
|
+
{
|
846
|
+
ref,
|
847
|
+
className: cn(
|
848
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
849
|
+
className
|
850
|
+
),
|
851
|
+
...props
|
852
|
+
}
|
853
|
+
));
|
854
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
855
|
+
var CommandSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
856
|
+
CommandPrimitive.Separator,
|
857
|
+
{
|
858
|
+
ref,
|
859
|
+
className: cn("-mx-1 h-px bg-border", className),
|
860
|
+
...props
|
861
|
+
}
|
862
|
+
));
|
863
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
864
|
+
var CommandItem = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
865
|
+
CommandPrimitive.Item,
|
866
|
+
{
|
867
|
+
ref,
|
868
|
+
className: cn(
|
869
|
+
"relative text=[#222222] flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
870
|
+
className
|
871
|
+
),
|
872
|
+
...props
|
873
|
+
}
|
874
|
+
));
|
875
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
876
|
+
var CommandShortcut = ({
|
877
|
+
className,
|
878
|
+
...props
|
879
|
+
}) => {
|
880
|
+
return /* @__PURE__ */ jsx16(
|
881
|
+
"span",
|
882
|
+
{
|
883
|
+
className: cn(
|
884
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
885
|
+
className
|
886
|
+
),
|
887
|
+
...props
|
888
|
+
}
|
889
|
+
);
|
890
|
+
};
|
891
|
+
CommandShortcut.displayName = "CommandShortcut";
|
892
|
+
|
893
|
+
// src/components/popover/index.tsx
|
894
|
+
import * as React9 from "react";
|
895
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
896
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
897
|
+
var PopoverRoot = PopoverPrimitive.Root;
|
898
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
899
|
+
var PopoverContent = React9.forwardRef(
|
900
|
+
({ className, align = "center", sideOffset = 4, portal = true, ...props }, ref) => portal ? /* @__PURE__ */ jsx17(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx17(
|
901
|
+
PopoverPrimitive.Content,
|
902
|
+
{
|
903
|
+
ref,
|
904
|
+
align,
|
905
|
+
sideOffset,
|
906
|
+
className: cn(
|
907
|
+
"pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
908
|
+
className
|
909
|
+
),
|
910
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
911
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
912
|
+
...props
|
913
|
+
}
|
914
|
+
) }) : /* @__PURE__ */ jsx17(
|
915
|
+
PopoverPrimitive.Content,
|
916
|
+
{
|
917
|
+
ref,
|
918
|
+
align,
|
919
|
+
sideOffset,
|
920
|
+
className: cn(
|
921
|
+
"pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
922
|
+
className
|
923
|
+
),
|
924
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
925
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
926
|
+
...props
|
927
|
+
}
|
928
|
+
)
|
929
|
+
);
|
930
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
931
|
+
var Popover = ({
|
932
|
+
trigger,
|
933
|
+
children,
|
934
|
+
open,
|
935
|
+
onOpenChange,
|
936
|
+
contentClassName,
|
937
|
+
asChild = true,
|
938
|
+
align,
|
939
|
+
side,
|
940
|
+
alignOffset,
|
941
|
+
triggerClassName,
|
942
|
+
sideOffset,
|
943
|
+
onOpenAutoFocus,
|
944
|
+
onCloseAutoFocus,
|
945
|
+
portal = true,
|
946
|
+
...props
|
947
|
+
}) => {
|
948
|
+
return /* @__PURE__ */ jsxs12(PopoverRoot, { ...props, open, onOpenChange, children: [
|
949
|
+
/* @__PURE__ */ jsx17(PopoverTrigger, { asChild, className: triggerClassName, children: trigger }),
|
950
|
+
/* @__PURE__ */ jsx17(
|
951
|
+
PopoverContent,
|
952
|
+
{
|
953
|
+
alignOffset,
|
954
|
+
sideOffset,
|
955
|
+
side,
|
956
|
+
align,
|
957
|
+
className: contentClassName,
|
958
|
+
onOpenAutoFocus,
|
959
|
+
onCloseAutoFocus,
|
960
|
+
portal,
|
961
|
+
children
|
962
|
+
}
|
963
|
+
)
|
964
|
+
] });
|
965
|
+
};
|
966
|
+
Popover.displayName = PopoverPrimitive.Root.displayName;
|
967
|
+
|
968
|
+
// src/components/scroll-area/index.tsx
|
969
|
+
import * as React10 from "react";
|
970
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
971
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
972
|
+
var ScrollArea = React10.forwardRef(({ className, viewPortClassName, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
|
973
|
+
ScrollAreaPrimitive.Root,
|
974
|
+
{
|
975
|
+
ref,
|
976
|
+
className: cn("relative overflow-hidden", className),
|
977
|
+
...props,
|
978
|
+
children: [
|
979
|
+
/* @__PURE__ */ jsx18(
|
980
|
+
ScrollAreaPrimitive.Viewport,
|
981
|
+
{
|
982
|
+
className: cn("h-full w-full rounded-[inherit]", viewPortClassName),
|
983
|
+
children
|
984
|
+
}
|
985
|
+
),
|
986
|
+
/* @__PURE__ */ jsx18(ScrollBar, {}),
|
987
|
+
/* @__PURE__ */ jsx18(ScrollAreaPrimitive.Corner, {})
|
988
|
+
]
|
989
|
+
}
|
990
|
+
));
|
991
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
992
|
+
var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx18(
|
993
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
994
|
+
{
|
995
|
+
ref,
|
996
|
+
orientation,
|
997
|
+
className: cn(
|
998
|
+
"flex touch-none select-none transition-colors",
|
999
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
1000
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
1001
|
+
className
|
1002
|
+
),
|
1003
|
+
...props,
|
1004
|
+
children: /* @__PURE__ */ jsx18(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]" })
|
1005
|
+
}
|
1006
|
+
));
|
1007
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
1008
|
+
|
1009
|
+
// src/components/searcheable/index.tsx
|
1010
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
1011
|
+
var SearchableTrigger = ({
|
1012
|
+
className,
|
1013
|
+
value,
|
1014
|
+
placeholder = "",
|
1015
|
+
status,
|
1016
|
+
disabled
|
1017
|
+
}) => {
|
1018
|
+
return /* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs14(
|
1019
|
+
"button",
|
1020
|
+
{
|
1021
|
+
disabled,
|
1022
|
+
className: cn(
|
1023
|
+
inputContainerVariants({ status }),
|
1024
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",
|
1025
|
+
value ? "" : "text-[#79818C]",
|
1026
|
+
className
|
1027
|
+
),
|
1028
|
+
children: [
|
1029
|
+
value ?? placeholder ?? "Select options...",
|
1030
|
+
/* @__PURE__ */ jsx19(
|
1031
|
+
"svg",
|
1032
|
+
{
|
1033
|
+
width: "20",
|
1034
|
+
height: "20",
|
1035
|
+
viewBox: "0 0 20 20",
|
1036
|
+
fill: "none",
|
1037
|
+
className: " data-[state=open]:goup-rotate-180",
|
1038
|
+
children: /* @__PURE__ */ jsx19(
|
1039
|
+
"path",
|
1040
|
+
{
|
1041
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1042
|
+
stroke: "currentColor",
|
1043
|
+
strokeWidth: "1.5",
|
1044
|
+
strokeMiterlimit: "10",
|
1045
|
+
strokeLinecap: "round",
|
1046
|
+
strokeLinejoin: "round"
|
1047
|
+
}
|
1048
|
+
)
|
1049
|
+
}
|
1050
|
+
)
|
1051
|
+
]
|
1052
|
+
}
|
1053
|
+
) });
|
1054
|
+
};
|
1055
|
+
var Searchable = ({
|
1056
|
+
options = [],
|
1057
|
+
value,
|
1058
|
+
onChange,
|
1059
|
+
containerClassName,
|
1060
|
+
placeholder,
|
1061
|
+
disabled,
|
1062
|
+
loading,
|
1063
|
+
optionComponent,
|
1064
|
+
children,
|
1065
|
+
modal = false,
|
1066
|
+
hideSearch,
|
1067
|
+
className,
|
1068
|
+
inputValue,
|
1069
|
+
onValueChange,
|
1070
|
+
onInputValueChange
|
1071
|
+
}) => {
|
1072
|
+
const [open, setOpen] = React11.useState(false);
|
1073
|
+
const triggerRef = React11.useRef(null);
|
1074
|
+
const [width, setWidth] = React11.useState(void 0);
|
1075
|
+
React11.useLayoutEffect(() => {
|
1076
|
+
if (triggerRef.current) {
|
1077
|
+
setWidth(triggerRef.current.clientWidth);
|
1078
|
+
}
|
1079
|
+
}, [triggerRef.current]);
|
1080
|
+
return /* @__PURE__ */ jsxs14(PopoverRoot, { modal, open, onOpenChange: setOpen, children: [
|
1081
|
+
/* @__PURE__ */ jsx19("div", { className: cn("w-full", className), ref: triggerRef, children }),
|
1082
|
+
/* @__PURE__ */ jsx19(
|
1083
|
+
PopoverContent,
|
1084
|
+
{
|
1085
|
+
portal: !modal,
|
1086
|
+
className: "p-0 min-w-[200px]",
|
1087
|
+
style: { width },
|
1088
|
+
children: /* @__PURE__ */ jsxs14(
|
1089
|
+
Command,
|
1090
|
+
{
|
1091
|
+
className: cn("relative max-h-[270px]", {
|
1092
|
+
"mt-2": !hideSearch
|
1093
|
+
}),
|
1094
|
+
children: [
|
1095
|
+
!hideSearch && /* @__PURE__ */ jsx19(
|
1096
|
+
CommandInput,
|
1097
|
+
{
|
1098
|
+
loading,
|
1099
|
+
placeholder: placeholder ?? "Search options...",
|
1100
|
+
onValueChange: onInputValueChange,
|
1101
|
+
value: inputValue,
|
1102
|
+
CommandInputContainerClassName: "mx-2 border rounded-md border-[#DEDEDE]"
|
1103
|
+
}
|
1104
|
+
),
|
1105
|
+
/* @__PURE__ */ jsx19(
|
1106
|
+
ScrollArea,
|
1107
|
+
{
|
1108
|
+
viewPortClassName: "max-h-[225px]",
|
1109
|
+
className: cn(
|
1110
|
+
"w-full px-0 h-full overflow-y-auto",
|
1111
|
+
containerClassName
|
1112
|
+
),
|
1113
|
+
children: /* @__PURE__ */ jsxs14(CommandList, { children: [
|
1114
|
+
!hideSearch && /* @__PURE__ */ jsx19(CommandEmpty, { children: "No result found." }),
|
1115
|
+
/* @__PURE__ */ jsx19(CommandGroup, { className: "w-full", children: options?.map((option) => /* @__PURE__ */ jsx19(
|
1116
|
+
CommandItem,
|
1117
|
+
{
|
1118
|
+
defaultValue: value?.label,
|
1119
|
+
value: option.label,
|
1120
|
+
disabled,
|
1121
|
+
onSelect: () => {
|
1122
|
+
onChange(option);
|
1123
|
+
setOpen(false);
|
1124
|
+
onValueChange?.(option?.value);
|
1125
|
+
},
|
1126
|
+
children: !optionComponent ? option.label : optionComponent(option)
|
1127
|
+
},
|
1128
|
+
option.value
|
1129
|
+
)) })
|
1130
|
+
] })
|
1131
|
+
}
|
1132
|
+
)
|
1133
|
+
]
|
1134
|
+
}
|
1135
|
+
)
|
1136
|
+
}
|
1137
|
+
)
|
1138
|
+
] });
|
1139
|
+
};
|
1140
|
+
|
1141
|
+
// src/components/country/data.ts
|
1142
|
+
var countryData = [
|
1143
|
+
{
|
1144
|
+
countryCode: "GLOBAL",
|
1145
|
+
countryName: "Global",
|
1146
|
+
currency: "Dollars",
|
1147
|
+
currencyCode: "USD",
|
1148
|
+
internetCountryCode: "GLOBAL"
|
1149
|
+
},
|
1150
|
+
{
|
1151
|
+
countryName: "Benin",
|
1152
|
+
countryCode: "+229",
|
1153
|
+
currency: "West African CFA franc",
|
1154
|
+
currencyCode: "XOF",
|
1155
|
+
currencyIcon: "Fr",
|
1156
|
+
internetCountryCode: "BJ"
|
1157
|
+
},
|
1158
|
+
{
|
1159
|
+
countryName: "Burkina Faso",
|
1160
|
+
countryCode: "+226",
|
1161
|
+
currency: "West African CFA franc",
|
1162
|
+
currencyCode: "XOF",
|
1163
|
+
currencyIcon: "Fr",
|
1164
|
+
internetCountryCode: "BF"
|
1165
|
+
},
|
1166
|
+
{
|
1167
|
+
countryName: "Cameroon",
|
1168
|
+
countryCode: "+237",
|
1169
|
+
currency: "Central African CFA franc",
|
1170
|
+
currencyCode: "XAF",
|
1171
|
+
currencyIcon: "Fr",
|
1172
|
+
internetCountryCode: "CM"
|
1173
|
+
},
|
1174
|
+
{
|
1175
|
+
countryName: "Chad",
|
1176
|
+
countryCode: "+235",
|
1177
|
+
currency: "Central African CFA franc",
|
1178
|
+
currencyCode: "XAF",
|
1179
|
+
currencyIcon: "Fr",
|
1180
|
+
internetCountryCode: "TD"
|
1181
|
+
},
|
1182
|
+
{
|
1183
|
+
countryName: "DR Congo",
|
1184
|
+
countryCode: "+243",
|
1185
|
+
currency: "Congolese franc",
|
1186
|
+
currencyCode: "CDF",
|
1187
|
+
currencyIcon: "FC",
|
1188
|
+
internetCountryCode: "CD"
|
1189
|
+
},
|
1190
|
+
{
|
1191
|
+
countryName: "Eswatini",
|
1192
|
+
countryCode: "+268",
|
1193
|
+
currency: "Swazi lilangeni",
|
1194
|
+
currencyCode: "SZL",
|
1195
|
+
currencyIcon: "L",
|
1196
|
+
internetCountryCode: "SZ"
|
1197
|
+
},
|
1198
|
+
{
|
1199
|
+
countryName: "Gabon",
|
1200
|
+
countryCode: "+241",
|
1201
|
+
currency: "Central African CFA franc",
|
1202
|
+
currencyCode: "XAF",
|
1203
|
+
currencyIcon: "Fr",
|
1204
|
+
internetCountryCode: "GA"
|
1205
|
+
},
|
1206
|
+
{
|
1207
|
+
countryName: "Ghana",
|
1208
|
+
countryCode: "+233",
|
1209
|
+
currency: "Ghanaian cedi",
|
1210
|
+
currencyCode: "GHS",
|
1211
|
+
currencyIcon: "\u20B5",
|
1212
|
+
internetCountryCode: "GH"
|
1213
|
+
},
|
1214
|
+
{
|
1215
|
+
countryName: "Guinea",
|
1216
|
+
countryCode: "+224",
|
1217
|
+
currency: "Guinean franc",
|
1218
|
+
currencyCode: "GNF",
|
1219
|
+
currencyIcon: "Fr",
|
1220
|
+
internetCountryCode: "GN"
|
1221
|
+
},
|
1222
|
+
{
|
1223
|
+
countryName: "Ivory Coast",
|
1224
|
+
countryCode: "+225",
|
1225
|
+
currency: "West African CFA franc",
|
1226
|
+
currencyCode: "XOF",
|
1227
|
+
currencyIcon: "Fr",
|
1228
|
+
internetCountryCode: "CI"
|
1229
|
+
},
|
1230
|
+
{
|
1231
|
+
countryName: "Kenya",
|
1232
|
+
countryCode: "+254",
|
1233
|
+
currency: "Kenyan shilling",
|
1234
|
+
currencyCode: "KES",
|
1235
|
+
currencyIcon: "Sh",
|
1236
|
+
internetCountryCode: "KE"
|
1237
|
+
},
|
1238
|
+
{
|
1239
|
+
countryName: "Lesotho",
|
1240
|
+
countryCode: "+266",
|
1241
|
+
currency: "Lesotho loti",
|
1242
|
+
currencyCode: "LSL",
|
1243
|
+
currencyIcon: "L",
|
1244
|
+
internetCountryCode: "LS"
|
1245
|
+
},
|
1246
|
+
{
|
1247
|
+
countryName: "Liberia",
|
1248
|
+
countryCode: "+231",
|
1249
|
+
currency: "Liberian dollar",
|
1250
|
+
currencyCode: "LRD",
|
1251
|
+
currencyIcon: "$",
|
1252
|
+
internetCountryCode: "LR"
|
1253
|
+
},
|
1254
|
+
{
|
1255
|
+
countryName: "Madagascar",
|
1256
|
+
countryCode: "+261",
|
1257
|
+
currency: "Malagasy ariary",
|
1258
|
+
currencyCode: "MGA",
|
1259
|
+
currencyIcon: "Ar",
|
1260
|
+
internetCountryCode: "MG"
|
1261
|
+
},
|
1262
|
+
{
|
1263
|
+
countryName: "Malawi",
|
1264
|
+
countryCode: "+265",
|
1265
|
+
currency: "Malawian kwacha",
|
1266
|
+
currencyCode: "MWK",
|
1267
|
+
currencyIcon: "MK",
|
1268
|
+
internetCountryCode: "MW"
|
1269
|
+
},
|
1270
|
+
{
|
1271
|
+
countryName: "Mali",
|
1272
|
+
countryCode: "+223",
|
1273
|
+
currency: "West African CFA franc",
|
1274
|
+
currencyCode: "XOF",
|
1275
|
+
currencyIcon: "Fr",
|
1276
|
+
internetCountryCode: "ML"
|
1277
|
+
},
|
1278
|
+
{
|
1279
|
+
countryName: "Mozambique",
|
1280
|
+
countryCode: "+258",
|
1281
|
+
currency: "Mozambican metical",
|
1282
|
+
currencyCode: "MZN",
|
1283
|
+
currencyIcon: "MT",
|
1284
|
+
internetCountryCode: "MZ"
|
1285
|
+
},
|
1286
|
+
{
|
1287
|
+
countryName: "Namibia",
|
1288
|
+
countryCode: "+264",
|
1289
|
+
currency: "Namibian dollar",
|
1290
|
+
currencyCode: "NAD",
|
1291
|
+
currencyIcon: "$",
|
1292
|
+
internetCountryCode: "NA"
|
1293
|
+
},
|
1294
|
+
{
|
1295
|
+
countryName: "Niger",
|
1296
|
+
countryCode: "+227",
|
1297
|
+
currency: "West African CFA franc",
|
1298
|
+
currencyCode: "XOF",
|
1299
|
+
currencyIcon: "Fr",
|
1300
|
+
internetCountryCode: "NE"
|
1301
|
+
},
|
1302
|
+
{
|
1303
|
+
countryName: "Nigeria",
|
1304
|
+
countryCode: "+234",
|
1305
|
+
currency: "Nigerian naira",
|
1306
|
+
currencyCode: "NGN",
|
1307
|
+
currencyIcon: "\u20A6",
|
1308
|
+
internetCountryCode: "NG"
|
1309
|
+
},
|
1310
|
+
{
|
1311
|
+
countryName: "Republic of the Congo",
|
1312
|
+
countryCode: "+242",
|
1313
|
+
currency: "Central African CFA franc",
|
1314
|
+
currencyCode: "XAF",
|
1315
|
+
currencyIcon: "Fr",
|
1316
|
+
internetCountryCode: "CG"
|
1317
|
+
},
|
1318
|
+
{
|
1319
|
+
countryName: "Rwanda",
|
1320
|
+
countryCode: "+250",
|
1321
|
+
currency: "Rwandan franc",
|
1322
|
+
currencyCode: "RWF",
|
1323
|
+
currencyIcon: "Fr",
|
1324
|
+
internetCountryCode: "RW"
|
1325
|
+
},
|
1326
|
+
{
|
1327
|
+
countryName: "Senegal",
|
1328
|
+
countryCode: "+221",
|
1329
|
+
currency: "West African CFA franc",
|
1330
|
+
currencyCode: "XOF",
|
1331
|
+
currencyIcon: "Fr",
|
1332
|
+
internetCountryCode: "SN"
|
1333
|
+
},
|
1334
|
+
{
|
1335
|
+
countryName: "Seychelles",
|
1336
|
+
countryCode: "+248",
|
1337
|
+
currency: "Seychellois rupee",
|
1338
|
+
currencyCode: "SCR",
|
1339
|
+
currencyIcon: "\u20A8",
|
1340
|
+
internetCountryCode: "SC"
|
1341
|
+
},
|
1342
|
+
{
|
1343
|
+
countryName: "South Africa",
|
1344
|
+
countryCode: "+27",
|
1345
|
+
currency: "South African rand",
|
1346
|
+
currencyCode: "ZAR",
|
1347
|
+
currencyIcon: "R",
|
1348
|
+
internetCountryCode: "ZA"
|
1349
|
+
},
|
1350
|
+
{
|
1351
|
+
countryName: "South Sudan",
|
1352
|
+
countryCode: "+211",
|
1353
|
+
currency: "South Sudanese pound",
|
1354
|
+
currencyCode: "SSP",
|
1355
|
+
currencyIcon: "\xA3",
|
1356
|
+
internetCountryCode: "SS"
|
1357
|
+
},
|
1358
|
+
{
|
1359
|
+
countryName: "Tanzania",
|
1360
|
+
countryCode: "+255",
|
1361
|
+
currency: "Tanzanian shilling",
|
1362
|
+
currencyCode: "TZS",
|
1363
|
+
currencyIcon: "Sh",
|
1364
|
+
internetCountryCode: "TZ"
|
1365
|
+
},
|
1366
|
+
{
|
1367
|
+
countryName: "Togo",
|
1368
|
+
countryCode: "+228",
|
1369
|
+
currency: "West African CFA franc",
|
1370
|
+
currencyCode: "XOF",
|
1371
|
+
currencyIcon: "Fr",
|
1372
|
+
internetCountryCode: "TG"
|
1373
|
+
},
|
1374
|
+
{
|
1375
|
+
countryName: "Uganda",
|
1376
|
+
countryCode: "+256",
|
1377
|
+
currency: "Ugandan shilling",
|
1378
|
+
currencyCode: "UGX",
|
1379
|
+
currencyIcon: "Sh",
|
1380
|
+
internetCountryCode: "UG"
|
1381
|
+
},
|
1382
|
+
{
|
1383
|
+
countryName: "Zambia",
|
1384
|
+
countryCode: "+260",
|
1385
|
+
currency: "Zambian kwacha",
|
1386
|
+
currencyCode: "ZMW",
|
1387
|
+
currencyIcon: "ZK",
|
1388
|
+
internetCountryCode: "ZM"
|
1389
|
+
}
|
1390
|
+
];
|
1391
|
+
var getCountryDataMap = () => {
|
1392
|
+
const frequency = {};
|
1393
|
+
countryData?.forEach((country) => {
|
1394
|
+
frequency[country?.internetCountryCode] = country?.countryName;
|
1395
|
+
});
|
1396
|
+
return frequency;
|
1397
|
+
};
|
1398
|
+
|
1399
|
+
// src/components/phone-input/index.tsx
|
1400
|
+
import * as React12 from "react";
|
1401
|
+
import * as RPNInput from "react-phone-number-input";
|
1402
|
+
import flags from "react-phone-number-input/flags";
|
1403
|
+
|
1404
|
+
// src/components/phone-input/Flag.tsx
|
1405
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
1406
|
+
var FlatGlobeIcon = (props) => {
|
1407
|
+
return /* @__PURE__ */ jsxs15(
|
1408
|
+
"svg",
|
1409
|
+
{
|
1410
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1411
|
+
viewBox: "0 0 32 32",
|
1412
|
+
fill: "none",
|
1413
|
+
...props,
|
1414
|
+
children: [
|
1415
|
+
/* @__PURE__ */ jsx20("rect", { width: "32", height: "32", fill: "#60A5FA" }),
|
1416
|
+
" ",
|
1417
|
+
/* @__PURE__ */ jsx20(
|
1418
|
+
"path",
|
1419
|
+
{
|
1420
|
+
d: "M3 10L7 8L10 9L13 8L16 10L19 9L22 11L25 10L28 12V15L26 17L28 19L27 22L29 24L27 26L24 25L21 26L18 24L15 25L12 23L9 24L6 22L4 23L2 21V18L4 16L3 13L5 11L3 10Z",
|
1421
|
+
fill: "#34D399"
|
1422
|
+
}
|
1423
|
+
),
|
1424
|
+
/* @__PURE__ */ jsx20("rect", { x: "2", y: "28", width: "28", height: "3", fill: "#D1D5DB" }),
|
1425
|
+
/* @__PURE__ */ jsx20(
|
1426
|
+
"path",
|
1427
|
+
{
|
1428
|
+
d: "M0 16H32M8 0V32M16 0V32M24 0V32",
|
1429
|
+
stroke: "#2563EB",
|
1430
|
+
strokeWidth: "0.5",
|
1431
|
+
vectorEffect: "non-scaling-stroke"
|
1432
|
+
}
|
1433
|
+
),
|
1434
|
+
/* @__PURE__ */ jsx20(
|
1435
|
+
"path",
|
1436
|
+
{
|
1437
|
+
d: "M0 16H32",
|
1438
|
+
stroke: "#2563EB",
|
1439
|
+
strokeWidth: "1",
|
1440
|
+
vectorEffect: "non-scaling-stroke"
|
1441
|
+
}
|
1442
|
+
)
|
1443
|
+
]
|
1444
|
+
}
|
1445
|
+
);
|
1446
|
+
};
|
1447
|
+
var Flag_default = FlatGlobeIcon;
|
1448
|
+
|
1449
|
+
// src/components/phone-input/index.tsx
|
1450
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
1451
|
+
var PhoneInput = React12.forwardRef(
|
1452
|
+
({
|
1453
|
+
className,
|
1454
|
+
onChange,
|
1455
|
+
defaultCountry = "NG",
|
1456
|
+
modal,
|
1457
|
+
showAsterisk,
|
1458
|
+
label,
|
1459
|
+
description,
|
1460
|
+
error,
|
1461
|
+
...props
|
1462
|
+
}, ref) => {
|
1463
|
+
const CountrySelectWrapper = (innerProps) => {
|
1464
|
+
return /* @__PURE__ */ jsx21(CountrySelect, { ...innerProps, status: props.status, modal });
|
1465
|
+
};
|
1466
|
+
return /* @__PURE__ */ jsxs16("div", { className: "relative space-y-1", children: [
|
1467
|
+
/* @__PURE__ */ jsx21(FormLabel, { showAsterisk, error, children: label }),
|
1468
|
+
/* @__PURE__ */ jsx21(
|
1469
|
+
RPNInput.default,
|
1470
|
+
{
|
1471
|
+
ref,
|
1472
|
+
className: cn("flex", className),
|
1473
|
+
flagComponent: FlagComponent,
|
1474
|
+
countrySelectComponent: CountrySelectWrapper,
|
1475
|
+
inputComponent: InputComponent,
|
1476
|
+
defaultCountry,
|
1477
|
+
onChange: (value) => {
|
1478
|
+
if (onChange) {
|
1479
|
+
onChange?.(value);
|
1480
|
+
}
|
1481
|
+
},
|
1482
|
+
...props
|
1483
|
+
}
|
1484
|
+
),
|
1485
|
+
/* @__PURE__ */ jsx21(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1486
|
+
/* @__PURE__ */ jsx21(ErrorMessage, { error })
|
1487
|
+
] });
|
1488
|
+
}
|
1489
|
+
);
|
1490
|
+
PhoneInput.displayName = "PhoneInput";
|
1491
|
+
var InputComponent = React12.forwardRef(
|
1492
|
+
({ className, ...props }, ref) => {
|
1493
|
+
return /* @__PURE__ */ jsx21(
|
1494
|
+
Input,
|
1495
|
+
{
|
1496
|
+
className: cn("!rounded-s-none h-10", className),
|
1497
|
+
...props,
|
1498
|
+
ref
|
1499
|
+
}
|
1500
|
+
);
|
1501
|
+
}
|
1502
|
+
);
|
1503
|
+
InputComponent.displayName = "InputComponent";
|
1504
|
+
var CountrySelect = ({
|
1505
|
+
disabled,
|
1506
|
+
value,
|
1507
|
+
onChange,
|
1508
|
+
options,
|
1509
|
+
status,
|
1510
|
+
modal
|
1511
|
+
}) => {
|
1512
|
+
const handleSelect = React12.useCallback(
|
1513
|
+
(country) => {
|
1514
|
+
onChange(country);
|
1515
|
+
},
|
1516
|
+
[onChange]
|
1517
|
+
);
|
1518
|
+
return /* @__PURE__ */ jsxs16(PopoverRoot, { modal, children: [
|
1519
|
+
/* @__PURE__ */ jsx21(PopoverTrigger, { disabled, children: /* @__PURE__ */ jsxs16(
|
1520
|
+
"div",
|
1521
|
+
{
|
1522
|
+
className: cn(
|
1523
|
+
inputContainerVariants({ status }),
|
1524
|
+
"transition justify-center items-center disabled:text-base-500 flex gap-3 h-10 rounded-e-none border-e-0 pl-2 pr-2"
|
1525
|
+
),
|
1526
|
+
children: [
|
1527
|
+
/* @__PURE__ */ jsx21(FlagComponent, { country: value, countryName: value }),
|
1528
|
+
/* @__PURE__ */ jsx21(
|
1529
|
+
"svg",
|
1530
|
+
{
|
1531
|
+
className: cn(
|
1532
|
+
"mr-0.5 h-4 w-4 opacity-50",
|
1533
|
+
disabled ? "hidden" : "opacity-100"
|
1534
|
+
),
|
1535
|
+
width: "20",
|
1536
|
+
height: "20",
|
1537
|
+
viewBox: "0 0 20 20",
|
1538
|
+
fill: "none",
|
1539
|
+
children: /* @__PURE__ */ jsx21(
|
1540
|
+
"path",
|
1541
|
+
{
|
1542
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1543
|
+
stroke: "#959595",
|
1544
|
+
strokeWidth: "1.5",
|
1545
|
+
strokeMiterlimit: "10",
|
1546
|
+
strokeLinecap: "round",
|
1547
|
+
strokeLinejoin: "round"
|
1548
|
+
}
|
1549
|
+
)
|
1550
|
+
}
|
1551
|
+
)
|
1552
|
+
]
|
1553
|
+
}
|
1554
|
+
) }),
|
1555
|
+
/* @__PURE__ */ jsx21(PopoverContent, { portal: !modal, className: "w-[200px] md:w-[300px] p-0", children: /* @__PURE__ */ jsx21(Command, { children: /* @__PURE__ */ jsx21(CommandList, { children: /* @__PURE__ */ jsxs16(ScrollArea, { className: "h-72", children: [
|
1556
|
+
/* @__PURE__ */ jsx21(CommandInput, { placeholder: "Search country..." }),
|
1557
|
+
/* @__PURE__ */ jsx21(CommandEmpty, { children: "No country found." }),
|
1558
|
+
/* @__PURE__ */ jsx21(CommandGroup, { children: options.filter((x) => x.value).map((option) => /* @__PURE__ */ jsxs16(
|
1559
|
+
CommandItem,
|
1560
|
+
{
|
1561
|
+
className: "gap-2",
|
1562
|
+
onSelect: () => handleSelect(option.value),
|
1563
|
+
children: [
|
1564
|
+
/* @__PURE__ */ jsx21(
|
1565
|
+
FlagComponent,
|
1566
|
+
{
|
1567
|
+
country: option.value,
|
1568
|
+
countryName: option.label
|
1569
|
+
}
|
1570
|
+
),
|
1571
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-sm", children: option.label }),
|
1572
|
+
option.value && /* @__PURE__ */ jsx21("span", { className: "text-[#191919]/50 text-sm dark:text-white", children: `+${RPNInput.getCountryCallingCode(option.value)}` }),
|
1573
|
+
/* @__PURE__ */ jsx21(
|
1574
|
+
"svg",
|
1575
|
+
{
|
1576
|
+
width: "16",
|
1577
|
+
height: "16",
|
1578
|
+
viewBox: "0 0 16 16",
|
1579
|
+
fill: "none",
|
1580
|
+
className: cn(
|
1581
|
+
"ml-auto",
|
1582
|
+
option.value === value ? "opacity-100" : "opacity-0"
|
1583
|
+
),
|
1584
|
+
children: /* @__PURE__ */ jsx21(
|
1585
|
+
"path",
|
1586
|
+
{
|
1587
|
+
d: "M4 8.00008L6.66353 10.6636L12 5.33655",
|
1588
|
+
stroke: "#959595",
|
1589
|
+
strokeWidth: "1.06667",
|
1590
|
+
strokeLinecap: "round",
|
1591
|
+
strokeLinejoin: "round"
|
1592
|
+
}
|
1593
|
+
)
|
1594
|
+
}
|
1595
|
+
)
|
1596
|
+
]
|
1597
|
+
},
|
1598
|
+
`${option.value}-${option.label}`
|
1599
|
+
)) })
|
1600
|
+
] }) }) }) })
|
1601
|
+
] });
|
1602
|
+
};
|
1603
|
+
var FlagComponent = ({
|
1604
|
+
country,
|
1605
|
+
countryName,
|
1606
|
+
className
|
1607
|
+
}) => {
|
1608
|
+
const Flag = flags[country];
|
1609
|
+
if (country === "GLOBAL")
|
1610
|
+
return /* @__PURE__ */ jsx21(
|
1611
|
+
"span",
|
1612
|
+
{
|
1613
|
+
className: cn(
|
1614
|
+
"bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
|
1615
|
+
className
|
1616
|
+
),
|
1617
|
+
children: /* @__PURE__ */ jsx21(Flag_default, { className: "w-full h-[90%]" })
|
1618
|
+
}
|
1619
|
+
);
|
1620
|
+
return /* @__PURE__ */ jsx21(
|
1621
|
+
"span",
|
1622
|
+
{
|
1623
|
+
className: cn(
|
1624
|
+
"bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
|
1625
|
+
className
|
1626
|
+
),
|
1627
|
+
children: Flag && /* @__PURE__ */ jsx21(Flag, { title: countryName })
|
1628
|
+
}
|
1629
|
+
);
|
1630
|
+
};
|
1631
|
+
FlagComponent.displayName = "FlagComponent";
|
1632
|
+
|
1633
|
+
// src/components/country/index.tsx
|
1634
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
1635
|
+
var countryMap = getCountryDataMap();
|
1636
|
+
var CountryTrigger = ({
|
1637
|
+
className,
|
1638
|
+
value,
|
1639
|
+
placeholder = "",
|
1640
|
+
status,
|
1641
|
+
disabled
|
1642
|
+
}) => {
|
1643
|
+
return /* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs17(
|
1644
|
+
"button",
|
1645
|
+
{
|
1646
|
+
disabled,
|
1647
|
+
className: cn(
|
1648
|
+
inputContainerVariants({ status }),
|
1649
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",
|
1650
|
+
value ? "" : "text-[#79818C]",
|
1651
|
+
className
|
1652
|
+
),
|
1653
|
+
children: [
|
1654
|
+
value ? /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-center", children: [
|
1655
|
+
/* @__PURE__ */ jsx22(
|
1656
|
+
FlagComponent,
|
1657
|
+
{
|
1658
|
+
country: value,
|
1659
|
+
countryName: value,
|
1660
|
+
className: "ml-1 !w-6 h-5"
|
1661
|
+
}
|
1662
|
+
),
|
1663
|
+
/* @__PURE__ */ jsxs17("span", { className: "", children: [
|
1664
|
+
" ",
|
1665
|
+
countryMap[value]
|
1666
|
+
] })
|
1667
|
+
] }) : placeholder ?? "Select options...",
|
1668
|
+
/* @__PURE__ */ jsx22(
|
1669
|
+
"svg",
|
1670
|
+
{
|
1671
|
+
width: "20",
|
1672
|
+
height: "20",
|
1673
|
+
viewBox: "0 0 20 20",
|
1674
|
+
fill: "none",
|
1675
|
+
className: " data-[state=open]:goup-rotate-180",
|
1676
|
+
children: /* @__PURE__ */ jsx22(
|
1677
|
+
"path",
|
1678
|
+
{
|
1679
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1680
|
+
stroke: "currentColor",
|
1681
|
+
strokeWidth: "1.5",
|
1682
|
+
strokeMiterlimit: "10",
|
1683
|
+
strokeLinecap: "round",
|
1684
|
+
strokeLinejoin: "round"
|
1685
|
+
}
|
1686
|
+
)
|
1687
|
+
}
|
1688
|
+
)
|
1689
|
+
]
|
1690
|
+
}
|
1691
|
+
) });
|
1692
|
+
};
|
1693
|
+
var Country = ({
|
1694
|
+
hideSearch = true,
|
1695
|
+
showAsterisk,
|
1696
|
+
label,
|
1697
|
+
description,
|
1698
|
+
error,
|
1699
|
+
...props
|
1700
|
+
}) => {
|
1701
|
+
const options = countryData?.map((country) => ({
|
1702
|
+
value: country?.internetCountryCode,
|
1703
|
+
label: country?.countryName,
|
1704
|
+
...country
|
1705
|
+
}));
|
1706
|
+
return /* @__PURE__ */ jsxs17("div", { className: "relative space-y-1", children: [
|
1707
|
+
/* @__PURE__ */ jsx22(FormLabel, { showAsterisk, error, children: label }),
|
1708
|
+
/* @__PURE__ */ jsx22(
|
1709
|
+
Searchable,
|
1710
|
+
{
|
1711
|
+
options,
|
1712
|
+
hideSearch,
|
1713
|
+
optionComponent: (arg) => {
|
1714
|
+
return /* @__PURE__ */ jsxs17("div", { className: "w-full flex items-center gap-2", children: [
|
1715
|
+
/* @__PURE__ */ jsx22(
|
1716
|
+
FlagComponent,
|
1717
|
+
{
|
1718
|
+
country: arg?.internetCountryCode,
|
1719
|
+
countryName: arg?.label,
|
1720
|
+
className: "ml-2 !w-6 !h-5"
|
1721
|
+
}
|
1722
|
+
),
|
1723
|
+
/* @__PURE__ */ jsx22("span", { className: "flex-1 text-sm", children: arg?.label })
|
1724
|
+
] });
|
1725
|
+
},
|
1726
|
+
...props,
|
1727
|
+
children: /* @__PURE__ */ jsx22(
|
1728
|
+
CountryTrigger,
|
1729
|
+
{
|
1730
|
+
value: props?.value?.value,
|
1731
|
+
status: props?.status,
|
1732
|
+
placeholder: props?.placeholder ?? " Select Country"
|
1733
|
+
}
|
1734
|
+
)
|
1735
|
+
}
|
1736
|
+
),
|
1737
|
+
/* @__PURE__ */ jsx22(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1738
|
+
/* @__PURE__ */ jsx22(ErrorMessage, { error })
|
1739
|
+
] });
|
1740
|
+
};
|
1741
|
+
|
1742
|
+
// src/components/select/index.tsx
|
1743
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
1744
|
+
var Select = ({
|
1745
|
+
showAsterisk,
|
1746
|
+
label,
|
1747
|
+
description,
|
1748
|
+
error,
|
1749
|
+
hideSearch = true,
|
1750
|
+
status,
|
1751
|
+
...props
|
1752
|
+
}) => {
|
1753
|
+
return /* @__PURE__ */ jsxs18("div", { className: "relative space-y-1", children: [
|
1754
|
+
/* @__PURE__ */ jsx23(FormLabel, { showAsterisk, error, children: label }),
|
1755
|
+
/* @__PURE__ */ jsx23(
|
1756
|
+
Searchable,
|
1757
|
+
{
|
1758
|
+
hideSearch,
|
1759
|
+
...props,
|
1760
|
+
containerClassName: "h-full",
|
1761
|
+
children: /* @__PURE__ */ jsx23(
|
1762
|
+
SearchableTrigger,
|
1763
|
+
{
|
1764
|
+
disabled: props?.disabled,
|
1765
|
+
placeholder: "Select or search email",
|
1766
|
+
status,
|
1767
|
+
value: props?.value?.label ?? props?.value?.value
|
1768
|
+
}
|
1769
|
+
)
|
1770
|
+
}
|
1771
|
+
),
|
1772
|
+
/* @__PURE__ */ jsx23(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1773
|
+
/* @__PURE__ */ jsx23(ErrorMessage, { error })
|
1774
|
+
] });
|
1775
|
+
};
|
1776
|
+
|
1777
|
+
// src/components/otp/index.tsx
|
1778
|
+
import OtpInput from "react-otp-input";
|
1779
|
+
import { cva as cva5 } from "class-variance-authority";
|
1780
|
+
import { useMemo as useMemo2 } from "react";
|
1781
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
1782
|
+
var otpInputVariants = cva5(
|
1783
|
+
"transition cursor-default placeholder:text-black dark:placeholder:text-white rounded-lg !h-14 !w-14 border aspect-square text-base font-semibold tracking-normal outline-none placeholder:text-sm placeholder:font-normal text-black focus:bg-white",
|
1784
|
+
{
|
1785
|
+
variants: {
|
1786
|
+
status: {
|
1787
|
+
default: "border-gray-300 dark:border-[#d4d4d4] focus:border-gray-400 focus-visible:!ring-offset-gray-200 focus:ring-offset-gray-200 !ring-gray-200 !focus-visible:ring-1 bg-white dark:!bg-transparent dark:focus-visible:!ring-0 dark:focus-within:!bg-transparent dark:text-white dark:focus-within:border-[#9299A2] dark:border-[#676767] dark:disabled:!border-[#9299A2]",
|
1788
|
+
error: "placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",
|
1789
|
+
loading: "placeholder:text-[#C4C4C4]"
|
1790
|
+
}
|
1791
|
+
},
|
1792
|
+
defaultVariants: {
|
1793
|
+
status: "default"
|
1794
|
+
}
|
1795
|
+
}
|
1796
|
+
);
|
1797
|
+
var OTPInput = ({
|
1798
|
+
numInputs = 4,
|
1799
|
+
inputStyle,
|
1800
|
+
containerStyle,
|
1801
|
+
placeholder = "-",
|
1802
|
+
status,
|
1803
|
+
...props
|
1804
|
+
}) => {
|
1805
|
+
const placeholderValue = useMemo2(() => {
|
1806
|
+
if (placeholder) return placeholder;
|
1807
|
+
const numInputArr = new Array(numInputs).fill("");
|
1808
|
+
const result = numInputArr.reduce((accumulator, currentValue) => {
|
1809
|
+
return accumulator += currentValue;
|
1810
|
+
}, "");
|
1811
|
+
return result;
|
1812
|
+
}, [numInputs, placeholder]);
|
1813
|
+
return /* @__PURE__ */ jsx24(
|
1814
|
+
OtpInput,
|
1815
|
+
{
|
1816
|
+
numInputs,
|
1817
|
+
placeholder: placeholderValue,
|
1818
|
+
containerStyle: cn("w-full", containerStyle),
|
1819
|
+
inputStyle: cn(otpInputVariants({ status }), inputStyle),
|
1820
|
+
renderInput: (props2) => /* @__PURE__ */ jsx24("input", { ...props2 }),
|
1821
|
+
...props
|
1822
|
+
}
|
1823
|
+
);
|
1824
|
+
};
|
1825
|
+
|
1826
|
+
// src/components/copyable-label/index.tsx
|
1827
|
+
import { useState as useState3 } from "react";
|
1828
|
+
import { Copy, CheckIcon } from "lucide-react";
|
1829
|
+
import { motion, AnimatePresence } from "framer-motion";
|
1830
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
1831
|
+
var CopyableLabel = ({
|
1832
|
+
text,
|
1833
|
+
onCopy,
|
1834
|
+
iconsPosition = "right",
|
1835
|
+
clampText = true
|
1836
|
+
}) => {
|
1837
|
+
const [copied, setCopied] = useState3(false);
|
1838
|
+
const copyToClipboard = () => {
|
1839
|
+
navigator.clipboard.writeText(text).then(() => {
|
1840
|
+
setCopied(true);
|
1841
|
+
onCopy?.();
|
1842
|
+
setTimeout(() => setCopied(false), 2e3);
|
1843
|
+
});
|
1844
|
+
};
|
1845
|
+
const Icon2 = copied ? CheckIcon : Copy;
|
1846
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex items-center space-x-2 cursor-pointer text-[#717171] bg-gray-100 w-fit max-w-full rounded-md p-1 px-2", children: [
|
1847
|
+
iconsPosition === "left" && /* @__PURE__ */ jsx25(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied }),
|
1848
|
+
/* @__PURE__ */ jsx25("span", { className: `${clampText ? "truncate max-w-[100px]" : ""}`, children: text }),
|
1849
|
+
iconsPosition === "right" && /* @__PURE__ */ jsx25(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied })
|
1850
|
+
] });
|
1851
|
+
};
|
1852
|
+
var AnimatedIcon = ({ Icon: Icon2, onClick, copied }) => /* @__PURE__ */ jsx25(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx25(
|
1853
|
+
motion.div,
|
1854
|
+
{
|
1855
|
+
initial: { opacity: 0, scale: 0.8 },
|
1856
|
+
animate: { opacity: 1, scale: 1 },
|
1857
|
+
exit: { opacity: 0, scale: 0.8 },
|
1858
|
+
transition: { duration: 0.2 },
|
1859
|
+
onClick,
|
1860
|
+
children: /* @__PURE__ */ jsx25(
|
1861
|
+
Icon2,
|
1862
|
+
{
|
1863
|
+
className: `w-5 h-5 ${copied ? "text-green-500" : "text-gray-500 hover:text-gray-700 transition"}`
|
1864
|
+
}
|
1865
|
+
)
|
1866
|
+
},
|
1867
|
+
copied ? "check" : "copy"
|
1868
|
+
) });
|
1869
|
+
|
1870
|
+
// src/components/debounced-input/index.tsx
|
1871
|
+
import { useEffect, useState as useState4 } from "react";
|
1872
|
+
import { Search as Search2 } from "lucide-react";
|
1873
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
1874
|
+
var DebouncedInput = ({
|
1875
|
+
value: initialValue,
|
1876
|
+
onChange,
|
1877
|
+
debounce = 500,
|
1878
|
+
addon,
|
1879
|
+
...props
|
1880
|
+
}) => {
|
1881
|
+
const [value, setValue] = useState4(initialValue ?? "");
|
1882
|
+
const handleInputChange = (event) => setValue(event.target.value);
|
1883
|
+
useEffect(() => {
|
1884
|
+
if (!initialValue) return;
|
1885
|
+
setValue(initialValue);
|
1886
|
+
}, [initialValue]);
|
1887
|
+
useEffect(() => {
|
1888
|
+
const timeout = setTimeout(() => {
|
1889
|
+
onChange(value);
|
1890
|
+
}, debounce);
|
1891
|
+
return () => clearTimeout(timeout);
|
1892
|
+
}, [value, debounce, onChange]);
|
1893
|
+
return /* @__PURE__ */ jsx26(
|
1894
|
+
Input,
|
1895
|
+
{
|
1896
|
+
leftNode: addon ?? /* @__PURE__ */ jsx26(Search2, { className: " w-4 h-4 text-gray-400" }),
|
1897
|
+
sideNodeClassName: "bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",
|
1898
|
+
...props,
|
1899
|
+
className: cn(
|
1900
|
+
"!pl-0 py-1 border-[.5px] border-[#E9EBF8] rounded-xl text-sm w-full h-8 focus:outline-none focus:placeholder:hidden focus:!ring-2 !focus:ring-primary-main bg-[#F5F8FF] focus-within:!bg-transparent placeholder:text-xs",
|
1901
|
+
props?.className
|
1902
|
+
),
|
1903
|
+
onChange: handleInputChange,
|
1904
|
+
value
|
1905
|
+
}
|
1906
|
+
);
|
1907
|
+
};
|
1908
|
+
|
1909
|
+
// src/components/status/index.tsx
|
1910
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
1911
|
+
var Status = ({
|
1912
|
+
status,
|
1913
|
+
variant,
|
1914
|
+
className
|
1915
|
+
}) => {
|
1916
|
+
return /* @__PURE__ */ jsx27("div", { children: /* @__PURE__ */ jsx27(
|
1917
|
+
"div",
|
1918
|
+
{
|
1919
|
+
className: cn(
|
1920
|
+
"order-first max-w-max flex-none rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ring-current sm:order-none text-[14px] capitalize",
|
1921
|
+
{
|
1922
|
+
"bg-green-500/20 text-green-500": variant === "success"
|
1923
|
+
},
|
1924
|
+
{
|
1925
|
+
"bg-gray-500/20 text-white": variant === "abandoned"
|
1926
|
+
},
|
1927
|
+
{
|
1928
|
+
"bg-red-500/20 text-red-500": variant === "failed"
|
1929
|
+
},
|
1930
|
+
{
|
1931
|
+
"bg-yellow-500/20 text-yellow-500": variant === "pending"
|
1932
|
+
},
|
1933
|
+
className
|
1934
|
+
),
|
1935
|
+
children: /* @__PURE__ */ jsx27("p", { children: status.replace("-", " ") })
|
1936
|
+
}
|
1937
|
+
) });
|
1938
|
+
};
|
1939
|
+
|
1940
|
+
// src/components/table/index.tsx
|
1941
|
+
import { Download, ListFilter, Loader as Loader2, RotateCw } from "lucide-react";
|
1942
|
+
|
1943
|
+
// src/components/table/pagination/index.tsx
|
1944
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
1945
|
+
|
1946
|
+
// src/components/table/pagination/utils.tsx
|
1947
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
1948
|
+
var PageButton = ({
|
1949
|
+
page,
|
1950
|
+
currentPage,
|
1951
|
+
onClick
|
1952
|
+
}) => {
|
1953
|
+
if (typeof page === "string") {
|
1954
|
+
return /* @__PURE__ */ jsx28("span", { className: "px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500", children: page });
|
1955
|
+
}
|
1956
|
+
return /* @__PURE__ */ jsx28(
|
1957
|
+
"button",
|
1958
|
+
{
|
1959
|
+
onClick,
|
1960
|
+
className: `p-1 w-8 h-8 text-xs sm:text-sm rounded-full ${page === currentPage ? "bg-primary-main text-white" : "text-[#717171] hover:bg-primary-main/10"}`,
|
1961
|
+
children: page
|
1962
|
+
}
|
1963
|
+
);
|
1964
|
+
};
|
1965
|
+
var renderPageNumbers = ({
|
1966
|
+
totalPages,
|
1967
|
+
currentPage,
|
1968
|
+
handlePageClick
|
1969
|
+
}) => {
|
1970
|
+
const maxVisiblePages = 3;
|
1971
|
+
const getWindowBounds = () => {
|
1972
|
+
const halfWindow = Math.floor(maxVisiblePages / 2);
|
1973
|
+
let start2 = Math.max(1, currentPage - halfWindow);
|
1974
|
+
let end2 = Math.min(totalPages, start2 + maxVisiblePages - 1);
|
1975
|
+
if (end2 > totalPages) {
|
1976
|
+
start2 = Math.max(1, totalPages - maxVisiblePages + 1);
|
1977
|
+
end2 = totalPages;
|
1978
|
+
}
|
1979
|
+
return { start: start2, end: end2 };
|
1980
|
+
};
|
1981
|
+
const { start, end } = getWindowBounds();
|
1982
|
+
const pages = [];
|
1983
|
+
if (start > 1) pages.push(1);
|
1984
|
+
if (start > 2) pages.push("...");
|
1985
|
+
pages.push(...Array.from({ length: end - start + 1 }, (_, i) => start + i));
|
1986
|
+
if (end < totalPages - 1) pages.push("...");
|
1987
|
+
if (end < totalPages) pages.push(totalPages);
|
1988
|
+
return pages.map((page, idx) => /* @__PURE__ */ jsx28(
|
1989
|
+
PageButton,
|
1990
|
+
{
|
1991
|
+
page,
|
1992
|
+
currentPage,
|
1993
|
+
onClick: typeof page === "number" ? () => handlePageClick(page) : void 0
|
1994
|
+
},
|
1995
|
+
idx
|
1996
|
+
));
|
1997
|
+
};
|
1998
|
+
|
1999
|
+
// src/components/table/pagination/index.tsx
|
2000
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
2001
|
+
var Pagination = ({
|
2002
|
+
currentPage = 1,
|
2003
|
+
totalPages = 1,
|
2004
|
+
onPageChange,
|
2005
|
+
itemsPerPage = 0,
|
2006
|
+
totalItems = 0
|
2007
|
+
}) => {
|
2008
|
+
const handlePageClick = (page) => {
|
2009
|
+
if (page >= 1 && page <= totalPages) {
|
2010
|
+
onPageChange?.(page);
|
2011
|
+
}
|
2012
|
+
};
|
2013
|
+
const visibleRangeStart = itemsPerPage === 0 ? 1 : itemsPerPage * (currentPage - 1) + 1;
|
2014
|
+
const visibleRangeEnd = currentPage === totalPages ? totalItems : Math.min(visibleRangeStart + itemsPerPage - 1, totalItems);
|
2015
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between border-t border-gray-200 px-4 py-3 sm:px-6 w-full flex-wrap gap-y-10 sm:gap-y-0", children: [
|
2016
|
+
totalItems && /* @__PURE__ */ jsx29("section", { className: "text-[#717171] text-[12px]", children: /* @__PURE__ */ jsxs20("p", { className: "", children: [
|
2017
|
+
"Showing ",
|
2018
|
+
visibleRangeStart,
|
2019
|
+
" - ",
|
2020
|
+
visibleRangeEnd,
|
2021
|
+
" of ",
|
2022
|
+
totalItems
|
2023
|
+
] }) }),
|
2024
|
+
/* @__PURE__ */ jsx29("div", { className: "flex items-center justify-center sm:justify-end ", children: /* @__PURE__ */ jsxs20("nav", { className: " inline-flex gap-x-1 sm:gap-x-[10px] items-center", children: [
|
2025
|
+
/* @__PURE__ */ jsx29(
|
2026
|
+
"button",
|
2027
|
+
{
|
2028
|
+
onClick: () => handlePageClick(currentPage - 1),
|
2029
|
+
disabled: currentPage === 1,
|
2030
|
+
className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
|
2031
|
+
children: /* @__PURE__ */ jsx29(ChevronLeftIcon, { className: "size-5" })
|
2032
|
+
}
|
2033
|
+
),
|
2034
|
+
renderPageNumbers({ currentPage, totalPages, handlePageClick }),
|
2035
|
+
/* @__PURE__ */ jsx29(
|
2036
|
+
"button",
|
2037
|
+
{
|
2038
|
+
onClick: () => handlePageClick(currentPage + 1),
|
2039
|
+
disabled: currentPage === totalPages,
|
2040
|
+
className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
|
2041
|
+
children: /* @__PURE__ */ jsx29(ChevronRightIcon, { className: "size-5" })
|
2042
|
+
}
|
2043
|
+
)
|
2044
|
+
] }) })
|
2045
|
+
] });
|
2046
|
+
};
|
2047
|
+
|
2048
|
+
// src/components/table/TableBody.tsx
|
2049
|
+
import {
|
2050
|
+
flexRender
|
2051
|
+
} from "@tanstack/react-table";
|
2052
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
2053
|
+
var TableBody = ({
|
2054
|
+
table,
|
2055
|
+
isMobile,
|
2056
|
+
onRowClick,
|
2057
|
+
id
|
2058
|
+
}) => {
|
2059
|
+
return /* @__PURE__ */ jsx30("div", { className: cn("relative w-full rounded-b border-0", {}), children: /* @__PURE__ */ jsxs21("table", { id: id ?? "table", className: "w-full overflow-x-scroll", children: [
|
2060
|
+
/* @__PURE__ */ jsx30("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx30(
|
2061
|
+
"tr",
|
2062
|
+
{
|
2063
|
+
className: cn(
|
2064
|
+
" rounded text-[#717171] border-b- bg-[#FCFCFC]",
|
2065
|
+
{}
|
2066
|
+
),
|
2067
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx30(
|
2068
|
+
"th",
|
2069
|
+
{
|
2070
|
+
className: "relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",
|
2071
|
+
colSpan: header.colSpan,
|
2072
|
+
style: {
|
2073
|
+
width: header.getSize()
|
2074
|
+
},
|
2075
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsx30(
|
2076
|
+
"div",
|
2077
|
+
{
|
2078
|
+
className: cn("flex items-center", {
|
2079
|
+
"cursor-pointer select-none": header.column.getCanSort()
|
2080
|
+
}),
|
2081
|
+
onClick: header.column.getToggleSortingHandler(),
|
2082
|
+
children: header.isPlaceholder ? null : flexRender(
|
2083
|
+
header.column.columnDef.header,
|
2084
|
+
header.getContext()
|
2085
|
+
)
|
2086
|
+
}
|
2087
|
+
)
|
2088
|
+
},
|
2089
|
+
header.id
|
2090
|
+
))
|
2091
|
+
},
|
2092
|
+
headerGroup.id
|
2093
|
+
)) }),
|
2094
|
+
/* @__PURE__ */ jsx30("tbody", { className: " pl-2.5", children: table?.getFilteredRowModel().rows.map((row) => /* @__PURE__ */ jsx30(
|
2095
|
+
"tr",
|
2096
|
+
{
|
2097
|
+
className: cn(
|
2098
|
+
"first-letter border-b border-zinc-100",
|
2099
|
+
{
|
2100
|
+
"hover:bg-gray-50": !isMobile
|
2101
|
+
},
|
2102
|
+
{
|
2103
|
+
"hover:bg-gray-50 hover:cursor-pointer": onRowClick
|
2104
|
+
}
|
2105
|
+
),
|
2106
|
+
onClick: () => onRowClick ? onRowClick(row) : {},
|
2107
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx30(
|
2108
|
+
"td",
|
2109
|
+
{
|
2110
|
+
className: cn("", {
|
2111
|
+
// block: false,
|
2112
|
+
}),
|
2113
|
+
children: /* @__PURE__ */ jsx30(
|
2114
|
+
"div",
|
2115
|
+
{
|
2116
|
+
className: cn("", {
|
2117
|
+
"w-max p-4 pl-2.5 text-black text-sm": true
|
2118
|
+
}),
|
2119
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
2120
|
+
}
|
2121
|
+
)
|
2122
|
+
},
|
2123
|
+
cell.id
|
2124
|
+
))
|
2125
|
+
},
|
2126
|
+
row.id
|
2127
|
+
)) })
|
2128
|
+
] }) });
|
2129
|
+
};
|
2130
|
+
|
2131
|
+
// src/components/table/index.tsx
|
2132
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
2133
|
+
var Table = ({
|
2134
|
+
table,
|
2135
|
+
isMobile = false,
|
2136
|
+
onRowClick,
|
2137
|
+
id,
|
2138
|
+
onRefetch,
|
2139
|
+
isRefetching,
|
2140
|
+
FilterMenu,
|
2141
|
+
ExtraNode,
|
2142
|
+
//deprecated: onExport - use download
|
2143
|
+
onExport,
|
2144
|
+
search = {
|
2145
|
+
enabled: false,
|
2146
|
+
debounceRate: 700
|
2147
|
+
},
|
2148
|
+
download = {
|
2149
|
+
enabled: false,
|
2150
|
+
buttonId: "download_button",
|
2151
|
+
buttonText: "Export"
|
2152
|
+
},
|
2153
|
+
isLoading,
|
2154
|
+
pagination
|
2155
|
+
}) => {
|
2156
|
+
const handleRefetch = () => {
|
2157
|
+
try {
|
2158
|
+
onRefetch?.();
|
2159
|
+
} catch (e) {
|
2160
|
+
console.error("Error while refetching data", e);
|
2161
|
+
}
|
2162
|
+
};
|
2163
|
+
const handleSearch = (e) => {
|
2164
|
+
search?.onSearch?.(e);
|
2165
|
+
};
|
2166
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("relative w-full rounded-b border-0 overflow-x-auto"), children: [
|
2167
|
+
(onRefetch || search?.enabled || FilterMenu || ExtraNode || onExport) && /* @__PURE__ */ jsxs22("div", { className: "sticky top-0 z-10 w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2", children: [
|
2168
|
+
/* @__PURE__ */ jsx31("div", { className: "flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start", children: /* @__PURE__ */ jsxs22("div", { className: " w-full flex gap-x-3", children: [
|
2169
|
+
search?.enabled && /* @__PURE__ */ jsx31("section", { className: "sm:w-56", children: /* @__PURE__ */ jsx31(
|
2170
|
+
DebouncedInput,
|
2171
|
+
{
|
2172
|
+
type: "text",
|
2173
|
+
placeholder: "Enter search here...",
|
2174
|
+
className: "h-9",
|
2175
|
+
onChange: handleSearch,
|
2176
|
+
debounce: search?.debounceRate
|
2177
|
+
}
|
2178
|
+
) }),
|
2179
|
+
/* @__PURE__ */ jsxs22("div", { className: " flex gap-2", children: [
|
2180
|
+
onRefetch && /* @__PURE__ */ jsx31(
|
2181
|
+
Button,
|
2182
|
+
{
|
2183
|
+
onClick: handleRefetch,
|
2184
|
+
title: "Refetch Data",
|
2185
|
+
disabled: isRefetching,
|
2186
|
+
variant: "outlined",
|
2187
|
+
className: "!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",
|
2188
|
+
size: "sm",
|
2189
|
+
children: /* @__PURE__ */ jsx31(
|
2190
|
+
RotateCw,
|
2191
|
+
{
|
2192
|
+
className: cn("w-4 h-4", {
|
2193
|
+
"animate-spin": isRefetching
|
2194
|
+
}),
|
2195
|
+
size: 5
|
2196
|
+
}
|
2197
|
+
)
|
2198
|
+
}
|
2199
|
+
),
|
2200
|
+
FilterMenu && /* @__PURE__ */ jsx31(
|
2201
|
+
Popover,
|
2202
|
+
{
|
2203
|
+
trigger: /* @__PURE__ */ jsx31(
|
2204
|
+
"button",
|
2205
|
+
{
|
2206
|
+
title: "Filter",
|
2207
|
+
className: cn(
|
2208
|
+
"!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",
|
2209
|
+
buttonVariants({
|
2210
|
+
variant: "outlined",
|
2211
|
+
size: "sm"
|
2212
|
+
})
|
2213
|
+
),
|
2214
|
+
children: /* @__PURE__ */ jsx31(ListFilter, { className: "w-4 h-4", size: 5 })
|
2215
|
+
}
|
2216
|
+
),
|
2217
|
+
children: FilterMenu
|
2218
|
+
}
|
2219
|
+
)
|
2220
|
+
] })
|
2221
|
+
] }) }),
|
2222
|
+
/* @__PURE__ */ jsx31("div", { className: "flex items-start flex-col gap-2 justify-center", children: /* @__PURE__ */ jsx31("section", { className: "flex flex-col-reverse sm:flex-row gap-2", children: /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
|
2223
|
+
ExtraNode && ExtraNode,
|
2224
|
+
onExport && /* @__PURE__ */ jsx31(Button, { variant: "primary", onClick: onExport, size: "sm", children: "Export" }),
|
2225
|
+
download?.enabled && /* @__PURE__ */ jsx31(
|
2226
|
+
Button,
|
2227
|
+
{
|
2228
|
+
variant: "primary",
|
2229
|
+
leftNode: /* @__PURE__ */ jsx31(
|
2230
|
+
Download,
|
2231
|
+
{
|
2232
|
+
className: cn("w-4 h-4", {
|
2233
|
+
"animate-spin": isRefetching
|
2234
|
+
}),
|
2235
|
+
size: 5
|
2236
|
+
}
|
2237
|
+
),
|
2238
|
+
onClick: download?.onDownload,
|
2239
|
+
id: download.buttonId,
|
2240
|
+
size: "sm",
|
2241
|
+
children: download?.buttonText
|
2242
|
+
}
|
2243
|
+
)
|
2244
|
+
] }) }) })
|
2245
|
+
] }),
|
2246
|
+
/* @__PURE__ */ jsx31("main", { className: "w-full overflow-x-auto mt-5", children: isLoading ? /* @__PURE__ */ jsxs22("div", { className: "py-10 flex flex-col justify-center w-full items-center space-x-2", children: [
|
2247
|
+
/* @__PURE__ */ jsx31(Loader2, { size: 20, className: "animate-spin" }),
|
2248
|
+
/* @__PURE__ */ jsx31("p", { className: "mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse", children: "Loading..." })
|
2249
|
+
] }) : table.getRowModel().rows.length < 1 ? /* @__PURE__ */ jsx31("div", { className: "py-10 flex flex-col justify-center w-full items-center", children: /* @__PURE__ */ jsx31("p", { className: "text-center text-gray-600 text-sm opacity-70", children: "No data available" }) }) : /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx31(
|
2250
|
+
TableBody,
|
2251
|
+
{
|
2252
|
+
table,
|
2253
|
+
isMobile,
|
2254
|
+
onRowClick,
|
2255
|
+
id
|
2256
|
+
}
|
2257
|
+
) }) }),
|
2258
|
+
!isLoading && pagination?.enabled && table.getRowModel().rows.length > 0 && /* @__PURE__ */ jsx31(
|
2259
|
+
Pagination,
|
2260
|
+
{
|
2261
|
+
...pagination,
|
2262
|
+
currentPage: pagination?.currentPage ?? 1,
|
2263
|
+
totalPages: pagination?.totalPages ?? Math.ceil(
|
2264
|
+
(pagination?.totalItems ?? 0) / Math.max(pagination?.itemsPerPage ?? 1, 1)
|
2265
|
+
) ?? 1,
|
2266
|
+
onPageChange: (page) => pagination?.onPageChange?.(page)
|
2267
|
+
}
|
2268
|
+
)
|
2269
|
+
] });
|
2270
|
+
};
|
2271
|
+
|
2272
|
+
// src/components/dev-banner/index.tsx
|
2273
|
+
import { useEffect as useEffect2 } from "react";
|
2274
|
+
import { X } from "lucide-react";
|
2275
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
2276
|
+
var DevBanner = (props) => {
|
2277
|
+
const {
|
2278
|
+
environment,
|
2279
|
+
branch,
|
2280
|
+
version,
|
2281
|
+
deployTime,
|
2282
|
+
showBanner,
|
2283
|
+
onClose,
|
2284
|
+
initDefault,
|
2285
|
+
removeFromStorage,
|
2286
|
+
syncLocalStorageToState
|
2287
|
+
} = props;
|
2288
|
+
const currentEnv = environment || process.env.NEXT_PUBLIC_NODE_ENV;
|
2289
|
+
if (currentEnv !== "staging" && currentEnv !== "sandbox") {
|
2290
|
+
useEffect2(() => {
|
2291
|
+
console.log({ environment, branch, version, deployTime });
|
2292
|
+
}, []);
|
2293
|
+
return null;
|
2294
|
+
}
|
2295
|
+
useEffect2(() => {
|
2296
|
+
syncLocalStorageToState();
|
2297
|
+
}, []);
|
2298
|
+
useEffect2(() => {
|
2299
|
+
let interval;
|
2300
|
+
const currentEnv2 = environment || process.env.NEXT_PUBLIC_NODE_ENV;
|
2301
|
+
if (currentEnv2 === "staging" || currentEnv2 === "sandbox") {
|
2302
|
+
interval = setInterval(
|
2303
|
+
() => {
|
2304
|
+
removeFromStorage();
|
2305
|
+
initDefault();
|
2306
|
+
},
|
2307
|
+
5 * 60 * 1e3
|
2308
|
+
);
|
2309
|
+
}
|
2310
|
+
return () => {
|
2311
|
+
if (interval) {
|
2312
|
+
clearInterval(interval);
|
2313
|
+
}
|
2314
|
+
};
|
2315
|
+
}, [showBanner, environment, onClose]);
|
2316
|
+
if (!showBanner) return null;
|
2317
|
+
return /* @__PURE__ */ jsxs23("div", { className: "w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96", children: [
|
2318
|
+
/* @__PURE__ */ jsx32("button", { onClick: onClose, className: "absolute top-2 right-2", children: /* @__PURE__ */ jsx32(X, {}) }),
|
2319
|
+
/* @__PURE__ */ jsxs23("div", { className: "space-y-2 text-sm", children: [
|
2320
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
|
2321
|
+
/* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Environment:" }),
|
2322
|
+
/* @__PURE__ */ jsx32("span", { className: "text-blue-600 capitalize", children: environment || process.env.NEXT_PUBLIC_NODE_ENV })
|
2323
|
+
] }),
|
2324
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
|
2325
|
+
/* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Branch:" }),
|
2326
|
+
/* @__PURE__ */ jsx32("span", { className: "text-green-600 capitalize", children: branch || process.env.NEXT_PUBLIC_DEPLOY_BRANCH })
|
2327
|
+
] }),
|
2328
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
|
2329
|
+
/* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Version:" }),
|
2330
|
+
/* @__PURE__ */ jsx32("span", { className: "text-purple-600", children: version || process.env.NEXT_PUBLIC_DEPLOY_VERSION })
|
2331
|
+
] }),
|
2332
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
|
2333
|
+
/* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Deploy Time:" }),
|
2334
|
+
/* @__PURE__ */ jsx32("span", { className: "text-orange-600", children: deployTime || process.env.NEXT_PUBLIC_DEPLOY_TIME })
|
2335
|
+
] })
|
2336
|
+
] })
|
2337
|
+
] });
|
2338
|
+
};
|
2339
|
+
|
2340
|
+
// src/components/banner/index.tsx
|
2341
|
+
import { useState as useState5, useEffect as useEffect3 } from "react";
|
2342
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
2343
|
+
var Icon = ({ type }) => {
|
2344
|
+
if (type === "gray") {
|
2345
|
+
return /* @__PURE__ */ jsx33(
|
2346
|
+
"svg",
|
2347
|
+
{
|
2348
|
+
width: "20",
|
2349
|
+
height: "20",
|
2350
|
+
viewBox: "0 0 20 20",
|
2351
|
+
fill: "none",
|
2352
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2353
|
+
children: /* @__PURE__ */ jsx33(
|
2354
|
+
"path",
|
2355
|
+
{
|
2356
|
+
d: "M10 0C4.49 0 0 4.49 0 10C0 15.51 4.49 20 10 20C15.51 20 20 15.51 20 10C20 4.49 15.51 0 10 0ZM14.78 7.7L9.11 13.37C8.97 13.51 8.78 13.59 8.58 13.59C8.38 13.59 8.19 13.51 8.05 13.37L5.22 10.54C4.93 10.25 4.93 9.77 5.22 9.48C5.51 9.19 5.99 9.19 6.28 9.48L8.58 11.78L13.72 6.64C14.01 6.35 14.49 6.35 14.78 6.64C15.07 6.93 15.07 7.4 14.78 7.7Z",
|
2357
|
+
fill: "#79818C"
|
2358
|
+
}
|
2359
|
+
)
|
2360
|
+
}
|
2361
|
+
);
|
2362
|
+
} else if (type === "info") {
|
2363
|
+
return /* @__PURE__ */ jsx33(
|
2364
|
+
"svg",
|
2365
|
+
{
|
2366
|
+
width: "24",
|
2367
|
+
height: "24",
|
2368
|
+
viewBox: "0 0 24 24",
|
2369
|
+
fill: "none",
|
2370
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2371
|
+
children: /* @__PURE__ */ jsx33(
|
2372
|
+
"path",
|
2373
|
+
{
|
2374
|
+
d: "M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z",
|
2375
|
+
fill: "#70B6F6"
|
2376
|
+
}
|
2377
|
+
)
|
2378
|
+
}
|
2379
|
+
);
|
2380
|
+
} else if (type === "warning") {
|
2381
|
+
return /* @__PURE__ */ jsx33(
|
2382
|
+
"svg",
|
2383
|
+
{
|
2384
|
+
width: "20",
|
2385
|
+
height: "20",
|
2386
|
+
viewBox: "0 0 20 20",
|
2387
|
+
fill: "none",
|
2388
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2389
|
+
children: /* @__PURE__ */ jsx33(
|
2390
|
+
"path",
|
2391
|
+
{
|
2392
|
+
d: "M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",
|
2393
|
+
fill: "#FFC700"
|
2394
|
+
}
|
2395
|
+
)
|
2396
|
+
}
|
2397
|
+
);
|
2398
|
+
} else if (type === "success") {
|
2399
|
+
return /* @__PURE__ */ jsx33(
|
2400
|
+
"svg",
|
2401
|
+
{
|
2402
|
+
width: "24",
|
2403
|
+
height: "24",
|
2404
|
+
viewBox: "0 0 24 24",
|
2405
|
+
fill: "none",
|
2406
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2407
|
+
children: /* @__PURE__ */ jsx33(
|
2408
|
+
"path",
|
2409
|
+
{
|
2410
|
+
d: "M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z",
|
2411
|
+
fill: "#00D488"
|
2412
|
+
}
|
2413
|
+
)
|
2414
|
+
}
|
2415
|
+
);
|
2416
|
+
} else {
|
2417
|
+
return /* @__PURE__ */ jsx33(
|
2418
|
+
"svg",
|
2419
|
+
{
|
2420
|
+
width: "20",
|
2421
|
+
height: "20",
|
2422
|
+
viewBox: "0 0 20 20",
|
2423
|
+
fill: "none",
|
2424
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2425
|
+
children: /* @__PURE__ */ jsx33(
|
2426
|
+
"path",
|
2427
|
+
{
|
2428
|
+
d: "M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",
|
2429
|
+
fill: "#F04248"
|
2430
|
+
}
|
2431
|
+
)
|
2432
|
+
}
|
2433
|
+
);
|
2434
|
+
}
|
2435
|
+
};
|
2436
|
+
var Banner = ({
|
2437
|
+
type = "info",
|
2438
|
+
title,
|
2439
|
+
description,
|
2440
|
+
open,
|
2441
|
+
showCloseButton,
|
2442
|
+
bottomNode,
|
2443
|
+
sideNode,
|
2444
|
+
onClose,
|
2445
|
+
showIcon = true
|
2446
|
+
}) => {
|
2447
|
+
const [isOpen, setIsOpen] = useState5(open);
|
2448
|
+
useEffect3(() => {
|
2449
|
+
setIsOpen(open);
|
2450
|
+
}, [open]);
|
2451
|
+
let bgColor = "";
|
2452
|
+
let stripeColor = "";
|
2453
|
+
switch (type) {
|
2454
|
+
case "gray":
|
2455
|
+
bgColor = "#eeeef0";
|
2456
|
+
stripeColor = "#79818c";
|
2457
|
+
break;
|
2458
|
+
case "info":
|
2459
|
+
bgColor = "#ebf5fd";
|
2460
|
+
stripeColor = "#70B6F6";
|
2461
|
+
break;
|
2462
|
+
case "warning":
|
2463
|
+
bgColor = "#fff8df";
|
2464
|
+
stripeColor = "#ffc700";
|
2465
|
+
break;
|
2466
|
+
case "success":
|
2467
|
+
bgColor = "#e0f9f0";
|
2468
|
+
stripeColor = "#49e0aa";
|
2469
|
+
break;
|
2470
|
+
case "danger":
|
2471
|
+
bgColor = "#fde8e9";
|
2472
|
+
stripeColor = "#f3777c";
|
2473
|
+
break;
|
2474
|
+
default:
|
2475
|
+
bgColor = "#eeeef0";
|
2476
|
+
stripeColor = "#79818c";
|
2477
|
+
break;
|
2478
|
+
}
|
2479
|
+
function handleClose() {
|
2480
|
+
setIsOpen(false);
|
2481
|
+
if (onClose) {
|
2482
|
+
onClose();
|
2483
|
+
}
|
2484
|
+
}
|
2485
|
+
if (!isOpen) {
|
2486
|
+
return null;
|
2487
|
+
}
|
2488
|
+
return /* @__PURE__ */ jsxs24(
|
2489
|
+
"div",
|
2490
|
+
{
|
2491
|
+
className: "w-full shadow-lg transform flex items-center rounded-md",
|
2492
|
+
style: {
|
2493
|
+
background: bgColor || "#ebf5fd"
|
2494
|
+
},
|
2495
|
+
children: [
|
2496
|
+
/* @__PURE__ */ jsx33(
|
2497
|
+
"div",
|
2498
|
+
{
|
2499
|
+
className: "flex-none absolute rounded-l-[4px] rounded-l-4px w-[4px] h-full",
|
2500
|
+
style: {
|
2501
|
+
background: stripeColor || "#70B6F6"
|
2502
|
+
}
|
2503
|
+
}
|
2504
|
+
),
|
2505
|
+
/* @__PURE__ */ jsxs24("div", { className: "w-full gap-3 h-full flex flex-row justify-between px-4 md:px-5 py-4 md:py-5", children: [
|
2506
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-row gap-2.5 items-start w-full h-full", children: [
|
2507
|
+
showIcon && /* @__PURE__ */ jsx33("div", { className: "h-full flex justify-end", children: /* @__PURE__ */ jsx33(Icon, { type }) }),
|
2508
|
+
/* @__PURE__ */ jsxs24("div", { className: "w-full gap-3 h-full flex flex-col md:flex-row items-start justify-between", children: [
|
2509
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex-1 gap-3 h-full flex flex-col items-start justify-between", children: [
|
2510
|
+
(title || description) && /* @__PURE__ */ jsxs24("div", { children: [
|
2511
|
+
title && /* @__PURE__ */ jsx33("div", { className: "text-sm font-bold text-[#191919]", children: title }),
|
2512
|
+
description && /* @__PURE__ */ jsx33("div", { className: "text-sm font-normal text-[#5D5D5D] mt-1", children: description })
|
2513
|
+
] }),
|
2514
|
+
bottomNode
|
2515
|
+
] }),
|
2516
|
+
sideNode
|
2517
|
+
] })
|
2518
|
+
] }),
|
2519
|
+
showCloseButton && /* @__PURE__ */ jsx33("div", { className: "w-1/10 h-full flex flex-col justify-start items-center", children: /* @__PURE__ */ jsx33("button", { onClick: handleClose, children: /* @__PURE__ */ jsxs24(
|
2520
|
+
"svg",
|
2521
|
+
{
|
2522
|
+
width: "16",
|
2523
|
+
height: "16",
|
2524
|
+
viewBox: "0 0 16 16",
|
2525
|
+
fill: "none",
|
2526
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2527
|
+
children: [
|
2528
|
+
/* @__PURE__ */ jsx33(
|
2529
|
+
"path",
|
2530
|
+
{
|
2531
|
+
d: "M3.3335 3.33337L12.6662 12.6661",
|
2532
|
+
stroke: "#191919",
|
2533
|
+
strokeWidth: "1.5",
|
2534
|
+
strokeLinecap: "round",
|
2535
|
+
strokeLinejoin: "round"
|
2536
|
+
}
|
2537
|
+
),
|
2538
|
+
/* @__PURE__ */ jsx33(
|
2539
|
+
"path",
|
2540
|
+
{
|
2541
|
+
d: "M3.33429 12.6661L12.667 3.33337",
|
2542
|
+
stroke: "#191919",
|
2543
|
+
strokeWidth: "1.5",
|
2544
|
+
strokeLinecap: "round",
|
2545
|
+
strokeLinejoin: "round"
|
2546
|
+
}
|
2547
|
+
)
|
2548
|
+
]
|
2549
|
+
}
|
2550
|
+
) }) })
|
2551
|
+
] })
|
2552
|
+
]
|
2553
|
+
}
|
2554
|
+
);
|
2555
|
+
};
|
2556
|
+
|
2557
|
+
// src/actions/amount.action.ts
|
2558
|
+
var CurrencySymbolMap = {
|
2559
|
+
USD: "$",
|
2560
|
+
CAD: "CA$",
|
2561
|
+
EUR: "\u20AC",
|
2562
|
+
AED: "AED",
|
2563
|
+
AFN: "Af",
|
2564
|
+
ALL: "ALL",
|
2565
|
+
AMD: "AMD",
|
2566
|
+
ARS: "AR$",
|
2567
|
+
AUD: "AU$",
|
2568
|
+
AZN: "man.",
|
2569
|
+
BAM: "KM",
|
2570
|
+
BDT: "Tk",
|
2571
|
+
BGN: "BGN",
|
2572
|
+
BHD: "BD",
|
2573
|
+
BIF: "FBu",
|
2574
|
+
BND: "BN$",
|
2575
|
+
BOB: "Bs",
|
2576
|
+
BRL: "R$",
|
2577
|
+
BWP: "BWP",
|
2578
|
+
BYN: "Br",
|
2579
|
+
BZD: "BZ$",
|
2580
|
+
CDF: "CDF",
|
2581
|
+
CHF: "CHF",
|
2582
|
+
CLP: "CL$",
|
2583
|
+
CNY: "CN\xA5",
|
2584
|
+
COP: "CO$",
|
2585
|
+
CRC: "\u20A1",
|
2586
|
+
CVE: "CV$",
|
2587
|
+
CZK: "K\u010D",
|
2588
|
+
DJF: "Fdj",
|
2589
|
+
DKK: "Dkr",
|
2590
|
+
DOP: "RD$",
|
2591
|
+
DZD: "DA",
|
2592
|
+
EEK: "Ekr",
|
2593
|
+
EGP: "EGP",
|
2594
|
+
ERN: "Nfk",
|
2595
|
+
ETB: "Br",
|
2596
|
+
GBP: "\xA3",
|
2597
|
+
GEL: "GEL",
|
2598
|
+
GHS: "GH\u20B5",
|
2599
|
+
GNF: "FG",
|
2600
|
+
GTQ: "GTQ",
|
2601
|
+
HKD: "HK$",
|
2602
|
+
HNL: "HNL",
|
2603
|
+
HRK: "kn",
|
2604
|
+
HUF: "Ft",
|
2605
|
+
IDR: "Rp",
|
2606
|
+
ILS: "\u20AA",
|
2607
|
+
INR: "\u20B9",
|
2608
|
+
IQD: "IQD",
|
2609
|
+
IRR: "IRR",
|
2610
|
+
ISK: "Ikr",
|
2611
|
+
JMD: "J$",
|
2612
|
+
JOD: "JD",
|
2613
|
+
JPY: "\xA5",
|
2614
|
+
KES: "Ksh",
|
2615
|
+
KHR: "KHR",
|
2616
|
+
KMF: "CF",
|
2617
|
+
KRW: "\u20A9",
|
2618
|
+
KWD: "KD",
|
2619
|
+
KZT: "KZT",
|
2620
|
+
LBP: "L.L.",
|
2621
|
+
LKR: "SLRs",
|
2622
|
+
LTL: "Lt",
|
2623
|
+
LVL: "Ls",
|
2624
|
+
LYD: "LD",
|
2625
|
+
MAD: "MAD",
|
2626
|
+
MDL: "MDL",
|
2627
|
+
MGA: "MGA",
|
2628
|
+
MKD: "MKD",
|
2629
|
+
MMK: "MMK",
|
2630
|
+
MOP: "MOP$",
|
2631
|
+
MUR: "MURs",
|
2632
|
+
MXN: "MX$",
|
2633
|
+
MYR: "RM",
|
2634
|
+
MZN: "MTn",
|
2635
|
+
NAD: "N$",
|
2636
|
+
NGN: "\u20A6",
|
2637
|
+
NIO: "C$",
|
2638
|
+
NOK: "Nkr",
|
2639
|
+
NPR: "NPRs",
|
2640
|
+
NZD: "NZ$",
|
2641
|
+
OMR: "OMR",
|
2642
|
+
PAB: "B/.",
|
2643
|
+
PEN: "S/.",
|
2644
|
+
PHP: "\u20B1",
|
2645
|
+
PKR: "PKRs",
|
2646
|
+
PLN: "z\u0142",
|
2647
|
+
PYG: "\u20B2",
|
2648
|
+
QAR: "QR",
|
2649
|
+
RON: "RON",
|
2650
|
+
RSD: "din.",
|
2651
|
+
RUB: "RUB",
|
2652
|
+
RWF: "RWF",
|
2653
|
+
SAR: "SR",
|
2654
|
+
SDG: "SDG",
|
2655
|
+
SEK: "Skr",
|
2656
|
+
SGD: "S$",
|
2657
|
+
SOS: "Ssh",
|
2658
|
+
SYP: "SY\xA3",
|
2659
|
+
THB: "\u0E3F",
|
2660
|
+
TND: "DT",
|
2661
|
+
TOP: "T$",
|
2662
|
+
TRY: "TL",
|
2663
|
+
TTD: "TT$",
|
2664
|
+
TWD: "NT$",
|
2665
|
+
TZS: "TSh",
|
2666
|
+
UAH: "\u20B4",
|
2667
|
+
UGX: "USh",
|
2668
|
+
UYU: "$U",
|
2669
|
+
UZS: "UZS",
|
2670
|
+
VEF: "Bs.F.",
|
2671
|
+
VND: "\u20AB",
|
2672
|
+
XAF: "F CFA",
|
2673
|
+
XOF: "CFA",
|
2674
|
+
YER: "YR",
|
2675
|
+
ZAR: "R",
|
2676
|
+
ZMK: "ZK",
|
2677
|
+
ZWL: "ZWL$"
|
2678
|
+
};
|
2679
|
+
var _AmountAction = class _AmountAction {
|
2680
|
+
static getCurrencyLocaleMap(currency) {
|
2681
|
+
const localeMap = {
|
2682
|
+
XOF: "fr",
|
2683
|
+
XAF: "fr"
|
2684
|
+
};
|
2685
|
+
return localeMap[currency] || "en";
|
2686
|
+
}
|
2687
|
+
static koboToNaira(amount) {
|
2688
|
+
return +amount / 100;
|
2689
|
+
}
|
2690
|
+
static nairaToKobo(amount) {
|
2691
|
+
return +amount * 100;
|
2692
|
+
}
|
2693
|
+
static getCurrencySymbol(currency) {
|
2694
|
+
return CurrencySymbolMap[currency] || currency;
|
2695
|
+
}
|
2696
|
+
};
|
2697
|
+
__publicField(_AmountAction, "formatAmountAndCurrency", (currency, value, options) => {
|
2698
|
+
const formatted = new Intl.NumberFormat(
|
2699
|
+
options?.locale || _AmountAction.getCurrencyLocaleMap(currency),
|
2700
|
+
{
|
2701
|
+
maximumFractionDigits: 3,
|
2702
|
+
style: "currency",
|
2703
|
+
currency,
|
2704
|
+
currencyDisplay: "symbol"
|
2705
|
+
}
|
2706
|
+
).format(
|
2707
|
+
options?.convertToMajorCurrency ? _AmountAction.koboToNaira(Number(value)) : Number(value)
|
2708
|
+
).replace(/^(\D+)/, "$1 ").replace("\u202F", " ").replace(/\s+/, "");
|
2709
|
+
const customSymbol = CurrencySymbolMap[currency] || currency;
|
2710
|
+
return formatted.replace(currency, customSymbol);
|
2711
|
+
});
|
2712
|
+
var AmountAction = _AmountAction;
|
2713
|
+
|
2714
|
+
// src/actions/date.action.ts
|
2715
|
+
import * as dayjs from "dayjs";
|
2716
|
+
var DateAction = class {
|
2717
|
+
static getDateLibrary() {
|
2718
|
+
return dayjs();
|
2719
|
+
}
|
2720
|
+
static formatTimestampToDate(timestamp, dateFormat) {
|
2721
|
+
return dayjs.unix(timestamp).format(dateFormat || "ddd, MMM, YYYY | HH:mm:ss");
|
2722
|
+
}
|
2723
|
+
static formatDateToTimestamp(date) {
|
2724
|
+
return dayjs(date).unix();
|
2725
|
+
}
|
2726
|
+
};
|
2727
|
+
export {
|
2728
|
+
AmountAction,
|
2729
|
+
Banner,
|
2730
|
+
Button,
|
2731
|
+
CopyableLabel,
|
2732
|
+
Country,
|
2733
|
+
CurrencySymbolMap,
|
2734
|
+
DateAction,
|
2735
|
+
DebouncedInput,
|
2736
|
+
DevBanner,
|
2737
|
+
Dialog2 as Dialog,
|
2738
|
+
FlagComponent,
|
2739
|
+
FormLabel,
|
2740
|
+
Input,
|
2741
|
+
Loader,
|
2742
|
+
OTPInput,
|
2743
|
+
PasswordInput,
|
2744
|
+
PhoneInput,
|
2745
|
+
Popover,
|
2746
|
+
PopoverContent,
|
2747
|
+
PopoverRoot,
|
2748
|
+
PopoverTrigger,
|
2749
|
+
Select,
|
2750
|
+
Status,
|
2751
|
+
Table,
|
2752
|
+
Textarea,
|
2753
|
+
buttonVariants,
|
2754
|
+
cn
|
2755
|
+
};
|