@6thbridge/hexa 0.0.4 → 0.0.6
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 +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +1773 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1725 -2
- package/dist/index.mjs.map +1 -1
- package/dist/output.css +206 -19
- package/package.json +2 -1
- package/tailwind.config.js +1 -1
package/dist/index.js
CHANGED
@@ -1,2 +1,1773 @@
|
|
1
|
-
"use strict";var st=Object.create;var le=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty;var mt=(t,e)=>{for(var o in e)le(t,o,{get:e[o],enumerable:!0})},Pe=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of dt(e))!pt.call(t,a)&&a!==o&&le(t,a,{get:()=>e[a],enumerable:!(r=lt(e,a))||r.enumerable});return t};var h=(t,e,o)=>(o=t!=null?st(ct(t)):{},Pe(e||!t||!t.__esModule?le(o,"default",{value:t,enumerable:!0}):o,t)),ft=t=>Pe(le({},"__esModule",{value:!0}),t);var xt={};mt(xt,{Button:()=>be,Country:()=>it,FormLabel:()=>w,Input:()=>E,Loader:()=>H,PasswordInput:()=>ye,PhoneInput:()=>Ne,Select:()=>ot,Textarea:()=>Ce});module.exports=ft(xt);var Ae=h(require("react"));var De=h(require("react")),ge=h(require("@radix-ui/react-label")),Le=require("class-variance-authority");var xe=require("clsx"),ke=require("tailwind-merge");function n(...t){return(0,ke.twMerge)((0,xe.clsx)(t))}var Ie=require("react/jsx-runtime"),ut=(0,Le.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=De.forwardRef(({className:t,...e},o)=>(0,Ie.jsx)(ge.Root,{ref:o,className:n(ut(),t),...e}));he.displayName=ge.Root.displayName;var Z=require("react/jsx-runtime"),w=Ae.default.forwardRef(({className:t,children:e,showAsterisk:o,error:r,...a},s)=>(0,Z.jsx)(he,{ref:s,className:n(r&&"text-red-500",t),...a,children:o?(0,Z.jsxs)("p",{children:[e,(0,Z.jsx)("span",{className:"text-red-500",children:"*"})]}):e}));w.displayName="FormLabel";var X=require("react/jsx-runtime"),H=({size:t=16,colour:e="primary"})=>(0,X.jsxs)("svg",{className:"animate-spin",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:[(0,X.jsx)("circle",{cx:"10",cy:"10",r:"9.25",stroke:"transparent",strokeWidth:"1.5"}),(0,X.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:e==="primary"?"#ffffff":"currentColor",className:"rounded"})]});var Se=h(require("react")),Te=require("@radix-ui/react-slot"),Fe=require("class-variance-authority");var N=require("react/jsx-runtime"),gt=(0,Fe.cva)("overflow-hidden isolate relative 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] text-[0.75rem] leading-[1rem] font-medium rounded-lg",lg:"py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",md:"h-12 py-1 px-5 items-center","icon-sm":"h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",icon:"h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg","icon-lg":"h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"}},defaultVariants:{variant:"primary",size:"default"}}),be=({className:t,variant:e="primary",size:o,asChild:r=!1,isLoading:a=!1,leftNode:s,rightNode:d,LoaderSize:i,ref:C,...g})=>{let m=r?Te.Slot:"button",{children:f,disabled:F,...q}=g,_=Se.useRef(null);return(0,N.jsx)(m,{className:n(gt({variant:e,size:o,className:t})),ref:_||C,disabled:F||a,...q,children:(0,N.jsx)("div",{className:"flex font-medium justify-center items-center gap-2",children:a?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("span",{className:"mx-auto",children:(0,N.jsx)(H,{size:i,colour:"secondary"})})}):(0,N.jsxs)(N.Fragment,{children:[s,f,d]})})})};be.displayName="Button";var de=require("class-variance-authority");var Ee=h(require("react")),Me=require("react/jsx-runtime"),P=Ee.default.forwardRef(({className:t,children:e,error:o,...r},a)=>{let s=o??e;return s?(0,Me.jsx)("p",{ref:a,className:n("text-xs font-normal text-[#F04248]",t),...r,children:s}):null});P.displayName="ErrorMessage";var Ve=h(require("react")),ze=require("react/jsx-runtime"),x=Ve.default.forwardRef(({className:t,...e},o)=>(0,ze.jsx)("p",{ref:o,className:n("text-sm text-[#8E98A8",t),...e}));x.displayName="FormDescription";var k=require("react/jsx-runtime"),ht=(0,de.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:""}},defaultVariants:{status:"default"}}),We=({className:t,status:e,type:o,ref:r,...a})=>(0,k.jsx)("input",{type:o,className:n(ht({status:e}),t),ref:r,...a});We.displayName="BaseInnerInput";var L=(0,de.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] dark:border-[#676767] 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-[#00B2A9] 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]"}},defaultVariants:{status:"default"}}),Oe=(0,de.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] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] 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]"}},defaultVariants:{status:"default",side:"left"}}),E=({className:t,status:e="default",disabled:o,error:r,isLoading:a,sideNodeClassName:s,showAsterisk:d,label:i,description:C,ref:g,...m})=>{let f=e;return r&&(f="error"),a&&(f="loading"),o&&(f="prefilled"),(0,k.jsxs)("div",{className:"relative space-y-1",children:[(0,k.jsx)(w,{showAsterisk:d,error:r,children:i}),(0,k.jsxs)("div",{className:n(L({status:f}),m.leftNode||m.rightNode?"p-0":"",t),children:[m.leftNode?(0,k.jsx)("div",{className:n(Oe({status:f,side:"left"}),s),children:m.leftNode}):null,(0,k.jsx)(We,{ref:g,disabled:a||o,className:m.leftNode||m.rightNode?"!px-3 !py-2":"",...m}),m.rightNode?(0,k.jsx)("div",{className:n(Oe({status:f,side:"right"}),s),children:m.rightNode}):null]}),(0,k.jsx)(x,{className:"text-gray-400 text-sm !font-normal",children:C}),(0,k.jsx)(P,{error:r})]})};E.displayName="Input";var Ue=require("react");var K=require("react/jsx-runtime"),Be=()=>(0,K.jsxs)("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,K.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,K.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 j=require("react/jsx-runtime"),He=()=>(0,j.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,j.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,j.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 U=require("react/jsx-runtime"),ye=({...t})=>{let[e,o]=(0,Ue.useState)(!1);return(0,U.jsx)(E,{sideNodeClassName:"!border-l-0",rightNode:e?(0,U.jsx)("button",{type:"button",onClick:()=>o(r=>!r),children:(0,U.jsx)(Be,{})}):(0,U.jsx)("button",{type:"button",onClick:()=>o(r=>!r),children:(0,U.jsx)(He,{})}),type:e?"text":"password",...t})};ye.displayName="PasswordInput";var Ge=require("class-variance-authority");var M=require("react/jsx-runtime"),ao=(0,Ge.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-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] 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]"}},defaultVariants:{status:"default"}}),Ce=({className:t,status:e="default",disabled:o,error:r,isLoading:a,showAsterisk:s,label:d,description:i,...C})=>{let g=e;return r&&(g="error"),a&&(g="loading"),o&&(g="prefilled"),(0,M.jsxs)("div",{className:"relative space-y-1",children:[(0,M.jsx)(w,{showAsterisk:s,error:r,children:d}),(0,M.jsx)("textarea",{className:n("min-h-[80px]",L({status:g}),t),disabled:a||o,...C}),(0,M.jsx)(x,{className:"text-gray-400 text-sm !font-normal",children:i}),(0,M.jsx)(P,{error:r})]})};Ce.displayName="Textarea";var z=h(require("react"));var I=h(require("react")),y=require("cmdk"),Ye=require("lucide-react");var J=h(require("react")),p=h(require("@radix-ui/react-dialog"));var $=require("react/jsx-runtime"),qe=()=>(0,$.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"stroke-[#232528]]",children:[(0,$.jsx)("path",{d:"M5.00098 5L19 18.9991",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,$.jsx)("path",{d:"M4.99996 18.9991L18.999 5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});var c=require("react/jsx-runtime"),bt=p.Root,yt=p.Trigger,_e=p.Portal,Ze=J.forwardRef(({className:t,...e},o)=>(0,c.jsx)(p.Overlay,{ref:o,className:n("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));Ze.displayName=p.Overlay.displayName;var ve=J.forwardRef(({className:t,hideCloseButton:e,children:o,...r},a)=>(0,c.jsxs)(_e,{children:[(0,c.jsx)(Ze,{}),(0,c.jsxs)(p.Content,{ref:a,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",t),...r,children:[o,!e&&(0,c.jsxs)(p.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)(qe,{}),(0,c.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ve.displayName=p.Content.displayName;var Xe=({className:t,...e})=>(0,c.jsx)("div",{className:n("flex flex-col space-y-1.5 text-left",t),...e});Xe.displayName="DialogHeader";var Ke=({className:t,...e})=>(0,c.jsx)("div",{className:n("flex flex-row justify-end sm:space-x-2",t),...e});Ke.displayName="DialogFooter";var je=J.forwardRef(({className:t,...e},o)=>(0,c.jsx)(p.Title,{ref:o,className:n("text-lg font-semibold leading-none tracking-tight",t),...e}));je.displayName=p.Title.displayName;var $e=J.forwardRef(({className:t,...e},o)=>(0,c.jsx)(p.Description,{ref:o,className:n("text-sm text-muted-foreground",t),...e}));$e.displayName=p.Description.displayName;var Je=({trigger:t,children:e,open:o,onOpenChange:r,hideCloseButton:a,footer:s,title:d,description:i,contentClassName:C,headerClassName:g,titleClassName:m,descriptionClassName:f,footerClassName:F,asChild:q=!0,onOpenAutoFocus:_,onCloseAutoFocus:me,onEscapeKeyDown:se,onInteractOutside:W,onPointerDownOutside:fe,...ue})=>(0,c.jsxs)(bt,{...ue,open:o,onOpenChange:r,children:[(0,c.jsx)(yt,{asChild:q,children:t}),(0,c.jsx)(_e,{children:(0,c.jsxs)(ve,{className:C,hideCloseButton:a,onOpenAutoFocus:_,onCloseAutoFocus:me,onEscapeKeyDown:se,onPointerDownOutside:fe,onInteractOutside:W,children:[d||i?(0,c.jsxs)(Xe,{className:g,children:[d&&(0,c.jsx)(je,{className:m,children:d}),i&&(0,c.jsx)($e,{className:f,children:i})]}):(0,c.jsx)(c.Fragment,{}),e,s&&(0,c.jsx)(Ke,{className:F,children:s})]})})]});Je.displayName=p.Dialog.displayName;var v=require("react/jsx-runtime"),Y=I.forwardRef(({className:t,...e},o)=>(0,v.jsx)(y.Command,{ref:o,className:n("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Y.displayName=y.Command.displayName;var Q=I.forwardRef(({className:t,CommandInputContainerClassName:e,loading:o,...r},a)=>(0,v.jsxs)("div",{className:n("flex items-center border-0 px-3 gap-2",e),"cmdk-input-wrapper":"",children:[o?(0,v.jsx)(H,{size:16,colour:"secondary"}):(0,v.jsx)(Ye.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,v.jsx)(y.Command.Input,{ref:a,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",t),disabled:o,...r})]}));Q.displayName=y.Command.Input.displayName;var ee=I.forwardRef(({className:t,...e},o)=>(0,v.jsx)(y.Command.List,{ref:o,className:n("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));ee.displayName=y.Command.List.displayName;var te=I.forwardRef((t,e)=>(0,v.jsx)(y.Command.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));te.displayName=y.Command.Empty.displayName;var oe=I.forwardRef(({className:t,...e},o)=>(0,v.jsx)(y.Command.Group,{ref:o,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",t),...e}));oe.displayName=y.Command.Group.displayName;var Ct=I.forwardRef(({className:t,...e},o)=>(0,v.jsx)(y.Command.Separator,{ref:o,className:n("-mx-1 h-px bg-border",t),...e}));Ct.displayName=y.Command.Separator.displayName;var re=I.forwardRef(({className:t,...e},o)=>(0,v.jsx)(y.Command.Item,{ref:o,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",t),...e}));re.displayName=y.Command.Item.displayName;var vt=({className:t,...e})=>(0,v.jsx)("span",{className:n("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});vt.displayName="CommandShortcut";var Qe=h(require("react")),D=h(require("@radix-ui/react-popover"));var A=require("react/jsx-runtime"),ae=D.Root,V=D.Trigger,G=Qe.forwardRef(({className:t,align:e="center",sideOffset:o=4,portal:r=!0,...a},s)=>r?(0,A.jsx)(D.Portal,{children:(0,A.jsx)(D.Content,{ref:s,align:e,sideOffset:o,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",t),onOpenAutoFocus:a.onOpenAutoFocus,onCloseAutoFocus:a.onCloseAutoFocus,...a})}):(0,A.jsx)(D.Content,{ref:s,align:e,sideOffset:o,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",t),onOpenAutoFocus:a.onOpenAutoFocus,onCloseAutoFocus:a.onCloseAutoFocus,...a}));G.displayName=D.Content.displayName;var wt=({trigger:t,children:e,open:o,onOpenChange:r,contentClassName:a,asChild:s=!0,align:d,side:i,alignOffset:C,sideOffset:g,onOpenAutoFocus:m,onCloseAutoFocus:f,...F})=>(0,A.jsxs)(ae,{...F,open:o,onOpenChange:r,children:[(0,A.jsx)(V,{asChild:s,children:t}),(0,A.jsx)(G,{alignOffset:C,sideOffset:g,side:i,align:d,className:a,onOpenAutoFocus:m,onCloseAutoFocus:f,children:e})]});wt.displayName=D.Root.displayName;var we=h(require("react")),R=h(require("@radix-ui/react-scroll-area"));var S=require("react/jsx-runtime"),ne=we.forwardRef(({className:t,children:e,...o},r)=>(0,S.jsxs)(R.Root,{ref:r,className:n("relative overflow-hidden",t),...o,children:[(0,S.jsx)(R.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),(0,S.jsx)(et,{}),(0,S.jsx)(R.Corner,{})]}));ne.displayName=R.Root.displayName;var et=we.forwardRef(({className:t,orientation:e="vertical",...o},r)=>(0,S.jsx)(R.ScrollAreaScrollbar,{ref:r,orientation:e,className:n("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...o,children:(0,S.jsx)(R.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));et.displayName=R.ScrollAreaScrollbar.displayName;var b=require("react/jsx-runtime"),tt=({className:t,value:e,placeholder:o="",status:r,disabled:a})=>(0,b.jsx)(V,{asChild:!0,disabled:a,children:(0,b.jsxs)("button",{disabled:a,className:n(L({status:r}),"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",e?"":"text-[#79818C]",t),children:[e??o??"Select options...",(0,b.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:(0,b.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"})})]})}),ce=({options:t=[],value:e,onChange:o,containerClassName:r,placeholder:a,disabled:s,loading:d,optionComponent:i,children:C,modal:g=!1,hideSearch:m,className:f,inputValue:F,onValueChange:q,onInputValueChange:_})=>{let[me,se]=z.useState(!1),W=z.useRef(null),[fe,ue]=z.useState(void 0);return z.useLayoutEffect(()=>{W.current&&ue(W.current.clientWidth)},[W.current]),(0,b.jsxs)(ae,{modal:g,open:me,onOpenChange:se,children:[(0,b.jsx)("div",{className:n("w-full",f),ref:W,children:C}),(0,b.jsx)(G,{portal:!g,className:"p-0 min-w-[200px]",style:{width:fe},children:(0,b.jsxs)(Y,{className:"max-h-[270px] pt-3 relative",children:[!m&&(0,b.jsx)(Q,{loading:d,placeholder:a??"Search options...",onValueChange:_,value:F,CommandInputContainerClassName:"mx-3 border rounded-md border-[#DEDEDE]"}),(0,b.jsx)(ne,{className:n("w-full px-0",r),children:(0,b.jsxs)(ee,{children:[!m&&(0,b.jsx)(te,{children:"No result found."}),(0,b.jsx)(oe,{className:"w-full",children:t?.map(B=>(0,b.jsx)(re,{defaultValue:e?.label,value:B.label,disabled:s,onSelect:()=>{o(B),se(!1),q?.(B?.value)},children:i?i(B):B.label},B.value))})]})})]})})]})};var T=require("react/jsx-runtime"),ot=({showAsterisk:t,label:e,description:o,error:r,hideSearch:a=!0,status:s,...d})=>(0,T.jsxs)("div",{className:"relative space-y-1",children:[(0,T.jsx)(w,{showAsterisk:t,error:r,children:e}),(0,T.jsx)(ce,{hideSearch:a,...d,children:(0,T.jsx)(tt,{disabled:d?.disabled,placeholder:"Select or search email",status:s,value:d?.value?.label??d?.value?.value})}),(0,T.jsx)(x,{className:"text-gray-400 text-sm !font-normal",children:o}),(0,T.jsx)(P,{error:r})]});var Re=[{countryCode:"GLOBAL",countryName:"Global",currency:"Dollars",currencyCode:"USD",currencyIcon:"\u{1F30E}",flag:"",flagURL:"",internetCountryCode:"GLOBAL"},{countryName:"Benin",countryCode:"+229",flag:"\u{1F1E7}\u{1F1EF}",flagURL:{png:"https://flagcdn.com/w320/bj.png",svg:"https://flagcdn.com/bj.svg",alt:"The flag of Benin features a green vertical band on its hoist side that takes up about two-fifth the width of the field and two equal horizontal bands of yellow and red adjoining the vertical band."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BJ",countryId:"659cb4624b4e7400b1c12efc"},{countryName:"Burkina Faso",countryCode:"+226",flag:"\u{1F1E7}\u{1F1EB}",flagURL:{png:"https://flagcdn.com/w320/bf.png",svg:"https://flagcdn.com/bf.svg",alt:"The flag of Burkina Faso features two equal horizontal bands of red and green, with a yellow five-pointed star in the center."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BF",countryId:"659cb4624b4e7400b1c12f0d"},{countryName:"Cameroon",countryCode:"+237",flag:"\u{1F1E8}\u{1F1F2}",flagURL:{png:"https://flagcdn.com/w320/cm.png",svg:"https://flagcdn.com/cm.svg",alt:"The flag of Cameroon is composed of three equal vertical bands of green, red and yellow, with a yellow five-pointed star in the center."},currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CM",countryId:"659cb4624b4e7400b1c12ee6"},{countryName:"Chad",countryCode:"+235",flag:"\u{1F1F9}\u{1F1E9}",flagURL:{png:"https://flagcdn.com/w320/td.png",svg:"https://flagcdn.com/td.svg",alt:"The flag of Chad is composed of three equal vertical bands of blue, gold and red."},currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"TD",countryId:"659cb4624b4e7400b1c12ea8"},{countryName:"DR Congo",countryCode:"+243",flag:"\u{1F1E8}\u{1F1E9}",flagURL:{png:"https://flagcdn.com/w320/cd.png",svg:"https://flagcdn.com/cd.svg",alt:"The flag of the Democratic Republic of the Congo has a sky-blue field with a yellow-edged red diagonal band that extends from the lower hoist-side corner to the upper fly-side corner of the field. A large five-pointed yellow star is situated above the diagonal band on the upper hoist side of the field."},currency:"Congolese franc",currencyCode:"CDF",currencyIcon:"FC",internetCountryCode:"CD",countryId:"659cb4624b4e7400b1c12ee5"},{countryName:"Eswatini",countryCode:"+268",flag:"\u{1F1F8}\u{1F1FF}",flagURL:{png:"https://flagcdn.com/w320/sz.png",svg:"https://flagcdn.com/sz.svg",alt:"The flag of Eswatini is composed of three horizontal bands \u2014 a large central yellow-edged red band, and a light blue band above and beneath the red band. The red band is three times the height of the blue bands and bears a centered emblem made up of a large black and white Nguni shield covering two spears and a staff decorated with feather tassels, all placed horizontally."},currency:"Swazi lilangeni",currencyCode:"SZL",currencyIcon:"L",internetCountryCode:"SZ",countryId:"659cb4624b4e7400b1c12edc"},{countryName:"Gabon",countryCode:"+241",flag:"\u{1F1EC}\u{1F1E6}",flagURL:{png:"https://flagcdn.com/w320/ga.png",svg:"https://flagcdn.com/ga.svg",alt:"The flag of Gabon is composed of three equal horizontal bands of green, yellow and blue."},currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"GA",countryId:"659cb4624b4e7400b1c12f51"},{countryName:"Ghana",countryCode:"+233",flag:"\u{1F1EC}\u{1F1ED}",flagURL:{png:"https://flagcdn.com/w320/gh.png",svg:"https://flagcdn.com/gh.svg",alt:"The flag of Ghana is composed of three equal horizontal bands of red, gold and green, with a five-pointed black star centered in the gold band."},currency:"Ghanaian cedi",currencyCode:"GHS",currencyIcon:"\u20B5",internetCountryCode:"GH",countryId:"659cb4624b4e7400b1c12e75"},{countryName:"Guinea",countryCode:"+224",flag:"\u{1F1EC}\u{1F1F3}",flagURL:{png:"https://flagcdn.com/w320/gn.png",svg:"https://flagcdn.com/gn.svg",alt:"The flag of Guinea is composed of three equal vertical bands of red, yellow and green."},currency:"Guinean franc",currencyCode:"GNF",currencyIcon:"Fr",internetCountryCode:"GN",countryId:"659cb4624b4e7400b1c12f3f"},{countryName:"Ivory Coast",countryCode:"+225",flag:"\u{1F1E8}\u{1F1EE}",flagURL:{png:"https://flagcdn.com/w320/ci.png",svg:"https://flagcdn.com/ci.svg",alt:"The flag of Ivory Coast is composed of three equal vertical bands of orange, white and green."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"CI",countryId:"659cb4624b4e7400b1c12f5f"},{countryName:"Kenya",countryCode:"+254",flag:"\u{1F1F0}\u{1F1EA}",flagURL:{png:"https://flagcdn.com/w320/ke.png",svg:"https://flagcdn.com/ke.svg",alt:"The flag of Kenya is composed of three equal horizontal bands of black, red with white top and bottom edges, and green. An emblem comprising a red, black and white Maasai shield covering two crossed white spears is superimposed at the center of the field."},currency:"Kenyan shilling",currencyCode:"KES",currencyIcon:"Sh",internetCountryCode:"KE",countryId:"659cb4624b4e7400b1c12f3c"},{countryName:"Lesotho",countryCode:"+266",flag:"\u{1F1F1}\u{1F1F8}",flagURL:{png:"https://flagcdn.com/w320/ls.png",svg:"https://flagcdn.com/ls.svg",alt:"The flag of Lesotho is composed of three horizontal bands of blue, white and green in the ratio of 3:4:3. A black mokorotlo \u2014 a Basotho hat \u2014 is centered in the white band."},currency:"Lesotho loti",currencyCode:"LSL",currencyIcon:"L",internetCountryCode:"LS",countryId:"659cb4624b4e7400b1c12f02"},{countryName:"Liberia",countryCode:"+231",flag:"\u{1F1F1}\u{1F1F7}",flagURL:{png:"https://flagcdn.com/w320/lr.png",svg:"https://flagcdn.com/lr.svg",alt:"The flag of Liberia is composed of eleven equal horizontal bands of red alternating with white. A blue square bearing a five-pointed white star is superimposed in the canton."},currency:"Liberian dollar",currencyCode:"LRD",currencyIcon:"$",internetCountryCode:"LR",countryId:"659cb4624b4e7400b1c12ec0"},{countryName:"Madagascar",countryCode:"+261",flag:"\u{1F1F2}\u{1F1EC}",flagURL:{png:"https://flagcdn.com/w320/mg.png",svg:"https://flagcdn.com/mg.svg",alt:"The flag of Madagascar features a white vertical band on the hoist side that takes up about one-third the width of the field, and two equal horizontal bands of red and green adjoining the vertical band."},currency:"Malagasy ariary",currencyCode:"MGA",currencyIcon:"Ar",internetCountryCode:"MG",countryId:"659cb4624b4e7400b1c12ede"},{countryName:"Malawi",countryCode:"+265",flag:"\u{1F1F2}\u{1F1FC}",flagURL:{png:"https://flagcdn.com/w320/mw.png",svg:"https://flagcdn.com/mw.svg",alt:"The flag of Malawi is composed of three equal horizontal bands of black, red and green. The top half of a red sun with thirty-one visible rays is centered in the black band."},currency:"Malawian kwacha",currencyCode:"MWK",currencyIcon:"MK",internetCountryCode:"MW",countryId:"659cb4624b4e7400b1c12f24"},{countryName:"Mali",countryCode:"+223",flag:"\u{1F1F2}\u{1F1F1}",flagURL:{png:"https://flagcdn.com/w320/ml.png",svg:"https://flagcdn.com/ml.svg",alt:"The flag of Mali is composed of three equal vertical bands of green, yellow and red."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"ML",countryId:"659cb4624b4e7400b1c12f25"},{countryName:"Mozambique",countryCode:"+258",flag:"\u{1F1F2}\u{1F1FF}",flagURL:{png:"https://flagcdn.com/w320/mz.png",svg:"https://flagcdn.com/mz.svg",alt:"The flag of Mozambique is composed of three equal horizontal bands of teal, black with white top and bottom edges, and yellow. A red isosceles triangle spanning about two-fifth the width of the field is superimposed on the hoist side with its base on the hoist end. This triangle bears a crossed rifle and hoe in black superimposed on an open white book which is superimposed on a five-pointed yellow star."},currency:"Mozambican metical",currencyCode:"MZN",currencyIcon:"MT",internetCountryCode:"MZ",countryId:"659cb4624b4e7400b1c12f22"},{countryName:"Namibia",countryCode:"+264",flag:"\u{1F1F3}\u{1F1E6}",flagURL:{png:"https://flagcdn.com/w320/na.png",svg:"https://flagcdn.com/na.svg",alt:"The flag of Namibia features a white-edged red diagonal band that extends from the lower hoist-side corner to the upper fly-side corner of the field. Above and beneath this band are a blue and green triangle respectively. A gold sun with twelve triangular rays is situated on the hoist side of the upper triangle."},currency:"Namibian dollar",currencyCode:"NAD",currencyIcon:"$",internetCountryCode:"NA",countryId:"659cb4624b4e7400b1c12e74"},{countryName:"Niger",countryCode:"+227",flag:"\u{1F1F3}\u{1F1EA}",flagURL:{png:"https://flagcdn.com/w320/ne.png",svg:"https://flagcdn.com/ne.svg",alt:"The flag of Niger features three equal horizontal bands of orange, white and green, with an orange circle centered in the white band."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"NE",countryId:"659cb4624b4e7400b1c12efb"},{countryName:"Nigeria",countryCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",flagURL:{png:"https://flagcdn.com/w320/ng.png",svg:"https://flagcdn.com/ng.svg",alt:"The flag of Nigeria is composed of three equal vertical bands of green, white and green."},currency:"Nigerian naira",currencyCode:"NGN",currencyIcon:"\u20A6",internetCountryCode:"NG",countryId:"659cb4624b4e7400b1c12eae"},{countryName:"Republic of the Congo",countryCode:"+242",flag:"\u{1F1E8}\u{1F1EC}",flagURL:{png:"https://flagcdn.com/w320/cg.png",svg:"https://flagcdn.com/cg.svg",alt:"The flag of the Republic of the Congo features a yellow diagonal band that extends from the lower hoist-side corner to the upper fly-side corner of the field. Above and beneath this band are a green and red triangle respectively."},currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CG",countryId:"659cb4624b4e7400b1c12e8b"},{countryName:"Rwanda",countryCode:"+250",flag:"\u{1F1F7}\u{1F1FC}",flagURL:{png:"https://flagcdn.com/w320/rw.png",svg:"https://flagcdn.com/rw.svg",alt:"The flag of Rwanda is composed of three horizontal bands of light blue, yellow and green. The light blue band is twice the height of the other two bands and bears a yellow sun with twenty-four rays on its fly side."},currency:"Rwandan franc",currencyCode:"RWF",currencyIcon:"Fr",internetCountryCode:"RW",countryId:"659cb4624b4e7400b1c12ee4"},{countryName:"Senegal",countryCode:"+221",flag:"\u{1F1F8}\u{1F1F3}",flagURL:{png:"https://flagcdn.com/w320/sn.png",svg:"https://flagcdn.com/sn.svg",alt:"The flag of Senegal is composed of three equal vertical bands of green, golden-yellow and red, with a five-pointed green star centered in the golden-yellow band."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"SN",countryId:"659cb4624b4e7400b1c12ebb"},{countryName:"Seychelles",countryCode:"+248",flag:"\u{1F1F8}\u{1F1E8}",flagURL:{png:"https://flagcdn.com/w320/sc.png",svg:"https://flagcdn.com/sc.svg",alt:"The flag of Seychelles is composed of five broadening oblique bands of blue, yellow, red, white and green, which extend from the hoist side of the bottom edge to the top and fly edges of the field."},currency:"Seychellois rupee",currencyCode:"SCR",currencyIcon:"\u20A8",internetCountryCode:"SC",countryId:"659cb4624b4e7400b1c12e7d"},{countryName:"South Africa",countryCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",flagURL:{png:"https://flagcdn.com/w320/za.png",svg:"https://flagcdn.com/za.svg",alt:"The flag of South Africa is composed of two equal horizontal bands of red and blue, with a yellow-edged black isosceles triangle superimposed on the hoist side of the field. This triangle has its base centered on the hoist end, spans about two-fifth the width and two-third the height of the field, and is enclosed on its sides by the arms of a white-edged green horizontally oriented Y-shaped band which extends along the boundary of the red and blue bands to the fly end of the field."},currency:"South African rand",currencyCode:"ZAR",currencyIcon:"R",internetCountryCode:"ZA",countryId:"659cb4624b4e7400b1c12ec1"},{countryName:"South Sudan",countryCode:"+211",flag:"\u{1F1F8}\u{1F1F8}",flagURL:{png:"https://flagcdn.com/w320/ss.png",svg:"https://flagcdn.com/ss.svg",alt:"The flag of South Sudan is composed of three equal horizontal bands of black, red with white top and bottom edges, and green. A blue equilateral triangle which spans about two-fifth the width of the field is superimposed on the hoist side with its base on the hoist end of the field. At the center of this triangle is a five-pointed yellow star."},currency:"South Sudanese pound",currencyCode:"SSP",currencyIcon:"\xA3",internetCountryCode:"SS",countryId:"659cb4624b4e7400b1c12e76"},{countryName:"Tanzania",countryCode:"+255",flag:"\u{1F1F9}\u{1F1FF}",flagURL:{png:"https://flagcdn.com/w320/tz.png",svg:"https://flagcdn.com/tz.svg",alt:"The flag of Tanzania features a yellow-edged black diagonal band that extends from the lower hoist-side corner to the upper fly-side corner of the field. Above and beneath this band are a green and light blue triangle respectively."},currency:"Tanzanian shilling",currencyCode:"TZS",currencyIcon:"Sh",internetCountryCode:"TZ",countryId:"659cb4624b4e7400b1c12eb1"},{countryName:"Togo",countryCode:"+228",flag:"\u{1F1F9}\u{1F1EC}",flagURL:{png:"https://flagcdn.com/w320/tg.png",svg:"https://flagcdn.com/tg.svg",alt:"The flag of Togo is composed of five equal horizontal bands of green alternating with yellow. A red square bearing a five-pointed white star is superimposed in the canton."},currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"TG",countryId:"659cb4624b4e7400b1c12ef2"},{countryName:"Uganda",countryCode:"+256",flag:"\u{1F1FA}\u{1F1EC}",flagURL:{png:"https://flagcdn.com/w320/ug.png",svg:"https://flagcdn.com/ug.svg",alt:"The flag of Uganda is composed of six equal horizontal bands of black, yellow, red, black, yellow and red. A white circle bearing a hoist-side facing grey red-crested crane is superimposed in the center of the field."},currency:"Ugandan shilling",currencyCode:"UGX",currencyIcon:"Sh",internetCountryCode:"UG",countryId:"659cb4624b4e7400b1c12edd"},{countryName:"Zambia",countryCode:"+260",flag:"\u{1F1FF}\u{1F1F2}",flagURL:{png:"https://flagcdn.com/w320/zm.png",svg:"https://flagcdn.com/zm.svg",alt:"The flag of Zambia has a green field, on the fly side of which is a soaring orange African fish eagle above a rectangular area divided into three equal vertical bands of red, black and orange."},currency:"Zambian kwacha",currencyCode:"ZMW",currencyIcon:"ZK",internetCountryCode:"ZM",countryId:"659cb4624b4e7400b1c12f2b"}],rt=()=>{let t={};return Re?.forEach(e=>{t[e?.internetCountryCode]=e?.countryName}),t};var ie=h(require("react")),pe=h(require("react-phone-number-input")),at=h(require("react-phone-number-input/flags"));var l=require("react/jsx-runtime"),Ne=ie.forwardRef(({className:t,onChange:e,modal:o,showAsterisk:r,label:a,description:s,error:d,defaultCountry:i="NG",...C},g)=>{let m=f=>(0,l.jsx)(Rt,{...f,status:C.status,modal:o});return(0,l.jsxs)("div",{className:"relative space-y-1",children:[(0,l.jsx)(w,{showAsterisk:r,error:d,children:a}),(0,l.jsx)(pe.default,{ref:g,className:n("flex",t),flagComponent:O,countrySelectComponent:m,inputComponent:nt,defaultCountry:i,onChange:f=>e?.(f),...C}),(0,l.jsx)(x,{className:"text-gray-400 text-sm !font-normal",children:s}),(0,l.jsx)(P,{error:d})]})});Ne.displayName="PhoneInput";var nt=ie.forwardRef(({className:t,...e},o)=>(0,l.jsx)(E,{className:n("h-full !-mt-0 border-l-0 rounded-l-none flex-1",t),...e,ref:o}));nt.displayName="InputComponent";var Rt=({disabled:t,value:e,onChange:o,options:r,status:a,modal:s})=>{let d=ie.useCallback(i=>{o(i)},[o]);return(0,l.jsxs)(ae,{modal:s,children:[(0,l.jsx)(V,{disabled:t,children:(0,l.jsxs)("div",{className:n(L({status:a}),"!border-r-0 transition justify-center items-center border disabled:text-base-500 disabled:border-base-300 border-status-neutral-fill dark:border-[#9299A2] text-texts-50 focus:ring-offset-1 focus:ring-offset-base-100 focus-visible:!ring-offset-base-100 focus-visible:ring-2 focus-visible:!ring-accent focus:ring-accent focus:ring-2 flex gap-1 h-full rounded-e-none rounded-s-lg px-3 dark:!bg-transparent"),children:[(0,l.jsx)(O,{country:e,countryName:e}),(0,l.jsx)("svg",{className:n("-mr-2 h-4 w-4 opacity-50",t?"hidden":"opacity-100"),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,l.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,l.jsx)(G,{portal:!s,className:"w-[200px] md:w-[300px] p-0",children:(0,l.jsx)(Y,{children:(0,l.jsx)(ee,{children:(0,l.jsxs)(ne,{className:"h-72",children:[(0,l.jsx)(Q,{placeholder:"Search country..."}),(0,l.jsx)(te,{children:"No country found."}),(0,l.jsx)(oe,{children:r.filter(i=>i.value).map(i=>(0,l.jsxs)(re,{className:"gap-2",onSelect:()=>d(i.value),children:[(0,l.jsx)(O,{country:i.value,countryName:i.label}),(0,l.jsx)("span",{className:"flex-1 text-sm",children:i.label}),i.value&&(0,l.jsx)("span",{className:"text-[#191919]/50 text-sm dark:text-white",children:`+${pe.getCountryCallingCode(i.value)}`}),(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:n("ml-auto",i.value===e?"opacity-100":"opacity-0"),children:(0,l.jsx)("path",{d:"M4 8.00008L6.66353 10.6636L12 5.33655",stroke:"#959595",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${i.value}-${i.label}`))})]})})})})]})},O=({country:t,countryName:e,className:o})=>{let r=at.default[t];return(0,l.jsx)("span",{className:n("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",o),children:r&&(0,l.jsx)(r,{title:e})})};O.displayName="FlagComponent";var u=require("react/jsx-runtime"),Nt=rt(),Pt=({className:t,value:e,placeholder:o="",status:r,disabled:a})=>(0,u.jsx)(V,{asChild:!0,disabled:a,children:(0,u.jsxs)("button",{disabled:a,className:n(L({status:r}),"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",e?"":"text-[#79818C]",t),children:[e?(0,u.jsxs)("div",{className:"flex gap-2",children:[(0,u.jsx)(O,{country:e,countryName:e,className:"ml-1 !w-6 h-5"}),(0,u.jsxs)("span",{className:"",children:[" ",Nt[e]]})]}):o??"Select options...",(0,u.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:(0,u.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"})})]})}),it=({hideSearch:t=!0,showAsterisk:e,label:o,description:r,error:a,...s})=>{let d=Re?.map(i=>({value:i?.internetCountryCode,label:i?.countryName,...i}));return(0,u.jsxs)("div",{className:"relative space-y-1",children:[(0,u.jsx)(w,{showAsterisk:e,error:a,children:o}),(0,u.jsx)(ce,{options:d,hideSearch:t,optionComponent:i=>(0,u.jsxs)("div",{className:"w-full flex items-center gap-2",children:[(0,u.jsx)(O,{country:i?.internetCountryCode,countryName:i?.label,className:"ml-2 !w-6 !h-5"}),(0,u.jsx)("span",{className:"flex-1 text-sm",children:i?.label})]}),...s,children:(0,u.jsx)(Pt,{value:s?.value?.value,status:s?.status,placeholder:s?.placeholder??" Select Country"})}),(0,u.jsx)(x,{className:"text-gray-400 text-sm !font-normal",children:r}),(0,u.jsx)(P,{error:a})]})};0&&(module.exports={Button,Country,FormLabel,Input,Loader,PasswordInput,PhoneInput,Select,Textarea});
|
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 __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
|
30
|
+
// src/index.ts
|
31
|
+
var index_exports = {};
|
32
|
+
__export(index_exports, {
|
33
|
+
Button: () => Button,
|
34
|
+
Country: () => Country,
|
35
|
+
Dialog: () => Dialog2,
|
36
|
+
FlagComponent: () => FlagComponent,
|
37
|
+
FormLabel: () => FormLabel,
|
38
|
+
Input: () => Input,
|
39
|
+
Loader: () => Loader,
|
40
|
+
OTPInput: () => OTPInput,
|
41
|
+
PasswordInput: () => PasswordInput,
|
42
|
+
PhoneInput: () => PhoneInput,
|
43
|
+
Select: () => Select,
|
44
|
+
Textarea: () => Textarea
|
45
|
+
});
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
47
|
+
|
48
|
+
// src/components/label/FormLabel.tsx
|
49
|
+
var import_react = __toESM(require("react"));
|
50
|
+
|
51
|
+
// src/components/label/index.tsx
|
52
|
+
var React = __toESM(require("react"));
|
53
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
54
|
+
var import_class_variance_authority = require("class-variance-authority");
|
55
|
+
|
56
|
+
// src/utils/index.ts
|
57
|
+
var import_clsx = require("clsx");
|
58
|
+
var import_tailwind_merge = require("tailwind-merge");
|
59
|
+
function cn(...inputs) {
|
60
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
61
|
+
}
|
62
|
+
|
63
|
+
// src/components/label/index.tsx
|
64
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
65
|
+
var labelVariants = (0, import_class_variance_authority.cva)(
|
66
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
67
|
+
);
|
68
|
+
var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
69
|
+
LabelPrimitive.Root,
|
70
|
+
{
|
71
|
+
ref,
|
72
|
+
className: cn(labelVariants(), className),
|
73
|
+
...props
|
74
|
+
}
|
75
|
+
));
|
76
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
77
|
+
|
78
|
+
// src/components/label/FormLabel.tsx
|
79
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
80
|
+
var FormLabel = import_react.default.forwardRef(({ className, children, showAsterisk, error, ...props }, ref) => {
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
82
|
+
Label,
|
83
|
+
{
|
84
|
+
ref,
|
85
|
+
className: cn(error && "text-red-500", className),
|
86
|
+
...props,
|
87
|
+
children: showAsterisk ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { children: [
|
88
|
+
children,
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-red-500", children: "*" })
|
90
|
+
] }) : children
|
91
|
+
}
|
92
|
+
);
|
93
|
+
});
|
94
|
+
FormLabel.displayName = "FormLabel";
|
95
|
+
|
96
|
+
// src/components/loader/index.tsx
|
97
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
98
|
+
var Loader = ({
|
99
|
+
size = 16,
|
100
|
+
colour = "primary"
|
101
|
+
}) => {
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
103
|
+
"svg",
|
104
|
+
{
|
105
|
+
className: "animate-spin",
|
106
|
+
width: size,
|
107
|
+
height: size,
|
108
|
+
viewBox: "0 0 20 20",
|
109
|
+
fill: "none",
|
110
|
+
children: [
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "10", cy: "10", r: "9.25", stroke: "transparent", strokeWidth: "1.5" }),
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
113
|
+
"path",
|
114
|
+
{
|
115
|
+
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",
|
116
|
+
fill: colour === "primary" ? "#ffffff" : "currentColor",
|
117
|
+
className: "rounded"
|
118
|
+
}
|
119
|
+
)
|
120
|
+
]
|
121
|
+
}
|
122
|
+
);
|
123
|
+
};
|
124
|
+
|
125
|
+
// src/components/button/index.tsx
|
126
|
+
var React3 = __toESM(require("react"));
|
127
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
128
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
129
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
130
|
+
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
131
|
+
"overflow-hidden isolate relative 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",
|
132
|
+
{
|
133
|
+
variants: {
|
134
|
+
variant: {
|
135
|
+
primary: "border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",
|
136
|
+
danger: "border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",
|
137
|
+
neutral: "!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",
|
138
|
+
outlined: "border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60",
|
139
|
+
"danger-outlined": "border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60",
|
140
|
+
"light-outlined": "border-white text-white hover:opacity-80 disabled:opacity-60",
|
141
|
+
"dark-text": "border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",
|
142
|
+
light: "border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"
|
143
|
+
},
|
144
|
+
size: {
|
145
|
+
// lg: "h-15 px-8 items-center",
|
146
|
+
// sm: "h-10 px-3.5 items-center text-sm",
|
147
|
+
default: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
|
148
|
+
sm: "py-[0.375rem] px-[1rem] text-[0.75rem] leading-[1rem] font-medium rounded-lg",
|
149
|
+
lg: "py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",
|
150
|
+
md: "h-12 py-1 px-5 items-center",
|
151
|
+
"icon-sm": "h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",
|
152
|
+
icon: "h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg",
|
153
|
+
"icon-lg": "h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"
|
154
|
+
}
|
155
|
+
},
|
156
|
+
defaultVariants: {
|
157
|
+
variant: "primary",
|
158
|
+
size: "default"
|
159
|
+
}
|
160
|
+
}
|
161
|
+
);
|
162
|
+
var Button = ({
|
163
|
+
className,
|
164
|
+
variant = "primary",
|
165
|
+
size,
|
166
|
+
asChild = false,
|
167
|
+
isLoading = false,
|
168
|
+
leftNode,
|
169
|
+
rightNode,
|
170
|
+
LoaderSize,
|
171
|
+
ref,
|
172
|
+
...props
|
173
|
+
}) => {
|
174
|
+
const Component = asChild ? import_react_slot.Slot : "button";
|
175
|
+
const { children, disabled, ...rest } = props;
|
176
|
+
const reference = React3.useRef(null);
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
178
|
+
Component,
|
179
|
+
{
|
180
|
+
className: cn(buttonVariants({ variant, size, className })),
|
181
|
+
ref: reference || ref,
|
182
|
+
disabled: disabled || isLoading,
|
183
|
+
...rest,
|
184
|
+
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: [
|
185
|
+
leftNode,
|
186
|
+
children,
|
187
|
+
rightNode
|
188
|
+
] }) })
|
189
|
+
}
|
190
|
+
);
|
191
|
+
};
|
192
|
+
Button.displayName = "Button";
|
193
|
+
|
194
|
+
// src/components/input/index.tsx
|
195
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
196
|
+
|
197
|
+
// src/components/form/ErrorMessage.tsx
|
198
|
+
var import_react2 = __toESM(require("react"));
|
199
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
200
|
+
var ErrorMessage = import_react2.default.forwardRef(({ className, children, error, ...props }, ref) => {
|
201
|
+
const body = error ?? children;
|
202
|
+
if (!body) {
|
203
|
+
return null;
|
204
|
+
}
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
206
|
+
"p",
|
207
|
+
{
|
208
|
+
ref,
|
209
|
+
className: cn("text-xs font-normal text-[#F04248]", className),
|
210
|
+
...props,
|
211
|
+
children: body
|
212
|
+
}
|
213
|
+
);
|
214
|
+
});
|
215
|
+
ErrorMessage.displayName = "ErrorMessage";
|
216
|
+
|
217
|
+
// src/components/form/FormDescription.tsx
|
218
|
+
var import_react3 = __toESM(require("react"));
|
219
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
220
|
+
var FormDescription = import_react3.default.forwardRef(({ className, ...props }, ref) => {
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
222
|
+
"p",
|
223
|
+
{
|
224
|
+
ref,
|
225
|
+
className: cn("text-sm text-[#8E98A8", className),
|
226
|
+
...props
|
227
|
+
}
|
228
|
+
);
|
229
|
+
});
|
230
|
+
FormDescription.displayName = "FormDescription";
|
231
|
+
|
232
|
+
// src/components/input/index.tsx
|
233
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
234
|
+
var inputVariants = (0, import_class_variance_authority3.cva)(
|
235
|
+
"!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",
|
236
|
+
{
|
237
|
+
variants: {
|
238
|
+
status: {
|
239
|
+
default: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
240
|
+
error: "placeholder:text-red-500 text-red-500",
|
241
|
+
loading: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
|
242
|
+
prefilled: ""
|
243
|
+
}
|
244
|
+
},
|
245
|
+
defaultVariants: {
|
246
|
+
status: "default"
|
247
|
+
}
|
248
|
+
}
|
249
|
+
);
|
250
|
+
var BaseInnerInput = ({
|
251
|
+
className,
|
252
|
+
status,
|
253
|
+
type,
|
254
|
+
ref,
|
255
|
+
...props
|
256
|
+
}) => {
|
257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
258
|
+
"input",
|
259
|
+
{
|
260
|
+
type,
|
261
|
+
className: cn(inputVariants({ status }), className),
|
262
|
+
ref,
|
263
|
+
...props
|
264
|
+
}
|
265
|
+
);
|
266
|
+
};
|
267
|
+
BaseInnerInput.displayName = "BaseInnerInput";
|
268
|
+
var inputContainerVariants = (0, import_class_variance_authority3.cva)(
|
269
|
+
"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]",
|
270
|
+
{
|
271
|
+
variants: {
|
272
|
+
status: {
|
273
|
+
default: "border-[#DEDEDE] dark:border-[#676767] 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]",
|
274
|
+
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",
|
275
|
+
loading: "",
|
276
|
+
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]"
|
277
|
+
}
|
278
|
+
},
|
279
|
+
defaultVariants: {
|
280
|
+
status: "default"
|
281
|
+
}
|
282
|
+
}
|
283
|
+
);
|
284
|
+
var sideVariants = (0, import_class_variance_authority3.cva)(
|
285
|
+
"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]",
|
286
|
+
{
|
287
|
+
variants: {
|
288
|
+
side: {
|
289
|
+
left: "left-0 rounded-l-[8px] border-r",
|
290
|
+
right: "right-0 rounded-r-[8px] border-l"
|
291
|
+
},
|
292
|
+
status: {
|
293
|
+
default: "border-[#DEDEDE] 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:disabled:!border-[#9299A2]",
|
294
|
+
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",
|
295
|
+
loading: "",
|
296
|
+
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]"
|
297
|
+
}
|
298
|
+
},
|
299
|
+
defaultVariants: {
|
300
|
+
status: "default",
|
301
|
+
side: "left"
|
302
|
+
}
|
303
|
+
}
|
304
|
+
);
|
305
|
+
var Input = ({
|
306
|
+
className,
|
307
|
+
status = "default",
|
308
|
+
disabled,
|
309
|
+
error,
|
310
|
+
isLoading,
|
311
|
+
sideNodeClassName,
|
312
|
+
showAsterisk,
|
313
|
+
label,
|
314
|
+
description,
|
315
|
+
ref,
|
316
|
+
...props
|
317
|
+
}) => {
|
318
|
+
let containerStatus = status;
|
319
|
+
if (error) containerStatus = "error";
|
320
|
+
if (isLoading) containerStatus = "loading";
|
321
|
+
if (disabled) containerStatus = "prefilled";
|
322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative space-y-1", children: [
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
325
|
+
"div",
|
326
|
+
{
|
327
|
+
className: cn(
|
328
|
+
inputContainerVariants({ status: containerStatus }),
|
329
|
+
props.leftNode || props.rightNode ? "p-0" : "",
|
330
|
+
className
|
331
|
+
),
|
332
|
+
children: [
|
333
|
+
props.leftNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
334
|
+
"div",
|
335
|
+
{
|
336
|
+
className: cn(
|
337
|
+
sideVariants({
|
338
|
+
status: containerStatus,
|
339
|
+
side: "left"
|
340
|
+
}),
|
341
|
+
sideNodeClassName
|
342
|
+
),
|
343
|
+
children: props.leftNode
|
344
|
+
}
|
345
|
+
) : null,
|
346
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
347
|
+
BaseInnerInput,
|
348
|
+
{
|
349
|
+
ref,
|
350
|
+
disabled: isLoading || disabled,
|
351
|
+
className: props.leftNode || props.rightNode ? "!px-3 !py-2" : "",
|
352
|
+
...props
|
353
|
+
}
|
354
|
+
),
|
355
|
+
props.rightNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
356
|
+
"div",
|
357
|
+
{
|
358
|
+
className: cn(
|
359
|
+
sideVariants({
|
360
|
+
status: containerStatus,
|
361
|
+
side: "right"
|
362
|
+
}),
|
363
|
+
sideNodeClassName
|
364
|
+
),
|
365
|
+
children: props.rightNode
|
366
|
+
}
|
367
|
+
) : null
|
368
|
+
]
|
369
|
+
}
|
370
|
+
),
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorMessage, { error })
|
373
|
+
] });
|
374
|
+
};
|
375
|
+
Input.displayName = "Input";
|
376
|
+
|
377
|
+
// src/components/password-input/index.tsx
|
378
|
+
var import_react4 = require("react");
|
379
|
+
|
380
|
+
// src/components/password-input/icons/Eye.tsx
|
381
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
382
|
+
var Eye = () => {
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
384
|
+
"svg",
|
385
|
+
{
|
386
|
+
width: "18",
|
387
|
+
height: "14",
|
388
|
+
viewBox: "0 0 18 14",
|
389
|
+
fill: "none",
|
390
|
+
xmlns: "http://www.w3.org/2000/svg",
|
391
|
+
children: [
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
393
|
+
"path",
|
394
|
+
{
|
395
|
+
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",
|
396
|
+
stroke: "#8E98A8",
|
397
|
+
strokeWidth: "2",
|
398
|
+
strokeLinecap: "round",
|
399
|
+
strokeLinejoin: "round"
|
400
|
+
}
|
401
|
+
),
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
403
|
+
"path",
|
404
|
+
{
|
405
|
+
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",
|
406
|
+
stroke: "#8E98A8",
|
407
|
+
strokeWidth: "2",
|
408
|
+
strokeLinecap: "round",
|
409
|
+
strokeLinejoin: "round"
|
410
|
+
}
|
411
|
+
)
|
412
|
+
]
|
413
|
+
}
|
414
|
+
);
|
415
|
+
};
|
416
|
+
|
417
|
+
// src/components/password-input/icons/EyeOff.tsx
|
418
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
419
|
+
var EyeOff = () => {
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
421
|
+
"svg",
|
422
|
+
{
|
423
|
+
width: "18",
|
424
|
+
height: "18",
|
425
|
+
viewBox: "0 0 18 18",
|
426
|
+
fill: "none",
|
427
|
+
xmlns: "http://www.w3.org/2000/svg",
|
428
|
+
children: [
|
429
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
430
|
+
"path",
|
431
|
+
{
|
432
|
+
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",
|
433
|
+
stroke: "#8E98A8",
|
434
|
+
strokeWidth: "1.5",
|
435
|
+
strokeLinecap: "round",
|
436
|
+
strokeLinejoin: "round"
|
437
|
+
}
|
438
|
+
),
|
439
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
440
|
+
"path",
|
441
|
+
{
|
442
|
+
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",
|
443
|
+
stroke: "#8E98A8",
|
444
|
+
strokeWidth: "1.5",
|
445
|
+
strokeLinecap: "round",
|
446
|
+
strokeLinejoin: "round"
|
447
|
+
}
|
448
|
+
)
|
449
|
+
]
|
450
|
+
}
|
451
|
+
);
|
452
|
+
};
|
453
|
+
|
454
|
+
// src/components/password-input/icons/Check.tsx
|
455
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
456
|
+
var Check = () => {
|
457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
458
|
+
"svg",
|
459
|
+
{
|
460
|
+
width: "12",
|
461
|
+
height: "12",
|
462
|
+
viewBox: "0 0 12 12",
|
463
|
+
fill: "none",
|
464
|
+
xmlns: "http://www.w3.org/2000/svg",
|
465
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
466
|
+
"path",
|
467
|
+
{
|
468
|
+
d: "M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",
|
469
|
+
fill: "currentColor"
|
470
|
+
}
|
471
|
+
)
|
472
|
+
}
|
473
|
+
);
|
474
|
+
};
|
475
|
+
|
476
|
+
// src/components/password-input/icons/Fail.tsx
|
477
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
478
|
+
var Fail = () => {
|
479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
480
|
+
"svg",
|
481
|
+
{
|
482
|
+
width: "12",
|
483
|
+
height: "12",
|
484
|
+
viewBox: "0 0 12 12",
|
485
|
+
fill: "none",
|
486
|
+
xmlns: "http://www.w3.org/2000/svg",
|
487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
488
|
+
"path",
|
489
|
+
{
|
490
|
+
d: "M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",
|
491
|
+
stroke: "currentColor",
|
492
|
+
strokeWidth: "1.5",
|
493
|
+
strokeLinecap: "round",
|
494
|
+
strokeLinejoin: "round"
|
495
|
+
}
|
496
|
+
)
|
497
|
+
}
|
498
|
+
);
|
499
|
+
};
|
500
|
+
|
501
|
+
// src/components/password-input/index.tsx
|
502
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
503
|
+
var validationOptions = [
|
504
|
+
{
|
505
|
+
label: "Uppercase",
|
506
|
+
key: "uppercase",
|
507
|
+
RegExp: /[A-Z]/,
|
508
|
+
validated: false
|
509
|
+
},
|
510
|
+
{
|
511
|
+
label: "Lowercase",
|
512
|
+
key: "lowercase",
|
513
|
+
RegExp: /[a-z]/,
|
514
|
+
validated: false
|
515
|
+
},
|
516
|
+
{
|
517
|
+
label: "Number",
|
518
|
+
key: "number",
|
519
|
+
RegExp: /\d/,
|
520
|
+
validated: false
|
521
|
+
},
|
522
|
+
{
|
523
|
+
label: "8 Characters",
|
524
|
+
key: "eight-chars",
|
525
|
+
RegExp: /.{8}/,
|
526
|
+
validated: false
|
527
|
+
}
|
528
|
+
];
|
529
|
+
var PasswordInput = ({
|
530
|
+
onValidate,
|
531
|
+
onChange,
|
532
|
+
...props
|
533
|
+
}) => {
|
534
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react4.useState)(false);
|
535
|
+
const [validatedValues, setValidatedValues] = (0, import_react4.useState)(validationOptions);
|
536
|
+
const validatePassword = (value) => {
|
537
|
+
return validationOptions.map((option) => ({
|
538
|
+
...option,
|
539
|
+
validated: option.RegExp.test(value)
|
540
|
+
}));
|
541
|
+
};
|
542
|
+
const checkPasswordStrength = (value) => {
|
543
|
+
const validatedOptions = validatePassword(value);
|
544
|
+
const allValidated = validatedOptions.every((option) => option.validated);
|
545
|
+
setValidatedValues(validatedOptions);
|
546
|
+
return allValidated;
|
547
|
+
};
|
548
|
+
const handlePaswordInputChange = (e) => {
|
549
|
+
if (onChange) onChange(e);
|
550
|
+
const value = e?.target?.value;
|
551
|
+
const validated = checkPasswordStrength(value);
|
552
|
+
if (onValidate) onValidate(validated, value);
|
553
|
+
};
|
554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
555
|
+
Input,
|
556
|
+
{
|
557
|
+
sideNodeClassName: "!border-l-0",
|
558
|
+
rightNode: passwordVisible ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
559
|
+
"button",
|
560
|
+
{
|
561
|
+
type: "button",
|
562
|
+
onClick: () => setPasswordVisible((val) => !val),
|
563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Eye, {})
|
564
|
+
}
|
565
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
566
|
+
"button",
|
567
|
+
{
|
568
|
+
type: "button",
|
569
|
+
onClick: () => setPasswordVisible((val) => !val),
|
570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EyeOff, {})
|
571
|
+
}
|
572
|
+
),
|
573
|
+
type: passwordVisible ? "text" : "password",
|
574
|
+
onChange: handlePaswordInputChange,
|
575
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center gap-2", children: validatedValues?.map((value) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
576
|
+
"div",
|
577
|
+
{
|
578
|
+
className: cn("text-xs flex items-center gap-0.5", {
|
579
|
+
"text-[#62C554]": value?.validated,
|
580
|
+
"text-[#8E98A8]": !value?.validated
|
581
|
+
}),
|
582
|
+
children: [
|
583
|
+
/* @__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, {}) }),
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "", children: value?.label })
|
585
|
+
]
|
586
|
+
},
|
587
|
+
value?.key
|
588
|
+
)) }),
|
589
|
+
...props
|
590
|
+
}
|
591
|
+
);
|
592
|
+
};
|
593
|
+
PasswordInput.displayName = "PasswordInput";
|
594
|
+
|
595
|
+
// src/components/textarea/index.tsx
|
596
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
597
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
598
|
+
var textareaContainerVariants = (0, import_class_variance_authority4.cva)(
|
599
|
+
"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",
|
600
|
+
{
|
601
|
+
variants: {
|
602
|
+
status: {
|
603
|
+
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]",
|
604
|
+
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",
|
605
|
+
loading: "placeholder:text-[#C4C4C4]",
|
606
|
+
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]"
|
607
|
+
}
|
608
|
+
},
|
609
|
+
defaultVariants: {
|
610
|
+
status: "default"
|
611
|
+
}
|
612
|
+
}
|
613
|
+
);
|
614
|
+
var Textarea = ({
|
615
|
+
className,
|
616
|
+
status = "default",
|
617
|
+
disabled,
|
618
|
+
error,
|
619
|
+
isLoading,
|
620
|
+
showAsterisk,
|
621
|
+
label,
|
622
|
+
description,
|
623
|
+
...props
|
624
|
+
}) => {
|
625
|
+
let containerStatus = status;
|
626
|
+
if (error) containerStatus = "error";
|
627
|
+
if (isLoading) containerStatus = "loading";
|
628
|
+
if (disabled) containerStatus = "prefilled";
|
629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative space-y-1", children: [
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
632
|
+
"textarea",
|
633
|
+
{
|
634
|
+
className: cn(
|
635
|
+
"min-h-[80px]",
|
636
|
+
inputContainerVariants({ status: containerStatus }),
|
637
|
+
className
|
638
|
+
),
|
639
|
+
disabled: isLoading || disabled,
|
640
|
+
...props
|
641
|
+
}
|
642
|
+
),
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ErrorMessage, { error })
|
645
|
+
] });
|
646
|
+
};
|
647
|
+
Textarea.displayName = "Textarea";
|
648
|
+
|
649
|
+
// src/components/searcheable/index.tsx
|
650
|
+
var React10 = __toESM(require("react"));
|
651
|
+
|
652
|
+
// src/components/command/index.tsx
|
653
|
+
var React7 = __toESM(require("react"));
|
654
|
+
var import_cmdk = require("cmdk");
|
655
|
+
var import_lucide_react = require("lucide-react");
|
656
|
+
|
657
|
+
// src/components/dialog/index.tsx
|
658
|
+
var React6 = __toESM(require("react"));
|
659
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
660
|
+
|
661
|
+
// src/components/dialog/icon/CloseIcon.tsx
|
662
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
663
|
+
var CloseIcon = () => {
|
664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
665
|
+
"svg",
|
666
|
+
{
|
667
|
+
xmlns: "http://www.w3.org/2000/svg",
|
668
|
+
width: "24",
|
669
|
+
height: "24",
|
670
|
+
viewBox: "0 0 24 24",
|
671
|
+
fill: "none",
|
672
|
+
stroke: "currentColor",
|
673
|
+
strokeWidth: "2",
|
674
|
+
strokeLinecap: "round",
|
675
|
+
strokeLinejoin: "round",
|
676
|
+
className: "lucide lucide-x",
|
677
|
+
children: [
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M18 6 6 18" }),
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m6 6 12 12" })
|
680
|
+
]
|
681
|
+
}
|
682
|
+
);
|
683
|
+
};
|
684
|
+
|
685
|
+
// src/components/dialog/index.tsx
|
686
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
687
|
+
var DialogRoot = DialogPrimitive.Root;
|
688
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
689
|
+
var DialogPortal = DialogPrimitive.Portal;
|
690
|
+
var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
691
|
+
DialogPrimitive.Overlay,
|
692
|
+
{
|
693
|
+
ref,
|
694
|
+
className: cn(
|
695
|
+
"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",
|
696
|
+
className
|
697
|
+
),
|
698
|
+
...props
|
699
|
+
}
|
700
|
+
));
|
701
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
702
|
+
var DialogContent = React6.forwardRef(({ className, hideCloseButton, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogPortal, { children: [
|
703
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogOverlay, {}),
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
705
|
+
DialogPrimitive.Content,
|
706
|
+
{
|
707
|
+
ref,
|
708
|
+
className: cn(
|
709
|
+
"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",
|
710
|
+
className
|
711
|
+
),
|
712
|
+
...props,
|
713
|
+
children: [
|
714
|
+
children,
|
715
|
+
!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: [
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon, {}),
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Close" })
|
718
|
+
] })
|
719
|
+
]
|
720
|
+
}
|
721
|
+
)
|
722
|
+
] }));
|
723
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
724
|
+
var DialogHeader = ({
|
725
|
+
className,
|
726
|
+
...props
|
727
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
728
|
+
"div",
|
729
|
+
{
|
730
|
+
className: cn("flex flex-col space-y-1.5 text-left", className),
|
731
|
+
...props
|
732
|
+
}
|
733
|
+
);
|
734
|
+
DialogHeader.displayName = "DialogHeader";
|
735
|
+
var DialogFooter = ({
|
736
|
+
className,
|
737
|
+
...props
|
738
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
739
|
+
"div",
|
740
|
+
{
|
741
|
+
className: cn("flex flex-row justify-end sm:space-x-2", className),
|
742
|
+
...props
|
743
|
+
}
|
744
|
+
);
|
745
|
+
DialogFooter.displayName = "DialogFooter";
|
746
|
+
var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
747
|
+
DialogPrimitive.Title,
|
748
|
+
{
|
749
|
+
ref,
|
750
|
+
className: cn(
|
751
|
+
"text-xl font-semibold leading-none tracking-tight",
|
752
|
+
className
|
753
|
+
),
|
754
|
+
...props
|
755
|
+
}
|
756
|
+
));
|
757
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
758
|
+
var DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
759
|
+
DialogPrimitive.Description,
|
760
|
+
{
|
761
|
+
ref,
|
762
|
+
className: cn("text-sm text-gray-500", className),
|
763
|
+
...props
|
764
|
+
}
|
765
|
+
));
|
766
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
767
|
+
var Dialog2 = ({
|
768
|
+
trigger = void 0,
|
769
|
+
children,
|
770
|
+
open,
|
771
|
+
onOpenChange,
|
772
|
+
hideCloseButton,
|
773
|
+
footer,
|
774
|
+
title,
|
775
|
+
description,
|
776
|
+
contentClassName,
|
777
|
+
headerClassName,
|
778
|
+
titleClassName,
|
779
|
+
descriptionClassName,
|
780
|
+
footerClassName,
|
781
|
+
asChild = true,
|
782
|
+
onOpenAutoFocus,
|
783
|
+
onCloseAutoFocus,
|
784
|
+
onEscapeKeyDown,
|
785
|
+
onInteractOutside,
|
786
|
+
onPointerDownOutside,
|
787
|
+
...props
|
788
|
+
}) => {
|
789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogRoot, { ...props, open, onOpenChange, children: [
|
790
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTrigger, { asChild, children: trigger }),
|
791
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
792
|
+
DialogContent,
|
793
|
+
{
|
794
|
+
className: contentClassName,
|
795
|
+
hideCloseButton,
|
796
|
+
onOpenAutoFocus,
|
797
|
+
onCloseAutoFocus,
|
798
|
+
onEscapeKeyDown,
|
799
|
+
onPointerDownOutside,
|
800
|
+
onInteractOutside,
|
801
|
+
children: [
|
802
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogHeader, { className: headerClassName, children: [
|
803
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTitle, { className: titleClassName, children: title }),
|
804
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogDescription, { className: descriptionClassName, children: description })
|
805
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
|
806
|
+
children,
|
807
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogFooter, { className: footerClassName, children: footer })
|
808
|
+
]
|
809
|
+
}
|
810
|
+
) })
|
811
|
+
] });
|
812
|
+
};
|
813
|
+
Dialog2.displayName = DialogPrimitive.Dialog.displayName;
|
814
|
+
|
815
|
+
// src/components/command/index.tsx
|
816
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
817
|
+
var Command = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
818
|
+
import_cmdk.Command,
|
819
|
+
{
|
820
|
+
ref,
|
821
|
+
className: cn(
|
822
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
823
|
+
className
|
824
|
+
),
|
825
|
+
...props
|
826
|
+
}
|
827
|
+
));
|
828
|
+
Command.displayName = import_cmdk.Command.displayName;
|
829
|
+
var CommandInput = React7.forwardRef(({ className, CommandInputContainerClassName, loading, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
830
|
+
"div",
|
831
|
+
{
|
832
|
+
className: cn(
|
833
|
+
"flex items-center border-0 px-3 gap-2",
|
834
|
+
CommandInputContainerClassName
|
835
|
+
),
|
836
|
+
"cmdk-input-wrapper": "",
|
837
|
+
children: [
|
838
|
+
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" }),
|
839
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
840
|
+
import_cmdk.Command.Input,
|
841
|
+
{
|
842
|
+
ref,
|
843
|
+
className: cn(
|
844
|
+
"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",
|
845
|
+
className
|
846
|
+
),
|
847
|
+
disabled: loading,
|
848
|
+
...props
|
849
|
+
}
|
850
|
+
)
|
851
|
+
]
|
852
|
+
}
|
853
|
+
));
|
854
|
+
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
855
|
+
var CommandList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
856
|
+
import_cmdk.Command.List,
|
857
|
+
{
|
858
|
+
ref,
|
859
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
860
|
+
...props
|
861
|
+
}
|
862
|
+
));
|
863
|
+
CommandList.displayName = import_cmdk.Command.List.displayName;
|
864
|
+
var CommandEmpty = React7.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
865
|
+
import_cmdk.Command.Empty,
|
866
|
+
{
|
867
|
+
ref,
|
868
|
+
className: "py-6 text-center text-sm",
|
869
|
+
...props
|
870
|
+
}
|
871
|
+
));
|
872
|
+
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
873
|
+
var CommandGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
874
|
+
import_cmdk.Command.Group,
|
875
|
+
{
|
876
|
+
ref,
|
877
|
+
className: cn(
|
878
|
+
"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",
|
879
|
+
className
|
880
|
+
),
|
881
|
+
...props
|
882
|
+
}
|
883
|
+
));
|
884
|
+
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
885
|
+
var CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
886
|
+
import_cmdk.Command.Separator,
|
887
|
+
{
|
888
|
+
ref,
|
889
|
+
className: cn("-mx-1 h-px bg-border", className),
|
890
|
+
...props
|
891
|
+
}
|
892
|
+
));
|
893
|
+
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
894
|
+
var CommandItem = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
895
|
+
import_cmdk.Command.Item,
|
896
|
+
{
|
897
|
+
ref,
|
898
|
+
className: cn(
|
899
|
+
"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",
|
900
|
+
className
|
901
|
+
),
|
902
|
+
...props
|
903
|
+
}
|
904
|
+
));
|
905
|
+
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
906
|
+
var CommandShortcut = ({
|
907
|
+
className,
|
908
|
+
...props
|
909
|
+
}) => {
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
911
|
+
"span",
|
912
|
+
{
|
913
|
+
className: cn(
|
914
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
915
|
+
className
|
916
|
+
),
|
917
|
+
...props
|
918
|
+
}
|
919
|
+
);
|
920
|
+
};
|
921
|
+
CommandShortcut.displayName = "CommandShortcut";
|
922
|
+
|
923
|
+
// src/components/popover/index.tsx
|
924
|
+
var React8 = __toESM(require("react"));
|
925
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
926
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
927
|
+
var PopoverRoot = PopoverPrimitive.Root;
|
928
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
929
|
+
var PopoverContent = React8.forwardRef(
|
930
|
+
({ 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)(
|
931
|
+
PopoverPrimitive.Content,
|
932
|
+
{
|
933
|
+
ref,
|
934
|
+
align,
|
935
|
+
sideOffset,
|
936
|
+
className: cn(
|
937
|
+
"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",
|
938
|
+
className
|
939
|
+
),
|
940
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
941
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
942
|
+
...props
|
943
|
+
}
|
944
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
945
|
+
PopoverPrimitive.Content,
|
946
|
+
{
|
947
|
+
ref,
|
948
|
+
align,
|
949
|
+
sideOffset,
|
950
|
+
className: cn(
|
951
|
+
"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",
|
952
|
+
className
|
953
|
+
),
|
954
|
+
onOpenAutoFocus: props.onOpenAutoFocus,
|
955
|
+
onCloseAutoFocus: props.onCloseAutoFocus,
|
956
|
+
...props
|
957
|
+
}
|
958
|
+
)
|
959
|
+
);
|
960
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
961
|
+
var Popover = ({
|
962
|
+
trigger,
|
963
|
+
children,
|
964
|
+
open,
|
965
|
+
onOpenChange,
|
966
|
+
contentClassName,
|
967
|
+
asChild = true,
|
968
|
+
align,
|
969
|
+
side,
|
970
|
+
alignOffset,
|
971
|
+
sideOffset,
|
972
|
+
onOpenAutoFocus,
|
973
|
+
onCloseAutoFocus,
|
974
|
+
...props
|
975
|
+
}) => {
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(PopoverRoot, { ...props, open, onOpenChange, children: [
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger, { asChild, children: trigger }),
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
979
|
+
PopoverContent,
|
980
|
+
{
|
981
|
+
alignOffset,
|
982
|
+
sideOffset,
|
983
|
+
side,
|
984
|
+
align,
|
985
|
+
className: contentClassName,
|
986
|
+
onOpenAutoFocus,
|
987
|
+
onCloseAutoFocus,
|
988
|
+
children
|
989
|
+
}
|
990
|
+
)
|
991
|
+
] });
|
992
|
+
};
|
993
|
+
Popover.displayName = PopoverPrimitive.Root.displayName;
|
994
|
+
|
995
|
+
// src/components/scroll-area/index.tsx
|
996
|
+
var React9 = __toESM(require("react"));
|
997
|
+
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
998
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
999
|
+
var ScrollArea = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
1000
|
+
ScrollAreaPrimitive.Root,
|
1001
|
+
{
|
1002
|
+
ref,
|
1003
|
+
className: cn("relative overflow-hidden", className),
|
1004
|
+
...props,
|
1005
|
+
children: [
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollBar, {}),
|
1008
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollAreaPrimitive.Corner, {})
|
1009
|
+
]
|
1010
|
+
}
|
1011
|
+
));
|
1012
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
1013
|
+
var ScrollBar = React9.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
1014
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
1015
|
+
{
|
1016
|
+
ref,
|
1017
|
+
orientation,
|
1018
|
+
className: cn(
|
1019
|
+
"flex touch-none select-none transition-colors",
|
1020
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
1021
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
1022
|
+
className
|
1023
|
+
),
|
1024
|
+
...props,
|
1025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
1026
|
+
}
|
1027
|
+
));
|
1028
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
1029
|
+
|
1030
|
+
// src/components/searcheable/index.tsx
|
1031
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
1032
|
+
var SearchableTrigger = ({
|
1033
|
+
className,
|
1034
|
+
value,
|
1035
|
+
placeholder = "",
|
1036
|
+
status,
|
1037
|
+
disabled
|
1038
|
+
}) => {
|
1039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
1040
|
+
"button",
|
1041
|
+
{
|
1042
|
+
disabled,
|
1043
|
+
className: cn(
|
1044
|
+
inputContainerVariants({ status }),
|
1045
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",
|
1046
|
+
value ? "" : "text-[#79818C]",
|
1047
|
+
className
|
1048
|
+
),
|
1049
|
+
children: [
|
1050
|
+
value ?? placeholder ?? "Select options...",
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1052
|
+
"svg",
|
1053
|
+
{
|
1054
|
+
width: "20",
|
1055
|
+
height: "20",
|
1056
|
+
viewBox: "0 0 20 20",
|
1057
|
+
fill: "none",
|
1058
|
+
className: " data-[state=open]:goup-rotate-180",
|
1059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1060
|
+
"path",
|
1061
|
+
{
|
1062
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1063
|
+
stroke: "currentColor",
|
1064
|
+
strokeWidth: "1.5",
|
1065
|
+
strokeMiterlimit: "10",
|
1066
|
+
strokeLinecap: "round",
|
1067
|
+
strokeLinejoin: "round"
|
1068
|
+
}
|
1069
|
+
)
|
1070
|
+
}
|
1071
|
+
)
|
1072
|
+
]
|
1073
|
+
}
|
1074
|
+
) });
|
1075
|
+
};
|
1076
|
+
var Searchable = ({
|
1077
|
+
options = [],
|
1078
|
+
value,
|
1079
|
+
onChange,
|
1080
|
+
containerClassName,
|
1081
|
+
placeholder,
|
1082
|
+
disabled,
|
1083
|
+
loading,
|
1084
|
+
optionComponent,
|
1085
|
+
children,
|
1086
|
+
modal = false,
|
1087
|
+
hideSearch,
|
1088
|
+
className,
|
1089
|
+
inputValue,
|
1090
|
+
onValueChange,
|
1091
|
+
onInputValueChange
|
1092
|
+
}) => {
|
1093
|
+
const [open, setOpen] = React10.useState(false);
|
1094
|
+
const triggerRef = React10.useRef(null);
|
1095
|
+
const [width, setWidth] = React10.useState(void 0);
|
1096
|
+
React10.useLayoutEffect(() => {
|
1097
|
+
if (triggerRef.current) {
|
1098
|
+
setWidth(triggerRef.current.clientWidth);
|
1099
|
+
}
|
1100
|
+
}, [triggerRef.current]);
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PopoverRoot, { modal, open, onOpenChange: setOpen, children: [
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("w-full", className), ref: triggerRef, children }),
|
1103
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1104
|
+
PopoverContent,
|
1105
|
+
{
|
1106
|
+
portal: !modal,
|
1107
|
+
className: "p-0 min-w-[200px]",
|
1108
|
+
style: { width },
|
1109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Command, { className: "max-h-[270px] pt-3 relative", children: [
|
1110
|
+
!hideSearch && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1111
|
+
CommandInput,
|
1112
|
+
{
|
1113
|
+
loading,
|
1114
|
+
placeholder: placeholder ?? "Search options...",
|
1115
|
+
onValueChange: onInputValueChange,
|
1116
|
+
value: inputValue,
|
1117
|
+
CommandInputContainerClassName: "mx-3 border rounded-md border-[#DEDEDE]"
|
1118
|
+
}
|
1119
|
+
),
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ScrollArea, { className: cn("w-full px-0", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CommandList, { children: [
|
1121
|
+
!hideSearch && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandEmpty, { children: "No result found." }),
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandGroup, { className: "w-full", children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
1123
|
+
CommandItem,
|
1124
|
+
{
|
1125
|
+
defaultValue: value?.label,
|
1126
|
+
value: option.label,
|
1127
|
+
disabled,
|
1128
|
+
onSelect: () => {
|
1129
|
+
onChange(option);
|
1130
|
+
setOpen(false);
|
1131
|
+
onValueChange?.(option?.value);
|
1132
|
+
},
|
1133
|
+
children: !optionComponent ? option.label : optionComponent(option)
|
1134
|
+
},
|
1135
|
+
option.value
|
1136
|
+
)) })
|
1137
|
+
] }) })
|
1138
|
+
] })
|
1139
|
+
}
|
1140
|
+
)
|
1141
|
+
] });
|
1142
|
+
};
|
1143
|
+
|
1144
|
+
// src/components/select/index.tsx
|
1145
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
1146
|
+
var Select = ({
|
1147
|
+
showAsterisk,
|
1148
|
+
label,
|
1149
|
+
description,
|
1150
|
+
error,
|
1151
|
+
hideSearch = true,
|
1152
|
+
status,
|
1153
|
+
...props
|
1154
|
+
}) => {
|
1155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative space-y-1", children: [
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Searchable, { hideSearch, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
1158
|
+
SearchableTrigger,
|
1159
|
+
{
|
1160
|
+
disabled: props?.disabled,
|
1161
|
+
placeholder: "Select or search email",
|
1162
|
+
status,
|
1163
|
+
value: props?.value?.label ?? props?.value?.value
|
1164
|
+
}
|
1165
|
+
) }),
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ErrorMessage, { error })
|
1168
|
+
] });
|
1169
|
+
};
|
1170
|
+
|
1171
|
+
// src/components/country/data.ts
|
1172
|
+
var countryData = [
|
1173
|
+
{
|
1174
|
+
countryCode: "GLOBAL",
|
1175
|
+
countryName: "Global",
|
1176
|
+
currency: "Dollars",
|
1177
|
+
currencyCode: "USD",
|
1178
|
+
internetCountryCode: "GLOBAL"
|
1179
|
+
},
|
1180
|
+
{
|
1181
|
+
countryName: "Benin",
|
1182
|
+
countryCode: "+229",
|
1183
|
+
currency: "West African CFA franc",
|
1184
|
+
currencyCode: "XOF",
|
1185
|
+
currencyIcon: "Fr",
|
1186
|
+
internetCountryCode: "BJ"
|
1187
|
+
},
|
1188
|
+
{
|
1189
|
+
countryName: "Burkina Faso",
|
1190
|
+
countryCode: "+226",
|
1191
|
+
currency: "West African CFA franc",
|
1192
|
+
currencyCode: "XOF",
|
1193
|
+
currencyIcon: "Fr",
|
1194
|
+
internetCountryCode: "BF"
|
1195
|
+
},
|
1196
|
+
{
|
1197
|
+
countryName: "Cameroon",
|
1198
|
+
countryCode: "+237",
|
1199
|
+
currency: "Central African CFA franc",
|
1200
|
+
currencyCode: "XAF",
|
1201
|
+
currencyIcon: "Fr",
|
1202
|
+
internetCountryCode: "CM"
|
1203
|
+
},
|
1204
|
+
{
|
1205
|
+
countryName: "Chad",
|
1206
|
+
countryCode: "+235",
|
1207
|
+
currency: "Central African CFA franc",
|
1208
|
+
currencyCode: "XAF",
|
1209
|
+
currencyIcon: "Fr",
|
1210
|
+
internetCountryCode: "TD"
|
1211
|
+
},
|
1212
|
+
{
|
1213
|
+
countryName: "DR Congo",
|
1214
|
+
countryCode: "+243",
|
1215
|
+
currency: "Congolese franc",
|
1216
|
+
currencyCode: "CDF",
|
1217
|
+
currencyIcon: "FC",
|
1218
|
+
internetCountryCode: "CD"
|
1219
|
+
},
|
1220
|
+
{
|
1221
|
+
countryName: "Eswatini",
|
1222
|
+
countryCode: "+268",
|
1223
|
+
currency: "Swazi lilangeni",
|
1224
|
+
currencyCode: "SZL",
|
1225
|
+
currencyIcon: "L",
|
1226
|
+
internetCountryCode: "SZ"
|
1227
|
+
},
|
1228
|
+
{
|
1229
|
+
countryName: "Gabon",
|
1230
|
+
countryCode: "+241",
|
1231
|
+
currency: "Central African CFA franc",
|
1232
|
+
currencyCode: "XAF",
|
1233
|
+
currencyIcon: "Fr",
|
1234
|
+
internetCountryCode: "GA"
|
1235
|
+
},
|
1236
|
+
{
|
1237
|
+
countryName: "Ghana",
|
1238
|
+
countryCode: "+233",
|
1239
|
+
currency: "Ghanaian cedi",
|
1240
|
+
currencyCode: "GHS",
|
1241
|
+
currencyIcon: "\u20B5",
|
1242
|
+
internetCountryCode: "GH"
|
1243
|
+
},
|
1244
|
+
{
|
1245
|
+
countryName: "Guinea",
|
1246
|
+
countryCode: "+224",
|
1247
|
+
currency: "Guinean franc",
|
1248
|
+
currencyCode: "GNF",
|
1249
|
+
currencyIcon: "Fr",
|
1250
|
+
internetCountryCode: "GN"
|
1251
|
+
},
|
1252
|
+
{
|
1253
|
+
countryName: "Ivory Coast",
|
1254
|
+
countryCode: "+225",
|
1255
|
+
currency: "West African CFA franc",
|
1256
|
+
currencyCode: "XOF",
|
1257
|
+
currencyIcon: "Fr",
|
1258
|
+
internetCountryCode: "CI"
|
1259
|
+
},
|
1260
|
+
{
|
1261
|
+
countryName: "Kenya",
|
1262
|
+
countryCode: "+254",
|
1263
|
+
currency: "Kenyan shilling",
|
1264
|
+
currencyCode: "KES",
|
1265
|
+
currencyIcon: "Sh",
|
1266
|
+
internetCountryCode: "KE"
|
1267
|
+
},
|
1268
|
+
{
|
1269
|
+
countryName: "Lesotho",
|
1270
|
+
countryCode: "+266",
|
1271
|
+
currency: "Lesotho loti",
|
1272
|
+
currencyCode: "LSL",
|
1273
|
+
currencyIcon: "L",
|
1274
|
+
internetCountryCode: "LS"
|
1275
|
+
},
|
1276
|
+
{
|
1277
|
+
countryName: "Liberia",
|
1278
|
+
countryCode: "+231",
|
1279
|
+
currency: "Liberian dollar",
|
1280
|
+
currencyCode: "LRD",
|
1281
|
+
currencyIcon: "$",
|
1282
|
+
internetCountryCode: "LR"
|
1283
|
+
},
|
1284
|
+
{
|
1285
|
+
countryName: "Madagascar",
|
1286
|
+
countryCode: "+261",
|
1287
|
+
currency: "Malagasy ariary",
|
1288
|
+
currencyCode: "MGA",
|
1289
|
+
currencyIcon: "Ar",
|
1290
|
+
internetCountryCode: "MG"
|
1291
|
+
},
|
1292
|
+
{
|
1293
|
+
countryName: "Malawi",
|
1294
|
+
countryCode: "+265",
|
1295
|
+
currency: "Malawian kwacha",
|
1296
|
+
currencyCode: "MWK",
|
1297
|
+
currencyIcon: "MK",
|
1298
|
+
internetCountryCode: "MW"
|
1299
|
+
},
|
1300
|
+
{
|
1301
|
+
countryName: "Mali",
|
1302
|
+
countryCode: "+223",
|
1303
|
+
currency: "West African CFA franc",
|
1304
|
+
currencyCode: "XOF",
|
1305
|
+
currencyIcon: "Fr",
|
1306
|
+
internetCountryCode: "ML"
|
1307
|
+
},
|
1308
|
+
{
|
1309
|
+
countryName: "Mozambique",
|
1310
|
+
countryCode: "+258",
|
1311
|
+
currency: "Mozambican metical",
|
1312
|
+
currencyCode: "MZN",
|
1313
|
+
currencyIcon: "MT",
|
1314
|
+
internetCountryCode: "MZ"
|
1315
|
+
},
|
1316
|
+
{
|
1317
|
+
countryName: "Namibia",
|
1318
|
+
countryCode: "+264",
|
1319
|
+
currency: "Namibian dollar",
|
1320
|
+
currencyCode: "NAD",
|
1321
|
+
currencyIcon: "$",
|
1322
|
+
internetCountryCode: "NA"
|
1323
|
+
},
|
1324
|
+
{
|
1325
|
+
countryName: "Niger",
|
1326
|
+
countryCode: "+227",
|
1327
|
+
currency: "West African CFA franc",
|
1328
|
+
currencyCode: "XOF",
|
1329
|
+
currencyIcon: "Fr",
|
1330
|
+
internetCountryCode: "NE"
|
1331
|
+
},
|
1332
|
+
{
|
1333
|
+
countryName: "Nigeria",
|
1334
|
+
countryCode: "+234",
|
1335
|
+
currency: "Nigerian naira",
|
1336
|
+
currencyCode: "NGN",
|
1337
|
+
currencyIcon: "\u20A6",
|
1338
|
+
internetCountryCode: "NG"
|
1339
|
+
},
|
1340
|
+
{
|
1341
|
+
countryName: "Republic of the Congo",
|
1342
|
+
countryCode: "+242",
|
1343
|
+
currency: "Central African CFA franc",
|
1344
|
+
currencyCode: "XAF",
|
1345
|
+
currencyIcon: "Fr",
|
1346
|
+
internetCountryCode: "CG"
|
1347
|
+
},
|
1348
|
+
{
|
1349
|
+
countryName: "Rwanda",
|
1350
|
+
countryCode: "+250",
|
1351
|
+
currency: "Rwandan franc",
|
1352
|
+
currencyCode: "RWF",
|
1353
|
+
currencyIcon: "Fr",
|
1354
|
+
internetCountryCode: "RW"
|
1355
|
+
},
|
1356
|
+
{
|
1357
|
+
countryName: "Senegal",
|
1358
|
+
countryCode: "+221",
|
1359
|
+
currency: "West African CFA franc",
|
1360
|
+
currencyCode: "XOF",
|
1361
|
+
currencyIcon: "Fr",
|
1362
|
+
internetCountryCode: "SN"
|
1363
|
+
},
|
1364
|
+
{
|
1365
|
+
countryName: "Seychelles",
|
1366
|
+
countryCode: "+248",
|
1367
|
+
currency: "Seychellois rupee",
|
1368
|
+
currencyCode: "SCR",
|
1369
|
+
currencyIcon: "\u20A8",
|
1370
|
+
internetCountryCode: "SC"
|
1371
|
+
},
|
1372
|
+
{
|
1373
|
+
countryName: "South Africa",
|
1374
|
+
countryCode: "+27",
|
1375
|
+
currency: "South African rand",
|
1376
|
+
currencyCode: "ZAR",
|
1377
|
+
currencyIcon: "R",
|
1378
|
+
internetCountryCode: "ZA"
|
1379
|
+
},
|
1380
|
+
{
|
1381
|
+
countryName: "South Sudan",
|
1382
|
+
countryCode: "+211",
|
1383
|
+
currency: "South Sudanese pound",
|
1384
|
+
currencyCode: "SSP",
|
1385
|
+
currencyIcon: "\xA3",
|
1386
|
+
internetCountryCode: "SS"
|
1387
|
+
},
|
1388
|
+
{
|
1389
|
+
countryName: "Tanzania",
|
1390
|
+
countryCode: "+255",
|
1391
|
+
currency: "Tanzanian shilling",
|
1392
|
+
currencyCode: "TZS",
|
1393
|
+
currencyIcon: "Sh",
|
1394
|
+
internetCountryCode: "TZ"
|
1395
|
+
},
|
1396
|
+
{
|
1397
|
+
countryName: "Togo",
|
1398
|
+
countryCode: "+228",
|
1399
|
+
currency: "West African CFA franc",
|
1400
|
+
currencyCode: "XOF",
|
1401
|
+
currencyIcon: "Fr",
|
1402
|
+
internetCountryCode: "TG"
|
1403
|
+
},
|
1404
|
+
{
|
1405
|
+
countryName: "Uganda",
|
1406
|
+
countryCode: "+256",
|
1407
|
+
currency: "Ugandan shilling",
|
1408
|
+
currencyCode: "UGX",
|
1409
|
+
currencyIcon: "Sh",
|
1410
|
+
internetCountryCode: "UG"
|
1411
|
+
},
|
1412
|
+
{
|
1413
|
+
countryName: "Zambia",
|
1414
|
+
countryCode: "+260",
|
1415
|
+
currency: "Zambian kwacha",
|
1416
|
+
currencyCode: "ZMW",
|
1417
|
+
currencyIcon: "ZK",
|
1418
|
+
internetCountryCode: "ZM"
|
1419
|
+
}
|
1420
|
+
];
|
1421
|
+
var getCountryDataMap = () => {
|
1422
|
+
const frequency = {};
|
1423
|
+
countryData?.forEach((country) => {
|
1424
|
+
frequency[country?.internetCountryCode] = country?.countryName;
|
1425
|
+
});
|
1426
|
+
return frequency;
|
1427
|
+
};
|
1428
|
+
|
1429
|
+
// src/components/phone-input/index.tsx
|
1430
|
+
var React11 = __toESM(require("react"));
|
1431
|
+
var RPNInput = __toESM(require("react-phone-number-input"));
|
1432
|
+
var import_flags = __toESM(require("react-phone-number-input/flags"));
|
1433
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
1434
|
+
var PhoneInput = React11.forwardRef(
|
1435
|
+
({
|
1436
|
+
className,
|
1437
|
+
onChange,
|
1438
|
+
modal,
|
1439
|
+
showAsterisk,
|
1440
|
+
label,
|
1441
|
+
description,
|
1442
|
+
error,
|
1443
|
+
defaultCountry = "NG",
|
1444
|
+
...props
|
1445
|
+
}, ref) => {
|
1446
|
+
const CountrySelectWrapper = (innerProps) => {
|
1447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CountrySelect, { ...innerProps, status: props.status, modal });
|
1448
|
+
};
|
1449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative space-y-1", children: [
|
1450
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1452
|
+
RPNInput.default,
|
1453
|
+
{
|
1454
|
+
ref,
|
1455
|
+
className: cn("flex", className),
|
1456
|
+
flagComponent: FlagComponent,
|
1457
|
+
countrySelectComponent: CountrySelectWrapper,
|
1458
|
+
inputComponent: InputComponent,
|
1459
|
+
defaultCountry,
|
1460
|
+
onChange: (value) => onChange?.(value),
|
1461
|
+
...props
|
1462
|
+
}
|
1463
|
+
),
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorMessage, { error })
|
1466
|
+
] });
|
1467
|
+
}
|
1468
|
+
);
|
1469
|
+
PhoneInput.displayName = "PhoneInput";
|
1470
|
+
var InputComponent = React11.forwardRef(
|
1471
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1472
|
+
Input,
|
1473
|
+
{
|
1474
|
+
className: cn(
|
1475
|
+
"h-full !-mt-0 border-l-0 rounded-l-none flex-1",
|
1476
|
+
className
|
1477
|
+
),
|
1478
|
+
...props,
|
1479
|
+
ref
|
1480
|
+
}
|
1481
|
+
)
|
1482
|
+
);
|
1483
|
+
InputComponent.displayName = "InputComponent";
|
1484
|
+
var CountrySelect = ({
|
1485
|
+
disabled,
|
1486
|
+
value,
|
1487
|
+
onChange,
|
1488
|
+
options,
|
1489
|
+
status,
|
1490
|
+
modal
|
1491
|
+
}) => {
|
1492
|
+
const handleSelect = React11.useCallback(
|
1493
|
+
(country) => {
|
1494
|
+
onChange(country);
|
1495
|
+
},
|
1496
|
+
[onChange]
|
1497
|
+
);
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(PopoverRoot, { modal, children: [
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverTrigger, { disabled, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
1500
|
+
"div",
|
1501
|
+
{
|
1502
|
+
className: cn(
|
1503
|
+
inputContainerVariants({ status }),
|
1504
|
+
"!border-r-0 transition justify-center items-center border disabled:text-base-500 disabled:border-base-300 border-status-neutral-fill dark:border-[#9299A2] text-texts-50 focus:ring-offset-1 focus:ring-offset-base-100 focus-visible:!ring-offset-base-100 focus-visible:ring-2 focus-visible:!ring-accent focus:ring-accent focus:ring-2 flex gap-1 h-full rounded-e-none rounded-s-lg px-3 dark:!bg-transparent"
|
1505
|
+
),
|
1506
|
+
children: [
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FlagComponent, { country: value, countryName: value }),
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1509
|
+
"svg",
|
1510
|
+
{
|
1511
|
+
className: cn(
|
1512
|
+
"-mr-2 h-4 w-4 opacity-50",
|
1513
|
+
disabled ? "hidden" : "opacity-100"
|
1514
|
+
),
|
1515
|
+
width: "20",
|
1516
|
+
height: "20",
|
1517
|
+
viewBox: "0 0 20 20",
|
1518
|
+
fill: "none",
|
1519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1520
|
+
"path",
|
1521
|
+
{
|
1522
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1523
|
+
stroke: "#959595",
|
1524
|
+
strokeWidth: "1.5",
|
1525
|
+
strokeMiterlimit: "10",
|
1526
|
+
strokeLinecap: "round",
|
1527
|
+
strokeLinejoin: "round"
|
1528
|
+
}
|
1529
|
+
)
|
1530
|
+
}
|
1531
|
+
)
|
1532
|
+
]
|
1533
|
+
}
|
1534
|
+
) }),
|
1535
|
+
/* @__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: [
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandInput, { placeholder: "Search country..." }),
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandEmpty, { children: "No country found." }),
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandGroup, { children: options.filter((x) => x.value).map((option) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
1539
|
+
CommandItem,
|
1540
|
+
{
|
1541
|
+
className: "gap-2",
|
1542
|
+
onSelect: () => handleSelect(option.value),
|
1543
|
+
children: [
|
1544
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1545
|
+
FlagComponent,
|
1546
|
+
{
|
1547
|
+
country: option.value,
|
1548
|
+
countryName: option.label
|
1549
|
+
}
|
1550
|
+
),
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-sm", children: option.label }),
|
1552
|
+
option.value && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-[#191919]/50 text-sm dark:text-white", children: `+${RPNInput.getCountryCallingCode(option.value)}` }),
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1554
|
+
"svg",
|
1555
|
+
{
|
1556
|
+
width: "16",
|
1557
|
+
height: "16",
|
1558
|
+
viewBox: "0 0 16 16",
|
1559
|
+
fill: "none",
|
1560
|
+
className: cn(
|
1561
|
+
"ml-auto",
|
1562
|
+
option.value === value ? "opacity-100" : "opacity-0"
|
1563
|
+
),
|
1564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1565
|
+
"path",
|
1566
|
+
{
|
1567
|
+
d: "M4 8.00008L6.66353 10.6636L12 5.33655",
|
1568
|
+
stroke: "#959595",
|
1569
|
+
strokeWidth: "1.06667",
|
1570
|
+
strokeLinecap: "round",
|
1571
|
+
strokeLinejoin: "round"
|
1572
|
+
}
|
1573
|
+
)
|
1574
|
+
}
|
1575
|
+
)
|
1576
|
+
]
|
1577
|
+
},
|
1578
|
+
`${option.value}-${option.label}`
|
1579
|
+
)) })
|
1580
|
+
] }) }) }) })
|
1581
|
+
] });
|
1582
|
+
};
|
1583
|
+
var FlagComponent = ({
|
1584
|
+
country,
|
1585
|
+
countryName,
|
1586
|
+
className
|
1587
|
+
}) => {
|
1588
|
+
const Flag = import_flags.default[country];
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
1590
|
+
"span",
|
1591
|
+
{
|
1592
|
+
className: cn(
|
1593
|
+
"bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
|
1594
|
+
className
|
1595
|
+
),
|
1596
|
+
children: Flag && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Flag, { title: countryName })
|
1597
|
+
}
|
1598
|
+
);
|
1599
|
+
};
|
1600
|
+
FlagComponent.displayName = "FlagComponent";
|
1601
|
+
|
1602
|
+
// src/components/country/index.tsx
|
1603
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
1604
|
+
var countryMap = getCountryDataMap();
|
1605
|
+
var CountryTrigger = ({
|
1606
|
+
className,
|
1607
|
+
value,
|
1608
|
+
placeholder = "",
|
1609
|
+
status,
|
1610
|
+
disabled
|
1611
|
+
}) => {
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
1613
|
+
"button",
|
1614
|
+
{
|
1615
|
+
disabled,
|
1616
|
+
className: cn(
|
1617
|
+
inputContainerVariants({ status }),
|
1618
|
+
"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",
|
1619
|
+
value ? "" : "text-[#79818C]",
|
1620
|
+
className
|
1621
|
+
),
|
1622
|
+
children: [
|
1623
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-2", children: [
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1625
|
+
FlagComponent,
|
1626
|
+
{
|
1627
|
+
country: value,
|
1628
|
+
countryName: value,
|
1629
|
+
className: "ml-1 !w-6 h-5"
|
1630
|
+
}
|
1631
|
+
),
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "", children: [
|
1633
|
+
" ",
|
1634
|
+
countryMap[value]
|
1635
|
+
] })
|
1636
|
+
] }) : placeholder ?? "Select options...",
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1638
|
+
"svg",
|
1639
|
+
{
|
1640
|
+
width: "20",
|
1641
|
+
height: "20",
|
1642
|
+
viewBox: "0 0 20 20",
|
1643
|
+
fill: "none",
|
1644
|
+
className: " data-[state=open]:goup-rotate-180",
|
1645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1646
|
+
"path",
|
1647
|
+
{
|
1648
|
+
d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
|
1649
|
+
stroke: "currentColor",
|
1650
|
+
strokeWidth: "1.5",
|
1651
|
+
strokeMiterlimit: "10",
|
1652
|
+
strokeLinecap: "round",
|
1653
|
+
strokeLinejoin: "round"
|
1654
|
+
}
|
1655
|
+
)
|
1656
|
+
}
|
1657
|
+
)
|
1658
|
+
]
|
1659
|
+
}
|
1660
|
+
) });
|
1661
|
+
};
|
1662
|
+
var Country = ({
|
1663
|
+
hideSearch = true,
|
1664
|
+
showAsterisk,
|
1665
|
+
label,
|
1666
|
+
description,
|
1667
|
+
error,
|
1668
|
+
...props
|
1669
|
+
}) => {
|
1670
|
+
const options = countryData?.map((country) => ({
|
1671
|
+
value: country?.internetCountryCode,
|
1672
|
+
label: country?.countryName,
|
1673
|
+
...country
|
1674
|
+
}));
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative space-y-1", children: [
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormLabel, { showAsterisk, error, children: label }),
|
1677
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1678
|
+
Searchable,
|
1679
|
+
{
|
1680
|
+
options,
|
1681
|
+
hideSearch,
|
1682
|
+
optionComponent: (arg) => {
|
1683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex items-center gap-2", children: [
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1685
|
+
FlagComponent,
|
1686
|
+
{
|
1687
|
+
country: arg?.internetCountryCode,
|
1688
|
+
countryName: arg?.label,
|
1689
|
+
className: "ml-2 !w-6 !h-5"
|
1690
|
+
}
|
1691
|
+
),
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-1 text-sm", children: arg?.label })
|
1693
|
+
] });
|
1694
|
+
},
|
1695
|
+
...props,
|
1696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
1697
|
+
CountryTrigger,
|
1698
|
+
{
|
1699
|
+
value: props?.value?.value,
|
1700
|
+
status: props?.status,
|
1701
|
+
placeholder: props?.placeholder ?? " Select Country"
|
1702
|
+
}
|
1703
|
+
)
|
1704
|
+
}
|
1705
|
+
),
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorMessage, { error })
|
1708
|
+
] });
|
1709
|
+
};
|
1710
|
+
|
1711
|
+
// src/components/otp/index.tsx
|
1712
|
+
var import_react_otp_input = __toESM(require("react-otp-input"));
|
1713
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
1714
|
+
var import_react5 = require("react");
|
1715
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
1716
|
+
var otpInputVariants = (0, import_class_variance_authority5.cva)(
|
1717
|
+
"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",
|
1718
|
+
{
|
1719
|
+
variants: {
|
1720
|
+
status: {
|
1721
|
+
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]",
|
1722
|
+
error: "placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",
|
1723
|
+
loading: "placeholder:text-[#C4C4C4]"
|
1724
|
+
}
|
1725
|
+
},
|
1726
|
+
defaultVariants: {
|
1727
|
+
status: "default"
|
1728
|
+
}
|
1729
|
+
}
|
1730
|
+
);
|
1731
|
+
var OTPInput = ({
|
1732
|
+
numInputs = 4,
|
1733
|
+
inputStyle,
|
1734
|
+
containerStyle,
|
1735
|
+
placeholder = "-",
|
1736
|
+
status,
|
1737
|
+
...props
|
1738
|
+
}) => {
|
1739
|
+
const placeholderValue = (0, import_react5.useMemo)(() => {
|
1740
|
+
if (placeholder) return placeholder;
|
1741
|
+
const numInputArr = new Array(numInputs).fill("");
|
1742
|
+
const result = numInputArr.reduce((accumulator, currentValue) => {
|
1743
|
+
return accumulator += currentValue;
|
1744
|
+
}, "");
|
1745
|
+
return result;
|
1746
|
+
}, [numInputs, placeholder]);
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
1748
|
+
import_react_otp_input.default,
|
1749
|
+
{
|
1750
|
+
numInputs,
|
1751
|
+
placeholder: placeholderValue,
|
1752
|
+
containerStyle: cn("w-full", containerStyle),
|
1753
|
+
inputStyle: cn(otpInputVariants({ status }), inputStyle),
|
1754
|
+
renderInput: (props2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { ...props2 }),
|
1755
|
+
...props
|
1756
|
+
}
|
1757
|
+
);
|
1758
|
+
};
|
1759
|
+
// Annotate the CommonJS export names for ESM import in node:
|
1760
|
+
0 && (module.exports = {
|
1761
|
+
Button,
|
1762
|
+
Country,
|
1763
|
+
Dialog,
|
1764
|
+
FlagComponent,
|
1765
|
+
FormLabel,
|
1766
|
+
Input,
|
1767
|
+
Loader,
|
1768
|
+
OTPInput,
|
1769
|
+
PasswordInput,
|
1770
|
+
PhoneInput,
|
1771
|
+
Select,
|
1772
|
+
Textarea
|
1773
|
+
});
|