@6thbridge/hexa 0.0.43 → 0.0.44
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/.turbo/turbo-lint.log +1 -1
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +3189 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3126 -2
- package/dist/index.mjs.map +1 -1
- package/dist/output.css +257 -0
- package/package.json +7 -5
package/dist/index.js
CHANGED
@@ -1,2 +1,3189 @@
|
|
1
|
-
"use strict";var gr=Object.create;var ie=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var Cr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty;var vr=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xr=(e,t)=>{for(var r in t)ie(e,r,{get:t[r],enumerable:!0})},lt=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Cr(t))!hr.call(e,o)&&o!==r&&ie(e,o,{get:()=>t[o],enumerable:!(a=yr(t,o))||a.enumerable});return e};var v=(e,t,r)=>(r=e!=null?gr(br(e)):{},lt(t||!e||!e.__esModule?ie(r,"default",{value:e,enumerable:!0}):r,e)),Nr=e=>lt(ie({},"__esModule",{value:!0}),e);var dt=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);var Gr={};xr(Gr,{AmountAction:()=>it,Banner:()=>lr,Button:()=>q,CopyableLabel:()=>qt,Country:()=>_t,CurrencySymbolMap:()=>nt,DateAction:()=>st,DebouncedInput:()=>Ae,DevBanner:()=>sr,Dialog:()=>Fe,FlagComponent:()=>K,FormLabel:()=>L,Input:()=>Z,Loader:()=>ae,LocaleSelector:()=>fr,OTPInput:()=>jt,PasswordInput:()=>Xe,PhoneInput:()=>qe,Popover:()=>xe,PopoverContent:()=>H,PopoverRoot:()=>z,PopoverTrigger:()=>O,Select:()=>$t,Status:()=>tr,Table:()=>nr,Textarea:()=>Ye,buttonVariants:()=>de,cn:()=>n});module.exports=Nr(Gr);var gt=v(require("react"));var mt=v(require("react")),ze=v(require("@radix-ui/react-label")),ut=require("class-variance-authority");var ct=require("clsx"),pt=require("tailwind-merge");function n(...e){return(0,pt.twMerge)((0,ct.clsx)(e))}var ft=require("react/jsx-runtime"),wr=(0,ut.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ke=mt.forwardRef(({className:e,...t},r)=>(0,ft.jsx)(ze.Root,{ref:r,className:n(wr(),e),...t}));Ke.displayName=ze.Root.displayName;var se=require("react/jsx-runtime"),L=gt.default.forwardRef(({className:e,children:t,showAsterisk:r,error:a,...o},i)=>(0,se.jsx)(Ke,{ref:i,className:n(a&&"text-red-500",e),...o,children:r?(0,se.jsxs)("p",{children:[t,(0,se.jsx)("span",{className:"text-red-500",children:"*"})]}):t}));L.displayName="FormLabel";var le=require("react/jsx-runtime"),ae=({size:e=16,colour:t="primary"})=>(0,le.jsxs)("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("circle",{cx:"10",cy:"10",r:"9.25",stroke:"transparent",strokeWidth:"1.5"}),(0,le.jsx)("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:t==="primary"?"#ffffff":"currentColor",className:"rounded"})]});var Le=v(require("react")),yt=require("@radix-ui/react-slot"),Ct=require("class-variance-authority");var I=require("react/jsx-runtime"),de=(0,Ct.cva)("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:"py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg","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"}}),q=Le.forwardRef(({className:e,variant:t="primary",size:r,asChild:a=!1,isLoading:o=!1,leftNode:i,rightNode:l,LoaderSize:s,...c},d)=>{let m=a?yt.Slot:"button",{children:u,disabled:p,...h}=c,k=Le.useRef(null);return(0,I.jsx)(m,{className:n(de({variant:t,size:r,className:e})),ref:k||d,disabled:p||o,...h,children:(0,I.jsx)("div",{className:"flex font-medium justify-center items-center gap-2",children:o?(0,I.jsx)(I.Fragment,{children:(0,I.jsx)("span",{className:"mx-auto",children:(0,I.jsx)(ae,{size:s,colour:"secondary"})})}):(0,I.jsxs)(I.Fragment,{children:[i,u,l]})})})});q.displayName="Button";var _e=v(require("react"));var Se=require("class-variance-authority");var bt=v(require("react")),ht=require("react/jsx-runtime"),M=bt.default.forwardRef(({className:e,children:t,error:r,...a},o)=>{let i=r??t;return i?(0,ht.jsx)("p",{ref:o,className:n("text-xs font-normal text-[#F04248]",e),...a,children:i}):null});M.displayName="ErrorMessage";var vt=v(require("react")),xt=require("react/jsx-runtime"),A=vt.default.forwardRef(({className:e,...t},r)=>(0,xt.jsx)("div",{ref:r,className:n("text-sm text-[#8E98A8",e),...t}));A.displayName="FormDescription";var V=require("react/jsx-runtime"),Pr=(0,Se.cva)("!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"}}),wt=_e.forwardRef(({className:e,status:t,type:r,...a},o)=>(0,V.jsx)("input",{type:r,className:n(Pr({status:t}),e),ref:o,...a}));wt.displayName="BaseInnerInput";var W=(0,Se.cva)("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"}}),Nt=(0,Se.cva)("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"}}),Z=_e.forwardRef(({className:e,status:t="default",disabled:r,error:a,isLoading:o,sideNodeClassName:i,showAsterisk:l,label:s,description:c,...d},m)=>{let u=t;return a&&(u="error"),o&&(u="loading"),r&&(u="prefilled"),(0,V.jsxs)("div",{className:"relative space-y-1 w-full",children:[s&&(0,V.jsx)(L,{showAsterisk:l,error:a,children:s}),(0,V.jsxs)("div",{className:n(W({status:u}),d.leftNode?"pl-0":"",d.rightNode?"pr-0":"",e),children:[d.leftNode?(0,V.jsx)("div",{className:n(Nt({status:u,side:"left"}),i),children:d.leftNode}):null,(0,V.jsx)(wt,{ref:m,disabled:o||r,className:n({"!pl-3":d.leftNode&&t!=="neutral","!pr-3":d.rightNode&&t!=="neutral"}),...d}),d.rightNode?(0,V.jsx)("div",{className:n(Nt({status:u,side:"right"}),i),children:d.rightNode}):null]}),c&&(0,V.jsx)(A,{className:"text-gray-400 text-sm !font-normal",children:c}),(0,V.jsx)(M,{error:a})]})});Z.displayName="Input";var me=require("react");var ce=require("react/jsx-runtime"),Pt=()=>(0,ce.jsxs)("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ce.jsx)("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"}),(0,ce.jsx)("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"})]});var pe=require("react/jsx-runtime"),Rt=()=>(0,pe.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,pe.jsx)("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"}),(0,pe.jsx)("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"})]});var $e=require("react/jsx-runtime"),Dt=()=>(0,$e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,$e.jsx)("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"})});var Ue=require("react/jsx-runtime"),kt=()=>(0,Ue.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ue.jsx)("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"})});var S=require("react/jsx-runtime"),Lt=[{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}],Xe=({onValidate:e,onChange:t,disableValidation:r,...a})=>{let[o,i]=(0,me.useState)(!1),[l,s]=(0,me.useState)(Lt),c=p=>Lt.map(h=>({...h,validated:h.RegExp.test(p)})),d=p=>{let h=c(p),k=h.every(E=>E.validated);return s(h),k},m=p=>{if(t&&t(p),r)return;let h=p?.target?.value,k=d(h);e&&e(k,h)},u=(0,me.useMemo)(()=>(0,S.jsx)("div",{className:"flex items-center gap-2",children:l?.map(p=>(0,S.jsxs)("div",{className:n("text-xs flex items-center gap-0.5",{"text-[#62C554]":p?.validated,"text-[#8E98A8]":!p?.validated}),children:[(0,S.jsx)("span",{className:"",children:p?.validated?(0,S.jsx)(Dt,{}):(0,S.jsx)(kt,{})}),(0,S.jsx)("span",{className:"",children:p?.label})]},p?.key))}),[l]);return(0,S.jsx)(Z,{sideNodeClassName:"!border-l-0",rightNode:o?(0,S.jsx)("button",{type:"button",onClick:()=>i(p=>!p),children:(0,S.jsx)(Pt,{})}):(0,S.jsx)("button",{type:"button",onClick:()=>i(p=>!p),children:(0,S.jsx)(Rt,{})}),type:o?"text":"password",onChange:m,description:!r&&u,...a})};Xe.displayName="PasswordInput";var St=require("class-variance-authority");var ee=require("react/jsx-runtime"),Po=(0,St.cva)("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"}}),Ye=({className:e,status:t="default",disabled:r,error:a,isLoading:o,showAsterisk:i,label:l,description:s,...c})=>{let d=t;return a&&(d="error"),o&&(d="loading"),r&&(d="prefilled"),(0,ee.jsxs)("div",{className:"relative space-y-1",children:[(0,ee.jsx)(L,{showAsterisk:i,error:a,children:l}),(0,ee.jsx)("textarea",{className:n("min-h-[80px]",W({status:d}),e),disabled:o||r,...c}),(0,ee.jsx)(A,{className:"text-gray-400 text-sm !font-normal",children:s}),(0,ee.jsx)(M,{error:a})]})};Ye.displayName="Textarea";var te=v(require("react"));var $=v(require("react")),R=require("cmdk"),Bt=require("lucide-react");var fe=v(require("react")),b=v(require("@radix-ui/react-dialog"));var ue=require("react/jsx-runtime"),Ft=()=>(0,ue.jsxs)("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:[(0,ue.jsx)("path",{d:"M18 6 6 18"}),(0,ue.jsx)("path",{d:"m6 6 12 12"})]});var C=require("react/jsx-runtime"),Rr=b.Root,Dr=b.Trigger,Tt=b.Portal,Et=fe.forwardRef(({className:e,...t},r)=>(0,C.jsx)(b.Overlay,{ref:r,className:n("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",e),...t}));Et.displayName=b.Overlay.displayName;var je=fe.forwardRef(({className:e,hideCloseButton:t,children:r,...a},o)=>(0,C.jsxs)(Tt,{children:[(0,C.jsx)(Et,{}),(0,C.jsxs)(b.Content,{ref:o,className:n("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",e),...a,children:[r,!t&&(0,C.jsxs)(b.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:[(0,C.jsx)(Ft,{}),(0,C.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));je.displayName=b.Content.displayName;var It=({className:e,...t})=>(0,C.jsx)("div",{className:n("flex flex-col space-y-1.5 text-left",e),...t});It.displayName="DialogHeader";var Mt=({className:e,...t})=>(0,C.jsx)("div",{className:n("flex flex-row justify-end sm:space-x-2",e),...t});Mt.displayName="DialogFooter";var At=fe.forwardRef(({className:e,...t},r)=>(0,C.jsx)(b.Title,{ref:r,className:n("text-xl font-semibold leading-none tracking-tight",e),...t}));At.displayName=b.Title.displayName;var Vt=fe.forwardRef(({className:e,...t},r)=>(0,C.jsx)(b.Description,{ref:r,className:n("text-sm text-gray-500",e),...t}));Vt.displayName=b.Description.displayName;var Fe=({trigger:e=void 0,children:t,open:r,onOpenChange:a,hideCloseButton:o,footer:i,title:l,description:s,contentClassName:c,headerClassName:d,titleClassName:m,descriptionClassName:u,footerClassName:p,asChild:h=!0,onOpenAutoFocus:k,onCloseAutoFocus:E,onEscapeKeyDown:ke,onInteractOutside:re,onPointerDownOutside:We,...Ze})=>(0,C.jsxs)(Rr,{...Ze,open:r,onOpenChange:a,children:[(0,C.jsx)(Dr,{asChild:h,children:e}),(0,C.jsx)(Tt,{children:(0,C.jsxs)(je,{className:c,hideCloseButton:o,onOpenAutoFocus:k,onCloseAutoFocus:E,onEscapeKeyDown:ke,onPointerDownOutside:We,onInteractOutside:re,children:[l||s?(0,C.jsxs)(It,{className:d,children:[l&&(0,C.jsx)(At,{className:m,children:l}),s&&(0,C.jsx)(Vt,{className:u,children:s})]}):(0,C.jsx)(C.Fragment,{}),t,i&&(0,C.jsx)(Mt,{className:p,children:i})]})})]});Fe.displayName=b.Dialog.displayName;var D=require("react/jsx-runtime"),ge=$.forwardRef(({className:e,...t},r)=>(0,D.jsx)(R.Command,{ref:r,className:n("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));ge.displayName=R.Command.displayName;var ye=$.forwardRef(({className:e,CommandInputContainerClassName:t,loading:r,...a},o)=>(0,D.jsxs)("div",{className:n("flex items-center border-0 px-3 gap-2",t),"cmdk-input-wrapper":"",children:[r?(0,D.jsx)(ae,{size:16,colour:"secondary"}):(0,D.jsx)(Bt.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,D.jsx)(R.Command.Input,{ref:o,className:n("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",e),disabled:r,...a})]}));ye.displayName=R.Command.Input.displayName;var Ce=$.forwardRef(({className:e,...t},r)=>(0,D.jsx)(R.Command.List,{ref:r,className:n("overflow-y-auto overflow-x-hidden",e),...t}));Ce.displayName=R.Command.List.displayName;var be=$.forwardRef((e,t)=>(0,D.jsx)(R.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));be.displayName=R.Command.Empty.displayName;var he=$.forwardRef(({className:e,...t},r)=>(0,D.jsx)(R.Command.Group,{ref:r,className:n("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",e),...t}));he.displayName=R.Command.Group.displayName;var kr=$.forwardRef(({className:e,...t},r)=>(0,D.jsx)(R.Command.Separator,{ref:r,className:n("-mx-1 h-px bg-border",e),...t}));kr.displayName=R.Command.Separator.displayName;var ve=$.forwardRef(({className:e,...t},r)=>(0,D.jsx)(R.Command.Item,{ref:r,className:n("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",e),...t}));ve.displayName=R.Command.Item.displayName;var Lr=({className:e,...t})=>(0,D.jsx)("span",{className:n("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Lr.displayName="CommandShortcut";var Ot=v(require("react")),B=v(require("@radix-ui/react-popover"));var U=require("react/jsx-runtime"),z=B.Root,O=B.Trigger,H=Ot.forwardRef(({className:e,align:t="center",sideOffset:r=4,portal:a=!0,...o},i)=>a?(0,U.jsx)(B.Portal,{children:(0,U.jsx)(B.Content,{ref:i,align:t,sideOffset:r,className:n("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",e),onOpenAutoFocus:o.onOpenAutoFocus,onCloseAutoFocus:o.onCloseAutoFocus,...o})}):(0,U.jsx)(B.Content,{ref:i,align:t,sideOffset:r,className:n("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",e),onOpenAutoFocus:o.onOpenAutoFocus,onCloseAutoFocus:o.onCloseAutoFocus,...o}));H.displayName=B.Content.displayName;var xe=({trigger:e,children:t,open:r,onOpenChange:a,contentClassName:o,asChild:i=!0,align:l,side:s,alignOffset:c,triggerClassName:d,sideOffset:m,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:h=!0,...k})=>(0,U.jsxs)(z,{...k,open:r,onOpenChange:a,children:[(0,U.jsx)(O,{asChild:i,className:d,children:e}),(0,U.jsx)(H,{alignOffset:c,sideOffset:m,side:s,align:l,className:o,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:h,children:t})]});xe.displayName=B.Root.displayName;var Je=v(require("react")),F=v(require("@radix-ui/react-scroll-area"));var X=require("react/jsx-runtime"),Ne=Je.forwardRef(({className:e,viewPortClassName:t,children:r,...a},o)=>(0,X.jsxs)(F.Root,{ref:o,className:n("relative overflow-hidden",e),...a,children:[(0,X.jsx)(F.Viewport,{className:n("h-full w-full rounded-[inherit]",t),children:r}),(0,X.jsx)(Gt,{}),(0,X.jsx)(F.Corner,{})]}));Ne.displayName=F.Root.displayName;var Gt=Je.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,X.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:n("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,X.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]"})}));Gt.displayName=F.ScrollAreaScrollbar.displayName;var P=require("react/jsx-runtime"),Ht=({className:e,value:t,placeholder:r="",status:a,disabled:o})=>(0,P.jsx)(O,{asChild:!0,disabled:o,children:(0,P.jsxs)("button",{disabled:o,className:n(W({status:a}),"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",t?"":"text-[#79818C]",e),children:[t??r??"Select options...",(0,P.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:(0,P.jsx)("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"})})]})}),Te=({options:e=[],value:t,onChange:r,containerClassName:a,placeholder:o,disabled:i,loading:l,optionComponent:s,children:c,modal:d=!1,hideSearch:m,className:u,inputValue:p,onValueChange:h,onInputValueChange:k})=>{let[E,ke]=te.useState(!1),re=te.useRef(null),[We,Ze]=te.useState(void 0);return te.useLayoutEffect(()=>{re.current&&Ze(re.current.clientWidth)},[re.current]),(0,P.jsxs)(z,{modal:d,open:E,onOpenChange:ke,children:[(0,P.jsx)("div",{className:n("w-full",u),ref:re,children:c}),(0,P.jsx)(H,{portal:!d,className:"p-0 min-w-[200px]",style:{width:We},children:(0,P.jsxs)(ge,{className:n("relative max-h-[270px]",{"mt-2":!m}),children:[!m&&(0,P.jsx)(ye,{loading:l,placeholder:o??"Search options...",onValueChange:k,value:p,CommandInputContainerClassName:"mx-2 border rounded-md border-[#DEDEDE]"}),(0,P.jsx)(Ne,{viewPortClassName:"max-h-[225px]",className:n("w-full px-0 h-full overflow-y-auto",a),children:(0,P.jsxs)(Ce,{children:[!m&&(0,P.jsx)(be,{children:"No result found."}),(0,P.jsx)(he,{className:"w-full",children:e?.map(oe=>(0,P.jsx)(ve,{defaultValue:t?.label,value:oe.label,disabled:i,onSelect:()=>{r(oe),ke(!1),h?.(oe?.value)},children:s?s(oe):oe.label},oe.value))})]})})]})})]})};var Qe=[{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"}],Wt=()=>{let e={};return Qe?.forEach(t=>{e[t?.internetCountryCode]=t?.countryName}),e};var we=v(require("react")),Ee=v(require("react-phone-number-input")),zt=v(require("react-phone-number-input/flags"));var Y=require("react/jsx-runtime"),Sr=e=>(0,Y.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"none",...e,children:[(0,Y.jsx)("rect",{width:"32",height:"32",fill:"#60A5FA"})," ",(0,Y.jsx)("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"}),(0,Y.jsx)("rect",{x:"2",y:"28",width:"28",height:"3",fill:"#D1D5DB"}),(0,Y.jsx)("path",{d:"M0 16H32M8 0V32M16 0V32M24 0V32",stroke:"#2563EB",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),(0,Y.jsx)("path",{d:"M0 16H32",stroke:"#2563EB",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]}),Zt=Sr;var f=require("react/jsx-runtime"),qe=we.forwardRef(({className:e,onChange:t,defaultCountry:r="NG",modal:a,showAsterisk:o,label:i,description:l,error:s,...c},d)=>{let m=u=>(0,f.jsx)(Fr,{...u,status:c.status,modal:a});return(0,f.jsxs)("div",{className:"relative space-y-1",children:[(0,f.jsx)(L,{showAsterisk:o,error:s,children:i}),(0,f.jsx)(Ee.default,{ref:d,className:n("flex",e),flagComponent:K,countrySelectComponent:m,inputComponent:Kt,defaultCountry:r,onChange:u=>{t&&t?.(u)},...c}),(0,f.jsx)(A,{className:"text-gray-400 text-sm !font-normal",children:l}),(0,f.jsx)(M,{error:s})]})});qe.displayName="PhoneInput";var Kt=we.forwardRef(({className:e,...t},r)=>(0,f.jsx)(Z,{className:n("!rounded-s-none h-10",e),...t,ref:r}));Kt.displayName="InputComponent";var Fr=({disabled:e,value:t,onChange:r,options:a,status:o,modal:i})=>{let l=we.useCallback(s=>{r(s)},[r]);return(0,f.jsxs)(z,{modal:i,children:[(0,f.jsx)(O,{disabled:e,children:(0,f.jsxs)("div",{className:n(W({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:[(0,f.jsx)(K,{country:t,countryName:t}),(0,f.jsx)("svg",{className:n("mr-0.5 h-4 w-4 opacity-50",e?"hidden":"opacity-100"),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,f.jsx)("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"})})]})}),(0,f.jsx)(H,{portal:!i,className:"w-[200px] md:w-[300px] p-0",children:(0,f.jsx)(ge,{children:(0,f.jsx)(Ce,{children:(0,f.jsxs)(Ne,{className:"h-72",children:[(0,f.jsx)(ye,{placeholder:"Search country..."}),(0,f.jsx)(be,{children:"No country found."}),(0,f.jsx)(he,{children:a.filter(s=>s.value).map(s=>(0,f.jsxs)(ve,{className:"gap-2",onSelect:()=>l(s.value),children:[(0,f.jsx)(K,{country:s.value,countryName:s.label}),(0,f.jsx)("span",{className:"flex-1 text-sm",children:s.label}),s.value&&(0,f.jsx)("span",{className:"text-[#191919]/50 text-sm dark:text-white",children:`+${Ee.getCountryCallingCode(s.value)}`}),(0,f.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:n("ml-auto",s.value===t?"opacity-100":"opacity-0"),children:(0,f.jsx)("path",{d:"M4 8.00008L6.66353 10.6636L12 5.33655",stroke:"#959595",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${s.value}-${s.label}`))})]})})})})]})},K=({country:e,countryName:t,className:r})=>{let a=zt.default[e];return e==="GLOBAL"?(0,f.jsx)("span",{className:n("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:(0,f.jsx)(Zt,{className:"w-full h-[90%]"})}):(0,f.jsx)("span",{className:n("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:a&&(0,f.jsx)(a,{title:t})})};K.displayName="FlagComponent";var x=require("react/jsx-runtime"),Tr=Wt(),Er=({className:e,value:t,placeholder:r="",status:a,disabled:o})=>(0,x.jsx)(O,{asChild:!0,disabled:o,children:(0,x.jsxs)("button",{disabled:o,className:n(W({status:a}),"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",t?"":"text-[#79818C]",e),children:[t?(0,x.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,x.jsx)(K,{country:t,countryName:t,className:"ml-1 !w-6 h-5"}),(0,x.jsxs)("span",{className:"",children:[" ",Tr[t]]})]}):r??"Select options...",(0,x.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:(0,x.jsx)("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"})})]})}),_t=({hideSearch:e=!0,showAsterisk:t,label:r,description:a,error:o,...i})=>{let l=Qe?.map(s=>({value:s?.internetCountryCode,label:s?.countryName,...s}));return(0,x.jsxs)("div",{className:"relative space-y-1",children:[(0,x.jsx)(L,{showAsterisk:t,error:o,children:r}),(0,x.jsx)(Te,{options:l,hideSearch:e,optionComponent:s=>(0,x.jsxs)("div",{className:"w-full flex items-center gap-2",children:[(0,x.jsx)(K,{country:s?.internetCountryCode,countryName:s?.label,className:"ml-2 !w-6 !h-5"}),(0,x.jsx)("span",{className:"flex-1 text-sm",children:s?.label})]}),...i,children:(0,x.jsx)(Er,{value:i?.value?.value,status:i?.status,placeholder:i?.placeholder??" Select Country"})}),(0,x.jsx)(A,{className:"text-gray-400 text-sm !font-normal",children:a}),(0,x.jsx)(M,{error:o})]})};var j=require("react/jsx-runtime"),$t=({showAsterisk:e,label:t,description:r,error:a,hideSearch:o=!0,status:i,...l})=>(0,j.jsxs)("div",{className:"relative space-y-1",children:[(0,j.jsx)(L,{showAsterisk:e,error:a,children:t}),(0,j.jsx)(Te,{hideSearch:o,...l,containerClassName:"h-full",children:(0,j.jsx)(Ht,{disabled:l?.disabled,placeholder:"Select or search email",status:i,value:l?.value?.label??l?.value?.value})}),(0,j.jsx)(A,{className:"text-gray-400 text-sm !font-normal",children:r}),(0,j.jsx)(M,{error:a})]});var Ut=v(require("react-otp-input"));var Xt=require("class-variance-authority"),Yt=require("react"),et=require("react/jsx-runtime"),Ir=(0,Xt.cva)("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"}}),jt=({numInputs:e=4,inputStyle:t,containerStyle:r,placeholder:a="-",status:o,...i})=>{let l=(0,Yt.useMemo)(()=>a||new Array(e).fill("").reduce((d,m)=>d+=m,""),[e,a]);return(0,et.jsx)(Ut.default,{numInputs:e,placeholder:l,containerStyle:n("w-full",r),inputStyle:n(Ir({status:o}),t),renderInput:s=>(0,et.jsx)("input",{...s}),...i})};var Qt=require("react"),Ie=require("lucide-react"),Me=require("framer-motion");var _=require("react/jsx-runtime"),qt=({text:e,textToCopy:t,onCopy:r,iconsPosition:a="right",clampText:o=!0,textClassName:i})=>{let[l,s]=(0,Qt.useState)(!1),c=()=>{navigator.clipboard.writeText(t??e).then(()=>{s(!0),r?.(),setTimeout(()=>s(!1),2e3)})},d=l?Ie.CheckIcon:Ie.Copy;return(0,_.jsxs)("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:[a==="left"&&(0,_.jsx)(Jt,{Icon:d,onClick:c,copied:l}),(0,_.jsx)("span",{className:n({"truncate max-w-[100px]":o},i),children:e}),a==="right"&&(0,_.jsx)(Jt,{Icon:d,onClick:c,copied:l})]})},Jt=({Icon:e,onClick:t,copied:r})=>(0,_.jsx)(Me.AnimatePresence,{mode:"wait",children:(0,_.jsx)(Me.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},onClick:t,children:(0,_.jsx)(e,{className:`w-5 h-5 ${r?"text-green-500":"text-gray-500 hover:text-gray-700 transition"}`})},r?"check":"copy")});var Pe=require("react");var er=require("lucide-react"),tt=require("react/jsx-runtime"),Ae=({value:e,onChange:t,debounce:r=500,addon:a,...o})=>{let[i,l]=(0,Pe.useState)(e??""),s=c=>l(c.target.value);return(0,Pe.useEffect)(()=>{e&&l(e)},[e]),(0,Pe.useEffect)(()=>{let c=setTimeout(()=>{t(i)},r);return()=>clearTimeout(c)},[i,r,t]),(0,tt.jsx)(Z,{leftNode:a??(0,tt.jsx)(er.Search,{className:" w-4 h-4 text-gray-400"}),sideNodeClassName:"bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",...o,className:n("!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:i})};var Ve=require("react/jsx-runtime"),tr=({status:e,variant:t,className:r})=>(0,Ve.jsx)("div",{children:(0,Ve.jsx)("div",{className:n("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":t==="success"},{"bg-gray-500/20 text-white":t==="abandoned"},{"bg-red-500/20 text-red-500":t==="failed"},{"bg-yellow-500/20 text-yellow-500":t==="pending"},r),children:(0,Ve.jsx)("p",{children:e.replace("-"," ")})})});var J=require("lucide-react");var Oe=require("lucide-react");var Be=require("react/jsx-runtime"),Mr=({page:e,currentPage:t,onClick:r})=>typeof e=="string"?(0,Be.jsx)("span",{className:"px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500",children:e}):(0,Be.jsx)("button",{onClick:r,className:`p-1 w-8 h-8 text-xs sm:text-sm rounded-full ${e===t?"bg-primary-main text-white":"text-[#717171] hover:bg-primary-main/10"}`,children:e}),rr=({totalPages:e,currentPage:t,handlePageClick:r})=>{let o=()=>{let c=Math.floor(1.5),d=Math.max(1,t-c),m=Math.min(e,d+3-1);return m>e&&(d=Math.max(1,e-3+1),m=e),{start:d,end:m}},{start:i,end:l}=o(),s=[];return i>1&&s.push(1),i>2&&s.push("..."),s.push(...Array.from({length:l-i+1},(c,d)=>i+d)),l<e-1&&s.push("..."),l<e&&s.push(e),s.map((c,d)=>(0,Be.jsx)(Mr,{page:c,currentPage:t,onClick:typeof c=="number"?()=>r(c):void 0},d))};var G=require("react/jsx-runtime"),or=({currentPage:e=1,totalPages:t=1,onPageChange:r,itemsPerPage:a=0,totalItems:o=0})=>{let i=c=>{c>=1&&c<=t&&r?.(c)},l=a===0?1:a*(e-1)+1,s=e===t?o:Math.min(l+a-1,o);return(0,G.jsxs)("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&&(0,G.jsx)("section",{className:"text-[#717171] text-[12px]",children:(0,G.jsxs)("p",{className:"",children:["Showing ",l," - ",s," of ",o]})}),(0,G.jsx)("div",{className:"flex items-center justify-center sm:justify-end ",children:(0,G.jsxs)("nav",{className:" inline-flex gap-x-1 sm:gap-x-[10px] items-center",children:[(0,G.jsx)("button",{onClick:()=>i(e-1),disabled:e===1,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:(0,G.jsx)(Oe.ChevronLeftIcon,{className:"size-5"})}),rr({currentPage:e,totalPages:t,handlePageClick:i}),(0,G.jsx)("button",{onClick:()=>i(e+1),disabled:e===t,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:(0,G.jsx)(Oe.ChevronRightIcon,{className:"size-5"})})]})})]})};var rt=require("@tanstack/react-table");var T=require("react/jsx-runtime"),ar=({table:e,isMobile:t,onRowClick:r,id:a})=>(0,T.jsx)("div",{className:n("relative w-full rounded-b border-0",{}),children:(0,T.jsxs)("table",{id:a??"table",className:"w-full overflow-x-scroll",children:[(0,T.jsx)("thead",{children:e.getHeaderGroups().map(o=>(0,T.jsx)("tr",{className:n(" rounded text-[#717171] border-b- bg-[#FCFCFC]",{}),children:o.headers.map(i=>(0,T.jsx)("th",{className:"relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",colSpan:i.colSpan,style:{width:i.getSize()},children:i.isPlaceholder?null:(0,T.jsx)("div",{className:n("flex items-center",{"cursor-pointer select-none":i.column.getCanSort()}),onClick:i.column.getToggleSortingHandler(),children:i.isPlaceholder?null:(0,rt.flexRender)(i.column.columnDef.header,i.getContext())})},i.id))},o.id))}),(0,T.jsx)("tbody",{className:" pl-2.5",children:e?.getFilteredRowModel().rows.map(o=>(0,T.jsx)("tr",{className:n("first-letter border-b border-zinc-100",{"hover:bg-gray-50":!t},{"hover:bg-gray-50 hover:cursor-pointer":r}),onClick:()=>r?r(o):{},children:o.getVisibleCells().map(i=>(0,T.jsx)("td",{className:n("",{}),children:(0,T.jsx)("div",{className:n("",{"w-max p-4 pl-2.5 text-black text-sm":!0}),children:(0,rt.flexRender)(i.column.columnDef.cell,i.getContext())})},i.id))},o.id))})]})});var g=require("react/jsx-runtime"),nr=({table:e,isMobile:t=!1,onRowClick:r,id:a,onRefetch:o,isRefetching:i,FilterMenu:l,ExtraNode:s,onExport:c,search:d={enabled:!1,debounceRate:700},download:m={enabled:!1,buttonId:"download_button",buttonText:"Export"},isLoading:u,pagination:p})=>{let h=()=>{try{o?.()}catch(E){console.error("Error while refetching data",E)}},k=E=>{d?.onSearch?.(E)};return(0,g.jsxs)("div",{className:n("relative w-full rounded-b border-0 overflow-x-auto"),children:[(o||d?.enabled||l||s||c)&&(0,g.jsxs)("div",{className:"w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2",children:[(0,g.jsx)("div",{className:"flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start",children:(0,g.jsxs)("div",{className:" w-full flex gap-x-3",children:[d?.enabled&&(0,g.jsx)("section",{className:"sm:w-56",children:(0,g.jsx)(Ae,{type:"text",placeholder:"Enter search here...",className:"h-9",onChange:k,debounce:d?.debounceRate})}),(0,g.jsxs)("div",{className:" flex gap-2",children:[o&&(0,g.jsx)(q,{onClick:h,title:"Refetch Data",disabled:i,variant:"outlined",className:"!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",size:"sm",children:(0,g.jsx)(J.RotateCw,{className:n("w-4 h-4",{"animate-spin":i}),size:5})}),l&&(0,g.jsx)(xe,{trigger:(0,g.jsx)("button",{title:"Filter",className:n("!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",de({variant:"outlined",size:"sm"})),children:(0,g.jsx)(J.ListFilter,{className:"w-4 h-4",size:5})}),children:l})]})]})}),(0,g.jsx)("div",{className:"flex items-start flex-col gap-2 justify-center",children:(0,g.jsx)("section",{className:"flex flex-col-reverse sm:flex-row gap-2",children:(0,g.jsxs)("div",{className:"flex gap-2",children:[s&&s,c&&(0,g.jsx)(q,{variant:"primary",onClick:c,size:"sm",children:"Export"}),m?.enabled&&(0,g.jsx)(q,{variant:"primary",leftNode:(0,g.jsx)(J.Download,{className:n("w-4 h-4",{"animate-spin":i}),size:5}),onClick:m?.onDownload,id:m.buttonId,size:"sm",children:m?.buttonText})]})})})]}),(0,g.jsx)("main",{className:"w-full overflow-x-auto mt-5",children:u?(0,g.jsxs)("div",{className:"py-10 flex flex-col justify-center w-full items-center space-x-2",children:[(0,g.jsx)(J.Loader,{size:20,className:"animate-spin"}),(0,g.jsx)("p",{className:"mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse",children:"Loading..."})]}):e.getRowModel().rows.length<1?(0,g.jsx)("div",{className:"py-10 flex flex-col justify-center w-full items-center",children:(0,g.jsx)("p",{className:"text-center text-gray-600 text-sm opacity-70",children:"No data available"})}):(0,g.jsx)("div",{className:"flex flex-col gap-2",children:(0,g.jsx)(ar,{table:e,isMobile:t,onRowClick:r,id:a})})}),!u&&p?.enabled&&e.getRowModel().rows.length>0&&(0,g.jsx)(or,{...p,currentPage:p?.currentPage??1,totalPages:p?.totalPages??Math.ceil((p?.totalItems??0)/Math.max(p?.itemsPerPage??1,1))??1,onPageChange:E=>p?.onPageChange?.(E)})]})};var ot=require("react"),ir=require("lucide-react"),N=require("react/jsx-runtime"),sr=e=>{let{environment:t,branch:r,version:a,deployTime:o,showBanner:i,onClose:l,initDefault:s,removeFromStorage:c,syncLocalStorageToState:d}=e,m=t||process.env.NEXT_PUBLIC_NODE_ENV;return m!=="staging"&&m!=="sandbox"||((0,ot.useEffect)(()=>{d()},[d]),(0,ot.useEffect)(()=>{let u;return(m==="staging"||m==="sandbox")&&(u=setInterval(()=>{c(),s()},5*60*1e3)),()=>{u&&clearInterval(u)}},[i,t,l,c,s,m]),!i)?null:(0,N.jsxs)("div",{className:"w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96",children:[(0,N.jsx)("button",{onClick:l,className:"absolute top-2 right-2",children:(0,N.jsx)(ir.X,{})}),(0,N.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,N.jsxs)("div",{className:"flex gap-2",children:[(0,N.jsx)("span",{className:"font-medium",children:"Environment:"}),(0,N.jsx)("span",{className:"text-blue-600 capitalize",children:m})]}),(0,N.jsxs)("div",{className:"flex gap-2",children:[(0,N.jsx)("span",{className:"font-medium",children:"Branch:"}),(0,N.jsx)("span",{className:"text-green-600 capitalize",children:r||process.env.NEXT_PUBLIC_DEPLOY_BRANCH})]}),(0,N.jsxs)("div",{className:"flex gap-2",children:[(0,N.jsx)("span",{className:"font-medium",children:"Version:"}),(0,N.jsx)("span",{className:"text-purple-600",children:a||process.env.NEXT_PUBLIC_DEPLOY_VERSION})]}),(0,N.jsxs)("div",{className:"flex gap-2",children:[(0,N.jsx)("span",{className:"font-medium",children:"Deploy Time:"}),(0,N.jsx)("span",{className:"text-orange-600",children:o||process.env.NEXT_PUBLIC_DEPLOY_TIME})]})]})]})};var Ge=require("react"),y=require("react/jsx-runtime"),Ar=({type:e})=>e==="gray"?(0,y.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{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",fill:"#79818C"})}):e==="info"?(0,y.jsx)("svg",{stroke:"#70B6F6",fill:"#70B6F6","stroke-width":"0",viewBox:"0 0 16 16",height:"24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2"})}):e==="warning"?(0,y.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{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",fill:"#FFC700"})}):e==="success"?(0,y.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{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",fill:"#00D488"})}):(0,y.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{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",fill:"#F04248"})}),lr=({type:e="info",title:t,description:r,open:a,showCloseButton:o,bottomNode:i,sideNode:l,onClose:s,showIcon:c=!0})=>{let[d,m]=(0,Ge.useState)(a);(0,Ge.useEffect)(()=>{m(a)},[a]);let u="",p="";switch(e){case"gray":u="#eeeef0",p="#79818c";break;case"info":u="#ebf5fd",p="#70B6F6";break;case"warning":u="#fff8df",p="#ffc700";break;case"success":u="#e0f9f0",p="#49e0aa";break;case"danger":u="#fde8e9",p="#f3777c";break;default:u="#eeeef0",p="#79818c";break}function h(){m(!1),s&&s()}return d?(0,y.jsxs)("div",{className:"w-full shadow-lg transform flex items-center rounded-md",style:{background:u||"#ebf5fd"},children:[(0,y.jsx)("div",{className:"flex-none absolute rounded-l-[2px] rounded-l-4px h-[4px] w-full top-0",style:{background:p||"#70B6F6"}}),(0,y.jsxs)("div",{className:"w-full gap-3 h-full flex flex-row justify-between px-4 md:px-4 py-3 md:py-4",children:[(0,y.jsxs)("div",{className:"flex flex-row gap-2.5 items-start w-full h-full",children:[c&&(0,y.jsx)("div",{className:"h-full flex justify-end",children:(0,y.jsx)(Ar,{type:e})}),(0,y.jsxs)("div",{className:"w-full gap-3 h-full flex flex-col md:flex-row items-start justify-between",children:[(0,y.jsxs)("div",{className:"flex-1 gap-3 h-full flex flex-col items-start justify-between",children:[(t||r)&&(0,y.jsxs)("div",{children:[t&&(0,y.jsx)("div",{className:"text-sm font-bold text-[#191919]",children:t}),r&&(0,y.jsx)("div",{className:"text-sm font-normal text-[#5D5D5D] mt-1",children:r})]}),i]}),l]})]}),o&&(0,y.jsx)("div",{className:"w-1/10 h-full flex flex-col justify-start items-center",children:(0,y.jsx)("button",{onClick:h,children:(0,y.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,y.jsx)("path",{d:"M3.3335 3.33337L12.6662 12.6661",stroke:"#191919",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,y.jsx)("path",{d:"M3.33429 12.6661L12.667 3.33337",stroke:"#191919",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})})]})]}):null};var at=require("react/jsx-runtime"),dr=()=>(0,at.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 20 20","aria-hidden":"true",className:"h-5 w-5",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,at.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})});var Q=require("react/jsx-runtime"),cr=e=>(0,Q.jsxs)("svg",{viewBox:"0 0 60 30",className:"w-full max-w-md h-auto","aria-label":"Union Jack - Flag of the United Kingdom",...e,children:[(0,Q.jsx)("rect",{width:"60",height:"30",fill:"#00247D"}),(0,Q.jsx)("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#FFFFFF",strokeWidth:"6"}),(0,Q.jsx)("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#CF142B",strokeWidth:"4"}),(0,Q.jsx)("path",{d:"M30,0 L30,30 M0,15 L60,15",stroke:"#FFFFFF",strokeWidth:"10"}),(0,Q.jsx)("path",{d:"M30,0 L30,30 M0,15 L60,15",stroke:"#CF142B",strokeWidth:"6"})]});var ne=require("react/jsx-runtime"),pr=e=>(0,ne.jsxs)("svg",{viewBox:"0 0 60 40",className:"w-full max-w-md h-auto","aria-label":"Tricolore - Flag of France",...e,children:[(0,ne.jsx)("rect",{x:"0",y:"0",width:"20",height:"40",fill:"#002395"}),(0,ne.jsx)("rect",{x:"20",y:"0",width:"20",height:"40",fill:"#FFFFFF"}),(0,ne.jsx)("rect",{x:"40",y:"0",width:"20",height:"40",fill:"#ED2939"})]});var Re=require("react/jsx-runtime"),mr=()=>(0,Re.jsxs)("svg",{width:"20",height:"18",viewBox:"0 0 8 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Re.jsx)("path",{d:"M5.50257 12.9395L3.68439 14.7576L1.86621 12.9395",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Re.jsx)("path",{d:"M5.50257 5.06055L3.68439 3.24237L1.86621 5.06055",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});var ur=require("@radix-ui/react-popover"),w=require("react/jsx-runtime"),Vr=[{key:"en",label:"English"},{key:"fr",label:"French"}],Br=({locale:e})=>e==="fr"?(0,w.jsx)(pr,{width:10}):(0,w.jsx)(cr,{width:10}),Or=({locale:e})=>(0,w.jsx)("div",{className:"px-2 py-1 ",children:(0,w.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,w.jsx)(Br,{locale:e})," ",(0,w.jsx)("span",{className:"uppercase",children:e}),(0,w.jsx)(mr,{})]})}),fr=({locale:e="en",onChange:t,locales:r=Vr})=>(0,w.jsxs)(z,{children:[(0,w.jsx)("div",{className:"flex items-center gap-2 px-2 py-1 rounded-lg shadow border-[0.5px] border-gray-50/50 text-current bg-white/10 ",children:(0,w.jsx)(O,{className:"!p-0 !bg-transparent ",children:(0,w.jsx)(Or,{locale:e})})}),(0,w.jsx)(H,{side:"bottom",className:"p-0 max-w-max rounded-md overflow-hidden mx-auto mt-2",children:(0,w.jsx)("div",{children:r?.map(a=>(0,w.jsxs)(ur.PopoverClose,{type:"button",className:n("flex items-center gap-3 px-3 py-1 text-sm hover:bg-blue-50 w-full transition-all",{"bg-blue-100":e&&e===a?.key}),onClick:()=>t?.(a?.key),children:[a?.label," ",e&&e===a?.key&&(0,w.jsx)(dr,{})]},a?.key))})})]});var nt={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$"},De=class De{static getCurrencyLocaleMap(t){return{XOF:"fr",XAF:"fr"}[t]||"en"}static koboToNaira(t){return+t/100}static nairaToKobo(t){return+t*100}static getCurrencySymbol(t){return nt[t]||t}};dt(De,"formatAmountAndCurrency",(t,r,a)=>{let o=new Intl.NumberFormat(a?.locale||De.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(a?.convertToMajorCurrency?De.koboToNaira(Number(r)):Number(r)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),i=nt[t]||t;return o.replace(t,i)});var it=De;var He=v(require("dayjs")),st=class{static getDateLibrary(){return(0,He.default)()}static formatTimestampToDate(t,r){return He.default.unix(t).format(r||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return(0,He.default)(t).unix()}};0&&(module.exports={AmountAction,Banner,Button,CopyableLabel,Country,CurrencySymbolMap,DateAction,DebouncedInput,DevBanner,Dialog,FlagComponent,FormLabel,Input,Loader,LocaleSelector,OTPInput,PasswordInput,PhoneInput,Popover,PopoverContent,PopoverRoot,PopoverTrigger,Select,Status,Table,Textarea,buttonVariants,cn});
|
2
|
-
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9
|
+
var __export = (target, all) => {
|
10
|
+
for (var name in all)
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
12
|
+
};
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
15
|
+
for (let key of __getOwnPropNames(from))
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
|
+
}
|
19
|
+
return to;
|
20
|
+
};
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
27
|
+
mod
|
28
|
+
));
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
31
|
+
|
32
|
+
// src/index.ts
|
33
|
+
var index_exports = {};
|
34
|
+
__export(index_exports, {
|
35
|
+
AmountAction: () => AmountAction,
|
36
|
+
Banner: () => Banner,
|
37
|
+
Button: () => Button,
|
38
|
+
CopyableLabel: () => CopyableLabel,
|
39
|
+
Country: () => Country,
|
40
|
+
CurrencySymbolMap: () => CurrencySymbolMap,
|
41
|
+
DateAction: () => DateAction,
|
42
|
+
DebouncedInput: () => DebouncedInput,
|
43
|
+
DevBanner: () => DevBanner,
|
44
|
+
Dialog: () => Dialog2,
|
45
|
+
Drawer: () => Drawer,
|
46
|
+
DrawerClose: () => DrawerClose,
|
47
|
+
DrawerRoot: () => DrawerRoot,
|
48
|
+
FlagComponent: () => FlagComponent,
|
49
|
+
FormLabel: () => FormLabel,
|
50
|
+
Input: () => Input,
|
51
|
+
Loader: () => Loader,
|
52
|
+
LocaleSelector: () => LocaleSelector,
|
53
|
+
OTPInput: () => OTPInput,
|
54
|
+
PasswordInput: () => PasswordInput,
|
55
|
+
PhoneInput: () => PhoneInput,
|
56
|
+
Popover: () => Popover,
|
57
|
+
PopoverContent: () => PopoverContent,
|
58
|
+
PopoverRoot: () => PopoverRoot,
|
59
|
+
PopoverTrigger: () => PopoverTrigger,
|
60
|
+
Select: () => Select,
|
61
|
+
Status: () => Status,
|
62
|
+
Table: () => Table,
|
63
|
+
Textarea: () => Textarea,
|
64
|
+
buttonVariants: () => buttonVariants,
|
65
|
+
cn: () => cn
|
66
|
+
});
|
67
|
+
module.exports = __toCommonJS(index_exports);
|
68
|
+
|
69
|
+
// src/components/label/FormLabel.tsx
|
70
|
+
var import_react = __toESM(require("react"));
|
71
|
+
|
72
|
+
// src/components/label/index.tsx
|
73
|
+
var React = __toESM(require("react"));
|
74
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
75
|
+
var import_class_variance_authority = require("class-variance-authority");
|
76
|
+
|
77
|
+
// src/utils/index.ts
|
78
|
+
var import_clsx = require("clsx");
|
79
|
+
var import_tailwind_merge = require("tailwind-merge");
|
80
|
+
function cn(...inputs) {
|
81
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
82
|
+
}
|
83
|
+
|
84
|
+
// src/components/label/index.tsx
|
85
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
86
|
+
var labelVariants = (0, import_class_variance_authority.cva)(
|
87
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
88
|
+
);
|
89
|
+
var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
90
|
+
LabelPrimitive.Root,
|
91
|
+
{
|
92
|
+
ref,
|
93
|
+
className: cn(labelVariants(), className),
|
94
|
+
...props
|
95
|
+
}
|
96
|
+
));
|
97
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
98
|
+
|
99
|
+
// src/components/label/FormLabel.tsx
|
100
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
101
|
+
var FormLabel = import_react.default.forwardRef(({ className, children, showAsterisk, error, ...props }, ref) => {
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
103
|
+
Label,
|
104
|
+
{
|
105
|
+
ref,
|
106
|
+
className: cn(error && "text-red-500", className),
|
107
|
+
...props,
|
108
|
+
children: showAsterisk ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { children: [
|
109
|
+
children,
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-red-500", children: "*" })
|
111
|
+
] }) : children
|
112
|
+
}
|
113
|
+
);
|
114
|
+
});
|
115
|
+
FormLabel.displayName = "FormLabel";
|
116
|
+
|
117
|
+
// src/components/loader/index.tsx
|
118
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
119
|
+
var Loader = ({
|
120
|
+
size = 16,
|
121
|
+
colour = "primary"
|
122
|
+
}) => {
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
124
|
+
"svg",
|
125
|
+
{
|
126
|
+
className: "animate-spin",
|
127
|
+
width: size,
|
128
|
+
height: size,
|
129
|
+
viewBox: "0 0 20 20",
|
130
|
+
fill: "none",
|
131
|
+
children: [
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "10", cy: "10", r: "9.25", stroke: "transparent", strokeWidth: "1.5" }),
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
134
|
+
"path",
|
135
|
+
{
|
136
|
+
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",
|
137
|
+
fill: colour === "primary" ? "#ffffff" : "currentColor",
|
138
|
+
className: "rounded"
|
139
|
+
}
|
140
|
+
)
|
141
|
+
]
|
142
|
+
}
|
143
|
+
);
|
144
|
+
};
|
145
|
+
|
146
|
+
// src/components/button/index.tsx
|
147
|
+
var React3 = __toESM(require("react"));
|
148
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
149
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
150
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
151
|
+
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
152
|
+
"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",
|
153
|
+
{
|
154
|
+
variants: {
|
155
|
+
variant: {
|
156
|
+
primary: "border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",
|
157
|
+
danger: "border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",
|
158
|
+
neutral: "!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",
|
159
|
+
outlined: "border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60",
|
160
|
+
"danger-outlined": "border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60",
|
161
|
+
"light-outlined": "border-white text-white hover:opacity-80 disabled:opacity-60",
|
162
|
+
"dark-text": "border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",
|
163
|
+
light: "border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"
|
164
|
+
},
|
165
|
+
size: {
|
166
|
+
// lg: "h-15 px-8 items-center",
|
167
|
+
// sm: "h-10 px-3.5 items-center text-sm",
|
168
|
+
default: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
|
169
|
+
sm: "py-[0.375rem] px-[1rem] leading-[1rem] font-normal text-sm rounded-lg",
|
170
|
+
lg: "py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",
|
171
|
+
md: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
|
172
|
+
"icon-sm": "h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",
|
173
|
+
icon: "h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg",
|
174
|
+
"icon-lg": "h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"
|
175
|
+
}
|
176
|
+
},
|
177
|
+
defaultVariants: {
|
178
|
+
variant: "primary",
|
179
|
+
size: "default"
|
180
|
+
}
|
181
|
+
}
|
182
|
+
);
|
183
|
+
var Button = React3.forwardRef(
|
184
|
+
({
|
185
|
+
className,
|
186
|
+
variant = "primary",
|
187
|
+
size,
|
188
|
+
asChild = false,
|
189
|
+
isLoading = false,
|
190
|
+
leftNode,
|
191
|
+
rightNode,
|
192
|
+
LoaderSize,
|
193
|
+
// ref,
|
194
|
+
...props
|
195
|
+
}, ref) => {
|
196
|
+
const Component = asChild ? import_react_slot.Slot : "button";
|
197
|
+
const { children, disabled, ...rest } = props;
|
198
|
+
const reference = React3.useRef(null);
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
200
|
+
Component,
|
201
|
+
{
|
202
|
+
className: cn(buttonVariants({ variant, size, className })),
|
203
|
+
ref: reference || ref,
|
204
|
+
disabled: disabled || isLoading,
|
205
|
+
...rest,
|
206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex font-medium justify-center items-center gap-2", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Loader, { size: LoaderSize, colour: "secondary" }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
207
|
+
leftNode,
|
208
|
+
children,
|
209
|
+
rightNode
|
210
|
+
] }) })
|
211
|
+
}
|
212
|
+
);
|
213
|
+
}
|
214
|
+
);
|
215
|
+
Button.displayName = "Button";
|
216
|
+
|
217
|
+
// src/components/input/index.tsx
|
218
|
+
var React6 = __toESM(require("react"));
|
219
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
220
|
+
|
221
|
+
// src/components/form/ErrorMessage.tsx
|
222
|
+
var import_react2 = __toESM(require("react"));
|
223
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
224
|
+
var ErrorMessage = import_react2.default.forwardRef(({ className, children, error, ...props }, ref) => {
|
225
|
+
const body = error ?? children;
|
226
|
+
if (!body) {
|
227
|
+
return null;
|
228
|
+
}
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
230
|
+
"p",
|
231
|
+
{
|
232
|
+
ref,
|
233
|
+
className: cn("text-xs font-normal text-[#F04248]", className),
|
234
|
+
...props,
|
235
|
+
children: body
|
236
|
+
}
|
237
|
+
);
|
238
|
+
});
|
239
|
+
ErrorMessage.displayName = "ErrorMessage";
|
240
|
+
|
241
|
+
// src/components/form/FormDescription.tsx
|
242
|
+
var import_react3 = __toESM(require("react"));
|
243
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
244
|
+
var FormDescription = import_react3.default.forwardRef(({ className, ...props }, ref) => {
|
245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
246
|
+
"div",
|
247
|
+
{
|
248
|
+
ref,
|
249
|
+
className: cn("text-sm text-[#8E98A8", className),
|
250
|
+
...props
|
251
|
+
}
|
252
|
+
);
|
253
|
+
});
|
254
|
+
FormDescription.displayName = "FormDescription";
|
255
|
+
|
256
|
+
// src/components/input/index.tsx
|
257
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
258
|
+
var inputVariants = (0, import_class_variance_authority3.cva)(
|
259
|
+
"!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",
|
260
|
+
{
|
261
|
+
variants: {
|
262
|
+
status: {
|
263
|
+
default: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
264
|
+
error: "placeholder:text-red-500 text-red-500",
|
265
|
+
loading: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
266
|
+
prefilled: "",
|
267
|
+
neutral: ""
|
268
|
+
}
|
269
|
+
},
|
270
|
+
defaultVariants: {
|
271
|
+
status: "default"
|
272
|
+
}
|
273
|
+
}
|
274
|
+
);
|
275
|
+
var BaseInnerInput = React6.forwardRef(
|
276
|
+
({ className, status, type, ...props }, ref) => {
|
277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
278
|
+
"input",
|
279
|
+
{
|
280
|
+
type,
|
281
|
+
className: cn(inputVariants({ status }), className),
|
282
|
+
ref,
|
283
|
+
...props
|
284
|
+
}
|
285
|
+
);
|
286
|
+
}
|
287
|
+
);
|
288
|
+
BaseInnerInput.displayName = "BaseInnerInput";
|
289
|
+
var inputContainerVariants = (0, import_class_variance_authority3.cva)(
|
290
|
+
"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]",
|
291
|
+
{
|
292
|
+
variants: {
|
293
|
+
status: {
|
294
|
+
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]",
|
295
|
+
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",
|
296
|
+
loading: "",
|
297
|
+
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]",
|
298
|
+
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]"
|
299
|
+
}
|
300
|
+
},
|
301
|
+
defaultVariants: {
|
302
|
+
status: "default"
|
303
|
+
}
|
304
|
+
}
|
305
|
+
);
|
306
|
+
var sideVariants = (0, import_class_variance_authority3.cva)(
|
307
|
+
"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]",
|
308
|
+
{
|
309
|
+
variants: {
|
310
|
+
side: {
|
311
|
+
left: "left-0 rounded-l-[8px] border-r",
|
312
|
+
right: "right-0 rounded-r-[8px] border-l"
|
313
|
+
},
|
314
|
+
status: {
|
315
|
+
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]",
|
316
|
+
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",
|
317
|
+
loading: "",
|
318
|
+
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]",
|
319
|
+
neutral: "bg-transparent border-0 caret-[#DEDEDE] !px-0"
|
320
|
+
}
|
321
|
+
},
|
322
|
+
defaultVariants: {
|
323
|
+
status: "default",
|
324
|
+
side: "left"
|
325
|
+
}
|
326
|
+
}
|
327
|
+
);
|
328
|
+
var Input = React6.forwardRef(
|
329
|
+
({
|
330
|
+
className,
|
331
|
+
status = "default",
|
332
|
+
disabled,
|
333
|
+
error,
|
334
|
+
isLoading,
|
335
|
+
sideNodeClassName,
|
336
|
+
showAsterisk,
|
337
|
+
label,
|
338
|
+
description,
|
339
|
+
...props
|
340
|
+
}, ref) => {
|
341
|
+
let containerStatus = status;
|
342
|
+
if (error) containerStatus = "error";
|
343
|
+
if (isLoading) containerStatus = "loading";
|
344
|
+
if (disabled) containerStatus = "prefilled";
|
345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative space-y-1 w-full", children: [
|
346
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
348
|
+
"div",
|
349
|
+
{
|
350
|
+
className: cn(
|
351
|
+
inputContainerVariants({ status: containerStatus }),
|
352
|
+
props.leftNode ? "pl-0" : "",
|
353
|
+
props.rightNode ? "pr-0" : "",
|
354
|
+
className
|
355
|
+
),
|
356
|
+
children: [
|
357
|
+
props.leftNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
358
|
+
"div",
|
359
|
+
{
|
360
|
+
className: cn(
|
361
|
+
sideVariants({
|
362
|
+
status: containerStatus,
|
363
|
+
side: "left"
|
364
|
+
}),
|
365
|
+
sideNodeClassName
|
366
|
+
),
|
367
|
+
children: props.leftNode
|
368
|
+
}
|
369
|
+
) : null,
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
371
|
+
BaseInnerInput,
|
372
|
+
{
|
373
|
+
ref,
|
374
|
+
disabled: isLoading || disabled,
|
375
|
+
className: cn({
|
376
|
+
"!pl-3": props.leftNode && status !== "neutral",
|
377
|
+
"!pr-3": props.rightNode && status !== "neutral"
|
378
|
+
}),
|
379
|
+
...props
|
380
|
+
}
|
381
|
+
),
|
382
|
+
props.rightNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
383
|
+
"div",
|
384
|
+
{
|
385
|
+
className: cn(
|
386
|
+
sideVariants({
|
387
|
+
status: containerStatus,
|
388
|
+
side: "right"
|
389
|
+
}),
|
390
|
+
sideNodeClassName
|
391
|
+
),
|
392
|
+
children: props.rightNode
|
393
|
+
}
|
394
|
+
) : null
|
395
|
+
]
|
396
|
+
}
|
397
|
+
),
|
398
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorMessage, { error })
|
400
|
+
] });
|
401
|
+
}
|
402
|
+
);
|
403
|
+
Input.displayName = "Input";
|
404
|
+
|
405
|
+
// src/components/password-input/index.tsx
|
406
|
+
var import_react4 = require("react");
|
407
|
+
|
408
|
+
// src/components/password-input/icons/Eye.tsx
|
409
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
410
|
+
var Eye = () => {
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
412
|
+
"svg",
|
413
|
+
{
|
414
|
+
width: "18",
|
415
|
+
height: "14",
|
416
|
+
viewBox: "0 0 18 14",
|
417
|
+
fill: "none",
|
418
|
+
xmlns: "http://www.w3.org/2000/svg",
|
419
|
+
children: [
|
420
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
421
|
+
"path",
|
422
|
+
{
|
423
|
+
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",
|
424
|
+
stroke: "#8E98A8",
|
425
|
+
strokeWidth: "2",
|
426
|
+
strokeLinecap: "round",
|
427
|
+
strokeLinejoin: "round"
|
428
|
+
}
|
429
|
+
),
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
431
|
+
"path",
|
432
|
+
{
|
433
|
+
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",
|
434
|
+
stroke: "#8E98A8",
|
435
|
+
strokeWidth: "2",
|
436
|
+
strokeLinecap: "round",
|
437
|
+
strokeLinejoin: "round"
|
438
|
+
}
|
439
|
+
)
|
440
|
+
]
|
441
|
+
}
|
442
|
+
);
|
443
|
+
};
|
444
|
+
|
445
|
+
// src/components/password-input/icons/EyeOff.tsx
|
446
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
447
|
+
var EyeOff = () => {
|
448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
449
|
+
"svg",
|
450
|
+
{
|
451
|
+
width: "18",
|
452
|
+
height: "18",
|
453
|
+
viewBox: "0 0 18 18",
|
454
|
+
fill: "none",
|
455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
456
|
+
children: [
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
458
|
+
"path",
|
459
|
+
{
|
460
|
+
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",
|
461
|
+
stroke: "#8E98A8",
|
462
|
+
strokeWidth: "1.5",
|
463
|
+
strokeLinecap: "round",
|
464
|
+
strokeLinejoin: "round"
|
465
|
+
}
|
466
|
+
),
|
467
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
468
|
+
"path",
|
469
|
+
{
|
470
|
+
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",
|
471
|
+
stroke: "#8E98A8",
|
472
|
+
strokeWidth: "1.5",
|
473
|
+
strokeLinecap: "round",
|
474
|
+
strokeLinejoin: "round"
|
475
|
+
}
|
476
|
+
)
|
477
|
+
]
|
478
|
+
}
|
479
|
+
);
|
480
|
+
};
|
481
|
+
|
482
|
+
// src/components/password-input/icons/Check.tsx
|
483
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
484
|
+
var Check = () => {
|
485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
486
|
+
"svg",
|
487
|
+
{
|
488
|
+
width: "12",
|
489
|
+
height: "12",
|
490
|
+
viewBox: "0 0 12 12",
|
491
|
+
fill: "none",
|
492
|
+
xmlns: "http://www.w3.org/2000/svg",
|
493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
494
|
+
"path",
|
495
|
+
{
|
496
|
+
d: "M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",
|
497
|
+
fill: "currentColor"
|
498
|
+
}
|
499
|
+
)
|
500
|
+
}
|
501
|
+
);
|
502
|
+
};
|
503
|
+
|
504
|
+
// src/components/password-input/icons/Fail.tsx
|
505
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
506
|
+
var Fail = () => {
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
508
|
+
"svg",
|
509
|
+
{
|
510
|
+
width: "12",
|
511
|
+
height: "12",
|
512
|
+
viewBox: "0 0 12 12",
|
513
|
+
fill: "none",
|
514
|
+
xmlns: "http://www.w3.org/2000/svg",
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
516
|
+
"path",
|
517
|
+
{
|
518
|
+
d: "M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",
|
519
|
+
stroke: "currentColor",
|
520
|
+
strokeWidth: "1.5",
|
521
|
+
strokeLinecap: "round",
|
522
|
+
strokeLinejoin: "round"
|
523
|
+
}
|
524
|
+
)
|
525
|
+
}
|
526
|
+
);
|
527
|
+
};
|
528
|
+
|
529
|
+
// src/components/password-input/index.tsx
|
530
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
531
|
+
var validationOptions = [
|
532
|
+
{
|
533
|
+
label: "Uppercase",
|
534
|
+
key: "uppercase",
|
535
|
+
RegExp: /[A-Z]/,
|
536
|
+
validated: false
|
537
|
+
},
|
538
|
+
{
|
539
|
+
label: "Lowercase",
|
540
|
+
key: "lowercase",
|
541
|
+
RegExp: /[a-z]/,
|
542
|
+
validated: false
|
543
|
+
},
|
544
|
+
{
|
545
|
+
label: "Number",
|
546
|
+
key: "number",
|
547
|
+
RegExp: /\d/,
|
548
|
+
validated: false
|
549
|
+
},
|
550
|
+
{
|
551
|
+
label: "8 Characters",
|
552
|
+
key: "eight-chars",
|
553
|
+
RegExp: /.{8}/,
|
554
|
+
validated: false
|
555
|
+
}
|
556
|
+
];
|
557
|
+
var PasswordInput = ({
|
558
|
+
onValidate,
|
559
|
+
onChange,
|
560
|
+
disableValidation,
|
561
|
+
...props
|
562
|
+
}) => {
|
563
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react4.useState)(false);
|
564
|
+
const [validatedValues, setValidatedValues] = (0, import_react4.useState)(validationOptions);
|
565
|
+
const validatePassword = (value) => {
|
566
|
+
return validationOptions.map((option) => ({
|
567
|
+
...option,
|
568
|
+
validated: option.RegExp.test(value)
|
569
|
+
}));
|
570
|
+
};
|
571
|
+
const checkPasswordStrength = (value) => {
|
572
|
+
const validatedOptions = validatePassword(value);
|
573
|
+
const allValidated = validatedOptions.every((option) => option.validated);
|
574
|
+
setValidatedValues(validatedOptions);
|
575
|
+
return allValidated;
|
576
|
+
};
|
577
|
+
const handlePaswordInputChange = (e) => {
|
578
|
+
if (onChange) onChange(e);
|
579
|
+
if (disableValidation) return;
|
580
|
+
const value = e?.target?.value;
|
581
|
+
const validated = checkPasswordStrength(value);
|
582
|
+
if (onValidate) onValidate(validated, value);
|
583
|
+
};
|
584
|
+
const ValidateComp = (0, import_react4.useMemo)(() => {
|
585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center gap-2", children: validatedValues?.map((value) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
586
|
+
"div",
|
587
|
+
{
|
588
|
+
className: cn("text-xs flex items-center gap-0.5", {
|
589
|
+
"text-[#62C554]": value?.validated,
|
590
|
+
"text-[#8E98A8]": !value?.validated
|
591
|
+
}),
|
592
|
+
children: [
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "", children: value?.validated ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Check, {}) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Fail, {}) }),
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "", children: value?.label })
|
595
|
+
]
|
596
|
+
},
|
597
|
+
value?.key
|
598
|
+
)) });
|
599
|
+
}, [validatedValues]);
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
601
|
+
Input,
|
602
|
+
{
|
603
|
+
sideNodeClassName: "!border-l-0",
|
604
|
+
rightNode: passwordVisible ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
605
|
+
"button",
|
606
|
+
{
|
607
|
+
type: "button",
|
608
|
+
onClick: () => setPasswordVisible((val) => !val),
|
609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Eye, {})
|
610
|
+
}
|
611
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
612
|
+
"button",
|
613
|
+
{
|
614
|
+
type: "button",
|
615
|
+
onClick: () => setPasswordVisible((val) => !val),
|
616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EyeOff, {})
|
617
|
+
}
|
618
|
+
),
|
619
|
+
type: passwordVisible ? "text" : "password",
|
620
|
+
onChange: handlePaswordInputChange,
|
621
|
+
description: !disableValidation && ValidateComp,
|
622
|
+
...props
|
623
|
+
}
|
624
|
+
);
|
625
|
+
};
|
626
|
+
PasswordInput.displayName = "PasswordInput";
|
627
|
+
|
628
|
+
// src/components/textarea/index.tsx
|
629
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
630
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
631
|
+
var textareaContainerVariants = (0, import_class_variance_authority4.cva)(
|
632
|
+
"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",
|
633
|
+
{
|
634
|
+
variants: {
|
635
|
+
status: {
|
636
|
+
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]",
|
637
|
+
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",
|
638
|
+
loading: "placeholder:text-[#C4C4C4]",
|
639
|
+
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]",
|
640
|
+
neutral: ""
|
641
|
+
}
|
642
|
+
},
|
643
|
+
defaultVariants: {
|
644
|
+
status: "default"
|
645
|
+
}
|
646
|
+
}
|
647
|
+
);
|
648
|
+
var Textarea = ({
|
649
|
+
className,
|
650
|
+
status = "default",
|
651
|
+
disabled,
|
652
|
+
error,
|
653
|
+
isLoading,
|
654
|
+
showAsterisk,
|
655
|
+
label,
|
656
|
+
description,
|
657
|
+
...props
|
658
|
+
}) => {
|
659
|
+
let containerStatus = status;
|
660
|
+
if (error) containerStatus = "error";
|
661
|
+
if (isLoading) containerStatus = "loading";
|
662
|
+
if (disabled) containerStatus = "prefilled";
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative space-y-1", children: [
|
664
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
665
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
666
|
+
"textarea",
|
667
|
+
{
|
668
|
+
className: cn(
|
669
|
+
"min-h-[80px]",
|
670
|
+
inputContainerVariants({ status: containerStatus }),
|
671
|
+
className
|
672
|
+
),
|
673
|
+
disabled: isLoading || disabled,
|
674
|
+
...props
|
675
|
+
}
|
676
|
+
),
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ErrorMessage, { error })
|
679
|
+
] });
|
680
|
+
};
|
681
|
+
Textarea.displayName = "Textarea";
|
682
|
+
|
683
|
+
// src/components/searcheable/index.tsx
|
684
|
+
var React11 = __toESM(require("react"));
|
685
|
+
|
686
|
+
// src/components/command/index.tsx
|
687
|
+
var React8 = __toESM(require("react"));
|
688
|
+
var import_cmdk = require("cmdk");
|
689
|
+
var import_lucide_react = require("lucide-react");
|
690
|
+
|
691
|
+
// src/components/dialog/index.tsx
|
692
|
+
var React7 = __toESM(require("react"));
|
693
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
694
|
+
|
695
|
+
// src/components/dialog/icon/CloseIcon.tsx
|
696
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
697
|
+
var CloseIcon = () => {
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
699
|
+
"svg",
|
700
|
+
{
|
701
|
+
xmlns: "http://www.w3.org/2000/svg",
|
702
|
+
width: "24",
|
703
|
+
height: "24",
|
704
|
+
viewBox: "0 0 24 24",
|
705
|
+
fill: "none",
|
706
|
+
stroke: "currentColor",
|
707
|
+
strokeWidth: "2",
|
708
|
+
strokeLinecap: "round",
|
709
|
+
strokeLinejoin: "round",
|
710
|
+
className: "lucide lucide-x",
|
711
|
+
children: [
|
712
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M18 6 6 18" }),
|
713
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m6 6 12 12" })
|
714
|
+
]
|
715
|
+
}
|
716
|
+
);
|
717
|
+
};
|
718
|
+
|
719
|
+
// src/components/dialog/index.tsx
|
720
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
721
|
+
var DialogRoot = DialogPrimitive.Root;
|
722
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
723
|
+
var DialogPortal = DialogPrimitive.Portal;
|
724
|
+
var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
725
|
+
DialogPrimitive.Overlay,
|
726
|
+
{
|
727
|
+
ref,
|
728
|
+
className: cn(
|
729
|
+
"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",
|
730
|
+
className
|
731
|
+
),
|
732
|
+
...props
|
733
|
+
}
|
734
|
+
));
|
735
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
736
|
+
var DialogContent = React7.forwardRef(({ className, hideCloseButton, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogPortal, { children: [
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogOverlay, {}),
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
739
|
+
DialogPrimitive.Content,
|
740
|
+
{
|
741
|
+
ref,
|
742
|
+
className: cn(
|
743
|
+
"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",
|
744
|
+
className
|
745
|
+
),
|
746
|
+
...props,
|
747
|
+
children: [
|
748
|
+
children,
|
749
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(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: [
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon, {}),
|
751
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Close" })
|
752
|
+
] })
|
753
|
+
]
|
754
|
+
}
|
755
|
+
)
|
756
|
+
] }));
|
757
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
758
|
+
var DialogHeader = ({
|
759
|
+
className,
|
760
|
+
...props
|
761
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
762
|
+
"div",
|
763
|
+
{
|
764
|
+
className: cn("flex flex-col space-y-1.5 text-left", className),
|
765
|
+
...props
|
766
|
+
}
|
767
|
+
);
|
768
|
+
DialogHeader.displayName = "DialogHeader";
|
769
|
+
var DialogFooter = ({
|
770
|
+
className,
|
771
|
+
...props
|
772
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
773
|
+
"div",
|
774
|
+
{
|
775
|
+
className: cn("flex flex-row justify-end sm:space-x-2", className),
|
776
|
+
...props
|
777
|
+
}
|
778
|
+
);
|
779
|
+
DialogFooter.displayName = "DialogFooter";
|
780
|
+
var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
781
|
+
DialogPrimitive.Title,
|
782
|
+
{
|
783
|
+
ref,
|
784
|
+
className: cn(
|
785
|
+
"text-xl font-semibold leading-none tracking-tight",
|
786
|
+
className
|
787
|
+
),
|
788
|
+
...props
|
789
|
+
}
|
790
|
+
));
|
791
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
792
|
+
var DialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
793
|
+
DialogPrimitive.Description,
|
794
|
+
{
|
795
|
+
ref,
|
796
|
+
className: cn("text-sm text-gray-500", className),
|
797
|
+
...props
|
798
|
+
}
|
799
|
+
));
|
800
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
801
|
+
var Dialog2 = ({
|
802
|
+
trigger = void 0,
|
803
|
+
children,
|
804
|
+
open,
|
805
|
+
onOpenChange,
|
806
|
+
hideCloseButton,
|
807
|
+
footer,
|
808
|
+
title,
|
809
|
+
description,
|
810
|
+
contentClassName,
|
811
|
+
headerClassName,
|
812
|
+
titleClassName,
|
813
|
+
descriptionClassName,
|
814
|
+
footerClassName,
|
815
|
+
asChild = true,
|
816
|
+
onOpenAutoFocus,
|
817
|
+
onCloseAutoFocus,
|
818
|
+
onEscapeKeyDown,
|
819
|
+
onInteractOutside,
|
820
|
+
onPointerDownOutside,
|
821
|
+
...props
|
822
|
+
}) => {
|
823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogRoot, { ...props, open, onOpenChange, children: [
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTrigger, { asChild, children: trigger }),
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
826
|
+
DialogContent,
|
827
|
+
{
|
828
|
+
className: contentClassName,
|
829
|
+
hideCloseButton,
|
830
|
+
onOpenAutoFocus,
|
831
|
+
onCloseAutoFocus,
|
832
|
+
onEscapeKeyDown,
|
833
|
+
onPointerDownOutside,
|
834
|
+
onInteractOutside,
|
835
|
+
children: [
|
836
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogHeader, { className: headerClassName, children: [
|
837
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTitle, { className: titleClassName, children: title }),
|
838
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogDescription, { className: descriptionClassName, children: description })
|
839
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
|
840
|
+
children,
|
841
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogFooter, { className: footerClassName, children: footer })
|
842
|
+
]
|
843
|
+
}
|
844
|
+
) })
|
845
|
+
] });
|
846
|
+
};
|
847
|
+
Dialog2.displayName = DialogPrimitive.Dialog.displayName;
|
848
|
+
|
849
|
+
// src/components/command/index.tsx
|
850
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
851
|
+
var Command = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
852
|
+
import_cmdk.Command,
|
853
|
+
{
|
854
|
+
ref,
|
855
|
+
className: cn(
|
856
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
857
|
+
className
|
858
|
+
),
|
859
|
+
...props
|
860
|
+
}
|
861
|
+
));
|
862
|
+
Command.displayName = import_cmdk.Command.displayName;
|
863
|
+
var CommandInput = React8.forwardRef(({ className, CommandInputContainerClassName, loading, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
864
|
+
"div",
|
865
|
+
{
|
866
|
+
className: cn(
|
867
|
+
"flex items-center border-0 px-3 gap-2",
|
868
|
+
CommandInputContainerClassName
|
869
|
+
),
|
870
|
+
"cmdk-input-wrapper": "",
|
871
|
+
children: [
|
872
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Loader, { size: 16, colour: "secondary" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
874
|
+
import_cmdk.Command.Input,
|
875
|
+
{
|
876
|
+
ref,
|
877
|
+
className: cn(
|
878
|
+
"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",
|
879
|
+
className
|
880
|
+
),
|
881
|
+
disabled: loading,
|
882
|
+
...props
|
883
|
+
}
|
884
|
+
)
|
885
|
+
]
|
886
|
+
}
|
887
|
+
));
|
888
|
+
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
889
|
+
var CommandList = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
890
|
+
import_cmdk.Command.List,
|
891
|
+
{
|
892
|
+
ref,
|
893
|
+
className: cn("overflow-y-auto overflow-x-hidden", className),
|
894
|
+
...props
|
895
|
+
}
|
896
|
+
));
|
897
|
+
CommandList.displayName = import_cmdk.Command.List.displayName;
|
898
|
+
var CommandEmpty = React8.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
899
|
+
import_cmdk.Command.Empty,
|
900
|
+
{
|
901
|
+
ref,
|
902
|
+
className: "py-6 text-center text-sm",
|
903
|
+
...props
|
904
|
+
}
|
905
|
+
));
|
906
|
+
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
907
|
+
var CommandGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
908
|
+
import_cmdk.Command.Group,
|
909
|
+
{
|
910
|
+
ref,
|
911
|
+
className: cn(
|
912
|
+
"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",
|
913
|
+
className
|
914
|
+
),
|
915
|
+
...props
|
916
|
+
}
|
917
|
+
));
|
918
|
+
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
919
|
+
var CommandSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
920
|
+
import_cmdk.Command.Separator,
|
921
|
+
{
|
922
|
+
ref,
|
923
|
+
className: cn("-mx-1 h-px bg-border", className),
|
924
|
+
...props
|
925
|
+
}
|
926
|
+
));
|
927
|
+
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
928
|
+
var CommandItem = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
929
|
+
import_cmdk.Command.Item,
|
930
|
+
{
|
931
|
+
ref,
|
932
|
+
className: cn(
|
933
|
+
"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",
|
934
|
+
className
|
935
|
+
),
|
936
|
+
...props
|
937
|
+
}
|
938
|
+
));
|
939
|
+
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
940
|
+
var CommandShortcut = ({
|
941
|
+
className,
|
942
|
+
...props
|
943
|
+
}) => {
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
945
|
+
"span",
|
946
|
+
{
|
947
|
+
className: cn(
|
948
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
949
|
+
className
|
950
|
+
),
|
951
|
+
...props
|
952
|
+
}
|
953
|
+
);
|
954
|
+
};
|
955
|
+
CommandShortcut.displayName = "CommandShortcut";
|
956
|
+
|
957
|
+
// src/components/popover/index.tsx
|
958
|
+
var React9 = __toESM(require("react"));
|
959
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
960
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
961
|
+
var PopoverRoot = PopoverPrimitive.Root;
|
962
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
963
|
+
var PopoverContent = React9.forwardRef(
|
964
|
+
({ className, align = "center", sideOffset = 4, portal = true, ...props }, ref) => portal ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
965
|
+
PopoverPrimitive.Content,
|
966
|
+
{
|
967
|
+
ref,
|
968
|
+
align,
|
969
|
+
sideOffset,
|
970
|
+
className: cn(
|
971
|
+
"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",
|
972
|
+
className
|
973
|
+
),
|
974
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
975
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
976
|
+
...props
|
977
|
+
}
|
978
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
979
|
+
PopoverPrimitive.Content,
|
980
|
+
{
|
981
|
+
ref,
|
982
|
+
align,
|
983
|
+
sideOffset,
|
984
|
+
className: cn(
|
985
|
+
"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",
|
986
|
+
className
|
987
|
+
),
|
988
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
989
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
990
|
+
...props
|
991
|
+
}
|
992
|
+
)
|
993
|
+
);
|
994
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
995
|
+
var Popover = ({
|
996
|
+
trigger,
|
997
|
+
children,
|
998
|
+
open,
|
999
|
+
onOpenChange,
|
1000
|
+
contentClassName,
|
1001
|
+
asChild = true,
|
1002
|
+
align,
|
1003
|
+
side,
|
1004
|
+
alignOffset,
|
1005
|
+
triggerClassName,
|
1006
|
+
sideOffset,
|
1007
|
+
onOpenAutoFocus,
|
1008
|
+
onCloseAutoFocus,
|
1009
|
+
portal = true,
|
1010
|
+
...props
|
1011
|
+
}) => {
|
1012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(PopoverRoot, { ...props, open, onOpenChange, children: [
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger, { asChild, className: triggerClassName, children: trigger }),
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
1015
|
+
PopoverContent,
|
1016
|
+
{
|
1017
|
+
alignOffset,
|
1018
|
+
sideOffset,
|
1019
|
+
side,
|
1020
|
+
align,
|
1021
|
+
className: contentClassName,
|
1022
|
+
onOpenAutoFocus,
|
1023
|
+
onCloseAutoFocus,
|
1024
|
+
portal,
|
1025
|
+
children
|
1026
|
+
}
|
1027
|
+
)
|
1028
|
+
] });
|
1029
|
+
};
|
1030
|
+
Popover.displayName = PopoverPrimitive.Root.displayName;
|
1031
|
+
|
1032
|
+
// src/components/scroll-area/index.tsx
|
1033
|
+
var React10 = __toESM(require("react"));
|
1034
|
+
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
1035
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
1036
|
+
var ScrollArea = React10.forwardRef(({ className, viewPortClassName, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
1037
|
+
ScrollAreaPrimitive.Root,
|
1038
|
+
{
|
1039
|
+
ref,
|
1040
|
+
className: cn("relative overflow-hidden", className),
|
1041
|
+
...props,
|
1042
|
+
children: [
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
1044
|
+
ScrollAreaPrimitive.Viewport,
|
1045
|
+
{
|
1046
|
+
className: cn("h-full w-full rounded-[inherit]", viewPortClassName),
|
1047
|
+
children
|
1048
|
+
}
|
1049
|
+
),
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollBar, {}),
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollAreaPrimitive.Corner, {})
|
1052
|
+
]
|
1053
|
+
}
|
1054
|
+
));
|
1055
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
1056
|
+
var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
1057
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
1058
|
+
{
|
1059
|
+
ref,
|
1060
|
+
orientation,
|
1061
|
+
className: cn(
|
1062
|
+
"flex touch-none select-none transition-colors",
|
1063
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
1064
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
1065
|
+
className
|
1066
|
+
),
|
1067
|
+
...props,
|
1068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]" })
|
1069
|
+
}
|
1070
|
+
));
|
1071
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
1072
|
+
|
1073
|
+
// src/components/searcheable/index.tsx
|
1074
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
1075
|
+
var SearchableTrigger = ({
|
1076
|
+
className,
|
1077
|
+
value,
|
1078
|
+
placeholder = "",
|
1079
|
+
status,
|
1080
|
+
disabled
|
1081
|
+
}) => {
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
1083
|
+
"button",
|
1084
|
+
{
|
1085
|
+
disabled,
|
1086
|
+
className: cn(
|
1087
|
+
inputContainerVariants({ status }),
|
1088
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",
|
1089
|
+
value ? "" : "text-[#79818C]",
|
1090
|
+
className
|
1091
|
+
),
|
1092
|
+
children: [
|
1093
|
+
value ?? placeholder ?? "Select options...",
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1095
|
+
"svg",
|
1096
|
+
{
|
1097
|
+
width: "20",
|
1098
|
+
height: "20",
|
1099
|
+
viewBox: "0 0 20 20",
|
1100
|
+
fill: "none",
|
1101
|
+
className: " data-[state=open]:goup-rotate-180",
|
1102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1103
|
+
"path",
|
1104
|
+
{
|
1105
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1106
|
+
stroke: "currentColor",
|
1107
|
+
strokeWidth: "1.5",
|
1108
|
+
strokeMiterlimit: "10",
|
1109
|
+
strokeLinecap: "round",
|
1110
|
+
strokeLinejoin: "round"
|
1111
|
+
}
|
1112
|
+
)
|
1113
|
+
}
|
1114
|
+
)
|
1115
|
+
]
|
1116
|
+
}
|
1117
|
+
) });
|
1118
|
+
};
|
1119
|
+
var Searchable = ({
|
1120
|
+
options = [],
|
1121
|
+
value,
|
1122
|
+
onChange,
|
1123
|
+
containerClassName,
|
1124
|
+
placeholder,
|
1125
|
+
disabled,
|
1126
|
+
loading,
|
1127
|
+
optionComponent,
|
1128
|
+
children,
|
1129
|
+
modal = false,
|
1130
|
+
hideSearch,
|
1131
|
+
className,
|
1132
|
+
inputValue,
|
1133
|
+
onValueChange,
|
1134
|
+
onInputValueChange
|
1135
|
+
}) => {
|
1136
|
+
const [open, setOpen] = React11.useState(false);
|
1137
|
+
const triggerRef = React11.useRef(null);
|
1138
|
+
const [width, setWidth] = React11.useState(void 0);
|
1139
|
+
React11.useLayoutEffect(() => {
|
1140
|
+
if (triggerRef.current) {
|
1141
|
+
setWidth(triggerRef.current.clientWidth);
|
1142
|
+
}
|
1143
|
+
}, [triggerRef.current]);
|
1144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PopoverRoot, { modal, open, onOpenChange: setOpen, children: [
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("w-full", className), ref: triggerRef, children }),
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1147
|
+
PopoverContent,
|
1148
|
+
{
|
1149
|
+
portal: !modal,
|
1150
|
+
className: "p-0 min-w-[200px]",
|
1151
|
+
style: { width },
|
1152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
1153
|
+
Command,
|
1154
|
+
{
|
1155
|
+
className: cn("relative max-h-[270px]", {
|
1156
|
+
"mt-2": !hideSearch
|
1157
|
+
}),
|
1158
|
+
children: [
|
1159
|
+
!hideSearch && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1160
|
+
CommandInput,
|
1161
|
+
{
|
1162
|
+
loading,
|
1163
|
+
placeholder: placeholder ?? "Search options...",
|
1164
|
+
onValueChange: onInputValueChange,
|
1165
|
+
value: inputValue,
|
1166
|
+
CommandInputContainerClassName: "mx-2 border rounded-md border-[#DEDEDE]"
|
1167
|
+
}
|
1168
|
+
),
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1170
|
+
ScrollArea,
|
1171
|
+
{
|
1172
|
+
viewPortClassName: "max-h-[225px]",
|
1173
|
+
className: cn(
|
1174
|
+
"w-full px-0 h-full overflow-y-auto",
|
1175
|
+
containerClassName
|
1176
|
+
),
|
1177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CommandList, { children: [
|
1178
|
+
!hideSearch && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandEmpty, { children: "No result found." }),
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandGroup, { className: "w-full", children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1180
|
+
CommandItem,
|
1181
|
+
{
|
1182
|
+
defaultValue: value?.label,
|
1183
|
+
value: option.label,
|
1184
|
+
disabled,
|
1185
|
+
onSelect: () => {
|
1186
|
+
onChange(option);
|
1187
|
+
setOpen(false);
|
1188
|
+
onValueChange?.(option?.value);
|
1189
|
+
},
|
1190
|
+
children: !optionComponent ? option.label : optionComponent(option)
|
1191
|
+
},
|
1192
|
+
option.value
|
1193
|
+
)) })
|
1194
|
+
] })
|
1195
|
+
}
|
1196
|
+
)
|
1197
|
+
]
|
1198
|
+
}
|
1199
|
+
)
|
1200
|
+
}
|
1201
|
+
)
|
1202
|
+
] });
|
1203
|
+
};
|
1204
|
+
|
1205
|
+
// src/components/country/data.ts
|
1206
|
+
var countryData = [
|
1207
|
+
{
|
1208
|
+
countryCode: "GLOBAL",
|
1209
|
+
countryName: "Global",
|
1210
|
+
currency: "Dollars",
|
1211
|
+
currencyCode: "USD",
|
1212
|
+
internetCountryCode: "GLOBAL"
|
1213
|
+
},
|
1214
|
+
{
|
1215
|
+
countryName: "Benin",
|
1216
|
+
countryCode: "+229",
|
1217
|
+
currency: "West African CFA franc",
|
1218
|
+
currencyCode: "XOF",
|
1219
|
+
currencyIcon: "Fr",
|
1220
|
+
internetCountryCode: "BJ"
|
1221
|
+
},
|
1222
|
+
{
|
1223
|
+
countryName: "Burkina Faso",
|
1224
|
+
countryCode: "+226",
|
1225
|
+
currency: "West African CFA franc",
|
1226
|
+
currencyCode: "XOF",
|
1227
|
+
currencyIcon: "Fr",
|
1228
|
+
internetCountryCode: "BF"
|
1229
|
+
},
|
1230
|
+
{
|
1231
|
+
countryName: "Cameroon",
|
1232
|
+
countryCode: "+237",
|
1233
|
+
currency: "Central African CFA franc",
|
1234
|
+
currencyCode: "XAF",
|
1235
|
+
currencyIcon: "Fr",
|
1236
|
+
internetCountryCode: "CM"
|
1237
|
+
},
|
1238
|
+
{
|
1239
|
+
countryName: "Chad",
|
1240
|
+
countryCode: "+235",
|
1241
|
+
currency: "Central African CFA franc",
|
1242
|
+
currencyCode: "XAF",
|
1243
|
+
currencyIcon: "Fr",
|
1244
|
+
internetCountryCode: "TD"
|
1245
|
+
},
|
1246
|
+
{
|
1247
|
+
countryName: "DR Congo",
|
1248
|
+
countryCode: "+243",
|
1249
|
+
currency: "Congolese franc",
|
1250
|
+
currencyCode: "CDF",
|
1251
|
+
currencyIcon: "FC",
|
1252
|
+
internetCountryCode: "CD"
|
1253
|
+
},
|
1254
|
+
{
|
1255
|
+
countryName: "Eswatini",
|
1256
|
+
countryCode: "+268",
|
1257
|
+
currency: "Swazi lilangeni",
|
1258
|
+
currencyCode: "SZL",
|
1259
|
+
currencyIcon: "L",
|
1260
|
+
internetCountryCode: "SZ"
|
1261
|
+
},
|
1262
|
+
{
|
1263
|
+
countryName: "Gabon",
|
1264
|
+
countryCode: "+241",
|
1265
|
+
currency: "Central African CFA franc",
|
1266
|
+
currencyCode: "XAF",
|
1267
|
+
currencyIcon: "Fr",
|
1268
|
+
internetCountryCode: "GA"
|
1269
|
+
},
|
1270
|
+
{
|
1271
|
+
countryName: "Ghana",
|
1272
|
+
countryCode: "+233",
|
1273
|
+
currency: "Ghanaian cedi",
|
1274
|
+
currencyCode: "GHS",
|
1275
|
+
currencyIcon: "\u20B5",
|
1276
|
+
internetCountryCode: "GH"
|
1277
|
+
},
|
1278
|
+
{
|
1279
|
+
countryName: "Guinea",
|
1280
|
+
countryCode: "+224",
|
1281
|
+
currency: "Guinean franc",
|
1282
|
+
currencyCode: "GNF",
|
1283
|
+
currencyIcon: "Fr",
|
1284
|
+
internetCountryCode: "GN"
|
1285
|
+
},
|
1286
|
+
{
|
1287
|
+
countryName: "Ivory Coast",
|
1288
|
+
countryCode: "+225",
|
1289
|
+
currency: "West African CFA franc",
|
1290
|
+
currencyCode: "XOF",
|
1291
|
+
currencyIcon: "Fr",
|
1292
|
+
internetCountryCode: "CI"
|
1293
|
+
},
|
1294
|
+
{
|
1295
|
+
countryName: "Kenya",
|
1296
|
+
countryCode: "+254",
|
1297
|
+
currency: "Kenyan shilling",
|
1298
|
+
currencyCode: "KES",
|
1299
|
+
currencyIcon: "Sh",
|
1300
|
+
internetCountryCode: "KE"
|
1301
|
+
},
|
1302
|
+
{
|
1303
|
+
countryName: "Lesotho",
|
1304
|
+
countryCode: "+266",
|
1305
|
+
currency: "Lesotho loti",
|
1306
|
+
currencyCode: "LSL",
|
1307
|
+
currencyIcon: "L",
|
1308
|
+
internetCountryCode: "LS"
|
1309
|
+
},
|
1310
|
+
{
|
1311
|
+
countryName: "Liberia",
|
1312
|
+
countryCode: "+231",
|
1313
|
+
currency: "Liberian dollar",
|
1314
|
+
currencyCode: "LRD",
|
1315
|
+
currencyIcon: "$",
|
1316
|
+
internetCountryCode: "LR"
|
1317
|
+
},
|
1318
|
+
{
|
1319
|
+
countryName: "Madagascar",
|
1320
|
+
countryCode: "+261",
|
1321
|
+
currency: "Malagasy ariary",
|
1322
|
+
currencyCode: "MGA",
|
1323
|
+
currencyIcon: "Ar",
|
1324
|
+
internetCountryCode: "MG"
|
1325
|
+
},
|
1326
|
+
{
|
1327
|
+
countryName: "Malawi",
|
1328
|
+
countryCode: "+265",
|
1329
|
+
currency: "Malawian kwacha",
|
1330
|
+
currencyCode: "MWK",
|
1331
|
+
currencyIcon: "MK",
|
1332
|
+
internetCountryCode: "MW"
|
1333
|
+
},
|
1334
|
+
{
|
1335
|
+
countryName: "Mali",
|
1336
|
+
countryCode: "+223",
|
1337
|
+
currency: "West African CFA franc",
|
1338
|
+
currencyCode: "XOF",
|
1339
|
+
currencyIcon: "Fr",
|
1340
|
+
internetCountryCode: "ML"
|
1341
|
+
},
|
1342
|
+
{
|
1343
|
+
countryName: "Mozambique",
|
1344
|
+
countryCode: "+258",
|
1345
|
+
currency: "Mozambican metical",
|
1346
|
+
currencyCode: "MZN",
|
1347
|
+
currencyIcon: "MT",
|
1348
|
+
internetCountryCode: "MZ"
|
1349
|
+
},
|
1350
|
+
{
|
1351
|
+
countryName: "Namibia",
|
1352
|
+
countryCode: "+264",
|
1353
|
+
currency: "Namibian dollar",
|
1354
|
+
currencyCode: "NAD",
|
1355
|
+
currencyIcon: "$",
|
1356
|
+
internetCountryCode: "NA"
|
1357
|
+
},
|
1358
|
+
{
|
1359
|
+
countryName: "Niger",
|
1360
|
+
countryCode: "+227",
|
1361
|
+
currency: "West African CFA franc",
|
1362
|
+
currencyCode: "XOF",
|
1363
|
+
currencyIcon: "Fr",
|
1364
|
+
internetCountryCode: "NE"
|
1365
|
+
},
|
1366
|
+
{
|
1367
|
+
countryName: "Nigeria",
|
1368
|
+
countryCode: "+234",
|
1369
|
+
currency: "Nigerian naira",
|
1370
|
+
currencyCode: "NGN",
|
1371
|
+
currencyIcon: "\u20A6",
|
1372
|
+
internetCountryCode: "NG"
|
1373
|
+
},
|
1374
|
+
{
|
1375
|
+
countryName: "Republic of the Congo",
|
1376
|
+
countryCode: "+242",
|
1377
|
+
currency: "Central African CFA franc",
|
1378
|
+
currencyCode: "XAF",
|
1379
|
+
currencyIcon: "Fr",
|
1380
|
+
internetCountryCode: "CG"
|
1381
|
+
},
|
1382
|
+
{
|
1383
|
+
countryName: "Rwanda",
|
1384
|
+
countryCode: "+250",
|
1385
|
+
currency: "Rwandan franc",
|
1386
|
+
currencyCode: "RWF",
|
1387
|
+
currencyIcon: "Fr",
|
1388
|
+
internetCountryCode: "RW"
|
1389
|
+
},
|
1390
|
+
{
|
1391
|
+
countryName: "Senegal",
|
1392
|
+
countryCode: "+221",
|
1393
|
+
currency: "West African CFA franc",
|
1394
|
+
currencyCode: "XOF",
|
1395
|
+
currencyIcon: "Fr",
|
1396
|
+
internetCountryCode: "SN"
|
1397
|
+
},
|
1398
|
+
{
|
1399
|
+
countryName: "Seychelles",
|
1400
|
+
countryCode: "+248",
|
1401
|
+
currency: "Seychellois rupee",
|
1402
|
+
currencyCode: "SCR",
|
1403
|
+
currencyIcon: "\u20A8",
|
1404
|
+
internetCountryCode: "SC"
|
1405
|
+
},
|
1406
|
+
{
|
1407
|
+
countryName: "South Africa",
|
1408
|
+
countryCode: "+27",
|
1409
|
+
currency: "South African rand",
|
1410
|
+
currencyCode: "ZAR",
|
1411
|
+
currencyIcon: "R",
|
1412
|
+
internetCountryCode: "ZA"
|
1413
|
+
},
|
1414
|
+
{
|
1415
|
+
countryName: "South Sudan",
|
1416
|
+
countryCode: "+211",
|
1417
|
+
currency: "South Sudanese pound",
|
1418
|
+
currencyCode: "SSP",
|
1419
|
+
currencyIcon: "\xA3",
|
1420
|
+
internetCountryCode: "SS"
|
1421
|
+
},
|
1422
|
+
{
|
1423
|
+
countryName: "Tanzania",
|
1424
|
+
countryCode: "+255",
|
1425
|
+
currency: "Tanzanian shilling",
|
1426
|
+
currencyCode: "TZS",
|
1427
|
+
currencyIcon: "Sh",
|
1428
|
+
internetCountryCode: "TZ"
|
1429
|
+
},
|
1430
|
+
{
|
1431
|
+
countryName: "Togo",
|
1432
|
+
countryCode: "+228",
|
1433
|
+
currency: "West African CFA franc",
|
1434
|
+
currencyCode: "XOF",
|
1435
|
+
currencyIcon: "Fr",
|
1436
|
+
internetCountryCode: "TG"
|
1437
|
+
},
|
1438
|
+
{
|
1439
|
+
countryName: "Uganda",
|
1440
|
+
countryCode: "+256",
|
1441
|
+
currency: "Ugandan shilling",
|
1442
|
+
currencyCode: "UGX",
|
1443
|
+
currencyIcon: "Sh",
|
1444
|
+
internetCountryCode: "UG"
|
1445
|
+
},
|
1446
|
+
{
|
1447
|
+
countryName: "Zambia",
|
1448
|
+
countryCode: "+260",
|
1449
|
+
currency: "Zambian kwacha",
|
1450
|
+
currencyCode: "ZMW",
|
1451
|
+
currencyIcon: "ZK",
|
1452
|
+
internetCountryCode: "ZM"
|
1453
|
+
}
|
1454
|
+
];
|
1455
|
+
var getCountryDataMap = () => {
|
1456
|
+
const frequency = {};
|
1457
|
+
countryData?.forEach((country) => {
|
1458
|
+
frequency[country?.internetCountryCode] = country?.countryName;
|
1459
|
+
});
|
1460
|
+
return frequency;
|
1461
|
+
};
|
1462
|
+
|
1463
|
+
// src/components/phone-input/index.tsx
|
1464
|
+
var React12 = __toESM(require("react"));
|
1465
|
+
var RPNInput = __toESM(require("react-phone-number-input"));
|
1466
|
+
var import_flags = __toESM(require("react-phone-number-input/flags"));
|
1467
|
+
|
1468
|
+
// src/components/phone-input/Flag.tsx
|
1469
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
1470
|
+
var FlatGlobeIcon = (props) => {
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
1472
|
+
"svg",
|
1473
|
+
{
|
1474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1475
|
+
viewBox: "0 0 32 32",
|
1476
|
+
fill: "none",
|
1477
|
+
...props,
|
1478
|
+
children: [
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("rect", { width: "32", height: "32", fill: "#60A5FA" }),
|
1480
|
+
" ",
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
1482
|
+
"path",
|
1483
|
+
{
|
1484
|
+
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",
|
1485
|
+
fill: "#34D399"
|
1486
|
+
}
|
1487
|
+
),
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("rect", { x: "2", y: "28", width: "28", height: "3", fill: "#D1D5DB" }),
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
1490
|
+
"path",
|
1491
|
+
{
|
1492
|
+
d: "M0 16H32M8 0V32M16 0V32M24 0V32",
|
1493
|
+
stroke: "#2563EB",
|
1494
|
+
strokeWidth: "0.5",
|
1495
|
+
vectorEffect: "non-scaling-stroke"
|
1496
|
+
}
|
1497
|
+
),
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
1499
|
+
"path",
|
1500
|
+
{
|
1501
|
+
d: "M0 16H32",
|
1502
|
+
stroke: "#2563EB",
|
1503
|
+
strokeWidth: "1",
|
1504
|
+
vectorEffect: "non-scaling-stroke"
|
1505
|
+
}
|
1506
|
+
)
|
1507
|
+
]
|
1508
|
+
}
|
1509
|
+
);
|
1510
|
+
};
|
1511
|
+
var Flag_default = FlatGlobeIcon;
|
1512
|
+
|
1513
|
+
// src/components/phone-input/index.tsx
|
1514
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
1515
|
+
var PhoneInput = React12.forwardRef(
|
1516
|
+
({
|
1517
|
+
className,
|
1518
|
+
onChange,
|
1519
|
+
defaultCountry = "NG",
|
1520
|
+
modal,
|
1521
|
+
showAsterisk,
|
1522
|
+
label,
|
1523
|
+
description,
|
1524
|
+
error,
|
1525
|
+
...props
|
1526
|
+
}, ref) => {
|
1527
|
+
const CountrySelectWrapper = (innerProps) => {
|
1528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CountrySelect, { ...innerProps, status: props.status, modal });
|
1529
|
+
};
|
1530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative space-y-1", children: [
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1533
|
+
RPNInput.default,
|
1534
|
+
{
|
1535
|
+
ref,
|
1536
|
+
className: cn("flex", className),
|
1537
|
+
flagComponent: FlagComponent,
|
1538
|
+
countrySelectComponent: CountrySelectWrapper,
|
1539
|
+
inputComponent: InputComponent,
|
1540
|
+
defaultCountry,
|
1541
|
+
onChange: (value) => {
|
1542
|
+
if (onChange) {
|
1543
|
+
onChange?.(value);
|
1544
|
+
}
|
1545
|
+
},
|
1546
|
+
...props
|
1547
|
+
}
|
1548
|
+
),
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorMessage, { error })
|
1551
|
+
] });
|
1552
|
+
}
|
1553
|
+
);
|
1554
|
+
PhoneInput.displayName = "PhoneInput";
|
1555
|
+
var InputComponent = React12.forwardRef(
|
1556
|
+
({ className, ...props }, ref) => {
|
1557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1558
|
+
Input,
|
1559
|
+
{
|
1560
|
+
className: cn("!rounded-s-none h-10", className),
|
1561
|
+
...props,
|
1562
|
+
ref
|
1563
|
+
}
|
1564
|
+
);
|
1565
|
+
}
|
1566
|
+
);
|
1567
|
+
InputComponent.displayName = "InputComponent";
|
1568
|
+
var CountrySelect = ({
|
1569
|
+
disabled,
|
1570
|
+
value,
|
1571
|
+
onChange,
|
1572
|
+
options,
|
1573
|
+
status,
|
1574
|
+
modal
|
1575
|
+
}) => {
|
1576
|
+
const handleSelect = React12.useCallback(
|
1577
|
+
(country) => {
|
1578
|
+
onChange(country);
|
1579
|
+
},
|
1580
|
+
[onChange]
|
1581
|
+
);
|
1582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(PopoverRoot, { modal, children: [
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverTrigger, { disabled, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
1584
|
+
"div",
|
1585
|
+
{
|
1586
|
+
className: cn(
|
1587
|
+
inputContainerVariants({ status }),
|
1588
|
+
"transition justify-center items-center disabled:text-base-500 flex gap-3 h-10 rounded-e-none border-e-0 pl-2 pr-2"
|
1589
|
+
),
|
1590
|
+
children: [
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FlagComponent, { country: value, countryName: value }),
|
1592
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1593
|
+
"svg",
|
1594
|
+
{
|
1595
|
+
className: cn(
|
1596
|
+
"mr-0.5 h-4 w-4 opacity-50",
|
1597
|
+
disabled ? "hidden" : "opacity-100"
|
1598
|
+
),
|
1599
|
+
width: "20",
|
1600
|
+
height: "20",
|
1601
|
+
viewBox: "0 0 20 20",
|
1602
|
+
fill: "none",
|
1603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1604
|
+
"path",
|
1605
|
+
{
|
1606
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1607
|
+
stroke: "#959595",
|
1608
|
+
strokeWidth: "1.5",
|
1609
|
+
strokeMiterlimit: "10",
|
1610
|
+
strokeLinecap: "round",
|
1611
|
+
strokeLinejoin: "round"
|
1612
|
+
}
|
1613
|
+
)
|
1614
|
+
}
|
1615
|
+
)
|
1616
|
+
]
|
1617
|
+
}
|
1618
|
+
) }),
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverContent, { portal: !modal, className: "w-[200px] md:w-[300px] p-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Command, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ScrollArea, { className: "h-72", children: [
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandInput, { placeholder: "Search country..." }),
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandEmpty, { children: "No country found." }),
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandGroup, { children: options.filter((x) => x.value).map((option) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
1623
|
+
CommandItem,
|
1624
|
+
{
|
1625
|
+
className: "gap-2",
|
1626
|
+
onSelect: () => handleSelect(option.value),
|
1627
|
+
children: [
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1629
|
+
FlagComponent,
|
1630
|
+
{
|
1631
|
+
country: option.value,
|
1632
|
+
countryName: option.label
|
1633
|
+
}
|
1634
|
+
),
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-sm", children: option.label }),
|
1636
|
+
option.value && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-[#191919]/50 text-sm dark:text-white", children: `+${RPNInput.getCountryCallingCode(option.value)}` }),
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1638
|
+
"svg",
|
1639
|
+
{
|
1640
|
+
width: "16",
|
1641
|
+
height: "16",
|
1642
|
+
viewBox: "0 0 16 16",
|
1643
|
+
fill: "none",
|
1644
|
+
className: cn(
|
1645
|
+
"ml-auto",
|
1646
|
+
option.value === value ? "opacity-100" : "opacity-0"
|
1647
|
+
),
|
1648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1649
|
+
"path",
|
1650
|
+
{
|
1651
|
+
d: "M4 8.00008L6.66353 10.6636L12 5.33655",
|
1652
|
+
stroke: "#959595",
|
1653
|
+
strokeWidth: "1.06667",
|
1654
|
+
strokeLinecap: "round",
|
1655
|
+
strokeLinejoin: "round"
|
1656
|
+
}
|
1657
|
+
)
|
1658
|
+
}
|
1659
|
+
)
|
1660
|
+
]
|
1661
|
+
},
|
1662
|
+
`${option.value}-${option.label}`
|
1663
|
+
)) })
|
1664
|
+
] }) }) }) })
|
1665
|
+
] });
|
1666
|
+
};
|
1667
|
+
var FlagComponent = ({
|
1668
|
+
country,
|
1669
|
+
countryName,
|
1670
|
+
className
|
1671
|
+
}) => {
|
1672
|
+
const Flag = import_flags.default[country];
|
1673
|
+
if (country === "GLOBAL")
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1675
|
+
"span",
|
1676
|
+
{
|
1677
|
+
className: cn(
|
1678
|
+
"bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
|
1679
|
+
className
|
1680
|
+
),
|
1681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Flag_default, { className: "w-full h-[90%]" })
|
1682
|
+
}
|
1683
|
+
);
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1685
|
+
"span",
|
1686
|
+
{
|
1687
|
+
className: cn(
|
1688
|
+
"bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
|
1689
|
+
className
|
1690
|
+
),
|
1691
|
+
children: Flag && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Flag, { title: countryName })
|
1692
|
+
}
|
1693
|
+
);
|
1694
|
+
};
|
1695
|
+
FlagComponent.displayName = "FlagComponent";
|
1696
|
+
|
1697
|
+
// src/components/country/index.tsx
|
1698
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
1699
|
+
var countryMap = getCountryDataMap();
|
1700
|
+
var CountryTrigger = ({
|
1701
|
+
className,
|
1702
|
+
value,
|
1703
|
+
placeholder = "",
|
1704
|
+
status,
|
1705
|
+
disabled
|
1706
|
+
}) => {
|
1707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
1708
|
+
"button",
|
1709
|
+
{
|
1710
|
+
disabled,
|
1711
|
+
className: cn(
|
1712
|
+
inputContainerVariants({ status }),
|
1713
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",
|
1714
|
+
value ? "" : "text-[#79818C]",
|
1715
|
+
className
|
1716
|
+
),
|
1717
|
+
children: [
|
1718
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-2 items-center", children: [
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1720
|
+
FlagComponent,
|
1721
|
+
{
|
1722
|
+
country: value,
|
1723
|
+
countryName: value,
|
1724
|
+
className: "ml-1 !w-6 h-5"
|
1725
|
+
}
|
1726
|
+
),
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "", children: [
|
1728
|
+
" ",
|
1729
|
+
countryMap[value]
|
1730
|
+
] })
|
1731
|
+
] }) : placeholder ?? "Select options...",
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1733
|
+
"svg",
|
1734
|
+
{
|
1735
|
+
width: "20",
|
1736
|
+
height: "20",
|
1737
|
+
viewBox: "0 0 20 20",
|
1738
|
+
fill: "none",
|
1739
|
+
className: " data-[state=open]:goup-rotate-180",
|
1740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1741
|
+
"path",
|
1742
|
+
{
|
1743
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1744
|
+
stroke: "currentColor",
|
1745
|
+
strokeWidth: "1.5",
|
1746
|
+
strokeMiterlimit: "10",
|
1747
|
+
strokeLinecap: "round",
|
1748
|
+
strokeLinejoin: "round"
|
1749
|
+
}
|
1750
|
+
)
|
1751
|
+
}
|
1752
|
+
)
|
1753
|
+
]
|
1754
|
+
}
|
1755
|
+
) });
|
1756
|
+
};
|
1757
|
+
var Country = ({
|
1758
|
+
hideSearch = true,
|
1759
|
+
showAsterisk,
|
1760
|
+
label,
|
1761
|
+
description,
|
1762
|
+
error,
|
1763
|
+
...props
|
1764
|
+
}) => {
|
1765
|
+
const options = countryData?.map((country) => ({
|
1766
|
+
value: country?.internetCountryCode,
|
1767
|
+
label: country?.countryName,
|
1768
|
+
...country
|
1769
|
+
}));
|
1770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative space-y-1", children: [
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1773
|
+
Searchable,
|
1774
|
+
{
|
1775
|
+
options,
|
1776
|
+
hideSearch,
|
1777
|
+
optionComponent: (arg) => {
|
1778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex items-center gap-2", children: [
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1780
|
+
FlagComponent,
|
1781
|
+
{
|
1782
|
+
country: arg?.internetCountryCode,
|
1783
|
+
countryName: arg?.label,
|
1784
|
+
className: "ml-2 !w-6 !h-5"
|
1785
|
+
}
|
1786
|
+
),
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-1 text-sm", children: arg?.label })
|
1788
|
+
] });
|
1789
|
+
},
|
1790
|
+
...props,
|
1791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1792
|
+
CountryTrigger,
|
1793
|
+
{
|
1794
|
+
value: props?.value?.value,
|
1795
|
+
status: props?.status,
|
1796
|
+
placeholder: props?.placeholder ?? " Select Country"
|
1797
|
+
}
|
1798
|
+
)
|
1799
|
+
}
|
1800
|
+
),
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorMessage, { error })
|
1803
|
+
] });
|
1804
|
+
};
|
1805
|
+
|
1806
|
+
// src/components/select/index.tsx
|
1807
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
1808
|
+
var Select = ({
|
1809
|
+
showAsterisk,
|
1810
|
+
label,
|
1811
|
+
description,
|
1812
|
+
error,
|
1813
|
+
hideSearch = true,
|
1814
|
+
status,
|
1815
|
+
...props
|
1816
|
+
}) => {
|
1817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative space-y-1", children: [
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
1820
|
+
Searchable,
|
1821
|
+
{
|
1822
|
+
hideSearch,
|
1823
|
+
...props,
|
1824
|
+
containerClassName: "h-full",
|
1825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
1826
|
+
SearchableTrigger,
|
1827
|
+
{
|
1828
|
+
disabled: props?.disabled,
|
1829
|
+
placeholder: "Select or search email",
|
1830
|
+
status,
|
1831
|
+
value: props?.value?.label ?? props?.value?.value
|
1832
|
+
}
|
1833
|
+
)
|
1834
|
+
}
|
1835
|
+
),
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ErrorMessage, { error })
|
1838
|
+
] });
|
1839
|
+
};
|
1840
|
+
|
1841
|
+
// src/components/otp/index.tsx
|
1842
|
+
var import_react_otp_input = __toESM(require("react-otp-input"));
|
1843
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
1844
|
+
var import_react5 = require("react");
|
1845
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
1846
|
+
var otpInputVariants = (0, import_class_variance_authority5.cva)(
|
1847
|
+
"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",
|
1848
|
+
{
|
1849
|
+
variants: {
|
1850
|
+
status: {
|
1851
|
+
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]",
|
1852
|
+
error: "placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",
|
1853
|
+
loading: "placeholder:text-[#C4C4C4]"
|
1854
|
+
}
|
1855
|
+
},
|
1856
|
+
defaultVariants: {
|
1857
|
+
status: "default"
|
1858
|
+
}
|
1859
|
+
}
|
1860
|
+
);
|
1861
|
+
var OTPInput = ({
|
1862
|
+
numInputs = 4,
|
1863
|
+
inputStyle,
|
1864
|
+
containerStyle,
|
1865
|
+
placeholder = "-",
|
1866
|
+
status,
|
1867
|
+
...props
|
1868
|
+
}) => {
|
1869
|
+
const placeholderValue = (0, import_react5.useMemo)(() => {
|
1870
|
+
if (placeholder) return placeholder;
|
1871
|
+
const numInputArr = new Array(numInputs).fill("");
|
1872
|
+
const result = numInputArr.reduce((accumulator, currentValue) => {
|
1873
|
+
return accumulator += currentValue;
|
1874
|
+
}, "");
|
1875
|
+
return result;
|
1876
|
+
}, [numInputs, placeholder]);
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
1878
|
+
import_react_otp_input.default,
|
1879
|
+
{
|
1880
|
+
numInputs,
|
1881
|
+
placeholder: placeholderValue,
|
1882
|
+
containerStyle: cn("w-full", containerStyle),
|
1883
|
+
inputStyle: cn(otpInputVariants({ status }), inputStyle),
|
1884
|
+
renderInput: (props2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { ...props2 }),
|
1885
|
+
...props
|
1886
|
+
}
|
1887
|
+
);
|
1888
|
+
};
|
1889
|
+
|
1890
|
+
// src/components/copyable-label/index.tsx
|
1891
|
+
var import_react6 = require("react");
|
1892
|
+
var import_lucide_react2 = require("lucide-react");
|
1893
|
+
var import_framer_motion = require("framer-motion");
|
1894
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
1895
|
+
var CopyableLabel = ({
|
1896
|
+
text,
|
1897
|
+
textToCopy,
|
1898
|
+
onCopy,
|
1899
|
+
iconsPosition = "right",
|
1900
|
+
clampText = true,
|
1901
|
+
textClassName
|
1902
|
+
}) => {
|
1903
|
+
const [copied, setCopied] = (0, import_react6.useState)(false);
|
1904
|
+
const copyToClipboard = () => {
|
1905
|
+
navigator.clipboard.writeText(textToCopy ?? text).then(() => {
|
1906
|
+
setCopied(true);
|
1907
|
+
onCopy?.();
|
1908
|
+
setTimeout(() => setCopied(false), 2e3);
|
1909
|
+
});
|
1910
|
+
};
|
1911
|
+
const Icon2 = copied ? import_lucide_react2.CheckIcon : import_lucide_react2.Copy;
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("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: [
|
1913
|
+
iconsPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied }),
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
1915
|
+
"span",
|
1916
|
+
{
|
1917
|
+
className: cn({ "truncate max-w-[100px]": clampText }, textClassName),
|
1918
|
+
children: text
|
1919
|
+
}
|
1920
|
+
),
|
1921
|
+
iconsPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied })
|
1922
|
+
] });
|
1923
|
+
};
|
1924
|
+
var AnimatedIcon = ({ Icon: Icon2, onClick, copied }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_framer_motion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
1925
|
+
import_framer_motion.motion.div,
|
1926
|
+
{
|
1927
|
+
initial: { opacity: 0, scale: 0.8 },
|
1928
|
+
animate: { opacity: 1, scale: 1 },
|
1929
|
+
exit: { opacity: 0, scale: 0.8 },
|
1930
|
+
transition: { duration: 0.2 },
|
1931
|
+
onClick,
|
1932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
1933
|
+
Icon2,
|
1934
|
+
{
|
1935
|
+
className: `w-5 h-5 ${copied ? "text-green-500" : "text-gray-500 hover:text-gray-700 transition"}`
|
1936
|
+
}
|
1937
|
+
)
|
1938
|
+
},
|
1939
|
+
copied ? "check" : "copy"
|
1940
|
+
) });
|
1941
|
+
|
1942
|
+
// src/components/debounced-input/index.tsx
|
1943
|
+
var import_react7 = require("react");
|
1944
|
+
var import_lucide_react3 = require("lucide-react");
|
1945
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
1946
|
+
var DebouncedInput = ({
|
1947
|
+
value: initialValue,
|
1948
|
+
onChange,
|
1949
|
+
debounce = 500,
|
1950
|
+
addon,
|
1951
|
+
...props
|
1952
|
+
}) => {
|
1953
|
+
const [value, setValue] = (0, import_react7.useState)(initialValue ?? "");
|
1954
|
+
const handleInputChange = (event) => setValue(event.target.value);
|
1955
|
+
(0, import_react7.useEffect)(() => {
|
1956
|
+
if (!initialValue) return;
|
1957
|
+
setValue(initialValue);
|
1958
|
+
}, [initialValue]);
|
1959
|
+
(0, import_react7.useEffect)(() => {
|
1960
|
+
const timeout = setTimeout(() => {
|
1961
|
+
onChange(value);
|
1962
|
+
}, debounce);
|
1963
|
+
return () => clearTimeout(timeout);
|
1964
|
+
}, [value, debounce, onChange]);
|
1965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
1966
|
+
Input,
|
1967
|
+
{
|
1968
|
+
leftNode: addon ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react3.Search, { className: " w-4 h-4 text-gray-400" }),
|
1969
|
+
sideNodeClassName: "bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",
|
1970
|
+
...props,
|
1971
|
+
className: cn(
|
1972
|
+
"!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",
|
1973
|
+
props?.className
|
1974
|
+
),
|
1975
|
+
onChange: handleInputChange,
|
1976
|
+
value
|
1977
|
+
}
|
1978
|
+
);
|
1979
|
+
};
|
1980
|
+
|
1981
|
+
// src/components/status/index.tsx
|
1982
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
1983
|
+
var Status = ({
|
1984
|
+
status,
|
1985
|
+
variant,
|
1986
|
+
className
|
1987
|
+
}) => {
|
1988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
1989
|
+
"div",
|
1990
|
+
{
|
1991
|
+
className: cn(
|
1992
|
+
"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",
|
1993
|
+
{
|
1994
|
+
"bg-green-500/20 text-green-500": variant === "success"
|
1995
|
+
},
|
1996
|
+
{
|
1997
|
+
"bg-gray-500/20 text-white": variant === "abandoned"
|
1998
|
+
},
|
1999
|
+
{
|
2000
|
+
"bg-red-500/20 text-red-500": variant === "failed"
|
2001
|
+
},
|
2002
|
+
{
|
2003
|
+
"bg-yellow-500/20 text-yellow-500": variant === "pending"
|
2004
|
+
},
|
2005
|
+
className
|
2006
|
+
),
|
2007
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: status.replace("-", " ") })
|
2008
|
+
}
|
2009
|
+
) });
|
2010
|
+
};
|
2011
|
+
|
2012
|
+
// src/components/table/index.tsx
|
2013
|
+
var import_lucide_react5 = require("lucide-react");
|
2014
|
+
|
2015
|
+
// src/components/table/pagination/index.tsx
|
2016
|
+
var import_lucide_react4 = require("lucide-react");
|
2017
|
+
|
2018
|
+
// src/components/table/pagination/utils.tsx
|
2019
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
2020
|
+
var PageButton = ({
|
2021
|
+
page,
|
2022
|
+
currentPage,
|
2023
|
+
onClick
|
2024
|
+
}) => {
|
2025
|
+
if (typeof page === "string") {
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500", children: page });
|
2027
|
+
}
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
2029
|
+
"button",
|
2030
|
+
{
|
2031
|
+
onClick,
|
2032
|
+
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"}`,
|
2033
|
+
children: page
|
2034
|
+
}
|
2035
|
+
);
|
2036
|
+
};
|
2037
|
+
var renderPageNumbers = ({
|
2038
|
+
totalPages,
|
2039
|
+
currentPage,
|
2040
|
+
handlePageClick
|
2041
|
+
}) => {
|
2042
|
+
const maxVisiblePages = 3;
|
2043
|
+
const getWindowBounds = () => {
|
2044
|
+
const halfWindow = Math.floor(maxVisiblePages / 2);
|
2045
|
+
let start2 = Math.max(1, currentPage - halfWindow);
|
2046
|
+
let end2 = Math.min(totalPages, start2 + maxVisiblePages - 1);
|
2047
|
+
if (end2 > totalPages) {
|
2048
|
+
start2 = Math.max(1, totalPages - maxVisiblePages + 1);
|
2049
|
+
end2 = totalPages;
|
2050
|
+
}
|
2051
|
+
return { start: start2, end: end2 };
|
2052
|
+
};
|
2053
|
+
const { start, end } = getWindowBounds();
|
2054
|
+
const pages = [];
|
2055
|
+
if (start > 1) pages.push(1);
|
2056
|
+
if (start > 2) pages.push("...");
|
2057
|
+
pages.push(...Array.from({ length: end - start + 1 }, (_, i) => start + i));
|
2058
|
+
if (end < totalPages - 1) pages.push("...");
|
2059
|
+
if (end < totalPages) pages.push(totalPages);
|
2060
|
+
return pages.map((page, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
2061
|
+
PageButton,
|
2062
|
+
{
|
2063
|
+
page,
|
2064
|
+
currentPage,
|
2065
|
+
onClick: typeof page === "number" ? () => handlePageClick(page) : void 0
|
2066
|
+
},
|
2067
|
+
idx
|
2068
|
+
));
|
2069
|
+
};
|
2070
|
+
|
2071
|
+
// src/components/table/pagination/index.tsx
|
2072
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
2073
|
+
var Pagination = ({
|
2074
|
+
currentPage = 1,
|
2075
|
+
totalPages = 1,
|
2076
|
+
onPageChange,
|
2077
|
+
itemsPerPage = 0,
|
2078
|
+
totalItems = 0
|
2079
|
+
}) => {
|
2080
|
+
const handlePageClick = (page) => {
|
2081
|
+
if (page >= 1 && page <= totalPages) {
|
2082
|
+
onPageChange?.(page);
|
2083
|
+
}
|
2084
|
+
};
|
2085
|
+
const visibleRangeStart = itemsPerPage === 0 ? 1 : itemsPerPage * (currentPage - 1) + 1;
|
2086
|
+
const visibleRangeEnd = currentPage === totalPages ? totalItems : Math.min(visibleRangeStart + itemsPerPage - 1, totalItems);
|
2087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("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: [
|
2088
|
+
totalItems && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("section", { className: "text-[#717171] text-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { className: "", children: [
|
2089
|
+
"Showing ",
|
2090
|
+
visibleRangeStart,
|
2091
|
+
" - ",
|
2092
|
+
visibleRangeEnd,
|
2093
|
+
" of ",
|
2094
|
+
totalItems
|
2095
|
+
] }) }),
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex items-center justify-center sm:justify-end ", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("nav", { className: " inline-flex gap-x-1 sm:gap-x-[10px] items-center", children: [
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
2098
|
+
"button",
|
2099
|
+
{
|
2100
|
+
onClick: () => handlePageClick(currentPage - 1),
|
2101
|
+
disabled: currentPage === 1,
|
2102
|
+
className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
|
2103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react4.ChevronLeftIcon, { className: "size-5" })
|
2104
|
+
}
|
2105
|
+
),
|
2106
|
+
renderPageNumbers({ currentPage, totalPages, handlePageClick }),
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
2108
|
+
"button",
|
2109
|
+
{
|
2110
|
+
onClick: () => handlePageClick(currentPage + 1),
|
2111
|
+
disabled: currentPage === totalPages,
|
2112
|
+
className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
|
2113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react4.ChevronRightIcon, { className: "size-5" })
|
2114
|
+
}
|
2115
|
+
)
|
2116
|
+
] }) })
|
2117
|
+
] });
|
2118
|
+
};
|
2119
|
+
|
2120
|
+
// src/components/table/TableBody.tsx
|
2121
|
+
var import_react_table = require("@tanstack/react-table");
|
2122
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
2123
|
+
var TableBody = ({
|
2124
|
+
table,
|
2125
|
+
isMobile,
|
2126
|
+
onRowClick,
|
2127
|
+
id
|
2128
|
+
}) => {
|
2129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("relative w-full rounded-b border-0", {}), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("table", { id: id ?? "table", className: "w-full overflow-x-scroll", children: [
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2131
|
+
"tr",
|
2132
|
+
{
|
2133
|
+
className: cn(
|
2134
|
+
" rounded text-[#717171] border-b- bg-[#FCFCFC]",
|
2135
|
+
{}
|
2136
|
+
),
|
2137
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2138
|
+
"th",
|
2139
|
+
{
|
2140
|
+
className: "relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",
|
2141
|
+
colSpan: header.colSpan,
|
2142
|
+
style: {
|
2143
|
+
width: header.getSize()
|
2144
|
+
},
|
2145
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2146
|
+
"div",
|
2147
|
+
{
|
2148
|
+
className: cn("flex items-center", {
|
2149
|
+
"cursor-pointer select-none": header.column.getCanSort()
|
2150
|
+
}),
|
2151
|
+
onClick: header.column.getToggleSortingHandler(),
|
2152
|
+
children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
2153
|
+
header.column.columnDef.header,
|
2154
|
+
header.getContext()
|
2155
|
+
)
|
2156
|
+
}
|
2157
|
+
)
|
2158
|
+
},
|
2159
|
+
header.id
|
2160
|
+
))
|
2161
|
+
},
|
2162
|
+
headerGroup.id
|
2163
|
+
)) }),
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tbody", { className: " pl-2.5", children: table?.getFilteredRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2165
|
+
"tr",
|
2166
|
+
{
|
2167
|
+
className: cn(
|
2168
|
+
"first-letter border-b border-zinc-100",
|
2169
|
+
{
|
2170
|
+
"hover:bg-gray-50": !isMobile
|
2171
|
+
},
|
2172
|
+
{
|
2173
|
+
"hover:bg-gray-50 hover:cursor-pointer": onRowClick
|
2174
|
+
}
|
2175
|
+
),
|
2176
|
+
onClick: () => onRowClick ? onRowClick(row) : {},
|
2177
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2178
|
+
"td",
|
2179
|
+
{
|
2180
|
+
className: cn("", {
|
2181
|
+
// block: false,
|
2182
|
+
}),
|
2183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
2184
|
+
"div",
|
2185
|
+
{
|
2186
|
+
className: cn("", {
|
2187
|
+
"w-max p-4 pl-2.5 text-black text-sm": true
|
2188
|
+
}),
|
2189
|
+
children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
|
2190
|
+
}
|
2191
|
+
)
|
2192
|
+
},
|
2193
|
+
cell.id
|
2194
|
+
))
|
2195
|
+
},
|
2196
|
+
row.id
|
2197
|
+
)) })
|
2198
|
+
] }) });
|
2199
|
+
};
|
2200
|
+
|
2201
|
+
// src/components/table/index.tsx
|
2202
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
2203
|
+
var Table = ({
|
2204
|
+
table,
|
2205
|
+
isMobile = false,
|
2206
|
+
onRowClick,
|
2207
|
+
id,
|
2208
|
+
onRefetch,
|
2209
|
+
isRefetching,
|
2210
|
+
FilterMenu,
|
2211
|
+
ExtraNode,
|
2212
|
+
//deprecated: onExport - use download
|
2213
|
+
onExport,
|
2214
|
+
search = {
|
2215
|
+
enabled: false,
|
2216
|
+
debounceRate: 700
|
2217
|
+
},
|
2218
|
+
download = {
|
2219
|
+
enabled: false,
|
2220
|
+
buttonId: "download_button",
|
2221
|
+
buttonText: "Export"
|
2222
|
+
},
|
2223
|
+
isLoading,
|
2224
|
+
pagination
|
2225
|
+
}) => {
|
2226
|
+
const handleRefetch = () => {
|
2227
|
+
try {
|
2228
|
+
onRefetch?.();
|
2229
|
+
} catch (e) {
|
2230
|
+
console.error("Error while refetching data", e);
|
2231
|
+
}
|
2232
|
+
};
|
2233
|
+
const handleSearch = (e) => {
|
2234
|
+
search?.onSearch?.(e);
|
2235
|
+
};
|
2236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("relative w-full rounded-b border-0 overflow-x-auto"), children: [
|
2237
|
+
(onRefetch || search?.enabled || FilterMenu || ExtraNode || onExport) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2", children: [
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: " w-full flex gap-x-3", children: [
|
2239
|
+
search?.enabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("section", { className: "sm:w-56", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2240
|
+
DebouncedInput,
|
2241
|
+
{
|
2242
|
+
type: "text",
|
2243
|
+
placeholder: "Enter search here...",
|
2244
|
+
className: "h-9",
|
2245
|
+
onChange: handleSearch,
|
2246
|
+
debounce: search?.debounceRate
|
2247
|
+
}
|
2248
|
+
) }),
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: " flex gap-2", children: [
|
2250
|
+
onRefetch && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2251
|
+
Button,
|
2252
|
+
{
|
2253
|
+
onClick: handleRefetch,
|
2254
|
+
title: "Refetch Data",
|
2255
|
+
disabled: isRefetching,
|
2256
|
+
variant: "outlined",
|
2257
|
+
className: "!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",
|
2258
|
+
size: "sm",
|
2259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2260
|
+
import_lucide_react5.RotateCw,
|
2261
|
+
{
|
2262
|
+
className: cn("w-4 h-4", {
|
2263
|
+
"animate-spin": isRefetching
|
2264
|
+
}),
|
2265
|
+
size: 5
|
2266
|
+
}
|
2267
|
+
)
|
2268
|
+
}
|
2269
|
+
),
|
2270
|
+
FilterMenu && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2271
|
+
Popover,
|
2272
|
+
{
|
2273
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2274
|
+
"button",
|
2275
|
+
{
|
2276
|
+
title: "Filter",
|
2277
|
+
className: cn(
|
2278
|
+
"!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",
|
2279
|
+
buttonVariants({
|
2280
|
+
variant: "outlined",
|
2281
|
+
size: "sm"
|
2282
|
+
})
|
2283
|
+
),
|
2284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react5.ListFilter, { className: "w-4 h-4", size: 5 })
|
2285
|
+
}
|
2286
|
+
),
|
2287
|
+
children: FilterMenu
|
2288
|
+
}
|
2289
|
+
)
|
2290
|
+
] })
|
2291
|
+
] }) }),
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-start flex-col gap-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("section", { className: "flex flex-col-reverse sm:flex-row gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex gap-2", children: [
|
2293
|
+
ExtraNode && ExtraNode,
|
2294
|
+
onExport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "primary", onClick: onExport, size: "sm", children: "Export" }),
|
2295
|
+
download?.enabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2296
|
+
Button,
|
2297
|
+
{
|
2298
|
+
variant: "primary",
|
2299
|
+
leftNode: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2300
|
+
import_lucide_react5.Download,
|
2301
|
+
{
|
2302
|
+
className: cn("w-4 h-4", {
|
2303
|
+
"animate-spin": isRefetching
|
2304
|
+
}),
|
2305
|
+
size: 5
|
2306
|
+
}
|
2307
|
+
),
|
2308
|
+
onClick: download?.onDownload,
|
2309
|
+
id: download.buttonId,
|
2310
|
+
size: "sm",
|
2311
|
+
children: download?.buttonText
|
2312
|
+
}
|
2313
|
+
)
|
2314
|
+
] }) }) })
|
2315
|
+
] }),
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("main", { className: "w-full overflow-x-auto mt-5", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "py-10 flex flex-col justify-center w-full items-center space-x-2", children: [
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react5.Loader, { size: 20, className: "animate-spin" }),
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse", children: "Loading..." })
|
2319
|
+
] }) : table.getRowModel().rows.length < 1 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "py-10 flex flex-col justify-center w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-center text-gray-600 text-sm opacity-70", children: "No data available" }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2320
|
+
TableBody,
|
2321
|
+
{
|
2322
|
+
table,
|
2323
|
+
isMobile,
|
2324
|
+
onRowClick,
|
2325
|
+
id
|
2326
|
+
}
|
2327
|
+
) }) }),
|
2328
|
+
!isLoading && pagination?.enabled && table.getRowModel().rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
2329
|
+
Pagination,
|
2330
|
+
{
|
2331
|
+
...pagination,
|
2332
|
+
currentPage: pagination?.currentPage ?? 1,
|
2333
|
+
totalPages: pagination?.totalPages ?? Math.ceil(
|
2334
|
+
(pagination?.totalItems ?? 0) / Math.max(pagination?.itemsPerPage ?? 1, 1)
|
2335
|
+
) ?? 1,
|
2336
|
+
onPageChange: (page) => pagination?.onPageChange?.(page)
|
2337
|
+
}
|
2338
|
+
)
|
2339
|
+
] });
|
2340
|
+
};
|
2341
|
+
|
2342
|
+
// src/components/dev-banner/index.tsx
|
2343
|
+
var import_react8 = require("react");
|
2344
|
+
var import_lucide_react6 = require("lucide-react");
|
2345
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
2346
|
+
var DevBanner = (props) => {
|
2347
|
+
const {
|
2348
|
+
environment,
|
2349
|
+
branch,
|
2350
|
+
version,
|
2351
|
+
deployTime,
|
2352
|
+
showBanner,
|
2353
|
+
onClose,
|
2354
|
+
initDefault,
|
2355
|
+
removeFromStorage,
|
2356
|
+
syncLocalStorageToState
|
2357
|
+
} = props;
|
2358
|
+
const currentEnv = environment || process.env.NEXT_PUBLIC_NODE_ENV;
|
2359
|
+
if (currentEnv !== "staging" && currentEnv !== "sandbox") {
|
2360
|
+
return null;
|
2361
|
+
}
|
2362
|
+
(0, import_react8.useEffect)(() => {
|
2363
|
+
syncLocalStorageToState();
|
2364
|
+
}, [syncLocalStorageToState]);
|
2365
|
+
(0, import_react8.useEffect)(() => {
|
2366
|
+
let interval;
|
2367
|
+
if (currentEnv === "staging" || currentEnv === "sandbox") {
|
2368
|
+
interval = setInterval(
|
2369
|
+
() => {
|
2370
|
+
removeFromStorage();
|
2371
|
+
initDefault();
|
2372
|
+
},
|
2373
|
+
5 * 60 * 1e3
|
2374
|
+
// 5 minutes in milliseconds
|
2375
|
+
);
|
2376
|
+
}
|
2377
|
+
return () => {
|
2378
|
+
if (interval) {
|
2379
|
+
clearInterval(interval);
|
2380
|
+
}
|
2381
|
+
};
|
2382
|
+
}, [
|
2383
|
+
showBanner,
|
2384
|
+
environment,
|
2385
|
+
onClose,
|
2386
|
+
removeFromStorage,
|
2387
|
+
initDefault,
|
2388
|
+
currentEnv
|
2389
|
+
]);
|
2390
|
+
if (!showBanner) return null;
|
2391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96", children: [
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { onClick: onClose, className: "absolute top-2 right-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react6.X, {}) }),
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-2 text-sm", children: [
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-2", children: [
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "Environment:" }),
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-blue-600 capitalize", children: currentEnv })
|
2397
|
+
] }),
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-2", children: [
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "Branch:" }),
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-green-600 capitalize", children: branch || process.env.NEXT_PUBLIC_DEPLOY_BRANCH })
|
2401
|
+
] }),
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-2", children: [
|
2403
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "Version:" }),
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-purple-600", children: version || process.env.NEXT_PUBLIC_DEPLOY_VERSION })
|
2405
|
+
] }),
|
2406
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-2", children: [
|
2407
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "Deploy Time:" }),
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-orange-600", children: deployTime || process.env.NEXT_PUBLIC_DEPLOY_TIME })
|
2409
|
+
] })
|
2410
|
+
] })
|
2411
|
+
] });
|
2412
|
+
};
|
2413
|
+
|
2414
|
+
// src/components/banner/index.tsx
|
2415
|
+
var import_react9 = require("react");
|
2416
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
2417
|
+
var Icon = ({ type }) => {
|
2418
|
+
if (type === "gray") {
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2420
|
+
"svg",
|
2421
|
+
{
|
2422
|
+
width: "20",
|
2423
|
+
height: "20",
|
2424
|
+
viewBox: "0 0 20 20",
|
2425
|
+
fill: "none",
|
2426
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2428
|
+
"path",
|
2429
|
+
{
|
2430
|
+
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",
|
2431
|
+
fill: "#79818C"
|
2432
|
+
}
|
2433
|
+
)
|
2434
|
+
}
|
2435
|
+
);
|
2436
|
+
} else if (type === "info") {
|
2437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2438
|
+
"svg",
|
2439
|
+
{
|
2440
|
+
stroke: "#70B6F6",
|
2441
|
+
fill: "#70B6F6",
|
2442
|
+
"stroke-width": "0",
|
2443
|
+
viewBox: "0 0 16 16",
|
2444
|
+
height: "24",
|
2445
|
+
width: "24",
|
2446
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2" })
|
2448
|
+
}
|
2449
|
+
);
|
2450
|
+
} else if (type === "warning") {
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2452
|
+
"svg",
|
2453
|
+
{
|
2454
|
+
width: "20",
|
2455
|
+
height: "20",
|
2456
|
+
viewBox: "0 0 20 20",
|
2457
|
+
fill: "none",
|
2458
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2460
|
+
"path",
|
2461
|
+
{
|
2462
|
+
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",
|
2463
|
+
fill: "#FFC700"
|
2464
|
+
}
|
2465
|
+
)
|
2466
|
+
}
|
2467
|
+
);
|
2468
|
+
} else if (type === "success") {
|
2469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2470
|
+
"svg",
|
2471
|
+
{
|
2472
|
+
width: "24",
|
2473
|
+
height: "24",
|
2474
|
+
viewBox: "0 0 24 24",
|
2475
|
+
fill: "none",
|
2476
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2478
|
+
"path",
|
2479
|
+
{
|
2480
|
+
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",
|
2481
|
+
fill: "#00D488"
|
2482
|
+
}
|
2483
|
+
)
|
2484
|
+
}
|
2485
|
+
);
|
2486
|
+
} else {
|
2487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2488
|
+
"svg",
|
2489
|
+
{
|
2490
|
+
width: "20",
|
2491
|
+
height: "20",
|
2492
|
+
viewBox: "0 0 20 20",
|
2493
|
+
fill: "none",
|
2494
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2496
|
+
"path",
|
2497
|
+
{
|
2498
|
+
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",
|
2499
|
+
fill: "#F04248"
|
2500
|
+
}
|
2501
|
+
)
|
2502
|
+
}
|
2503
|
+
);
|
2504
|
+
}
|
2505
|
+
};
|
2506
|
+
var Banner = ({
|
2507
|
+
type = "info",
|
2508
|
+
title,
|
2509
|
+
description,
|
2510
|
+
open,
|
2511
|
+
showCloseButton,
|
2512
|
+
bottomNode,
|
2513
|
+
sideNode,
|
2514
|
+
onClose,
|
2515
|
+
showIcon = true
|
2516
|
+
}) => {
|
2517
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(open);
|
2518
|
+
(0, import_react9.useEffect)(() => {
|
2519
|
+
setIsOpen(open);
|
2520
|
+
}, [open]);
|
2521
|
+
let bgColor = "";
|
2522
|
+
let stripeColor = "";
|
2523
|
+
switch (type) {
|
2524
|
+
case "gray":
|
2525
|
+
bgColor = "#eeeef0";
|
2526
|
+
stripeColor = "#79818c";
|
2527
|
+
break;
|
2528
|
+
case "info":
|
2529
|
+
bgColor = "#ebf5fd";
|
2530
|
+
stripeColor = "#70B6F6";
|
2531
|
+
break;
|
2532
|
+
case "warning":
|
2533
|
+
bgColor = "#fff8df";
|
2534
|
+
stripeColor = "#ffc700";
|
2535
|
+
break;
|
2536
|
+
case "success":
|
2537
|
+
bgColor = "#e0f9f0";
|
2538
|
+
stripeColor = "#49e0aa";
|
2539
|
+
break;
|
2540
|
+
case "danger":
|
2541
|
+
bgColor = "#fde8e9";
|
2542
|
+
stripeColor = "#f3777c";
|
2543
|
+
break;
|
2544
|
+
default:
|
2545
|
+
bgColor = "#eeeef0";
|
2546
|
+
stripeColor = "#79818c";
|
2547
|
+
break;
|
2548
|
+
}
|
2549
|
+
function handleClose() {
|
2550
|
+
setIsOpen(false);
|
2551
|
+
if (onClose) {
|
2552
|
+
onClose();
|
2553
|
+
}
|
2554
|
+
}
|
2555
|
+
if (!isOpen) {
|
2556
|
+
return null;
|
2557
|
+
}
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
2559
|
+
"div",
|
2560
|
+
{
|
2561
|
+
className: "w-full shadow-lg transform flex items-center rounded-md",
|
2562
|
+
style: {
|
2563
|
+
background: bgColor || "#ebf5fd"
|
2564
|
+
},
|
2565
|
+
children: [
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2567
|
+
"div",
|
2568
|
+
{
|
2569
|
+
className: "flex-none absolute rounded-l-[2px] rounded-l-4px h-[4px] w-full top-0",
|
2570
|
+
style: {
|
2571
|
+
background: stripeColor || "#70B6F6"
|
2572
|
+
}
|
2573
|
+
}
|
2574
|
+
),
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-full gap-3 h-full flex flex-row justify-between px-4 md:px-4 py-3 md:py-4", children: [
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-row gap-2.5 items-start w-full h-full", children: [
|
2577
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-full flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { type }) }),
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-full gap-3 h-full flex flex-col md:flex-row items-start justify-between", children: [
|
2579
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 gap-3 h-full flex flex-col items-start justify-between", children: [
|
2580
|
+
(title || description) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
2581
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-sm font-bold text-[#191919]", children: title }),
|
2582
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-sm font-normal text-[#5D5D5D] mt-1", children: description })
|
2583
|
+
] }),
|
2584
|
+
bottomNode
|
2585
|
+
] }),
|
2586
|
+
sideNode
|
2587
|
+
] })
|
2588
|
+
] }),
|
2589
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-1/10 h-full flex flex-col justify-start items-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
2590
|
+
"svg",
|
2591
|
+
{
|
2592
|
+
width: "16",
|
2593
|
+
height: "16",
|
2594
|
+
viewBox: "0 0 16 16",
|
2595
|
+
fill: "none",
|
2596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2597
|
+
children: [
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2599
|
+
"path",
|
2600
|
+
{
|
2601
|
+
d: "M3.3335 3.33337L12.6662 12.6661",
|
2602
|
+
stroke: "#191919",
|
2603
|
+
strokeWidth: "1.5",
|
2604
|
+
strokeLinecap: "round",
|
2605
|
+
strokeLinejoin: "round"
|
2606
|
+
}
|
2607
|
+
),
|
2608
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
2609
|
+
"path",
|
2610
|
+
{
|
2611
|
+
d: "M3.33429 12.6661L12.667 3.33337",
|
2612
|
+
stroke: "#191919",
|
2613
|
+
strokeWidth: "1.5",
|
2614
|
+
strokeLinecap: "round",
|
2615
|
+
strokeLinejoin: "round"
|
2616
|
+
}
|
2617
|
+
)
|
2618
|
+
]
|
2619
|
+
}
|
2620
|
+
) }) })
|
2621
|
+
] })
|
2622
|
+
]
|
2623
|
+
}
|
2624
|
+
);
|
2625
|
+
};
|
2626
|
+
|
2627
|
+
// src/components/locale-selctor/icons/Check.tsx
|
2628
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
2629
|
+
var Check2 = () => {
|
2630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
2631
|
+
"svg",
|
2632
|
+
{
|
2633
|
+
stroke: "currentColor",
|
2634
|
+
fill: "currentColor",
|
2635
|
+
strokeWidth: "0",
|
2636
|
+
viewBox: "0 0 20 20",
|
2637
|
+
"aria-hidden": "true",
|
2638
|
+
className: "h-5 w-5",
|
2639
|
+
height: "1em",
|
2640
|
+
width: "1em",
|
2641
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2642
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
2643
|
+
"path",
|
2644
|
+
{
|
2645
|
+
fillRule: "evenodd",
|
2646
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
2647
|
+
clipRule: "evenodd"
|
2648
|
+
}
|
2649
|
+
)
|
2650
|
+
}
|
2651
|
+
);
|
2652
|
+
};
|
2653
|
+
|
2654
|
+
// src/components/locale-selctor/icons/EnglishFlag.tsx
|
2655
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
2656
|
+
var EnglishFlag = (props) => {
|
2657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
2658
|
+
"svg",
|
2659
|
+
{
|
2660
|
+
viewBox: "0 0 60 30",
|
2661
|
+
className: "w-full max-w-md h-auto",
|
2662
|
+
"aria-label": "Union Jack - Flag of the United Kingdom",
|
2663
|
+
...props,
|
2664
|
+
children: [
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("rect", { width: "60", height: "30", fill: "#00247D" }),
|
2666
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M0,0 L60,30 M60,0 L0,30", stroke: "#FFFFFF", strokeWidth: "6" }),
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M0,0 L60,30 M60,0 L0,30", stroke: "#CF142B", strokeWidth: "4" }),
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M30,0 L30,30 M0,15 L60,15", stroke: "#FFFFFF", strokeWidth: "10" }),
|
2669
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M30,0 L30,30 M0,15 L60,15", stroke: "#CF142B", strokeWidth: "6" })
|
2670
|
+
]
|
2671
|
+
}
|
2672
|
+
);
|
2673
|
+
};
|
2674
|
+
|
2675
|
+
// src/components/locale-selctor/icons/FrenchFlag.tsx
|
2676
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
2677
|
+
var FrenchFlag = (props) => {
|
2678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
2679
|
+
"svg",
|
2680
|
+
{
|
2681
|
+
viewBox: "0 0 60 40",
|
2682
|
+
className: "w-full max-w-md h-auto",
|
2683
|
+
"aria-label": "Tricolore - Flag of France",
|
2684
|
+
...props,
|
2685
|
+
children: [
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("rect", { x: "0", y: "0", width: "20", height: "40", fill: "#002395" }),
|
2687
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("rect", { x: "20", y: "0", width: "20", height: "40", fill: "#FFFFFF" }),
|
2688
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("rect", { x: "40", y: "0", width: "20", height: "40", fill: "#ED2939" })
|
2689
|
+
]
|
2690
|
+
}
|
2691
|
+
);
|
2692
|
+
};
|
2693
|
+
|
2694
|
+
// src/components/locale-selctor/icons/UpDownIcon.tsx
|
2695
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
2696
|
+
var UpDownIcon = () => {
|
2697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
2698
|
+
"svg",
|
2699
|
+
{
|
2700
|
+
width: "20",
|
2701
|
+
height: "18",
|
2702
|
+
viewBox: "0 0 8 18",
|
2703
|
+
fill: "none",
|
2704
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2705
|
+
children: [
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
2707
|
+
"path",
|
2708
|
+
{
|
2709
|
+
d: "M5.50257 12.9395L3.68439 14.7576L1.86621 12.9395",
|
2710
|
+
stroke: "currentColor",
|
2711
|
+
strokeLinecap: "round",
|
2712
|
+
strokeLinejoin: "round"
|
2713
|
+
}
|
2714
|
+
),
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
2716
|
+
"path",
|
2717
|
+
{
|
2718
|
+
d: "M5.50257 5.06055L3.68439 3.24237L1.86621 5.06055",
|
2719
|
+
stroke: "currentColor",
|
2720
|
+
strokeLinecap: "round",
|
2721
|
+
strokeLinejoin: "round"
|
2722
|
+
}
|
2723
|
+
)
|
2724
|
+
]
|
2725
|
+
}
|
2726
|
+
);
|
2727
|
+
};
|
2728
|
+
|
2729
|
+
// src/components/locale-selctor/index.tsx
|
2730
|
+
var import_react_popover = require("@radix-ui/react-popover");
|
2731
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
2732
|
+
var localeListOptons = [
|
2733
|
+
{
|
2734
|
+
key: "en",
|
2735
|
+
label: "English"
|
2736
|
+
},
|
2737
|
+
{
|
2738
|
+
key: "fr",
|
2739
|
+
label: "French"
|
2740
|
+
}
|
2741
|
+
];
|
2742
|
+
var LocaleIcon = ({ locale }) => {
|
2743
|
+
if (locale === "fr") return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FrenchFlag, { width: 10 });
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EnglishFlag, { width: 10 });
|
2745
|
+
};
|
2746
|
+
var LocaleTrigger = ({ locale }) => {
|
2747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-2 py-1 ", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(LocaleIcon, { locale }),
|
2749
|
+
" ",
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "uppercase", children: locale }),
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UpDownIcon, {})
|
2752
|
+
] }) });
|
2753
|
+
};
|
2754
|
+
var LocaleSelector = ({
|
2755
|
+
locale = "en",
|
2756
|
+
onChange,
|
2757
|
+
locales = localeListOptons
|
2758
|
+
}) => {
|
2759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(PopoverRoot, { children: [
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex items-center gap-2 px-2 py-1 rounded-lg shadow border-[0.5px] border-gray-50/50 text-current bg-white/10 ", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PopoverTrigger, { className: "!p-0 !bg-transparent ", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(LocaleTrigger, { locale }) }) }),
|
2761
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
2762
|
+
PopoverContent,
|
2763
|
+
{
|
2764
|
+
side: "bottom",
|
2765
|
+
className: "p-0 max-w-max rounded-md overflow-hidden mx-auto mt-2",
|
2766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: locales?.map((_locale) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
2767
|
+
import_react_popover.PopoverClose,
|
2768
|
+
{
|
2769
|
+
type: "button",
|
2770
|
+
className: cn(
|
2771
|
+
"flex items-center gap-3 px-3 py-1 text-sm hover:bg-blue-50 w-full transition-all",
|
2772
|
+
{ "bg-blue-100": locale && locale === _locale?.key }
|
2773
|
+
),
|
2774
|
+
onClick: () => onChange?.(_locale?.key),
|
2775
|
+
children: [
|
2776
|
+
_locale?.label,
|
2777
|
+
" ",
|
2778
|
+
locale && locale === _locale?.key && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Check2, {})
|
2779
|
+
]
|
2780
|
+
},
|
2781
|
+
_locale?.key
|
2782
|
+
)) })
|
2783
|
+
}
|
2784
|
+
)
|
2785
|
+
] });
|
2786
|
+
};
|
2787
|
+
|
2788
|
+
// src/components/drawer/index.tsx
|
2789
|
+
var React14 = __toESM(require("react"));
|
2790
|
+
var import_vaul = require("vaul");
|
2791
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
2792
|
+
var import_react_use = require("react-use");
|
2793
|
+
|
2794
|
+
// src/components/drawer/icon/CloseIcon.tsx
|
2795
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
2796
|
+
var CloseIcon2 = () => {
|
2797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
2798
|
+
"svg",
|
2799
|
+
{
|
2800
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2801
|
+
width: "24",
|
2802
|
+
height: "24",
|
2803
|
+
viewBox: "0 0 24 24",
|
2804
|
+
fill: "none",
|
2805
|
+
stroke: "currentColor",
|
2806
|
+
strokeWidth: "2",
|
2807
|
+
strokeLinecap: "round",
|
2808
|
+
strokeLinejoin: "round",
|
2809
|
+
className: "lucide lucide-x",
|
2810
|
+
children: [
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { d: "M18 6 6 18" }),
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { d: "m6 6 12 12" })
|
2813
|
+
]
|
2814
|
+
}
|
2815
|
+
);
|
2816
|
+
};
|
2817
|
+
|
2818
|
+
// src/components/drawer/index.tsx
|
2819
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
2820
|
+
var DrawerRoot = ({
|
2821
|
+
shouldScaleBackground = true,
|
2822
|
+
...props
|
2823
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2824
|
+
import_vaul.Drawer.Root,
|
2825
|
+
{
|
2826
|
+
direction: "right",
|
2827
|
+
shouldScaleBackground,
|
2828
|
+
...props
|
2829
|
+
}
|
2830
|
+
);
|
2831
|
+
DrawerRoot.displayName = "Drawer";
|
2832
|
+
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
2833
|
+
var DrawerClose = import_vaul.Drawer.Close;
|
2834
|
+
var DrawerPortal = import_vaul.Drawer.Portal;
|
2835
|
+
var DrawerOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2836
|
+
import_vaul.Drawer.Overlay,
|
2837
|
+
{
|
2838
|
+
className: cn(
|
2839
|
+
"fixed inset-0 z-40 bg-black/75 !m-0 !p-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
2840
|
+
className
|
2841
|
+
),
|
2842
|
+
...props,
|
2843
|
+
ref
|
2844
|
+
}
|
2845
|
+
));
|
2846
|
+
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
|
2847
|
+
var DrawerVariants = (0, import_class_variance_authority6.cva)(
|
2848
|
+
"fixed focus-visible:outline-0 z-50 gap-4 bg-white shadow-lg dark:bg-[#2B2B2B] dark:text-white transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:border-none",
|
2849
|
+
{
|
2850
|
+
variants: {
|
2851
|
+
side: {
|
2852
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top rounded-b-lg",
|
2853
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom rounded-t-lg",
|
2854
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-[512px] ",
|
2855
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-[512px]"
|
2856
|
+
}
|
2857
|
+
},
|
2858
|
+
defaultVariants: {
|
2859
|
+
side: "right"
|
2860
|
+
}
|
2861
|
+
}
|
2862
|
+
);
|
2863
|
+
var DrawerContent = React14.forwardRef(({ side = "right", hideCloseButton, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(DrawerPortal, { children: [
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DrawerOverlay, {}),
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
2866
|
+
import_vaul.Drawer.Content,
|
2867
|
+
{
|
2868
|
+
ref,
|
2869
|
+
className: cn(DrawerVariants({ side }), className),
|
2870
|
+
...props,
|
2871
|
+
children: [
|
2872
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "bg-gray-300 block md:hidden mx-auto mt-4 h-1.5 w-[80px] rounded-full opacity-70 transition-opacity hover:opacity-100" }),
|
2873
|
+
children,
|
2874
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_vaul.Drawer.Close, { className: "absolute right-2 top-3 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-secondary", children: [
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CloseIcon2, {}),
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "sr-only", children: "Close" })
|
2877
|
+
] })
|
2878
|
+
]
|
2879
|
+
}
|
2880
|
+
)
|
2881
|
+
] }));
|
2882
|
+
DrawerContent.displayName = import_vaul.Drawer.Content.displayName;
|
2883
|
+
var DrawerHeader = ({
|
2884
|
+
className,
|
2885
|
+
...props
|
2886
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2887
|
+
"div",
|
2888
|
+
{
|
2889
|
+
className: cn(
|
2890
|
+
"text-2xl flex flex-col border-b-0 border-b-gray-200 space-y-1 text-left w-full p-3 py-4",
|
2891
|
+
className
|
2892
|
+
),
|
2893
|
+
...props
|
2894
|
+
}
|
2895
|
+
);
|
2896
|
+
DrawerHeader.displayName = "DrawerHeader";
|
2897
|
+
var DrawerFooter = ({
|
2898
|
+
className,
|
2899
|
+
...props
|
2900
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2901
|
+
"div",
|
2902
|
+
{
|
2903
|
+
className: cn(
|
2904
|
+
"flex flex-col-reverse sm:flex-row m-auto right-0 left-0 p-3 sm:space-x-2 border-t border-t-[#EDEDED] dark:border-t-[#242424] w-full",
|
2905
|
+
className
|
2906
|
+
),
|
2907
|
+
...props
|
2908
|
+
}
|
2909
|
+
);
|
2910
|
+
DrawerFooter.displayName = "DrawerFooter";
|
2911
|
+
var DrawerTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2912
|
+
import_vaul.Drawer.Title,
|
2913
|
+
{
|
2914
|
+
ref,
|
2915
|
+
className: cn(
|
2916
|
+
"text-xl font-semibold text-[#191919] dark:text-white",
|
2917
|
+
className
|
2918
|
+
),
|
2919
|
+
...props
|
2920
|
+
}
|
2921
|
+
));
|
2922
|
+
DrawerTitle.displayName = import_vaul.Drawer.Title.displayName;
|
2923
|
+
var DrawerDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2924
|
+
import_vaul.Drawer.Description,
|
2925
|
+
{
|
2926
|
+
ref,
|
2927
|
+
className: cn("text-xs text-[#5d5c5c] dark:text-white", className),
|
2928
|
+
...props
|
2929
|
+
}
|
2930
|
+
));
|
2931
|
+
DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
|
2932
|
+
var Drawer = ({
|
2933
|
+
trigger = void 0,
|
2934
|
+
children,
|
2935
|
+
open = void 0,
|
2936
|
+
onOpenChange = void 0,
|
2937
|
+
hideCloseButton,
|
2938
|
+
footer,
|
2939
|
+
title,
|
2940
|
+
description,
|
2941
|
+
contentClassName,
|
2942
|
+
headerClassName,
|
2943
|
+
titleClassName,
|
2944
|
+
descriptionClassName,
|
2945
|
+
footerClassName,
|
2946
|
+
asChild = true,
|
2947
|
+
onOpenAutoFocus,
|
2948
|
+
onCloseAutoFocus
|
2949
|
+
}) => {
|
2950
|
+
const { width } = (0, import_react_use.useWindowSize)();
|
2951
|
+
const direction = width < 768 ? "bottom" : "right";
|
2952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(DrawerRoot, { open, onOpenChange, direction, children: [
|
2953
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DrawerTrigger, { className: "cursor-pointer", asChild, children: trigger }),
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
2955
|
+
DrawerContent,
|
2956
|
+
{
|
2957
|
+
className: cn(
|
2958
|
+
"flex flex-col gap-0 justify-start items-start max-h-[90vh] md:max-h-full w-full",
|
2959
|
+
contentClassName
|
2960
|
+
),
|
2961
|
+
side: direction,
|
2962
|
+
hideCloseButton,
|
2963
|
+
onOpenAutoFocus,
|
2964
|
+
onCloseAutoFocus,
|
2965
|
+
children: [
|
2966
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(DrawerHeader, { className: headerClassName, children: [
|
2967
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DrawerTitle, { className: titleClassName, children: title }),
|
2968
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DrawerDescription, { className: descriptionClassName, children: description })
|
2969
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, {}),
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
2971
|
+
"div",
|
2972
|
+
{
|
2973
|
+
className: cn(
|
2974
|
+
"flex w-full overflow-y-auto flex-col justify-start items-start p-4 flex-1 h-[30px]"
|
2975
|
+
),
|
2976
|
+
children
|
2977
|
+
}
|
2978
|
+
),
|
2979
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DrawerFooter, { className: footerClassName, children: footer })
|
2980
|
+
]
|
2981
|
+
}
|
2982
|
+
)
|
2983
|
+
] });
|
2984
|
+
};
|
2985
|
+
|
2986
|
+
// src/actions/amount.action.ts
|
2987
|
+
var CurrencySymbolMap = {
|
2988
|
+
USD: "$",
|
2989
|
+
CAD: "CA$",
|
2990
|
+
EUR: "\u20AC",
|
2991
|
+
AED: "AED",
|
2992
|
+
AFN: "Af",
|
2993
|
+
ALL: "ALL",
|
2994
|
+
AMD: "AMD",
|
2995
|
+
ARS: "AR$",
|
2996
|
+
AUD: "AU$",
|
2997
|
+
AZN: "man.",
|
2998
|
+
BAM: "KM",
|
2999
|
+
BDT: "Tk",
|
3000
|
+
BGN: "BGN",
|
3001
|
+
BHD: "BD",
|
3002
|
+
BIF: "FBu",
|
3003
|
+
BND: "BN$",
|
3004
|
+
BOB: "Bs",
|
3005
|
+
BRL: "R$",
|
3006
|
+
BWP: "BWP",
|
3007
|
+
BYN: "Br",
|
3008
|
+
BZD: "BZ$",
|
3009
|
+
CDF: "CDF",
|
3010
|
+
CHF: "CHF",
|
3011
|
+
CLP: "CL$",
|
3012
|
+
CNY: "CN\xA5",
|
3013
|
+
COP: "CO$",
|
3014
|
+
CRC: "\u20A1",
|
3015
|
+
CVE: "CV$",
|
3016
|
+
CZK: "K\u010D",
|
3017
|
+
DJF: "Fdj",
|
3018
|
+
DKK: "Dkr",
|
3019
|
+
DOP: "RD$",
|
3020
|
+
DZD: "DA",
|
3021
|
+
EEK: "Ekr",
|
3022
|
+
EGP: "EGP",
|
3023
|
+
ERN: "Nfk",
|
3024
|
+
ETB: "Br",
|
3025
|
+
GBP: "\xA3",
|
3026
|
+
GEL: "GEL",
|
3027
|
+
GHS: "GH\u20B5",
|
3028
|
+
GNF: "FG",
|
3029
|
+
GTQ: "GTQ",
|
3030
|
+
HKD: "HK$",
|
3031
|
+
HNL: "HNL",
|
3032
|
+
HRK: "kn",
|
3033
|
+
HUF: "Ft",
|
3034
|
+
IDR: "Rp",
|
3035
|
+
ILS: "\u20AA",
|
3036
|
+
INR: "\u20B9",
|
3037
|
+
IQD: "IQD",
|
3038
|
+
IRR: "IRR",
|
3039
|
+
ISK: "Ikr",
|
3040
|
+
JMD: "J$",
|
3041
|
+
JOD: "JD",
|
3042
|
+
JPY: "\xA5",
|
3043
|
+
KES: "Ksh",
|
3044
|
+
KHR: "KHR",
|
3045
|
+
KMF: "CF",
|
3046
|
+
KRW: "\u20A9",
|
3047
|
+
KWD: "KD",
|
3048
|
+
KZT: "KZT",
|
3049
|
+
LBP: "L.L.",
|
3050
|
+
LKR: "SLRs",
|
3051
|
+
LTL: "Lt",
|
3052
|
+
LVL: "Ls",
|
3053
|
+
LYD: "LD",
|
3054
|
+
MAD: "MAD",
|
3055
|
+
MDL: "MDL",
|
3056
|
+
MGA: "MGA",
|
3057
|
+
MKD: "MKD",
|
3058
|
+
MMK: "MMK",
|
3059
|
+
MOP: "MOP$",
|
3060
|
+
MUR: "MURs",
|
3061
|
+
MXN: "MX$",
|
3062
|
+
MYR: "RM",
|
3063
|
+
MZN: "MTn",
|
3064
|
+
NAD: "N$",
|
3065
|
+
NGN: "\u20A6",
|
3066
|
+
NIO: "C$",
|
3067
|
+
NOK: "Nkr",
|
3068
|
+
NPR: "NPRs",
|
3069
|
+
NZD: "NZ$",
|
3070
|
+
OMR: "OMR",
|
3071
|
+
PAB: "B/.",
|
3072
|
+
PEN: "S/.",
|
3073
|
+
PHP: "\u20B1",
|
3074
|
+
PKR: "PKRs",
|
3075
|
+
PLN: "z\u0142",
|
3076
|
+
PYG: "\u20B2",
|
3077
|
+
QAR: "QR",
|
3078
|
+
RON: "RON",
|
3079
|
+
RSD: "din.",
|
3080
|
+
RUB: "RUB",
|
3081
|
+
RWF: "RWF",
|
3082
|
+
SAR: "SR",
|
3083
|
+
SDG: "SDG",
|
3084
|
+
SEK: "Skr",
|
3085
|
+
SGD: "S$",
|
3086
|
+
SOS: "Ssh",
|
3087
|
+
SYP: "SY\xA3",
|
3088
|
+
THB: "\u0E3F",
|
3089
|
+
TND: "DT",
|
3090
|
+
TOP: "T$",
|
3091
|
+
TRY: "TL",
|
3092
|
+
TTD: "TT$",
|
3093
|
+
TWD: "NT$",
|
3094
|
+
TZS: "TSh",
|
3095
|
+
UAH: "\u20B4",
|
3096
|
+
UGX: "USh",
|
3097
|
+
UYU: "$U",
|
3098
|
+
UZS: "UZS",
|
3099
|
+
VEF: "Bs.F.",
|
3100
|
+
VND: "\u20AB",
|
3101
|
+
XAF: "F CFA",
|
3102
|
+
XOF: "CFA",
|
3103
|
+
YER: "YR",
|
3104
|
+
ZAR: "R",
|
3105
|
+
ZMK: "ZK",
|
3106
|
+
ZWL: "ZWL$"
|
3107
|
+
};
|
3108
|
+
var _AmountAction = class _AmountAction {
|
3109
|
+
static getCurrencyLocaleMap(currency) {
|
3110
|
+
const localeMap = {
|
3111
|
+
XOF: "fr",
|
3112
|
+
XAF: "fr"
|
3113
|
+
};
|
3114
|
+
return localeMap[currency] || "en";
|
3115
|
+
}
|
3116
|
+
static koboToNaira(amount) {
|
3117
|
+
return +amount / 100;
|
3118
|
+
}
|
3119
|
+
static nairaToKobo(amount) {
|
3120
|
+
return +amount * 100;
|
3121
|
+
}
|
3122
|
+
static getCurrencySymbol(currency) {
|
3123
|
+
return CurrencySymbolMap[currency] || currency;
|
3124
|
+
}
|
3125
|
+
};
|
3126
|
+
__publicField(_AmountAction, "formatAmountAndCurrency", (currency, value, options) => {
|
3127
|
+
const formatted = new Intl.NumberFormat(
|
3128
|
+
options?.locale || _AmountAction.getCurrencyLocaleMap(currency),
|
3129
|
+
{
|
3130
|
+
maximumFractionDigits: 3,
|
3131
|
+
style: "currency",
|
3132
|
+
currency,
|
3133
|
+
currencyDisplay: "symbol"
|
3134
|
+
}
|
3135
|
+
).format(
|
3136
|
+
options?.convertToMajorCurrency ? _AmountAction.koboToNaira(Number(value)) : Number(value)
|
3137
|
+
).replace(/^(\D+)/, "$1 ").replace("\u202F", " ").replace(/\s+/, "");
|
3138
|
+
const customSymbol = CurrencySymbolMap[currency] || currency;
|
3139
|
+
return formatted.replace(currency, customSymbol);
|
3140
|
+
});
|
3141
|
+
var AmountAction = _AmountAction;
|
3142
|
+
|
3143
|
+
// src/actions/date.action.ts
|
3144
|
+
var import_dayjs = __toESM(require("dayjs"));
|
3145
|
+
var DateAction = class {
|
3146
|
+
static getDateLibrary() {
|
3147
|
+
return (0, import_dayjs.default)();
|
3148
|
+
}
|
3149
|
+
static formatTimestampToDate(timestamp, dateFormat) {
|
3150
|
+
return import_dayjs.default.unix(timestamp).format(dateFormat || "ddd, MMM, YYYY | HH:mm:ss");
|
3151
|
+
}
|
3152
|
+
static formatDateToTimestamp(date) {
|
3153
|
+
return (0, import_dayjs.default)(date).unix();
|
3154
|
+
}
|
3155
|
+
};
|
3156
|
+
// Annotate the CommonJS export names for ESM import in node:
|
3157
|
+
0 && (module.exports = {
|
3158
|
+
AmountAction,
|
3159
|
+
Banner,
|
3160
|
+
Button,
|
3161
|
+
CopyableLabel,
|
3162
|
+
Country,
|
3163
|
+
CurrencySymbolMap,
|
3164
|
+
DateAction,
|
3165
|
+
DebouncedInput,
|
3166
|
+
DevBanner,
|
3167
|
+
Dialog,
|
3168
|
+
Drawer,
|
3169
|
+
DrawerClose,
|
3170
|
+
DrawerRoot,
|
3171
|
+
FlagComponent,
|
3172
|
+
FormLabel,
|
3173
|
+
Input,
|
3174
|
+
Loader,
|
3175
|
+
LocaleSelector,
|
3176
|
+
OTPInput,
|
3177
|
+
PasswordInput,
|
3178
|
+
PhoneInput,
|
3179
|
+
Popover,
|
3180
|
+
PopoverContent,
|
3181
|
+
PopoverRoot,
|
3182
|
+
PopoverTrigger,
|
3183
|
+
Select,
|
3184
|
+
Status,
|
3185
|
+
Table,
|
3186
|
+
Textarea,
|
3187
|
+
buttonVariants,
|
3188
|
+
cn
|
3189
|
+
});
|