@medway-ui/core 1.33.0 → 1.34.0

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.
Files changed (78) hide show
  1. package/COMPONENTS.md +110 -2
  2. package/COMPONENTS_SUMMARY.md +4 -2
  3. package/dist/COMPONENTS.md +110 -2
  4. package/dist/COMPONENTS_SUMMARY.md +4 -2
  5. package/dist/assets/css/tokens.css +49 -22
  6. package/dist/components/Alert.mjs +1 -1
  7. package/dist/components/AlertDialog.js +1 -1
  8. package/dist/components/AlertDialog.mjs +1 -1
  9. package/dist/components/Autocomplete.mjs +1 -1
  10. package/dist/components/Button.d.mts +2 -0
  11. package/dist/components/Button.d.mts.map +1 -1
  12. package/dist/components/Button.d.ts +2 -0
  13. package/dist/components/Button.d.ts.map +1 -1
  14. package/dist/components/Button.js +1 -1
  15. package/dist/components/Button.mjs +1 -1
  16. package/dist/components/CardContinue.mjs +1 -1
  17. package/dist/components/CardLesson.mjs +1 -1
  18. package/dist/components/CardModule.mjs +1 -1
  19. package/dist/components/CardNews.mjs +1 -1
  20. package/dist/components/CardTopic.mjs +1 -1
  21. package/dist/components/CardWeek.mjs +1 -1
  22. package/dist/components/Carousel.js +1 -1
  23. package/dist/components/Carousel.mjs +1 -1
  24. package/dist/components/Chip.d.mts +1 -1
  25. package/dist/components/Chip.d.mts.map +1 -1
  26. package/dist/components/Chip.d.ts +1 -1
  27. package/dist/components/Chip.d.ts.map +1 -1
  28. package/dist/components/Chip.js +1 -1
  29. package/dist/components/Chip.mjs +1 -1
  30. package/dist/components/ConfirmDeleteButton.d.mts +26 -0
  31. package/dist/components/ConfirmDeleteButton.d.mts.map +1 -0
  32. package/dist/components/ConfirmDeleteButton.d.ts +26 -0
  33. package/dist/components/ConfirmDeleteButton.d.ts.map +1 -0
  34. package/dist/components/ConfirmDeleteButton.js +4 -0
  35. package/dist/components/ConfirmDeleteButton.js.map +1 -0
  36. package/dist/components/ConfirmDeleteButton.mjs +4 -0
  37. package/dist/components/ConfirmDeleteButton.mjs.map +1 -0
  38. package/dist/components/NoteEditor.d.mts.map +1 -1
  39. package/dist/components/NoteEditor.d.ts.map +1 -1
  40. package/dist/components/NoteEditor.js +1 -1
  41. package/dist/components/NoteEditor.mjs +1 -1
  42. package/dist/components/NoteEditorLinkDialog.d.mts +36 -0
  43. package/dist/components/NoteEditorLinkDialog.d.mts.map +1 -0
  44. package/dist/components/NoteEditorLinkDialog.d.ts +36 -0
  45. package/dist/components/NoteEditorLinkDialog.d.ts.map +1 -0
  46. package/dist/components/NoteEditorLinkDialog.js +4 -0
  47. package/dist/components/NoteEditorLinkDialog.js.map +1 -0
  48. package/dist/components/NoteEditorLinkDialog.mjs +4 -0
  49. package/dist/components/NoteEditorLinkDialog.mjs.map +1 -0
  50. package/dist/components/Pagination.mjs +1 -1
  51. package/dist/components/Ranking.mjs +1 -1
  52. package/dist/components/Select.d.mts.map +1 -1
  53. package/dist/components/Select.d.ts.map +1 -1
  54. package/dist/components/Select.js +1 -1
  55. package/dist/components/Select.mjs +1 -1
  56. package/dist/components/Skeleton.js +1 -1
  57. package/dist/components/Skeleton.mjs +1 -1
  58. package/dist/components/Tag.d.mts +2 -1
  59. package/dist/components/Tag.d.mts.map +1 -1
  60. package/dist/components/Tag.d.ts +2 -1
  61. package/dist/components/Tag.d.ts.map +1 -1
  62. package/dist/components/Tag.js +1 -1
  63. package/dist/components/TagPicker.d.mts +91 -0
  64. package/dist/components/TagPicker.d.mts.map +1 -0
  65. package/dist/components/TagPicker.d.ts +91 -0
  66. package/dist/components/TagPicker.d.ts.map +1 -0
  67. package/dist/components/TagPicker.js +4 -0
  68. package/dist/components/TagPicker.js.map +1 -0
  69. package/dist/components/TagPicker.mjs +4 -0
  70. package/dist/components/TagPicker.mjs.map +1 -0
  71. package/dist/components/Toast.mjs +1 -1
  72. package/dist/index.d.mts +5 -1
  73. package/dist/index.d.mts.map +1 -1
  74. package/dist/index.d.ts +5 -1
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/index.mjs +1 -1
  78. package/package.json +3 -2
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsxs as z,jsx as h,Fragment as Ye}from"react/jsx-runtime";import{forwardRef as $e,useMemo as de,useState as q,useRef as v,useCallback as A,useLayoutEffect as be,useEffect as _,useReducer as Ve,useImperativeHandle as Ze}from"react";import{createPortal as _e}from"react-dom";import{useEditor as Qe,EditorContent as et}from"@tiptap/react";import{NodeSelection as we,Selection as Ne}from"@tiptap/pm/state";import{EMPTY_SLASH_STATE as tt,sanitizeImageSrc as rt,EMPTY_DOCUMENT as ye,getSlashCommand as ot,toEditorContent as nt,normalizeDocument as it,sanitizeImageWidth as Me,sanitizeLinkHref as lt,MIN_IMAGE_WIDTH as at}from"@medway-ui/notes-core";import{createSlashCommand as st,buildExtensions as xe,assertSchemaContract as ct,generateHTML as ut,generateJSON as dt}from"@medway-ui/notes-core/schema";import{getImageToolbarPlacement as mt}from"../lib/image-toolbar-placement.mjs";import{cn as Q}from"../lib/utils.mjs";import{Separator as Pe}from"./Separator.mjs";import{Bold as ft,Italic as pt,Underline as gt,Strikethrough as ht,Code as vt,HeadingH2 as bt,HeadingH3 as _t,ListUnordered as wt,ListOrdered as yt,DoubleQuotesL as Mt,WindowCodeBlock as xt,Link as Pt,ArrowUndoUpLeft as Et,Redo as kt,Image as Lt}from"@medway-ui/icons";var At=Object.defineProperty,Nt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Te=(e,r,a)=>r in e?At(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,Se=(e,r)=>{for(var a in r||(r={}))De.call(r,a)&&Te(e,a,r[a]);if(me)for(var a of me(r))Ce.call(r,a)&&Te(e,a,r[a]);return e},Ie=(e,r)=>Nt(e,Dt(r)),Ct=(e,r)=>{var a={};for(var m in e)De.call(e,m)&&r.indexOf(m)<0&&(a[m]=e[m]);if(e!=null&&me)for(var m of me(e))r.indexOf(m)<0&&Ce.call(e,m)&&(a[m]=e[m]);return a};const Ee=e=>Array.from(e!=null?e:[]).filter(r=>r.type.startsWith("image/")),Re=e=>e.replace(/\r?\n/g," "),Tt=e=>{const{selection:r}=e;return r.empty&&r.from===Ne.atStart(e.doc).from},St=e=>{const r=new Set,a=m=>{var l;if(!m||typeof m!="object")return;const O=m;if(O.type==="image"){const E=(l=O.attrs)==null?void 0:l.src;typeof E=="string"&&r.add(E)}Array.isArray(O.content)&&O.content.forEach(a)};return a(e),r},ze=e=>{const r=typeof e=="string"?dt(e,xe()):e;return nt(it(r!=null?r:ye))},It=4e3,Rt=e=>{e.chain().focus().undo().run()},zt=e=>{e.chain().focus().redo().run()},Ot=e=>e.can().undo(),jt=e=>e.can().redo(),fe=e=>{e.preventDefault()},Ut=e=>{const r=e.getAttributes("link").href,a=window.prompt("URL do link",r||"https://");if(a===null)return;const m=e.chain().focus().extendMarkRange("link");if(a.trim()===""){m.unsetLink().run();return}const l=lt(a);if(!l){console.error("@medway-ui/core NoteEditor: rejected invalid link URL",a);return}m.setLink({href:l}).run()},Ht=[[{id:"bold",title:"Negrito (Ctrl/Cmd+B)",icon:ft,isActive:e=>e.isActive("bold"),run:e=>e.chain().focus().toggleMark("bold").run()},{id:"italic",title:"It\xE1lico (Ctrl/Cmd+I)",icon:pt,isActive:e=>e.isActive("italic"),run:e=>e.chain().focus().toggleMark("italic").run()},{id:"underline",title:"Sublinhado (Ctrl/Cmd+U)",icon:gt,isActive:e=>e.isActive("underline"),run:e=>e.chain().focus().toggleMark("underline").run()},{id:"strike",title:"Tachado (Ctrl/Cmd+Shift+S)",icon:ht,isActive:e=>e.isActive("strike"),run:e=>e.chain().focus().toggleMark("strike").run()},{id:"code",title:"C\xF3digo",icon:vt,isActive:e=>e.isActive("code"),run:e=>e.chain().focus().toggleMark("code").run()}],[{id:"heading2",title:"T\xEDtulo 2",icon:bt,isActive:e=>e.isActive("heading",{level:2}),run:e=>e.chain().focus().toggleNode("heading","paragraph",{level:2}).run()},{id:"heading3",title:"T\xEDtulo 3",icon:_t,isActive:e=>e.isActive("heading",{level:3}),run:e=>e.chain().focus().toggleNode("heading","paragraph",{level:3}).run()}],[{id:"bulletList",title:"Lista com marcadores",icon:wt,isActive:e=>e.isActive("bulletList"),run:e=>e.chain().focus().toggleList("bulletList","listItem").run()},{id:"orderedList",title:"Lista numerada",icon:yt,isActive:e=>e.isActive("orderedList"),run:e=>e.chain().focus().toggleList("orderedList","listItem").run()},{id:"blockquote",title:"Cita\xE7\xE3o",icon:Mt,isActive:e=>e.isActive("blockquote"),run:e=>e.chain().focus().toggleWrap("blockquote").run()},{id:"codeBlock",title:"Bloco de c\xF3digo",icon:xt,isActive:e=>e.isActive("codeBlock"),run:e=>e.chain().focus().toggleNode("codeBlock","paragraph").run()}],[{id:"link",title:"Inserir link",icon:Pt,isActive:e=>e.isActive("link"),run:e=>Ut(e)}],[{id:"undo",title:"Desfazer",icon:Et,isDisabled:e=>!Ot(e),run:e=>Rt(e)},{id:"redo",title:"Refazer",icon:kt,isDisabled:e=>!jt(e),run:e=>zt(e)}]],ke="mx-1 data-[orientation=vertical]:h-5",Oe=(e,r)=>r?e:e.filter(a=>a!=="image"),Bt=["max-w-none focus:outline-none","[&_.ProseMirror]:min-h-[8rem] [&_.ProseMirror]:outline-none","[&_.ProseMirror]:text-content-paragraph [&_.ProseMirror]:text-md [&_.ProseMirror]:leading-md","[&_.ProseMirror>*+*]:mt-3","[&_.ProseMirror_p]:my-0","[&_.ProseMirror_h1]:mt-4 [&_.ProseMirror_h1]:text-title-lg [&_.ProseMirror_h1]:font-bold [&_.ProseMirror_h1]:leading-title-lg [&_.ProseMirror_h1]:text-content-title","[&_.ProseMirror_h2]:mt-3 [&_.ProseMirror_h2]:text-title-md [&_.ProseMirror_h2]:font-bold [&_.ProseMirror_h2]:leading-title-md [&_.ProseMirror_h2]:text-content-title","[&_.ProseMirror_h3]:mt-3 [&_.ProseMirror_h3]:text-title-sm [&_.ProseMirror_h3]:font-semibold [&_.ProseMirror_h3]:leading-title-sm [&_.ProseMirror_h3]:text-content-title","[&_.ProseMirror>h1:first-child]:mt-0 [&_.ProseMirror>h2:first-child]:mt-0 [&_.ProseMirror>h3:first-child]:mt-0","[&_.ProseMirror_ul]:list-disc [&_.ProseMirror_ol]:list-decimal [&_.ProseMirror_ul]:pl-5 [&_.ProseMirror_ol]:pl-5","[&_.ProseMirror_li]:my-1 [&_.ProseMirror_li_p]:my-0","[&_.ProseMirror_ul[data-type=taskList]]:list-none [&_.ProseMirror_ul[data-type=taskList]]:pl-0","[&_.ProseMirror_ul[data-type=taskList]_li]:flex [&_.ProseMirror_ul[data-type=taskList]_li]:items-start [&_.ProseMirror_ul[data-type=taskList]_li]:gap-2","[&_.ProseMirror_ul[data-type=taskList]_li>label]:mt-0.5","[&_.ProseMirror_ul[data-type=taskList]_li[data-checked=true]>div>p]:text-gray-foreground-muted [&_.ProseMirror_ul[data-type=taskList]_li[data-checked=true]>div>p]:line-through","[&_.ProseMirror_blockquote]:border-l-2 [&_.ProseMirror_blockquote]:border-gray-stroke-muted [&_.ProseMirror_blockquote]:pl-3 [&_.ProseMirror_blockquote]:text-gray-foreground-muted","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-gray-background-soft [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-xs","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-gray-background-soft [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre_code]:bg-transparent [&_.ProseMirror_pre_code]:p-0","[&_.ProseMirror_hr]:my-4 [&_.ProseMirror_hr]:border-gray-stroke-muted","[&_.ProseMirror_a]:text-content-link [&_.ProseMirror_a]:underline","[&_.ProseMirror_img]:max-w-full [&_.ProseMirror_img]:rounded-md","[&_.ProseMirror_img.ProseMirror-selectednode]:outline [&_.ProseMirror_img.ProseMirror-selectednode]:outline-2 [&_.ProseMirror_img.ProseMirror-selectednode]:outline-offset-2 [&_.ProseMirror_img.ProseMirror-selectednode]:outline-gray-stroke","[&_.ProseMirror_p.is-empty]:before:content-[attr(data-placeholder)] [&_.ProseMirror_p.is-empty]:before:pointer-events-none [&_.ProseMirror_p.is-empty]:before:float-left [&_.ProseMirror_p.is-empty]:before:h-0 [&_.ProseMirror_p.is-empty]:before:text-gray-foreground-muted [&_.ProseMirror_p.is-empty]:before:opacity-50","[&_.ProseMirror_.medway-slash]:rounded [&_.ProseMirror_.medway-slash]:bg-gray-background-soft"].join(" "),Ft=["mb-1 block w-full resize-none overflow-hidden border-0 bg-transparent p-0","text-title-lg font-bold leading-title-lg text-content-title","focus:outline-none focus:ring-0","placeholder:text-gray-foreground-muted placeholder:opacity-50"].join(" "),Wt=(e,r)=>{const{selection:a}=e.state;return!e.isEditable||!(e.isFocused||r)||!(a instanceof we)||a.node.type.name!=="image"?null:{pos:a.from,width:Me(a.node.attrs.width)}},qt=[{label:"25%",title:"Pequena (25% da largura)",width:25},{label:"50%",title:"M\xE9dia (50% da largura)",width:50},{label:"75%",title:"Grande (75% da largura)",width:75},{label:"100%",title:"Largura total (100% da largura)",width:100}],Kt=42,je=e=>{var r;return{width:(r=e==null?void 0:e.offsetWidth)!=null?r:0,height:(e==null?void 0:e.offsetHeight)||Kt}},Gt=e=>{const r=e.parentElement;if(!r)return e.getBoundingClientRect().width||1;const a=window.getComputedStyle(r),m=r.clientWidth-parseFloat(a.paddingLeft||"0")-parseFloat(a.paddingRight||"0");return m>0?m:1},Jt=e=>{const r={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight};for(let a=e.parentElement;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const m=window.getComputedStyle(a);if(m.overflowX==="visible"&&m.overflowY==="visible")continue;const l=a.getBoundingClientRect();r.top=Math.max(r.top,l.top),r.left=Math.max(r.left,l.left),r.right=Math.min(r.right,l.right),r.bottom=Math.min(r.bottom,l.bottom)}return r},Ue=(e,r,a)=>e.chain().command(({tr:m})=>{const l=m.doc.nodeAt(r);return!l||l.type.name!=="image"?!1:(m.setNodeMarkup(r,void 0,Ie(Se({},l.attrs),{width:a})),m.setSelection(we.create(m.doc,r)),!0)}).run(),Xt=["nw","ne","sw","se"],pe=6,Yt={nw:"-left-1.5 -top-1.5 cursor-nwse-resize",ne:"-right-1.5 -top-1.5 cursor-nesw-resize",sw:"-bottom-1.5 -left-1.5 cursor-nesw-resize",se:"-bottom-1.5 -right-1.5 cursor-nwse-resize"},$t=(e,r)=>e.top===r.top&&e.left===r.left&&e.width===r.width&&e.height===r.height&&e.clip.top===r.clip.top&&e.clip.left===r.clip.left&&e.clip.right===r.clip.right&&e.clip.bottom===r.clip.bottom&&e.originTop===r.originTop&&e.originLeft===r.originLeft&&e.toolbarWidth===r.toolbarWidth&&e.toolbarHeight===r.toolbarHeight&&e.toolbar.side===r.toolbar.side&&e.toolbar.top===r.toolbar.top&&e.toolbar.left===r.toolbar.left,Vt=({editor:e,image:r,toolbarRef:a,onFocusLeave:m})=>{const[l,O]=q(null),[E,ee]=q(null),[w,te]=q(null),re=v(null),I=v(null),j=v(null),X=de(()=>{var n;return(n=e.view.dom.closest('[role="dialog"]'))!=null?n:document.body},[e]),U=A(()=>{const n=e.view.nodeDOM(r.pos);return n instanceof HTMLElement?n:null},[e,r.pos]),Y=A(()=>{var n;const u=U();if(!u){O(null);return}const f=u.getBoundingClientRect(),g=(n=re.current)==null?void 0:n.getBoundingClientRect(),b=Jt(u),d=je(a.current),H=I.current!==null,C=j.current===u;j.current=u,O(N=>{var k,x,J;const B={top:f.top,left:f.left,width:f.width,height:f.height,clip:b,originTop:(k=g==null?void 0:g.top)!=null?k:0,originLeft:(x=g==null?void 0:g.left)!=null?x:0,toolbarWidth:d.width,toolbarHeight:d.height,toolbar:mt({imageTop:f.top,imageLeft:f.left,imageHeight:f.height,clip:b,toolbarWidth:d.width,toolbarHeight:d.height,previousSide:C&&(J=N==null?void 0:N.toolbar.side)!=null?J:null,keepSide:H})};return N&&$t(N,B)?N:B})},[U,a]);be(()=>{Y();const n=U();let u=0;const f=()=>{u||(u=requestAnimationFrame(()=>{u=0,Y()}))},g=typeof ResizeObserver!="undefined"?new ResizeObserver(f):null;return n&&(g==null||g.observe(n)),g==null||g.observe(e.view.dom),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),e.on("transaction",f),()=>{g==null||g.disconnect(),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f),e.off("transaction",f),u&&cancelAnimationFrame(u)}},[e,U,Y,r.width]),be(()=>{if(!l||!a.current||I.current)return;const n=je(a.current);(n.width!==l.toolbarWidth||n.height!==l.toolbarHeight)&&Y()}),_(()=>()=>{var n;return(n=I.current)==null?void 0:n.cancel()},[]);const ge=n=>u=>{var f,g;const b=U();if(!b||u.button!==0)return;u.preventDefault(),u.stopPropagation(),(f=I.current)==null||f.cancel();const d=u.currentTarget,H=u.pointerId;d.setPointerCapture(H);const C=n==="nw"||n==="sw"?-1:1,N=u.clientX,k=b.getBoundingClientRect().width,x=Gt(b),J=b.style.width,B=(g=e.state.doc.nodeAt(r.pos))==null?void 0:g.attrs.src;let W=r.pos,T=!1,S=null;const le=({transaction:P})=>{const F=P.mapping.mapResult(W);F.deleted&&(T=!0),W=F.pos},ae=P=>{var F;const se=k+C*(P.clientX-N);S=(F=Me(se/x*100))!=null?F:at,b.style.width=`${S}%`,ee(S)},D=()=>{var P;d.removeEventListener("pointermove",ae),d.removeEventListener("pointerup",Z),d.removeEventListener("pointercancel",D),d.removeEventListener("lostpointercapture",D),e.off("transaction",le),(P=d.hasPointerCapture)!=null&&P.call(d,H)&&d.releasePointerCapture(H),b.style.width=J,I.current=null,ee(null),te(null)},Z=()=>{if(D(),S===null||T)return;const P=e.state.doc.nodeAt(W);!P||P.type.name!=="image"||P.attrs.src!==B||S!==Me(P.attrs.width)&&Ue(e,W,S)};e.on("transaction",le),d.addEventListener("pointermove",ae),d.addEventListener("pointerup",Z),d.addEventListener("pointercancel",D),d.addEventListener("lostpointercapture",D),I.current={cancel:D},te(n)},oe=n=>{n!==r.width&&Ue(e,r.pos,n)},K=n=>{var u,f,g,b;const d=Array.from(n.currentTarget.querySelectorAll("button")),H=d.indexOf(document.activeElement);switch(n.key){case"ArrowRight":case"ArrowLeft":{n.preventDefault();const C=n.key==="ArrowRight"?1:-1;(u=d[(H+C+d.length)%d.length])==null||u.focus();return}case"Home":n.preventDefault(),(f=d[0])==null||f.focus();return;case"End":n.preventDefault(),(g=d[d.length-1])==null||g.focus();return;case"Escape":n.preventDefault(),e.view.focus();return;case"Tab":{if(n.preventDefault(),n.shiftKey){e.view.focus();return}const C=e.state.doc.nodeAt(r.pos),N=r.pos+((b=C==null?void 0:C.nodeSize)!=null?b:1);e.chain().focus().command(({tr:k})=>(k.setSelection(Ne.near(k.doc.resolve(N))),!0)).run();return}default:return}},ne=h("span",{ref:re,"aria-hidden":!0,className:"pointer-events-none fixed left-0 top-0 h-0 w-0"}),$=l!==null&&(l.width>0||l.height>0)&&l.top<l.clip.bottom&&l.top+l.height>l.clip.top&&l.left<l.clip.right&&l.left+l.width>l.clip.left;if(!l||!$)return _e(ne,X);const{clip:G}=l,V=E!=null?E:r.width,he=n=>{const u=n==="nw"||n==="sw"?l.left-pe:l.left+l.width+pe,f=n==="nw"||n==="ne"?l.top-pe:l.top+l.height+pe;return u>=G.left&&u<=G.right&&f>=G.top&&f<=G.bottom},ie=n=>Q("flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-stroke",n?"bg-primary-background-soft text-primary-foreground":"text-content-paragraph hover:bg-state-hover");return _e(z(Ye,{children:[ne,z("div",{ref:a,role:"toolbar","aria-label":"Tamanho da imagem",className:"pointer-events-auto fixed z-50 flex items-center gap-0.5 rounded-md border bg-surface-elevated p-1 shadow-lg",style:{left:l.toolbar.left-l.originLeft,top:l.toolbar.top-l.originTop},onMouseDown:fe,onKeyDown:K,onBlur:n=>{n.currentTarget.contains(n.relatedTarget)||m(n.relatedTarget)},children:[qt.map(n=>{const u=V===n.width;return h("button",{type:"button",title:n.title,"aria-label":n.title,"aria-pressed":u,onClick:()=>oe(n.width),className:ie(u),children:n.label},n.width)}),h(Pe,{orientation:"vertical",className:ke}),h("button",{type:"button",title:"Tamanho original","aria-label":"Tamanho original","aria-pressed":V===null,onClick:()=>oe(null),className:ie(V===null),children:"Original"})]}),z("div",{"aria-hidden":!0,className:"pointer-events-none fixed z-50",style:{left:l.left-l.originLeft,top:l.top-l.originTop,width:l.width,height:l.height},children:[Xt.filter(n=>n===w||he(n)).map(n=>h("span",{onPointerDown:ge(n),onMouseDown:fe,className:Q("pointer-events-auto absolute h-3 w-3 touch-none rounded-full border-2 border-surface-elevated bg-primary-stroke shadow-sm","before:absolute before:-inset-2 before:content-['']",Yt[n])},n)),E!==null?z("span",{className:"absolute bottom-2 right-2 rounded bg-gray-foreground px-1.5 py-0.5 text-xs font-medium text-surface-elevated",children:[E,"%"]}):null]})]}),X)},He=$e((e,r)=>{var a=e,{document:m,initialTitle:l,titlePlaceholder:O="T\xEDtulo",showTitle:E=!0,onChange:ee,editable:w=!0,autofocus:te=!1,extraExtensions:re,toolbar:I=!1,onImageUpload:j,onImageRemoved:X,imageDeleteGraceMs:U=It,className:Y}=a,ge=Ct(a,["document","initialTitle","titlePlaceholder","showTitle","onChange","editable","autofocus","extraExtensions","toolbar","onImageUpload","onImageRemoved","imageDeleteGraceMs","className"]);const oe=de(()=>ze(m),[]),[K,ne]=q(()=>Re(l!=null?l:"")),$=v(null),G=v(E&&!!te&&K.length===0),V=A(()=>{const t=$.current;t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)},[]);be(()=>{V()},[K,V]),_(()=>{var t;G.current&&((t=$.current)==null||t.focus())},[]);const he=A(t=>{ne(Re(t.target.value))},[]),ie=A(()=>{const t=$.current;if(!t)return;t.focus();const o=t.value.length;t.setSelectionRange(o,o)},[]),n=v(E);_(()=>{n.current=E},[E]);const[u,f]=q(tt),[g,b]=q(0),d=v(null);d.current||(d.current=st(f));const H=d.current,C=v(u),N=v(g);_(()=>{C.current=u},[u]),_(()=>{N.current=g},[g]),_(()=>{b(0)},[u.query,u.active]);const k=v(j),x=v(X),J=v(U);_(()=>{k.current=j},[j]),_(()=>{x.current=X},[X]),_(()=>{J.current=U},[U]);const B=v(new Set),W=v(new Set),T=v(new Map),S=v(!0),le=A(t=>{const o=T.current.get(t);o&&clearTimeout(o);const s=setTimeout(()=>{var c;T.current.delete(t),B.current.delete(t),(c=x.current)==null||c.call(x,t)},J.current);T.current.set(t,s)},[]),ae=A(t=>{const o=T.current.get(t);o&&(clearTimeout(o),T.current.delete(t))},[]);_(()=>{S.current=!0;const t=T.current;return()=>{S.current=!1,t.forEach(o=>clearTimeout(o)),t.clear()}},[]);const D=v(w),Z=v(null);D.current=w;const P=v(null),F=A(()=>{var t;D.current&&((t=P.current)==null||t.click())},[]),[se,Le]=q(0),ve=v(()=>{}),Be=de(()=>xe({extra:[...re!=null?re:[],H.extension]}),[]),Fe=de(()=>({attributes:{role:"textbox","aria-label":"Conte\xFAdo da anota\xE7\xE3o","aria-multiline":"true","aria-readonly":w?"false":"true"},handleKeyDown:(t,o)=>{var s,c,p;const y=C.current;if(n.current&&o.key==="Backspace"&&!y.active&&Tt(t.state))return o.preventDefault(),ie(),!0;const{selection:R}=t.state;if(o.key==="Tab"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!y.active&&D.current&&R instanceof we&&R.node.type.name==="image"){const M=(s=Z.current)==null?void 0:s.querySelector("button");if(M)return o.preventDefault(),M.focus(),!0}const L=Oe(y.commandIds,!!k.current);if(!y.active||L.length===0)return!1;switch(o.key){case"ArrowDown":return o.preventDefault(),b(M=>(M+1)%L.length),!0;case"ArrowUp":return o.preventDefault(),b(M=>(M-1+L.length)%L.length),!0;case"Enter":case"Tab":{if(!D.current)return!1;o.preventDefault();const M=(c=L[N.current])!=null?c:L[0];return(p=d.current)==null||p.run(M),M==="image"&&F(),!0}default:return!1}},handleDrop:(t,o)=>{var s,c;const p=Ee((s=o.dataTransfer)==null?void 0:s.files);if(!p.length||!k.current)return!1;o.preventDefault();const y=(c=t.posAtCoords({left:o.clientX,top:o.clientY}))==null?void 0:c.pos;return p.forEach(R=>ve.current(R,y)),!0},handlePaste:(t,o)=>{var s;const c=Ee((s=o.clipboardData)==null?void 0:s.files);return!c.length||!k.current?!1:(o.preventDefault(),c.forEach(p=>ve.current(p)),!0)}}),[w]),i=Qe({extensions:Be,content:oe,editable:w,autofocus:G.current?!1:te,editorProps:Fe,onUpdate:({editor:t})=>{const o=t.getJSON();ee==null||ee(o);const s=St(o);W.current.forEach(c=>{!s.has(c)&&B.current.has(c)&&le(c)}),s.forEach(c=>ae(c)),W.current=s}}),We=A(t=>{t.key!=="Enter"||t.nativeEvent.isComposing||(t.preventDefault(),i==null||i.commands.focus("start"))},[i]);_(()=>{if(!i)return;const t=ct(i.schema);t.length&&process.env.NODE_ENV!=="production"&&console.error(`@medway-ui/core NoteEditor: schema is missing ${t.join(", ")}`)},[i]),_(()=>{i&&i.isEditable!==w&&i.setEditable(w)},[i,w]);const ce=A((t,o)=>{const s=k.current;!s||!i||!i.isEditable||(Le(c=>c+1),s(t).then(c=>{var p,y,R;if(!S.current||i.isDestroyed){(p=x.current)==null||p.call(x,c);return}if(!D.current){(y=x.current)==null||y.call(x,c);return}const L=rt(c);if(!L){console.error("@medway-ui/core NoteEditor: rejected invalid image URL",c),(R=x.current)==null||R.call(x,c);return}B.current.add(L);const M=i.chain().focus();typeof o=="number"?M.insertContentAt(o,{type:"image",attrs:{src:L,alt:t.name}}).run():M.setImage({src:L,alt:t.name}).run()}).catch(c=>{console.error("@medway-ui/core NoteEditor: onImageUpload failed",c)}).finally(()=>{S.current&&Le(c=>c-1)}))},[i]);_(()=>{ve.current=ce},[ce]);const qe=A(t=>{const o=Ee(t.target.files);t.target.value="",o.forEach(s=>ce(s))},[ce]);_(()=>{if(!i)return;let t=0;const o=()=>{t||(t=requestAnimationFrame(()=>{var s;t=0,(s=d.current)==null||s.refreshCaret()}))};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o),t&&cancelAnimationFrame(t)}},[i]);const[,Ke]=Ve(t=>t+1,0);_(()=>{if(!i||!I)return;const t=()=>Ke();return i.on("transaction",t),i.on("selectionUpdate",t),()=>{i.off("transaction",t),i.off("selectionUpdate",t)}},[i,I]);const[Ae,Ge]=q(null),ue=A(t=>{if(!i)return;const o=Z.current,s=t instanceof Node&&!!(o!=null&&o.contains(t)),c=Wt(i,s);Ge(p=>(p==null?void 0:p.pos)===(c==null?void 0:c.pos)&&(p==null?void 0:p.width)===(c==null?void 0:c.width)?p:c)},[i]);_(()=>{if(!i)return;const t=({transaction:o}={})=>{var s,c;const p=o==null?void 0:o.getMeta("blur");ue(p?(c=(s=p.event)==null?void 0:s.relatedTarget)!=null?c:null:document.activeElement)};return t(),i.on("transaction",t),()=>{i.off("transaction",t)}},[i,ue]);const Je=A(t=>{t instanceof Node&&i!=null&&i.view.dom.contains(t)||ue(t)},[i,ue]);return Ze(r,()=>({editor:i!=null?i:null,focus:t=>i==null?void 0:i.commands.focus(t!=null?t:"end"),blur:()=>i==null?void 0:i.commands.blur(),getDocument:()=>{var t;return(t=i==null?void 0:i.getJSON())!=null?t:ye},getSaveData:()=>{var t;const o=(t=i==null?void 0:i.getJSON())!=null?t:ye,s=i?ut(o,xe()):"";return{title:K,json:o,html:s}},setDocument:(t,o)=>{i&&(T.current.forEach(s=>clearTimeout(s)),T.current.clear(),B.current=new Set,W.current=new Set,i.commands.setContent(ze(t),{emitUpdate:!1}),o!=null&&o.focus&&i.commands.focus("end"))}}),[i,K]),z("div",Ie(Se({className:Q(Bt,Y)},ge),{children:[I&&i&&z("div",{role:"toolbar","aria-label":"Formata\xE7\xE3o",className:"sticky top-0 z-10 mb-2 flex flex-wrap items-center gap-0.5 border-b border-gray-stroke-muted bg-surface-elevated pb-2",children:[Ht.map((t,o)=>z("div",{className:"flex items-center gap-0.5",children:[o>0?h(Pe,{orientation:"vertical",className:ke}):null,t.map(s=>{var c,p,y,R;const L=s.icon,M=(p=(c=s.isActive)==null?void 0:c.call(s,i))!=null?p:!1,Xe=!w||((R=(y=s.isDisabled)==null?void 0:y.call(s,i))!=null?R:!1);return h("button",{type:"button",title:s.title,"aria-label":s.title,"aria-pressed":s.isActive?M:void 0,disabled:Xe,onMouseDown:fe,onClick:()=>{i.isEditable&&s.run(i)},className:Q("flex h-8 w-8 items-center justify-center rounded-md transition-colors","disabled:cursor-not-allowed disabled:opacity-40",M?"bg-primary-background-soft text-primary-foreground":"text-content-paragraph hover:bg-state-hover"),children:h(L,{size:16})},s.id)})]},o)),j?z("div",{className:"flex items-center gap-0.5",children:[h(Pe,{orientation:"vertical",className:ke}),h("button",{type:"button",title:"Inserir imagem","aria-label":"Inserir imagem",disabled:!w||se>0,onMouseDown:fe,onClick:F,className:Q("flex h-8 w-8 items-center justify-center rounded-md transition-colors","disabled:cursor-not-allowed disabled:opacity-40","text-content-paragraph hover:bg-state-hover"),children:h(Lt,{size:16})}),se>0&&z("span",{className:"ml-2 flex items-center gap-1.5 text-xs text-content-paragraph",children:[h("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-primary-stroke border-t-transparent"}),"enviando imagem\u2026"]})]}):null]}),E?h("textarea",{ref:$,rows:1,value:K,onChange:he,onKeyDown:We,placeholder:O,"aria-label":"T\xEDtulo da anota\xE7\xE3o",readOnly:!w,className:Ft}):null,j?h("input",{ref:P,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:qe}):null,h(et,{editor:i}),i&&w&&Ae?h(Vt,{editor:i,image:Ae,toolbarRef:Z,onFocusLeave:Je}):null,w&&u.active&&u.caret?_e(h("div",{role:"listbox","aria-label":"Comandos",className:"fixed z-50 max-h-72 w-64 overflow-auto rounded-md border bg-surface-elevated p-1 text-sm shadow-lg",style:{left:u.caret.x,top:u.caret.y+u.caret.height+6},children:(()=>{const t=Oe(u.commandIds,!!j);return t.length===0?h("div",{className:"px-3 py-2 text-gray-foreground-muted",children:"Nenhum resultado"}):t.map((o,s)=>{const c=ot(o);return c?z("button",{type:"button",role:"option","aria-selected":s===g,className:Q("flex w-full cursor-pointer flex-col items-start gap-0.5 rounded-sm px-3 py-1.5 text-left font-medium text-gray-foreground",s===g&&"bg-secondary-background-soft-emphasis"),onMouseEnter:()=>b(s),onMouseDown:p=>{var y;p.preventDefault(),(y=d.current)==null||y.run(o),o==="image"&&F()},children:[h("span",{className:"font-medium",children:c.label}),h("span",{className:"text-xs text-gray-foreground-muted",children:c.description})]},o):null})})()}),document.body):null]}))});He.displayName="NoteEditor";export{He as NoteEditor};
3
+ import{jsx as m,jsxs as C,Fragment as Me}from"react/jsx-runtime";import{memo as mt,useRef as _,useState as W,useCallback as M,useLayoutEffect as de,useMemo as fe,useEffect as k,Fragment as Re,forwardRef as pt,useReducer as gt,useImperativeHandle as ht}from"react";import{createPortal as Pe}from"react-dom";import{useEditorState as bt,useEditor as vt,EditorContent as yt}from"@tiptap/react";import{NodeSelection as ve,Selection as Fe}from"@tiptap/pm/state";import{EMPTY_SLASH_STATE as _t,sanitizeLinkHref as wt,sanitizeImageSrc as xt,EMPTY_DOCUMENT as ke,getSlashCommand as Mt,toEditorContent as Pt,normalizeDocument as kt,sanitizeImageWidth as Ee,MIN_IMAGE_WIDTH as Et}from"@medway-ui/notes-core";import{createSlashCommand as Lt,buildExtensions as Le,assertSchemaContract as Dt,generateHTML as Ct,generateJSON as Nt}from"@medway-ui/notes-core/schema";import{getImageToolbarPlacement as At}from"../lib/image-toolbar-placement.mjs";import{cn as Y}from"../lib/utils.mjs";import{Loading as De}from"./Loading.mjs";import{Separator as Ce}from"./Separator.mjs";import{NoteEditorLinkDialog as Tt}from"./NoteEditorLinkDialog.mjs";import{TooltipProvider as St,Tooltip as It,TooltipTrigger as zt,TooltipContent as Ot}from"./Tooltip.mjs";import{DropdownMenu as Rt,DropdownMenuTrigger as Ft,DropdownMenuContent as Ht,DropdownMenuSeparator as Bt,DropdownMenuCheckboxItem as jt,DropdownMenuItem as Ut}from"./DropdownMenu.mjs";import{Bold as Wt,Italic as qt,Underline as Kt,Strikethrough as Gt,Code as Xt,HeadingH2 as Yt,HeadingH3 as $t,ListUnordered as Jt,ListOrdered as Vt,DoubleQuotesL as Qt,WindowCodeBlock as Zt,Link as er,ArrowUndoUpLeft as tr,Redo as rr,Image as or,MoreVertical as nr}from"@medway-ui/icons";var ir=Object.defineProperty,lr=Object.defineProperties,ar=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,je=(e,t,l)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Ne=(e,t)=>{for(var l in t||(t={}))He.call(t,l)&&je(e,l,t[l]);if(ye)for(var l of ye(t))Be.call(t,l)&&je(e,l,t[l]);return e},Ae=(e,t)=>lr(e,ar(t)),sr=(e,t)=>{var l={};for(var f in e)He.call(e,f)&&t.indexOf(f)<0&&(l[f]=e[f]);if(e!=null&&ye)for(var f of ye(e))t.indexOf(f)<0&&Be.call(e,f)&&(l[f]=e[f]);return l};const Te=e=>Array.from(e!=null?e:[]).filter(t=>t.type.startsWith("image/")),Ue=e=>e.replace(/\r?\n/g," "),cr=e=>{const{selection:t}=e;return t.empty&&t.from===Fe.atStart(e.doc).from},ur=e=>{const t=new Set,l=f=>{var a;if(!f||typeof f!="object")return;const P=f;if(P.type==="image"){const y=(a=P.attrs)==null?void 0:a.src;typeof y=="string"&&t.add(y)}Array.isArray(P.content)&&P.content.forEach(l)};return l(e),t},We=e=>{const t=typeof e=="string"?Nt(e,Le()):e;return Pt(kt(t!=null?t:ke))},dr=4e3,fr=e=>{e.chain().focus().undo().run()},mr=e=>{e.chain().focus().redo().run()},pr=e=>e.can().undo(),gr=e=>e.can().redo(),Se=e=>{e.preventDefault()},hr=e=>{const{selection:t}=e.state;if(t instanceof ve)return{from:t.to,to:t.to};e.isActive("link")&&e.commands.extendMarkRange("link");const{from:l,to:f}=e.state.selection;return{from:l,to:f}},qe=[[{id:"bold",label:"Negrito",shortcut:"Ctrl/Cmd+B",icon:Wt,isActive:e=>e.isActive("bold"),run:e=>e.chain().focus().toggleMark("bold").run()},{id:"italic",label:"It\xE1lico",shortcut:"Ctrl/Cmd+I",icon:qt,isActive:e=>e.isActive("italic"),run:e=>e.chain().focus().toggleMark("italic").run()},{id:"underline",label:"Sublinhado",shortcut:"Ctrl/Cmd+U",icon:Kt,isActive:e=>e.isActive("underline"),run:e=>e.chain().focus().toggleMark("underline").run()},{id:"strike",label:"Tachado",shortcut:"Ctrl/Cmd+Shift+S",icon:Gt,isActive:e=>e.isActive("strike"),run:e=>e.chain().focus().toggleMark("strike").run()},{id:"code",label:"C\xF3digo",icon:Xt,isActive:e=>e.isActive("code"),run:e=>e.chain().focus().toggleMark("code").run()}],[{id:"heading2",label:"T\xEDtulo 2",icon:Yt,isActive:e=>e.isActive("heading",{level:2}),run:e=>e.chain().focus().toggleNode("heading","paragraph",{level:2}).run()},{id:"heading3",label:"T\xEDtulo 3",icon:$t,isActive:e=>e.isActive("heading",{level:3}),run:e=>e.chain().focus().toggleNode("heading","paragraph",{level:3}).run()}],[{id:"bulletList",label:"Lista com marcadores",icon:Jt,isActive:e=>e.isActive("bulletList"),run:e=>e.chain().focus().toggleList("bulletList","listItem").run()},{id:"orderedList",label:"Lista numerada",icon:Vt,isActive:e=>e.isActive("orderedList"),run:e=>e.chain().focus().toggleList("orderedList","listItem").run()},{id:"blockquote",label:"Cita\xE7\xE3o",icon:Qt,isActive:e=>e.isActive("blockquote"),run:e=>e.chain().focus().toggleWrap("blockquote").run()},{id:"codeBlock",label:"Bloco de c\xF3digo",icon:Zt,isActive:e=>e.isActive("codeBlock"),run:e=>e.chain().focus().toggleNode("codeBlock","paragraph").run()}],[{id:"link",label:"Inserir link",shortcut:"Ctrl/Cmd+K",icon:er,isActive:e=>e.isActive("link"),run:(e,t)=>t.openLinkDialog()}],[{id:"undo",label:"Desfazer",icon:tr,isDisabled:e=>!pr(e),run:e=>fr(e)},{id:"redo",label:"Refazer",icon:rr,isDisabled:e=>!gr(e),run:e=>mr(e)}]],br="mx-1 data-[orientation=vertical]:h-5",Ke=1,vr=.5,Ge="shrink-0 data-[orientation=vertical]:h-5",Xe=e=>Y("flex size-10 shrink-0 items-center justify-center rounded-pill transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-foreground","disabled:pointer-events-none disabled:opacity-40",e?"bg-primary-background-soft text-primary-foreground":"text-content-title hover:bg-state-hover aria-expanded:bg-state-hover dark:hover:bg-state-focus dark:aria-expanded:bg-state-focus"),Ye=e=>Y("gap-3 rounded-md py-2.5 pl-3 text-md text-content-title",e&&"bg-primary-background-soft text-primary-foreground"),_e=qe.flatMap((e,t)=>e.map(l=>Ae(Ne({},l),{group:t}))),yr=e=>e?["Control","Meta"].map(t=>e.replace("Ctrl/Cmd",t)).join(" "):void 0,_r=(e,t,l)=>{var f;if(e.clientWidth===0)return null;const a=getComputedStyle(e),P=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0),y=(f=t==null?void 0:t.getBoundingClientRect().width)!=null?f:0;return y===0?null:{available:e.clientWidth-P,item:y,gap:parseFloat(a.columnGap)||0,status:l!=null&&l.textContent?l.getBoundingClientRect().width:0}},wr=(e,t)=>e===t||e!==null&&t!==null&&e.available===t.available&&e.item===t.item&&e.gap===t.gap&&e.status===t.status,$e=(e,t,{item:l,gap:f})=>{let a=0,P=0;const y=N=>{a+=N,P+=1};return e.forEach((N,x)=>{x>0&&N.group!==e[x-1].group&&y(Ke),y(l)}),t&&(e.length>0&&y(Ke),y(l)),a+Math.max(0,P-1)*f},xr=(e,t)=>{const l=t.available-(t.status>0?t.status+t.gap:0)+vr;if($e(e,!1,t)<=l)return e.length;let f=e.length-1;for(;f>0&&$e(e.slice(0,f),!0,t)>l;)f-=1;return f},Je=({label:e,disabled:t,children:l})=>C(It,{children:[m(zt,{asChild:!0,children:m("span",{className:Y("flex shrink-0",t&&"cursor-not-allowed"),children:l})}),m(Ot,{sideOffset:4,children:e})]}),Mr=mt(function({editor:e,editable:t,onInsertImage:l,isUploadingImage:f,onOpenLinkDialog:a}){const P=_(null),y=_(null),N=_(null),[x,re]=W(null),Q=bt({editor:e,selector:({editor:c})=>({active:Object.fromEntries(_e.map(p=>{var n,u;return[p.id,(u=(n=p.isActive)==null?void 0:n.call(p,c))!=null?u:!1]})),disabled:Object.fromEntries(_e.map(p=>{var n,u;return[p.id,(u=(n=p.isDisabled)==null?void 0:n.call(p,c))!=null?u:!1]}))})}),E=M(()=>{const c=P.current;if(!c)return;const p=_r(c,y.current,N.current);re(n=>wr(n,p)?n:p)},[]);de(()=>{const c=P.current;if(!c||(E(),typeof ResizeObserver=="undefined"))return;const p=new ResizeObserver(E);return p.observe(c),y.current&&p.observe(y.current),N.current&&p.observe(N.current),()=>p.disconnect()},[E,l]),de(E,[E,f]);const A=fe(()=>l?[..._e,{id:"image",label:"Inserir imagem",icon:or,group:qe.length,busy:f,run:()=>l()}]:_e,[l,f]),$=x===null?A.length:xr(A,x),S=A.slice(0,$),q=A.slice($),oe=q.length>0,ne=c=>{var p;return(p=Q.active[c.id])!=null?p:!1},F=c=>{var p;return!t||(c.id==="image"?f:(p=Q.disabled[c.id])!=null?p:!1)},ie=c=>{e.isEditable&&c.run(e,{openLinkDialog:a})},[K,G]=W(!1),X=_(!1);return k(()=>{if(oe||!K)return;G(!1);const c=document.activeElement;(!c||c===document.body)&&e.isEditable&&e.commands.focus()},[e,oe,K]),m(St,{delayDuration:300,children:C("div",{ref:P,role:"toolbar","aria-label":"Formata\xE7\xE3o",className:"sticky top-0 z-10 mb-6 flex w-full items-center gap-2 overflow-hidden rounded-lg border border-gray-stroke-muted bg-surface-elevated px-2 py-1",children:[m("span",{ref:y,"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 size-10"}),S.map((c,p)=>{const n=c.icon,u=ne(c),b=F(c),v=c.shortcut?`${c.label} (${c.shortcut})`:c.label,w=p>0&&c.group!==S[p-1].group;return C(Re,{children:[w?m(Ce,{orientation:"vertical",className:Ge}):null,m(Je,{label:v,disabled:b,children:m("button",{type:"button","aria-label":c.label,"aria-keyshortcuts":yr(c.shortcut),"aria-pressed":c.isActive?u:void 0,"aria-busy":c.busy||void 0,disabled:b,onMouseDown:Se,onClick:()=>ie(c),className:Xe(u),children:c.busy?m(De,{size:16,className:"shrink-0"}):m(n,{size:20,className:"shrink-0"})})})]},c.id)}),oe?C(Me,{children:[S.length>0?m(Ce,{orientation:"vertical",className:Ge}):null,C(Rt,{modal:!1,open:K,onOpenChange:G,children:[m(Je,{label:"Mais op\xE7\xF5es",disabled:!t,children:m(Ft,{asChild:!0,children:m("button",{type:"button","aria-label":"Mais op\xE7\xF5es",disabled:!t,className:Xe(!1),children:m(nr,{size:20,className:"shrink-0"})})})}),m(Ht,{align:"end",className:"min-w-[12rem] rounded-lg p-2",onCloseAutoFocus:c=>{const p=X.current;if(X.current=!1,!p)return;c.preventDefault();const n=document.activeElement;n!=null&&n.closest('[role="dialog"]')||!e.isFocused&&e.isEditable&&e.commands.focus()},children:q.map((c,p)=>{const n=c.icon,u=ne(c),b=p>0&&c.group!==q[p-1].group,v=c.busy?m(De,{size:16,className:"size-4"}):m(n,{size:20,className:"size-5"}),w=()=>{X.current=!0,ie(c)};return C(Re,{children:[b?m(Bt,{className:"-mx-2"}):null,c.isActive?C(jt,{checked:u,disabled:F(c),onSelect:w,className:Y(Ye(u),"pr-9"),children:[v,c.label]}):C(Ut,{disabled:F(c),onSelect:w,className:Y(Ye(!1),"pr-3"),children:[v,c.label]})]},c.id)})})]})]}):null,l?m("span",{ref:N,role:"status",className:Y("flex shrink-0 items-center gap-1.5 whitespace-nowrap text-xs text-content-paragraph",f?"ml-auto":"sr-only"),children:f?C(Me,{children:[m(De,{size:12,className:"shrink-0 text-primary-stroke"}),"enviando imagem\u2026"]}):null}):null]})})}),Ve=(e,t)=>t?e:e.filter(l=>l!=="image"),Pr=["max-w-none focus:outline-none","[&_.ProseMirror]:min-h-[8rem] [&_.ProseMirror]:outline-none","[&_.ProseMirror]:text-gray-foreground [&_.ProseMirror]:text-md [&_.ProseMirror]:font-regular [&_.ProseMirror]:leading-md","[&_.ProseMirror>*+*]:mt-3","[&_.ProseMirror_p]:my-0","[&_.ProseMirror_h1]:mt-4 [&_.ProseMirror_h1]:text-title-xs [&_.ProseMirror_h1]:font-semibold [&_.ProseMirror_h1]:leading-lg [&_.ProseMirror_h1]:text-gray-foreground","[&_.ProseMirror_h2]:mt-3 [&_.ProseMirror_h2]:text-lg [&_.ProseMirror_h2]:font-semibold [&_.ProseMirror_h2]:leading-lg [&_.ProseMirror_h2]:text-gray-foreground","[&_.ProseMirror_h3]:mt-3 [&_.ProseMirror_h3]:text-md [&_.ProseMirror_h3]:font-semibold [&_.ProseMirror_h3]:leading-lg [&_.ProseMirror_h3]:text-gray-foreground","[&_.ProseMirror>h1:first-child]:mt-0 [&_.ProseMirror>h2:first-child]:mt-0 [&_.ProseMirror>h3:first-child]:mt-0","[&_.ProseMirror_ul]:list-disc [&_.ProseMirror_ol]:list-decimal [&_.ProseMirror_ul]:pl-5 [&_.ProseMirror_ol]:pl-5","[&_.ProseMirror_li]:my-1 [&_.ProseMirror_li_p]:my-0","[&_.ProseMirror_ul[data-type=taskList]]:list-none [&_.ProseMirror_ul[data-type=taskList]]:pl-0","[&_.ProseMirror_ul[data-type=taskList]_li]:flex [&_.ProseMirror_ul[data-type=taskList]_li]:items-start [&_.ProseMirror_ul[data-type=taskList]_li]:gap-2","[&_.ProseMirror_ul[data-type=taskList]_li>label]:mt-0.5","[&_.ProseMirror_ul[data-type=taskList]_li[data-checked=true]>div>p]:text-gray-foreground-muted [&_.ProseMirror_ul[data-type=taskList]_li[data-checked=true]>div>p]:line-through","[&_.ProseMirror_blockquote]:border-l-2 [&_.ProseMirror_blockquote]:border-gray-stroke-muted [&_.ProseMirror_blockquote]:pl-3 [&_.ProseMirror_blockquote]:text-gray-foreground-muted","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-gray-background-soft [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-xs","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-gray-background-soft [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre_code]:bg-transparent [&_.ProseMirror_pre_code]:p-0","[&_.ProseMirror_hr]:my-4 [&_.ProseMirror_hr]:border-gray-stroke-muted","[&_.ProseMirror_a]:text-content-link [&_.ProseMirror_a]:underline","[&_.ProseMirror_img]:max-w-full [&_.ProseMirror_img]:rounded-md","[&_.ProseMirror_img.ProseMirror-selectednode]:outline [&_.ProseMirror_img.ProseMirror-selectednode]:outline-2 [&_.ProseMirror_img.ProseMirror-selectednode]:outline-offset-2 [&_.ProseMirror_img.ProseMirror-selectednode]:outline-gray-stroke","[&_.ProseMirror_p.is-empty]:before:content-[attr(data-placeholder)] [&_.ProseMirror_p.is-empty]:before:pointer-events-none [&_.ProseMirror_p.is-empty]:before:float-left [&_.ProseMirror_p.is-empty]:before:h-0 [&_.ProseMirror_p.is-empty]:before:text-gray-foreground-muted [&_.ProseMirror_p.is-empty]:before:opacity-50","[&_.ProseMirror_.medway-slash]:rounded [&_.ProseMirror_.medway-slash]:bg-gray-background-soft"].join(" "),kr=["mb-1 block w-full resize-none overflow-hidden border-0 bg-transparent p-0","text-title-xs font-bold leading-title-xs text-gray-foreground","focus:outline-none focus:ring-0","placeholder:text-gray-foreground-muted placeholder:opacity-50"].join(" "),Er=(e,t)=>{const{selection:l}=e.state;return!e.isEditable||!(e.isFocused||t)||!(l instanceof ve)||l.node.type.name!=="image"?null:{pos:l.from,width:Ee(l.node.attrs.width)}},Lr=[{label:"25%",title:"Pequena (25% da largura)",width:25},{label:"50%",title:"M\xE9dia (50% da largura)",width:50},{label:"75%",title:"Grande (75% da largura)",width:75},{label:"100%",title:"Largura total (100% da largura)",width:100}],Dr=42,Qe=e=>{var t;return{width:(t=e==null?void 0:e.offsetWidth)!=null?t:0,height:(e==null?void 0:e.offsetHeight)||Dr}},Cr=e=>{const t=e.parentElement;if(!t)return e.getBoundingClientRect().width||1;const l=window.getComputedStyle(t),f=t.clientWidth-parseFloat(l.paddingLeft||"0")-parseFloat(l.paddingRight||"0");return f>0?f:1},Nr=e=>{const t={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight};for(let l=e.parentElement;l&&l!==document.body&&l!==document.documentElement;l=l.parentElement){const f=window.getComputedStyle(l);if(f.overflowX==="visible"&&f.overflowY==="visible")continue;const a=l.getBoundingClientRect();t.top=Math.max(t.top,a.top),t.left=Math.max(t.left,a.left),t.right=Math.min(t.right,a.right),t.bottom=Math.min(t.bottom,a.bottom)}return t},Ze=(e,t,l)=>e.chain().command(({tr:f})=>{const a=f.doc.nodeAt(t);return!a||a.type.name!=="image"?!1:(f.setNodeMarkup(t,void 0,Ae(Ne({},a.attrs),{width:l})),f.setSelection(ve.create(f.doc,t)),!0)}).run(),Ar=["nw","ne","sw","se"],we=6,Tr={nw:"-left-1.5 -top-1.5 cursor-nwse-resize",ne:"-right-1.5 -top-1.5 cursor-nesw-resize",sw:"-bottom-1.5 -left-1.5 cursor-nesw-resize",se:"-bottom-1.5 -right-1.5 cursor-nwse-resize"},Sr=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height&&e.clip.top===t.clip.top&&e.clip.left===t.clip.left&&e.clip.right===t.clip.right&&e.clip.bottom===t.clip.bottom&&e.originTop===t.originTop&&e.originLeft===t.originLeft&&e.toolbarWidth===t.toolbarWidth&&e.toolbarHeight===t.toolbarHeight&&e.toolbar.side===t.toolbar.side&&e.toolbar.top===t.toolbar.top&&e.toolbar.left===t.toolbar.left,Ir=({editor:e,image:t,toolbarRef:l,onFocusLeave:f})=>{const[a,P]=W(null),[y,N]=W(null),[x,re]=W(null),Q=_(null),E=_(null),A=_(null),$=fe(()=>{var n;return(n=e.view.dom.closest('[role="dialog"]'))!=null?n:document.body},[e]),S=M(()=>{const n=e.view.nodeDOM(t.pos);return n instanceof HTMLElement?n:null},[e,t.pos]),q=M(()=>{var n;const u=S();if(!u){P(null);return}const b=u.getBoundingClientRect(),v=(n=Q.current)==null?void 0:n.getBoundingClientRect(),w=Nr(u),g=Qe(l.current),J=E.current!==null,H=A.current===u;A.current=u,P(O=>{var I,T,le;const V={top:b.top,left:b.left,width:b.width,height:b.height,clip:w,originTop:(I=v==null?void 0:v.top)!=null?I:0,originLeft:(T=v==null?void 0:v.left)!=null?T:0,toolbarWidth:g.width,toolbarHeight:g.height,toolbar:At({imageTop:b.top,imageLeft:b.left,imageHeight:b.height,clip:w,toolbarWidth:g.width,toolbarHeight:g.height,previousSide:H&&(le=O==null?void 0:O.toolbar.side)!=null?le:null,keepSide:J})};return O&&Sr(O,V)?O:V})},[S,l]);de(()=>{q();const n=S();let u=0;const b=()=>{u||(u=requestAnimationFrame(()=>{u=0,q()}))},v=typeof ResizeObserver!="undefined"?new ResizeObserver(b):null;return n&&(v==null||v.observe(n)),v==null||v.observe(e.view.dom),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),e.on("transaction",b),()=>{v==null||v.disconnect(),window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),e.off("transaction",b),u&&cancelAnimationFrame(u)}},[e,S,q,t.width]),de(()=>{if(!a||!l.current||E.current)return;const n=Qe(l.current);(n.width!==a.toolbarWidth||n.height!==a.toolbarHeight)&&q()}),k(()=>()=>{var n;return(n=E.current)==null?void 0:n.cancel()},[]);const oe=n=>u=>{var b,v;const w=S();if(!w||u.button!==0)return;u.preventDefault(),u.stopPropagation(),(b=E.current)==null||b.cancel();const g=u.currentTarget,J=u.pointerId;g.setPointerCapture(J);const H=n==="nw"||n==="sw"?-1:1,O=u.clientX,I=w.getBoundingClientRect().width,T=Cr(w),le=w.style.width,V=(v=e.state.doc.nodeAt(t.pos))==null?void 0:v.attrs.src;let Z=t.pos,B=!1,j=null;const me=({transaction:L})=>{const ee=L.mapping.mapResult(Z);ee.deleted&&(B=!0),Z=ee.pos},pe=L=>{var ee;const ce=I+H*(L.clientX-O);j=(ee=Ee(ce/T*100))!=null?ee:Et,w.style.width=`${j}%`,N(j)},z=()=>{var L;g.removeEventListener("pointermove",pe),g.removeEventListener("pointerup",se),g.removeEventListener("pointercancel",z),g.removeEventListener("lostpointercapture",z),e.off("transaction",me),(L=g.hasPointerCapture)!=null&&L.call(g,J)&&g.releasePointerCapture(J),w.style.width=le,E.current=null,N(null),re(null)},se=()=>{if(z(),j===null||B)return;const L=e.state.doc.nodeAt(Z);!L||L.type.name!=="image"||L.attrs.src!==V||j!==Ee(L.attrs.width)&&Ze(e,Z,j)};e.on("transaction",me),g.addEventListener("pointermove",pe),g.addEventListener("pointerup",se),g.addEventListener("pointercancel",z),g.addEventListener("lostpointercapture",z),E.current={cancel:z},re(n)},ne=n=>{n!==t.width&&Ze(e,t.pos,n)},F=n=>{var u,b,v,w;const g=Array.from(n.currentTarget.querySelectorAll("button")),J=g.indexOf(document.activeElement);switch(n.key){case"ArrowRight":case"ArrowLeft":{n.preventDefault();const H=n.key==="ArrowRight"?1:-1;(u=g[(J+H+g.length)%g.length])==null||u.focus();return}case"Home":n.preventDefault(),(b=g[0])==null||b.focus();return;case"End":n.preventDefault(),(v=g[g.length-1])==null||v.focus();return;case"Escape":n.preventDefault(),e.view.focus();return;case"Tab":{if(n.preventDefault(),n.shiftKey){e.view.focus();return}const H=e.state.doc.nodeAt(t.pos),O=t.pos+((w=H==null?void 0:H.nodeSize)!=null?w:1);e.chain().focus().command(({tr:I})=>(I.setSelection(Fe.near(I.doc.resolve(O))),!0)).run();return}default:return}},ie=m("span",{ref:Q,"aria-hidden":!0,className:"pointer-events-none fixed left-0 top-0 h-0 w-0"}),K=a!==null&&(a.width>0||a.height>0)&&a.top<a.clip.bottom&&a.top+a.height>a.clip.top&&a.left<a.clip.right&&a.left+a.width>a.clip.left;if(!a||!K)return Pe(ie,$);const{clip:G}=a,X=y!=null?y:t.width,c=n=>{const u=n==="nw"||n==="sw"?a.left-we:a.left+a.width+we,b=n==="nw"||n==="ne"?a.top-we:a.top+a.height+we;return u>=G.left&&u<=G.right&&b>=G.top&&b<=G.bottom},p=n=>Y("flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-stroke",n?"bg-primary-background-soft text-primary-foreground":"text-content-paragraph hover:bg-state-hover");return Pe(C(Me,{children:[ie,C("div",{ref:l,role:"toolbar","aria-label":"Tamanho da imagem",className:"pointer-events-auto fixed z-50 flex items-center gap-0.5 rounded-md border bg-surface-elevated p-1 shadow-lg",style:{left:a.toolbar.left-a.originLeft,top:a.toolbar.top-a.originTop},onMouseDown:Se,onKeyDown:F,onBlur:n=>{n.currentTarget.contains(n.relatedTarget)||f(n.relatedTarget)},children:[Lr.map(n=>{const u=X===n.width;return m("button",{type:"button",title:n.title,"aria-label":n.title,"aria-pressed":u,onClick:()=>ne(n.width),className:p(u),children:n.label},n.width)}),m(Ce,{orientation:"vertical",className:br}),m("button",{type:"button",title:"Tamanho original","aria-label":"Tamanho original","aria-pressed":X===null,onClick:()=>ne(null),className:p(X===null),children:"Original"})]}),C("div",{"aria-hidden":!0,className:"pointer-events-none fixed z-50",style:{left:a.left-a.originLeft,top:a.top-a.originTop,width:a.width,height:a.height},children:[Ar.filter(n=>n===x||c(n)).map(n=>m("span",{onPointerDown:oe(n),onMouseDown:Se,className:Y("pointer-events-auto absolute h-3 w-3 touch-none rounded-full border-2 border-surface-elevated bg-primary-stroke shadow-sm","before:absolute before:-inset-2 before:content-['']",Tr[n])},n)),y!==null?C("span",{className:"absolute bottom-2 right-2 rounded bg-gray-foreground px-1.5 py-0.5 text-xs font-medium text-surface-elevated",children:[y,"%"]}):null]})]}),$)},et=pt((e,t)=>{var l=e,{document:f,initialTitle:a,titlePlaceholder:P="T\xEDtulo",showTitle:y=!0,onChange:N,editable:x=!0,autofocus:re=!1,extraExtensions:Q,toolbar:E=!1,onImageUpload:A,onImageRemoved:$,imageDeleteGraceMs:S=dr,className:q}=l,oe=sr(l,["document","initialTitle","titlePlaceholder","showTitle","onChange","editable","autofocus","extraExtensions","toolbar","onImageUpload","onImageRemoved","imageDeleteGraceMs","className"]);const ne=fe(()=>We(f),[]),[F,ie]=W(()=>Ue(a!=null?a:"")),K=_(null),G=_(y&&!!re&&F.length===0),X=M(()=>{const r=K.current;r&&(r.style.height="auto",r.style.height=`${r.scrollHeight}px`)},[]);de(()=>{X()},[F,X]),k(()=>{var r;G.current&&((r=K.current)==null||r.focus())},[]);const c=M(r=>{ie(Ue(r.target.value))},[]),p=M(()=>{const r=K.current;if(!r)return;r.focus();const o=r.value.length;r.setSelectionRange(o,o)},[]),n=_(y);k(()=>{n.current=y},[y]);const[u,b]=W(_t),[v,w]=W(0),g=_(null);g.current||(g.current=Lt(b));const J=g.current,H=_(u),O=_(v);k(()=>{H.current=u},[u]),k(()=>{O.current=v},[v]),k(()=>{w(0)},[u.query,u.active]);const I=_(A),T=_($),le=_(S);k(()=>{I.current=A},[A]),k(()=>{T.current=$},[$]),k(()=>{le.current=S},[S]);const V=_(new Set),Z=_(new Set),B=_(new Map),j=_(!0),me=M(r=>{const o=B.current.get(r);o&&clearTimeout(o);const d=setTimeout(()=>{var s;B.current.delete(r),V.current.delete(r),(s=T.current)==null||s.call(T,r)},le.current);B.current.set(r,d)},[]),pe=M(r=>{const o=B.current.get(r);o&&(clearTimeout(o),B.current.delete(r))},[]);k(()=>{j.current=!0;const r=B.current;return()=>{j.current=!1,r.forEach(o=>clearTimeout(o)),r.clear()}},[]);const z=_(x),se=_(()=>{}),L=_(null);z.current=x;const ee=_(null),ce=M(()=>{var r;z.current&&((r=ee.current)==null||r.click())},[]),[tt,Ie]=W(0),xe=_(()=>{}),rt=fe(()=>Le({extra:[...Q!=null?Q:[],J.extension]}),[]),ot=fe(()=>({attributes:{role:"textbox","aria-label":"Conte\xFAdo da anota\xE7\xE3o","aria-multiline":"true","aria-readonly":x?"false":"true"},handleKeyDown:(r,o)=>{var d,s,h;const D=H.current;if((o.metaKey||o.ctrlKey)&&!o.shiftKey&&!o.altKey&&o.key.toLowerCase()==="k"&&z.current)return o.preventDefault(),se.current(),!0;if(n.current&&o.key==="Backspace"&&!D.active&&cr(r.state))return o.preventDefault(),p(),!0;const{selection:ae}=r.state;if(o.key==="Tab"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!D.active&&z.current&&ae instanceof ve&&ae.node.type.name==="image"){const R=(d=L.current)==null?void 0:d.querySelector("button");if(R)return o.preventDefault(),R.focus(),!0}const U=Ve(D.commandIds,!!I.current);if(!D.active||U.length===0)return!1;switch(o.key){case"ArrowDown":return o.preventDefault(),w(R=>(R+1)%U.length),!0;case"ArrowUp":return o.preventDefault(),w(R=>(R-1+U.length)%U.length),!0;case"Enter":case"Tab":{if(!z.current)return!1;o.preventDefault();const R=(s=U[O.current])!=null?s:U[0];return(h=g.current)==null||h.run(R),R==="image"&&ce(),!0}default:return!1}},handleDrop:(r,o)=>{var d,s;const h=Te((d=o.dataTransfer)==null?void 0:d.files);if(!h.length||!I.current)return!1;o.preventDefault();const D=(s=r.posAtCoords({left:o.clientX,top:o.clientY}))==null?void 0:s.pos;return h.forEach(ae=>xe.current(ae,D)),!0},handleDOMEvents:{click:(r,o)=>{var d;const s=o.target,h=(d=s==null?void 0:s.closest)==null?void 0:d.call(s,"a[href]");if(!h||!r.dom.contains(h)||(o.preventDefault(),o.button!==0||!r.state.selection.empty))return!1;const D=wt(h.getAttribute("href"));return D&&window.open(D,"_blank","noopener,noreferrer"),!1}},handlePaste:(r,o)=>{var d;const s=Te((d=o.clipboardData)==null?void 0:d.files);return!s.length||!I.current?!1:(o.preventDefault(),s.forEach(h=>xe.current(h)),!0)}}),[x]),i=vt({extensions:rt,content:ne,editable:x,autofocus:G.current?!1:re,editorProps:ot,onUpdate:({editor:r})=>{const o=r.getJSON();N==null||N(o);const d=ur(o);Z.current.forEach(s=>{!d.has(s)&&V.current.has(s)&&me(s)}),d.forEach(s=>pe(s)),Z.current=d}}),nt=M(r=>{r.key!=="Enter"||r.nativeEvent.isComposing||(r.preventDefault(),i==null||i.commands.focus("start"))},[i]);k(()=>{if(!i)return;const r=Dt(i.schema);r.length&&process.env.NODE_ENV!=="production"&&console.error(`@medway-ui/core NoteEditor: schema is missing ${r.join(", ")}`)},[i]),k(()=>{i&&i.isEditable!==x&&i.setEditable(x)},[i,x]);const ge=M((r,o)=>{const d=I.current;!d||!i||!i.isEditable||(Ie(s=>s+1),d(r).then(s=>{var h,D,ae;if(!j.current||i.isDestroyed){(h=T.current)==null||h.call(T,s);return}if(!z.current){(D=T.current)==null||D.call(T,s);return}const U=xt(s);if(!U){console.error("@medway-ui/core NoteEditor: rejected invalid image URL",s),(ae=T.current)==null||ae.call(T,s);return}V.current.add(U);const R=i.chain().focus();typeof o=="number"?R.insertContentAt(o,{type:"image",attrs:{src:U,alt:r.name}}).run():R.setImage({src:U,alt:r.name}).run()}).catch(s=>{console.error("@medway-ui/core NoteEditor: onImageUpload failed",s)}).finally(()=>{j.current&&Ie(s=>s-1)}))},[i]);k(()=>{xe.current=ge},[ge]);const it=M(r=>{const o=Te(r.target.files);r.target.value="",o.forEach(d=>ge(d))},[ge]);k(()=>{if(!i)return;let r=0;const o=()=>{r||(r=requestAnimationFrame(()=>{var d;r=0,(d=g.current)==null||d.refreshCaret()}))};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o),r&&cancelAnimationFrame(r)}},[i]);const[te,he]=W(null),ue=_(null),ze=M(()=>{var r;if(!i||!i.isEditable)return;const o=hr(i),d=(r=i.getAttributes("link").href)!=null?r:"";ue.current=o,he({range:o,text:i.state.doc.textBetween(o.from,o.to," "),href:d,isEditing:d!==""})},[i]);se.current=ze;const lt=M(()=>he(null),[]),at=M(({text:r,href:o})=>{if(!i||!te)return;const{from:d,to:s}=te.range;if(d!==s&&r===te.text)i.chain().setTextSelection({from:d,to:s}).setLink({href:o}).run(),ue.current={from:s,to:s};else{i.chain().insertContentAt({from:d,to:s},{type:"text",text:r,marks:[{type:"link",attrs:{href:o}}]}).run();const h=d+r.length;ue.current={from:h,to:h}}he(null)},[i,te]),st=M(()=>{!i||!te||(i.chain().setTextSelection(te.range).unsetLink().run(),he(null))},[i,te]),ct=M(()=>{const r=ue.current;if(ue.current=null,!i||i.isDestroyed)return;const o=i.chain();if((r?o.setTextSelection(r):o).focus().run(),r&&r.from===r.to){const{state:d}=i,s=d.selection.$from.marks();s.some(h=>h.type.name==="link")&&i.view.dispatch(d.tr.setStoredMarks(s.filter(h=>h.type.name!=="link")))}},[i]),[,ut]=gt(r=>r+1,0);k(()=>{if(!i||!E)return;const r=()=>ut();return i.on("transaction",r),i.on("selectionUpdate",r),()=>{i.off("transaction",r),i.off("selectionUpdate",r)}},[i,E]);const[Oe,dt]=W(null),be=M(r=>{if(!i)return;const o=L.current,d=r instanceof Node&&!!(o!=null&&o.contains(r)),s=Er(i,d);dt(h=>(h==null?void 0:h.pos)===(s==null?void 0:s.pos)&&(h==null?void 0:h.width)===(s==null?void 0:s.width)?h:s)},[i]);k(()=>{if(!i)return;const r=({transaction:o}={})=>{var d,s;const h=o==null?void 0:o.getMeta("blur");be(h?(s=(d=h.event)==null?void 0:d.relatedTarget)!=null?s:null:document.activeElement)};return r(),i.on("transaction",r),()=>{i.off("transaction",r)}},[i,be]);const ft=M(r=>{r instanceof Node&&i!=null&&i.view.dom.contains(r)||be(r)},[i,be]);return ht(t,()=>({editor:i!=null?i:null,focus:r=>i==null?void 0:i.commands.focus(r!=null?r:"end"),blur:()=>i==null?void 0:i.commands.blur(),getDocument:()=>{var r;return(r=i==null?void 0:i.getJSON())!=null?r:ke},getSaveData:()=>{var r;const o=(r=i==null?void 0:i.getJSON())!=null?r:ke,d=i?Ct(o,Le()):"";return{title:F,json:o,html:d}},setDocument:(r,o)=>{i&&(B.current.forEach(d=>clearTimeout(d)),B.current.clear(),V.current=new Set,Z.current=new Set,i.commands.setContent(We(r),{emitUpdate:!1}),o!=null&&o.focus&&i.commands.focus("end"))}}),[i,F]),C("div",Ae(Ne({className:Y(Pr,q)},oe),{children:[E&&i&&m(Mr,{editor:i,editable:x,onInsertImage:A?ce:void 0,isUploadingImage:tt>0,onOpenLinkDialog:ze}),y?m("textarea",{ref:K,rows:1,value:F,onChange:c,onKeyDown:nt,placeholder:P,"aria-label":"T\xEDtulo da anota\xE7\xE3o",readOnly:!x,className:kr}):null,A?m("input",{ref:ee,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:it}):null,m(yt,{editor:i}),i?m(Tt,{draft:te,onSave:at,onRemove:st,onCancel:lt,onClosed:ct}):null,i&&x&&Oe?m(Ir,{editor:i,image:Oe,toolbarRef:L,onFocusLeave:ft}):null,x&&u.active&&u.caret?Pe(m("div",{role:"listbox","aria-label":"Comandos",className:"fixed z-50 max-h-72 w-64 overflow-auto rounded-md border bg-surface-elevated p-1 text-sm shadow-lg",style:{left:u.caret.x,top:u.caret.y+u.caret.height+6},children:(()=>{const r=Ve(u.commandIds,!!A);return r.length===0?m("div",{className:"px-3 py-2 text-gray-foreground-muted",children:"Nenhum resultado"}):r.map((o,d)=>{const s=Mt(o);return s?C("button",{type:"button",role:"option","aria-selected":d===v,className:Y("flex w-full cursor-pointer flex-col items-start gap-0.5 rounded-sm px-3 py-1.5 text-left font-medium text-gray-foreground",d===v&&"bg-secondary-background-soft-emphasis"),onMouseEnter:()=>w(d),onMouseDown:h=>{var D;h.preventDefault(),(D=g.current)==null||D.run(o),o==="image"&&ce()},children:[m("span",{className:"font-medium",children:s.label}),m("span",{className:"text-xs text-gray-foreground-muted",children:s.description})]},o):null})})()}),document.body):null]}))});et.displayName="NoteEditor";export{et as NoteEditor};
4
4
  //# sourceMappingURL=NoteEditor.mjs.map
@@ -0,0 +1,36 @@
1
+ /** What the dialog opens with: the selected text and the link under it, if any. */
2
+ export type LinkDialogDraft = {
3
+ text: string;
4
+ href: string;
5
+ /** `true` when the selection already is a link: offers "Remover link". */
6
+ isEditing: boolean;
7
+ };
8
+ export type LinkDialogValue = {
9
+ text: string;
10
+ href: string;
11
+ };
12
+ /**
13
+ * Accepts what people type in Slack-like link fields: `medway.com.br`,
14
+ * `www.medway.com.br/aulas`, `ana@medway.com.br` and full URLs. Bare hosts
15
+ * get `https://`, bare e-mails get `mailto:`. Anything else with a scheme
16
+ * goes through `sanitizeLinkHref` as-is, so `javascript:`/`data:` stay out.
17
+ */
18
+ export declare const normalizeLinkInput: (value: string) => string | null;
19
+ type NoteEditorLinkDialogProps = {
20
+ /** `null` keeps the dialog closed. */
21
+ draft: LinkDialogDraft | null;
22
+ onSave: (value: LinkDialogValue) => void;
23
+ onRemove: () => void;
24
+ onCancel: () => void;
25
+ /** Runs once the dialog is gone: the editor takes focus back here. */
26
+ onClosed: () => void;
27
+ };
28
+ /**
29
+ * Slack-style "Adicionar link" dialog: a text field (prefilled with the
30
+ * selection) and a link field. Replaces `window.prompt`, which some hosts
31
+ * (Electron, sandboxed iframes) don't implement and which couldn't insert a
32
+ * link without a selection.
33
+ */
34
+ export declare function NoteEditorLinkDialog({ draft, onSave, onRemove, onCancel, onClosed, }: NoteEditorLinkDialogProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
36
+ //# sourceMappingURL=NoteEditorLinkDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoteEditorLinkDialog.d.ts","sourceRoot":"","sources":["../../src/components/NoteEditorLinkDialog.tsx"],"names":[],"mappings":"AAgBA,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAM7D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAe3D,CAAC;AAoGF,KAAK,yBAAyB,GAAG;IAC/B,sCAAsC;IACtC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,2CAiD3B"}
@@ -0,0 +1,36 @@
1
+ /** What the dialog opens with: the selected text and the link under it, if any. */
2
+ export type LinkDialogDraft = {
3
+ text: string;
4
+ href: string;
5
+ /** `true` when the selection already is a link: offers "Remover link". */
6
+ isEditing: boolean;
7
+ };
8
+ export type LinkDialogValue = {
9
+ text: string;
10
+ href: string;
11
+ };
12
+ /**
13
+ * Accepts what people type in Slack-like link fields: `medway.com.br`,
14
+ * `www.medway.com.br/aulas`, `ana@medway.com.br` and full URLs. Bare hosts
15
+ * get `https://`, bare e-mails get `mailto:`. Anything else with a scheme
16
+ * goes through `sanitizeLinkHref` as-is, so `javascript:`/`data:` stay out.
17
+ */
18
+ export declare const normalizeLinkInput: (value: string) => string | null;
19
+ type NoteEditorLinkDialogProps = {
20
+ /** `null` keeps the dialog closed. */
21
+ draft: LinkDialogDraft | null;
22
+ onSave: (value: LinkDialogValue) => void;
23
+ onRemove: () => void;
24
+ onCancel: () => void;
25
+ /** Runs once the dialog is gone: the editor takes focus back here. */
26
+ onClosed: () => void;
27
+ };
28
+ /**
29
+ * Slack-style "Adicionar link" dialog: a text field (prefilled with the
30
+ * selection) and a link field. Replaces `window.prompt`, which some hosts
31
+ * (Electron, sandboxed iframes) don't implement and which couldn't insert a
32
+ * link without a selection.
33
+ */
34
+ export declare function NoteEditorLinkDialog({ draft, onSave, onRemove, onCancel, onClosed, }: NoteEditorLinkDialogProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
36
+ //# sourceMappingURL=NoteEditorLinkDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoteEditorLinkDialog.d.ts","sourceRoot":"","sources":["../../src/components/NoteEditorLinkDialog.tsx"],"names":[],"mappings":"AAgBA,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAM7D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAe3D,CAAC;AAoGF,KAAK,yBAAyB,GAAG;IAC/B,sCAAsC;IACtC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,2CAiD3B"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ "use client";
3
+ "use strict";var e=require("react/jsx-runtime"),d=require("react"),h=require("@medway-ui/notes-core"),p=require("./Button.js"),f=require("./Dialog.js"),k=require("./Input.js"),j=require("./Label.js");const b=/^[^\s@/:]+@[^\s@/:]+\.[^\s@/:]+$/,C=/^[a-z][a-z0-9+.-]*:(?!\d)/i,g=t=>{const n=t.trim();if(!n||/\s/.test(n))return null;if(b.test(n))return h.sanitizeLinkHref(`mailto:${n}`);if(C.test(n))return h.sanitizeLinkHref(n);const o=h.sanitizeLinkHref(n.startsWith("//")?`https:${n}`:`https://${n}`);if(!o)return null;const{hostname:s}=new URL(o);return s.includes(".")||s==="localhost"?o:null};function L({draft:t,onSave:n,onRemove:o,onCancel:s}){const i=d.useId(),[u,m]=d.useState(t.text),[r,v]=d.useState(t.href),[l,c]=d.useState(!1);return e.jsxs("form",{onSubmit:a=>{a.preventDefault();const x=g(r);if(!x){c(!0);return}n({text:u.trim()?u:r.trim(),href:x})},noValidate:!0,children:[e.jsx(f.DialogHeader,{className:"pb-0",children:e.jsx(f.DialogTitle,{children:t.isEditing?"Editar link":"Adicionar link"})}),e.jsxs("div",{className:"flex flex-col gap-5 px-8 pt-6",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(j.Label,{htmlFor:`${i}-text`,className:"font-semibold",children:"Texto"}),e.jsx(k.Input,{id:`${i}-text`,"data-link-field":"text",size:"md",value:u,onChange:a=>m(a.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(j.Label,{htmlFor:`${i}-href`,className:"font-semibold",children:"Link"}),e.jsx(k.Input,{id:`${i}-href`,"data-link-field":"href",size:"md",value:r,invalid:l,"aria-invalid":l||void 0,"aria-describedby":l?`${i}-error`:void 0,onChange:a=>{v(a.target.value),c(!1)},inputMode:"url",autoComplete:"off",spellCheck:!1}),l?e.jsx("span",{id:`${i}-error`,role:"alert",className:"text-xs text-feedback-error-foreground",children:"Link inv\xE1lido. Use um endere\xE7o como medway.com.br"}):null]})]}),e.jsxs(f.DialogFooter,{className:"sm:items-center",children:[t.isEditing?e.jsx(p.Button,{variant:"error-basic",className:"sm:mr-auto",onClick:o,children:"Remover link"}):null,e.jsx(p.Button,{variant:"outlined",onClick:s,children:"Cancelar"}),e.jsx(p.Button,{type:"submit",disabled:r.trim()==="",children:"Salvar"})]})]})}function $({draft:t,onSave:n,onRemove:o,onCancel:s,onClosed:i}){var u;const m=d.useRef(null),[r,v]=d.useState(null);return t&&t!==(r==null?void 0:r.draft)&&v({draft:t,key:((u=r==null?void 0:r.key)!=null?u:0)+1}),e.jsx(f.Dialog,{open:t!==null,onOpenChange:l=>{l||s()},children:e.jsx(f.DialogContainer,{"aria-describedby":void 0,className:"sm:max-w-md",onOpenAutoFocus:l=>{var c,a;l.preventDefault();const x=t!=null&&t.text?"href":"text";(a=(c=m.current)==null?void 0:c.querySelector(`[data-link-field="${x}"]`))==null||a.focus()},onCloseAutoFocus:l=>{l.preventDefault(),i()},children:e.jsx("div",{ref:m,children:r?e.jsx(L,{draft:r.draft,onSave:n,onRemove:o,onCancel:s},r.key):null})})})}exports.NoteEditorLinkDialog=$,exports.normalizeLinkInput=g;
4
+ //# sourceMappingURL=NoteEditorLinkDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoteEditorLinkDialog.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ "use client";
3
+ import{jsx as e,jsxs as u}from"react/jsx-runtime";import{useRef as b,useState as h,useId as $}from"react";import{sanitizeLinkHref as p}from"@medway-ui/notes-core";import{Button as x}from"./Button.mjs";import{Dialog as N,DialogContainer as D,DialogHeader as S,DialogTitle as y,DialogFooter as L}from"./Dialog.mjs";import{Input as k}from"./Input.mjs";import{Label as g}from"./Label.mjs";const z=/^[^\s@/:]+@[^\s@/:]+\.[^\s@/:]+$/,E=/^[a-z][a-z0-9+.-]*:(?!\d)/i,C=t=>{const l=t.trim();if(!l||/\s/.test(l))return null;if(z.test(l))return p(`mailto:${l}`);if(E.test(l))return p(l);const o=p(l.startsWith("//")?`https:${l}`:`https://${l}`);if(!o)return null;const{hostname:s}=new URL(o);return s.includes(".")||s==="localhost"?o:null};function R({draft:t,onSave:l,onRemove:o,onCancel:s}){const a=$(),[d,m]=h(t.text),[n,v]=h(t.href),[r,c]=h(!1);return u("form",{onSubmit:i=>{i.preventDefault();const f=C(n);if(!f){c(!0);return}l({text:d.trim()?d:n.trim(),href:f})},noValidate:!0,children:[e(S,{className:"pb-0",children:e(y,{children:t.isEditing?"Editar link":"Adicionar link"})}),u("div",{className:"flex flex-col gap-5 px-8 pt-6",children:[u("div",{className:"flex flex-col gap-2",children:[e(g,{htmlFor:`${a}-text`,className:"font-semibold",children:"Texto"}),e(k,{id:`${a}-text`,"data-link-field":"text",size:"md",value:d,onChange:i=>m(i.target.value),autoComplete:"off"})]}),u("div",{className:"flex flex-col gap-2",children:[e(g,{htmlFor:`${a}-href`,className:"font-semibold",children:"Link"}),e(k,{id:`${a}-href`,"data-link-field":"href",size:"md",value:n,invalid:r,"aria-invalid":r||void 0,"aria-describedby":r?`${a}-error`:void 0,onChange:i=>{v(i.target.value),c(!1)},inputMode:"url",autoComplete:"off",spellCheck:!1}),r?e("span",{id:`${a}-error`,role:"alert",className:"text-xs text-feedback-error-foreground",children:"Link inv\xE1lido. Use um endere\xE7o como medway.com.br"}):null]})]}),u(L,{className:"sm:items-center",children:[t.isEditing?e(x,{variant:"error-basic",className:"sm:mr-auto",onClick:o,children:"Remover link"}):null,e(x,{variant:"outlined",onClick:s,children:"Cancelar"}),e(x,{type:"submit",disabled:n.trim()==="",children:"Salvar"})]})]})}function F({draft:t,onSave:l,onRemove:o,onCancel:s,onClosed:a}){var d;const m=b(null),[n,v]=h(null);return t&&t!==(n==null?void 0:n.draft)&&v({draft:t,key:((d=n==null?void 0:n.key)!=null?d:0)+1}),e(N,{open:t!==null,onOpenChange:r=>{r||s()},children:e(D,{"aria-describedby":void 0,className:"sm:max-w-md",onOpenAutoFocus:r=>{var c,i;r.preventDefault();const f=t!=null&&t.text?"href":"text";(i=(c=m.current)==null?void 0:c.querySelector(`[data-link-field="${f}"]`))==null||i.focus()},onCloseAutoFocus:r=>{r.preventDefault(),a()},children:e("div",{ref:m,children:n?e(R,{draft:n.draft,onSave:l,onRemove:o,onCancel:s},n.key):null})})})}export{F as NoteEditorLinkDialog,C as normalizeLinkInput};
4
+ //# sourceMappingURL=NoteEditorLinkDialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoteEditorLinkDialog.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsx as t,jsxs as x,Fragment as O}from"react/jsx-runtime";import{screens as F}from"../assets/js/tokens.mjs";import{Button as P}from"./Button.mjs";import{cn as p}from"../lib/utils.mjs";import{ChevronLeftDuo as H,ChevronRightDuo as K,MoreHorizontal as Q}from"@medway-ui/icons";import{forwardRef as z,useState as T,useEffect as U}from"react";var W=Object.defineProperty,_=Object.defineProperties,q=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,R=(a,e,r)=>e in a?W(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,m=(a,e)=>{for(var r in e||(e={}))E.call(e,r)&&R(a,r,e[r]);if(b)for(var r of b(e))L.call(e,r)&&R(a,r,e[r]);return a},g=(a,e)=>_(a,q(e)),f=(a,e)=>{var r={};for(var i in a)E.call(a,i)&&e.indexOf(i)<0&&(r[i]=a[i]);if(a!=null&&b)for(var i of b(a))e.indexOf(i)<0&&L.call(a,i)&&(r[i]=a[i]);return r};const G={outlined:"regular-basic"};function C(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("nav",m({"aria-label":"Pagina\xE7\xE3o",className:p("flex w-full flex-wrap items-center justify-between gap-4",r)},i))}function I(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("ul",m({className:p("flex min-w-0 max-w-full flex-row flex-wrap items-center justify-center gap-2",r)},i))}function y(a){var e=a,{count:r,label:i="itens",className:n}=e,s=f(e,["count","label","className"]);return t("p",g(m({className:p("text-xs font-medium text-gray-foreground-muted",n)},s),{children:i==="itens"?x(O,{children:["Mostrando"," ",t("span",{className:"font-semibold text-gray-foreground",children:r})," ",i]}):x(O,{children:[t("span",{className:"font-semibold text-gray-foreground",children:r})," ",i]})}))}function w(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("li",m({className:r},i))}const V=z(function(a,e){var r=a,{className:i,isActive:n,iconLeft:s,iconRight:o,size:l="md",variant:u="regular",activeVariant:d,inactiveVariant:v}=r,N=f(r,["className","isActive","iconLeft","iconRight","size","variant","activeVariant","inactiveVariant"]);return t(P,g(m({ref:e,"aria-current":n?"page":void 0,variant:n&&d?d:!n&&v?v:n?u:`${u}-soft`,className:p("transition-none",i),size:l,iconLeft:s,iconRight:o},N),{children:N.children}))}),M=z(function(a,e){var r=a,{className:i,size:n="md",variant:s="regular-basic"}=r,o=f(r,["className","size","variant"]);return t(P,g(m({ref:e,"aria-label":"P\xE1gina anterior",className:i,iconLeft:t(H,{}),variant:s,size:n},o),{children:o.children||"Anterior"}))}),k=z(function(a,e){var r=a,{className:i,size:n="md",variant:s="regular-basic"}=r,o=f(r,["className","size","variant"]);return t(P,g(m({ref:e,className:i,variant:s,iconRight:t(K,{}),size:n},o),{children:o.children||"Pr\xF3ximo"}))});function A(a){var e=a,{className:r,size:i="md"}=e,n=f(e,["className","size"]);return t("span",g(m({"aria-hidden":!0,className:p("flex items-center justify-center",{sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[i],r)},n),{children:t(Q,{className:"h-4 w-4"})}))}function D(a,e,r=2){const i=[];if(e<=r+2)for(let n=1;n<=e;n++)i.push(n);else{const n=Math.floor(r/2);if(a<=n+1){for(let s=1;s<=r+1;s++)i.push(s);r+1<e&&i.push(-1,e)}else if(a>=e-n){i.push(1),e-r>1&&i.push(-1);for(let s=e-r;s<=e;s++)i.push(s)}else{const s=a-n,o=a+n;i.push(1),s>2&&i.push(-1);for(let l=s;l<=o;l++)i.push(l);o<e-1&&i.push(-1),i.push(e)}}return i}function J({currentPage:a,totalPages:e,maxVisibleItems:r,onPageChange:i,itemsPerPage:n,totalItems:s,className:o,responsive:l=!0,size:u="md",variant:d="regular"}){const[v,N]=T(!1);U(()=>{if(typeof window=="undefined"||!l)return;const c=parseInt(F.tablet),h=()=>{N(window.innerWidth<=c)};return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[l]);const $=typeof r=="number"?r:l&&v?0:2,j=l&&v,S=l?"max-[500px]:hidden":void 0,B=()=>D(a,e,$);return x(C,{className:o,children:[n!==void 0&&!j?t(y,{count:n,label:"itens"}):t("div",{}),x(I,{className:l?"max-[500px]:w-full max-[500px]:justify-between":void 0,children:[t(w,{children:t(M,{onClick:()=>i(Math.max(1,a-1)),disabled:a<=1,size:u})}),B().map((c,h)=>t(w,{className:S,children:c===-1?t(A,{size:u}):t(V,{"aria-label":`P\xE1gina ${c}`,onClick:()=>{c!==a&&i(c)},isActive:c===a,size:u,variant:d,inactiveVariant:G[d],children:c})},c===-1?`ellipsis-${h}`:c)),t(w,{children:t(k,{onClick:()=>i(Math.min(e,a+1)),disabled:a>=e,size:u})})]}),s!==void 0&&!j?t(y,{count:s,label:"total"}):t("div",{})]})}export{J as Pagination,I as PaginationContent,A as PaginationEllipsis,y as PaginationInfo,w as PaginationItem,V as PaginationLink,k as PaginationNext,M as PaginationPrevious,C as PaginationRoot,D as calculatePageNumbers};
3
+ import{jsx as t,jsxs as x,Fragment as O}from"react/jsx-runtime";import{screens as F}from"../assets/js/tokens.mjs";import{Button as P}from"./Button.mjs";import{cn as p}from"../lib/utils.mjs";import{ChevronLeftDuo as H,ChevronRightDuo as U,MoreHorizontal as Q}from"@medway-ui/icons";import{forwardRef as z,useState as T,useEffect as W}from"react";var _=Object.defineProperty,q=Object.defineProperties,G=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,R=(a,e,r)=>e in a?_(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,m=(a,e)=>{for(var r in e||(e={}))E.call(e,r)&&R(a,r,e[r]);if(b)for(var r of b(e))L.call(e,r)&&R(a,r,e[r]);return a},g=(a,e)=>q(a,G(e)),f=(a,e)=>{var r={};for(var i in a)E.call(a,i)&&e.indexOf(i)<0&&(r[i]=a[i]);if(a!=null&&b)for(var i of b(a))e.indexOf(i)<0&&L.call(a,i)&&(r[i]=a[i]);return r};const J={outlined:"regular-basic"};function C(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("nav",m({"aria-label":"Pagina\xE7\xE3o",className:p("flex w-full flex-wrap items-center justify-between gap-4",r)},i))}function I(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("ul",m({className:p("flex min-w-0 max-w-full flex-row flex-wrap items-center justify-center gap-2",r)},i))}function y(a){var e=a,{count:r,label:i="itens",className:n}=e,s=f(e,["count","label","className"]);return t("p",g(m({className:p("text-xs font-medium text-gray-foreground-muted",n)},s),{children:i==="itens"?x(O,{children:["Mostrando"," ",t("span",{className:"font-semibold text-gray-foreground",children:r})," ",i]}):x(O,{children:[t("span",{className:"font-semibold text-gray-foreground",children:r})," ",i]})}))}function w(a){var e=a,{className:r}=e,i=f(e,["className"]);return t("li",m({className:r},i))}const V=z(function(a,e){var r=a,{className:i,isActive:n,iconLeft:s,iconRight:o,size:l="md",variant:u="regular",activeVariant:d,inactiveVariant:v}=r,N=f(r,["className","isActive","iconLeft","iconRight","size","variant","activeVariant","inactiveVariant"]);return t(P,g(m({ref:e,"aria-current":n?"page":void 0,variant:n&&d?d:!n&&v?v:n?u:`${u}-soft`,className:p("transition-none",i),size:l,iconLeft:s,iconRight:o},N),{children:N.children}))}),M=z(function(a,e){var r=a,{className:i,size:n="md",variant:s="regular-basic"}=r,o=f(r,["className","size","variant"]);return t(P,g(m({ref:e,"aria-label":"P\xE1gina anterior",className:i,iconLeft:t(H,{}),variant:s,size:n},o),{children:o.children||"Anterior"}))}),k=z(function(a,e){var r=a,{className:i,size:n="md",variant:s="regular-basic"}=r,o=f(r,["className","size","variant"]);return t(P,g(m({ref:e,className:i,variant:s,iconRight:t(U,{}),size:n},o),{children:o.children||"Pr\xF3ximo"}))});function $(a){var e=a,{className:r,size:i="md"}=e,n=f(e,["className","size"]);return t("span",g(m({"aria-hidden":!0,className:p("flex items-center justify-center",{sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[i],r)},n),{children:t(Q,{className:"h-4 w-4"})}))}function A(a,e,r=2){const i=[];if(e<=r+2)for(let n=1;n<=e;n++)i.push(n);else{const n=Math.floor(r/2);if(a<=n+1){for(let s=1;s<=r+1;s++)i.push(s);r+1<e&&i.push(-1,e)}else if(a>=e-n){i.push(1),e-r>1&&i.push(-1);for(let s=e-r;s<=e;s++)i.push(s)}else{const s=a-n,o=a+n;i.push(1),s>2&&i.push(-1);for(let l=s;l<=o;l++)i.push(l);o<e-1&&i.push(-1),i.push(e)}}return i}function K({currentPage:a,totalPages:e,maxVisibleItems:r,onPageChange:i,itemsPerPage:n,totalItems:s,className:o,responsive:l=!0,size:u="md",variant:d="regular"}){const[v,N]=T(!1);W(()=>{if(typeof window=="undefined"||!l)return;const c=parseInt(F.tablet),h=()=>{N(window.innerWidth<=c)};return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[l]);const D=typeof r=="number"?r:l&&v?0:2,j=l&&v,S=l?"max-[500px]:hidden":void 0,B=()=>A(a,e,D);return x(C,{className:o,children:[n!==void 0&&!j?t(y,{count:n,label:"itens"}):t("div",{}),x(I,{className:l?"max-[500px]:w-full max-[500px]:justify-between":void 0,children:[t(w,{children:t(M,{onClick:()=>i(Math.max(1,a-1)),disabled:a<=1,size:u})}),B().map((c,h)=>t(w,{className:S,children:c===-1?t($,{size:u}):t(V,{"aria-label":`P\xE1gina ${c}`,onClick:()=>{c!==a&&i(c)},isActive:c===a,size:u,variant:d,inactiveVariant:J[d],children:c})},c===-1?`ellipsis-${h}`:c)),t(w,{children:t(k,{onClick:()=>i(Math.min(e,a+1)),disabled:a>=e,size:u})})]}),s!==void 0&&!j?t(y,{count:s,label:"total"}):t("div",{})]})}export{K as Pagination,I as PaginationContent,$ as PaginationEllipsis,y as PaginationInfo,w as PaginationItem,V as PaginationLink,k as PaginationNext,M as PaginationPrevious,C as PaginationRoot,A as calculatePageNumbers};
4
4
  //# sourceMappingURL=Pagination.mjs.map
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsx as s,jsxs as d,Fragment as b}from"react/jsx-runtime";import{cn as i,clampPercentage as p}from"../lib/utils.mjs";import{ArrowRightMd as L,Info as Q,CloseMd as q,Check as B,Warning as W,RemoveMinus as v,CheckboxFill as G}from"@medway-ui/icons";import{Button as y}from"./Button.mjs";import{Avatar as H,AvatarImage as K,AvatarFallback as X}from"./Avatar.mjs";import{Tag as k}from"./Tag.mjs";import{TooltipProvider as w,Tooltip as C,TooltipTrigger as R,TooltipContent as j}from"./Tooltip.mjs";var Y=Object.defineProperty,Z=Object.defineProperties,J=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,O=(r,e,a)=>e in r?Y(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,l=(r,e)=>{for(var a in e||(e={}))$.call(e,a)&&O(r,a,e[a]);if(h)for(var a of h(e))z.call(e,a)&&O(r,a,e[a]);return r},o=(r,e)=>Z(r,J(e)),c=(r,e)=>{var a={};for(var n in r)$.call(r,n)&&e.indexOf(n)<0&&(a[n]=r[n]);if(r!=null&&h)for(var n of h(r))e.indexOf(n)<0&&z.call(r,n)&&(a[n]=r[n]);return a};function U(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",{className:"w-full overflow-x-auto rounded-lg border border-gray-stroke-muted",children:s("table",o(l({className:i("w-full border-collapse text-left",n)},t),{children:a}))})}function V(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("thead",o(l({className:i("h-11 border-b border-gray-stroke-muted bg-surface-card",n)},t),{children:s("tr",{children:a})}))}function _(r){var e=r,{children:a,className:n,tooltip:t,highlight:m}=e,u=c(e,["children","className","tooltip","highlight"]);return s("th",o(l({className:i("text-ellipsis whitespace-nowrap px-5 text-sm font-semibold text-gray-foreground first:pr-0",n)},u),{children:d("div",{className:"flex items-center gap-1.5",children:[s("span",{className:i(m&&"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-foreground-onfill"),children:a}),t&&s(w,{children:d(C,{children:[s(R,{asChild:!0,children:s(y,{type:"button",variant:"regular-basic",size:"sm","aria-label":t,className:"!h-6 !min-h-6 !w-6 !min-w-6 !p-0 text-gray-foreground",iconLeft:s(Q,{"aria-hidden":"true",className:"size-4"})})}),s(j,{children:t})]})})]})}))}function ee(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tbody",o(l({className:i("bg-surface-card",n)},t),{children:a}))}function re(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tr",o(l({className:i("w-full border-t border-solid border-gray-stroke-muted first:border-t-0",n)},t),{children:a}))}function ae(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",{className:"py-4 pl-5 align-middle",children:s("div",o(l({className:i("flex size-7 shrink-0 items-center justify-center overflow-hidden whitespace-nowrap rounded-full bg-primary-foreground text-sm font-semibold text-primary-foreground-onfill",n)},t),{children:a}))})}function ne(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex items-center gap-5",n),children:s("div",{className:"flex shrink-0 items-center gap-5 pr-8",children:a})})}))}function se(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("flex shrink-0 flex-col items-start whitespace-nowrap text-gray-foreground",n)},t),{children:a}))}function te(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-xxs font-medium leading-xxs",n)},t),{children:a}))}function ie(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-sm font-semibold leading-5",n)},t),{children:a}))}function le(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s(k,o(l({className:i("bg-gradient-to-r from-cm-24 to-secondary-24 text-primary-foreground",n)},t),{icon:s(G,{className:"text-primary-foreground"}),children:a}))}function oe(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex flex-col items-start gap-2",n),children:a})}))}function ce(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("p",o(l({className:i("relative shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xxs font-medium leading-xxs text-gray-foreground",n)},t),{children:a}))}function de(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("avatar-group flex shrink-0 items-center gap-2",n)},t),{children:a}))}function me(r){var e=r,{src:a,alt:n,fallback:t="?",className:m,tooltip:u}=e,f=c(e,["src","alt","fallback","className","tooltip"]);const g=d(H,o(l({size:"sm",className:i("ring-2 ring-background",m)},f),{children:[s(K,{src:a,alt:n}),s(X,{children:t})]}));return u?s(w,{children:d(C,{children:[s(R,{asChild:!0,children:g}),s(j,{children:u})]})}):g}function ue(r){var e=r,{children:a,className:n,icon:t}=e,m=c(e,["children","className","icon"]);return s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s(k,{variant:"regular-soft",className:n,icon:t,children:a})}))}function fe({className:r,percentage:e,label:a}){return s("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p(e)),className:i("relative h-0.5 w-full overflow-hidden rounded-pill bg-gray-100",r),children:s("div",{className:i("absolute inset-y-0 left-0 rounded-pill bg-primary-stroke transition-all duration-300"),style:{width:`${p(e)}%`}})})}function ge(r){var e=r,{questions:a,answered:n,className:t}=e,m=c(e,["questions","answered","className"]);const u=n>0&&a>0?p(n/a*100):0;return n===0?s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:"flex size-4 items-center justify-center rounded-full bg-gray-background-soft",children:s(v,{className:"size-3 text-gray-foreground",strokeWidth:2.6})}),s("span",{className:"whitespace-nowrap font-medium text-gray-foreground-muted",children:"N\xE3o iniciado"})]})})})):s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:d("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:[s("div",{className:"flex shrink-0 items-center gap-0.5 text-xs leading-4",children:d("span",{className:"relative shrink-0 whitespace-nowrap font-medium text-gray-foreground-muted",children:[s("span",{className:"font-semibold text-gray-foreground",children:n})," ",n>1?"respondidas":"respondida"]})}),s(fe,{percentage:u,label:`${n} ${n>1?"respondidas":"respondida"}`})]})}))}const he={notStarted:{icon:v,bgColor:"bg-gray-background-soft",iconColor:"text-gray-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"N\xE3o iniciado",subtitle:()=>""},minNotReached:{icon:W,bgColor:"bg-feedback-warning-background-soft",iconColor:"text-feedback-warning-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"M\xEDnimo n\xE3o atingido",subtitle:({remainingQuestions:r})=>r>1?`Faltam ${r} quest\xF5es`:`Falta ${r} quest\xE3o`},dominated:{icon:B,statusLabel:"Dominado",bgColor:"bg-feedback-success-background-soft",iconColor:"text-feedback-success-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`},notDominated:{icon:q,statusLabel:"N\xE3o dominado",bgColor:"bg-feedback-error-background-soft",iconColor:"text-feedback-error-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`}};function pe(r,e,a){return[[r,"notStarted"],[e,"minNotReached"],[a>=80,"dominated"],[!0,"notDominated"]].find(([n])=>n)[1]}function Ne(r){var e=r,{answered:a,correct:n,minQuestions:t,className:m}=e,u=c(e,["answered","correct","minQuestions","className"]);const f=a>0?n/a*100:0,g=a===0,T=a<t,P=t-a,A=pe(g,T,f),{icon:E,bgColor:F,iconColor:M,titleClassName:D,statusLabel:N,title:I,subtitle:S}=he[A],x={progress:f,correct:n,answered:a,remainingQuestions:P};return s("td",o(l({className:"px-5 py-4 align-middle"},u),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",m),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:i("flex size-4 items-center justify-center rounded-full",F),children:s(E,{"aria-hidden":"true",className:i("size-3",M),strokeWidth:2.6})}),d("div",{className:"flex flex-col items-start justify-center",children:[N&&d("span",{className:"sr-only",children:[N,": "]}),s("span",{className:i("whitespace-nowrap",D),children:I(x)}),s("span",{className:"whitespace-nowrap text-xxs font-semibold text-gray-foreground-muted",children:S(x)})]})]})})}))}function xe(r){var e=r,{children:a,className:n,onClick:t}=e,m=c(e,["children","className","onClick"]);return s("td",{className:"px-5 py-4 align-middle",children:s(y,o(l({variant:"regular-soft",size:"sm",iconRight:s(L,{className:"size-4"}),onClick:t,className:n},m),{children:a}))})}export{U as Ranking,de as RankingAssigneeGroup,me as RankingAssigneeItem,ce as RankingAssigneeLabel,oe as RankingAssigneesColumn,ee as RankingBody,xe as RankingButton,V as RankingHeader,_ as RankingHeaderCell,re as RankingItem,ae as RankingNumber,Ne as RankingPerformance,ue as RankingPriority,ge as RankingQuestions,te as RankingSpecialty,le as RankingSuperFocus,ie as RankingTopic,ne as RankingTopicColumn,se as RankingTopicContent};
3
+ import{jsx as s,jsxs as d,Fragment as b}from"react/jsx-runtime";import{cn as i,clampPercentage as p}from"../lib/utils.mjs";import{ArrowRightMd as L,Info as Q,CloseMd as q,Check as B,Warning as W,RemoveMinus as v,CheckboxFill as G}from"@medway-ui/icons";import{Button as y}from"./Button.mjs";import{Avatar as H,AvatarImage as U,AvatarFallback as X}from"./Avatar.mjs";import{Tag as k}from"./Tag.mjs";import{TooltipProvider as w,Tooltip as C,TooltipTrigger as R,TooltipContent as j}from"./Tooltip.mjs";var Y=Object.defineProperty,Z=Object.defineProperties,J=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,O=(r,e,a)=>e in r?Y(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,l=(r,e)=>{for(var a in e||(e={}))z.call(e,a)&&O(r,a,e[a]);if(h)for(var a of h(e))$.call(e,a)&&O(r,a,e[a]);return r},o=(r,e)=>Z(r,J(e)),c=(r,e)=>{var a={};for(var n in r)z.call(r,n)&&e.indexOf(n)<0&&(a[n]=r[n]);if(r!=null&&h)for(var n of h(r))e.indexOf(n)<0&&$.call(r,n)&&(a[n]=r[n]);return a};function K(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",{className:"w-full overflow-x-auto rounded-lg border border-gray-stroke-muted",children:s("table",o(l({className:i("w-full border-collapse text-left",n)},t),{children:a}))})}function V(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("thead",o(l({className:i("h-11 border-b border-gray-stroke-muted bg-surface-card",n)},t),{children:s("tr",{children:a})}))}function _(r){var e=r,{children:a,className:n,tooltip:t,highlight:m}=e,u=c(e,["children","className","tooltip","highlight"]);return s("th",o(l({className:i("text-ellipsis whitespace-nowrap px-5 text-sm font-semibold text-gray-foreground first:pr-0",n)},u),{children:d("div",{className:"flex items-center gap-1.5",children:[s("span",{className:i(m&&"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary-foreground-onfill"),children:a}),t&&s(w,{children:d(C,{children:[s(R,{asChild:!0,children:s(y,{type:"button",variant:"regular-basic",size:"sm","aria-label":t,className:"!h-6 !min-h-6 !w-6 !min-w-6 !p-0 text-gray-foreground",iconLeft:s(Q,{"aria-hidden":"true",className:"size-4"})})}),s(j,{children:t})]})})]})}))}function ee(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tbody",o(l({className:i("bg-surface-card",n)},t),{children:a}))}function re(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("tr",o(l({className:i("w-full border-t border-solid border-gray-stroke-muted first:border-t-0",n)},t),{children:a}))}function ae(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",{className:"py-4 pl-5 align-middle",children:s("div",o(l({className:i("flex size-7 shrink-0 items-center justify-center overflow-hidden whitespace-nowrap rounded-full bg-primary-foreground text-sm font-semibold text-primary-foreground-onfill",n)},t),{children:a}))})}function ne(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex items-center gap-5",n),children:s("div",{className:"flex shrink-0 items-center gap-5 pr-8",children:a})})}))}function se(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("flex shrink-0 flex-col items-start whitespace-nowrap text-gray-foreground",n)},t),{children:a}))}function te(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-xxs font-medium leading-xxs",n)},t),{children:a}))}function ie(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("span",o(l({className:i("shrink-0 overflow-hidden text-ellipsis font-sans text-sm font-semibold leading-5",n)},t),{children:a}))}function le(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s(k,o(l({className:i("bg-gradient-to-r from-cm-24 to-secondary-24 text-primary-foreground",n)},t),{icon:s(G,{className:"text-primary-foreground"}),children:a}))}function oe(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("td",o(l({className:"px-5 py-4 align-middle"},t),{children:s("div",{className:i("flex flex-col items-start gap-2",n),children:a})}))}function ce(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("p",o(l({className:i("relative shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xxs font-medium leading-xxs text-gray-foreground",n)},t),{children:a}))}function de(r){var e=r,{children:a,className:n}=e,t=c(e,["children","className"]);return s("div",o(l({className:i("avatar-group flex shrink-0 items-center gap-2",n)},t),{children:a}))}function me(r){var e=r,{src:a,alt:n,fallback:t="?",className:m,tooltip:u}=e,f=c(e,["src","alt","fallback","className","tooltip"]);const g=d(H,o(l({size:"sm",className:i("ring-2 ring-background",m)},f),{children:[s(U,{src:a,alt:n}),s(X,{children:t})]}));return u?s(w,{children:d(C,{children:[s(R,{asChild:!0,children:g}),s(j,{children:u})]})}):g}function ue(r){var e=r,{children:a,className:n,icon:t}=e,m=c(e,["children","className","icon"]);return s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s(k,{variant:"regular-soft",className:n,icon:t,children:a})}))}function fe({className:r,percentage:e,label:a}){return s("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p(e)),className:i("relative h-0.5 w-full overflow-hidden rounded-pill bg-gray-100",r),children:s("div",{className:i("absolute inset-y-0 left-0 rounded-pill bg-primary-stroke transition-all duration-300"),style:{width:`${p(e)}%`}})})}function ge(r){var e=r,{questions:a,answered:n,className:t}=e,m=c(e,["questions","answered","className"]);const u=n>0&&a>0?p(n/a*100):0;return n===0?s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:"flex size-4 items-center justify-center rounded-full bg-gray-background-soft",children:s(v,{className:"size-3 text-gray-foreground",strokeWidth:2.6})}),s("span",{className:"whitespace-nowrap font-medium text-gray-foreground-muted",children:"N\xE3o iniciado"})]})})})):s("td",o(l({className:"px-5 py-4 align-middle"},m),{children:d("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",t),children:[s("div",{className:"flex shrink-0 items-center gap-0.5 text-xs leading-4",children:d("span",{className:"relative shrink-0 whitespace-nowrap font-medium text-gray-foreground-muted",children:[s("span",{className:"font-semibold text-gray-foreground",children:n})," ",n>1?"respondidas":"respondida"]})}),s(fe,{percentage:u,label:`${n} ${n>1?"respondidas":"respondida"}`})]})}))}const he={notStarted:{icon:v,bgColor:"bg-gray-background-soft",iconColor:"text-gray-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"N\xE3o iniciado",subtitle:()=>""},minNotReached:{icon:W,bgColor:"bg-feedback-warning-background-soft",iconColor:"text-feedback-warning-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:()=>"M\xEDnimo n\xE3o atingido",subtitle:({remainingQuestions:r})=>r>1?`Faltam ${r} quest\xF5es`:`Falta ${r} quest\xE3o`},dominated:{icon:B,statusLabel:"Dominado",bgColor:"bg-feedback-success-background-soft",iconColor:"text-feedback-success-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`},notDominated:{icon:q,statusLabel:"N\xE3o dominado",bgColor:"bg-feedback-error-background-soft",iconColor:"text-feedback-error-foreground",titleClassName:"font-medium text-gray-foreground-muted",title:({progress:r})=>d(b,{children:[d("span",{className:"font-semibold text-gray-foreground",children:[Math.round(r),"%"]})," ","de ",r>1?"acertos":"acerto"]}),subtitle:({correct:r,answered:e})=>`${r} de ${e} acertos`}};function pe(r,e,a){return[[r,"notStarted"],[e,"minNotReached"],[a>=80,"dominated"],[!0,"notDominated"]].find(([n])=>n)[1]}function Ne(r){var e=r,{answered:a,correct:n,minQuestions:t,className:m}=e,u=c(e,["answered","correct","minQuestions","className"]);const f=a>0?n/a*100:0,g=a===0,T=a<t,P=t-a,A=pe(g,T,f),{icon:E,bgColor:F,iconColor:M,titleClassName:S,statusLabel:N,title:D,subtitle:I}=he[A],x={progress:f,correct:n,answered:a,remainingQuestions:P};return s("td",o(l({className:"px-5 py-4 align-middle"},u),{children:s("div",{className:i("flex min-w-[140px] flex-col items-start justify-center gap-2",m),children:d("div",{className:"flex shrink-0 items-center justify-center gap-2 text-xs font-medium text-gray-foreground-muted",children:[s("div",{className:i("flex size-4 items-center justify-center rounded-full",F),children:s(E,{"aria-hidden":"true",className:i("size-3",M),strokeWidth:2.6})}),d("div",{className:"flex flex-col items-start justify-center",children:[N&&d("span",{className:"sr-only",children:[N,": "]}),s("span",{className:i("whitespace-nowrap",S),children:D(x)}),s("span",{className:"whitespace-nowrap text-xxs font-semibold text-gray-foreground-muted",children:I(x)})]})]})})}))}function xe(r){var e=r,{children:a,className:n,onClick:t}=e,m=c(e,["children","className","onClick"]);return s("td",{className:"px-5 py-4 align-middle",children:s(y,o(l({variant:"regular-soft",size:"sm",iconRight:s(L,{className:"size-4"}),onClick:t,className:n},m),{children:a}))})}export{K as Ranking,de as RankingAssigneeGroup,me as RankingAssigneeItem,ce as RankingAssigneeLabel,oe as RankingAssigneesColumn,ee as RankingBody,xe as RankingButton,V as RankingHeader,_ as RankingHeaderCell,re as RankingItem,ae as RankingNumber,Ne as RankingPerformance,ue as RankingPriority,ge as RankingQuestions,te as RankingSpecialty,le as RankingSuperFocus,ie as RankingTopic,ne as RankingTopicColumn,se as RankingTopicContent};
4
4
  //# sourceMappingURL=Ranking.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAKL,cAAc,EACd,cAAc,EAGd,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,UAAU,WAAY,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,UAAU,eAAgB,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAOD,iBAAS,MAAM,CAAC,EAAE,OAAe,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQtE;AAED,UAAU,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,2CAQhC;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAevE;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,QAAA,MAAM,cAAc;;8EAqBnB,CAAC;AAiBF,QAAA,MAAM,aAAa,kMA8BjB,CAAC;AAEH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CA2BhD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAW9C;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CA4B3E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQlD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAavD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAiBzD;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,eAAe,CAAC,2CAc3E;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAKL,cAAc,EACd,cAAc,EAGd,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,UAAU,WAAY,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,UAAU,eAAgB,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAOD,iBAAS,MAAM,CAAC,EAAE,OAAe,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQtE;AAED,UAAU,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,2CAQhC;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAevE;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,QAAA,MAAM,cAAc;;8EAqBnB,CAAC;AAiBF,QAAA,MAAM,aAAa,kMA8BjB,CAAC;AAEH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CA4BhD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAW9C;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CA4B3E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQlD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAavD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAiBzD;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,eAAe,CAAC,2CAc3E;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAKL,cAAc,EACd,cAAc,EAGd,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,UAAU,WAAY,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,UAAU,eAAgB,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAOD,iBAAS,MAAM,CAAC,EAAE,OAAe,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQtE;AAED,UAAU,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,2CAQhC;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAevE;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,QAAA,MAAM,cAAc;;8EAqBnB,CAAC;AAiBF,QAAA,MAAM,aAAa,kMA8BjB,CAAC;AAEH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CA2BhD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAW9C;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CA4B3E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQlD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAavD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAiBzD;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,eAAe,CAAC,2CAc3E;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAKL,cAAc,EACd,cAAc,EAGd,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,UAAU,WAAY,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,UAAU,eAAgB,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAOD,iBAAS,MAAM,CAAC,EAAE,OAAe,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQtE;AAED,UAAU,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,2CAQhC;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAevE;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAE9C;AAED,QAAA,MAAM,cAAc;;8EAqBnB,CAAC;AAiBF,QAAA,MAAM,aAAa,kMA8BjB,CAAC;AAEH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CA4BhD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAW9C;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CA4B3E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQlD;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAavD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAiBzD;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,eAAe,CAAC,2CAc3E;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var s=require("react/jsx-runtime"),m=require("@medway-ui/icons"),o=require("radix-ui"),i=require("react"),c=require("../lib/utils.js"),v=require("class-variance-authority"),z=Object.defineProperty,k=Object.defineProperties,C=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,j=(t,e,a)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,e)=>{for(var a in e||(e={}))b.call(e,a)&&j(t,a,e[a]);if(h)for(var a of h(e))y.call(e,a)&&j(t,a,e[a]);return t},u=(t,e)=>k(t,C(e)),d=(t,e)=>{var a={};for(var r in t)b.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&h)for(var r of h(t))e.indexOf(r)<0&&y.call(t,r)&&(a[r]=t[r]);return a};const x=i.createContext({invalid:!1,size:"lg"});function O(t){var e=t,{invalid:a=!1,size:r="lg"}=e,l=d(e,["invalid","size"]);return s.jsx(x.Provider,{value:i.useMemo(()=>({invalid:a,size:r}),[a,r]),children:s.jsx(o.Select.Root,n({},l))})}function I(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx("div",n({className:c.cn("group relative flex flex-col gap-2",a),"data-slot":"select-wrapper"},r))}function V(t){var e=t,{className:a,children:r}=e,l=d(e,["className","children"]);return s.jsx("label",u(n({className:c.cn("pointer-events-none absolute start-3 top-0 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground","group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:!text-sm",a),"data-slot":"select-label"},l),{children:r}))}function _(t){var e=d(t,[]);return s.jsx(o.Select.Group,n({"data-slot":"select-group"},e))}function q(t){var e=d(t,[]);return s.jsx(o.Select.Value,n({"data-slot":"select-value"},e))}const N=v.cva(["flex w-full items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] hover:border-gray-stroke-emphasis hover:ring-[3px] hover:ring-state-focus disabled:cursor-default disabled:bg-gray-background-soft-muted disabled:hover:border-gray-stroke-muted disabled:hover:ring-0 aria-[invalid]:border-feedback-error-stroke aria-[invalid]:hover:ring-[3px] aria-[invalid]:hover:ring-state-error data-[placeholder]:text-gray-foreground-emphasis *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 disabled:data-[placeholder]:text-gray-foreground-muted [&>span]:line-clamp-1 [&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{size:{lg:["h-12 max-h-12 text-md [&_svg]:size-6","group-has-[[data-slot=select-label]]:h-14"],md:["h-10 max-h-10 text-sm [&_svg]:size-5","group-has-[[data-slot=select-label]]:h-11"]}},defaultVariants:{size:"lg"}}),P=v.cva("data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-secondary-background-soft-emphasis relative flex w-full cursor-default select-none items-center rounded pe-8 ps-2 font-medium text-gray-foreground outline-none hover:cursor-pointer hover:bg-secondary-background-soft-emphasis gap-3",{variants:{size:{lg:"py-2 text-sm [&_svg]:size-5",md:"py-2 text-sm [&_svg]:size-5"}},defaultVariants:{size:"lg"}}),D=i.forwardRef(function(t,e){var a=t,{className:r,children:l}=a,g=d(a,["className","children"]);const{invalid:p,size:f}=i.useContext(x);return s.jsxs(o.Select.Trigger,u(n({ref:e,className:c.cn(N({size:f}),!p&&"[&:not([data-placeholder]):not(:disabled)]:border-gray-stroke-emphasis","group-has-[[data-slot=select-label]]:py-3 group-has-[[data-slot=select-label]]:data-[placeholder]:text-transparent",r),"data-slot":"select-trigger","data-size":f,"aria-invalid":p?"true":void 0},g),{children:[l,s.jsx(o.Select.Icon,{asChild:!0,children:s.jsx(m.ChevronDown,{className:c.cn("flex-shrink-0 text-gray-foreground"),strokeWidth:1.6})})]}))});function W(t){var e=t,{className:a,children:r,position:l="popper"}=e,g=d(e,["className","children","position"]);return s.jsx(o.Select.Portal,{children:s.jsxs(o.Select.Content,u(n({className:c.cn("relative z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-32 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated text-gray-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&_[role=group]]:py-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),"data-slot":"select-content",position:l},g),{children:[s.jsx(S,{}),s.jsx(o.Select.Viewport,{className:c.cn("p-2",l==="popper"&&"h-[var(--radix-select-trigger-height)]"),children:r}),s.jsx(w,{})]}))})}function T(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.Label,n({className:c.cn("px-2 py-2 text-xs font-medium text-gray-foreground-muted",a),"data-slot":"select-header"},r))}function U(t){var e=t,{className:a,children:r,icon:l}=e,g=d(e,["className","children","icon"]);const{size:p}=i.useContext(x);return s.jsxs(o.Select.Item,u(n({className:c.cn(P({size:p}),a),"data-slot":"select-item"},g),{children:[l&&s.jsx("span",{className:"flex shrink-0 items-center justify-center text-gray-foreground",children:i.isValidElement(l)?i.cloneElement(l,{strokeWidth:1.6}):l}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.jsx(o.Select.ItemText,{children:r})}),s.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:s.jsx(o.Select.ItemIndicator,{children:s.jsx(m.Check,{strokeWidth:1.6,className:"text-secondary-foreground"})})})]}))}function B(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.Separator,n({className:c.cn("-mx-1 my-1 h-px bg-gray-stroke-muted",a),"data-slot":"select-separator"},r))}function S(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.ScrollUpButton,u(n({className:c.cn("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-up-button"},r),{children:s.jsx(m.ChevronUp,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function w(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.ScrollDownButton,u(n({className:c.cn("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-down-button"},r),{children:s.jsx(m.ChevronDown,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function E(t){var e=t,{className:a}=e,r=d(e,["className"]);const{invalid:l}=i.useContext(x);return s.jsx("span",n({className:c.cn("-mt-1 text-xs",l?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"select-text"},r))}exports.Select=O,exports.SelectContent=W,exports.SelectGroup=_,exports.SelectHeader=T,exports.SelectItem=U,exports.SelectLabel=V,exports.SelectScrollDownButton=w,exports.SelectScrollUpButton=S,exports.SelectSeparator=B,exports.SelectText=E,exports.SelectTrigger=D,exports.SelectValue=q,exports.SelectWrapper=I,exports.selectVariants=N;
3
+ "use strict";var s=require("react/jsx-runtime"),m=require("@medway-ui/icons"),o=require("radix-ui"),c=require("react"),i=require("../lib/utils.js"),v=require("class-variance-authority"),z=Object.defineProperty,k=Object.defineProperties,C=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,j=(t,e,a)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,e)=>{for(var a in e||(e={}))b.call(e,a)&&j(t,a,e[a]);if(h)for(var a of h(e))y.call(e,a)&&j(t,a,e[a]);return t},u=(t,e)=>k(t,C(e)),d=(t,e)=>{var a={};for(var r in t)b.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&h)for(var r of h(t))e.indexOf(r)<0&&y.call(t,r)&&(a[r]=t[r]);return a};const x=c.createContext({invalid:!1,size:"lg"});function O(t){var e=t,{invalid:a=!1,size:r="lg"}=e,l=d(e,["invalid","size"]);return s.jsx(x.Provider,{value:c.useMemo(()=>({invalid:a,size:r}),[a,r]),children:s.jsx(o.Select.Root,n({},l))})}function I(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx("div",n({className:i.cn("group relative flex flex-col gap-2",a),"data-slot":"select-wrapper"},r))}function V(t){var e=t,{className:a,children:r}=e,l=d(e,["className","children"]);return s.jsx("label",u(n({className:i.cn("pointer-events-none absolute start-3 top-0 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground","group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:!text-sm",a),"data-slot":"select-label"},l),{children:r}))}function _(t){var e=d(t,[]);return s.jsx(o.Select.Group,n({"data-slot":"select-group"},e))}function q(t){var e=d(t,[]);return s.jsx(o.Select.Value,n({"data-slot":"select-value"},e))}const N=v.cva(["flex w-full items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] hover:border-gray-stroke-emphasis hover:ring-[3px] hover:ring-state-focus disabled:cursor-default disabled:bg-gray-background-soft-muted disabled:hover:border-gray-stroke-muted disabled:hover:ring-0 aria-[invalid]:border-feedback-error-stroke aria-[invalid]:hover:ring-[3px] aria-[invalid]:hover:ring-state-error data-[placeholder]:text-gray-foreground-emphasis *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 disabled:data-[placeholder]:text-gray-foreground-muted [&>span]:line-clamp-1 [&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{size:{lg:["h-12 max-h-12 text-md [&_svg]:size-6","group-has-[[data-slot=select-label]]:h-14"],md:["h-10 max-h-10 text-sm [&_svg]:size-5","group-has-[[data-slot=select-label]]:h-11"]}},defaultVariants:{size:"lg"}}),P=v.cva("data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-secondary-background-soft-emphasis relative flex w-full cursor-default select-none items-center rounded pe-8 ps-2 font-medium text-gray-foreground outline-none hover:cursor-pointer hover:bg-secondary-background-soft-emphasis gap-3",{variants:{size:{lg:"py-2 text-sm [&_svg]:size-5",md:"py-2 text-sm [&_svg]:size-5"}},defaultVariants:{size:"lg"}}),D=c.forwardRef(function(t,e){var a=t,{className:r,children:l}=a,p=d(a,["className","children"]);const{invalid:g,size:f}=c.useContext(x);return s.jsxs(o.Select.Trigger,u(n({ref:e,className:i.cn(N({size:f}),!g&&"[&:not([data-placeholder]):not(:disabled)]:border-gray-stroke-emphasis","group-has-[[data-slot=select-label]]:py-3 group-has-[[data-slot=select-label]]:data-[placeholder]:text-transparent",r),"data-slot":"select-trigger","data-size":f,"aria-invalid":g?"true":void 0},p),{children:[l,s.jsx(o.Select.Icon,{asChild:!0,children:s.jsx(m.ChevronDown,{className:i.cn("flex-shrink-0 text-gray-foreground"),strokeWidth:1.6})})]}))});function W(t){var e=t,{className:a,children:r,position:l="popper"}=e,p=d(e,["className","children","position"]);return s.jsx(o.Select.Portal,{children:s.jsxs(o.Select.Content,u(n({className:i.cn("relative z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-32 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated text-gray-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&_[role=group]]:py-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),"data-slot":"select-content",position:l},p),{children:[s.jsx(S,{}),s.jsx(o.Select.Viewport,{className:l==="popper"?"h-[var(--radix-select-trigger-height)] p-2":"p-2",children:r}),s.jsx(w,{})]}))})}function T(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.Label,n({className:i.cn("px-2 py-2 text-xs font-medium text-gray-foreground-muted",a),"data-slot":"select-header"},r))}function U(t){var e=t,{className:a,children:r,icon:l}=e,p=d(e,["className","children","icon"]);const{size:g}=c.useContext(x);return s.jsxs(o.Select.Item,u(n({className:i.cn(P({size:g}),a),"data-slot":"select-item"},p),{children:[l&&s.jsx("span",{className:"flex shrink-0 items-center justify-center text-gray-foreground",children:c.isValidElement(l)?c.cloneElement(l,{strokeWidth:1.6}):l}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.jsx(o.Select.ItemText,{children:r})}),s.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:s.jsx(o.Select.ItemIndicator,{children:s.jsx(m.Check,{strokeWidth:1.6,className:"text-secondary-foreground"})})})]}))}function B(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.Separator,n({className:i.cn("-mx-1 my-1 h-px bg-gray-stroke-muted",a),"data-slot":"select-separator"},r))}function S(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.ScrollUpButton,u(n({className:i.cn("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-up-button"},r),{children:s.jsx(m.ChevronUp,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function w(t){var e=t,{className:a}=e,r=d(e,["className"]);return s.jsx(o.Select.ScrollDownButton,u(n({className:i.cn("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-down-button"},r),{children:s.jsx(m.ChevronDown,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function E(t){var e=t,{className:a}=e,r=d(e,["className"]);const{invalid:l}=c.useContext(x);return s.jsx("span",n({className:i.cn("-mt-1 text-xs",l?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"select-text"},r))}exports.Select=O,exports.SelectContent=W,exports.SelectGroup=_,exports.SelectHeader=T,exports.SelectItem=U,exports.SelectLabel=V,exports.SelectScrollDownButton=w,exports.SelectScrollUpButton=S,exports.SelectSeparator=B,exports.SelectText=E,exports.SelectTrigger=D,exports.SelectValue=q,exports.SelectWrapper=I,exports.selectVariants=N;
4
4
  //# sourceMappingURL=Select.js.map
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsxs as h,jsx as s}from"react/jsx-runtime";import{ChevronDown as x,Check as j,ChevronUp as O}from"@medway-ui/icons";import{Select as l}from"radix-ui";import{createContext as C,forwardRef as I,useContext as f,useMemo as _,isValidElement as P,cloneElement as V}from"react";import{cn as i}from"../lib/utils.mjs";import{cva as b}from"class-variance-authority";var W=Object.defineProperty,D=Object.defineProperties,T=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,w=(t,e,a)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,e)=>{for(var a in e||(e={}))y.call(e,a)&&w(t,a,e[a]);if(g)for(var a of g(e))N.call(e,a)&&w(t,a,e[a]);return t},c=(t,e)=>D(t,T(e)),d=(t,e)=>{var a={};for(var r in t)y.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&g)for(var r of g(t))e.indexOf(r)<0&&N.call(t,r)&&(a[r]=t[r]);return a};const m=C({invalid:!1,size:"lg"});function B(t){var e=t,{invalid:a=!1,size:r="lg"}=e,o=d(e,["invalid","size"]);return s(m.Provider,{value:_(()=>({invalid:a,size:r}),[a,r]),children:s(l.Root,n({},o))})}function E(t){var e=t,{className:a}=e,r=d(e,["className"]);return s("div",n({className:i("group relative flex flex-col gap-2",a),"data-slot":"select-wrapper"},r))}function U(t){var e=t,{className:a,children:r}=e,o=d(e,["className","children"]);return s("label",c(n({className:i("pointer-events-none absolute start-3 top-0 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground","group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:!text-sm",a),"data-slot":"select-label"},o),{children:r}))}function G(t){var e=d(t,[]);return s(l.Group,n({"data-slot":"select-group"},e))}function L(t){var e=d(t,[]);return s(l.Value,n({"data-slot":"select-value"},e))}const z=b(["flex w-full items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] hover:border-gray-stroke-emphasis hover:ring-[3px] hover:ring-state-focus disabled:cursor-default disabled:bg-gray-background-soft-muted disabled:hover:border-gray-stroke-muted disabled:hover:ring-0 aria-[invalid]:border-feedback-error-stroke aria-[invalid]:hover:ring-[3px] aria-[invalid]:hover:ring-state-error data-[placeholder]:text-gray-foreground-emphasis *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 disabled:data-[placeholder]:text-gray-foreground-muted [&>span]:line-clamp-1 [&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{size:{lg:["h-12 max-h-12 text-md [&_svg]:size-6","group-has-[[data-slot=select-label]]:h-14"],md:["h-10 max-h-10 text-sm [&_svg]:size-5","group-has-[[data-slot=select-label]]:h-11"]}},defaultVariants:{size:"lg"}}),R=b("data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-secondary-background-soft-emphasis relative flex w-full cursor-default select-none items-center rounded pe-8 ps-2 font-medium text-gray-foreground outline-none hover:cursor-pointer hover:bg-secondary-background-soft-emphasis gap-3",{variants:{size:{lg:"py-2 text-sm [&_svg]:size-5",md:"py-2 text-sm [&_svg]:size-5"}},defaultVariants:{size:"lg"}}),q=I(function(t,e){var a=t,{className:r,children:o}=a,u=d(a,["className","children"]);const{invalid:p,size:v}=f(m);return h(l.Trigger,c(n({ref:e,className:i(z({size:v}),!p&&"[&:not([data-placeholder]):not(:disabled)]:border-gray-stroke-emphasis","group-has-[[data-slot=select-label]]:py-3 group-has-[[data-slot=select-label]]:data-[placeholder]:text-transparent",r),"data-slot":"select-trigger","data-size":v,"aria-invalid":p?"true":void 0},u),{children:[o,s(l.Icon,{asChild:!0,children:s(x,{className:i("flex-shrink-0 text-gray-foreground"),strokeWidth:1.6})})]}))});function A(t){var e=t,{className:a,children:r,position:o="popper"}=e,u=d(e,["className","children","position"]);return s(l.Portal,{children:h(l.Content,c(n({className:i("relative z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-32 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated text-gray-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&_[role=group]]:py-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),"data-slot":"select-content",position:o},u),{children:[s(k,{}),s(l.Viewport,{className:i("p-2",o==="popper"&&"h-[var(--radix-select-trigger-height)]"),children:r}),s(S,{})]}))})}function F(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.Label,n({className:i("px-2 py-2 text-xs font-medium text-gray-foreground-muted",a),"data-slot":"select-header"},r))}function H(t){var e=t,{className:a,children:r,icon:o}=e,u=d(e,["className","children","icon"]);const{size:p}=f(m);return h(l.Item,c(n({className:i(R({size:p}),a),"data-slot":"select-item"},u),{children:[o&&s("span",{className:"flex shrink-0 items-center justify-center text-gray-foreground",children:P(o)?V(o,{strokeWidth:1.6}):o}),s("span",{className:"min-w-0 flex-1 truncate",children:s(l.ItemText,{children:r})}),s("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:s(l.ItemIndicator,{children:s(j,{strokeWidth:1.6,className:"text-secondary-foreground"})})})]}))}function J(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.Separator,n({className:i("-mx-1 my-1 h-px bg-gray-stroke-muted",a),"data-slot":"select-separator"},r))}function k(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.ScrollUpButton,c(n({className:i("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-up-button"},r),{children:s(O,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function S(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.ScrollDownButton,c(n({className:i("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-down-button"},r),{children:s(x,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function K(t){var e=t,{className:a}=e,r=d(e,["className"]);const{invalid:o}=f(m);return s("span",n({className:i("-mt-1 text-xs",o?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"select-text"},r))}export{B as Select,A as SelectContent,G as SelectGroup,F as SelectHeader,H as SelectItem,U as SelectLabel,S as SelectScrollDownButton,k as SelectScrollUpButton,J as SelectSeparator,K as SelectText,q as SelectTrigger,L as SelectValue,E as SelectWrapper,z as selectVariants};
3
+ import{jsxs as h,jsx as s}from"react/jsx-runtime";import{ChevronDown as x,Check as j,ChevronUp as O}from"@medway-ui/icons";import{Select as l}from"radix-ui";import{createContext as C,forwardRef as I,useContext as f,useMemo as _,isValidElement as P,cloneElement as V}from"react";import{cn as i}from"../lib/utils.mjs";import{cva as b}from"class-variance-authority";var W=Object.defineProperty,D=Object.defineProperties,T=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,w=(t,e,a)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,e)=>{for(var a in e||(e={}))y.call(e,a)&&w(t,a,e[a]);if(g)for(var a of g(e))N.call(e,a)&&w(t,a,e[a]);return t},c=(t,e)=>D(t,T(e)),d=(t,e)=>{var a={};for(var r in t)y.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&g)for(var r of g(t))e.indexOf(r)<0&&N.call(t,r)&&(a[r]=t[r]);return a};const m=C({invalid:!1,size:"lg"});function B(t){var e=t,{invalid:a=!1,size:r="lg"}=e,o=d(e,["invalid","size"]);return s(m.Provider,{value:_(()=>({invalid:a,size:r}),[a,r]),children:s(l.Root,n({},o))})}function E(t){var e=t,{className:a}=e,r=d(e,["className"]);return s("div",n({className:i("group relative flex flex-col gap-2",a),"data-slot":"select-wrapper"},r))}function U(t){var e=t,{className:a,children:r}=e,o=d(e,["className","children"]);return s("label",c(n({className:i("pointer-events-none absolute start-3 top-0 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground","group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=select-trigger][data-size=md]]:group-has-[[data-slot=select-trigger][data-placeholder]:not([data-state=open])]:!text-sm",a),"data-slot":"select-label"},o),{children:r}))}function G(t){var e=d(t,[]);return s(l.Group,n({"data-slot":"select-group"},e))}function L(t){var e=d(t,[]);return s(l.Value,n({"data-slot":"select-value"},e))}const z=b(["flex w-full items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] hover:border-gray-stroke-emphasis hover:ring-[3px] hover:ring-state-focus disabled:cursor-default disabled:bg-gray-background-soft-muted disabled:hover:border-gray-stroke-muted disabled:hover:ring-0 aria-[invalid]:border-feedback-error-stroke aria-[invalid]:hover:ring-[3px] aria-[invalid]:hover:ring-state-error data-[placeholder]:text-gray-foreground-emphasis *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 disabled:data-[placeholder]:text-gray-foreground-muted [&>span]:line-clamp-1 [&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{size:{lg:["h-12 max-h-12 text-md [&_svg]:size-6","group-has-[[data-slot=select-label]]:h-14"],md:["h-10 max-h-10 text-sm [&_svg]:size-5","group-has-[[data-slot=select-label]]:h-11"]}},defaultVariants:{size:"lg"}}),R=b("data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-secondary-background-soft-emphasis relative flex w-full cursor-default select-none items-center rounded pe-8 ps-2 font-medium text-gray-foreground outline-none hover:cursor-pointer hover:bg-secondary-background-soft-emphasis gap-3",{variants:{size:{lg:"py-2 text-sm [&_svg]:size-5",md:"py-2 text-sm [&_svg]:size-5"}},defaultVariants:{size:"lg"}}),q=I(function(t,e){var a=t,{className:r,children:o}=a,u=d(a,["className","children"]);const{invalid:p,size:v}=f(m);return h(l.Trigger,c(n({ref:e,className:i(z({size:v}),!p&&"[&:not([data-placeholder]):not(:disabled)]:border-gray-stroke-emphasis","group-has-[[data-slot=select-label]]:py-3 group-has-[[data-slot=select-label]]:data-[placeholder]:text-transparent",r),"data-slot":"select-trigger","data-size":v,"aria-invalid":p?"true":void 0},u),{children:[o,s(l.Icon,{asChild:!0,children:s(x,{className:i("flex-shrink-0 text-gray-foreground"),strokeWidth:1.6})})]}))});function A(t){var e=t,{className:a,children:r,position:o="popper"}=e,u=d(e,["className","children","position"]);return s(l.Portal,{children:h(l.Content,c(n({className:i("relative z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-32 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated text-gray-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&_[role=group]]:py-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),"data-slot":"select-content",position:o},u),{children:[s(k,{}),s(l.Viewport,{className:o==="popper"?"h-[var(--radix-select-trigger-height)] p-2":"p-2",children:r}),s(S,{})]}))})}function F(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.Label,n({className:i("px-2 py-2 text-xs font-medium text-gray-foreground-muted",a),"data-slot":"select-header"},r))}function H(t){var e=t,{className:a,children:r,icon:o}=e,u=d(e,["className","children","icon"]);const{size:p}=f(m);return h(l.Item,c(n({className:i(R({size:p}),a),"data-slot":"select-item"},u),{children:[o&&s("span",{className:"flex shrink-0 items-center justify-center text-gray-foreground",children:P(o)?V(o,{strokeWidth:1.6}):o}),s("span",{className:"min-w-0 flex-1 truncate",children:s(l.ItemText,{children:r})}),s("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:s(l.ItemIndicator,{children:s(j,{strokeWidth:1.6,className:"text-secondary-foreground"})})})]}))}function J(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.Separator,n({className:i("-mx-1 my-1 h-px bg-gray-stroke-muted",a),"data-slot":"select-separator"},r))}function k(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.ScrollUpButton,c(n({className:i("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-up-button"},r),{children:s(O,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function S(t){var e=t,{className:a}=e,r=d(e,["className"]);return s(l.ScrollDownButton,c(n({className:i("flex cursor-default items-center justify-center py-1",a),"data-slot":"select-scroll-down-button"},r),{children:s(x,{size:16,strokeWidth:1.6,className:"text-gray-foreground"})}))}function K(t){var e=t,{className:a}=e,r=d(e,["className"]);const{invalid:o}=f(m);return s("span",n({className:i("-mt-1 text-xs",o?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"select-text"},r))}export{B as Select,A as SelectContent,G as SelectGroup,F as SelectHeader,H as SelectItem,U as SelectLabel,S as SelectScrollDownButton,k as SelectScrollUpButton,J as SelectSeparator,K as SelectText,q as SelectTrigger,L as SelectValue,E as SelectWrapper,z as selectVariants};
4
4
  //# sourceMappingURL=Select.mjs.map
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var s=require("react/jsx-runtime"),c=require("../lib/utils.js"),o=Object.defineProperty,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,u=(r,e,a)=>e in r?o(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,v=(r,e)=>{for(var a in e||(e={}))l.call(e,a)&&u(r,a,e[a]);if(n)for(var a of n(e))i.call(e,a)&&u(r,a,e[a]);return r},f=(r,e)=>{var a={};for(var t in r)l.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(r!=null&&n)for(var t of n(r))e.indexOf(t)<0&&i.call(r,t)&&(a[t]=r[t]);return a};function d(r){var e=r,{className:a}=e,t=f(e,["className"]);return s.jsx("div",v({"data-slot":"skeleton","aria-hidden":!0,className:c.cn("animate-pulse rounded-md bg-gray-150 motion-reduce:animate-none",a)},t))}exports.Skeleton=d;
3
+ "use strict";var s=require("react/jsx-runtime"),c=require("../lib/utils.js"),o=Object.defineProperty,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,u=(r,e,a)=>e in r?o(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,v=(r,e)=>{for(var a in e||(e={}))l.call(e,a)&&u(r,a,e[a]);if(n)for(var a of n(e))i.call(e,a)&&u(r,a,e[a]);return r},d=(r,e)=>{var a={};for(var t in r)l.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(r!=null&&n)for(var t of n(r))e.indexOf(t)<0&&i.call(r,t)&&(a[t]=r[t]);return a};function f(r){var e=r,{className:a}=e,t=d(e,["className"]);return s.jsx("div",v({"data-slot":"skeleton","aria-hidden":!0,className:c.cn("animate-pulse rounded-md bg-gray-150 dark:bg-gray-600 motion-reduce:animate-none",a)},t))}exports.Skeleton=f;
4
4
  //# sourceMappingURL=Skeleton.js.map
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- import{jsx as u}from"react/jsx-runtime";import{cn as c}from"../lib/utils.mjs";var f=Object.defineProperty,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(r,a,e)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e,m=(r,a)=>{for(var e in a||(a={}))l.call(a,e)&&o(r,e,a[e]);if(n)for(var e of n(a))i.call(a,e)&&o(r,e,a[e]);return r},s=(r,a)=>{var e={};for(var t in r)l.call(r,t)&&a.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&n)for(var t of n(r))a.indexOf(t)<0&&i.call(r,t)&&(e[t]=r[t]);return e};function p(r){var a=r,{className:e}=a,t=s(a,["className"]);return u("div",m({"data-slot":"skeleton","aria-hidden":!0,className:c("animate-pulse rounded-md bg-gray-150 motion-reduce:animate-none",e)},t))}export{p as Skeleton};
3
+ import{jsx as u}from"react/jsx-runtime";import{cn as c}from"../lib/utils.mjs";var f=Object.defineProperty,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(r,a,e)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e,m=(r,a)=>{for(var e in a||(a={}))l.call(a,e)&&o(r,e,a[e]);if(n)for(var e of n(a))i.call(a,e)&&o(r,e,a[e]);return r},s=(r,a)=>{var e={};for(var t in r)l.call(r,t)&&a.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&n)for(var t of n(r))a.indexOf(t)<0&&i.call(r,t)&&(e[t]=r[t]);return e};function p(r){var a=r,{className:e}=a,t=s(a,["className"]);return u("div",m({"data-slot":"skeleton","aria-hidden":!0,className:c("animate-pulse rounded-md bg-gray-150 dark:bg-gray-600 motion-reduce:animate-none",e)},t))}export{p as Skeleton};
4
4
  //# sourceMappingURL=Skeleton.mjs.map
@@ -7,7 +7,8 @@ interface TagProps extends ComponentProps<"span">, VariantProps<typeof tagVarian
7
7
  declare const tagVariants: (props?: ({
8
8
  variant?: "regular" | "error" | "warning" | "regular-soft" | "regular-basic" | "emphasis" | "emphasis-soft" | "emphasis-basic" | "error-soft" | "error-basic" | "warning-soft" | "warning-basic" | "success" | "success-soft" | "success-basic" | "gray" | "go" | "gray-soft" | "gray-basic" | "cm" | "cm-soft" | "cm-basic" | "go-soft" | "go-basic" | "cir" | "cir-soft" | "cir-basic" | "ped" | "ped-soft" | "ped-basic" | "prev" | "prev-soft" | "prev-basic" | "ia" | "ia-soft" | "ia-basic" | null | undefined;
9
9
  } & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
10
+ type TagVariant = NonNullable<VariantProps<typeof tagVariants>["variant"]>;
10
11
  declare const Tag: import("react").ForwardRefExoticComponent<Omit<TagProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
11
12
  export { Tag, tagVariants };
12
- export type { TagProps };
13
+ export type { TagProps, TagVariant };
13
14
  //# sourceMappingURL=Tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/components/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,UAAU,QACR,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,YAAY,CAAC,OAAO,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,QAAA,MAAM,WAAW;;8EAuEhB,CAAC;AAoBF,QAAA,MAAM,GAAG,mHAuBP,CAAC;AAEH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/components/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,UAAU,QACR,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,YAAY,CAAC,OAAO,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,QAAA,MAAM,WAAW;;8EAuEhB,CAAC;AAEF,KAAK,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAoB3E,QAAA,MAAM,GAAG,mHAuBP,CAAC;AAEH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"}
@@ -7,7 +7,8 @@ interface TagProps extends ComponentProps<"span">, VariantProps<typeof tagVarian
7
7
  declare const tagVariants: (props?: ({
8
8
  variant?: "regular" | "error" | "warning" | "regular-soft" | "regular-basic" | "emphasis" | "emphasis-soft" | "emphasis-basic" | "error-soft" | "error-basic" | "warning-soft" | "warning-basic" | "success" | "success-soft" | "success-basic" | "gray" | "go" | "gray-soft" | "gray-basic" | "cm" | "cm-soft" | "cm-basic" | "go-soft" | "go-basic" | "cir" | "cir-soft" | "cir-basic" | "ped" | "ped-soft" | "ped-basic" | "prev" | "prev-soft" | "prev-basic" | "ia" | "ia-soft" | "ia-basic" | null | undefined;
9
9
  } & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
10
+ type TagVariant = NonNullable<VariantProps<typeof tagVariants>["variant"]>;
10
11
  declare const Tag: import("react").ForwardRefExoticComponent<Omit<TagProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
11
12
  export { Tag, tagVariants };
12
- export type { TagProps };
13
+ export type { TagProps, TagVariant };
13
14
  //# sourceMappingURL=Tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/components/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,UAAU,QACR,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,YAAY,CAAC,OAAO,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,QAAA,MAAM,WAAW;;8EAuEhB,CAAC;AAoBF,QAAA,MAAM,GAAG,mHAuBP,CAAC;AAEH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/components/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,UAAU,QACR,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,YAAY,CAAC,OAAO,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,QAAA,MAAM,WAAW;;8EAuEhB,CAAC;AAEF,KAAK,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAoB3E,QAAA,MAAM,GAAG,mHAuBP,CAAC;AAEH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  "use client";
3
- "use strict";var a=require("react/jsx-runtime"),w=require("react"),d=require("radix-ui"),h=require("class-variance-authority"),c=require("../lib/utils.js"),_=Object.defineProperty,j=Object.defineProperties,O=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,b=(r,e,o)=>e in r?_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,p=(r,e)=>{for(var o in e||(e={}))s.call(e,o)&&b(r,o,e[o]);if(t)for(var o of t(e))u.call(e,o)&&b(r,o,e[o]);return r},x=(r,e)=>j(r,O(e)),y=(r,e)=>{var o={};for(var n in r)s.call(r,n)&&e.indexOf(n)<0&&(o[n]=r[n]);if(r!=null&&t)for(var n of t(r))e.indexOf(n)<0&&u.call(r,n)&&(o[n]=r[n]);return o};const m=h.cva("inline-flex items-center justify-center rounded-md px-2 py-1 text-xs font-semibold w-fit min-w-0 max-w-full whitespace-nowrap gap-1.5 transition-colors overflow-hidden max-h-6",{variants:{variant:{regular:"bg-primary-background-fill text-primary-foreground-onfill fill-primary-foreground-onfill","regular-soft":"bg-primary-background-soft text-primary-foreground fill-primary-foreground","regular-basic":"bg-transparent text-primary-foreground fill-primary-foreground",emphasis:"bg-secondary-background-fill text-secondary-foreground-onfill fill-secondary-foreground-onfill","emphasis-soft":"bg-secondary-background-soft text-secondary-foreground fill-secondary-foreground","emphasis-basic":"bg-transparent text-secondary-foreground fill-secondary-foreground",gray:"bg-gray-background-fill text-gray-foreground-onfill fill-gray-foreground-onfill","gray-soft":"bg-gray-background-soft text-gray-foreground fill-gray-foreground","gray-basic":"bg-transparent text-gray-foreground fill-gray-foreground",success:"bg-green-background-fill text-green-foreground-onfill fill-green-foreground-onfill","success-soft":"bg-green-background-soft text-green-foreground fill-green-foreground","success-basic":"bg-transparent text-green-foreground fill-green-foreground",error:"bg-red-background-fill text-red-foreground-onfill fill-red-foreground-onfill","error-soft":"bg-red-background-soft text-red-foreground fill-red-foreground","error-basic":"bg-transparent text-red-foreground fill-red-foreground",warning:"bg-yellow-background-fill text-yellow-foreground-onfill fill-yellow-foreground-onfill","warning-soft":"bg-yellow-background-soft text-yellow-foreground fill-yellow-foreground","warning-basic":"bg-transparent text-yellow-foreground fill-yellow-foreground",cm:"bg-cm-background-fill text-cm-foreground-onfill fill-cm-foreground-onfill","cm-soft":"bg-cm-background-soft text-cm-foreground fill-cm-foreground","cm-basic":"bg-transparent text-cm-foreground fill-cm-foreground",go:"bg-go-background-fill text-go-foreground-onfill fill-go-foreground-onfill","go-soft":"bg-go-background-soft text-go-foreground fill-go-foreground","go-basic":"bg-transparent text-go-foreground fill-go-foreground",cir:"bg-cir-background-fill text-cir-foreground-onfill fill-cir-foreground-onfill","cir-soft":"bg-cir-background-soft text-cir-foreground fill-cir-foreground","cir-basic":"bg-transparent text-cir-foreground fill-cir-foreground",ped:"bg-ped-background-fill text-ped-foreground-onfill fill-ped-foreground-onfill","ped-soft":"bg-ped-background-soft text-ped-foreground fill-ped-foreground","ped-basic":"bg-transparent text-ped-foreground fill-ped-foreground",prev:"bg-prev-background-fill text-prev-foreground-onfill fill-prev-foreground-onfill","prev-soft":"bg-prev-background-soft text-prev-foreground fill-prev-foreground","prev-basic":"bg-transparent text-prev-foreground fill-prev-foreground",ia:"[background:linear-gradient(90deg,var(--color-secondary-darken-1)_0%,var(--color-cm)_100%)] text-primary-foreground-onfill fill-primary-foreground-onfill","ia-soft":"[background:linear-gradient(90deg,color-mix(in_srgb,var(--color-secondary-darken-1)_15%,transparent)_0%,color-mix(in_srgb,var(--color-cm)_15%,transparent)_100%)] text-secondary-foreground fill-secondary-foreground","ia-basic":"bg-transparent text-secondary-foreground [&_[data-slot=tag-text]]:bg-clip-text [&_[data-slot=tag-text]]:text-transparent [&_[data-slot=tag-text]]:[-webkit-background-clip:text] [&_[data-slot=tag-text]]:[background-image:linear-gradient(90deg,var(--color-secondary-darken-1)_0%,var(--color-cm)_100%)]"}},defaultVariants:{variant:"regular"}});function N(r){var e=r,{className:o,icon:n}=e,l=y(e,["className","icon"]);return a.jsx("span",x(p({"data-slot":"tag-icon",className:c.cn("[&>svg]:size-3.5",o)},l),{children:n}))}const q=w.forwardRef(function(r,e){var o=r,{className:n,variant:l,asChild:g=!1,icon:f,children:i}=o,v=y(o,["className","variant","asChild","icon","children"]);const k=g?d.Slot.Slot:"span";return a.jsxs(k,x(p({ref:e,"data-slot":"tag",className:c.cn(m({variant:l}),n)},v),{children:[f&&a.jsx(N,{icon:f}),g?a.jsx(d.Slot.Slottable,{children:i}):a.jsx("span",{"data-slot":"tag-text",className:"min-w-0 truncate",children:i})]}))});exports.Tag=q,exports.tagVariants=m;
3
+ "use strict";var a=require("react/jsx-runtime"),w=require("react"),d=require("radix-ui"),h=require("class-variance-authority"),c=require("../lib/utils.js"),_=Object.defineProperty,j=Object.defineProperties,O=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,b=(r,e,o)=>e in r?_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,p=(r,e)=>{for(var o in e||(e={}))s.call(e,o)&&b(r,o,e[o]);if(t)for(var o of t(e))u.call(e,o)&&b(r,o,e[o]);return r},x=(r,e)=>j(r,O(e)),y=(r,e)=>{var o={};for(var n in r)s.call(r,n)&&e.indexOf(n)<0&&(o[n]=r[n]);if(r!=null&&t)for(var n of t(r))e.indexOf(n)<0&&u.call(r,n)&&(o[n]=r[n]);return o};const m=h.cva("inline-flex items-center justify-center rounded-md px-2 py-1 text-xs font-semibold w-fit min-w-0 max-w-full whitespace-nowrap gap-1.5 transition-colors overflow-hidden max-h-6",{variants:{variant:{regular:"bg-primary-background-fill text-primary-foreground-onfill fill-primary-foreground-onfill","regular-soft":"bg-primary-background-soft text-primary-foreground fill-primary-foreground","regular-basic":"bg-transparent text-primary-foreground fill-primary-foreground",emphasis:"bg-secondary-background-fill text-secondary-foreground-onfill fill-secondary-foreground-onfill","emphasis-soft":"bg-secondary-background-soft text-secondary-foreground fill-secondary-foreground","emphasis-basic":"bg-transparent text-secondary-foreground fill-secondary-foreground",gray:"bg-gray-background-fill text-gray-foreground-onfill fill-gray-foreground-onfill","gray-soft":"bg-gray-background-soft text-gray-foreground fill-gray-foreground","gray-basic":"bg-transparent text-gray-foreground fill-gray-foreground",success:"bg-green-background-fill text-green-foreground-onfill fill-green-foreground-onfill","success-soft":"bg-green-background-soft text-green-foreground fill-green-foreground","success-basic":"bg-transparent text-green-foreground fill-green-foreground",error:"bg-red-background-fill text-red-foreground-onfill fill-red-foreground-onfill","error-soft":"bg-red-background-soft text-red-foreground fill-red-foreground","error-basic":"bg-transparent text-red-foreground fill-red-foreground",warning:"bg-yellow-background-fill text-yellow-foreground-onfill fill-yellow-foreground-onfill","warning-soft":"bg-yellow-background-soft text-yellow-foreground fill-yellow-foreground","warning-basic":"bg-transparent text-yellow-foreground fill-yellow-foreground",cm:"bg-cm-background-fill text-cm-foreground-onfill fill-cm-foreground-onfill","cm-soft":"bg-cm-background-soft text-cm-foreground fill-cm-foreground","cm-basic":"bg-transparent text-cm-foreground fill-cm-foreground",go:"bg-go-background-fill text-go-foreground-onfill fill-go-foreground-onfill","go-soft":"bg-go-background-soft text-go-foreground fill-go-foreground","go-basic":"bg-transparent text-go-foreground fill-go-foreground",cir:"bg-cir-background-fill text-cir-foreground-onfill fill-cir-foreground-onfill","cir-soft":"bg-cir-background-soft text-cir-foreground fill-cir-foreground","cir-basic":"bg-transparent text-cir-foreground fill-cir-foreground",ped:"bg-ped-background-fill text-ped-foreground-onfill fill-ped-foreground-onfill","ped-soft":"bg-ped-background-soft text-ped-foreground fill-ped-foreground","ped-basic":"bg-transparent text-ped-foreground fill-ped-foreground",prev:"bg-prev-background-fill text-prev-foreground-onfill fill-prev-foreground-onfill","prev-soft":"bg-prev-background-soft text-prev-foreground fill-prev-foreground","prev-basic":"bg-transparent text-prev-foreground fill-prev-foreground",ia:"[background:linear-gradient(90deg,var(--color-secondary-darken-1)_0%,var(--color-cm)_100%)] text-primary-foreground-onfill fill-primary-foreground-onfill","ia-soft":"[background:linear-gradient(90deg,color-mix(in_srgb,var(--color-secondary-darken-1)_15%,transparent)_0%,color-mix(in_srgb,var(--color-cm)_15%,transparent)_100%)] text-secondary-foreground fill-secondary-foreground","ia-basic":"bg-transparent text-secondary-foreground [&_[data-slot=tag-text]]:bg-clip-text [&_[data-slot=tag-text]]:text-transparent [&_[data-slot=tag-text]]:[-webkit-background-clip:text] [&_[data-slot=tag-text]]:[background-image:linear-gradient(90deg,var(--color-secondary-darken-1)_0%,var(--color-cm)_100%)]"}},defaultVariants:{variant:"regular"}});function N(r){var e=r,{className:o,icon:n}=e,l=y(e,["className","icon"]);return a.jsx("span",x(p({"data-slot":"tag-icon",className:c.cn("[&>svg]:size-3.5",o)},l),{children:n}))}const S=w.forwardRef(function(r,e){var o=r,{className:n,variant:l,asChild:g=!1,icon:f,children:i}=o,v=y(o,["className","variant","asChild","icon","children"]);const k=g?d.Slot.Slot:"span";return a.jsxs(k,x(p({ref:e,"data-slot":"tag",className:c.cn(m({variant:l}),n)},v),{children:[f&&a.jsx(N,{icon:f}),g?a.jsx(d.Slot.Slottable,{children:i}):a.jsx("span",{"data-slot":"tag-text",className:"min-w-0 truncate",children:i})]}))});exports.Tag=S,exports.tagVariants=m;
4
4
  //# sourceMappingURL=Tag.js.map