@6thbridge/hexa 0.0.0-pr76-137 → 0.0.0-pr77-138

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.mjs 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:c,...u,children:Me(bt.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?Me(ca.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:Me("path",{d:"M1.9165 1H10.0832",stroke:c?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):Me(ca.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:Me("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:c?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||m)&&da("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:[Me("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors",{"cursor-not-allowed opacity-50":c}),children:a}),m&&Me("p",{className:i("text-sm text-base-500",{"cursor-not-allowed opacity-50":c},l),children:m})]})]}));vt.displayName=bt.Root.displayName;import{jsx as k,jsxs as ue}from"react/jsx-runtime";var ua=V.memo(({item:e,onDelete:t})=>ue("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[k("span",{children:e.label}),k("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:k(ys,{size:12})})]}));ua.displayName="SelectedChip";var go=V.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>k(H,{asChild:!0,disabled:e,children:ue("div",{className:i(z({status:a}),"cursor-pointer [&>svg]:shrink-0 h-auto min-h-12 flex items-center justify-between w-full gap-2",t),children:[k("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>k(ua,{item:s,onDelete:n},s.value)):k("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),k("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:k("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"})})]})}));go.displayName="MultiSelectTrigger";var fa=V.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>k("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:k("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:k(vt,{onSelect:()=>o(e),value:e.value,label:r?r(e):k("span",{children:e.label}),bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));fa.displayName="OptionItem";var xs=({options:e,children:t,onChange:o,optionComponent:r,values:a,hideSearch:n,modal:s,placeholder:c,isLoading:m,showSelectedValues:l=!1,error:p,label:u,showAsterisk:d})=>{let[f,N]=V.useState(""),y=a,v=V.useMemo(()=>new Set(y.map(P=>P.value)),[y]),g=V.useMemo(()=>{if(!f)return e;let P=f.trim().toLowerCase();return e.filter(F=>F.label?.trim()?.toLowerCase()?.includes(P))},[e,f]),R=V.useCallback(P=>{let F=v.has(P.value);o(F?y.filter(Pe=>Pe.value!==P.value):[...y,P])},[y,v,o]),x=V.useRef(null),[b,h]=V.useState(void 0);V.useLayoutEffect(()=>{if(!x.current)return;let P=x.current,F=()=>{h(P.getBoundingClientRect().width)};F();let Pe=new ResizeObserver(()=>{F()});return Pe.observe(P),()=>Pe.disconnect()},[]);let C=V.useCallback(P=>{let F=y.filter(Pe=>Pe.value!==P.value);o(F)},[y,o]),w=V.useCallback(()=>{y.length===e.length?o([]):o(e)},[y.length,e,o]),D=V.useCallback(P=>{N(P.target.value)},[]);return ue("div",{className:"relative space-y-1",children:[k(A,{showAsterisk:d,error:p,children:u}),ue(K,{modal:s,children:[k("div",{ref:x,children:t??k(go,{values:y,placeholder:c??"Select",onDelete:C,className:"h-auto"})}),l&&k("div",{className:"flex py-2 gap-2 flex-wrap",children:y.map(P=>k("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:k("span",{children:P.label})},ma()))}),ue($,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:b?`${b}px`:void 0},children:[!n&&k("div",{className:"w-full px-4",children:ue("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[m?k(pe,{}):ue("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[k("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"}),k("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),k("input",{value:f,placeholder:"Search",type:"text",disabled:m,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:D})]})}),ue("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:[k("button",{className:"text-sm text-primary-main font-normal",onClick:w,disabled:g.length<1||m,children:ue("span",{children:[y.length===e.length?"Unselect":"Select"," all"]})}),ue("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[y.length," selected"]})]}),ue(le,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[m&&k("div",{className:"py-7 flex justify-center",children:k(pe,{})}),!m&&g.map(P=>k(fa,{option:P,isChecked:v.has(P.value),onSelect:R,optionComponent:r},ma()))]})]})]})]})};import*as Ae from"@radix-ui/react-tabs";import{jsx as He,jsxs as bo}from"react/jsx-runtime";function Cs({tabs:e,defaultValue:t,onChange:o}){return bo(Ae.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[bo(le,{className:"w-full",children:[He(wt,{className:"z-[1000]",orientation:"horizontal"}),He(Ae.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>bo(Ae.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:[He("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:He("span",{children:r.title})}),r.count&&He("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:He("span",{children:r.count})})]},r?.key))})]}),e.map(r=>He(Ae.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}import{BiInfoCircle as Ns,BiX as ha}from"react-icons/bi";import{cva as ws}from"class-variance-authority";var ba=ws("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"}}),ga={default:{primary:"",outlined:""},danger:{primary:"bg-red-600 hover:bg-red-600/80 text-white border-red-600",outlined:"border-red-600 text-red-600 hover:bg-red-50"},success:{primary:"bg-green-600 hover:bg-green-600/80 text-white border-green-600",outlined:"border-green-600 text-green-600 hover:bg-green-50"},pending:{primary:"bg-yellow-600 hover:bg-yellow-600/80 text-white border-yellow-600",outlined:"border-yellow-600 text-yellow-600 hover:bg-yellow-50"}},va=(e,t)=>(ga[e]??ga.default)[t];import{jsx as we,jsxs as ht}from"react/jsx-runtime";var Rs=({title:e,message:t,variant:o="default",icon:r,action:a,dismissible:n=!1,onDismiss:s,isOpen:c=!0,align:m="start",classNames:l})=>{if(!c)return null;let p=a?.variant??"primary",u=va(o??"default",p),d=m==="center";return ht("div",{className:i(ba({variant:o}),l?.root),children:[n&&we("button",{type:"button",onClick:s,className:"absolute top-3 right-3 opacity-60 transition-opacity hover:opacity-100 sm:hidden","aria-label":"Dismiss",id:"feature_banner_dismiss_button_mobile",children:we(ha,{size:20})}),ht("div",{className:i("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",d&&"sm:items-center"),id:"feature_banner_container",children:[ht("div",{className:i("flex items-start gap-3 pr-6 sm:pr-0",d&&"sm:items-center"),id:"feature_banner_content_wrapper",children:[we("span",{className:i("shrink-0 mt-0.5",d&&"sm:mt-0",l?.icon),id:"feature_banner_icon",children:r??we(Ns,{size:18})}),ht("div",{className:"min-w-0",id:"feature_banner_content",children:[we("p",{className:i("font-semibold",l?.title),id:"feature_banner_title",children:e}),t&&we("p",{id:"feature_banner_message",className:i("mt-1 text-sm opacity-90 break-words",l?.message),children:t})]})]}),(a||n)&&ht("div",{className:i("flex flex-col items-end gap-3 sm:flex-row sm:items-center",d&&"sm:items-center"),id:"feature_banner_actions_wrapper",children:[a&&we(Q,{variant:p,type:"button",onClick:a.onClick,className:i(u,l?.action),id:"feature_banner_action_button",children:a.label}),n&&we("button",{type:"button",onClick:s,className:"hidden sm:flex opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss",id:"feature_banner_dismiss_button",children:we(ha,{size:20})})]})]})]})};import zs from"@tiptap/extension-font-family";import $s from"@tiptap/extension-link";import Zs from"@tiptap/extension-underline";import{EditorContent as Us,useEditor as Ks}from"@tiptap/react";import js from"@tiptap/starter-kit";import yo from"clsx";import Gs from"clsx";import{Bold as Ps,Italic as Ls,List as ks,ListOrdered as Ds,Quote as Ss,Strikethrough as Ts,Underline as Fs}from"lucide-react";import{jsx as Ms}from"react/jsx-runtime";var Es=()=>Ms("span",{className:"text-sm font-semibold",children:"H1"}),_e={bold:{icon:Ps,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:Ls,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:Fs,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:Ts,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:Es,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:ks,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:Ds,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:Ss,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 As from"clsx";import{jsx as ya}from"react/jsx-runtime";var xa=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>ya("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:As("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:ya(t,{width:18,height:18})});import Is from"clsx";import{Link as Bs}from"lucide-react";import{useCallback as Bt,useMemo as vo,useState as Ca}from"react";import{Fragment as Vs,jsx as Ne,jsxs as ho}from"react/jsx-runtime";var wa=({editor:e})=>{let[t,o]=Ca(!1),[r,a]=Ca(""),n=vo(()=>!e.state.selection.empty,[e.state.selection]),s=vo(()=>e.isActive("link"),[e]),c=vo(()=>n||s,[n,s]),m=Bt(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),l=Bt(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),p=Bt(d=>{let f=e.getAttributes("link").href;a(f||""),o(d)},[c,e]),u=Bt(d=>{d.key==="Enter"&&(d.preventDefault(),m()),d.key==="Escape"&&o(!1)},[m]);return Ne(ie,{open:t,onOpenChange:p,trigger:Ne("div",{className:Is("",{"opacity-100 text-black":t,"opacity-40 text-gray-500":!t}),title:c?e.isActive("link")?"Edit link":"Add link":"Select text to add a link",children:Ne(Bs,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:Ne("div",{className:"space-y-4",children:!n&&!s?Ne("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."}):ho(Vs,{children:[ho("div",{children:[Ne("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),Ne(G,{type:"url",value:r,onChange:d=>a(d.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),ho("div",{className:"flex justify-between space-x-2",children:[Ne(Q,{type:"button",onClick:m,disabled:!r.trim(),variant:"primary",size:"sm",className:"flex-1",children:e.isActive("link")?"Update Link":"Add Link"}),e.isActive("link")&&Ne(Q,{type:"button",onClick:l,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 Os from"clsx";import{ChevronDown as Hs}from"lucide-react";import{useState as _s}from"react";import{jsx as qe,jsxs as Na}from"react/jsx-runtime";var Ra=({editor:e})=>{let[t,o]=_s(!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 qe(ie,{open:t,onOpenChange:o,trigger:Na("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:[qe("span",{className:"text-base ",children:r()}),qe(Hs,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:qe("div",{className:"space-y-1",children:a.map((n,s)=>Na("div",{children:[s===1&&qe("div",{className:"border-b border-gray-200 my-1"}),qe("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:Os("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 Vt,jsxs as Ws}from"react/jsx-runtime";var Pa=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return Ws("div",{className:Gs("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"||_e&&_e[n]?Vt("div",{className:"flex items-center",children:n==="textStyle"?Vt(Ra,{editor:e}):n==="link"?Vt(wa,{editor:e}):Vt(xa,{editor:e,icon:_e[n].icon,action:_e[n].action,isActive:_e[n].isActive,title:_e[n].title})},n):null),r]})};import{jsx as Je,jsxs as Ot}from"react/jsx-runtime";var Xs=({label:e,helpText:t,error:o,value:r="",onChange:a,optional:n,isRequired:s,extensions:c=[],editorClassName:m,wrapperClassName:l,controls:p,extraMenuNodes:u,placeholder:d})=>{let f=Ks({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[js,Zs,zs,$s.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...c],onFocus:({event:N})=>{N.preventDefault(),N.stopPropagation()},onUpdate:({editor:N})=>{let y=N.getHTML();a?.(N.isEmpty?"":y)}});return f?Ot("div",{className:yo("flex flex-col w-full",l),children:[e&&Ot("div",{className:"flex justify-between mb-1",children:[Ot("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&Je("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&Je("span",{className:"text-sm text-gray-400",children:"Optional"})]}),Ot("div",{className:yo("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:[Je(Pa,{editor:f,controls:p,extraNodes:u}),Je(Us,{editor:f,className:yo("overflow-y-auto p-3 h-full bg-white",m),placeholder:d})]}),o&&Je("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&Je("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};import{Search as Ys,X as ka}from"lucide-react";import*as O from"react";import{jsx as S,jsxs as Re}from"react/jsx-runtime";var La={success:"bg-green-500/20 text-green-500 ring-1 ring-inset ring-current",failed:"bg-red-500/20 text-red-500 ring-1 ring-inset ring-current",pending:"bg-yellow-500/20 text-yellow-500 ring-1 ring-inset ring-current",default:"bg-gray-100 text-gray-700"},Da=O.memo(({tag:e,onRemove:t})=>Re("p",{className:i("text-xs p-1.5 py-1 rounded-md flex items-center gap-1",La[e.variant??"default"]??La.default),children:[S("span",{children:e.label}),S("button",{type:"button",className:"pl-1",onClick:o=>{o.stopPropagation(),t()},children:S(ka,{size:12})})]}));Da.displayName="SelectedChip";var Sa=O.memo(({option:e,isChecked:t,onSelect:o,renderOption:r,disabled:a})=>S("article",{className:"cursor-pointer relative hover:bg-status-success-bg transition flex w-[calc(100%-0.375rem)] mx-auto rounded-md items-center py-1.5 px-2 text-sm outline-none focus:bg-status-success-bg dark:!text-[#DDDFE0] focus-visible:ring-1 focus-visible:ring-status-success-fill focus-visible:ring-offset-1",onClick:()=>!a&&o(e),children:S("div",{className:"w-full h-[20px] flex flex-row items-center dark:!text-white",children:S(vt,{onSelect:()=>!a&&o(e),disabled:a,value:e.value,label:r?r(e,t):S("span",{children:e.label}),bodyClassName:"w-full",labelWrapperClassName:"w-full",checked:t})})}));Sa.displayName="OptionItem";var qs=({value:e,onChange:t,options:o=[],label:r,error:a,placeholder:n="Add tag...",description:s,showAsterisk:c,disabled:m,isLoading:l,allowCreate:p=!0,renderTag:u,renderOption:d,validateTag:f,onCreate:N,maxTags:y})=>{let[v,g]=O.useState(""),R=O.useRef(null),[x,b]=O.useState();O.useLayoutEffect(()=>{if(!R.current)return;let L=()=>b(R.current?.getBoundingClientRect().width);L();let M=new ResizeObserver(L);return M.observe(R.current),()=>M.disconnect()},[]);let h=O.useMemo(()=>new Set(e.map(L=>L.value)),[e]),C=O.useMemo(()=>{let L=v.trim().toLowerCase();return L?o.filter(M=>M.label.toLowerCase().includes(L)):o},[o,v]),w=O.useCallback(L=>t(e.filter(M=>M.value!==L)),[e,t]),D=O.useCallback(L=>{h.has(L.value)||y&&e.length>=y||t([...e,L])},[e,t,h,y]),P=O.useCallback(L=>{let M=L.trim();if(!M||!(f?f(M):!0))return;let Co=o.find(wo=>wo.value.toLowerCase()===M.toLowerCase()||wo.label.toLowerCase()===M.toLowerCase());if(Co){D(Co),g("");return}p&&(D(N?.(M)??{value:M,label:M}),g(""))},[o,p,N,f,D]),F=L=>{L.key==="Enter"&&(L.preventDefault(),P(v)),L.key==="Backspace"&&!v&&e.length&&w(e[e.length-1].value)},Pe=!l&&p&&v.trim()&&!o.some(L=>L.value.toLowerCase()===v.trim().toLowerCase());return Re("div",{className:"relative space-y-1",children:[S(A,{showAsterisk:c,error:a,children:r}),Re(K,{children:[S("div",{ref:R,children:S(H,{asChild:!0,disabled:m,children:Re("div",{id:"tags_trigger_container",className:i(z({status:a?"error":"default"}),"cursor-pointer [&>svg]:shrink-0 h-auto min-h-10 flex items-center justify-between w-full gap-2 p-2"),children:[Re("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:[e.length>0&&e?.map(L=>{let M=()=>w(L.value);return u?S(O.Fragment,{children:Re("div",{className:"flex items-center",children:[u(L),S("button",{type:"button",className:"pl-1",onClick:xo=>{xo.stopPropagation(),M()},children:S(ka,{size:12})})]})},L.value):S(Da,{tag:L,onRemove:M},L.value)}),S("input",{value:v,disabled:m,readOnly:!p||void 0,placeholder:n,className:"flex-1 min-w-[80px] !border-none !outline-none bg-transparent text-sm p-0 h-auto !focus-visible:ring-0 placeholder:text-[#79818C] placeholder:text-sm",onChange:L=>g(L.target.value),onKeyDown:F})]}),S("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:S("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"})})]})})}),Re($,{align:"start",className:"min-w-[200px] p-0 mt-1",style:{width:x?`${x}px`:void 0},children:[S("div",{className:"w-full",children:S("div",{className:i("w-full mt-1 h-10 flex items-center justify-start mb-[5px] px-2 pt-2",{"mt-3":a}),children:S(G,{error:a,leftNode:S(Ys,{className:"text-gray-400"}),value:v,placeholder:"Type to search or create",type:"text",disabled:l,rightNode:l?S(pe,{colour:"secondary"}):void 0,onChange:L=>g(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),P(v))}})})}),Re(le,{viewPortClassName:"max-h-[225px] px",className:"pb-1 mt-3",children:[l&&S("div",{className:"py-7 flex justify-center",children:S(pe,{})}),!l&&C.map(L=>S(Sa,{option:L,isChecked:h.has(L.value),disabled:L.disabled,onSelect:M=>h.has(M.value)?w(M.value):D(M),renderOption:d},L.value)),Pe&&Re("button",{type:"button",className:i("w-full text-left px-3 py-2 text-sm border-t border-t-gray-300 hover:bg-gray-50 mt-1",{"mt-3":a}),onClick:()=>P(v),children:['Create "',v.trim(),'"']})]})]})]}),s&&!a&&S("div",{className:"text-sm text-gray-500",children:s}),S(ee,{error:a})]})};export{Ro as AmountAction,Sn as Banner,Q as Button,co as CalendarInput,Bn as CopyableLabel,yn as Country,No as CurrencySymbolMap,Po as DateAction,qt as DebouncedInput,Gn as DevBanner,Kt as Dialog,Yn as Drawer,Kn as DrawerClose,Jt as DrawerRoot,Rs as FeatureBanner,uo as FilterPopover,De as FlagComponent,A as FormLabel,hs as HasResourcePermission,G as Input,pe as Loader,ni as LocaleSelector,xs as MultiSelect,go as MultiSelectTrigger,Pn as OTPInput,fo as PageDataToolbar,so as Pagination,jo as PasswordInput,kt as PermissionsContext,wi as PermissionsProvider,ir as PhoneInput,ie as Popover,$ as PopoverContent,K as PopoverRoot,H as PopoverTrigger,Ft as RadioGroup,Et as RadioGroupItem,Xs as RichTextEditor,le as ScrollArea,Se as Select,Ii as Sidebar,Vi as Status,_t as StringAction,vs as Table,Cs as Tabs,qs as TagsInput,$e as TextOverflow,Xo as Textarea,xt as Tooltip,Gt as TooltipContent,Do as TooltipProvider,So as TooltipRoot,To as TooltipTrigger,J as buttonVariants,i as cn,gt as useFilterStore,ft as useHasPermission,Gr as usePermissions};
14
+ flex items-center justify-center text-current`),children:t?Me(ca.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:Me("path",{d:"M1.9165 1H10.0832",stroke:c?"#B0B0B0":"#00D488",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):Me(ca.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:Me("path",{d:"M1 3.99996L3.66353 6.66349L9 1.33643",stroke:c?"#B0B0B0":"#00D488",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(a||m)&&da("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:[Me("label",{htmlFor:r,className:i(n,"text-sm font-normal cursor-pointer disabled:cursor-not-allowed transition-colors",{"cursor-not-allowed opacity-50":c}),children:a}),m&&Me("p",{className:i("text-sm text-base-500",{"cursor-not-allowed opacity-50":c},l),children:m})]})]}));vt.displayName=bt.Root.displayName;import{jsx as k,jsxs as ue}from"react/jsx-runtime";var ua=V.memo(({item:e,onDelete:t})=>ue("p",{className:"text-xs p-1.5 py-1 bg-gray-100 rounded-md flex items-center",children:[k("span",{children:e.label}),k("button",{type:"button",className:"pl-2",onClick:o=>{o.stopPropagation(),t(e)},children:k(ys,{size:12})})]}));ua.displayName="SelectedChip";var go=V.memo(({disabled:e,className:t,values:o,placeholder:r="",status:a,onDelete:n})=>k(H,{asChild:!0,disabled:e,children:ue("div",{className:i(z({status:a}),"cursor-pointer [&>svg]:shrink-0 h-auto min-h-12 flex items-center justify-between w-full gap-2",t),children:[k("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:o.length?o.map(s=>k(ua,{item:s,onDelete:n},s.value)):k("span",{className:"text-[#79818C] dark:text-[#959BA4]",children:r})}),k("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:k("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"})})]})}));go.displayName="MultiSelectTrigger";var fa=V.memo(({option:e,isChecked:t,onSelect:o,optionComponent:r})=>k("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:k("div",{className:"w-full h-[30px] flex flex-row items-center dark:!text-white",children:k(vt,{onClick:a=>a.stopPropagation(),onSelect:()=>o(e),value:e.value,label:r?r(e):k("span",{children:e.label}),bodyClassName:"w-full",labelWrapperClassName:"w-full",labelClassName:i(r&&"w-full"),checked:t})})}));fa.displayName="OptionItem";var xs=({options:e,children:t,onChange:o,optionComponent:r,values:a,hideSearch:n,modal:s,placeholder:c,isLoading:m,showSelectedValues:l=!1,error:p,label:u,showAsterisk:d})=>{let[f,N]=V.useState(""),y=a,v=V.useMemo(()=>new Set(y.map(P=>P.value)),[y]),g=V.useMemo(()=>{if(!f)return e;let P=f.trim().toLowerCase();return e.filter(F=>F.label?.trim()?.toLowerCase()?.includes(P))},[e,f]),R=V.useCallback(P=>{let F=v.has(P.value);o(F?y.filter(Pe=>Pe.value!==P.value):[...y,P])},[y,v,o]),x=V.useRef(null),[b,h]=V.useState(void 0);V.useLayoutEffect(()=>{if(!x.current)return;let P=x.current,F=()=>{h(P.getBoundingClientRect().width)};F();let Pe=new ResizeObserver(()=>{F()});return Pe.observe(P),()=>Pe.disconnect()},[]);let C=V.useCallback(P=>{let F=y.filter(Pe=>Pe.value!==P.value);o(F)},[y,o]),w=V.useCallback(()=>{y.length===e.length?o([]):o(e)},[y.length,e,o]),D=V.useCallback(P=>{N(P.target.value)},[]);return ue("div",{className:"relative space-y-1",children:[k(A,{showAsterisk:d,error:p,children:u}),ue(K,{modal:s,children:[k("div",{ref:x,children:t??k(go,{values:y,placeholder:c??"Select",onDelete:C,className:"h-auto"})}),l&&k("div",{className:"flex py-2 gap-2 flex-wrap",children:y.map(P=>k("div",{className:"bg-gray-100 border text-black rounded-xl text-[10px] font-medium px-2 py-1",children:k("span",{children:P.label})},ma()))}),ue($,{portal:!s,align:"start",className:"min-w-[200px] p-0",style:{width:b?`${b}px`:void 0},children:[!n&&k("div",{className:"w-full px-4",children:ue("div",{className:"w-full h-[36px] px-1 flex items-center justify-start border-[0.5px] rounded-md border-[#D7D7D7] mb-[5px]",children:[m?k(pe,{}):ue("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[k("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"}),k("path",{d:"M22 22L20 20",stroke:"#959595",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),k("input",{value:f,placeholder:"Search",type:"text",disabled:m,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:D})]})}),ue("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:[k("button",{className:"text-sm text-primary-main font-normal",onClick:w,disabled:g.length<1||m,children:ue("span",{children:[y.length===e.length?"Unselect":"Select"," all"]})}),ue("p",{className:"text-sm text-[#959595] font-normal dark:text-[#DDDFE0]",children:[y.length," selected"]})]}),ue(le,{viewPortClassName:"max-h-[225px]",className:"pb-1",children:[m&&k("div",{className:"py-7 flex justify-center",children:k(pe,{})}),!m&&g.map(P=>k(fa,{option:P,isChecked:v.has(P.value),onSelect:R,optionComponent:r},ma()))]})]})]})]})};import*as Ae from"@radix-ui/react-tabs";import{jsx as He,jsxs as bo}from"react/jsx-runtime";function Cs({tabs:e,defaultValue:t,onChange:o}){return bo(Ae.Root,{defaultValue:t,onValueChange:o,className:"flex flex-col items-start justify-start gap-2.5",children:[bo(le,{className:"w-full",children:[He(wt,{className:"z-[1000]",orientation:"horizontal"}),He(Ae.List,{className:"my-2 border-b border-gray-300 items-center flex",children:e.map(r=>bo(Ae.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:[He("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:He("span",{children:r.title})}),r.count&&He("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:He("span",{children:r.count})})]},r?.key))})]}),e.map(r=>He(Ae.Content,{value:r?.key,className:"w-full",children:r.content},r?.key))]})}import{BiInfoCircle as Ns,BiX as ha}from"react-icons/bi";import{cva as ws}from"class-variance-authority";var ba=ws("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"}}),ga={default:{primary:"",outlined:""},danger:{primary:"bg-red-600 hover:bg-red-600/80 text-white border-red-600",outlined:"border-red-600 text-red-600 hover:bg-red-50"},success:{primary:"bg-green-600 hover:bg-green-600/80 text-white border-green-600",outlined:"border-green-600 text-green-600 hover:bg-green-50"},pending:{primary:"bg-yellow-600 hover:bg-yellow-600/80 text-white border-yellow-600",outlined:"border-yellow-600 text-yellow-600 hover:bg-yellow-50"}},va=(e,t)=>(ga[e]??ga.default)[t];import{jsx as we,jsxs as ht}from"react/jsx-runtime";var Rs=({title:e,message:t,variant:o="default",icon:r,action:a,dismissible:n=!1,onDismiss:s,isOpen:c=!0,align:m="start",classNames:l})=>{if(!c)return null;let p=a?.variant??"primary",u=va(o??"default",p),d=m==="center";return ht("div",{className:i(ba({variant:o}),l?.root),children:[n&&we("button",{type:"button",onClick:s,className:"absolute top-3 right-3 opacity-60 transition-opacity hover:opacity-100 sm:hidden","aria-label":"Dismiss",id:"feature_banner_dismiss_button_mobile",children:we(ha,{size:20})}),ht("div",{className:i("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",d&&"sm:items-center"),id:"feature_banner_container",children:[ht("div",{className:i("flex items-start gap-3 pr-6 sm:pr-0",d&&"sm:items-center"),id:"feature_banner_content_wrapper",children:[we("span",{className:i("shrink-0 mt-0.5",d&&"sm:mt-0",l?.icon),id:"feature_banner_icon",children:r??we(Ns,{size:18})}),ht("div",{className:"min-w-0",id:"feature_banner_content",children:[we("p",{className:i("font-semibold",l?.title),id:"feature_banner_title",children:e}),t&&we("p",{id:"feature_banner_message",className:i("mt-1 text-sm opacity-90 break-words",l?.message),children:t})]})]}),(a||n)&&ht("div",{className:i("flex flex-col items-end gap-3 sm:flex-row sm:items-center",d&&"sm:items-center"),id:"feature_banner_actions_wrapper",children:[a&&we(Q,{variant:p,type:"button",onClick:a.onClick,className:i(u,l?.action),id:"feature_banner_action_button",children:a.label}),n&&we("button",{type:"button",onClick:s,className:"hidden sm:flex opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss",id:"feature_banner_dismiss_button",children:we(ha,{size:20})})]})]})]})};import zs from"@tiptap/extension-font-family";import $s from"@tiptap/extension-link";import Zs from"@tiptap/extension-underline";import{EditorContent as Us,useEditor as Ks}from"@tiptap/react";import js from"@tiptap/starter-kit";import yo from"clsx";import Gs from"clsx";import{Bold as Ps,Italic as Ls,List as ks,ListOrdered as Ds,Quote as Ss,Strikethrough as Ts,Underline as Fs}from"lucide-react";import{jsx as Ms}from"react/jsx-runtime";var Es=()=>Ms("span",{className:"text-sm font-semibold",children:"H1"}),_e={bold:{icon:Ps,action:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),title:"Bold"},italic:{icon:Ls,action:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),title:"Italic"},underline:{icon:Fs,action:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),title:"Underline"},strike:{icon:Ts,action:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),title:"Strikethrough"},heading1:{icon:Es,action:e=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e=>e.isActive("heading",{level:1}),title:"Heading 1"},bulletList:{icon:ks,action:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),title:"Bullet List"},orderedList:{icon:Ds,action:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),title:"Numbered List"},blockquote:{icon:Ss,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 As from"clsx";import{jsx as ya}from"react/jsx-runtime";var xa=({editor:e,icon:t,action:o,isActive:r,disabled:a,title:n,className:s})=>ya("button",{type:"button",onClick:()=>o(e),disabled:a??!e.can().chain().focus().run(),title:n,className:As("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:ya(t,{width:18,height:18})});import Is from"clsx";import{Link as Bs}from"lucide-react";import{useCallback as Bt,useMemo as vo,useState as Ca}from"react";import{Fragment as Vs,jsx as Ne,jsxs as ho}from"react/jsx-runtime";var wa=({editor:e})=>{let[t,o]=Ca(!1),[r,a]=Ca(""),n=vo(()=>!e.state.selection.empty,[e.state.selection]),s=vo(()=>e.isActive("link"),[e]),c=vo(()=>n||s,[n,s]),m=Bt(()=>{r.trim()&&(e.chain().focus().extendMarkRange("link").setLink({href:r.trim()}).run(),o(!1),a(""))},[e,r]),l=Bt(()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),o(!1),a("")},[e]),p=Bt(d=>{let f=e.getAttributes("link").href;a(f||""),o(d)},[c,e]),u=Bt(d=>{d.key==="Enter"&&(d.preventDefault(),m()),d.key==="Escape"&&o(!1)},[m]);return Ne(ie,{open:t,onOpenChange:p,trigger:Ne("div",{className:Is("",{"opacity-100 text-black":t,"opacity-40 text-gray-500":!t}),title:c?e.isActive("link")?"Edit link":"Add link":"Select text to add a link",children:Ne(Bs,{width:18,height:18})}),contentClassName:"w-80 p-4",align:"start",children:Ne("div",{className:"space-y-4",children:!n&&!s?Ne("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."}):ho(Vs,{children:[ho("div",{children:[Ne("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Link URL"}),Ne(G,{type:"url",value:r,onChange:d=>a(d.target.value),placeholder:"https://example.com",autoFocus:!0,onKeyDown:u})]}),ho("div",{className:"flex justify-between space-x-2",children:[Ne(Q,{type:"button",onClick:m,disabled:!r.trim(),variant:"primary",size:"sm",className:"flex-1",children:e.isActive("link")?"Update Link":"Add Link"}),e.isActive("link")&&Ne(Q,{type:"button",onClick:l,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 Os from"clsx";import{ChevronDown as Hs}from"lucide-react";import{useState as _s}from"react";import{jsx as qe,jsxs as Na}from"react/jsx-runtime";var Ra=({editor:e})=>{let[t,o]=_s(!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 qe(ie,{open:t,onOpenChange:o,trigger:Na("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:[qe("span",{className:"text-base ",children:r()}),qe(Hs,{width:16,height:16})]}),contentClassName:"w-48 w-auto- p-1",align:"start",children:qe("div",{className:"space-y-1",children:a.map((n,s)=>Na("div",{children:[s===1&&qe("div",{className:"border-b border-gray-200 my-1"}),qe("button",{type:"button",onClick:()=>{n.action(),o(!1)},className:Os("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 Vt,jsxs as Ws}from"react/jsx-runtime";var Pa=({editor:e,controls:t=["textStyle","bold","italic","underline","strike","link","bulletList","orderedList","blockquote"],className:o,extraNodes:r})=>{let a=Array.isArray(t)?t:[];return Ws("div",{className:Gs("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"||_e&&_e[n]?Vt("div",{className:"flex items-center",children:n==="textStyle"?Vt(Ra,{editor:e}):n==="link"?Vt(wa,{editor:e}):Vt(xa,{editor:e,icon:_e[n].icon,action:_e[n].action,isActive:_e[n].isActive,title:_e[n].title})},n):null),r]})};import{jsx as Je,jsxs as Ot}from"react/jsx-runtime";var Xs=({label:e,helpText:t,error:o,value:r="",onChange:a,optional:n,isRequired:s,extensions:c=[],editorClassName:m,wrapperClassName:l,controls:p,extraMenuNodes:u,placeholder:d})=>{let f=Ks({immediatelyRender:!1,content:r,editorProps:{attributes:{class:"px-3 h-40"}},extensions:[js,Zs,zs,$s.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline hover:text-blue-800"}}),...c],onFocus:({event:N})=>{N.preventDefault(),N.stopPropagation()},onUpdate:({editor:N})=>{let y=N.getHTML();a?.(N.isEmpty?"":y)}});return f?Ot("div",{className:yo("flex flex-col w-full",l),children:[e&&Ot("div",{className:"flex justify-between mb-1",children:[Ot("label",{className:"text-sm font-medium text-gray-900 flex items-center",htmlFor:"editor-id",children:[e,s&&Je("span",{className:"ml-1 text-red-500",children:"*"})]}),n&&Je("span",{className:"text-sm text-gray-400",children:"Optional"})]}),Ot("div",{className:yo("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:[Je(Pa,{editor:f,controls:p,extraNodes:u}),Je(Us,{editor:f,className:yo("overflow-y-auto p-3 h-full bg-white",m),placeholder:d})]}),o&&Je("p",{className:"mt-2 text-sm text-red-600",id:"editor-error",children:o}),t&&Je("p",{className:"mt-2 text-sm text-gray-500",id:"editor-helptext",children:t})]}):null};import{Search as Ys,X as ka}from"lucide-react";import*as O from"react";import{jsx as S,jsxs as Re}from"react/jsx-runtime";var La={success:"bg-green-500/20 text-green-500 ring-1 ring-inset ring-current",failed:"bg-red-500/20 text-red-500 ring-1 ring-inset ring-current",pending:"bg-yellow-500/20 text-yellow-500 ring-1 ring-inset ring-current",default:"bg-gray-100 text-gray-700"},Da=O.memo(({tag:e,onRemove:t})=>Re("p",{className:i("text-xs p-1.5 py-1 rounded-md flex items-center gap-1",La[e.variant??"default"]??La.default),children:[S("span",{children:e.label}),S("button",{type:"button",className:"pl-1",onClick:o=>{o.stopPropagation(),t()},children:S(ka,{size:12})})]}));Da.displayName="SelectedChip";var Sa=O.memo(({option:e,isChecked:t,onSelect:o,renderOption:r,disabled:a})=>S("article",{className:"cursor-pointer relative hover:bg-status-success-bg transition flex w-[calc(100%-0.375rem)] mx-auto rounded-md items-center py-1.5 px-2 text-sm outline-none focus:bg-status-success-bg dark:!text-[#DDDFE0] focus-visible:ring-1 focus-visible:ring-status-success-fill focus-visible:ring-offset-1",onClick:()=>!a&&o(e),children:S("div",{className:"w-full h-[20px] flex flex-row items-center dark:!text-white",children:S(vt,{onSelect:()=>!a&&o(e),disabled:a,value:e.value,label:r?r(e,t):S("span",{children:e.label}),bodyClassName:"w-full",labelWrapperClassName:"w-full",checked:t})})}));Sa.displayName="OptionItem";var qs=({value:e,onChange:t,options:o=[],label:r,error:a,placeholder:n="Add tag...",description:s,showAsterisk:c,disabled:m,isLoading:l,allowCreate:p=!0,renderTag:u,renderOption:d,validateTag:f,onCreate:N,maxTags:y})=>{let[v,g]=O.useState(""),R=O.useRef(null),[x,b]=O.useState();O.useLayoutEffect(()=>{if(!R.current)return;let L=()=>b(R.current?.getBoundingClientRect().width);L();let M=new ResizeObserver(L);return M.observe(R.current),()=>M.disconnect()},[]);let h=O.useMemo(()=>new Set(e.map(L=>L.value)),[e]),C=O.useMemo(()=>{let L=v.trim().toLowerCase();return L?o.filter(M=>M.label.toLowerCase().includes(L)):o},[o,v]),w=O.useCallback(L=>t(e.filter(M=>M.value!==L)),[e,t]),D=O.useCallback(L=>{h.has(L.value)||y&&e.length>=y||t([...e,L])},[e,t,h,y]),P=O.useCallback(L=>{let M=L.trim();if(!M||!(f?f(M):!0))return;let Co=o.find(wo=>wo.value.toLowerCase()===M.toLowerCase()||wo.label.toLowerCase()===M.toLowerCase());if(Co){D(Co),g("");return}p&&(D(N?.(M)??{value:M,label:M}),g(""))},[o,p,N,f,D]),F=L=>{L.key==="Enter"&&(L.preventDefault(),P(v)),L.key==="Backspace"&&!v&&e.length&&w(e[e.length-1].value)},Pe=!l&&p&&v.trim()&&!o.some(L=>L.value.toLowerCase()===v.trim().toLowerCase());return Re("div",{className:"relative space-y-1",children:[S(A,{showAsterisk:c,error:a,children:r}),Re(K,{children:[S("div",{ref:R,children:S(H,{asChild:!0,disabled:m,children:Re("div",{id:"tags_trigger_container",className:i(z({status:a?"error":"default"}),"cursor-pointer [&>svg]:shrink-0 h-auto min-h-10 flex items-center justify-between w-full gap-2 p-2"),children:[Re("div",{className:"w-full flex flex-row items-center gap-2 flex-wrap",children:[e.length>0&&e?.map(L=>{let M=()=>w(L.value);return u?S(O.Fragment,{children:Re("div",{className:"flex items-center",children:[u(L),S("button",{type:"button",className:"pl-1",onClick:xo=>{xo.stopPropagation(),M()},children:S(ka,{size:12})})]})},L.value):S(Da,{tag:L,onRemove:M},L.value)}),S("input",{value:v,disabled:m,readOnly:!p||void 0,placeholder:n,className:"flex-1 min-w-[80px] !border-none !outline-none bg-transparent text-sm p-0 h-auto !focus-visible:ring-0 placeholder:text-[#79818C] placeholder:text-sm",onChange:L=>g(L.target.value),onKeyDown:F})]}),S("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:S("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"})})]})})}),Re($,{align:"start",className:"min-w-[200px] p-0 mt-1",style:{width:x?`${x}px`:void 0},children:[S("div",{className:"w-full",children:S("div",{className:i("w-full mt-1 h-10 flex items-center justify-start mb-[5px] px-2 pt-2",{"mt-3":a}),children:S(G,{error:a,leftNode:S(Ys,{className:"text-gray-400"}),value:v,placeholder:"Type to search or create",type:"text",disabled:l,rightNode:l?S(pe,{colour:"secondary"}):void 0,onChange:L=>g(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),P(v))}})})}),Re(le,{viewPortClassName:"max-h-[225px] px",className:"pb-1 mt-3",children:[l&&S("div",{className:"py-7 flex justify-center",children:S(pe,{})}),!l&&C.map(L=>S(Sa,{option:L,isChecked:h.has(L.value),disabled:L.disabled,onSelect:M=>h.has(M.value)?w(M.value):D(M),renderOption:d},L.value)),Pe&&Re("button",{type:"button",className:i("w-full text-left px-3 py-2 text-sm border-t border-t-gray-300 hover:bg-gray-50 mt-1",{"mt-3":a}),onClick:()=>P(v),children:['Create "',v.trim(),'"']})]})]})]}),s&&!a&&S("div",{className:"text-sm text-gray-500",children:s}),S(ee,{error:a})]})};export{Ro as AmountAction,Sn as Banner,Q as Button,co as CalendarInput,Bn as CopyableLabel,yn as Country,No as CurrencySymbolMap,Po as DateAction,qt as DebouncedInput,Gn as DevBanner,Kt as Dialog,Yn as Drawer,Kn as DrawerClose,Jt as DrawerRoot,Rs as FeatureBanner,uo as FilterPopover,De as FlagComponent,A as FormLabel,hs as HasResourcePermission,G as Input,pe as Loader,ni as LocaleSelector,xs as MultiSelect,go as MultiSelectTrigger,Pn as OTPInput,fo as PageDataToolbar,so as Pagination,jo as PasswordInput,kt as PermissionsContext,wi as PermissionsProvider,ir as PhoneInput,ie as Popover,$ as PopoverContent,K as PopoverRoot,H as PopoverTrigger,Ft as RadioGroup,Et as RadioGroupItem,Xs as RichTextEditor,le as ScrollArea,Se as Select,Ii as Sidebar,Vi as Status,_t as StringAction,vs as Table,Cs as Tabs,qs as TagsInput,$e as TextOverflow,Xo as Textarea,xt as Tooltip,Gt as TooltipContent,Do as TooltipProvider,So as TooltipRoot,To as TooltipTrigger,J as buttonVariants,i as cn,gt as useFilterStore,ft as useHasPermission,Gr as usePermissions};
15
15
  //# sourceMappingURL=index.mjs.map