@veevarts/design-system 1.6.0-dev.4 → 1.6.0-dev.5

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),y=require("@heroui/react"),v=require("react"),_=require("lucide-react"),Re=require("framer-motion"),hr=require("@tiptap/react"),R=require("@tiptap/core"),Fo=require("@tiptap/extension-underline"),Po=require("@tiptap/extension-color"),$o=require("@tiptap/extension-highlight"),Vo=require("@tiptap/extension-link"),Bo=require("@tiptap/extension-task-list"),zo=require("@tiptap/extension-task-item"),_o=require("@tiptap/extension-text-align");function Ho({children:t}){return c.jsx(y.HeroUIProvider,{children:t})}const oe=v.forwardRef(({color:t="primary",radius:e="full",testId:n="veevart-button",...r},s)=>c.jsx(y.Button,{ref:s,color:t,radius:e,"data-testid":n,...r}));oe.displayName="Button";const Uo={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function qo({languages:t,selectedLanguage:e,onLanguageChange:n,label:r}){return c.jsx("div",{className:"flex items-center",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(_.Globe,{className:"absolute left-3 w-5 h-5 pointer-events-none text-black"}),c.jsx(y.Select,{"data-testid":"language-select-desktop","aria-label":r,selectedKeys:e?[e]:[],onSelectionChange:s=>{const i=Array.from(s)[0]||e;n?.(i)},className:"min-w-40 hidden md:inline-flex",isDisabled:t.length===0,placeholder:r,startContent:c.jsx(_.Globe,{className:"w-5 h-5 text-black"}),children:t.map(s=>c.jsx(y.SelectItem,{textValue:s.label,"data-testid":`language-select-option-${s.code}`,children:s.label},s.code))}),c.jsx(y.Select,{"aria-label":r,"data-testid":"language-select-mobile",selectedKeys:e?[e]:[],onSelectionChange:s=>{const i=Array.from(s)[0]||e;n?.(i)},className:"min-w-20 inline-flex md:hidden",isDisabled:t.length===0,placeholder:e||"Language",children:t.map(s=>c.jsx(y.SelectItem,{className:"min-w-4",textValue:s.code.toUpperCase(),"data-testid":`language-select-option-mobile-${s.code}`,children:s.code.toUpperCase()},s.code))})]})})}function Ko({isLoggedIn:t,onLogin:e,onLogout:n,labels:r}){return t?c.jsxs(oe,{"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,children:[c.jsx(_.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.logout})]}):c.jsxs(oe,{"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:e,children:[c.jsx(_.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Jo({logo:t,languages:e=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:s,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:a,labels:u={},className:d}){const f={...Uo,...u};return c.jsxs("nav",{"data-testid":"navbar",className:y.cn("w-full px-4 md:px-8 py-4 bg-white border-b border-zinc-100 flex items-center justify-between",d),children:[c.jsx("div",{className:"flex items-center min-w-10",children:t&&c.jsx("a",{href:"/",className:"block",children:c.jsx("img",{"data-testid":"navbar-logo",src:t,alt:"Logo",className:"h-8 max-w-28 md:max-w-40"})})}),c.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||e.length>0)&&c.jsx(qo,{languages:e,selectedLanguage:n,onLanguageChange:r,label:f.selectLanguage}),a&&c.jsx(Ko,{isLoggedIn:s,onLogin:i,onLogout:o,labels:f})]})]})}function Wo(t){return c.jsx("div",{className:"min-h-screen flex flex-col",children:c.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:c.jsx(y.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 Mn;const Go=typeof document<"u"?(Mn=v.useInsertionEffect)!==null&&Mn!==void 0?Mn:v.useLayoutEffect:()=>{};function pr(t,e,n){let[r,s]=v.useState(t||e),i=v.useRef(r),o=v.useRef(t!==void 0),l=t!==void 0;v.useEffect(()=>{let f=o.current;f!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let a=l?t:r;Go(()=>{i.current=a});let[,u]=v.useReducer(()=>({}),{}),d=v.useCallback((f,...p)=>{let m=typeof f=="function"?f(i.current):f;Object.is(i.current,m)||(i.current=m,s(m),u(),n?.(m,...p))},[n]);return[a,d]}function Zo(t){return c.jsx("svg",{...t,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:c.jsx(Re.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 Zs=v.forwardRef(({color:t="primary",stepsCount:e=3,defaultStep:n=0,label:r,onStepChange:s,currentStep:i,hideProgressBars:o=!1,stepClassName:l,className:a,isDisabled:u=!1,...d},f)=>{const[p,m]=pr(i,n,s),C=v.useMemo(()=>{let b,k;const S=["[--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(t){case"primary":b="[--step-color:var(--heroui-primary)]",k="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":b="[--step-color:var(--heroui-secondary)]",k="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":b="[--step-color:var(--heroui-success)]",k="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":b="[--step-color:var(--heroui-warning)]",k="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":b="[--step-color:var(--heroui-danger)]",k="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":b="[--step-color:var(--heroui-default)]",k="[--step-fg-color:var(--heroui-default-foreground)]";break;default:b="[--step-color:var(--heroui-primary)]",k="[--step-fg-color:var(--heroui-primary-foreground)]";break}return S.unshift(k),S.unshift(b),S},[t]);return c.jsxs("nav",{ref:f,"aria-label":"Progress",className:y.cn("flex max-w-fit items-center overflow-x-auto",a),"data-testid":"stepper-root",...d,children:[r&&c.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:r}),c.jsx("ol",{className:y.cn("flex flex-row flex-nowrap gap-x-3",C,a),"data-testid":"stepper-list",children:Array.from({length:e})?.map((b,k)=>{const S=p===k?"active":p<k?"inactive":"complete";return c.jsx("li",{className:"relative flex shrink-0 items-center pr-12","data-testid":`stepper-step-${k}`,children:c.jsxs("button",{"aria-current":S==="active"?"step":void 0,className:y.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"cursor-not-allowed opacity-50":u},l),onClick:()=>!u&&m(k),disabled:u,"data-testid":`stepper-step-btn-${k}`,children:[c.jsx("div",{className:"h-full relative flex items-center",children:c.jsx(Re.LazyMotion,{features:Re.domAnimation,children:c.jsx(Re.m.div,{animate:S,className:"relative",children:c.jsx(Re.m.div,{animate:S,className:y.cn("border-medium text-large text-default-foreground relative flex h-[26px] w-[26px] items-center justify-center rounded-full font-semibold",{"shadow-lg":S==="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:c.jsx("div",{className:"flex items-center justify-center",children:S==="complete"?c.jsx(Zo,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${k}`}):c.jsx("span",{})})})})})}),k<e-1&&!o&&c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 left-[26px] w-[calc(100%-13px)] flex-none items-center",style:{"--idx":k},children:c.jsx("div",{className:y.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":k<p})})})]},k)},k)})})]})});Zs.displayName="Stepper";function Qo(t){return c.jsx("div",{className:"min-h-screen flex flex-col",children:c.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:c.jsx(y.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 Xo(){return c.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 Yo=t=>{const e=v.useMemo(()=>JSON.stringify({allItems:t.allItems,selected:t.selected}),[t.allItems,t.selected]);return c.jsx(el,{...t},e)},el=({allItems:t,selected:e,onSelectedChange:n,titleLeft:r,titleRight:s})=>{const[i,o]=v.useState([]),[l,a]=v.useState([]),[u,d]=v.useState(null),[f,p]=v.useState(null),m=v.useMemo(()=>new Set(e),[e]),C=v.useMemo(()=>new Set(t),[t]),b=v.useMemo(()=>t.filter(P=>!m.has(P)),[t,m]),k=P=>{if(P.length===0)return;const M=Array.from(new Set([...e,...P]));n(M)},S=P=>{if(P.length===0)return;const M=new Set(P);n(e.filter(F=>!M.has(F)))},w=()=>{i.length!==0&&(k(i),o([]))},j=()=>{l.length!==0&&(S(l),a([]))},N=()=>{b.length!==0&&(k(b),o([]))},D=()=>{e.length!==0&&(n([]),a([]))},L=(P,M,F)=>{const $=Math.min(M,F),B=Math.max(M,F);return P.slice($,B+1)},O=(P,M,F)=>{if(F&&u!==null){o(L(b,u,M)),a([]),d(M);return}const $=i.includes(P);o($?i.filter(B=>B!==P):[...i,P]),a([]),d(M)},z=(P,M,F)=>{if(F&&f!==null){a(L(e,f,M)),o([]),p(M);return}const $=l.includes(P);a($?l.filter(B=>B!==P):[...l,P]),o([]),p(M)},H=(P,M,F)=>{const $=F==="available"?i.includes(M)?i:[M]:l.includes(M)?l:[M];P.dataTransfer.setData("text/plain",JSON.stringify({source:F,items:$})),P.dataTransfer.effectAllowed="move"},U=(P,M)=>{P.preventDefault();const F=P.dataTransfer.getData("text/plain");if(F)try{const $=JSON.parse(F),B=($.items||[]).filter(Y=>C.has(Y));if(B.length===0||$.source===M)return;M==="selected"?(k(B),o([])):(S(B),a([]))}catch{return}};return c.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[c.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),c.jsx(y.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(y.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:P=>P.preventDefault(),onDrop:P=>U(P,"available"),children:b.map((P,M)=>{const F=i.includes(P);return c.jsx("button",{type:"button",onClick:$=>{O(P,M,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>H($,P,"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:P},P)})})})]}),c.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[c.jsx(oe,{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:w,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),c.jsx(oe,{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:j,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),c.jsx(oe,{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:N,isDisabled:b.length===0,"aria-label":"Move all to right",children:"»"}),c.jsx(oe,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:D,"data-testid":"move-all-to-available",isDisabled:e.length===0,"aria-label":"Move all to left",children:"«"})]}),c.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[c.jsx("h2",{className:"text-sm font-medium text-gray-700",children:s}),c.jsx(y.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(y.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:P=>P.preventDefault(),onDrop:P=>U(P,"selected"),children:e.map((P,M)=>{const F=l.includes(P);return c.jsx("button",{type:"button",onClick:$=>{z(P,M,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>H($,P,"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:P},P)})})})]})]})};function Rt(t){return typeof t=="string"?t:t.type}function nt({className:t}){return c.jsx("div",{className:`flex items-center h-6 ${t||""}`,children:c.jsx(y.Divider,{orientation:"vertical"})})}function We({icon:t,label:e,isActive:n=!1,isDisabled:r=!1,onClick:s,shortcut:i,iconSize:o=16,className:l}){const a=i?`${e} (${i})`:e;return c.jsx(y.Tooltip,{content:a,placement:"top",offset:10,children:c.jsx(oe,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:s,"aria-label":e,className:l,children:c.jsx(t,{size:o})})})}const He={bold:{execute:({editor:t})=>t.chain().focus().toggleBold().run(),canExecute:t=>t.can().chain().focus().toggleBold().run(),isActive:t=>t.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:t})=>t.chain().focus().toggleItalic().run(),canExecute:t=>t.can().chain().focus().toggleItalic().run(),isActive:t=>t.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:t})=>t.chain().focus().toggleStrike().run(),canExecute:t=>t.can().chain().focus().toggleStrike().run(),isActive:t=>t.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:t})=>t.chain().focus().toggleUnderline().run(),canExecute:t=>t.can().chain().focus().toggleUnderline().run(),isActive:t=>t.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:t})=>t.chain().focus().toggleCode().run(),canExecute:t=>t.can().chain().focus().toggleCode().run(),isActive:t=>t.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:t,config:e})=>{const n=e?.type==="textColor"?e.color:"";n?t.chain().focus().setColor(n).run():t.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:t=>t.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:t,config:e})=>{const n=e?.type==="highlight"?e.color:"";n?t.chain().focus().setHighlight({color:n}).run():t.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:t=>t.isActive("highlight"),label:"Highlight"},link:{execute:({editor:t,config:e})=>{const n=e?.type==="link"?e.href:"";if(n){const r=e?.type==="link"?e.target:void 0,s=e?.type==="link"?e.rel:void 0;t.chain().focus().setLink({href:n,target:r,rel:s}).run()}else t.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:t=>t.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:t})=>t.chain().focus().setParagraph().run(),canExecute:t=>t.can().chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:t,config:e})=>{const n=e?.type==="heading"?e.level:1;t.chain().focus().toggleHeading({level:n}).run()},canExecute:(t,e)=>{const n=e?.type==="heading"?e.level:1;return t.can().chain().focus().toggleHeading({level:n}).run()},isActive:(t,e)=>e?.type==="heading"?t.isActive("heading",{level:e.level}):t.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:t})=>t.chain().focus().toggleBulletList().run(),canExecute:t=>t.can().chain().focus().toggleBulletList().run(),isActive:t=>t.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:t})=>t.chain().focus().toggleOrderedList().run(),canExecute:t=>t.can().chain().focus().toggleOrderedList().run(),isActive:t=>t.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:t})=>t.chain().focus().toggleTaskList().run(),canExecute:t=>t.can().chain().focus().toggleTaskList().run(),isActive:t=>t.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:t})=>t.chain().focus().toggleCodeBlock().run(),canExecute:t=>t.can().chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:t})=>t.chain().focus().toggleBlockquote().run(),canExecute:t=>t.can().chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:t})=>t.chain().focus().setHorizontalRule().run(),canExecute:t=>t.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:t})=>t.chain().focus().setHardBreak().run(),canExecute:t=>t.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:t,config:e})=>{const n=e?.type==="textAlign"?e.alignment:"left";t.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(t,e)=>e?.type==="textAlign"?t.isActive({textAlign:e.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:t})=>t.chain().focus().unsetAllMarks().run(),canExecute:t=>t.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:t})=>t.chain().focus().clearNodes().run(),canExecute:t=>t.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:t})=>t.chain().focus().undo().run(),canExecute:t=>t.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:t})=>t.chain().focus().redo().run(),canExecute:t=>t.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},tl={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function nl({editor:t,levels:e=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=v.useState(0);v.useEffect(()=>{const o=()=>r(l=>l+1);return t.on("selectionUpdate",o),t.on("transaction",o),()=>{t.off("selectionUpdate",o),t.off("transaction",o)}},[t]);const s=e.find(o=>t.isActive("heading",{level:o})),i=o=>{const l=Number(o),a=He.heading;a&&a.execute({editor:t,config:{type:"heading",level:l}})};return c.jsxs(y.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(y.DropdownTrigger,{children:c.jsx(oe,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,startContent:c.jsx(_.Heading,{size:16}),"aria-label":"Select heading level",children:s?`H${s}`:"H"})}),c.jsx(y.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:s?new Set([String(s)]):new Set,onAction:i,children:e.map(o=>c.jsx(y.DropdownItem,{startContent:t.isActive("heading",{level:o})?c.jsx(_.Check,{size:16}):c.jsx("div",{className:"w-4"}),children:tl[o]},o))})]})}const On={bulletList:{label:"Bullet List",icon:_.List},orderedList:{label:"Numbered List",icon:_.ListOrdered},taskList:{label:"Task List",icon:_.ListTodo}};function rl({editor:t,types:e=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=v.useState(0);v.useEffect(()=>{const l=()=>r(a=>a+1);return t.on("selectionUpdate",l),t.on("transaction",l),()=>{t.off("selectionUpdate",l),t.off("transaction",l)}},[t]);const s=e.find(l=>t.isActive(l)),i=s?On[s].icon:_.List,o=l=>{const u=He[l];u&&u.execute({editor:t})};return c.jsxs(y.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(y.DropdownTrigger,{children:c.jsx(oe,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:c.jsx(i,{size:16})})}),c.jsx(y.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:s?new Set([s]):new Set,onAction:o,children:e.map(l=>{const a=On[l].icon;return c.jsx(y.DropdownItem,{startContent:c.jsx(a,{size:16}),children:On[l].label},l)})})]})}function sl({colors:t,selectedColor:e,onColorSelect:n,columns:r=4}){return c.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:t.map(s=>{const i=e===s;return c.jsx("button",{type:"button",onClick:()=>n(s),className:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),y=require("@heroui/react"),v=require("react"),_=require("lucide-react"),Re=require("framer-motion"),hr=require("@tiptap/react"),R=require("@tiptap/core"),Fo=require("@tiptap/extension-underline"),Po=require("@tiptap/extension-color"),$o=require("@tiptap/extension-highlight"),Vo=require("@tiptap/extension-link"),Bo=require("@tiptap/extension-task-list"),zo=require("@tiptap/extension-task-item"),_o=require("@tiptap/extension-text-align");function Ho({children:t}){return c.jsx(y.HeroUIProvider,{children:t})}const oe=v.forwardRef(({color:t="primary",radius:e="full",testId:n="veevart-button",...r},s)=>c.jsx(y.Button,{ref:s,color:t,radius:e,"data-testid":n,...r}));oe.displayName="Button";const Uo={login:"Login",logout:"Logout",selectLanguage:"Select your language"};function qo({languages:t,selectedLanguage:e,onLanguageChange:n,label:r}){const s=t.find(i=>i.code===e);return c.jsx("div",{className:"flex items-center",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(y.Select,{"data-testid":"language-select-desktop","aria-label":r,selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"min-w-40 hidden md:inline-flex",isDisabled:t.length===0,placeholder:r,startContent:c.jsx(_.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s?.label||r,children:t.map(i=>c.jsx(y.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),c.jsx(y.Select,{"aria-label":r,"data-testid":"language-select-mobile",selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"min-w-20 inline-flex md:hidden",isDisabled:t.length===0,placeholder:r,startContent:c.jsx(_.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>s?.code.toUpperCase()||"",children:t.map(i=>c.jsx(y.SelectItem,{className:"min-w-4",textValue:i.label,"data-testid":`language-select-option-mobile-${i.code}`,children:i.label},i.code))})]})})}function Ko({isLoggedIn:t,onLogin:e,onLogout:n,labels:r}){return t?c.jsxs(oe,{"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,children:[c.jsx(_.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.logout})]}):c.jsxs(oe,{"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:e,children:[c.jsx(_.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Jo({logo:t,languages:e=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:s,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:a,labels:u={},className:d}){const f={...Uo,...u};return c.jsxs("nav",{"data-testid":"navbar",className:y.cn("w-full px-4 md:px-8 py-4 bg-white border-b border-zinc-100 flex items-center justify-between",d),children:[c.jsx("div",{className:"flex items-center min-w-10",children:t&&c.jsx("a",{href:"/",className:"block",children:c.jsx("img",{"data-testid":"navbar-logo",src:t,alt:"Logo",className:"h-8 max-w-28 md:max-w-40"})})}),c.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[(l||e.length>0)&&c.jsx(qo,{languages:e,selectedLanguage:n,onLanguageChange:r,label:f.selectLanguage}),a&&c.jsx(Ko,{isLoggedIn:s,onLogin:i,onLogout:o,labels:f})]})]})}function Wo(t){return c.jsx("div",{className:"min-h-screen flex flex-col",children:c.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:c.jsx(y.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 Mn;const Go=typeof document<"u"?(Mn=v.useInsertionEffect)!==null&&Mn!==void 0?Mn:v.useLayoutEffect:()=>{};function pr(t,e,n){let[r,s]=v.useState(t||e),i=v.useRef(r),o=v.useRef(t!==void 0),l=t!==void 0;v.useEffect(()=>{let f=o.current;f!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),o.current=l},[l]);let a=l?t:r;Go(()=>{i.current=a});let[,u]=v.useReducer(()=>({}),{}),d=v.useCallback((f,...p)=>{let m=typeof f=="function"?f(i.current):f;Object.is(i.current,m)||(i.current=m,s(m),u(),n?.(m,...p))},[n]);return[a,d]}function Zo(t){return c.jsx("svg",{...t,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:c.jsx(Re.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 Zs=v.forwardRef(({color:t="primary",stepsCount:e=3,defaultStep:n=0,label:r,onStepChange:s,currentStep:i,hideProgressBars:o=!1,stepClassName:l,className:a,isDisabled:u=!1,...d},f)=>{const[p,m]=pr(i,n,s),C=v.useMemo(()=>{let b,k;const S=["[--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(t){case"primary":b="[--step-color:var(--heroui-primary)]",k="[--step-fg-color:var(--heroui-primary-foreground)]";break;case"secondary":b="[--step-color:var(--heroui-secondary)]",k="[--step-fg-color:var(--heroui-secondary-foreground)]";break;case"success":b="[--step-color:var(--heroui-success)]",k="[--step-fg-color:var(--heroui-success-foreground)]";break;case"warning":b="[--step-color:var(--heroui-warning)]",k="[--step-fg-color:var(--heroui-warning-foreground)]";break;case"danger":b="[--step-color:var(--heroui-danger)]",k="[--step-fg-color:var(--heroui-danger-foreground)]";break;case"default":b="[--step-color:var(--heroui-default)]",k="[--step-fg-color:var(--heroui-default-foreground)]";break;default:b="[--step-color:var(--heroui-primary)]",k="[--step-fg-color:var(--heroui-primary-foreground)]";break}return S.unshift(k),S.unshift(b),S},[t]);return c.jsxs("nav",{ref:f,"aria-label":"Progress",className:y.cn("flex max-w-fit items-center overflow-x-auto",a),"data-testid":"stepper-root",...d,children:[r&&c.jsx("label",{className:"text-small text-default-foreground lg:text-medium font-light whitespace-nowrap me-3","data-testid":"stepper-label",children:r}),c.jsx("ol",{className:y.cn("flex flex-row flex-nowrap gap-x-3",C,a),"data-testid":"stepper-list",children:Array.from({length:e})?.map((b,k)=>{const S=p===k?"active":p<k?"inactive":"complete";return c.jsx("li",{className:"relative flex shrink-0 items-center pr-12","data-testid":`stepper-step-${k}`,children:c.jsxs("button",{"aria-current":S==="active"?"step":void 0,className:y.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",{"cursor-not-allowed opacity-50":u},l),onClick:()=>!u&&m(k),disabled:u,"data-testid":`stepper-step-btn-${k}`,children:[c.jsx("div",{className:"h-full relative flex items-center",children:c.jsx(Re.LazyMotion,{features:Re.domAnimation,children:c.jsx(Re.m.div,{animate:S,className:"relative",children:c.jsx(Re.m.div,{animate:S,className:y.cn("border-medium text-large text-default-foreground relative flex h-[26px] w-[26px] items-center justify-center rounded-full font-semibold",{"shadow-lg":S==="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:c.jsx("div",{className:"flex items-center justify-center",children:S==="complete"?c.jsx(Zo,{className:"h-5 w-5 text-(--active-fg-color)","data-testid":`stepper-step-check-${k}`}):c.jsx("span",{})})})})})}),k<e-1&&!o&&c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 left-[26px] w-[calc(100%-13px)] flex-none items-center",style:{"--idx":k},children:c.jsx("div",{className:y.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":k<p})})})]},k)},k)})})]})});Zs.displayName="Stepper";function Qo(t){return c.jsx("div",{className:"min-h-screen flex flex-col",children:c.jsx("div",{className:"flex-1 flex items-center justify-center p-12",children:c.jsx(y.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 Xo(){return c.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 Yo=t=>{const e=v.useMemo(()=>JSON.stringify({allItems:t.allItems,selected:t.selected}),[t.allItems,t.selected]);return c.jsx(el,{...t},e)},el=({allItems:t,selected:e,onSelectedChange:n,titleLeft:r,titleRight:s})=>{const[i,o]=v.useState([]),[l,a]=v.useState([]),[u,d]=v.useState(null),[f,p]=v.useState(null),m=v.useMemo(()=>new Set(e),[e]),C=v.useMemo(()=>new Set(t),[t]),b=v.useMemo(()=>t.filter(P=>!m.has(P)),[t,m]),k=P=>{if(P.length===0)return;const M=Array.from(new Set([...e,...P]));n(M)},S=P=>{if(P.length===0)return;const M=new Set(P);n(e.filter(F=>!M.has(F)))},w=()=>{i.length!==0&&(k(i),o([]))},j=()=>{l.length!==0&&(S(l),a([]))},N=()=>{b.length!==0&&(k(b),o([]))},D=()=>{e.length!==0&&(n([]),a([]))},L=(P,M,F)=>{const $=Math.min(M,F),B=Math.max(M,F);return P.slice($,B+1)},O=(P,M,F)=>{if(F&&u!==null){o(L(b,u,M)),a([]),d(M);return}const $=i.includes(P);o($?i.filter(B=>B!==P):[...i,P]),a([]),d(M)},z=(P,M,F)=>{if(F&&f!==null){a(L(e,f,M)),o([]),p(M);return}const $=l.includes(P);a($?l.filter(B=>B!==P):[...l,P]),o([]),p(M)},H=(P,M,F)=>{const $=F==="available"?i.includes(M)?i:[M]:l.includes(M)?l:[M];P.dataTransfer.setData("text/plain",JSON.stringify({source:F,items:$})),P.dataTransfer.effectAllowed="move"},U=(P,M)=>{P.preventDefault();const F=P.dataTransfer.getData("text/plain");if(F)try{const $=JSON.parse(F),B=($.items||[]).filter(Y=>C.has(Y));if(B.length===0||$.source===M)return;M==="selected"?(k(B),o([])):(S(B),a([]))}catch{return}};return c.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[c.jsx("h2",{className:"text-sm font-medium text-gray-700",children:r}),c.jsx(y.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(y.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:P=>P.preventDefault(),onDrop:P=>U(P,"available"),children:b.map((P,M)=>{const F=i.includes(P);return c.jsx("button",{type:"button",onClick:$=>{O(P,M,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>H($,P,"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:P},P)})})})]}),c.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[c.jsx(oe,{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:w,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),c.jsx(oe,{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:j,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),c.jsx(oe,{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:N,isDisabled:b.length===0,"aria-label":"Move all to right",children:"»"}),c.jsx(oe,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:D,"data-testid":"move-all-to-available",isDisabled:e.length===0,"aria-label":"Move all to left",children:"«"})]}),c.jsxs("div",{className:"flex w-full flex-col gap-3 md:w-2/5",children:[c.jsx("h2",{className:"text-sm font-medium text-gray-700",children:s}),c.jsx(y.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(y.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:P=>P.preventDefault(),onDrop:P=>U(P,"selected"),children:e.map((P,M)=>{const F=l.includes(P);return c.jsx("button",{type:"button",onClick:$=>{z(P,M,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>H($,P,"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:P},P)})})})]})]})};function Rt(t){return typeof t=="string"?t:t.type}function nt({className:t}){return c.jsx("div",{className:`flex items-center h-6 ${t||""}`,children:c.jsx(y.Divider,{orientation:"vertical"})})}function We({icon:t,label:e,isActive:n=!1,isDisabled:r=!1,onClick:s,shortcut:i,iconSize:o=16,className:l}){const a=i?`${e} (${i})`:e;return c.jsx(y.Tooltip,{content:a,placement:"top",offset:10,children:c.jsx(oe,{size:"sm",radius:"sm",color:n?"primary":"default",variant:n?"solid":"bordered",isIconOnly:!0,isDisabled:r,onPress:s,"aria-label":e,className:l,children:c.jsx(t,{size:o})})})}const He={bold:{execute:({editor:t})=>t.chain().focus().toggleBold().run(),canExecute:t=>t.can().chain().focus().toggleBold().run(),isActive:t=>t.isActive("bold"),shortcut:"Mod-b",label:"Bold"},italic:{execute:({editor:t})=>t.chain().focus().toggleItalic().run(),canExecute:t=>t.can().chain().focus().toggleItalic().run(),isActive:t=>t.isActive("italic"),shortcut:"Mod-i",label:"Italic"},strike:{execute:({editor:t})=>t.chain().focus().toggleStrike().run(),canExecute:t=>t.can().chain().focus().toggleStrike().run(),isActive:t=>t.isActive("strike"),shortcut:"Mod-Shift-x",label:"Strikethrough"},underline:{execute:({editor:t})=>t.chain().focus().toggleUnderline().run(),canExecute:t=>t.can().chain().focus().toggleUnderline().run(),isActive:t=>t.isActive("underline"),shortcut:"Mod-u",label:"Underline"},code:{execute:({editor:t})=>t.chain().focus().toggleCode().run(),canExecute:t=>t.can().chain().focus().toggleCode().run(),isActive:t=>t.isActive("code"),shortcut:"Mod-e",label:"Inline code"},textColor:{execute:({editor:t,config:e})=>{const n=e?.type==="textColor"?e.color:"";n?t.chain().focus().setColor(n).run():t.chain().focus().unsetColor().run()},canExecute:()=>!0,isActive:t=>t.isActive("textStyle"),label:"Text color"},highlight:{execute:({editor:t,config:e})=>{const n=e?.type==="highlight"?e.color:"";n?t.chain().focus().setHighlight({color:n}).run():t.chain().focus().unsetHighlight().run()},canExecute:()=>!0,isActive:t=>t.isActive("highlight"),label:"Highlight"},link:{execute:({editor:t,config:e})=>{const n=e?.type==="link"?e.href:"";if(n){const r=e?.type==="link"?e.target:void 0,s=e?.type==="link"?e.rel:void 0;t.chain().focus().setLink({href:n,target:r,rel:s}).run()}else t.chain().focus().unsetLink().run()},canExecute:()=>!0,isActive:t=>t.isActive("link"),shortcut:"Mod-k",label:"Link"},paragraph:{execute:({editor:t})=>t.chain().focus().setParagraph().run(),canExecute:t=>t.can().chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph"),shortcut:"Mod-Alt-0",label:"Paragraph"},heading:{execute:({editor:t,config:e})=>{const n=e?.type==="heading"?e.level:1;t.chain().focus().toggleHeading({level:n}).run()},canExecute:(t,e)=>{const n=e?.type==="heading"?e.level:1;return t.can().chain().focus().toggleHeading({level:n}).run()},isActive:(t,e)=>e?.type==="heading"?t.isActive("heading",{level:e.level}):t.isActive("heading"),label:"Heading"},bulletList:{execute:({editor:t})=>t.chain().focus().toggleBulletList().run(),canExecute:t=>t.can().chain().focus().toggleBulletList().run(),isActive:t=>t.isActive("bulletList"),shortcut:"Mod-Shift-8",label:"Bullet list"},orderedList:{execute:({editor:t})=>t.chain().focus().toggleOrderedList().run(),canExecute:t=>t.can().chain().focus().toggleOrderedList().run(),isActive:t=>t.isActive("orderedList"),shortcut:"Mod-Shift-7",label:"Numbered list"},taskList:{execute:({editor:t})=>t.chain().focus().toggleTaskList().run(),canExecute:t=>t.can().chain().focus().toggleTaskList().run(),isActive:t=>t.isActive("taskList"),label:"Task list"},codeBlock:{execute:({editor:t})=>t.chain().focus().toggleCodeBlock().run(),canExecute:t=>t.can().chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock"),shortcut:"Mod-Alt-c",label:"Code block"},blockquote:{execute:({editor:t})=>t.chain().focus().toggleBlockquote().run(),canExecute:t=>t.can().chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote"),shortcut:"Mod-Shift-b",label:"Blockquote"},horizontalRule:{execute:({editor:t})=>t.chain().focus().setHorizontalRule().run(),canExecute:t=>t.can().chain().focus().setHorizontalRule().run(),isActive:()=>!1,label:"Horizontal rule"},hardBreak:{execute:({editor:t})=>t.chain().focus().setHardBreak().run(),canExecute:t=>t.can().chain().focus().setHardBreak().run(),isActive:()=>!1,shortcut:"Mod-Enter",label:"Line break"},textAlign:{execute:({editor:t,config:e})=>{const n=e?.type==="textAlign"?e.alignment:"left";t.chain().focus().setTextAlign(n).run()},canExecute:()=>!0,isActive:(t,e)=>e?.type==="textAlign"?t.isActive({textAlign:e.alignment}):!1,label:"Text alignment"},clearMarks:{execute:({editor:t})=>t.chain().focus().unsetAllMarks().run(),canExecute:t=>t.can().chain().focus().unsetAllMarks().run(),isActive:()=>!1,label:"Clear formatting"},clearNodes:{execute:({editor:t})=>t.chain().focus().clearNodes().run(),canExecute:t=>t.can().chain().focus().clearNodes().run(),isActive:()=>!1,label:"Clear nodes"},undo:{execute:({editor:t})=>t.chain().focus().undo().run(),canExecute:t=>t.can().chain().focus().undo().run(),isActive:()=>!1,shortcut:"Mod-z",label:"Undo"},redo:{execute:({editor:t})=>t.chain().focus().redo().run(),canExecute:t=>t.can().chain().focus().redo().run(),isActive:()=>!1,shortcut:"Mod-Shift-z",label:"Redo"}},tl={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function nl({editor:t,levels:e=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=v.useState(0);v.useEffect(()=>{const o=()=>r(l=>l+1);return t.on("selectionUpdate",o),t.on("transaction",o),()=>{t.off("selectionUpdate",o),t.off("transaction",o)}},[t]);const s=e.find(o=>t.isActive("heading",{level:o})),i=o=>{const l=Number(o),a=He.heading;a&&a.execute({editor:t,config:{type:"heading",level:l}})};return c.jsxs(y.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(y.DropdownTrigger,{children:c.jsx(oe,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,startContent:c.jsx(_.Heading,{size:16}),"aria-label":"Select heading level",children:s?`H${s}`:"H"})}),c.jsx(y.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:s?new Set([String(s)]):new Set,onAction:i,children:e.map(o=>c.jsx(y.DropdownItem,{startContent:t.isActive("heading",{level:o})?c.jsx(_.Check,{size:16}):c.jsx("div",{className:"w-4"}),children:tl[o]},o))})]})}const On={bulletList:{label:"Bullet List",icon:_.List},orderedList:{label:"Numbered List",icon:_.ListOrdered},taskList:{label:"Task List",icon:_.ListTodo}};function rl({editor:t,types:e=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=v.useState(0);v.useEffect(()=>{const l=()=>r(a=>a+1);return t.on("selectionUpdate",l),t.on("transaction",l),()=>{t.off("selectionUpdate",l),t.off("transaction",l)}},[t]);const s=e.find(l=>t.isActive(l)),i=s?On[s].icon:_.List,o=l=>{const u=He[l];u&&u.execute({editor:t})};return c.jsxs(y.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(y.DropdownTrigger,{children:c.jsx(oe,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,isIconOnly:!0,"aria-label":"Select list type",children:c.jsx(i,{size:16})})}),c.jsx(y.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:s?new Set([s]):new Set,onAction:o,children:e.map(l=>{const a=On[l].icon;return c.jsx(y.DropdownItem,{startContent:c.jsx(a,{size:16}),children:On[l].label},l)})})]})}function sl({colors:t,selectedColor:e,onColorSelect:n,columns:r=4}){return c.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:t.map(s=>{const i=e===s;return c.jsx("button",{type:"button",onClick:()=>n(s),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
@@ -31,30 +31,31 @@ function la({
31
31
  onLanguageChange: n,
32
32
  label: r
33
33
  }) {
34
+ const i = t.find((s) => s.code === e);
34
35
  return /* @__PURE__ */ d("div", { className: "flex items-center", children: /* @__PURE__ */ T("div", { className: "relative flex items-center", children: [
35
- /* @__PURE__ */ d(gi, { className: "absolute left-3 w-5 h-5 pointer-events-none text-black" }),
36
36
  /* @__PURE__ */ d(
37
37
  hi,
38
38
  {
39
39
  "data-testid": "language-select-desktop",
40
40
  "aria-label": r,
41
41
  selectedKeys: e ? [e] : [],
42
- onSelectionChange: (i) => {
43
- const s = Array.from(i)[0] || e;
44
- n?.(s);
42
+ onSelectionChange: (s) => {
43
+ const o = Array.from(s)[0] || e;
44
+ n?.(o);
45
45
  },
46
46
  className: "min-w-40 hidden md:inline-flex",
47
47
  isDisabled: t.length === 0,
48
48
  placeholder: r,
49
49
  startContent: /* @__PURE__ */ d(gi, { className: "w-5 h-5 text-black" }),
50
- children: t.map((i) => /* @__PURE__ */ d(
50
+ renderValue: () => i?.label || r,
51
+ children: t.map((s) => /* @__PURE__ */ d(
51
52
  pi,
52
53
  {
53
- textValue: i.label,
54
- "data-testid": `language-select-option-${i.code}`,
55
- children: i.label
54
+ textValue: s.label,
55
+ "data-testid": `language-select-option-${s.code}`,
56
+ children: s.label
56
57
  },
57
- i.code
58
+ s.code
58
59
  ))
59
60
  }
60
61
  ),
@@ -64,22 +65,24 @@ function la({
64
65
  "aria-label": r,
65
66
  "data-testid": "language-select-mobile",
66
67
  selectedKeys: e ? [e] : [],
67
- onSelectionChange: (i) => {
68
- const s = Array.from(i)[0] || e;
69
- n?.(s);
68
+ onSelectionChange: (s) => {
69
+ const o = Array.from(s)[0] || e;
70
+ n?.(o);
70
71
  },
71
72
  className: "min-w-20 inline-flex md:hidden",
72
73
  isDisabled: t.length === 0,
73
- placeholder: e || "Language",
74
- children: t.map((i) => /* @__PURE__ */ d(
74
+ placeholder: r,
75
+ startContent: /* @__PURE__ */ d(gi, { className: "w-5 h-5 text-black" }),
76
+ renderValue: () => i?.code.toUpperCase() || "",
77
+ children: t.map((s) => /* @__PURE__ */ d(
75
78
  pi,
76
79
  {
77
80
  className: "min-w-4",
78
- textValue: i.code.toUpperCase(),
79
- "data-testid": `language-select-option-mobile-${i.code}`,
80
- children: i.code.toUpperCase()
81
+ textValue: s.label,
82
+ "data-testid": `language-select-option-mobile-${s.code}`,
83
+ children: s.label
81
84
  },
82
- i.code
85
+ s.code
83
86
  ))
84
87
  }
85
88
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "1.6.0-dev.4",
4
+ "version": "1.6.0-dev.5",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",