@6thbridge/hexa 0.0.0-pr59-92 → 0.0.0-pr59-93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11,5 +11,5 @@
11
11
  focus-visible:border-status-success-fill focus-visible:!ring-offset-status-success-bg focus-visible:!ring-status-success-bg focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-status-success-fill
12
12
  focus:border-status-success-fill focus:!ring-offset-status-success-bg focus:!ring-status-success-bg focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-status-success-fill
13
13
  disabled:cursor-not-allowed disabled:opacity-50 peer`,e==="md"?"h-5 w-5":e==="lg"?"h-6 w-6":"","data-[state=checked]:border-status-success-fill data-[state=checked]:bg-status-success-bg",o),id:r,disabled:l,...u,children:(0,me.jsx)(Et.Indicator,{className:i(`text-white dark:text-black data-[state=checked]:text-status-success-fill
14
- flex items-center justify-center text-current`),children:t?(0,me.jsx)(_o.motion.svg,{initial:{opacity:0,scale:.8},exit:{opacity:0},animate:{opacity:1,scale:1},transition:{duration:.1},width:"12",height:"2",viewBox:"0 0 12 2",fill:"none",children:(0,me.jsx)("path",{d:"M1.9165 1H10.0832",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,me.jsx)(_o.motion.svg,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.1},exit:{opacity:0},width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,me.jsx)("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||d)&&(0,me.jsxs)("div",{className:i("flex flex-col justify-start items-start text-base-700 dark:text-white peer-aria-checked:text-base-900 dark:peer-aria-checked:text-white peer-focus-visible:text-base-900 dark:peer-focus-visible:text-white peer-focus:text-base-900 dark:peer-focus:text-white peer-hover:text-base-900 dark:peer-hover:text-white",s),children:[(0,me.jsx)("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors"),children:a}),d&&(0,me.jsx)("p",{className:i("text-sm text-base-500",p),children:d})]})]}));zo.displayName=Et.Root.displayName;var za=require("lucide-react"),$o=require("uuid"),C=require("react/jsx-runtime"),$a=H.memo(({item:e,onDelete:t})=>(0,C.jsxs)("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[e.label,(0,C.jsx)("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:(0,C.jsx)(za.X,{size:12})})]}));$a.displayName="SelectedChip";var po=H.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>(0,C.jsxs)($,{className:i(re({status:a}),t),disabled:e,children:[(0,C.jsx)("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>(0,C.jsx)($a,{item:s,onDelete:n},s.value)):(0,C.jsx)("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),(0,C.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,C.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"})})]}));po.displayName="MultiSelectTrigger";var Za=H.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>(0,C.jsx)("article",{className:"cursor-pointer relative hover:bg-status-success-bg transition flex w-[calc(100%-0.375rem)] mx-auto rounded-md items-center focus:dark:!text-[#DDDFE0] py-1.5 px-2 text-sm outline-none focus:bg-status-success-bg dark:!text-[#DDDFE0] focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus-visible:ring-1 focus-visible:ring-status-success-fill focus-visible:ring-offset-1 focus-visible:ring-offset-status-success-fill",onClick:()=>o(e),children:(0,C.jsx)("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:(0,C.jsx)(zo,{value:e.value,label:r?r(e):e.label,bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));Za.displayName="OptionItem";var Ua=({options:e,children:t,onChange:o,optionComponent:r,values:a,hideSearch:n,modal:s,placeholder:l,isLoading:d,showSelectedValues:p=!1,error:c,label:u,showAsterisk:m})=>{let[f,b]=H.useState(""),x=a,g=H.useMemo(()=>new Set(x.map(B=>B.value)),[x]),v=H.useMemo(()=>{if(!f)return e;let B=f.trim().toLowerCase();return e.filter(Le=>Le.label?.trim()?.toLowerCase()?.includes(B))},[e,f]),P=H.useCallback(B=>{let Le=g.has(B.value);o(Le?x.filter(go=>go.value!==B.value):[...x,B])},[x,g,o]),M=H.useRef(null),[h,L]=H.useState(void 0);H.useLayoutEffect(()=>{M.current&&L(M.current.clientWidth)},[]);let S=H.useCallback(B=>{let Le=x.filter(go=>go.value!==B.value);o(Le)},[x,o]),G=H.useCallback(()=>{x.length===e.length?o([]):o(e)},[x.length,e,o]),Ne=H.useCallback(B=>{b(B.target.value)},[]);return(0,C.jsxs)("div",{className:"relative space-y-1",children:[(0,C.jsx)(V,{showAsterisk:m,error:c,children:u}),(0,C.jsxs)(ne,{modal:s,children:[(0,C.jsx)("div",{ref:M,children:t??(0,C.jsx)(po,{values:x,placeholder:l??"Select",onDelete:S,className:"h-auto"})}),p&&(0,C.jsx)("div",{className:"flex py-2 gap-2 flex-wrap",children:x.map(B=>(0,C.jsx)("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:B.label},(0,$o.v4)()))}),(0,C.jsxs)(J,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:h},children:[!n&&(0,C.jsx)("div",{className:"w-full px-4",children:(0,C.jsxs)("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[d?(0,C.jsx)(De,{}):(0,C.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.jsx)("path",{d:"M11.5 21C16.7467 21 21 16.7467 21 11.5C21 6.25329 16.7467 2 11.5 2C6.25329 2 2 6.25329 2 11.5C2 16.7467 6.25329 21 11.5 21Z",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,C.jsx)("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,C.jsx)("input",{value:f,placeholder:"Search",type:"text",disabled:d,className:"oultine-0 focus-visible:outline-0 focus-visible:ring-0 ml-1 w-full !border-transparent placeholder:text-sm placeholder:font-normal dark:bg-transparent placeholder:text-[#959595] dark:placeholder:text-[#DDDFE0] focus:ring-0 focus:ring-offset-0 focus:bg-white dark:focus:bg-transparent dark:text-[#DDDFE0]",onChange:Ne})]})}),(0,C.jsxs)("div",{className:i("w-full h-[44px] px-2.5 flex items-center justify-between mb-[5px] border-[#D7D7D7] dark:border-[#5C636B]",n?"border-b-[0.5px]":"border-y-[0.5px]"),children:[(0,C.jsxs)("button",{className:"text-sm text-primary-main font-normal",onClick:G,disabled:v.length<1||d,children:[x.length===e.length?"Unselect":"Select"," all"]}),(0,C.jsxs)("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[x.length," selected"]})]}),(0,C.jsxs)(xe,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[d&&(0,C.jsx)("div",{className:"py-7 flex justify-center",children:(0,C.jsx)(De,{})}),!d&&v.map(B=>(0,C.jsx)(Za,{option:B,isChecked:g.has(B.value),onSelect:P,optionComponent:r},(0,$o.v4)()))]})]})]})]})};var We=y(require("@radix-ui/react-tabs"));var Pe=require("react/jsx-runtime");function Ka({tabs:e,defaultValue:t,onChange:o}){return(0,Pe.jsxs)(We.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[(0,Pe.jsxs)(xe,{className:"w-full",children:[(0,Pe.jsx)(Ht,{className:"z-[1000]",orientation:"horizontal"}),(0,Pe.jsx)(We.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>(0,Pe.jsxs)(We.Trigger,{className:"flex items-center gap-2 whitespace-nowrap rounded-t-md px-5 py-2 relative transition-all group hover:!bg-gray-200/50 dark:hover:!bg-gray-200/10 data-[state=active]:dark:hover:!bg-gray-200 data-[state=active]:hover:!bg-gray-200 data-[state=active]:bg-gray-200 before:absolute before:bottom-[0px] before:left-0 before:h-[2px] dark:before:h-[0px] before:w-full before:rounded-sm data-[state=active]:before:!bg-texts-50 before:content-['']",value:r?.key,children:[(0,Pe.jsx)("p",{className:"text-center text-sm leading-5 font-normal text-gray-500 group-data-[state=active]:font-medium group-data-[state=active]:text-gray-800",children:r.title}),r.count&&(0,Pe.jsx)("div",{className:"bg-gray-300 group-data-[state=active]:bg-texts-50 group-data-[state=active]:text-white text-texts-50 text-xs font-medium me-2 px-2.5 py-0.5 rounded-full",children:r.count})]},r?.key))})]}),e.map(r=>(0,Pe.jsx)(We.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}var Zo=require("class-variance-authority"),At=require("react-icons/bi"),U=require("react/jsx-runtime"),Jn=(0,Zo.cva)("relative rounded-lg border px-4 py-4 text-sm",{variants:{variant:{default:"border-blue-200 bg-blue-50 text-blue-800",danger:"border-red-200 bg-red-50 text-red-800",success:"border-green-200 bg-green-50 text-green-800",pending:"border-yellow-200 bg-yellow-50 text-yellow-800"}},defaultVariants:{variant:"default"}}),Qn=(0,Zo.cva)("rounded-md px-4 py-2 text-sm font-semibold transition-colors whitespace-nowrap",{variants:{variant:{default:"bg-blue-600 text-white hover:bg-blue-700",danger:"bg-red-600 text-white hover:bg-red-700",success:"bg-green-600 text-white hover:bg-green-700",pending:"bg-yellow-600 text-white hover:bg-yellow-700"}},defaultVariants:{variant:"default"}}),Xa=({title:e,message:t,variant:o="default",icon:r,action:a,dismissible:n=!1,onDismiss:s,isOpen:l=!0,className:d})=>l?(0,U.jsxs)("div",{className:i(Jn({variant:o}),d),children:[n&&(0,U.jsx)("button",{type:"button",onClick:s,className:"absolute top-3 right-3 opacity-60 transition-opacity hover:opacity-100 sm:hidden","aria-label":"Dismiss",children:(0,U.jsx)(At.BiX,{size:20})}),(0,U.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,U.jsxs)("div",{className:"flex items-start gap-3 pr-6 sm:pr-0",children:[(0,U.jsx)("span",{className:"shrink-0 mt-0.5",children:r??(0,U.jsx)(At.BiInfoCircle,{size:18})}),(0,U.jsxs)("div",{className:"min-w-0",children:[(0,U.jsx)("p",{className:"font-semibold",children:e}),t&&(0,U.jsx)("p",{className:"mt-1 text-sm opacity-90 break-words",children:t})]})]}),(a||n)&&(0,U.jsxs)("div",{className:"flex flex-col items-end gap-3 sm:flex-row sm:items-center",children:[a&&(0,U.jsx)("button",{type:"button",onClick:a.onClick,className:i(Qn({variant:o}),a.className),children:a.label}),n&&(0,U.jsx)("button",{type:"button",onClick:s,className:"hidden sm:block opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss",children:(0,U.jsx)(At.BiX,{size:20})})]})]})]}):null;var ln=y(require("@tiptap/extension-font-family")),cn=y(require("@tiptap/extension-link")),dn=y(require("@tiptap/extension-underline")),uo=require("@tiptap/react"),pn=y(require("@tiptap/starter-kit")),mo=y(require("clsx"));var nn=y(require("clsx"));var oe=require("lucide-react"),ja=require("react/jsx-runtime"),ei=()=>(0,ja.jsx)("span",{className:"text-sm font-semibold",children:"H1"}),je={bold:{icon:oe.Bold,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:oe.Italic,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:oe.Underline,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:oe.Strikethrough,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:ei,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:oe.List,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:oe.ListOrdered,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:oe.Quote,action:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),title:"Quote"},textStyle:{icon:()=>null,action:()=>!0,isActive:()=>!1,title:"Text Style"},link:{icon:()=>null,action:()=>!0,isActive:()=>!1,title:"Link"}};var Ya=y(require("clsx")),Uo=require("react/jsx-runtime"),qa=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>(0,Uo.jsx)("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:(0,Ya.default)("p-2 rounded hover:bg-gray-100 transition",{"opacity-100 text-black":r(e),"opacity-40 text-gray-500":!r(e),"cursor-not-allowed":a},s),children:(0,Uo.jsx)(t,{width:18,height:18})});var Ja=y(require("clsx")),Qa=require("lucide-react"),ue=require("react");var K=require("react/jsx-runtime"),en=({editor:e})=>{let[t,o]=(0,ue.useState)(!1),[r,a]=(0,ue.useState)(""),n=(0,ue.useMemo)(()=>!e.state.selection.empty,[e.state.selection]),s=(0,ue.useMemo)(()=>e.isActive("link"),[e]),l=(0,ue.useMemo)(()=>n||s,[n,s]),d=(0,ue.useCallback)(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),p=(0,ue.useCallback)(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),c=(0,ue.useCallback)(m=>{let f=e.getAttributes("link").href;a(f||""),o(m)},[l,e]),u=(0,ue.useCallback)(m=>{m.key==="Enter"&&(m.preventDefault(),d()),m.key==="Escape"&&o(!1)},[d]);return(0,K.jsx)(ie,{open:t,onOpenChange:c,trigger:(0,K.jsx)("div",{className:(0,Ja.default)("",{"opacity-100 text-black":t,"opacity-40 text-gray-500":!t}),title:l?e.isActive("link")?"Edit link":"Add link":"Select text to add a link",children:(0,K.jsx)(Qa.Link,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:(0,K.jsx)("div",{className:"space-y-4",children:!n&&!s?(0,K.jsx)("div",{className:"text-sm text-gray-500 bg-gray-50 rounded p-3 border border-gray-200",children:"Please select some text in the editor to apply a link."}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),(0,K.jsx)(X,{type:"url",value:r,onChange:m=>a(m.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),(0,K.jsxs)("div",{className:"flex justify-between space-x-2",children:[(0,K.jsx)(le,{type:"button",onClick:d,disabled:!r.trim(),variant:"primary",size:"sm",className:"flex-1",children:e.isActive("link")?"Update Link":"Add Link"}),e.isActive("link")&&(0,K.jsx)(le,{type:"button",onClick:p,variant:"neutral",size:"sm",className:"px-3 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition text-sm font-medium",children:"Remove"})]})]})})})};var tn=y(require("clsx")),on=require("lucide-react"),rn=require("react");var Re=require("react/jsx-runtime"),an=({editor:e})=>{let[t,o]=(0,rn.useState)(!1),r=()=>e.isActive("heading",{level:1})?"Heading 1":e.isActive("heading",{level:2})?"Heading 2":e.isActive("heading",{level:3})?"Heading 3":"Normal",a=[{label:"Normal",action:()=>e.chain().focus().setParagraph().run(),isActive:!e.isActive("heading")},{label:"Heading 1",action:()=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e.isActive("heading",{level:1})},{label:"Heading 2",action:()=>e.chain().focus().toggleHeading({level:2}).run(),isActive:e.isActive("heading",{level:2})},{label:"Heading 3",action:()=>e.chain().focus().toggleHeading({level:3}).run(),isActive:e.isActive("heading",{level:3})}];return(0,Re.jsx)(ie,{open:t,onOpenChange:o,trigger:(0,Re.jsxs)("button",{type:"button",className:"flex items-center space-x-1 p-2 rounded hover:bg-gray-100 transition min-w-[110px] justify-between text-gray-600",children:[(0,Re.jsx)("span",{className:"text-base ",children:r()}),(0,Re.jsx)(on.ChevronDown,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:(0,Re.jsx)("div",{className:"space-y-1",children:a.map((n,s)=>(0,Re.jsxs)("div",{children:[s===1&&(0,Re.jsx)("div",{className:"border-b border-gray-200 my-1"}),(0,Re.jsx)("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:(0,tn.default)("w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-100 transition",{"bg-gray-100 font-medium":n.isActive}),children:n.label})]},n.label))})})};var Ye=require("react/jsx-runtime"),sn=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return(0,Ye.jsxs)("div",{className:(0,nn.default)("sticky top-0 z-10 flex w-full flex-wrap items-center space-x-1 border-b bg-white/80 backdrop-blur-md p-2",o),children:[a.map(n=>n==="textStyle"||n==="link"||je&&je[n]?(0,Ye.jsx)("div",{className:"flex items-center",children:n==="textStyle"?(0,Ye.jsx)(an,{editor:e}):n==="link"?(0,Ye.jsx)(en,{editor:e}):(0,Ye.jsx)(qa,{editor:e,icon:je[n].icon,action:je[n].action,isActive:je[n].isActive,title:je[n].title})},n):null),r]})};var fe=require("react/jsx-runtime"),mn=({label:e,helpText:t,error:o,value:r="",onChange:a,optional:n,isRequired:s,extensions:l=[],editorClassName:d,wrapperClassName:p,controls:c,extraMenuNodes:u,placeholder:m})=>{let f=(0,uo.useEditor)({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[pn.default,dn.default,ln.default,cn.default.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...l],onFocus:({event:b})=>{b.preventDefault(),b.stopPropagation()},onUpdate:({editor:b})=>{let x=b.getHTML();a?.(b.isEmpty?"":x)}});return f?(0,fe.jsxs)("div",{className:(0,mo.default)("flex flex-col w-full",p),children:[e&&(0,fe.jsxs)("div",{className:"flex justify-between mb-1",children:[(0,fe.jsxs)("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&(0,fe.jsx)("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&(0,fe.jsx)("span",{className:"text-sm text-gray-400",children:"Optional"})]}),(0,fe.jsxs)("div",{className:(0,mo.default)("relative border-none rounded-md overflow-hidden",o?"ring-1 ring-red-300 focus-within:ring-red-500":"ring-1 ring-gray-300 focus-within:ring-primary-main"),children:[(0,fe.jsx)(sn,{editor:f,controls:c,extraNodes:u}),(0,fe.jsx)(uo.EditorContent,{editor:f,className:(0,mo.default)("overflow-y-auto p-3 h-full bg-white",d),placeholder:m})]}),o&&(0,fe.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&(0,fe.jsx)("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};var Ko={USD:"$",CAD:"CA$",EUR:"\u20AC",AED:"AED",AFN:"Af",ALL:"ALL",AMD:"AMD",ARS:"AR$",AUD:"AU$",AZN:"man.",BAM:"KM",BDT:"Tk",BGN:"BGN",BHD:"BD",BIF:"FBu",BND:"BN$",BOB:"Bs",BRL:"R$",BWP:"BWP",BYN:"Br",BZD:"BZ$",CDF:"CDF",CHF:"CHF",CLP:"CL$",CNY:"CN\xA5",COP:"CO$",CRC:"\u20A1",CVE:"CV$",CZK:"K\u010D",DJF:"Fdj",DKK:"Dkr",DOP:"RD$",DZD:"DA",EEK:"Ekr",EGP:"EGP",ERN:"Nfk",ETB:"Br",GBP:"\xA3",GEL:"GEL",GHS:"GH\u20B5",GNF:"FG",GTQ:"GTQ",HKD:"HK$",HNL:"HNL",HRK:"kn",HUF:"Ft",IDR:"Rp",ILS:"\u20AA",INR:"\u20B9",IQD:"IQD",IRR:"IRR",ISK:"Ikr",JMD:"J$",JOD:"JD",JPY:"\xA5",KES:"Ksh",KHR:"KHR",KMF:"CF",KRW:"\u20A9",KWD:"KD",KZT:"KZT",LBP:"L.L.",LKR:"SLRs",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"MDL",MGA:"MGA",MKD:"MKD",MMK:"MMK",MOP:"MOP$",MUR:"MURs",MXN:"MX$",MYR:"RM",MZN:"MTn",NAD:"N$",NGN:"\u20A6",NIO:"C$",NOK:"Nkr",NPR:"NPRs",NZD:"NZ$",OMR:"OMR",PAB:"B/.",PEN:"S/.",PHP:"\u20B1",PKR:"PKRs",PLN:"z\u0142",PYG:"\u20B2",QAR:"QR",RON:"RON",RSD:"din.",RUB:"RUB",RWF:"RWF",SAR:"SR",SDG:"SDG",SEK:"Skr",SGD:"S$",SOS:"Ssh",SYP:"SY\xA3",THB:"\u0E3F",TND:"DT",TOP:"T$",TRY:"TL",TTD:"TT$",TWD:"NT$",TZS:"TSh",UAH:"\u20B4",UGX:"USh",UYU:"$U",UZS:"UZS",VEF:"Bs.F.",VND:"\u20AB",XAF:"F CFA",XOF:"CFA",YER:"YR",ZAR:"R",ZMK:"ZK",ZWL:"ZWL$"},Mt=class Mt{static getCurrencyLocaleMap(t){return{XOF:"fr",XAF:"fr"}[t]||"en"}static koboToNaira(t){return+t/100}static nairaToKobo(t){return+t*100}static getCurrencySymbol(t){return Ko[t]||t}};qo(Mt,"formatAmountAndCurrency",(t,o,r)=>{let a=new Intl.NumberFormat(r?.locale||Mt.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(r?.convertToMajorCurrency?Mt.koboToNaira(Number(o)):Number(o)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),n=Ko[t]||t;return a.replace(t,n)});var Xo=Mt;var fo=y(require("dayjs")),jo=class{static getDateLibrary(){return(0,fo.default)()}static formatTimestampToDate(t,o){return fo.default.unix(t).format(o||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return(0,fo.default)(t).unix()}};0&&(module.exports={AmountAction,Banner,Button,CalendarInput,CopyableLabel,Country,CurrencySymbolMap,DateAction,DebouncedInput,DevBanner,Dialog,Drawer,DrawerClose,DrawerRoot,FeatureBanner,FilterPopover,FlagComponent,FormLabel,HasResourcePermission,Input,Loader,LocaleSelector,MultiSelect,MultiSelectTrigger,OTPInput,PageDataToolbar,Pagination,PasswordInput,PermissionsContext,PermissionsProvider,PhoneInput,Popover,PopoverContent,PopoverRoot,PopoverTrigger,RadioGroup,RadioGroupItem,RichTextEditor,ScrollArea,Select,Sidebar,Status,Table,Tabs,TextOverflow,Textarea,Tooltip,TooltipContent,TooltipProvider,TooltipRoot,TooltipTrigger,buttonVariants,cn,useFilterStore,useHasPermission,usePermissions});
14
+ flex items-center justify-center text-current`),children:t?(0,me.jsx)(_o.motion.svg,{initial:{opacity:0,scale:.8},exit:{opacity:0},animate:{opacity:1,scale:1},transition:{duration:.1},width:"12",height:"2",viewBox:"0 0 12 2",fill:"none",children:(0,me.jsx)("path",{d:"M1.9165 1H10.0832",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,me.jsx)(_o.motion.svg,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.1},exit:{opacity:0},width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,me.jsx)("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||d)&&(0,me.jsxs)("div",{className:i("flex flex-col justify-start items-start text-base-700 dark:text-white peer-aria-checked:text-base-900 dark:peer-aria-checked:text-white peer-focus-visible:text-base-900 dark:peer-focus-visible:text-white peer-focus:text-base-900 dark:peer-focus:text-white peer-hover:text-base-900 dark:peer-hover:text-white",s),children:[(0,me.jsx)("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors"),children:a}),d&&(0,me.jsx)("p",{className:i("text-sm text-base-500",p),children:d})]})]}));zo.displayName=Et.Root.displayName;var za=require("lucide-react"),$o=require("uuid"),C=require("react/jsx-runtime"),$a=H.memo(({item:e,onDelete:t})=>(0,C.jsxs)("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[e.label,(0,C.jsx)("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:(0,C.jsx)(za.X,{size:12})})]}));$a.displayName="SelectedChip";var po=H.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>(0,C.jsxs)($,{className:i(re({status:a}),t),disabled:e,children:[(0,C.jsx)("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>(0,C.jsx)($a,{item:s,onDelete:n},s.value)):(0,C.jsx)("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),(0,C.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,C.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"})})]}));po.displayName="MultiSelectTrigger";var Za=H.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>(0,C.jsx)("article",{className:"cursor-pointer relative hover:bg-status-success-bg transition flex w-[calc(100%-0.375rem)] mx-auto rounded-md items-center focus:dark:!text-[#DDDFE0] py-1.5 px-2 text-sm outline-none focus:bg-status-success-bg dark:!text-[#DDDFE0] focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus-visible:ring-1 focus-visible:ring-status-success-fill focus-visible:ring-offset-1 focus-visible:ring-offset-status-success-fill",onClick:()=>o(e),children:(0,C.jsx)("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:(0,C.jsx)(zo,{value:e.value,label:r?r(e):e.label,bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));Za.displayName="OptionItem";var Ua=({options:e,children:t,onChange:o,optionComponent:r,values:a,hideSearch:n,modal:s,placeholder:l,isLoading:d,showSelectedValues:p=!1,error:c,label:u,showAsterisk:m})=>{let[f,b]=H.useState(""),x=a,g=H.useMemo(()=>new Set(x.map(B=>B.value)),[x]),v=H.useMemo(()=>{if(!f)return e;let B=f.trim().toLowerCase();return e.filter(Le=>Le.label?.trim()?.toLowerCase()?.includes(B))},[e,f]),P=H.useCallback(B=>{let Le=g.has(B.value);o(Le?x.filter(go=>go.value!==B.value):[...x,B])},[x,g,o]),M=H.useRef(null),[h,L]=H.useState(void 0);H.useLayoutEffect(()=>{M.current&&L(M.current.clientWidth)},[]);let S=H.useCallback(B=>{let Le=x.filter(go=>go.value!==B.value);o(Le)},[x,o]),G=H.useCallback(()=>{x.length===e.length?o([]):o(e)},[x.length,e,o]),Ne=H.useCallback(B=>{b(B.target.value)},[]);return(0,C.jsxs)("div",{className:"relative space-y-1",children:[(0,C.jsx)(V,{showAsterisk:m,error:c,children:u}),(0,C.jsxs)(ne,{modal:s,children:[(0,C.jsx)("div",{ref:M,children:t??(0,C.jsx)(po,{values:x,placeholder:l??"Select",onDelete:S,className:"h-auto"})}),p&&(0,C.jsx)("div",{className:"flex py-2 gap-2 flex-wrap",children:x.map(B=>(0,C.jsx)("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:B.label},(0,$o.v4)()))}),(0,C.jsxs)(J,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:h},children:[!n&&(0,C.jsx)("div",{className:"w-full px-4",children:(0,C.jsxs)("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[d?(0,C.jsx)(De,{}):(0,C.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.jsx)("path",{d:"M11.5 21C16.7467 21 21 16.7467 21 11.5C21 6.25329 16.7467 2 11.5 2C6.25329 2 2 6.25329 2 11.5C2 16.7467 6.25329 21 11.5 21Z",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,C.jsx)("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,C.jsx)("input",{value:f,placeholder:"Search",type:"text",disabled:d,className:"oultine-0 focus-visible:outline-0 focus-visible:ring-0 ml-1 w-full !border-transparent placeholder:text-sm placeholder:font-normal dark:bg-transparent placeholder:text-[#959595] dark:placeholder:text-[#DDDFE0] focus:ring-0 focus:ring-offset-0 focus:bg-white dark:focus:bg-transparent dark:text-[#DDDFE0]",onChange:Ne})]})}),(0,C.jsxs)("div",{className:i("w-full h-[44px] px-2.5 flex items-center justify-between mb-[5px] border-[#D7D7D7] dark:border-[#5C636B]",n?"border-b-[0.5px]":"border-y-[0.5px]"),children:[(0,C.jsxs)("button",{className:"text-sm text-primary-main font-normal",onClick:G,disabled:v.length<1||d,children:[x.length===e.length?"Unselect":"Select"," all"]}),(0,C.jsxs)("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[x.length," selected"]})]}),(0,C.jsxs)(xe,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[d&&(0,C.jsx)("div",{className:"py-7 flex justify-center",children:(0,C.jsx)(De,{})}),!d&&v.map(B=>(0,C.jsx)(Za,{option:B,isChecked:g.has(B.value),onSelect:P,optionComponent:r},(0,$o.v4)()))]})]})]})]})};var We=y(require("@radix-ui/react-tabs"));var Pe=require("react/jsx-runtime");function Ka({tabs:e,defaultValue:t,onChange:o}){return(0,Pe.jsxs)(We.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[(0,Pe.jsxs)(xe,{className:"w-full",children:[(0,Pe.jsx)(Ht,{className:"z-[1000]",orientation:"horizontal"}),(0,Pe.jsx)(We.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>(0,Pe.jsxs)(We.Trigger,{className:"flex items-center gap-2 whitespace-nowrap rounded-t-md px-5 py-2 relative transition-all group hover:!bg-gray-200/50 dark:hover:!bg-gray-200/10 data-[state=active]:dark:hover:!bg-gray-200 data-[state=active]:hover:!bg-gray-200 data-[state=active]:bg-gray-200 before:absolute before:bottom-[0px] before:left-0 before:h-[2px] dark:before:h-[0px] before:w-full before:rounded-sm data-[state=active]:before:!bg-texts-50 before:content-['']",value:r?.key,children:[(0,Pe.jsx)("p",{className:"text-center text-sm leading-5 font-normal text-gray-500 group-data-[state=active]:font-medium group-data-[state=active]:text-gray-800",children:r.title}),r.count&&(0,Pe.jsx)("div",{className:"bg-gray-300 group-data-[state=active]:bg-texts-50 group-data-[state=active]:text-white text-texts-50 text-xs font-medium me-2 px-2.5 py-0.5 rounded-full",children:r.count})]},r?.key))})]}),e.map(r=>(0,Pe.jsx)(We.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}var Zo=require("class-variance-authority"),At=require("react-icons/bi"),U=require("react/jsx-runtime"),Jn=(0,Zo.cva)("relative rounded-lg border px-4 py-4 text-sm",{variants:{variant:{default:"border-blue-200 bg-blue-50 text-blue-800",danger:"border-red-200 bg-red-50 text-red-800",success:"border-green-200 bg-green-50 text-green-800",pending:"border-yellow-200 bg-yellow-50 text-yellow-800"}},defaultVariants:{variant:"default"}}),Qn=(0,Zo.cva)("rounded-md px-4 py-2 text-sm font-semibold transition-colors whitespace-nowrap",{variants:{variant:{default:"bg-blue-600 text-white hover:bg-blue-700",danger:"bg-red-600 text-white hover:bg-red-700",success:"bg-green-600 text-white hover:bg-green-700",pending:"bg-yellow-600 text-white hover:bg-yellow-700"}},defaultVariants:{variant:"default"}}),Xa=({title:e,message:t,variant:o="default",icon:r,action:a,dismissible:n=!1,onDismiss:s,isOpen:l=!0,className:d})=>l?(0,U.jsxs)("div",{className:i(Jn({variant:o}),d),children:[n&&(0,U.jsx)("button",{type:"button",onClick:s,className:"absolute top-3 right-3 opacity-60 transition-opacity hover:opacity-100 sm:hidden","aria-label":"Dismiss",children:(0,U.jsx)(At.BiX,{size:20})}),(0,U.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,U.jsxs)("div",{className:"flex items-start gap-3 pr-6 sm:pr-0",children:[(0,U.jsx)("span",{className:"shrink-0 mt-0.5",children:r??(0,U.jsx)(At.BiInfoCircle,{size:18})}),(0,U.jsxs)("div",{className:"min-w-0",children:[(0,U.jsx)("p",{className:"font-semibold",children:e}),t&&(0,U.jsx)("p",{className:"mt-1 text-sm opacity-90 break-words",children:t})]})]}),(a||n)&&(0,U.jsxs)("div",{className:"flex flex-col items-end gap-3 sm:flex-row sm:items-center",children:[a&&(0,U.jsx)("button",{type:"button",onClick:a.onClick,className:i(Qn({variant:o}),a.className),children:a.label}),n&&(0,U.jsx)("button",{type:"button",onClick:s,className:"hidden sm:flex opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss",children:(0,U.jsx)(At.BiX,{size:20})})]})]})]}):null;var ln=y(require("@tiptap/extension-font-family")),cn=y(require("@tiptap/extension-link")),dn=y(require("@tiptap/extension-underline")),uo=require("@tiptap/react"),pn=y(require("@tiptap/starter-kit")),mo=y(require("clsx"));var nn=y(require("clsx"));var oe=require("lucide-react"),ja=require("react/jsx-runtime"),ei=()=>(0,ja.jsx)("span",{className:"text-sm font-semibold",children:"H1"}),je={bold:{icon:oe.Bold,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:oe.Italic,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:oe.Underline,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:oe.Strikethrough,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:ei,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:oe.List,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:oe.ListOrdered,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:oe.Quote,action:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),title:"Quote"},textStyle:{icon:()=>null,action:()=>!0,isActive:()=>!1,title:"Text Style"},link:{icon:()=>null,action:()=>!0,isActive:()=>!1,title:"Link"}};var Ya=y(require("clsx")),Uo=require("react/jsx-runtime"),qa=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>(0,Uo.jsx)("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:(0,Ya.default)("p-2 rounded hover:bg-gray-100 transition",{"opacity-100 text-black":r(e),"opacity-40 text-gray-500":!r(e),"cursor-not-allowed":a},s),children:(0,Uo.jsx)(t,{width:18,height:18})});var Ja=y(require("clsx")),Qa=require("lucide-react"),ue=require("react");var K=require("react/jsx-runtime"),en=({editor:e})=>{let[t,o]=(0,ue.useState)(!1),[r,a]=(0,ue.useState)(""),n=(0,ue.useMemo)(()=>!e.state.selection.empty,[e.state.selection]),s=(0,ue.useMemo)(()=>e.isActive("link"),[e]),l=(0,ue.useMemo)(()=>n||s,[n,s]),d=(0,ue.useCallback)(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),p=(0,ue.useCallback)(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),c=(0,ue.useCallback)(m=>{let f=e.getAttributes("link").href;a(f||""),o(m)},[l,e]),u=(0,ue.useCallback)(m=>{m.key==="Enter"&&(m.preventDefault(),d()),m.key==="Escape"&&o(!1)},[d]);return(0,K.jsx)(ie,{open:t,onOpenChange:c,trigger:(0,K.jsx)("div",{className:(0,Ja.default)("",{"opacity-100 text-black":t,"opacity-40 text-gray-500":!t}),title:l?e.isActive("link")?"Edit link":"Add link":"Select text to add a link",children:(0,K.jsx)(Qa.Link,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:(0,K.jsx)("div",{className:"space-y-4",children:!n&&!s?(0,K.jsx)("div",{className:"text-sm text-gray-500 bg-gray-50 rounded p-3 border border-gray-200",children:"Please select some text in the editor to apply a link."}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),(0,K.jsx)(X,{type:"url",value:r,onChange:m=>a(m.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),(0,K.jsxs)("div",{className:"flex justify-between space-x-2",children:[(0,K.jsx)(le,{type:"button",onClick:d,disabled:!r.trim(),variant:"primary",size:"sm",className:"flex-1",children:e.isActive("link")?"Update Link":"Add Link"}),e.isActive("link")&&(0,K.jsx)(le,{type:"button",onClick:p,variant:"neutral",size:"sm",className:"px-3 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition text-sm font-medium",children:"Remove"})]})]})})})};var tn=y(require("clsx")),on=require("lucide-react"),rn=require("react");var Re=require("react/jsx-runtime"),an=({editor:e})=>{let[t,o]=(0,rn.useState)(!1),r=()=>e.isActive("heading",{level:1})?"Heading 1":e.isActive("heading",{level:2})?"Heading 2":e.isActive("heading",{level:3})?"Heading 3":"Normal",a=[{label:"Normal",action:()=>e.chain().focus().setParagraph().run(),isActive:!e.isActive("heading")},{label:"Heading 1",action:()=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e.isActive("heading",{level:1})},{label:"Heading 2",action:()=>e.chain().focus().toggleHeading({level:2}).run(),isActive:e.isActive("heading",{level:2})},{label:"Heading 3",action:()=>e.chain().focus().toggleHeading({level:3}).run(),isActive:e.isActive("heading",{level:3})}];return(0,Re.jsx)(ie,{open:t,onOpenChange:o,trigger:(0,Re.jsxs)("button",{type:"button",className:"flex items-center space-x-1 p-2 rounded hover:bg-gray-100 transition min-w-[110px] justify-between text-gray-600",children:[(0,Re.jsx)("span",{className:"text-base ",children:r()}),(0,Re.jsx)(on.ChevronDown,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:(0,Re.jsx)("div",{className:"space-y-1",children:a.map((n,s)=>(0,Re.jsxs)("div",{children:[s===1&&(0,Re.jsx)("div",{className:"border-b border-gray-200 my-1"}),(0,Re.jsx)("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:(0,tn.default)("w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-100 transition",{"bg-gray-100 font-medium":n.isActive}),children:n.label})]},n.label))})})};var Ye=require("react/jsx-runtime"),sn=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return(0,Ye.jsxs)("div",{className:(0,nn.default)("sticky top-0 z-10 flex w-full flex-wrap items-center space-x-1 border-b bg-white/80 backdrop-blur-md p-2",o),children:[a.map(n=>n==="textStyle"||n==="link"||je&&je[n]?(0,Ye.jsx)("div",{className:"flex items-center",children:n==="textStyle"?(0,Ye.jsx)(an,{editor:e}):n==="link"?(0,Ye.jsx)(en,{editor:e}):(0,Ye.jsx)(qa,{editor:e,icon:je[n].icon,action:je[n].action,isActive:je[n].isActive,title:je[n].title})},n):null),r]})};var fe=require("react/jsx-runtime"),mn=({label:e,helpText:t,error:o,value:r="",onChange:a,optional:n,isRequired:s,extensions:l=[],editorClassName:d,wrapperClassName:p,controls:c,extraMenuNodes:u,placeholder:m})=>{let f=(0,uo.useEditor)({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[pn.default,dn.default,ln.default,cn.default.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...l],onFocus:({event:b})=>{b.preventDefault(),b.stopPropagation()},onUpdate:({editor:b})=>{let x=b.getHTML();a?.(b.isEmpty?"":x)}});return f?(0,fe.jsxs)("div",{className:(0,mo.default)("flex flex-col w-full",p),children:[e&&(0,fe.jsxs)("div",{className:"flex justify-between mb-1",children:[(0,fe.jsxs)("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&(0,fe.jsx)("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&(0,fe.jsx)("span",{className:"text-sm text-gray-400",children:"Optional"})]}),(0,fe.jsxs)("div",{className:(0,mo.default)("relative border-none rounded-md overflow-hidden",o?"ring-1 ring-red-300 focus-within:ring-red-500":"ring-1 ring-gray-300 focus-within:ring-primary-main"),children:[(0,fe.jsx)(sn,{editor:f,controls:c,extraNodes:u}),(0,fe.jsx)(uo.EditorContent,{editor:f,className:(0,mo.default)("overflow-y-auto p-3 h-full bg-white",d),placeholder:m})]}),o&&(0,fe.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&(0,fe.jsx)("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};var Ko={USD:"$",CAD:"CA$",EUR:"\u20AC",AED:"AED",AFN:"Af",ALL:"ALL",AMD:"AMD",ARS:"AR$",AUD:"AU$",AZN:"man.",BAM:"KM",BDT:"Tk",BGN:"BGN",BHD:"BD",BIF:"FBu",BND:"BN$",BOB:"Bs",BRL:"R$",BWP:"BWP",BYN:"Br",BZD:"BZ$",CDF:"CDF",CHF:"CHF",CLP:"CL$",CNY:"CN\xA5",COP:"CO$",CRC:"\u20A1",CVE:"CV$",CZK:"K\u010D",DJF:"Fdj",DKK:"Dkr",DOP:"RD$",DZD:"DA",EEK:"Ekr",EGP:"EGP",ERN:"Nfk",ETB:"Br",GBP:"\xA3",GEL:"GEL",GHS:"GH\u20B5",GNF:"FG",GTQ:"GTQ",HKD:"HK$",HNL:"HNL",HRK:"kn",HUF:"Ft",IDR:"Rp",ILS:"\u20AA",INR:"\u20B9",IQD:"IQD",IRR:"IRR",ISK:"Ikr",JMD:"J$",JOD:"JD",JPY:"\xA5",KES:"Ksh",KHR:"KHR",KMF:"CF",KRW:"\u20A9",KWD:"KD",KZT:"KZT",LBP:"L.L.",LKR:"SLRs",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"MDL",MGA:"MGA",MKD:"MKD",MMK:"MMK",MOP:"MOP$",MUR:"MURs",MXN:"MX$",MYR:"RM",MZN:"MTn",NAD:"N$",NGN:"\u20A6",NIO:"C$",NOK:"Nkr",NPR:"NPRs",NZD:"NZ$",OMR:"OMR",PAB:"B/.",PEN:"S/.",PHP:"\u20B1",PKR:"PKRs",PLN:"z\u0142",PYG:"\u20B2",QAR:"QR",RON:"RON",RSD:"din.",RUB:"RUB",RWF:"RWF",SAR:"SR",SDG:"SDG",SEK:"Skr",SGD:"S$",SOS:"Ssh",SYP:"SY\xA3",THB:"\u0E3F",TND:"DT",TOP:"T$",TRY:"TL",TTD:"TT$",TWD:"NT$",TZS:"TSh",UAH:"\u20B4",UGX:"USh",UYU:"$U",UZS:"UZS",VEF:"Bs.F.",VND:"\u20AB",XAF:"F CFA",XOF:"CFA",YER:"YR",ZAR:"R",ZMK:"ZK",ZWL:"ZWL$"},Mt=class Mt{static getCurrencyLocaleMap(t){return{XOF:"fr",XAF:"fr"}[t]||"en"}static koboToNaira(t){return+t/100}static nairaToKobo(t){return+t*100}static getCurrencySymbol(t){return Ko[t]||t}};qo(Mt,"formatAmountAndCurrency",(t,o,r)=>{let a=new Intl.NumberFormat(r?.locale||Mt.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(r?.convertToMajorCurrency?Mt.koboToNaira(Number(o)):Number(o)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),n=Ko[t]||t;return a.replace(t,n)});var Xo=Mt;var fo=y(require("dayjs")),jo=class{static getDateLibrary(){return(0,fo.default)()}static formatTimestampToDate(t,o){return fo.default.unix(t).format(o||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return(0,fo.default)(t).unix()}};0&&(module.exports={AmountAction,Banner,Button,CalendarInput,CopyableLabel,Country,CurrencySymbolMap,DateAction,DebouncedInput,DevBanner,Dialog,Drawer,DrawerClose,DrawerRoot,FeatureBanner,FilterPopover,FlagComponent,FormLabel,HasResourcePermission,Input,Loader,LocaleSelector,MultiSelect,MultiSelectTrigger,OTPInput,PageDataToolbar,Pagination,PasswordInput,PermissionsContext,PermissionsProvider,PhoneInput,Popover,PopoverContent,PopoverRoot,PopoverTrigger,RadioGroup,RadioGroupItem,RichTextEditor,ScrollArea,Select,Sidebar,Status,Table,Tabs,TextOverflow,Textarea,Tooltip,TooltipContent,TooltipProvider,TooltipRoot,TooltipTrigger,buttonVariants,cn,useFilterStore,useHasPermission,usePermissions});
15
15
  //# sourceMappingURL=index.js.map