@6thbridge/hexa 0.0.0-pr51-61 → 0.0.0-pr51-62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -11,5 +11,5 @@ var fa=Object.defineProperty;var ga=(e,t,o)=>t in e?fa(e,t,{enumerable:!0,config
|
|
|
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:we(st.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?we(Jr.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:we("path",{d:"M1.9165 1H10.0832",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):we(Jr.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:we("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||d)&&Qr("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:[we("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors"),children:a}),d&&we("p",{className:i("text-sm text-base-500",p),children:d})]})]}));ro.displayName=st.Root.displayName;import{X as Ji}from"lucide-react";import{v4 as ta}from"uuid";import{jsx as R,jsxs as re}from"react/jsx-runtime";var oa=T.memo(({item:e,onDelete:t})=>re("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[e.label,R("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:R(Ji,{size:12})})]}));oa.displayName="SelectedChip";var ao=T.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>re(H,{className:i(W({status:a}),t),disabled:e,children:[R("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>R(oa,{item:s,onDelete:n},s.value)):R("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),R("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:R("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"})})]}));ao.displayName="MultiSelectTrigger";var ra=T.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>R("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:R("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:R(ro,{value:e.value,label:r?r(e):e.label,bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));ra.displayName="OptionItem";var Qi=({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,y]=T.useState(""),b=a,h=T.useMemo(()=>new Set(b.map(k=>k.value)),[b]),v=T.useMemo(()=>{if(!f)return e;let k=f.trim().toLowerCase();return e.filter(me=>me.label?.trim()?.toLowerCase()?.includes(k))},[e,f]),C=T.useCallback(k=>{let me=h.has(k.value);o(me?b.filter(Tt=>Tt.value!==k.value):[...b,k])},[b,h,o]),L=T.useRef(null),[g,x]=T.useState(void 0);T.useLayoutEffect(()=>{L.current&&x(L.current.clientWidth)},[]);let N=T.useCallback(k=>{let me=b.filter(Tt=>Tt.value!==k.value);o(me)},[b,o]),S=T.useCallback(()=>{b.length===e.length?o([]):o(e)},[b.length,e,o]),ae=T.useCallback(k=>{y(k.target.value)},[]);return re("div",{className:"relative space-y-1",children:[R(F,{showAsterisk:m,error:c,children:u}),re(U,{modal:s,children:[R("div",{ref:L,children:t??R(ao,{values:b,placeholder:l??"Select",onDelete:N,className:"h-auto"})}),p&&R("div",{className:"flex py-2 gap-2 flex-wrap",children:b.map(k=>R("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:k.label},ta()))}),re(z,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:g},children:[!n&&R("div",{className:"w-full px-4",children:re("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[d?R(he,{}):re("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),R("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:ae})]})}),re("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:[re("button",{className:"text-sm text-primary-main font-normal",onClick:S,disabled:v.length<1||d,children:[b.length===e.length?"Unselect":"Select"," all"]}),re("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[b.length," selected"]})]}),re(se,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[d&&R("div",{className:"py-7 flex justify-center",children:R(he,{})}),!d&&v.map(k=>R(ra,{option:k,isChecked:h.has(k.value),onSelect:C,optionComponent:r},ta()))]})]})]})]})};import*as Ne from"@radix-ui/react-tabs";import{jsx as lt,jsxs as no}from"react/jsx-runtime";function es({tabs:e,defaultValue:t,onChange:o}){return no(Ne.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[no(se,{className:"w-full",children:[lt(ut,{className:"z-[1000]",orientation:"horizontal"}),lt(Ne.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>no(Ne.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:[lt("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&<("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=>lt(Ne.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}import bs from"@tiptap/extension-font-family";import Cs from"@tiptap/extension-link";import xs from"@tiptap/extension-underline";import{EditorContent as ws,useEditor as Ns}from"@tiptap/react";import Rs from"@tiptap/starter-kit";import lo from"clsx";import vs from"clsx";import{Bold as ts,Italic as os,List as rs,ListOrdered as as,Quote as ns,Strikethrough as is,Underline as ss}from"lucide-react";import{jsx as cs}from"react/jsx-runtime";var ls=()=>cs("span",{className:"text-sm font-semibold",children:"H1"}),ke={bold:{icon:ts,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:os,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:ss,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:is,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:ls,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:rs,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:as,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:ns,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"}};import ds from"clsx";import{jsx as aa}from"react/jsx-runtime";var na=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>aa("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:ds("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:aa(t,{width:18,height:18})});import ps from"clsx";import{Link as ms}from"lucide-react";import{useCallback as Lt,useMemo as io,useState as ia}from"react";import{Fragment as us,jsx as ge,jsxs as so}from"react/jsx-runtime";var sa=({editor:e})=>{let[t,o]=ia(!1),[r,a]=ia(""),n=io(()=>!e.state.selection.empty,[e.state.selection]),s=io(()=>e.isActive("link"),[e]),l=io(()=>n||s,[n,s]),d=Lt(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),p=Lt(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),c=Lt(m=>{let f=e.getAttributes("link").href;a(f||""),o(m)},[l,e]),u=Lt(m=>{m.key==="Enter"&&(m.preventDefault(),d()),m.key==="Escape"&&o(!1)},[d]);return ge(K,{open:t,onOpenChange:c,trigger:ge("div",{className:ps("",{"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:ge(ms,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:ge("div",{className:"space-y-4",children:!n&&!s?ge("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."}):so(us,{children:[so("div",{children:[ge("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),ge(B,{type:"url",value:r,onChange:m=>a(m.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),so("div",{className:"flex justify-between space-x-2",children:[ge(J,{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")&&ge(J,{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"})]})]})})})};import fs from"clsx";import{ChevronDown as gs}from"lucide-react";import{useState as hs}from"react";import{jsx as Be,jsxs as la}from"react/jsx-runtime";var ca=({editor:e})=>{let[t,o]=hs(!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 Be(K,{open:t,onOpenChange:o,trigger:la("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:[Be("span",{className:"text-base ",children:r()}),Be(gs,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:Be("div",{className:"space-y-1",children:a.map((n,s)=>la("div",{children:[s===1&&Be("div",{className:"border-b border-gray-200 my-1"}),Be("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:fs("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))})})};import{jsx as kt,jsxs as ys}from"react/jsx-runtime";var da=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return ys("div",{className:vs("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"||ke&&ke[n]?kt("div",{className:"flex items-center",children:n==="textStyle"?kt(ca,{editor:e}):n==="link"?kt(sa,{editor:e}):kt(na,{editor:e,icon:ke[n].icon,action:ke[n].action,isActive:ke[n].isActive,title:ke[n].title})},n):null),r]})};import{jsx as Ve,jsxs as Dt}from"react/jsx-runtime";var Ps=({label:e,helpText:t,error:o,value:r="",onChange:a,optional:n,isRequired:s,extensions:l=[],editorClassName:d,wrapperClassName:p,controls:c,extraMenuNodes:u})=>{let m=Ns({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[Rs,xs,bs,Cs.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...l],onFocus:({event:f})=>{f.preventDefault(),f.stopPropagation()},onUpdate:({editor:f})=>{let y=f.getHTML();a?.(f.isEmpty?"":y)}});return m?Dt("div",{className:lo("flex flex-col w-full",p),children:[e&&Dt("div",{className:"flex justify-between mb-1",children:[Dt("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&Ve("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&Ve("span",{className:"text-sm text-gray-400",children:"Optional"})]}),Dt("div",{className:lo("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:[Ve(da,{editor:m,controls:c,extraNodes:u}),Ve(ws,{editor:m,className:lo("overflow-y-auto p-3 h-full bg-white",d)})]}),o&&Ve("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&Ve("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};var pa={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$"},ct=class ct{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 pa[t]||t}};po(ct,"formatAmountAndCurrency",(t,o,r)=>{let a=new Intl.NumberFormat(r?.locale||ct.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(r?.convertToMajorCurrency?ct.koboToNaira(Number(o)):Number(o)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),n=pa[t]||t;return a.replace(t,n)});var ma=ct;import co from"dayjs";var ua=class{static getDateLibrary(){return co()}static formatTimestampToDate(t,o){return co.unix(t).format(o||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return co(t).unix()}};export{ma as AmountAction,pn as Banner,J as Button,Jt as CalendarInput,yn as CopyableLabel,en as Country,pa as CurrencySymbolMap,ua as DateAction,Ht as DebouncedInput,Nn as DevBanner,Bt as Dialog,En as Drawer,Tn as DrawerClose,Gt as DrawerRoot,eo as FilterPopover,ye as FlagComponent,F as FormLabel,qi as HasResourcePermission,B as Input,he as Loader,_n as LocaleSelector,Qi as MultiSelect,ao as MultiSelectTrigger,sn as OTPInput,to as PageDataToolbar,jt as Pagination,Io as PasswordInput,Pt as PermissionsContext,Ui as PermissionsProvider,Xo as PhoneInput,K as Popover,z as PopoverContent,U as PopoverRoot,H as PopoverTrigger,bt as RadioGroup,Ct as RadioGroupItem,Ps as RichTextEditor,se as ScrollArea,et as Select,di as Sidebar,mi as Status,zi as Table,es as Tabs,Te as TextOverflow,Mo as Textarea,dt as Tooltip,St as TooltipContent,fo as TooltipProvider,go as TooltipRoot,ho as TooltipTrigger,Z as buttonVariants,i as cn,it as useFilterStore,oo as useHasPermission,jr as usePermissions};
|
|
14
|
+
flex items-center justify-center text-current`),children:t?we(Jr.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:we("path",{d:"M1.9165 1H10.0832",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):we(Jr.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:we("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:l?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||d)&&Qr("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:[we("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors"),children:a}),d&&we("p",{className:i("text-sm text-base-500",p),children:d})]})]}));ro.displayName=st.Root.displayName;import{X as Ji}from"lucide-react";import{v4 as ta}from"uuid";import{jsx as R,jsxs as re}from"react/jsx-runtime";var oa=T.memo(({item:e,onDelete:t})=>re("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[e.label,R("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:R(Ji,{size:12})})]}));oa.displayName="SelectedChip";var ao=T.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>re(H,{className:i(W({status:a}),t),disabled:e,children:[R("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>R(oa,{item:s,onDelete:n},s.value)):R("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),R("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:R("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"})})]}));ao.displayName="MultiSelectTrigger";var ra=T.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>R("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:R("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:R(ro,{value:e.value,label:r?r(e):e.label,bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));ra.displayName="OptionItem";var Qi=({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,y]=T.useState(""),b=a,h=T.useMemo(()=>new Set(b.map(k=>k.value)),[b]),v=T.useMemo(()=>{if(!f)return e;let k=f.trim().toLowerCase();return e.filter(me=>me.label?.trim()?.toLowerCase()?.includes(k))},[e,f]),C=T.useCallback(k=>{let me=h.has(k.value);o(me?b.filter(Tt=>Tt.value!==k.value):[...b,k])},[b,h,o]),L=T.useRef(null),[g,x]=T.useState(void 0);T.useLayoutEffect(()=>{L.current&&x(L.current.clientWidth)},[]);let N=T.useCallback(k=>{let me=b.filter(Tt=>Tt.value!==k.value);o(me)},[b,o]),S=T.useCallback(()=>{b.length===e.length?o([]):o(e)},[b.length,e,o]),ae=T.useCallback(k=>{y(k.target.value)},[]);return re("div",{className:"relative space-y-1",children:[R(F,{showAsterisk:m,error:c,children:u}),re(U,{modal:s,children:[R("div",{ref:L,children:t??R(ao,{values:b,placeholder:l??"Select",onDelete:N,className:"h-auto"})}),p&&R("div",{className:"flex py-2 gap-2 flex-wrap",children:b.map(k=>R("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:k.label},ta()))}),re(z,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:g},children:[!n&&R("div",{className:"w-full px-4",children:re("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[d?R(he,{}):re("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[R("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"}),R("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),R("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:ae})]})}),re("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:[re("button",{className:"text-sm text-primary-main font-normal",onClick:S,disabled:v.length<1||d,children:[b.length===e.length?"Unselect":"Select"," all"]}),re("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[b.length," selected"]})]}),re(se,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[d&&R("div",{className:"py-7 flex justify-center",children:R(he,{})}),!d&&v.map(k=>R(ra,{option:k,isChecked:h.has(k.value),onSelect:C,optionComponent:r},ta()))]})]})]})]})};import*as Ne from"@radix-ui/react-tabs";import{jsx as lt,jsxs as no}from"react/jsx-runtime";function es({tabs:e,defaultValue:t,onChange:o}){return no(Ne.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[no(se,{className:"w-full",children:[lt(ut,{className:"z-[1000]",orientation:"horizontal"}),lt(Ne.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>no(Ne.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:[lt("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&<("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=>lt(Ne.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}import bs from"@tiptap/extension-font-family";import Cs from"@tiptap/extension-link";import xs from"@tiptap/extension-underline";import{EditorContent as ws,useEditor as Ns}from"@tiptap/react";import Rs from"@tiptap/starter-kit";import lo from"clsx";import vs from"clsx";import{Bold as ts,Italic as os,List as rs,ListOrdered as as,Quote as ns,Strikethrough as is,Underline as ss}from"lucide-react";import{jsx as cs}from"react/jsx-runtime";var ls=()=>cs("span",{className:"text-sm font-semibold",children:"H1"}),ke={bold:{icon:ts,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:os,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:ss,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:is,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:ls,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:rs,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:as,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:ns,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"}};import ds from"clsx";import{jsx as aa}from"react/jsx-runtime";var na=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>aa("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:ds("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:aa(t,{width:18,height:18})});import ps from"clsx";import{Link as ms}from"lucide-react";import{useCallback as Lt,useMemo as io,useState as ia}from"react";import{Fragment as us,jsx as ge,jsxs as so}from"react/jsx-runtime";var sa=({editor:e})=>{let[t,o]=ia(!1),[r,a]=ia(""),n=io(()=>!e.state.selection.empty,[e.state.selection]),s=io(()=>e.isActive("link"),[e]),l=io(()=>n||s,[n,s]),d=Lt(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),p=Lt(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),c=Lt(m=>{let f=e.getAttributes("link").href;a(f||""),o(m)},[l,e]),u=Lt(m=>{m.key==="Enter"&&(m.preventDefault(),d()),m.key==="Escape"&&o(!1)},[d]);return ge(K,{open:t,onOpenChange:c,trigger:ge("div",{className:ps("",{"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:ge(ms,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:ge("div",{className:"space-y-4",children:!n&&!s?ge("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."}):so(us,{children:[so("div",{children:[ge("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),ge(B,{type:"url",value:r,onChange:m=>a(m.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),so("div",{className:"flex justify-between space-x-2",children:[ge(J,{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")&&ge(J,{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"})]})]})})})};import fs from"clsx";import{ChevronDown as gs}from"lucide-react";import{useState as hs}from"react";import{jsx as Be,jsxs as la}from"react/jsx-runtime";var ca=({editor:e})=>{let[t,o]=hs(!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 Be(K,{open:t,onOpenChange:o,trigger:la("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:[Be("span",{className:"text-base ",children:r()}),Be(gs,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:Be("div",{className:"space-y-1",children:a.map((n,s)=>la("div",{children:[s===1&&Be("div",{className:"border-b border-gray-200 my-1"}),Be("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:fs("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))})})};import{jsx as kt,jsxs as ys}from"react/jsx-runtime";var da=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return ys("div",{className:vs("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"||ke&&ke[n]?kt("div",{className:"flex items-center",children:n==="textStyle"?kt(ca,{editor:e}):n==="link"?kt(sa,{editor:e}):kt(na,{editor:e,icon:ke[n].icon,action:ke[n].action,isActive:ke[n].isActive,title:ke[n].title})},n):null),r]})};import{jsx as Ve,jsxs as Dt}from"react/jsx-runtime";var Ps=({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=Ns({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[Rs,xs,bs,Cs.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...l],onFocus:({event:y})=>{y.preventDefault(),y.stopPropagation()},onUpdate:({editor:y})=>{let b=y.getHTML();a?.(y.isEmpty?"":b)}});return f?Dt("div",{className:lo("flex flex-col w-full",p),children:[e&&Dt("div",{className:"flex justify-between mb-1",children:[Dt("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&Ve("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&Ve("span",{className:"text-sm text-gray-400",children:"Optional"})]}),Dt("div",{className:lo("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:[Ve(da,{editor:f,controls:c,extraNodes:u}),Ve(ws,{editor:f,className:lo("overflow-y-auto p-3 h-full bg-white",d),placeholder:m})]}),o&&Ve("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&Ve("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};var pa={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$"},ct=class ct{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 pa[t]||t}};po(ct,"formatAmountAndCurrency",(t,o,r)=>{let a=new Intl.NumberFormat(r?.locale||ct.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(r?.convertToMajorCurrency?ct.koboToNaira(Number(o)):Number(o)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),n=pa[t]||t;return a.replace(t,n)});var ma=ct;import co from"dayjs";var ua=class{static getDateLibrary(){return co()}static formatTimestampToDate(t,o){return co.unix(t).format(o||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return co(t).unix()}};export{ma as AmountAction,pn as Banner,J as Button,Jt as CalendarInput,yn as CopyableLabel,en as Country,pa as CurrencySymbolMap,ua as DateAction,Ht as DebouncedInput,Nn as DevBanner,Bt as Dialog,En as Drawer,Tn as DrawerClose,Gt as DrawerRoot,eo as FilterPopover,ye as FlagComponent,F as FormLabel,qi as HasResourcePermission,B as Input,he as Loader,_n as LocaleSelector,Qi as MultiSelect,ao as MultiSelectTrigger,sn as OTPInput,to as PageDataToolbar,jt as Pagination,Io as PasswordInput,Pt as PermissionsContext,Ui as PermissionsProvider,Xo as PhoneInput,K as Popover,z as PopoverContent,U as PopoverRoot,H as PopoverTrigger,bt as RadioGroup,Ct as RadioGroupItem,Ps as RichTextEditor,se as ScrollArea,et as Select,di as Sidebar,mi as Status,zi as Table,es as Tabs,Te as TextOverflow,Mo as Textarea,dt as Tooltip,St as TooltipContent,fo as TooltipProvider,go as TooltipRoot,ho as TooltipTrigger,Z as buttonVariants,i as cn,it as useFilterStore,oo as useHasPermission,jr as usePermissions};
|
|
15
15
|
//# sourceMappingURL=index.mjs.map
|