@veevarts/design-system 1.15.0-alpha.1 → 1.15.0-alpha.2
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.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("@heroui/react"),x=require("react"),Y=require("lucide-react"),Ce=require("framer-motion"),rn=require("@tiptap/react"),$n=require("@tiptap/core"),ca=require("@tiptap/extension-bold"),da=require("@tiptap/extension-italic"),ua=require("@tiptap/extension-strike"),fa=require("@tiptap/extension-underline"),ma=require("@tiptap/extension-code"),ha=require("@tiptap/extension-color"),xa=require("@tiptap/extension-highlight"),pa=require("@tiptap/extension-link"),ga=require("@tiptap/extension-text-style"),ba=require("@tiptap/extension-heading"),ya=require("@tiptap/extension-paragraph"),va=require("@tiptap/extension-bullet-list"),ja=require("@tiptap/extension-ordered-list"),wa=require("@tiptap/extension-task-list"),Na=require("@tiptap/extension-task-item"),Ca=require("@tiptap/extension-list-item"),Sa=require("@tiptap/extension-code-block"),ka=require("@tiptap/extension-blockquote"),Aa=require("@tiptap/extension-horizontal-rule"),Da=require("@tiptap/extension-hard-break"),En=require("@tiptap/extension-history"),$a=require("@tiptap/extension-text-align"),Ea=require("@tiptap/extension-document"),Ia=require("@tiptap/extension-text"),Ma=require("@tiptap/extension-dropcursor"),Fa=require("@tiptap/extension-gapcursor");function Ta({children:e}){return s.jsx(d.HeroUIProvider,{children:e})}const G=x.forwardRef(({color:e="primary",radius:t="full",testId:n="veevart-button",...r},a)=>s.jsx(d.Button,{ref:a,color:e,radius:t,"data-testid":n,...r}));G.displayName="Button";function La(e){const t=e?.closest('[role="dialog"]');return t?.parentElement??t??void 0}const _e=x.forwardRef(({popoverProps:e,...t},n)=>{const r=x.useRef(null),[a,i]=x.useState(void 0),o={...e,disableDialogFocus:e?.disableDialogFocus??(a?!0:void 0),portalContainer:e?.portalContainer??a};return x.useEffect(()=>{i(La(r.current))},[]),s.jsx("span",{ref:r,className:"contents",children:s.jsx(d.Select,{ref:n,...t,popoverProps:o})})});_e.displayName="Select";const _a={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function Oa({languages:e,selectedLanguage:t,onLanguageChange:n,label:r}){const a=e.find(i=>i.code===t);return s.jsx("div",{className:"flex items-center",children:s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(_e,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:e.length===0,placeholder:r,startContent:s.jsx(Y.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s.jsx("span",{children:a?.label||r}),size:"md",radius:"full",children:e.map(i=>s.jsx(d.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),s.jsx(_e,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:e.length===0,placeholder:"",startContent:s.jsx(Y.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>s.jsx("span",{children:a?.code.toUpperCase()||""}),size:"md",radius:"full",children:e.map(i=>s.jsx(d.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function za({isLoggedIn:e,onLogin:t,onLogout:n,labels:r}){return e?s.jsxs(G,{"data-testid":"navbar-auth-button",className:"px-2 py-1 w-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:n,size:"md",children:[s.jsx(Y.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.logout})]}):s.jsxs(G,{"data-testid":"navbar-auth-button",className:"px-2 py-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:t,size:"md",children:[s.jsx(Y.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Pa({logo:e,languages:t=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:a,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:c,labels:u={},className:f}){const p={..._a,...u};return s.jsxs("nav",{"data-testid":"navbar",className:d.cn("w-full px-4 md:px-8 py-3 bg-white border-b border-zinc-100 flex items-center justify-between",f),children:[s.jsx("div",{className:"flex items-center min-w-10",children:e&&s.jsx("a",{href:"/",className:"block",children:s.jsx("img",{"data-testid":"navbar-logo",src:e,alt:"Logo",className:"h-8 w-auto max-w-28 md:max-w-40 object-contain"})})}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||t.length>0)&&s.jsx(Oa,{languages:t,selectedLanguage:n,onLanguageChange:r,label:p.selectLanguage}),c&&s.jsx(za,{isLoggedIn:a,onLogin:i,onLogout:o,labels:p})]})]})}function Ra(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(d.Alert,{description:"This template combines Navbar, Footer, and a confirmation Card. Include title, message, confirmation number, details list, icon, and action buttons. Use Card for the confirmation content.",title:"TODO: Implement ConfirmationPageTemplate",variant:"faded",className:"max-w-2xl"})})})}var $t;const Ba=typeof document<"u"?($t=x.useInsertionEffect)!==null&&$t!==void 0?$t:x.useLayoutEffect:()=>{};function an(e,t,n){let[r,a]=x.useState(e||t),i=x.useRef(r),o=x.useRef(e!==void 0),l=e!==void 0;x.useEffect(()=>{let p=o.current;p!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let c=l?e:r;Ba(()=>{i.current=c});let[,u]=x.useReducer(()=>({}),{}),f=x.useCallback((p,...b)=>{let m=typeof p=="function"?p(i.current):p;Object.is(i.current,m)||(i.current=m,a(m),u(),n?.(m,...b))},[n]);return[c,f]}function Va(e){return s.jsx("svg",{...e,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:s.jsx(Ce.m.path,{animate:{pathLength:1},d:"M5 13l4 4L19 7",initial:{pathLength:0},strokeLinecap:"round",strokeLinejoin:"round",transition:{delay:.2,type:"tween",ease:"easeOut",duration:.3}})})}const ys=x.forwardRef(({color:e="primary",variant:t="default",stepsCount:n=3,defaultStep:r=0,label:a,stepLabels:i,showStepLabelTooltip:o=!1,stepLabelTooltipPlacement:l="top",showStepCounter:c=!1,stepCounterPosition:u="right",layout:f="compact",stepCounterFormat:p,onStepChange:b,currentStep:m,hideProgressBars:N=!1,stepClassName:w,className:y,isDisabled:j=!1,...S},$)=>{const[g,C]=an(m,r,b),E=x.useMemo(()=>{let M,z;const A=["[--active-fg-color:hsl(var(--step-fg-color))]","[--active-border-color:hsl(var(--step-color))]","[--active-color:hsl(var(--step-color))]","[--complete-background-color:hsl(var(--step-color))]","[--complete-border-color:hsl(var(--step-color))]","[--inactive-border-color:hsl(var(--heroui-default-300))]","[--inactive-color:hsl(var(--heroui-default-300))]"];switch(e){case"primary":M="[--step-color:var(--heroui-primary)]",z="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":M="[--step-color:var(--heroui-secondary)]",z="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":M="[--step-color:var(--heroui-success)]",z="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":M="[--step-color:var(--heroui-warning)]",z="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":M="[--step-color:var(--heroui-danger)]",z="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":M="[--step-color:var(--heroui-default)]",z="[--step-fg-color:var(--heroui-default-foreground)]";break;default:M="[--step-color:var(--heroui-primary)]",z="[--step-fg-color:var(--heroui-primary-foreground)]";break}return A.unshift(z),A.unshift(M),A},[e]);return s.jsxs("nav",{ref:$,"aria-label":"Progress",className:d.cn("flex items-center overflow-x-auto",f==="spread"?"w-full justify-between gap-6":"max-w-fit gap-3",y),"data-testid":"stepper-root",...S,children:[c&&u==="left"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:p?p(g+1,n):`Step ${g+1} of ${n}`}):null,a&&s.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:a}),s.jsx("ol",{className:d.cn("flex flex-row flex-nowrap gap-x-3",E,y),"data-testid":"stepper-list",children:Array.from({length:n})?.map((M,z)=>{const A=g===z?"active":g<z?"inactive":"complete",L=t==="activeLabel"&&A==="active"&&!!i?.[z],I=o&&A!=="active"&&!!i?.[z];return s.jsxs("li",{className:"relative flex shrink-0 items-center gap-x-3","data-testid":`stepper-step-${z}`,children:[s.jsx(d.Tooltip,{content:I?i?.[z]:void 0,isDisabled:!I,offset:12,placement:l,classNames:{base:"px-0 py-0",content:"rounded-full border border-default-200 bg-white px-4 py-2 text-small font-medium text-default-700 shadow-sm"},children:s.jsxs("button",{"aria-current":A==="active"?"step":void 0,className:d.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10 px-4 py-1.5":L},{"cursor-not-allowed opacity-50":j},w),onClick:()=>!j&&C(z),disabled:j,"data-testid":`stepper-step-btn-${z}`,children:[s.jsx("div",{className:"h-full relative flex items-center",children:s.jsx(Ce.LazyMotion,{features:Ce.domAnimation,children:s.jsx(Ce.m.div,{animate:A,className:"relative z-10",children:s.jsx(Ce.m.div,{animate:A,className:d.cn("border-medium text-large text-default-foreground relative z-10 flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-full font-semibold bg-white",{"border-(--complete-border-color) bg-(--complete-background-color) text-(--active-fg-color)":L,"bg-(--complete-background-color)":A==="complete","shadow-lg":A==="complete"}),initial:!1,transition:{duration:.25},variants:{inactive:{backgroundColor:"transparent",borderColor:"var(--inactive-border-color)",color:"var(--inactive-color)"},active:{backgroundColor:"transparent",borderColor:"var(--active-border-color)",color:"var(--active-color)"},complete:{backgroundColor:"var(--complete-background-color)",borderColor:"var(--complete-border-color)",color:"var(--active-fg-color)"}},children:s.jsx("div",{className:"flex items-center justify-center",children:A==="complete"&&t==="default"?s.jsx(Va,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${z}`}):s.jsx("span",{children:z+1})})})})})}),L?s.jsx("span",{className:"pr-2 text-2xl leading-none font-medium whitespace-nowrap text-(--active-color)","data-testid":`stepper-step-label-${z}`,children:i[z]}):null]},z)}),z<n-1&&!N&&s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none z-0 w-12 flex-none items-center",style:{"--idx":z},children:s.jsx("div",{className:d.cn("bg-default-200 relative h-0.5 w-full transition-colors duration-300","after:absolute after:block after:h-full after:w-0 after:bg-(--active-border-color) after:transition-[width] after:duration-300 after:content-['']",{"after:w-full":z<g})})})]},z)})}),c&&u==="right"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:p?p(g+1,n):`Step ${g+1} of ${n}`}):null]})});ys.displayName="Stepper";function Ua(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(d.Alert,{description:"This template combines Navbar, Stepper, Footer, and an event details Card. Include event image, category/spots chips, tags, details grid, and action buttons. Use Card, CardHeader, CardBody for content structure.",title:"TODO: Implement EventDetailsTemplate",variant:"faded",className:"max-w-2xl"})})})}function Oe(e,t="en-US",n="USD"){try{return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}}function ln(e,t="en-US"){try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e}).resolvedOptions();return typeof n.maximumFractionDigits=="number"?n.maximumFractionDigits:2}catch{return 2}}function vs(e,t,n="en-US"){const r=ln(t,n),a=Math.pow(10,r);return Math.round(e*a)/a}function qt(e,t,n,r){return vs(e-t,n,r)}function Ha(){return s.jsxs("footer",{"data-testid":"footer",className:"fixed left-0 bottom-0 w-full text-left p-4 bg-white font-inter font-light text-base text-zinc-500",children:["Powered by Veevart ® ",new Date().getFullYear()]})}const qa=e=>{const t=x.useMemo(()=>JSON.stringify({allItems:e.allItems,selected:e.selected}),[e.allItems,e.selected]);return s.jsx(Wa,{...e},t)},Wa=({allItems:e,selected:t,onSelectedChange:n,titleLeft:r,titleRight:a})=>{const[i,o]=x.useState([]),[l,c]=x.useState([]),[u,f]=x.useState(null),[p,b]=x.useState(null),m=x.useMemo(()=>new Set(t),[t]),N=x.useMemo(()=>new Set(e),[e]),w=x.useMemo(()=>e.filter(I=>!m.has(I)),[e,m]),y=I=>{if(I.length===0)return;const k=Array.from(new Set([...t,...I]));n(k)},j=I=>{if(I.length===0)return;const k=new Set(I);n(t.filter(F=>!k.has(F)))},S=()=>{i.length!==0&&(y(i),o([]))},$=()=>{l.length!==0&&(j(l),c([]))},g=()=>{w.length!==0&&(y(w),o([]))},C=()=>{t.length!==0&&(n([]),c([]))},E=(I,k,F)=>{const _=Math.min(k,F),V=Math.max(k,F);return I.slice(_,V+1)},M=(I,k,F)=>{if(F&&u!==null){o(E(w,u,k)),c([]),f(k);return}const _=i.includes(I);o(_?i.filter(V=>V!==I):[...i,I]),c([]),f(k)},z=(I,k,F)=>{if(F&&p!==null){c(E(t,p,k)),o([]),b(k);return}const _=l.includes(I);c(_?l.filter(V=>V!==I):[...l,I]),o([]),b(k)},A=(I,k,F)=>{const _=F==="available"?i.includes(k)?i:[k]:l.includes(k)?l:[k];I.dataTransfer.setData("text/plain",JSON.stringify({source:F,items:_})),I.dataTransfer.effectAllowed="move"},L=(I,k)=>{I.preventDefault();const F=I.dataTransfer.getData("text/plain");if(F)try{const _=JSON.parse(F),V=(_.items||[]).filter(Z=>N.has(Z));if(V.length===0||_.source===k)return;k==="selected"?(y(V),o([])):(j(V),c([]))}catch{return}};return s.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),s.jsx(d.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(d.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>L(I,"available"),children:w.map((I,k)=>{const F=i.includes(I);return s.jsx("button",{type:"button",onClick:_=>{M(I,k,_.shiftKey)},onMouseDown:_=>{_.shiftKey&&_.preventDefault()},draggable:!0,onDragStart:_=>A(_,I,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${F?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]}),s.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:S,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:$,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-all-to-selected",onPress:g,isDisabled:w.length===0,"aria-label":"Move all to right",children:"»"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:C,"data-testid":"move-all-to-available",isDisabled:t.length===0,"aria-label":"Move all to left",children:"«"})]}),s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:a}),s.jsx(d.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(d.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>L(I,"selected"),children:t.map((I,k)=>{const F=l.includes(I);return s.jsx("button",{type:"button",onClick:_=>{z(I,k,_.shiftKey)},onMouseDown:_=>{_.shiftKey&&_.preventDefault()},draggable:!0,onDragStart:_=>A(_,I,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${F?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]})]})};function rt(e){return typeof e=="string"?e:e.type}function Re({className:e}){return s.jsx("div",{className:`flex items-center h-6 ${e||""}`,children:s.jsx(d.Divider,{orientation:"vertical"})})}function Be({icon:e,label:t,isActive:n=!1,isDisabled:r=!1,onClick:a,shortcut:i,iconSize:o=16,className:l}){const c=i?`${t} (${i})`:t;return s.jsx(d.Tooltip,{content:c,placement:"top",offset:10,children:s.jsx(G,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:a,"aria-label":t,className:l,children:s.jsx(e,{size:o})})})}const $e={bold:{execute:({editor:e})=>e.chain().focus().toggleBold().run(),canExecute:e=>e.can().chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:e})=>e.chain().focus().toggleItalic().run(),canExecute:e=>e.can().chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:e})=>e.chain().focus().toggleStrike().run(),canExecute:e=>e.can().chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:e})=>e.chain().focus().toggleUnderline().run(),canExecute:e=>e.can().chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:e})=>e.chain().focus().toggleCode().run(),canExecute:e=>e.can().chain().focus().toggleCode().run(),isActive:e=>e.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:e,config:t})=>{const n=t?.type==="textColor"?t.color:"";n?e.chain().focus().setColor(n).run():e.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:e=>e.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:e,config:t})=>{const n=t?.type==="highlight"?t.color:"";n?e.chain().focus().setHighlight({color:n}).run():e.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:e=>e.isActive("highlight"),label:"Highlight"},link:{execute:({editor:e,config:t})=>{const n=t?.type==="link"?t.href:"";if(n){const r=t?.type==="link"?t.target:void 0,a=t?.type==="link"?t.rel:void 0;e.chain().focus().setLink({href:n,target:r,rel:a}).run()}else e.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:e=>e.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:e})=>e.chain().focus().setParagraph().run(),canExecute:e=>e.can().chain().focus().setParagraph().run(),isActive:e=>e.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:e,config:t})=>{const n=t?.type==="heading"?t.level:1;e.chain().focus().toggleHeading({level:n}).run()},canExecute:(e,t)=>{const n=t?.type==="heading"?t.level:1;return e.can().chain().focus().toggleHeading({level:n}).run()},isActive:(e,t)=>t?.type==="heading"?e.isActive("heading",{level:t.level}):e.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:e})=>e.chain().focus().toggleBulletList().run(),canExecute:e=>e.can().chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:e})=>e.chain().focus().toggleOrderedList().run(),canExecute:e=>e.can().chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:e})=>e.chain().focus().toggleTaskList().run(),canExecute:e=>e.can().chain().focus().toggleTaskList().run(),isActive:e=>e.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:e})=>e.chain().focus().toggleCodeBlock().run(),canExecute:e=>e.can().chain().focus().toggleCodeBlock().run(),isActive:e=>e.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:e})=>e.chain().focus().toggleBlockquote().run(),canExecute:e=>e.can().chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:e})=>e.chain().focus().setHorizontalRule().run(),canExecute:e=>e.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:e})=>e.chain().focus().setHardBreak().run(),canExecute:e=>e.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:e,config:t})=>{const n=t?.type==="textAlign"?t.alignment:"left";e.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(e,t)=>t?.type==="textAlign"?e.isActive({textAlign:t.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:e})=>e.chain().focus().unsetAllMarks().run(),canExecute:e=>e.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:e})=>e.chain().focus().clearNodes().run(),canExecute:e=>e.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:e})=>e.chain().focus().undo().run(),canExecute:e=>e.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:e})=>e.chain().focus().redo().run(),canExecute:e=>e.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},Ya={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function Ga({editor:e,levels:t=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=x.useState(0);x.useEffect(()=>{const o=()=>r(l=>l+1);return e.on("selectionUpdate",o),e.on("transaction",o),()=>{e.off("selectionUpdate",o),e.off("transaction",o)}},[e]);const a=t.find(o=>e.isActive("heading",{level:o})),i=o=>{const l=Number(o),c=$e.heading;c&&c.execute({editor:e,config:{type:"heading",level:l}})};return s.jsxs(d.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(d.DropdownTrigger,{children:s.jsx(G,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,startContent:s.jsx(Y.Heading,{size:16}),"aria-label":"Select heading level",children:a?`H${a}`:"H"})}),s.jsx(d.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:a?new Set([String(a)]):new Set,onAction:i,children:t.map(o=>s.jsx(d.DropdownItem,{startContent:e.isActive("heading",{level:o})?s.jsx(Y.Check,{size:16}):s.jsx("div",{className:"w-4"}),children:Ya[o]},o))})]})}const Et={bulletList:{label:"Bullet List",icon:Y.List},orderedList:{label:"Numbered List",icon:Y.ListOrdered},taskList:{label:"Task List",icon:Y.ListTodo}};function Qa({editor:e,types:t=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=x.useState(0);x.useEffect(()=>{const l=()=>r(c=>c+1);return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e]);const a=t.find(l=>e.isActive(l)),i=a?Et[a].icon:Y.List,o=l=>{const u=$e[l];u&&u.execute({editor:e})};return s.jsxs(d.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(d.DropdownTrigger,{children:s.jsx(G,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:s.jsx(i,{size:16})})}),s.jsx(d.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:a?new Set([a]):new Set,onAction:o,children:t.map(l=>{const c=Et[l].icon;return s.jsx(d.DropdownItem,{startContent:s.jsx(c,{size:16}),children:Et[l].label},l)})})]})}function Ka({colors:e,selectedColor:t,onColorSelect:n,columns:r=4}){return s.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:e.map(a=>{const i=t===a;return s.jsx("button",{type:"button",onClick:()=>n(a),className:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("@heroui/react"),x=require("react"),Y=require("lucide-react"),Ce=require("framer-motion"),rn=require("@tiptap/react"),$n=require("@tiptap/core"),ca=require("@tiptap/extension-bold"),da=require("@tiptap/extension-italic"),ua=require("@tiptap/extension-strike"),fa=require("@tiptap/extension-underline"),ma=require("@tiptap/extension-code"),ha=require("@tiptap/extension-color"),xa=require("@tiptap/extension-highlight"),pa=require("@tiptap/extension-link"),ga=require("@tiptap/extension-text-style"),ba=require("@tiptap/extension-heading"),ya=require("@tiptap/extension-paragraph"),va=require("@tiptap/extension-bullet-list"),ja=require("@tiptap/extension-ordered-list"),wa=require("@tiptap/extension-task-list"),Na=require("@tiptap/extension-task-item"),Ca=require("@tiptap/extension-list-item"),Sa=require("@tiptap/extension-code-block"),ka=require("@tiptap/extension-blockquote"),Aa=require("@tiptap/extension-horizontal-rule"),Da=require("@tiptap/extension-hard-break"),En=require("@tiptap/extension-history"),$a=require("@tiptap/extension-text-align"),Ea=require("@tiptap/extension-document"),Ia=require("@tiptap/extension-text"),Ma=require("@tiptap/extension-dropcursor"),Fa=require("@tiptap/extension-gapcursor");function Ta({children:e}){return s.jsx(d.HeroUIProvider,{children:e})}const G=x.forwardRef(({color:e="primary",radius:t="full",testId:n="veevart-button",...r},a)=>s.jsx(d.Button,{ref:a,color:e,radius:t,"data-testid":n,...r}));G.displayName="Button";function La(e){const t=e?.closest('[role="dialog"]');return t?.parentElement??t??void 0}const _e=x.forwardRef(({popoverProps:e,...t},n)=>{const r=x.useRef(null),[a,i]=x.useState(void 0),o={...e,disableDialogFocus:e?.disableDialogFocus??(a?!0:void 0),portalContainer:e?.portalContainer??a};return x.useEffect(()=>{i(La(r.current))},[]),s.jsx("span",{ref:r,className:"contents",children:s.jsx(d.Select,{ref:n,...t,popoverProps:o})})});_e.displayName="Select";const _a={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function Oa({languages:e,selectedLanguage:t,onLanguageChange:n,label:r}){const a=e.find(i=>i.code===t);return s.jsx("div",{className:"flex items-center",children:s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(_e,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:e.length===0,placeholder:r,startContent:s.jsx(Y.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s.jsx("span",{children:a?.label||r}),size:"md",radius:"full",children:e.map(i=>s.jsx(d.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),s.jsx(_e,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:t?[t]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||t;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:e.length===0,placeholder:"",startContent:s.jsx(Y.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>s.jsx("span",{children:a?.code.toUpperCase()||""}),size:"md",radius:"full",children:e.map(i=>s.jsx(d.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function za({isLoggedIn:e,onLogin:t,onLogout:n,labels:r}){return e?s.jsxs(G,{"data-testid":"navbar-auth-button",className:"px-2 py-1 w-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:n,size:"md",children:[s.jsx(Y.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.logout})]}):s.jsxs(G,{"data-testid":"navbar-auth-button",className:"px-2 py-1 min-w-12 md:min-w-24 rounded-full bg-black text-white text-sm flex items-center",onPress:t,size:"md",children:[s.jsx(Y.User,{className:"inline w-5 h-5"}),s.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Pa({logo:e,languages:t=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:a,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:c,labels:u={},className:f}){const p={..._a,...u};return s.jsxs("nav",{"data-testid":"navbar",className:d.cn("w-full px-4 md:px-8 py-3 bg-white border-b border-zinc-100 flex items-center justify-between",f),children:[s.jsx("div",{className:"flex items-center min-w-10",children:e&&s.jsx("a",{href:"/",className:"block",children:s.jsx("img",{"data-testid":"navbar-logo",src:e,alt:"Logo",className:"h-8 w-auto max-w-28 md:max-w-40 object-contain"})})}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||t.length>0)&&s.jsx(Oa,{languages:t,selectedLanguage:n,onLanguageChange:r,label:p.selectLanguage}),c&&s.jsx(za,{isLoggedIn:a,onLogin:i,onLogout:o,labels:p})]})]})}function Ra(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(d.Alert,{description:"This template combines Navbar, Footer, and a confirmation Card. Include title, message, confirmation number, details list, icon, and action buttons. Use Card for the confirmation content.",title:"TODO: Implement ConfirmationPageTemplate",variant:"faded",className:"max-w-2xl"})})})}var $t;const Ba=typeof document<"u"?($t=x.useInsertionEffect)!==null&&$t!==void 0?$t:x.useLayoutEffect:()=>{};function an(e,t,n){let[r,a]=x.useState(e||t),i=x.useRef(r),o=x.useRef(e!==void 0),l=e!==void 0;x.useEffect(()=>{let p=o.current;p!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let c=l?e:r;Ba(()=>{i.current=c});let[,u]=x.useReducer(()=>({}),{}),f=x.useCallback((p,...b)=>{let m=typeof p=="function"?p(i.current):p;Object.is(i.current,m)||(i.current=m,a(m),u(),n?.(m,...b))},[n]);return[c,f]}function Va(e){return s.jsx("svg",{...e,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:s.jsx(Ce.m.path,{animate:{pathLength:1},d:"M5 13l4 4L19 7",initial:{pathLength:0},strokeLinecap:"round",strokeLinejoin:"round",transition:{delay:.2,type:"tween",ease:"easeOut",duration:.3}})})}const ys=x.forwardRef(({color:e="primary",variant:t="default",stepsCount:n=3,defaultStep:r=0,label:a,stepLabels:i,showStepLabelTooltip:o=!1,stepLabelTooltipPlacement:l="top",showStepCounter:c=!1,stepCounterPosition:u="right",layout:f="compact",stepCounterFormat:p,onStepChange:b,currentStep:m,hideProgressBars:N=!1,stepClassName:w,className:y,isDisabled:j=!1,...S},$)=>{const[g,C]=an(m,r,b),E=x.useMemo(()=>{let M,z;const A=["[--active-fg-color:hsl(var(--step-fg-color))]","[--active-border-color:hsl(var(--step-color))]","[--active-color:hsl(var(--step-color))]","[--complete-background-color:hsl(var(--step-color))]","[--complete-border-color:hsl(var(--step-color))]","[--inactive-border-color:hsl(var(--heroui-default-300))]","[--inactive-color:hsl(var(--heroui-default-300))]"];switch(e){case"primary":M="[--step-color:var(--heroui-primary)]",z="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":M="[--step-color:var(--heroui-secondary)]",z="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":M="[--step-color:var(--heroui-success)]",z="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":M="[--step-color:var(--heroui-warning)]",z="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":M="[--step-color:var(--heroui-danger)]",z="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":M="[--step-color:var(--heroui-default)]",z="[--step-fg-color:var(--heroui-default-foreground)]";break;default:M="[--step-color:var(--heroui-primary)]",z="[--step-fg-color:var(--heroui-primary-foreground)]";break}return A.unshift(z),A.unshift(M),A},[e]);return s.jsxs("nav",{ref:$,"aria-label":"Progress",className:d.cn("flex items-center overflow-x-auto",f==="spread"?"w-full justify-between gap-6":"max-w-fit gap-3",y),"data-testid":"stepper-root",...S,children:[c&&u==="left"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:p?p(g+1,n):`Step ${g+1} of ${n}`}):null,a&&s.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:a}),s.jsx("ol",{className:d.cn("flex flex-row flex-nowrap gap-x-3",E,y),"data-testid":"stepper-list",children:Array.from({length:n})?.map((M,z)=>{const A=g===z?"active":g<z?"inactive":"complete",L=t==="activeLabel"&&A==="active"&&!!i?.[z],I=o&&A!=="active"&&!!i?.[z];return s.jsxs("li",{className:"relative flex shrink-0 items-center gap-x-3","data-testid":`stepper-step-${z}`,children:[s.jsx(d.Tooltip,{content:I?i?.[z]:void 0,isDisabled:!I,offset:12,placement:l,classNames:{base:"px-0 py-0",content:"rounded-full border border-default-200 bg-white px-4 py-2 text-small font-medium text-default-700 shadow-sm"},children:s.jsxs("button",{"aria-current":A==="active"?"step":void 0,className:d.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10 pl-2 pr-4 py-1.5":L},{"cursor-not-allowed opacity-50":j},w),onClick:()=>!j&&C(z),disabled:j,"data-testid":`stepper-step-btn-${z}`,children:[s.jsx("div",{className:"h-full relative flex items-center",children:s.jsx(Ce.LazyMotion,{features:Ce.domAnimation,children:s.jsx(Ce.m.div,{animate:A,className:"relative z-10",children:s.jsx(Ce.m.div,{animate:A,className:d.cn("border-medium text-large text-default-foreground relative z-10 flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-full font-semibold bg-white",{"border-(--complete-border-color) bg-(--complete-background-color) text-(--active-fg-color)":L,"bg-(--complete-background-color)":A==="complete","shadow-lg":A==="complete"}),initial:!1,transition:{duration:.25},variants:{inactive:{backgroundColor:"transparent",borderColor:"var(--inactive-border-color)",color:"var(--inactive-color)"},active:{backgroundColor:"transparent",borderColor:"var(--active-border-color)",color:"var(--active-color)"},complete:{backgroundColor:"var(--complete-background-color)",borderColor:"var(--complete-border-color)",color:"var(--active-fg-color)"}},children:s.jsx("div",{className:"flex items-center justify-center",children:A==="complete"&&t==="default"?s.jsx(Va,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${z}`}):s.jsx("span",{children:z+1})})})})})}),L?s.jsx("span",{className:"pr-2 text-2xl leading-none font-medium whitespace-nowrap text-(--active-color)","data-testid":`stepper-step-label-${z}`,children:i[z]}):null]},z)}),z<n-1&&!N&&s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none z-0 w-12 flex-none items-center",style:{"--idx":z},children:s.jsx("div",{className:d.cn("bg-default-200 relative h-0.5 w-full transition-colors duration-300","after:absolute after:block after:h-full after:w-0 after:bg-(--active-border-color) after:transition-[width] after:duration-300 after:content-['']",{"after:w-full":z<g})})})]},z)})}),c&&u==="right"?s.jsx("span",{className:"text-default-500 text-2xl whitespace-nowrap","data-testid":"stepper-counter",children:p?p(g+1,n):`Step ${g+1} of ${n}`}):null]})});ys.displayName="Stepper";function Ua(e){return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:s.jsx(d.Alert,{description:"This template combines Navbar, Stepper, Footer, and an event details Card. Include event image, category/spots chips, tags, details grid, and action buttons. Use Card, CardHeader, CardBody for content structure.",title:"TODO: Implement EventDetailsTemplate",variant:"faded",className:"max-w-2xl"})})})}function Oe(e,t="en-US",n="USD"){try{return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e)}catch{return`${n} ${e.toFixed(2)}`}}function ln(e,t="en-US"){try{const n=new Intl.NumberFormat(t,{style:"currency",currency:e}).resolvedOptions();return typeof n.maximumFractionDigits=="number"?n.maximumFractionDigits:2}catch{return 2}}function vs(e,t,n="en-US"){const r=ln(t,n),a=Math.pow(10,r);return Math.round(e*a)/a}function qt(e,t,n,r){return vs(e-t,n,r)}function Ha(){return s.jsxs("footer",{"data-testid":"footer",className:"fixed left-0 bottom-0 w-full text-left p-4 bg-white font-inter font-light text-base text-zinc-500",children:["Powered by Veevart ® ",new Date().getFullYear()]})}const qa=e=>{const t=x.useMemo(()=>JSON.stringify({allItems:e.allItems,selected:e.selected}),[e.allItems,e.selected]);return s.jsx(Wa,{...e},t)},Wa=({allItems:e,selected:t,onSelectedChange:n,titleLeft:r,titleRight:a})=>{const[i,o]=x.useState([]),[l,c]=x.useState([]),[u,f]=x.useState(null),[p,b]=x.useState(null),m=x.useMemo(()=>new Set(t),[t]),N=x.useMemo(()=>new Set(e),[e]),w=x.useMemo(()=>e.filter(I=>!m.has(I)),[e,m]),y=I=>{if(I.length===0)return;const k=Array.from(new Set([...t,...I]));n(k)},j=I=>{if(I.length===0)return;const k=new Set(I);n(t.filter(F=>!k.has(F)))},S=()=>{i.length!==0&&(y(i),o([]))},$=()=>{l.length!==0&&(j(l),c([]))},g=()=>{w.length!==0&&(y(w),o([]))},C=()=>{t.length!==0&&(n([]),c([]))},E=(I,k,F)=>{const _=Math.min(k,F),V=Math.max(k,F);return I.slice(_,V+1)},M=(I,k,F)=>{if(F&&u!==null){o(E(w,u,k)),c([]),f(k);return}const _=i.includes(I);o(_?i.filter(V=>V!==I):[...i,I]),c([]),f(k)},z=(I,k,F)=>{if(F&&p!==null){c(E(t,p,k)),o([]),b(k);return}const _=l.includes(I);c(_?l.filter(V=>V!==I):[...l,I]),o([]),b(k)},A=(I,k,F)=>{const _=F==="available"?i.includes(k)?i:[k]:l.includes(k)?l:[k];I.dataTransfer.setData("text/plain",JSON.stringify({source:F,items:_})),I.dataTransfer.effectAllowed="move"},L=(I,k)=>{I.preventDefault();const F=I.dataTransfer.getData("text/plain");if(F)try{const _=JSON.parse(F),V=(_.items||[]).filter(Z=>N.has(Z));if(V.length===0||_.source===k)return;k==="selected"?(y(V),o([])):(j(V),c([]))}catch{return}};return s.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),s.jsx(d.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(d.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>L(I,"available"),children:w.map((I,k)=>{const F=i.includes(I);return s.jsx("button",{type:"button",onClick:_=>{M(I,k,_.shiftKey)},onMouseDown:_=>{_.shiftKey&&_.preventDefault()},draggable:!0,onDragStart:_=>A(_,I,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${F?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]}),s.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:S,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-selected-to-available",onPress:$,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,"data-testid":"move-all-to-selected",onPress:g,isDisabled:w.length===0,"aria-label":"Move all to right",children:"»"}),s.jsx(G,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:C,"data-testid":"move-all-to-available",isDisabled:t.length===0,"aria-label":"Move all to left",children:"«"})]}),s.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[s.jsx("h2",{className:"text-sm font-medium text-gray-700",children:a}),s.jsx(d.Card,{className:"w-full border border-gray-200 shadow-none",children:s.jsx(d.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:I=>I.preventDefault(),onDrop:I=>L(I,"selected"),children:t.map((I,k)=>{const F=l.includes(I);return s.jsx("button",{type:"button",onClick:_=>{z(I,k,_.shiftKey)},onMouseDown:_=>{_.shiftKey&&_.preventDefault()},draggable:!0,onDragStart:_=>A(_,I,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${F?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:I},I)})})})]})]})};function rt(e){return typeof e=="string"?e:e.type}function Re({className:e}){return s.jsx("div",{className:`flex items-center h-6 ${e||""}`,children:s.jsx(d.Divider,{orientation:"vertical"})})}function Be({icon:e,label:t,isActive:n=!1,isDisabled:r=!1,onClick:a,shortcut:i,iconSize:o=16,className:l}){const c=i?`${t} (${i})`:t;return s.jsx(d.Tooltip,{content:c,placement:"top",offset:10,children:s.jsx(G,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:a,"aria-label":t,className:l,children:s.jsx(e,{size:o})})})}const $e={bold:{execute:({editor:e})=>e.chain().focus().toggleBold().run(),canExecute:e=>e.can().chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:e})=>e.chain().focus().toggleItalic().run(),canExecute:e=>e.can().chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:e})=>e.chain().focus().toggleStrike().run(),canExecute:e=>e.can().chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:e})=>e.chain().focus().toggleUnderline().run(),canExecute:e=>e.can().chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:e})=>e.chain().focus().toggleCode().run(),canExecute:e=>e.can().chain().focus().toggleCode().run(),isActive:e=>e.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:e,config:t})=>{const n=t?.type==="textColor"?t.color:"";n?e.chain().focus().setColor(n).run():e.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:e=>e.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:e,config:t})=>{const n=t?.type==="highlight"?t.color:"";n?e.chain().focus().setHighlight({color:n}).run():e.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:e=>e.isActive("highlight"),label:"Highlight"},link:{execute:({editor:e,config:t})=>{const n=t?.type==="link"?t.href:"";if(n){const r=t?.type==="link"?t.target:void 0,a=t?.type==="link"?t.rel:void 0;e.chain().focus().setLink({href:n,target:r,rel:a}).run()}else e.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:e=>e.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:e})=>e.chain().focus().setParagraph().run(),canExecute:e=>e.can().chain().focus().setParagraph().run(),isActive:e=>e.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:e,config:t})=>{const n=t?.type==="heading"?t.level:1;e.chain().focus().toggleHeading({level:n}).run()},canExecute:(e,t)=>{const n=t?.type==="heading"?t.level:1;return e.can().chain().focus().toggleHeading({level:n}).run()},isActive:(e,t)=>t?.type==="heading"?e.isActive("heading",{level:t.level}):e.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:e})=>e.chain().focus().toggleBulletList().run(),canExecute:e=>e.can().chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:e})=>e.chain().focus().toggleOrderedList().run(),canExecute:e=>e.can().chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:e})=>e.chain().focus().toggleTaskList().run(),canExecute:e=>e.can().chain().focus().toggleTaskList().run(),isActive:e=>e.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:e})=>e.chain().focus().toggleCodeBlock().run(),canExecute:e=>e.can().chain().focus().toggleCodeBlock().run(),isActive:e=>e.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:e})=>e.chain().focus().toggleBlockquote().run(),canExecute:e=>e.can().chain().focus().toggleBlockquote().run(),isActive:e=>e.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:e})=>e.chain().focus().setHorizontalRule().run(),canExecute:e=>e.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:e})=>e.chain().focus().setHardBreak().run(),canExecute:e=>e.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:e,config:t})=>{const n=t?.type==="textAlign"?t.alignment:"left";e.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(e,t)=>t?.type==="textAlign"?e.isActive({textAlign:t.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:e})=>e.chain().focus().unsetAllMarks().run(),canExecute:e=>e.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:e})=>e.chain().focus().clearNodes().run(),canExecute:e=>e.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:e})=>e.chain().focus().undo().run(),canExecute:e=>e.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:e})=>e.chain().focus().redo().run(),canExecute:e=>e.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},Ya={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function Ga({editor:e,levels:t=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=x.useState(0);x.useEffect(()=>{const o=()=>r(l=>l+1);return e.on("selectionUpdate",o),e.on("transaction",o),()=>{e.off("selectionUpdate",o),e.off("transaction",o)}},[e]);const a=t.find(o=>e.isActive("heading",{level:o})),i=o=>{const l=Number(o),c=$e.heading;c&&c.execute({editor:e,config:{type:"heading",level:l}})};return s.jsxs(d.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(d.DropdownTrigger,{children:s.jsx(G,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,startContent:s.jsx(Y.Heading,{size:16}),"aria-label":"Select heading level",children:a?`H${a}`:"H"})}),s.jsx(d.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:a?new Set([String(a)]):new Set,onAction:i,children:t.map(o=>s.jsx(d.DropdownItem,{startContent:e.isActive("heading",{level:o})?s.jsx(Y.Check,{size:16}):s.jsx("div",{className:"w-4"}),children:Ya[o]},o))})]})}const Et={bulletList:{label:"Bullet List",icon:Y.List},orderedList:{label:"Numbered List",icon:Y.ListOrdered},taskList:{label:"Task List",icon:Y.ListTodo}};function Qa({editor:e,types:t=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=x.useState(0);x.useEffect(()=>{const l=()=>r(c=>c+1);return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e]);const a=t.find(l=>e.isActive(l)),i=a?Et[a].icon:Y.List,o=l=>{const u=$e[l];u&&u.execute({editor:e})};return s.jsxs(d.Dropdown,{placement:"top-start",offset:10,children:[s.jsx(d.DropdownTrigger,{children:s.jsx(G,{size:"sm",radius:"sm",variant:a?"solid":"bordered",color:a?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:s.jsx(i,{size:16})})}),s.jsx(d.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:a?new Set([a]):new Set,onAction:o,children:t.map(l=>{const c=Et[l].icon;return s.jsx(d.DropdownItem,{startContent:s.jsx(c,{size:16}),children:Et[l].label},l)})})]})}function Ka({colors:e,selectedColor:t,onColorSelect:n,columns:r=4}){return s.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:e.map(a=>{const i=t===a;return s.jsx("button",{type:"button",onClick:()=>n(a),className:`
|
|
2
2
|
w-8 h-8 rounded-full border-2 cursor-pointer
|
|
3
3
|
transition-all duration-200
|
|
4
4
|
hover:scale-110 hover:shadow-md
|
package/dist/index.js
CHANGED
|
@@ -377,7 +377,7 @@ const Us = H.forwardRef(
|
|
|
377
377
|
className: g(
|
|
378
378
|
"group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",
|
|
379
379
|
{
|
|
380
|
-
"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10
|
|
380
|
+
"rounded-full border border-(--active-border-color)/20 bg-(--active-border-color)/10 pl-2 pr-4 py-1.5": _
|
|
381
381
|
},
|
|
382
382
|
{ "cursor-not-allowed opacity-50": w },
|
|
383
383
|
N
|