@veevarts/design-system 1.12.2 → 1.12.3
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 +9 -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 c=require("react/jsx-runtime"),g=require("@heroui/react"),x=require("react"),B=require("lucide-react"),$e=require("framer-motion"),hr=require("@tiptap/react"),R=require("@tiptap/core"),_o=require("@tiptap/extension-underline"),Ho=require("@tiptap/extension-color"),Uo=require("@tiptap/extension-highlight"),qo=require("@tiptap/extension-link"),Ko=require("@tiptap/extension-task-list"),Wo=require("@tiptap/extension-task-item"),Jo=require("@tiptap/extension-text-align");function Go({children:t}){return c.jsx(g.HeroUIProvider,{children:t})}const se=x.forwardRef(({color:t="primary",radius:e="full",testId:n="veevart-button",...r},s)=>c.jsx(g.Button,{ref:s,color:t,radius:e,"data-testid":n,...r}));se.displayName="Button";const Zo={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(g.Select,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:t.length===0,placeholder:r,startContent:c.jsx(B.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>c.jsx("span",{children:s?.label||r}),size:"md",radius:"full",children:t.map(i=>c.jsx(g.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),c.jsx(g.Select,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:t.length===0,placeholder:"",startContent:c.jsx(B.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>c.jsx("span",{children:s?.code.toUpperCase()||""}),size:"md",radius:"full",children:t.map(i=>c.jsx(g.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function Xo({isLoggedIn:t,onLogin:e,onLogout:n,labels:r}){return t?c.jsxs(se,{"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:[c.jsx(B.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.logout})]}):c.jsxs(se,{"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,size:"md",children:[c.jsx(B.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Yo({logo:t,languages:e=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:s,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:a,labels:u={},className:d}){const f={...Zo,...u};return c.jsxs("nav",{"data-testid":"navbar",className:g.cn("w-full px-4 md:px-8 py-3 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(Xo,{isLoggedIn:s,onLogin:i,onLogout:o,labels:f})]})]})}function el(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(g.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 tl=typeof document<"u"?(Mn=x.useInsertionEffect)!==null&&Mn!==void 0?Mn:x.useLayoutEffect:()=>{};function pr(t,e,n){let[r,s]=x.useState(t||e),i=x.useRef(r),o=x.useRef(t!==void 0),l=t!==void 0;x.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;tl(()=>{i.current=a});let[,u]=x.useReducer(()=>({}),{}),d=x.useCallback((f,...m)=>{let h=typeof f=="function"?f(i.current):f;Object.is(i.current,h)||(i.current=h,s(h),u(),n?.(h,...m))},[n]);return[a,d]}function nl(t){return c.jsx("svg",{...t,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:c.jsx($e.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: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[m,h]=pr(i,n,s),C=x.useMemo(()=>{let b,k;const v=["[--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 v.unshift(k),v.unshift(b),v},[t]);return c.jsxs("nav",{ref:f,"aria-label":"Progress",className:g.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:g.cn("flex flex-row flex-nowrap gap-x-3",C,a),"data-testid":"stepper-list",children:Array.from({length:e})?.map((b,k)=>{const v=m===k?"active":m<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":v==="active"?"step":void 0,className:g.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&&h(k),disabled:u,"data-testid":`stepper-step-btn-${k}`,children:[c.jsx("div",{className:"h-full relative flex items-center",children:c.jsx($e.LazyMotion,{features:$e.domAnimation,children:c.jsx($e.m.div,{animate:v,className:"relative",children:c.jsx($e.m.div,{animate:v,className:g.cn("border-medium text-large text-default-foreground relative flex h-[26px] w-[26px] items-center justify-center rounded-full font-semibold",{"shadow-lg":v==="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:v==="complete"?c.jsx(nl,{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:g.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<m})})})]},k)},k)})})]})});Ys.displayName="Stepper";function rl(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(g.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 sl(){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 il=t=>{const e=x.useMemo(()=>JSON.stringify({allItems:t.allItems,selected:t.selected}),[t.allItems,t.selected]);return c.jsx(ol,{...t},e)},ol=({allItems:t,selected:e,onSelectedChange:n,titleLeft:r,titleRight:s})=>{const[i,o]=x.useState([]),[l,a]=x.useState([]),[u,d]=x.useState(null),[f,m]=x.useState(null),h=x.useMemo(()=>new Set(e),[e]),C=x.useMemo(()=>new Set(t),[t]),b=x.useMemo(()=>t.filter(F=>!h.has(F)),[t,h]),k=F=>{if(F.length===0)return;const j=Array.from(new Set([...e,...F]));n(j)},v=F=>{if(F.length===0)return;const j=new Set(F);n(e.filter(P=>!j.has(P)))},A=()=>{i.length!==0&&(k(i),o([]))},N=()=>{l.length!==0&&(v(l),a([]))},w=()=>{b.length!==0&&(k(b),o([]))},T=()=>{e.length!==0&&(n([]),a([]))},O=(F,j,P)=>{const $=Math.min(j,P),W=Math.max(j,P);return F.slice($,W+1)},L=(F,j,P)=>{if(P&&u!==null){o(O(b,u,j)),a([]),d(j);return}const $=i.includes(F);o($?i.filter(W=>W!==F):[...i,F]),a([]),d(j)},_=(F,j,P)=>{if(P&&f!==null){a(O(e,f,j)),o([]),m(j);return}const $=l.includes(F);a($?l.filter(W=>W!==F):[...l,F]),o([]),m(j)},z=(F,j,P)=>{const $=P==="available"?i.includes(j)?i:[j]:l.includes(j)?l:[j];F.dataTransfer.setData("text/plain",JSON.stringify({source:P,items:$})),F.dataTransfer.effectAllowed="move"},H=(F,j)=>{F.preventDefault();const P=F.dataTransfer.getData("text/plain");if(P)try{const $=JSON.parse(P),W=($.items||[]).filter(oe=>C.has(oe));if(W.length===0||$.source===j)return;j==="selected"?(k(W),o([])):(v(W),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(g.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(g.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:F=>F.preventDefault(),onDrop:F=>H(F,"available"),children:b.map((F,j)=>{const P=i.includes(F);return c.jsx("button",{type:"button",onClick:$=>{L(F,j,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>z($,F,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${P?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:F},F)})})})]}),c.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[c.jsx(se,{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:A,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),c.jsx(se,{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:N,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),c.jsx(se,{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:w,isDisabled:b.length===0,"aria-label":"Move all to right",children:"»"}),c.jsx(se,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:T,"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(g.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(g.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:F=>F.preventDefault(),onDrop:F=>H(F,"selected"),children:e.map((F,j)=>{const P=l.includes(F);return c.jsx("button",{type:"button",onClick:$=>{_(F,j,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>z($,F,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${P?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:F},F)})})})]})]})};function Rt(t){return typeof t=="string"?t:t.type}function rt({className:t}){return c.jsx("div",{className:`flex items-center h-6 ${t||""}`,children:c.jsx(g.Divider,{orientation:"vertical"})})}function st({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(g.Tooltip,{content:a,placement:"top",offset:10,children:c.jsx(se,{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 Ke={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"}},ll={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function al({editor:t,levels:e=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=x.useState(0);x.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=Ke.heading;a&&a.execute({editor:t,config:{type:"heading",level:l}})};return c.jsxs(g.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(g.DropdownTrigger,{children:c.jsx(se,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,startContent:c.jsx(B.Heading,{size:16}),"aria-label":"Select heading level",children:s?`H${s}`:"H"})}),c.jsx(g.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:s?new Set([String(s)]):new Set,onAction:i,children:e.map(o=>c.jsx(g.DropdownItem,{startContent:t.isActive("heading",{level:o})?c.jsx(B.Check,{size:16}):c.jsx("div",{className:"w-4"}),children:ll[o]},o))})]})}const jn={bulletList:{label:"Bullet List",icon:B.List},orderedList:{label:"Numbered List",icon:B.ListOrdered},taskList:{label:"Task List",icon:B.ListTodo}};function cl({editor:t,types:e=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=x.useState(0);x.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?jn[s].icon:B.List,o=l=>{const u=Ke[l];u&&u.execute({editor:t})};return c.jsxs(g.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(g.DropdownTrigger,{children:c.jsx(se,{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(g.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:s?new Set([s]):new Set,onAction:o,children:e.map(l=>{const a=jn[l].icon;return c.jsx(g.DropdownItem,{startContent:c.jsx(a,{size:16}),children:jn[l].label},l)})})]})}function ul({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"),g=require("@heroui/react"),x=require("react"),B=require("lucide-react"),$e=require("framer-motion"),hr=require("@tiptap/react"),R=require("@tiptap/core"),_o=require("@tiptap/extension-underline"),Ho=require("@tiptap/extension-color"),Uo=require("@tiptap/extension-highlight"),qo=require("@tiptap/extension-link"),Ko=require("@tiptap/extension-task-list"),Wo=require("@tiptap/extension-task-item"),Jo=require("@tiptap/extension-text-align");function Go({children:t}){return c.jsx(g.HeroUIProvider,{children:t})}const se=x.forwardRef(({color:t="primary",radius:e="full",testId:n="veevart-button",...r},s)=>c.jsx(g.Button,{ref:s,color:t,radius:e,"data-testid":n,...r}));se.displayName="Button";const Zo={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(g.Select,{"data-testid":"language-select-desktop",variant:"bordered","aria-label":r,selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"min-w-36 hidden md:inline-flex",isDisabled:t.length===0,placeholder:r,startContent:c.jsx(B.Globe,{className:"w-5 h-5 text-black"}),renderValue:()=>c.jsx("span",{children:s?.label||r}),size:"md",radius:"full",children:t.map(i=>c.jsx(g.SelectItem,{textValue:i.label,"data-testid":`language-select-option-${i.code}`,children:i.label},i.code))}),c.jsx(g.Select,{"aria-label":r,"data-testid":"language-select-mobile",variant:"bordered",selectedKeys:e?[e]:[],onSelectionChange:i=>{const o=Array.from(i)[0]||e;n?.(o)},className:"w-24 inline-flex md:hidden",isDisabled:t.length===0,placeholder:"",startContent:c.jsx(B.Globe,{className:"w-6 h-6 text-black"}),renderValue:()=>c.jsx("span",{children:s?.code.toUpperCase()||""}),size:"md",radius:"full",children:t.map(i=>c.jsx(g.SelectItem,{textValue:i.code.toUpperCase(),"data-testid":`language-select-option-mobile-${i.code}`,children:i.code.toUpperCase()},i.code))})]})})}function Xo({isLoggedIn:t,onLogin:e,onLogout:n,labels:r}){return t?c.jsxs(se,{"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:[c.jsx(B.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.logout})]}):c.jsxs(se,{"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,size:"md",children:[c.jsx(B.User,{className:"inline w-5 h-5"}),c.jsx("span",{className:"hidden md:inline",children:r.login})]})}function Yo({logo:t,languages:e=[],selectedLanguage:n,onLanguageChange:r,isLoggedIn:s,onLogin:i,onLogout:o,hasLanguages:l,hasAuth:a,labels:u={},className:d}){const f={...Zo,...u};return c.jsxs("nav",{"data-testid":"navbar",className:g.cn("w-full px-4 md:px-8 py-3 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 w-auto max-w-28 md:max-w-40 object-contain"})})}),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(Xo,{isLoggedIn:s,onLogin:i,onLogout:o,labels:f})]})]})}function el(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(g.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 tl=typeof document<"u"?(Mn=x.useInsertionEffect)!==null&&Mn!==void 0?Mn:x.useLayoutEffect:()=>{};function pr(t,e,n){let[r,s]=x.useState(t||e),i=x.useRef(r),o=x.useRef(t!==void 0),l=t!==void 0;x.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;tl(()=>{i.current=a});let[,u]=x.useReducer(()=>({}),{}),d=x.useCallback((f,...m)=>{let h=typeof f=="function"?f(i.current):f;Object.is(i.current,h)||(i.current=h,s(h),u(),n?.(h,...m))},[n]);return[a,d]}function nl(t){return c.jsx("svg",{...t,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:c.jsx($e.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: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[m,h]=pr(i,n,s),C=x.useMemo(()=>{let b,k;const v=["[--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 v.unshift(k),v.unshift(b),v},[t]);return c.jsxs("nav",{ref:f,"aria-label":"Progress",className:g.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:g.cn("flex flex-row flex-nowrap gap-x-3",C,a),"data-testid":"stepper-list",children:Array.from({length:e})?.map((b,k)=>{const v=m===k?"active":m<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":v==="active"?"step":void 0,className:g.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&&h(k),disabled:u,"data-testid":`stepper-step-btn-${k}`,children:[c.jsx("div",{className:"h-full relative flex items-center",children:c.jsx($e.LazyMotion,{features:$e.domAnimation,children:c.jsx($e.m.div,{animate:v,className:"relative",children:c.jsx($e.m.div,{animate:v,className:g.cn("border-medium text-large text-default-foreground relative flex h-[26px] w-[26px] items-center justify-center rounded-full font-semibold",{"shadow-lg":v==="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:v==="complete"?c.jsx(nl,{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:g.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<m})})})]},k)},k)})})]})});Ys.displayName="Stepper";function rl(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(g.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 sl(){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 il=t=>{const e=x.useMemo(()=>JSON.stringify({allItems:t.allItems,selected:t.selected}),[t.allItems,t.selected]);return c.jsx(ol,{...t},e)},ol=({allItems:t,selected:e,onSelectedChange:n,titleLeft:r,titleRight:s})=>{const[i,o]=x.useState([]),[l,a]=x.useState([]),[u,d]=x.useState(null),[f,m]=x.useState(null),h=x.useMemo(()=>new Set(e),[e]),C=x.useMemo(()=>new Set(t),[t]),b=x.useMemo(()=>t.filter(F=>!h.has(F)),[t,h]),k=F=>{if(F.length===0)return;const j=Array.from(new Set([...e,...F]));n(j)},v=F=>{if(F.length===0)return;const j=new Set(F);n(e.filter(P=>!j.has(P)))},A=()=>{i.length!==0&&(k(i),o([]))},N=()=>{l.length!==0&&(v(l),a([]))},w=()=>{b.length!==0&&(k(b),o([]))},T=()=>{e.length!==0&&(n([]),a([]))},O=(F,j,P)=>{const $=Math.min(j,P),W=Math.max(j,P);return F.slice($,W+1)},L=(F,j,P)=>{if(P&&u!==null){o(O(b,u,j)),a([]),d(j);return}const $=i.includes(F);o($?i.filter(W=>W!==F):[...i,F]),a([]),d(j)},_=(F,j,P)=>{if(P&&f!==null){a(O(e,f,j)),o([]),m(j);return}const $=l.includes(F);a($?l.filter(W=>W!==F):[...l,F]),o([]),m(j)},z=(F,j,P)=>{const $=P==="available"?i.includes(j)?i:[j]:l.includes(j)?l:[j];F.dataTransfer.setData("text/plain",JSON.stringify({source:P,items:$})),F.dataTransfer.effectAllowed="move"},H=(F,j)=>{F.preventDefault();const P=F.dataTransfer.getData("text/plain");if(P)try{const $=JSON.parse(P),W=($.items||[]).filter(oe=>C.has(oe));if(W.length===0||$.source===j)return;j==="selected"?(k(W),o([])):(v(W),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(g.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(g.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:F=>F.preventDefault(),onDrop:F=>H(F,"available"),children:b.map((F,j)=>{const P=i.includes(F);return c.jsx("button",{type:"button",onClick:$=>{L(F,j,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>z($,F,"available"),className:`rounded-md px-3 py-2 text-left text-sm transition ${P?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:F},F)})})})]}),c.jsxs("div",{className:"flex flex-row items-center justify-center gap-3 md:flex-col md:pt-6",children:[c.jsx(se,{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:A,isDisabled:i.length===0,"aria-label":"Move selected to right",children:"›"}),c.jsx(se,{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:N,isDisabled:l.length===0,"aria-label":"Move selected to left",children:"‹"}),c.jsx(se,{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:w,isDisabled:b.length===0,"aria-label":"Move all to right",children:"»"}),c.jsx(se,{variant:"light",className:"h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",isIconOnly:!0,onPress:T,"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(g.Card,{className:"w-full border border-gray-200 shadow-none",children:c.jsx(g.CardBody,{className:"h-60 gap-2 overflow-y-auto",onDragOver:F=>F.preventDefault(),onDrop:F=>H(F,"selected"),children:e.map((F,j)=>{const P=l.includes(F);return c.jsx("button",{type:"button",onClick:$=>{_(F,j,$.shiftKey)},onMouseDown:$=>{$.shiftKey&&$.preventDefault()},draggable:!0,onDragStart:$=>z($,F,"selected"),className:`rounded-md px-3 py-2 text-left text-sm transition ${P?"bg-[#E4571E]/10 text-[#E4571E]":"text-gray-700 hover:bg-gray-100"}`,children:F},F)})})})]})]})};function Rt(t){return typeof t=="string"?t:t.type}function rt({className:t}){return c.jsx("div",{className:`flex items-center h-6 ${t||""}`,children:c.jsx(g.Divider,{orientation:"vertical"})})}function st({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(g.Tooltip,{content:a,placement:"top",offset:10,children:c.jsx(se,{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 Ke={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"}},ll={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4",5:"Heading 5",6:"Heading 6"};function al({editor:t,levels:e=[1,2,3,4,5,6],isDisabled:n=!1}){const[,r]=x.useState(0);x.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=Ke.heading;a&&a.execute({editor:t,config:{type:"heading",level:l}})};return c.jsxs(g.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(g.DropdownTrigger,{children:c.jsx(se,{size:"sm",radius:"sm",variant:s?"solid":"bordered",color:s?"primary":"default",isDisabled:n,startContent:c.jsx(B.Heading,{size:16}),"aria-label":"Select heading level",children:s?`H${s}`:"H"})}),c.jsx(g.DropdownMenu,{"aria-label":"Heading levels",selectionMode:"single",selectedKeys:s?new Set([String(s)]):new Set,onAction:i,children:e.map(o=>c.jsx(g.DropdownItem,{startContent:t.isActive("heading",{level:o})?c.jsx(B.Check,{size:16}):c.jsx("div",{className:"w-4"}),children:ll[o]},o))})]})}const jn={bulletList:{label:"Bullet List",icon:B.List},orderedList:{label:"Numbered List",icon:B.ListOrdered},taskList:{label:"Task List",icon:B.ListTodo}};function cl({editor:t,types:e=["bulletList","orderedList","taskList"],isDisabled:n=!1}){const[,r]=x.useState(0);x.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?jn[s].icon:B.List,o=l=>{const u=Ke[l];u&&u.execute({editor:t})};return c.jsxs(g.Dropdown,{placement:"top-start",offset:10,children:[c.jsx(g.DropdownTrigger,{children:c.jsx(se,{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(g.DropdownMenu,{"aria-label":"List types",selectionMode:"single",selectedKeys:s?new Set([s]):new Set,onAction:o,children:e.map(l=>{const a=jn[l].icon;return c.jsx(g.DropdownItem,{startContent:c.jsx(a,{size:16}),children:jn[l].label},l)})})]})}function ul({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
|
@@ -148,7 +148,15 @@ function vh({
|
|
|
148
148
|
d
|
|
149
149
|
),
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */ u("div", { className: "flex items-center min-w-10", children: t && /* @__PURE__ */ u("a", { href: "/", className: "block", children: /* @__PURE__ */ u(
|
|
151
|
+
/* @__PURE__ */ u("div", { className: "flex items-center min-w-10", children: t && /* @__PURE__ */ u("a", { href: "/", className: "block", children: /* @__PURE__ */ u(
|
|
152
|
+
"img",
|
|
153
|
+
{
|
|
154
|
+
"data-testid": "navbar-logo",
|
|
155
|
+
src: t,
|
|
156
|
+
alt: "Logo",
|
|
157
|
+
className: "h-8 w-auto max-w-28 md:max-w-40 object-contain"
|
|
158
|
+
}
|
|
159
|
+
) }) }),
|
|
152
160
|
/* @__PURE__ */ C("div", { className: "flex items-center gap-2 md:gap-4", children: [
|
|
153
161
|
(l || e.length > 0) && /* @__PURE__ */ u(
|
|
154
162
|
ma,
|