@owodesign/owoui 0.1.6 → 0.1.7-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +2 -2
- package/dist/index.d.ts +7 -3
- package/dist/index.min.js +2895 -1
- package/dist/storybook/index.css +2 -2
- package/dist/storybook/index.min.js +6910 -170
- package/dist/storybook-static/assets/index-BqGLqINX.css +1 -0
- package/dist/storybook-static/assets/index-DIFPlPRj.js +178 -0
- package/dist/storybook-static/index.html +6 -6
- package/dist/style.css +2 -2
- package/dist/tokens.min.js +195 -1
- package/package.json +11 -7
- package/dist/storybook-static/app.css +0 -597
- package/dist/storybook-static/assets/main.css +0 -1
- package/dist/storybook-static/assets/main.js +0 -307
package/dist/index.min.js
CHANGED
|
@@ -1 +1,2895 @@
|
|
|
1
|
-
import{clsx as To}from"clsx";import{useState as ko}from"react";var it={};import{jsx as Xe}from"react/jsx-runtime";function Po(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function st({src:e,alt:t,name:o,size:r="md",tone:a="neutral",className:i}){let[n,c]=ko(!1),d=e&&!n,u=o?Po(o):"?";return Xe("span",{"data-tone":a,"data-size":r,className:To("owo-avatar",it.root,i),children:d?Xe("img",{src:e,alt:t??o??"",onError:()=>c(!0)}):Xe("span",{"aria-label":t??o,children:u})})}import{clsx as Co}from"clsx";var dt={};import{jsx as Io}from"react/jsx-runtime";function ct({tone:e="neutral",variant:t="soft",size:o="xs",className:r,children:a,...i}){return Io("span",{"data-tone":e,"data-variant":t,"data-size":o,className:Co("owo-badge",dt.root,r),...i,children:a})}import{clsx as Xo}from"clsx";import{clsx as Ro}from"clsx";var lt={};import{jsx as k,jsxs as ae}from"react/jsx-runtime";var So={xs:12,sm:14,md:16,lg:24};function Lo({px:e}){let o=Math.PI*2*9;return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[k("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",opacity:"0.2"}),k("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:`${o*.28} ${o*.72}`})]})}function Do({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[k("path",{d:"M12 2a10 10 0 0 1 10 10",opacity:"0.9"}),k("path",{d:"M12 2a10 10 0 0 0-7.07 2.93",opacity:"0.2"}),k("path",{d:"M4.93 4.93A10 10 0 0 0 2 12",opacity:"0.2"}),k("path",{d:"M2 12a10 10 0 0 0 2.93 7.07",opacity:"0.2"}),k("path",{d:"M4.93 19.07A10 10 0 0 0 12 22",opacity:"0.2"}),k("path",{d:"M12 22a10 10 0 0 0 7.07-2.93",opacity:"0.2"}),k("path",{d:"M19.07 19.07A10 10 0 0 0 22 12",opacity:"0.2"})]})}function Eo({px:e}){return k("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3,4,5,6,7].map(o=>{let r=o/8*360,a=.15+o/8*.85;return k("circle",{cx:"12",cy:"3.5",r:"1.8",fill:"currentColor",opacity:a,transform:`rotate(${r} 12 12)`},o)})})}function zo({px:e}){return k("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3].map(t=>ae("rect",{x:3+t*5.5,y:"4",width:"3",height:"16",rx:"1.5",fill:"currentColor",opacity:"0.3",children:[k("animate",{attributeName:"opacity",values:"0.3;1;0.3",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),k("animate",{attributeName:"height",values:"16;8;16",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),k("animate",{attributeName:"y",values:"4;8;4",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"})]},t))})}function Ho({px:e}){let t=e*.14,o=e*.33,r=e/2-o,a=e/2,i=e/2+o,n=e/2;return k("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[r,a,i].map((c,d)=>ae("circle",{cx:c,cy:n,r:t,fill:"currentColor",opacity:"0.4",children:[k("animate",{attributeName:"cy",values:`${n};${n-e*.25};${n}`,dur:"0.6s",begin:`${d*.12}s`,repeatCount:"indefinite",calcMode:"spline",keySplines:"0.4 0 0.2 1;0.4 0 0.2 1"}),k("animate",{attributeName:"opacity",values:"0.4;1;0.4",dur:"0.6s",begin:`${d*.12}s`,repeatCount:"indefinite"})]},d))})}function Ao({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[ae("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",opacity:"0",children:[k("animate",{attributeName:"r",values:"4;10;4",dur:"1.2s",repeatCount:"indefinite"}),k("animate",{attributeName:"opacity",values:"0.8;0.1;0.8",dur:"1.2s",repeatCount:"indefinite"})]}),k("circle",{cx:"12",cy:"12",r:"3.5",fill:"currentColor",opacity:"0.7"})]})}function Bo({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[k("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:"0.15"}),k("circle",{cx:"12",cy:"4",r:"2.2",fill:"currentColor",children:k("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.9s",repeatCount:"indefinite"})}),k("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor",opacity:"0.5",children:k("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"-360 12 12",dur:"0.9s",repeatCount:"indefinite"})})]})}function Oo({px:e}){let t=e*.14,o=e*.33,r=e/2-o,a=e/2,i=e/2+o,n=e/2;return k("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[r,a,i].map((c,d)=>k("circle",{cx:c,cy:n,r:t,fill:"currentColor",opacity:"0.25",children:k("animate",{attributeName:"opacity",values:"0.25;1;0.25",dur:"0.9s",begin:`${d*.2}s`,repeatCount:"indefinite"})},d))})}var Vo={ring:Lo,arc:Do,dots:Eo,bars:zo,bounce:Ho,pulse:Ao,orbit:Bo,flow:Oo},Fo=new Set(["ring","arc","dots"]);function Ie({variant:e="ring",size:t="md",className:o,label:r}){let a=typeof t=="number"?t:So[t],i=Vo[e];return k("span",{"aria-hidden":!r,"aria-label":r,role:r?"img":void 0,"data-animate":Fo.has(e)?"spin":void 0,className:Ro("owo-spinner",lt.root,o),children:k(i,{px:a})})}var ce={};import{Fragment as Ko,jsx as ne,jsxs as Uo}from"react/jsx-runtime";function pt({className:e}){return Xo("owo-button",ce.root,e)}function be(e){let{variant:t="secondary",size:o="md",loading:r=!1,leadingIcon:a,trailingIcon:i,className:n,children:c,...d}=e,u=Uo(Ko,{children:[r?ne("span",{className:ce.icon,children:ne(Ie,{size:o==="xs"?"xs":o==="sm"?"sm":o==="xl"?"lg":"md"})}):a?ne("span",{className:ce.icon,children:a}):null,ne("span",{className:ce.label,children:c}),!r&&i?ne("span",{className:ce.icon,children:i}):null]}),s=pt({variant:t,size:o,loading:r,className:n});if("href"in e&&e.href){let{href:l,...b}=d;return ne("a",{href:l,"data-variant":t,"data-size":o,"data-loading":r?"true":void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,className:s,onClick:r?p=>p.preventDefault():void 0,...b,children:u})}let m=d;return ne("button",{type:m.type??"button","data-variant":t,"data-size":o,"data-loading":r?"true":void 0,disabled:m.disabled||r,className:s,...m,children:u})}import{clsx as q}from"clsx";import{createContext as _o,useContext as qo,useEffect as Go,useId as Yo,useMemo as Jo,useRef as ut,useState as mt}from"react";var ee={};import{jsx as G,jsxs as er}from"react/jsx-runtime";var gt=_o(null);function ft(e){let t=qo(gt);if(!t)throw new Error(`${e} must be used within Collapsible.Root`);return t}function Zo({open:e,defaultOpen:t,onOpenChange:o}){let[r,a]=mt(t??!1),i=e!==void 0,n=i?e:r;function c(d){i||a(d),o?.(d)}return[n,c]}function Ke({children:e,open:t,defaultOpen:o,onOpenChange:r,classNames:a,className:i,...n}){let[c,d]=Zo({open:t,defaultOpen:o,onOpenChange:r}),u=Yo(),s=Jo(()=>({open:c,setOpen:d,contentId:u,classNames:a}),[u,c,d,a]);return G(gt.Provider,{value:s,children:G("div",{"data-state":c?"open":"closed","data-scope":"collapsible",className:q("owo-collapsible",ee.root,i),...n,children:e})})}function bt({children:e,icon:t,indicator:o,iconPosition:r="start",className:a,onClick:i,...n}){let{open:c,setOpen:d,contentId:u,classNames:s}=ft("Collapsible.Trigger"),l=t!==void 0||o!==void 0?er("span",{"data-part":"triggerInner",className:q(ee.triggerInner,s?.triggerInner),children:[t&&r==="start"?G("span",{"data-part":"triggerIcon","aria-hidden":"true",className:q(ee.triggerIcon,s?.triggerIcon),children:t}):null,G("span",{"data-part":"triggerLabel",className:q(ee.triggerLabel,s?.triggerLabel),children:e}),t&&r==="end"?G("span",{"data-part":"triggerIcon","aria-hidden":"true",className:q(ee.triggerIcon,s?.triggerIcon),children:t}):null,o?G("span",{"data-part":"triggerIndicator","aria-hidden":"true",className:q(ee.triggerIndicator,s?.triggerIndicator),children:o}):null]}):e;return G("button",{type:"button","aria-expanded":c,"aria-controls":u,"data-state":c?"open":"closed","data-scope":"collapsible","data-part":"trigger",className:q(s?.trigger,a),onClick:b=>{i?.(b),b.defaultPrevented||d(!c)},...n,children:l})}function ht({children:e,className:t,...o}){let{open:r,contentId:a,classNames:i}=ft("Collapsible.Content"),[n,c]=mt(r),d=ut(null),u=ut(null);return Go(()=>{let s=d.current,m=u.current;if(!s||!m)return;let l=0,b=0,p=()=>{s.style.height="auto",s.style.overflow="visible"};if(r&&c(!0),!n&&!r)return;let f=h=>{h.target!==s||h.propertyName!=="height"||(s.removeEventListener("transitionend",f),r?p():c(!1))};return(()=>{let h=m.scrollHeight;if(s.style.overflow="hidden",r){s.style.height="0px",l=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",f),s.style.height=`${h}px`}),b=window.setTimeout(p,240);return}s.style.height=`${h}px`,l=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",f),s.style.height="0px"}),b=window.setTimeout(()=>c(!1),240)})(),()=>{window.cancelAnimationFrame(l),window.clearTimeout(b),s.removeEventListener("transitionend",f)}},[r,n]),!n&&!r?null:G("div",{id:a,ref:d,"data-state":r?"open":"closed","data-scope":"collapsible","data-part":"content","aria-hidden":!r,className:q(i?.content,t),...o,children:G("div",{ref:u,"data-part":"contentInner",className:q(ee.contentInner,i?.contentInner),children:e})})}var jo=Object.assign(Ke,{Root:Ke,Trigger:bt,Content:ht}),Qo=jo;import{createContext as cr,useCallback as wt,useContext as lr,useRef as pr,useState as ur}from"react";import{clsx as le}from"clsx";import{createContext as or,useEffect as rr,useRef as vt,useCallback as ar,useContext as Ue}from"react";var he={};import{jsx as pe,jsxs as dr}from"react/jsx-runtime";var Ne=or(void 0);function nr({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"header",className:le(r?.header,e),...o,children:t})}function ir({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"body",className:le(r?.body,e),...o,children:t})}function sr({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"footer",className:le(r?.footer,e),...o,children:t})}function W({open:e,onClose:t,size:o="sm",children:r,className:a,overlayClassName:i,panelClassName:n,classNames:c,...d}){let u=vt(null),s=vt(null),m=ar(l=>{l.key==="Escape"&&(l.stopPropagation(),t())},[t]);return rr(()=>(e?(s.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{let l=u.current;if(!l)return;let b=l.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b?b.focus():l.focus()}),document.addEventListener("keydown",m)):(document.body.style.overflow="",s.current?.focus()),()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}),[e,m]),e?pe(Ne.Provider,{value:c,children:dr("div",{"data-state":"open","data-scope":"dialog","data-part":"overlay",className:le("owo-dialog-overlay",he.overlay,c?.overlay),children:[pe("button",{type:"button","aria-label":"Close dialog","data-state":"open","data-scope":"dialog","data-part":"backdrop",className:le("owo-dialog-backdrop",i,c?.backdrop),onClick:t}),pe("div",{ref:u,role:"dialog","aria-modal":"true",tabIndex:-1,"data-state":"open","data-size":o,className:le("owo-dialog",he.panel,n,a),...d,children:r})]})}):null}W.Header=nr;W.Body=ir;W.Footer=sr;import{Fragment as fr,jsx as ue,jsxs as We}from"react/jsx-runtime";var xt=cr(null);function mr(){let e=lr(xt);if(!e)throw new Error("useConfirm must be used within <ConfirmProvider>");return e}function gr({children:e}){let[t,o]=ur(null),r=pr(null),a=wt(n=>(r.current&&r.current.resolve(!1),new Promise(c=>{let d={options:n,resolve:c};r.current=d,o(d)})),[]),i=wt(n=>{r.current&&(r.current.resolve(n),r.current=null),o(null)},[]);return We(xt.Provider,{value:a,children:[e,ue(W,{open:t!==null,onClose:()=>i(!1),children:t&&We(fr,{children:[ue(W.Header,{children:t.options.title}),ue(W.Body,{children:typeof t.options.description=="string"?ue("p",{className:he.confirmDescription,children:t.options.description}):t.options.description}),We(W.Footer,{children:[ue(be,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:t.options.cancelLabel??"\u53D6\u6D88"}),ue(be,{variant:t.options.variant??"primary",size:"sm",onClick:()=>i(!0),children:t.options.confirmLabel??"\u786E\u8BA4"})]})]})})]})}import{clsx as oe}from"clsx";import{autoUpdate as hr,computePosition as vr,flip as wr,offset as xr,shift as yr}from"@floating-ui/dom";import{Children as Tr,cloneElement as kr,createContext as yt,isValidElement as Pr,useCallback as A,useContext as _e,useEffect as ie,useId as Re,useLayoutEffect as Mr,useMemo as Le,useRef as te,useState as ve}from"react";import{createPortal as Cr}from"react-dom";var O={};import{jsx as B,jsxs as Ct}from"react/jsx-runtime";var Tt=yt(null),qe=yt(null);function se(e){let t=_e(Tt);if(!t)throw new Error(`${e} must be used within DropdownMenu.`);return t}function kt(e){let t=_e(qe);if(!t)throw new Error(`${e} must be used within DropdownMenu.Content.`);return t}function me(e,t){return o=>{e?.(o),t(o)}}function Pt(...e){return t=>{for(let o of e)o&&(typeof o=="function"?o(t):o.current=t)}}function Se(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Se).join(" "):!e||typeof e=="boolean"?"":Pr(e)?Se(e.props.children):""}function Ir(e){return[...e].sort((t,o)=>{let r=t.ref.current,a=o.ref.current;if(!r||!a)return 0;let i=r.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Nr(e,t){return t==="center"?e:`${e}-${t}`}function Rr(e){let t=e.split("-");return{side:t[0],align:t[1]??"center"}}function Mt({open:e,defaultOpen:t=!1,onOpenChange:o,side:r="bottom",align:a="start",sideOffset:i=8,alignOffset:n=0,collisionPadding:c=8,portal:d=!0,contentRole:u="menu",classNames:s,children:m}){let l=_e(qe),[b,p]=ve(t),f=e!==void 0,P=f?e:b,h=te(null),v=te(null),x=te("selected"),C=Re(),I=Re(),y=A(M=>{f||p(M),o?.(M)},[f,o]),D=A(()=>{y(!1)},[y]),N=A(()=>{y(!1),l?.closeTree()},[l,y]),z=A(()=>{y(!P)},[P,y]),H=A(()=>{h.current?.focus()},[]),g=Le(()=>({open:P,setOpen:y,toggleOpen:z,triggerRef:h,contentRef:v,side:r,align:a,sideOffset:i,alignOffset:n,collisionPadding:c,portal:d,contentRole:u,triggerId:C,contentId:I,focusIntentRef:x,parentList:l,isSubmenu:!!l,closeSelf:D,closeTree:N,focusTrigger:H,classNames:s}),[P,a,n,s,D,N,c,u,l,d,y,r,i,z,C,I,H]);return B(Tt.Provider,{value:g,children:m})}function Sr({asChild:e=!1,disabled:t=!1,className:o,children:r}){let{open:a,setOpen:i,toggleOpen:n,triggerRef:c,contentRole:d,triggerId:u,contentId:s,focusIntentRef:m,isSubmenu:l,classNames:b}=se("DropdownMenu.Trigger"),p=Tr.only(r),f=p.props??{},P=typeof f.className=="string"?f.className:void 0,h={id:u,"data-state":a?"open":"closed","aria-expanded":a,"aria-haspopup":d,"aria-controls":a?s:void 0,onClick:me(f.onClick,v=>{if(t){v.preventDefault();return}m.current="selected",n()}),onKeyDown:me(f.onKeyDown,v=>{t||(v.key==="ArrowDown"?(v.preventDefault(),m.current="first",i(!0)):v.key==="ArrowUp"?(v.preventDefault(),m.current="last",i(!0)):!l&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),m.current="selected",n()))})};return e?kr(p,{...h,ref:Pt(c,f.ref),className:oe(O.trigger,b?.trigger,o,P),type:p.type==="button"?f.type??"button":f.type}):B("button",{ref:c,disabled:t,type:"button","data-scope":"dropdown-menu","data-part":"trigger",className:oe(O.trigger,b?.trigger,o),...h,children:p})}function Lr({className:e,children:t,style:o,matchTriggerWidth:r=!1,maxHeight:a=320,...i}){let{open:n,setOpen:c,triggerRef:d,contentRef:u,side:s,align:m,sideOffset:l,alignOffset:b,collisionPadding:p,portal:f,contentRole:P,triggerId:h,contentId:v,focusIntentRef:x,parentList:C,isSubmenu:I,closeSelf:y,closeTree:D,focusTrigger:N,classNames:z}=se("DropdownMenu.Content"),H=te([]),[g,M]=ve(null),[V,J]=ve(null),[F,Z]=ve(null),[$,ot]=ve(!1),fe=te(""),j=te(null),Ce=A(w=>(H.current=[...H.current.filter(R=>R.id!==w.id),w],()=>{H.current=H.current.filter(R=>R.id!==w.id)}),[]),E=A(()=>Ir(H.current),[]),rt=A(w=>{x.current=w},[x]);ie(()=>{ot(!0)},[]);let wo=Le(()=>({role:P,highlightedId:g,setHighlightedId:M,registerItem:Ce,getItems:E,requestFocusIntent:rt,closeTree:D,closeSelf:y,focusTrigger:N,activeSubmenuId:V,setActiveSubmenuId:J,contentRef:u}),[V,y,D,u,P,N,E,g,Ce,rt]);Mr(()=>!n||!$||!d.current||!u.current?void 0:hr(d.current,u.current,()=>{!d.current||!u.current||vr(d.current,u.current,{placement:Nr(s,m),strategy:"fixed",middleware:[xr({mainAxis:l,crossAxis:b}),wr({padding:p}),yr({padding:p})]}).then(({x:R,y:T,placement:S})=>{let X=Rr(S);Z({top:T,left:R,side:X.side,align:X.align})})}),[m,b,p,u,$,n,s,l,d]),ie(()=>{if(!n){M(null),J(null);return}let w=E().filter(T=>!T.disabled);if(w.length===0)return;let R=w[0];x.current==="last"?R=w[w.length-1]:x.current==="selected"&&(R=w.find(T=>T.selected)??w[0]),M(R.id),requestAnimationFrame(()=>{u.current?.focus(),R.ref.current?.scrollIntoView({block:"nearest"})})},[u,x,E,n]),ie(()=>{if(!n)return;function w(R){let T=R.target,S=d.current?.contains(T),X=u.current?.contains(T);if(!S&&!X){let U=C?.contentRef.current?.contains(T);if(I&&U){y(),C?.setActiveSubmenuId(null);return}D()}}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[y,D,u,I,n,C,d]),ie(()=>{if(n)return()=>{j.current&&clearTimeout(j.current)}},[n]);let Q=A(w=>{if(M(w),!w){J(null);return}E().find(T=>T.id===w)?.submenu||J(null)},[E]),$e=A((w,R="first")=>{let T=E().filter(_=>!_.disabled);if(T.length===0)return;let S=T.findIndex(_=>_.id===g);if(S===-1){Q(R==="last"?T[T.length-1].id:T[0].id);return}let X=(S+w+T.length)%T.length,U=T[X];Q(U.id),U.ref.current?.scrollIntoView({block:"nearest"})},[E,g,Q]),at=A(w=>{let R=w.length===1?w.toLowerCase():"";if(!R)return;j.current&&clearTimeout(j.current),fe.current+=R,j.current=setTimeout(()=>{fe.current="",j.current=null},350);let T=E().filter(_=>!_.disabled);if(T.length===0)return;let S=T.findIndex(_=>_.id===g),U=(S>=0?[...T.slice(S+1),...T.slice(0,S+1)]:T).find(_=>_.textValue.toLowerCase().startsWith(fe.current));U&&(Q(U.id),U.ref.current?.scrollIntoView({block:"nearest"}))},[E,g,Q]),xo=A(w=>{let R=E(),T=R.find(S=>S.id===g)??null;switch(w.key){case"ArrowDown":w.preventDefault(),$e(1);break;case"ArrowUp":w.preventDefault(),$e(-1,"last");break;case"Home":w.preventDefault();{let S=R.find(X=>!X.disabled);S&&Q(S.id)}break;case"End":w.preventDefault();{let S=R.filter(U=>!U.disabled),X=S[S.length-1];X&&Q(X.id)}break;case"Enter":case" ":T&&!T.disabled&&(w.preventDefault(),T.click());break;case"ArrowRight":T?.submenu&&(w.preventDefault(),T.openSubmenu?.());break;case"ArrowLeft":I&&(w.preventDefault(),y(),N(),C?.setActiveSubmenuId(null));break;case"Tab":D();break;case"Escape":w.preventDefault(),y(),N(),I&&C?.setActiveSubmenuId(null);break;default:at(w.key)}},[y,D,N,E,at,g,Q,I,$e,C]);if(!n||!$)return null;let nt=B(qe.Provider,{value:wo,children:B("div",{ref:u,id:v,role:P,tabIndex:-1,"aria-labelledby":P==="menu"?h:void 0,"data-state":"open","data-side":F?.side??s,"data-align":F?.align??m,"data-scope":"dropdown-menu","data-part":"content",className:oe(O.content,z?.content,e),style:{...o,position:"fixed",top:F?.top??0,left:F?.left??0,maxHeight:a,minWidth:r?d.current?.getBoundingClientRect().width:void 0},onKeyDown:xo,...i,children:t})});return f?Cr(nt,document.body):nt}function Dr({className:e,children:t,...o}){let{classNames:r}=se("DropdownMenu.Group");return B("div",{"data-scope":"dropdown-menu","data-part":"group",className:oe(r?.group,e),...o,children:t})}function Er({className:e,children:t,...o}){let{classNames:r}=se("DropdownMenu.Label");return B("div",{"data-scope":"dropdown-menu","data-part":"label",className:oe(r?.label,e),...o,children:t})}function zr({className:e,...t}){let{classNames:o}=se("DropdownMenu.Separator");return B("div",{role:"separator","data-scope":"dropdown-menu","data-part":"separator",className:oe(o?.separator,e),...t})}function Hr({className:e,children:t,inset:o=!1,disabled:r=!1,selected:a=!1,destructive:i=!1,closeOnSelect:n=!0,shortcut:c,indicator:d,onSelect:u,onMouseEnter:s,onClick:m,...l}){let b=Re(),p=te(null),{role:f,highlightedId:P,setHighlightedId:h,registerItem:v,closeTree:x,setActiveSubmenuId:C}=kt("DropdownMenu.Item"),{classNames:I}=se("DropdownMenu.Item"),y=Le(()=>Se(t),[t]),D=P===b,N=A(()=>{r||(u?.(),n&&x())},[n,x,r,u]);return ie(()=>v({id:b,ref:p,disabled:r,submenu:!1,selected:a,textValue:y,closeOnSelect:n,click:N}),[n,r,N,b,v,a,y]),Ct("button",{ref:p,id:b,type:"button",role:f==="listbox"?"option":"menuitem",tabIndex:-1,disabled:r,"aria-selected":f==="listbox"?a:void 0,"data-highlighted":D||void 0,"data-selected":a||void 0,"data-disabled":r||void 0,"data-destructive":i||void 0,"data-scope":"dropdown-menu","data-part":"item",className:oe(o&&O.itemInset,I?.item,e),onMouseEnter:me(s,()=>{r||(h(b),C(null))}),onClick:me(m,z=>{z.preventDefault(),N()}),...l,children:[B("span",{className:O.itemMain,children:t}),c?B("span",{className:O.shortcut,children:c}):null,a?B("span",{className:O.indicator,children:d??"\u2713"}):null]})}function Ar(e){return B(Mt,{side:"right",align:"start",sideOffset:6,...e,contentRole:"menu"})}function Br({className:e,children:t,inset:o=!1,disabled:r=!1,destructive:a=!1,shortcut:i,onSelect:n,onMouseEnter:c,onClick:d,...u}){let s=Re(),m=te(null),l=se("DropdownMenu.SubTrigger"),{highlightedId:b,setHighlightedId:p,registerItem:f,setActiveSubmenuId:P,activeSubmenuId:h}=kt("DropdownMenu.SubTrigger"),v=Le(()=>Se(t),[t]),x=b===s,C=l.open&&h===s,I=A(()=>{r||(l.focusIntentRef.current="first",p(s),P(s),l.setOpen(!0))},[r,s,P,p,l]);return ie(()=>f({id:s,ref:m,disabled:r,submenu:!0,selected:!1,textValue:v,closeOnSelect:!1,click:I,openSubmenu:I}),[r,s,I,f,v]),ie(()=>{h!==s&&l.open&&l.setOpen(!1)},[h,s,l]),Ct("button",{ref:Pt(m,l.triggerRef),id:l.triggerId,type:"button",role:"menuitem",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-highlighted":x||void 0,"data-state":C?"open":"closed","data-disabled":r||void 0,"data-destructive":a||void 0,className:oe(O.subTrigger,o&&O.itemInset,e),onMouseEnter:me(c,()=>{I()}),onClick:me(d,y=>{y.preventDefault(),I(),n?.()}),...u,children:[B("span",{className:O.itemMain,children:t}),i?B("span",{className:O.shortcut,children:i}):null,B("span",{className:O.submenuIndicator,"aria-hidden":"true",children:"\u203A"})]})}var Or=Object.assign(Mt,{Trigger:Sr,Content:Lr,Group:Dr,Label:Er,Item:Hr,Separator:zr,Submenu:Ar,SubTrigger:Br}),Vr=Or;import{clsx as It}from"clsx";var Ge={};import{Fragment as $r,jsx as Nt,jsxs as Xr}from"react/jsx-runtime";function Rt({as:e="aside",open:t,children:o,side:r="right",position:a="fixed",showBackdrop:i=!0,onClose:n,closeLabel:c="\u5173\u95ED\u62BD\u5C49",backdropClassName:d,className:u,classNames:s,...m}){return Xr($r,{children:[i&&t&&n&&Nt("button",{type:"button","aria-label":c,"data-state":"open","data-scope":"drawer","data-part":"backdrop","data-position":a,className:It("owo-drawer-backdrop",Ge.backdrop,d,s?.backdrop),onClick:n}),Nt(e,{"aria-hidden":!t,"data-state":t?"open":"closed","data-side":r,"data-position":a,"data-scope":"drawer","data-part":"panel",className:It("owo-drawer",Ge.panel,u,s?.panel),...m,children:o})]})}import{clsx as Ur}from"clsx";var De={};import{jsx as St,jsxs as Wr}from"react/jsx-runtime";function Lt({label:e,help:t,htmlFor:o,children:r,className:a,...i}){return Wr("div",{className:Ur("owo-field",De.root,a),...i,children:[St("label",{htmlFor:o,className:De.label,children:e}),r,t?St("span",{className:De.help,children:t}):null]})}import{clsx as qr}from"clsx";var Dt={};import{jsx as Et}from"react/jsx-runtime";function zt({variant:e="ghost",size:t="md",label:o,icon:r,className:a,...i}){let n=qr("owo-icon-button",Dt.root,a);if("href"in i&&i.href){let{href:d,...u}=i;return Et("a",{href:d,"aria-label":o,title:u.title??o,"data-variant":e,"data-size":t,className:n,...u,children:r})}let c=i;return Et("button",{type:c.type??"button","aria-label":o,title:c.title??o,"data-variant":e,"data-size":t,className:n,...c,children:r})}import{clsx as Ht}from"clsx";var we={};import{jsx as At}from"react/jsx-runtime";function Bt(e){let{className:t,tone:o="default",size:r="md",...a}=e;return e.as==="textarea"?At("textarea",{"data-tone":o,"data-size":r,className:Ht("owo-input",we.root,t),...a}):At("input",{"data-tone":o,"data-size":r,className:Ht("owo-input",we.root,t),...a})}import{clsx as Ee}from"clsx";var Ot={};import{jsx as ze}from"react/jsx-runtime";function Vt({as:e="section",variant:t="default",padding:o="none",className:r,children:a,...i}){return ze(e,{"data-variant":t,"data-padding":o!=="none"?o:void 0,"data-scope":"panel",className:Ee("owo-panel",Ot.root,r),...i,children:a})}function Jr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"header",className:Ee(e),...o,children:t})}function Zr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"body",className:Ee(e),...o,children:t})}function jr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"footer",className:Ee(e),...o,children:t})}import{clsx as ea}from"clsx";var Ye={};import{jsx as Ft}from"react/jsx-runtime";function $t({value:e,onChange:t,options:o,size:r="md",className:a,ariaLabel:i}){return Ft("div",{role:"tablist","aria-label":i,"data-size":r,className:ea("owo-segmented-control",Ye.root,a),children:o.map(n=>{let c=n.value===e;return Ft("button",{type:"button",role:"tab","aria-selected":c,disabled:n.disabled,"data-active":c?"true":void 0,className:Ye.item,onClick:()=>t(n.value),children:n.label},n.value)})})}import{clsx as ge}from"clsx";import{useCallback as Je,useEffect as Xt,useId as oa,useMemo as ra,useRef as Kt,useState as Ut}from"react";var He={};import{jsx as xe,jsxs as Wt}from"react/jsx-runtime";function _t({value:e,onChange:t,options:o,placeholder:r="Select\u2026",size:a="md",tone:i="default",disabled:n=!1,className:c,ariaLabel:d,renderValue:u,renderOption:s,classNames:m}){let[l,b]=Ut(!1),[p,f]=Ut(-1),P=Kt(null),h=Kt(null),v=oa(),x=o.find(g=>g.value===e),C=ra(()=>o.reduce((g,M,V)=>(M.disabled||g.push(V),g),[]),[o]),I=Je(()=>{if(n||o.length===0)return;b(!0);let g=o.findIndex(M=>M.value===e);f(g>=0?g:C[0]??-1)},[n,o,e,C]),y=Je(()=>{b(!1),f(-1)},[]),D=Je(g=>{g.disabled||(t(g.value),y())},[t,y]);Xt(()=>{if(!l)return;function g(M){P.current&&!P.current.contains(M.target)&&y()}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[l,y]),Xt(()=>{if(!l||p<0)return;h.current?.children[p]?.scrollIntoView({block:"nearest"})},[l,p]);function N(g){if(!n)switch(g.key){case"Enter":case" ":{g.preventDefault(),l?p>=0&&o[p]&&!o[p].disabled&&D(o[p]):I();break}case"ArrowDown":{if(g.preventDefault(),!l)I();else{let M=C.indexOf(p),V=C[M+1];V!==void 0&&f(V)}break}case"ArrowUp":{if(g.preventDefault(),!l)I();else{let M=C.indexOf(p),V=C[M-1];V!==void 0&&f(V)}break}case"Escape":{l&&(g.preventDefault(),y());break}case"Tab":{l&&y();break}}}let z=e!==""&&x,H=u?u({open:l,placeholder:r,selectedOption:x}):xe("span",{className:ge(He.valueText,!z&&He.placeholder),children:z?x.label:r});return Wt("div",{ref:P,"data-state":l?"open":"closed","data-disabled":n||void 0,"data-size":a,"data-tone":i,"data-scope":"select",className:ge("owo-select",He.root,c),children:[Wt("button",{type:"button",role:"combobox","aria-expanded":l,"aria-haspopup":"listbox","aria-controls":v,"aria-label":d,"aria-activedescendant":l&&p>=0?`${v}-opt-${p}`:void 0,"data-state":l?"open":"closed","data-disabled":n||void 0,"data-tone":i,"data-size":a,"data-has-value":z||void 0,"data-scope":"select","data-part":"trigger",disabled:n,className:ge(m?.trigger),onClick:()=>l?y():I(),onKeyDown:N,children:[H,xe("svg",{"aria-hidden":"true","data-state":l?"open":"closed","data-scope":"select","data-part":"chevron",className:ge(m?.chevron),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xe("path",{d:"M4 6l4 4 4-4"})})]}),l&&xe("ul",{ref:h,id:v,role:"listbox","aria-label":d,"data-state":"open","data-size":a,"data-scope":"select","data-part":"dropdown",className:ge(m?.dropdown),children:o.map((g,M)=>xe("li",{id:`${v}-opt-${M}`,role:"option","aria-selected":g.value===e,"aria-disabled":g.disabled||void 0,"data-state":g.value===e?"selected":M===p?"highlighted":"idle","data-focused":M===p||void 0,"data-selected":g.value===e||void 0,"data-disabled":g.disabled||void 0,"data-highlighted":M===p||void 0,"data-scope":"select","data-part":"option",className:ge(m?.option),onClick:()=>D(g),onMouseEnter:()=>!g.disabled&&f(M),children:s?s({option:g,index:M,selected:g.value===e,highlighted:M===p}):g.label},g.value))})]})}import{clsx as na}from"clsx";var qt={};import{jsx as sa}from"react/jsx-runtime";var ia={slow:"4s",medium:"3s",fast:"2s"};function Gt({className:e,animation:t="scan",tone:o="default",speed:r="medium",style:a,...i}){let n=o==="warm"?"emphasis":o,c={...a,"--_owo-skeleton-scan-duration":ia[r]};return sa("div",{className:na("owo-skeleton",qt.root,e),"data-animation":t,"data-tone":n,"aria-hidden":"true",style:c,...i})}import{clsx as Yt}from"clsx";var K={};import{Fragment as Jt,jsx as Y,jsxs as Ae}from"react/jsx-runtime";function Zt({tone:e="neutral",layout:t="horizontal",icon:o,title:r,description:a,action:i,className:n,children:c,...d}){if(t==="vertical"){let u=o||r||a||i;return Y("div",{"data-tone":e,"data-layout":"vertical",className:Yt("owo-status-notice",K.root,n),...d,children:u?Ae("div",{className:K.body,children:[o&&Y("div",{className:K.icon,children:o}),r&&Y("div",{className:K.title,children:r}),a&&Y("div",{children:a}),i&&Y("div",{className:K.action,children:i})]}):c})}return Y("div",{"data-tone":e,className:Yt("owo-status-notice",K.root,o&&K.withIcon,n),...d,children:o?Ae(Jt,{children:[Y("span",{className:K.icon,"aria-hidden":"true",children:o}),Ae("div",{className:K.text,children:[r&&Y("div",{className:K.title,children:r}),c]})]}):Ae(Jt,{children:[r&&Y("div",{className:K.title,children:r}),c]})})}import{clsx as la}from"clsx";var Ze={};import{jsx as jt}from"react/jsx-runtime";function Qt({checked:e,onChange:t,size:o="md",disabled:r=!1,className:a,ariaLabel:i}){return jt("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,disabled:r,"data-size":o,className:la("owo-switch",Ze.root,a),onClick:()=>t(!e),children:jt("span",{"aria-hidden":"true",className:Ze.thumb})})}import{clsx as Oe}from"clsx";import{createContext as ua,useContext as ma,useId as ga,useMemo as fa,useState as ba}from"react";var eo={};import{jsx as ye}from"react/jsx-runtime";var to=ua(null);function oo(e){let t=ma(to);if(!t)throw new Error(`${e} must be used within Tabs.Root`);return t}function Be(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function ha({value:e,defaultValue:t,onValueChange:o}){let[r,a]=ba(t??""),i=e!==void 0,n=i?e:r;function c(d){i||a(d),o?.(d)}return[n,c]}function je({children:e,value:t,defaultValue:o,onValueChange:r,className:a,...i}){let[n,c]=ha({value:t,defaultValue:o,onValueChange:r}),d=ga(),u=fa(()=>({value:n,setValue:c,baseId:d}),[d,n,c]);return ye(to.Provider,{value:u,children:ye("div",{"data-scope":"tabs",className:Oe("owo-tabs",eo.root,a),...i,children:e})})}function ro({children:e,className:t,ariaLabel:o,...r}){return ye("div",{role:"tablist","aria-label":o,"data-scope":"tabs","data-part":"list",className:Oe(t),...r,children:e})}function ao({children:e,className:t,value:o,disabled:r,onClick:a,onKeyDown:i,...n}){let{value:c,setValue:d,baseId:u}=oo("Tabs.Trigger"),s=c===o,m=`${u}-trigger-${Be(o)}`,l=`${u}-panel-${Be(o)}`;function b(p,f){let P=p.closest('[role="tablist"]');if(!P)return;let h=Array.from(P.querySelectorAll('[role="tab"]:not([disabled])')),v=h.indexOf(p);if(v<0)return;let x;f==="first"&&(x=h[0]),f==="last"&&(x=h[h.length-1]),f==="next"&&(x=h[(v+1)%h.length]),f==="prev"&&(x=h[(v-1+h.length)%h.length]),x&&(x.focus(),x.click())}return ye("button",{type:"button",id:m,role:"tab","aria-selected":s,"aria-controls":l,tabIndex:s?0:-1,"data-state":s?"active":"inactive","data-scope":"tabs","data-part":"trigger",disabled:r,className:Oe(t),onClick:p=>{a?.(p),!p.defaultPrevented&&!r&&d(o)},onKeyDown:p=>{if(i?.(p),p.defaultPrevented||r)return;let f=p.currentTarget;switch(p.key){case"ArrowRight":p.preventDefault(),b(f,"next");break;case"ArrowLeft":p.preventDefault(),b(f,"prev");break;case"Home":p.preventDefault(),b(f,"first");break;case"End":p.preventDefault(),b(f,"last");break}},...n,children:e})}function no({children:e,className:t,value:o,...r}){let{value:a,baseId:i}=oo("Tabs.Content"),n=a===o,c=`${i}-trigger-${Be(o)}`,d=`${i}-panel-${Be(o)}`;return n?ye("div",{id:d,role:"tabpanel","aria-labelledby":c,"data-state":"active","data-scope":"tabs","data-part":"content",className:Oe(t),...r,children:e}):null}var va=Object.assign(je,{Root:je,List:ro,Trigger:ao,Content:no}),wa=va;import{clsx as ya}from"clsx";import{useCallback as Ta,useEffect as ka,useRef as Pa}from"react";var io={};import{jsx as Ma}from"react/jsx-runtime";function so({className:e,tone:t="default",size:o="md",resize:r="vertical",autoResize:a=!1,style:i,onInput:n,rows:c=3,...d}){let u=Pa(null),s=n,m=Ta(()=>{if(!a||!u.current)return;let p=u.current;p.style.height="auto",p.style.height=`${p.scrollHeight}px`},[a]);ka(()=>{m()},[m,d.value,d.defaultValue,c]);function l(p){m(),s?.(p)}let b={...i,resize:a?"none":r};return Ma("textarea",{...d,ref:u,rows:c,"data-tone":t,"data-size":o,"data-auto-resize":a||void 0,className:ya("owo-input",we.root,"owo-textarea",io.root,e),style:b,onInput:l})}import{clsx as re}from"clsx";import{createContext as Ia,useCallback as co,useContext as Na,useMemo as Ra,useRef as lo,useState as Sa}from"react";var Te={};import{jsx as L,jsxs as ke}from"react/jsx-runtime";var uo=Ia(null),Qe=5,po=4e3;function La(){let e=Na(uo);if(!e)throw new Error("useToast must be used within <ToastProvider>");return e}function Da({tone:e}){let t={width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"success":return L("svg",{...t,children:L("path",{d:"M3.5 8.5l3 3 6-7"})});case"warning":return ke("svg",{...t,children:[L("path",{d:"M8 5v4"}),L("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]});case"danger":return L("svg",{...t,children:L("path",{d:"M4.5 4.5l7 7M11.5 4.5l-7 7"})});case"info":return ke("svg",{...t,children:[L("circle",{cx:"8",cy:"3.5",r:"1.2",fill:"currentColor",stroke:"none"}),L("path",{d:"M8 7v5.5"})]})}}function Ea(e,t){return typeof e=="string"?{message:e,duration:t??po}:{title:e.title,message:e.message,duration:e.duration??t??po}}function za({item:e,onDismiss:t,renderToast:o,classNames:r}){let a=()=>t(e.id),i=L(Da,{tone:e.tone});return o?L("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,"data-scope":"toast","data-part":"toast",className:re("owo-toast",Te.toast,r?.toast),children:o({item:e,dismiss:a,icon:i})}):ke("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,"data-scope":"toast","data-part":"toast",className:re("owo-toast",Te.toast,Te.toastDefault,r?.toast),children:[L("span",{"data-scope":"toast","data-part":"icon",className:re(r?.icon),"aria-hidden":"true",children:i}),ke("span",{"data-scope":"toast","data-part":"content",className:re(r?.content),children:[e.title?L("span",{"data-scope":"toast","data-part":"title",className:re(r?.title),children:e.title}):null,L("span",{"data-scope":"toast","data-part":"message",className:re(r?.message),children:e.message})]}),L("button",{type:"button",onClick:a,"data-scope":"toast","data-part":"close",className:re(r?.close),"aria-label":"Dismiss",children:L("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:L("path",{d:"M4 4l8 8M12 4l-8 8"})})})]})}function Ha({children:e,renderToast:t,classNames:o}){let[r,a]=Sa([]),i=lo(0),n=lo(new Map),c=co(s=>{let m=n.current.get(s);m&&clearTimeout(m),n.current.delete(s),a(l=>l.filter(b=>b.id!==s))},[]),d=co((s,m,l)=>{let b=i.current++,p=Ea(m,l),f={id:b,tone:s,...p};a(P=>{let h=[...P,f];if(h.length>Qe){let v=h.slice(0,h.length-Qe);for(let x of v){let C=n.current.get(x.id);C&&clearTimeout(C),n.current.delete(x.id)}return h.slice(-Qe)}return h}),f.duration>0&&n.current.set(b,setTimeout(()=>c(b),f.duration))},[c]),u=Ra(()=>({success:(s,m)=>d("success",s,m),warning:(s,m)=>d("warning",s,m),danger:(s,m)=>d("danger",s,m),info:(s,m)=>d("info",s,m)}),[d]);return ke(uo.Provider,{value:u,children:[e,L("div",{"aria-label":"Notifications","data-state":r.length>0?"open":"closed","data-scope":"toast","data-part":"container",className:re("owo-toast-container",Te.container,o?.container),children:r.map(s=>L(za,{item:s,onDismiss:c,renderToast:t,classNames:o},s.id))})]})}import{clsx as tt}from"clsx";import{autoUpdate as Ba,computePosition as Oa,flip as Va,offset as Fa,shift as $a,arrow as Xa}from"@floating-ui/dom";import{useCallback as de,useEffect as mo,useId as Ka,useLayoutEffect as Ua,useRef as Pe,useState as Ve}from"react";import{createPortal as Wa}from"react-dom";var et={};import{Fragment as qa,jsx as Fe,jsxs as ho}from"react/jsx-runtime";var Me=6,go=8,fo=4;function _a(e){return e.split("-")[0]}var bo={top:"",bottom:"rotate(180deg)",left:"rotate(-90deg)",right:"rotate(90deg)"};function vo({content:e,placement:t="top",density:o="default",showDelay:r=300,hideDelay:a=150,arrow:i=!0,renderArrow:n,className:c,children:d,classNames:u}){let[s,m]=Ve(!1),[l,b]=Ve(null),[p,f]=Ve(t),[P,h]=Ve({}),v=Pe(null),x=Pe(null),C=Pe(null),I=Pe(void 0),y=Pe(void 0),D=Ka(),N=de(()=>{clearTimeout(I.current),clearTimeout(y.current)},[]),z=de(()=>{N(),I.current=setTimeout(()=>m(!0),r)},[N,r]),H=de(()=>{N(),m(!0)},[N]),g=de(()=>{N(),y.current=setTimeout(()=>m(!1),a)},[N,a]),M=de($=>{if($.target===v.current){z();return}H()},[z,H]),V=de($=>{$.pointerType!=="mouse"&&H()},[H]),J=de($=>{$.key==="Escape"&&s&&m(!1)},[s]);Ua(()=>{if(!s||!v.current||!x.current)return;let $=[Fa(i?go+Me:go),Va({padding:fo}),$a({padding:fo})];return i&&C.current&&$.push(Xa({element:C.current})),Ba(v.current,x.current,()=>{!v.current||!x.current||Oa(v.current,x.current,{placement:t,strategy:"fixed",middleware:$}).then(({x:fe,y:j,placement:Ce,middlewareData:E})=>{b({top:j,left:fe}),f(_a(Ce)),E.arrow&&h({x:E.arrow.x,y:E.arrow.y})})})},[s,t,i]),mo(()=>{if(s)return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[s,J]),mo(()=>N,[N]);let F={position:"absolute"},Z=p;return Z==="top"||Z==="bottom"?(F.left=P.x??0,F[Z==="top"?"bottom":"top"]=-Me,F.transform=bo[Z]||void 0):(F.top=P.y??0,F[Z==="left"?"right":"left"]=-Me,F.transform=bo[Z]),ho(qa,{children:[Fe("span",{ref:v,"data-state":s?"open":"closed","data-scope":"tooltip","data-part":"trigger",className:tt("owo-tooltip-trigger",et.trigger,u?.trigger),onMouseEnter:z,onMouseLeave:g,onFocus:M,onBlur:g,onPointerDown:V,"aria-describedby":s?D:void 0,children:d}),s&&Wa(ho("div",{ref:x,id:D,role:"tooltip","data-state":s?"open":"closed","data-placement":p,"data-density":o,"data-scope":"tooltip","data-part":"content",className:tt("owo-tooltip",et.content,u?.content,c),style:l?{top:l.top,left:l.left}:{visibility:"hidden"},onMouseEnter:z,onMouseLeave:g,children:[e,i&&Fe("span",{ref:C,"data-scope":"tooltip","data-part":"arrow",className:tt(u?.arrow),style:F,children:n?n({placement:p}):Fe("svg",{width:Me*2,height:Me,viewBox:"0 0 12 6",children:Fe("path",{d:"M0 0l6 6 6-6z",fill:"currentColor"})})})]}),document.body)]})}export{st as Avatar,ct as Badge,be as Button,Qo as Collapsible,ht as CollapsibleContent,Ke as CollapsibleRoot,bt as CollapsibleTrigger,gr as ConfirmProvider,W as Dialog,Rt as Drawer,Vr as DropdownMenu,Lt as Field,zt as IconButton,Bt as Input,Vt as Panel,Zr as PanelBody,jr as PanelFooter,Jr as PanelHeader,$t as SegmentedControl,_t as Select,Gt as Skeleton,Ie as Spinner,Zt as StatusNotice,Qt as Switch,wa as Tabs,no as TabsContent,ro as TabsList,je as TabsRoot,ao as TabsTrigger,so as Textarea,Ha as ToastProvider,vo as Tooltip,pt as buttonClassName,mr as useConfirm,La as useToast};
|
|
1
|
+
"use client";
|
|
2
|
+
import { Children as e, cloneElement as t, createContext as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as h } from "react-dom";
|
|
5
|
+
//#region node_modules/clsx/dist/clsx.mjs
|
|
6
|
+
function g(e) {
|
|
7
|
+
var t, n, r = "";
|
|
8
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
9
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
10
|
+
var i = e.length;
|
|
11
|
+
for (t = 0; t < i; t++) e[t] && (n = g(e[t])) && (r && (r += " "), r += n);
|
|
12
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
13
|
+
return r;
|
|
14
|
+
}
|
|
15
|
+
function _() {
|
|
16
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = g(e)) && (r && (r += " "), r += t);
|
|
17
|
+
return r;
|
|
18
|
+
}
|
|
19
|
+
var v = { root: "_root_crrwl_1" };
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/Avatar.tsx
|
|
22
|
+
function y(e) {
|
|
23
|
+
let t = e.trim().split(/\s+/);
|
|
24
|
+
return t.length >= 2 ? (t[0][0] + t[t.length - 1][0]).toUpperCase() : e.slice(0, 2).toUpperCase();
|
|
25
|
+
}
|
|
26
|
+
function b({ src: e, alt: t, name: n, size: r = "md", tone: i = "neutral", className: a }) {
|
|
27
|
+
let [o, s] = d(!1), c = e && !o, l = n ? y(n) : "?";
|
|
28
|
+
return /* @__PURE__ */ p("span", {
|
|
29
|
+
"data-tone": i,
|
|
30
|
+
"data-size": r,
|
|
31
|
+
className: _("owo-avatar", v.root, a),
|
|
32
|
+
children: c ? /* @__PURE__ */ p("img", {
|
|
33
|
+
src: e,
|
|
34
|
+
alt: t ?? n ?? "",
|
|
35
|
+
onError: () => s(!0)
|
|
36
|
+
}) : /* @__PURE__ */ p("span", {
|
|
37
|
+
"aria-label": t ?? n,
|
|
38
|
+
children: l
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var x = { root: "_root_6bx55_1" };
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/Badge.tsx
|
|
45
|
+
function S({ tone: e = "neutral", variant: t = "soft", size: n = "xs", className: r, children: i, ...a }) {
|
|
46
|
+
return /* @__PURE__ */ p("span", {
|
|
47
|
+
"data-tone": e,
|
|
48
|
+
"data-variant": t,
|
|
49
|
+
"data-size": n,
|
|
50
|
+
className: _("owo-badge", x.root, r),
|
|
51
|
+
...a,
|
|
52
|
+
children: i
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var C = {
|
|
56
|
+
root: "_root_1oxco_1",
|
|
57
|
+
"owo-spin": "_owo-spin_1oxco_1"
|
|
58
|
+
}, w = {
|
|
59
|
+
xs: 12,
|
|
60
|
+
sm: 14,
|
|
61
|
+
md: 16,
|
|
62
|
+
lg: 24
|
|
63
|
+
};
|
|
64
|
+
function T({ px: e }) {
|
|
65
|
+
let t = Math.PI * 2 * 9;
|
|
66
|
+
return /* @__PURE__ */ m("svg", {
|
|
67
|
+
width: e,
|
|
68
|
+
height: e,
|
|
69
|
+
viewBox: "0 0 24 24",
|
|
70
|
+
fill: "none",
|
|
71
|
+
children: [/* @__PURE__ */ p("circle", {
|
|
72
|
+
cx: "12",
|
|
73
|
+
cy: "12",
|
|
74
|
+
r: 9,
|
|
75
|
+
stroke: "currentColor",
|
|
76
|
+
strokeWidth: "3",
|
|
77
|
+
opacity: "0.2"
|
|
78
|
+
}), /* @__PURE__ */ p("circle", {
|
|
79
|
+
cx: "12",
|
|
80
|
+
cy: "12",
|
|
81
|
+
r: 9,
|
|
82
|
+
stroke: "currentColor",
|
|
83
|
+
strokeWidth: "3",
|
|
84
|
+
strokeLinecap: "round",
|
|
85
|
+
strokeDasharray: `${t * .28} ${t * .72}`
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function E({ px: e }) {
|
|
90
|
+
return /* @__PURE__ */ m("svg", {
|
|
91
|
+
width: e,
|
|
92
|
+
height: e,
|
|
93
|
+
viewBox: "0 0 24 24",
|
|
94
|
+
fill: "none",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
strokeWidth: "2.5",
|
|
97
|
+
strokeLinecap: "round",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ p("path", {
|
|
100
|
+
d: "M12 2a10 10 0 0 1 10 10",
|
|
101
|
+
opacity: "0.9"
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ p("path", {
|
|
104
|
+
d: "M12 2a10 10 0 0 0-7.07 2.93",
|
|
105
|
+
opacity: "0.2"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ p("path", {
|
|
108
|
+
d: "M4.93 4.93A10 10 0 0 0 2 12",
|
|
109
|
+
opacity: "0.2"
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ p("path", {
|
|
112
|
+
d: "M2 12a10 10 0 0 0 2.93 7.07",
|
|
113
|
+
opacity: "0.2"
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ p("path", {
|
|
116
|
+
d: "M4.93 19.07A10 10 0 0 0 12 22",
|
|
117
|
+
opacity: "0.2"
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ p("path", {
|
|
120
|
+
d: "M12 22a10 10 0 0 0 7.07-2.93",
|
|
121
|
+
opacity: "0.2"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ p("path", {
|
|
124
|
+
d: "M19.07 19.07A10 10 0 0 0 22 12",
|
|
125
|
+
opacity: "0.2"
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function D({ px: e }) {
|
|
131
|
+
return /* @__PURE__ */ p("svg", {
|
|
132
|
+
width: e,
|
|
133
|
+
height: e,
|
|
134
|
+
viewBox: "0 0 24 24",
|
|
135
|
+
children: [
|
|
136
|
+
0,
|
|
137
|
+
1,
|
|
138
|
+
2,
|
|
139
|
+
3,
|
|
140
|
+
4,
|
|
141
|
+
5,
|
|
142
|
+
6,
|
|
143
|
+
7
|
|
144
|
+
].map((e) => {
|
|
145
|
+
let t = e / 8 * 360;
|
|
146
|
+
return /* @__PURE__ */ p("circle", {
|
|
147
|
+
cx: "12",
|
|
148
|
+
cy: "3.5",
|
|
149
|
+
r: "1.8",
|
|
150
|
+
fill: "currentColor",
|
|
151
|
+
opacity: .15 + e / 8 * .85,
|
|
152
|
+
transform: `rotate(${t} 12 12)`
|
|
153
|
+
}, e);
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function O({ px: e }) {
|
|
158
|
+
return /* @__PURE__ */ p("svg", {
|
|
159
|
+
width: e,
|
|
160
|
+
height: e,
|
|
161
|
+
viewBox: "0 0 24 24",
|
|
162
|
+
children: [
|
|
163
|
+
0,
|
|
164
|
+
1,
|
|
165
|
+
2,
|
|
166
|
+
3
|
|
167
|
+
].map((e) => /* @__PURE__ */ m("rect", {
|
|
168
|
+
x: 3 + e * 5.5,
|
|
169
|
+
y: "4",
|
|
170
|
+
width: "3",
|
|
171
|
+
height: "16",
|
|
172
|
+
rx: "1.5",
|
|
173
|
+
fill: "currentColor",
|
|
174
|
+
opacity: "0.3",
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ p("animate", {
|
|
177
|
+
attributeName: "opacity",
|
|
178
|
+
values: "0.3;1;0.3",
|
|
179
|
+
dur: "1s",
|
|
180
|
+
begin: `${e * .15}s`,
|
|
181
|
+
repeatCount: "indefinite"
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ p("animate", {
|
|
184
|
+
attributeName: "height",
|
|
185
|
+
values: "16;8;16",
|
|
186
|
+
dur: "1s",
|
|
187
|
+
begin: `${e * .15}s`,
|
|
188
|
+
repeatCount: "indefinite"
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ p("animate", {
|
|
191
|
+
attributeName: "y",
|
|
192
|
+
values: "4;8;4",
|
|
193
|
+
dur: "1s",
|
|
194
|
+
begin: `${e * .15}s`,
|
|
195
|
+
repeatCount: "indefinite"
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
}, e))
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function k({ px: e }) {
|
|
202
|
+
let t = e * .14, n = e * .33, r = e / 2 - n, i = e / 2, a = e / 2 + n, o = e / 2;
|
|
203
|
+
return /* @__PURE__ */ p("svg", {
|
|
204
|
+
width: e,
|
|
205
|
+
height: e,
|
|
206
|
+
viewBox: `0 0 ${e} ${e}`,
|
|
207
|
+
children: [
|
|
208
|
+
r,
|
|
209
|
+
i,
|
|
210
|
+
a
|
|
211
|
+
].map((n, r) => /* @__PURE__ */ m("circle", {
|
|
212
|
+
cx: n,
|
|
213
|
+
cy: o,
|
|
214
|
+
r: t,
|
|
215
|
+
fill: "currentColor",
|
|
216
|
+
opacity: "0.4",
|
|
217
|
+
children: [/* @__PURE__ */ p("animate", {
|
|
218
|
+
attributeName: "cy",
|
|
219
|
+
values: `${o};${o - e * .25};${o}`,
|
|
220
|
+
dur: "0.6s",
|
|
221
|
+
begin: `${r * .12}s`,
|
|
222
|
+
repeatCount: "indefinite",
|
|
223
|
+
calcMode: "spline",
|
|
224
|
+
keySplines: "0.4 0 0.2 1;0.4 0 0.2 1"
|
|
225
|
+
}), /* @__PURE__ */ p("animate", {
|
|
226
|
+
attributeName: "opacity",
|
|
227
|
+
values: "0.4;1;0.4",
|
|
228
|
+
dur: "0.6s",
|
|
229
|
+
begin: `${r * .12}s`,
|
|
230
|
+
repeatCount: "indefinite"
|
|
231
|
+
})]
|
|
232
|
+
}, r))
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function A({ px: e }) {
|
|
236
|
+
return /* @__PURE__ */ m("svg", {
|
|
237
|
+
width: e,
|
|
238
|
+
height: e,
|
|
239
|
+
viewBox: "0 0 24 24",
|
|
240
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
241
|
+
cx: "12",
|
|
242
|
+
cy: "12",
|
|
243
|
+
r: "0",
|
|
244
|
+
fill: "currentColor",
|
|
245
|
+
opacity: "0",
|
|
246
|
+
children: [/* @__PURE__ */ p("animate", {
|
|
247
|
+
attributeName: "r",
|
|
248
|
+
values: "4;10;4",
|
|
249
|
+
dur: "1.2s",
|
|
250
|
+
repeatCount: "indefinite"
|
|
251
|
+
}), /* @__PURE__ */ p("animate", {
|
|
252
|
+
attributeName: "opacity",
|
|
253
|
+
values: "0.8;0.1;0.8",
|
|
254
|
+
dur: "1.2s",
|
|
255
|
+
repeatCount: "indefinite"
|
|
256
|
+
})]
|
|
257
|
+
}), /* @__PURE__ */ p("circle", {
|
|
258
|
+
cx: "12",
|
|
259
|
+
cy: "12",
|
|
260
|
+
r: "3.5",
|
|
261
|
+
fill: "currentColor",
|
|
262
|
+
opacity: "0.7"
|
|
263
|
+
})]
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function j({ px: e }) {
|
|
267
|
+
return /* @__PURE__ */ m("svg", {
|
|
268
|
+
width: e,
|
|
269
|
+
height: e,
|
|
270
|
+
viewBox: "0 0 24 24",
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ p("circle", {
|
|
273
|
+
cx: "12",
|
|
274
|
+
cy: "12",
|
|
275
|
+
r: "8",
|
|
276
|
+
stroke: "currentColor",
|
|
277
|
+
strokeWidth: "1.5",
|
|
278
|
+
fill: "none",
|
|
279
|
+
opacity: "0.15"
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ p("circle", {
|
|
282
|
+
cx: "12",
|
|
283
|
+
cy: "4",
|
|
284
|
+
r: "2.2",
|
|
285
|
+
fill: "currentColor",
|
|
286
|
+
children: /* @__PURE__ */ p("animateTransform", {
|
|
287
|
+
attributeName: "transform",
|
|
288
|
+
type: "rotate",
|
|
289
|
+
from: "0 12 12",
|
|
290
|
+
to: "360 12 12",
|
|
291
|
+
dur: "0.9s",
|
|
292
|
+
repeatCount: "indefinite"
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ p("circle", {
|
|
296
|
+
cx: "12",
|
|
297
|
+
cy: "20",
|
|
298
|
+
r: "1.5",
|
|
299
|
+
fill: "currentColor",
|
|
300
|
+
opacity: "0.5",
|
|
301
|
+
children: /* @__PURE__ */ p("animateTransform", {
|
|
302
|
+
attributeName: "transform",
|
|
303
|
+
type: "rotate",
|
|
304
|
+
from: "0 12 12",
|
|
305
|
+
to: "-360 12 12",
|
|
306
|
+
dur: "0.9s",
|
|
307
|
+
repeatCount: "indefinite"
|
|
308
|
+
})
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
function M({ px: e }) {
|
|
314
|
+
let t = e * .14, n = e * .33, r = e / 2 - n, i = e / 2, a = e / 2 + n, o = e / 2;
|
|
315
|
+
return /* @__PURE__ */ p("svg", {
|
|
316
|
+
width: e,
|
|
317
|
+
height: e,
|
|
318
|
+
viewBox: `0 0 ${e} ${e}`,
|
|
319
|
+
children: [
|
|
320
|
+
r,
|
|
321
|
+
i,
|
|
322
|
+
a
|
|
323
|
+
].map((e, n) => /* @__PURE__ */ p("circle", {
|
|
324
|
+
cx: e,
|
|
325
|
+
cy: o,
|
|
326
|
+
r: t,
|
|
327
|
+
fill: "currentColor",
|
|
328
|
+
opacity: "0.25",
|
|
329
|
+
children: /* @__PURE__ */ p("animate", {
|
|
330
|
+
attributeName: "opacity",
|
|
331
|
+
values: "0.25;1;0.25",
|
|
332
|
+
dur: "0.9s",
|
|
333
|
+
begin: `${n * .2}s`,
|
|
334
|
+
repeatCount: "indefinite"
|
|
335
|
+
})
|
|
336
|
+
}, n))
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
var N = {
|
|
340
|
+
ring: T,
|
|
341
|
+
arc: E,
|
|
342
|
+
dots: D,
|
|
343
|
+
bars: O,
|
|
344
|
+
bounce: k,
|
|
345
|
+
pulse: A,
|
|
346
|
+
orbit: j,
|
|
347
|
+
flow: M
|
|
348
|
+
}, ee = new Set([
|
|
349
|
+
"ring",
|
|
350
|
+
"arc",
|
|
351
|
+
"dots"
|
|
352
|
+
]);
|
|
353
|
+
function P({ variant: e = "ring", size: t = "md", className: n, label: r }) {
|
|
354
|
+
let i = typeof t == "number" ? t : w[t], a = N[e];
|
|
355
|
+
return /* @__PURE__ */ p("span", {
|
|
356
|
+
"aria-hidden": !r,
|
|
357
|
+
"aria-label": r,
|
|
358
|
+
role: r ? "img" : void 0,
|
|
359
|
+
"data-animate": ee.has(e) ? "spin" : void 0,
|
|
360
|
+
className: _("owo-spinner", C.root, n),
|
|
361
|
+
children: /* @__PURE__ */ p(a, { px: i })
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
var F = {
|
|
365
|
+
root: "_root_yhdgl_1",
|
|
366
|
+
icon: "_icon_yhdgl_83",
|
|
367
|
+
label: "_label_yhdgl_95"
|
|
368
|
+
};
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/components/Button.tsx
|
|
371
|
+
function I({ className: e }) {
|
|
372
|
+
return _("owo-button", F.root, e);
|
|
373
|
+
}
|
|
374
|
+
function L(e) {
|
|
375
|
+
let { variant: t = "secondary", size: n = "md", loading: r = !1, leadingIcon: i, trailingIcon: a, className: o, children: s, ...c } = e, l = /* @__PURE__ */ m(f, { children: [
|
|
376
|
+
r ? /* @__PURE__ */ p("span", {
|
|
377
|
+
className: F.icon,
|
|
378
|
+
children: /* @__PURE__ */ p(P, { size: n === "xs" ? "xs" : n === "sm" ? "sm" : n === "xl" ? "lg" : "md" })
|
|
379
|
+
}) : i ? /* @__PURE__ */ p("span", {
|
|
380
|
+
className: F.icon,
|
|
381
|
+
children: i
|
|
382
|
+
}) : null,
|
|
383
|
+
/* @__PURE__ */ p("span", {
|
|
384
|
+
className: F.label,
|
|
385
|
+
children: s
|
|
386
|
+
}),
|
|
387
|
+
!r && a ? /* @__PURE__ */ p("span", {
|
|
388
|
+
className: F.icon,
|
|
389
|
+
children: a
|
|
390
|
+
}) : null
|
|
391
|
+
] }), u = I({
|
|
392
|
+
variant: t,
|
|
393
|
+
size: n,
|
|
394
|
+
loading: r,
|
|
395
|
+
className: o
|
|
396
|
+
});
|
|
397
|
+
if ("href" in e && e.href) {
|
|
398
|
+
let { href: e, ...i } = c;
|
|
399
|
+
return /* @__PURE__ */ p("a", {
|
|
400
|
+
href: e,
|
|
401
|
+
"data-variant": t,
|
|
402
|
+
"data-size": n,
|
|
403
|
+
"data-loading": r ? "true" : void 0,
|
|
404
|
+
"aria-disabled": r || void 0,
|
|
405
|
+
tabIndex: r ? -1 : void 0,
|
|
406
|
+
className: u,
|
|
407
|
+
onClick: r ? (e) => e.preventDefault() : void 0,
|
|
408
|
+
...i,
|
|
409
|
+
children: l
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
let d = c;
|
|
413
|
+
return /* @__PURE__ */ p("button", {
|
|
414
|
+
type: d.type ?? "button",
|
|
415
|
+
"data-variant": t,
|
|
416
|
+
"data-size": n,
|
|
417
|
+
"data-loading": r ? "true" : void 0,
|
|
418
|
+
disabled: d.disabled || r,
|
|
419
|
+
className: u,
|
|
420
|
+
...d,
|
|
421
|
+
children: l
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
var R = {
|
|
425
|
+
root: "_root_bx150_1",
|
|
426
|
+
triggerInner: "_triggerInner_bx150_27",
|
|
427
|
+
triggerIcon: "_triggerIcon_bx150_34",
|
|
428
|
+
triggerIndicator: "_triggerIndicator_bx150_35",
|
|
429
|
+
triggerLabel: "_triggerLabel_bx150_44",
|
|
430
|
+
contentInner: "_contentInner_bx150_50"
|
|
431
|
+
}, te = n(null);
|
|
432
|
+
function ne(e) {
|
|
433
|
+
let t = a(te);
|
|
434
|
+
if (!t) throw Error(`${e} must be used within Collapsible.Root`);
|
|
435
|
+
return t;
|
|
436
|
+
}
|
|
437
|
+
function z({ open: e, defaultOpen: t, onOpenChange: n }) {
|
|
438
|
+
let [r, i] = d(t ?? !1), a = e !== void 0, o = a ? e : r;
|
|
439
|
+
function s(e) {
|
|
440
|
+
a || i(e), n?.(e);
|
|
441
|
+
}
|
|
442
|
+
return [o, s];
|
|
443
|
+
}
|
|
444
|
+
function B({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames: i, className: a, ...o }) {
|
|
445
|
+
let [c, u] = z({
|
|
446
|
+
open: t,
|
|
447
|
+
defaultOpen: n,
|
|
448
|
+
onOpenChange: r
|
|
449
|
+
}), d = s(), f = l(() => ({
|
|
450
|
+
open: c,
|
|
451
|
+
setOpen: u,
|
|
452
|
+
contentId: d,
|
|
453
|
+
classNames: i
|
|
454
|
+
}), [
|
|
455
|
+
d,
|
|
456
|
+
c,
|
|
457
|
+
u,
|
|
458
|
+
i
|
|
459
|
+
]);
|
|
460
|
+
return /* @__PURE__ */ p(te.Provider, {
|
|
461
|
+
value: f,
|
|
462
|
+
children: /* @__PURE__ */ p("div", {
|
|
463
|
+
"data-state": c ? "open" : "closed",
|
|
464
|
+
"data-scope": "collapsible",
|
|
465
|
+
className: _("owo-collapsible", R.root, a),
|
|
466
|
+
...o,
|
|
467
|
+
children: e
|
|
468
|
+
})
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
function re({ children: e, icon: t, indicator: n, iconPosition: r = "start", className: i, onClick: a, ...o }) {
|
|
472
|
+
let { open: s, setOpen: c, contentId: l, classNames: u } = ne("Collapsible.Trigger"), d = t !== void 0 || n !== void 0 ? /* @__PURE__ */ m("span", {
|
|
473
|
+
"data-part": "triggerInner",
|
|
474
|
+
className: _(R.triggerInner, u?.triggerInner),
|
|
475
|
+
children: [
|
|
476
|
+
t && r === "start" ? /* @__PURE__ */ p("span", {
|
|
477
|
+
"data-part": "triggerIcon",
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
className: _(R.triggerIcon, u?.triggerIcon),
|
|
480
|
+
children: t
|
|
481
|
+
}) : null,
|
|
482
|
+
/* @__PURE__ */ p("span", {
|
|
483
|
+
"data-part": "triggerLabel",
|
|
484
|
+
className: _(R.triggerLabel, u?.triggerLabel),
|
|
485
|
+
children: e
|
|
486
|
+
}),
|
|
487
|
+
t && r === "end" ? /* @__PURE__ */ p("span", {
|
|
488
|
+
"data-part": "triggerIcon",
|
|
489
|
+
"aria-hidden": "true",
|
|
490
|
+
className: _(R.triggerIcon, u?.triggerIcon),
|
|
491
|
+
children: t
|
|
492
|
+
}) : null,
|
|
493
|
+
n ? /* @__PURE__ */ p("span", {
|
|
494
|
+
"data-part": "triggerIndicator",
|
|
495
|
+
"aria-hidden": "true",
|
|
496
|
+
className: _(R.triggerIndicator, u?.triggerIndicator),
|
|
497
|
+
children: n
|
|
498
|
+
}) : null
|
|
499
|
+
]
|
|
500
|
+
}) : e;
|
|
501
|
+
return /* @__PURE__ */ p("button", {
|
|
502
|
+
type: "button",
|
|
503
|
+
"aria-expanded": s,
|
|
504
|
+
"aria-controls": l,
|
|
505
|
+
"data-state": s ? "open" : "closed",
|
|
506
|
+
"data-scope": "collapsible",
|
|
507
|
+
"data-part": "trigger",
|
|
508
|
+
className: _(u?.trigger, i),
|
|
509
|
+
onClick: (e) => {
|
|
510
|
+
a?.(e), e.defaultPrevented || c(!s);
|
|
511
|
+
},
|
|
512
|
+
...o,
|
|
513
|
+
children: d
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
function V({ children: e, className: t, ...n }) {
|
|
517
|
+
let { open: r, contentId: i, classNames: a } = ne("Collapsible.Content"), [s, c] = d(r), l = u(null), f = u(null);
|
|
518
|
+
return o(() => {
|
|
519
|
+
let e = l.current, t = f.current;
|
|
520
|
+
if (!e || !t) return;
|
|
521
|
+
let n = 0, i = 0, a = () => {
|
|
522
|
+
e.style.height = "auto", e.style.overflow = "visible";
|
|
523
|
+
};
|
|
524
|
+
if (r && c(!0), !s && !r) return;
|
|
525
|
+
let o = (t) => {
|
|
526
|
+
t.target !== e || t.propertyName !== "height" || (e.removeEventListener("transitionend", o), r ? a() : c(!1));
|
|
527
|
+
};
|
|
528
|
+
return (() => {
|
|
529
|
+
let s = t.scrollHeight;
|
|
530
|
+
if (e.style.overflow = "hidden", r) {
|
|
531
|
+
e.style.height = "0px", n = window.requestAnimationFrame(() => {
|
|
532
|
+
e.addEventListener("transitionend", o), e.style.height = `${s}px`;
|
|
533
|
+
}), i = window.setTimeout(a, 240);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
e.style.height = `${s}px`, n = window.requestAnimationFrame(() => {
|
|
537
|
+
e.addEventListener("transitionend", o), e.style.height = "0px";
|
|
538
|
+
}), i = window.setTimeout(() => c(!1), 240);
|
|
539
|
+
})(), () => {
|
|
540
|
+
window.cancelAnimationFrame(n), window.clearTimeout(i), e.removeEventListener("transitionend", o);
|
|
541
|
+
};
|
|
542
|
+
}, [r, s]), !s && !r ? null : /* @__PURE__ */ p("div", {
|
|
543
|
+
id: i,
|
|
544
|
+
ref: l,
|
|
545
|
+
"data-state": r ? "open" : "closed",
|
|
546
|
+
"data-scope": "collapsible",
|
|
547
|
+
"data-part": "content",
|
|
548
|
+
"aria-hidden": !r,
|
|
549
|
+
className: _(a?.content, t),
|
|
550
|
+
...n,
|
|
551
|
+
children: /* @__PURE__ */ p("div", {
|
|
552
|
+
ref: f,
|
|
553
|
+
"data-part": "contentInner",
|
|
554
|
+
className: _(R.contentInner, a?.contentInner),
|
|
555
|
+
children: e
|
|
556
|
+
})
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
var ie = Object.assign(B, {
|
|
560
|
+
Root: B,
|
|
561
|
+
Trigger: re,
|
|
562
|
+
Content: V
|
|
563
|
+
}), H = "_overlay_1p0ee_1", ae = "_panel_1p0ee_19", oe = "_confirmDescription_1p0ee_64", U = {
|
|
564
|
+
overlay: H,
|
|
565
|
+
"dialog-backdrop-in": "_dialog-backdrop-in_1p0ee_1",
|
|
566
|
+
panel: ae,
|
|
567
|
+
"dialog-in": "_dialog-in_1p0ee_1",
|
|
568
|
+
confirmDescription: oe
|
|
569
|
+
}, se = n(void 0);
|
|
570
|
+
function ce({ className: e, children: t, ...n }) {
|
|
571
|
+
let r = a(se);
|
|
572
|
+
return /* @__PURE__ */ p("div", {
|
|
573
|
+
"data-scope": "dialog",
|
|
574
|
+
"data-part": "header",
|
|
575
|
+
className: _(r?.header, e),
|
|
576
|
+
...n,
|
|
577
|
+
children: t
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
function le({ className: e, children: t, ...n }) {
|
|
581
|
+
let r = a(se);
|
|
582
|
+
return /* @__PURE__ */ p("div", {
|
|
583
|
+
"data-scope": "dialog",
|
|
584
|
+
"data-part": "body",
|
|
585
|
+
className: _(r?.body, e),
|
|
586
|
+
...n,
|
|
587
|
+
children: t
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
function ue({ className: e, children: t, ...n }) {
|
|
591
|
+
let r = a(se);
|
|
592
|
+
return /* @__PURE__ */ p("div", {
|
|
593
|
+
"data-scope": "dialog",
|
|
594
|
+
"data-part": "footer",
|
|
595
|
+
className: _(r?.footer, e),
|
|
596
|
+
...n,
|
|
597
|
+
children: t
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
function W({ open: e, onClose: t, size: n = "sm", children: r, className: a, overlayClassName: s, panelClassName: c, classNames: l, ...d }) {
|
|
601
|
+
let f = u(null), h = u(null), g = i((e) => {
|
|
602
|
+
e.key === "Escape" && (e.stopPropagation(), t());
|
|
603
|
+
}, [t]);
|
|
604
|
+
return o(() => (e ? (h.current = document.activeElement, document.body.style.overflow = "hidden", requestAnimationFrame(() => {
|
|
605
|
+
let e = f.current;
|
|
606
|
+
if (!e) return;
|
|
607
|
+
let t = e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
|
|
608
|
+
t ? t.focus() : e.focus();
|
|
609
|
+
}), document.addEventListener("keydown", g)) : (document.body.style.overflow = "", h.current?.focus()), () => {
|
|
610
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
611
|
+
}), [e, g]), e ? /* @__PURE__ */ p(se.Provider, {
|
|
612
|
+
value: l,
|
|
613
|
+
children: /* @__PURE__ */ m("div", {
|
|
614
|
+
"data-state": "open",
|
|
615
|
+
"data-scope": "dialog",
|
|
616
|
+
"data-part": "overlay",
|
|
617
|
+
className: _("owo-dialog-overlay", U.overlay, l?.overlay),
|
|
618
|
+
children: [/* @__PURE__ */ p("button", {
|
|
619
|
+
type: "button",
|
|
620
|
+
"aria-label": "Close dialog",
|
|
621
|
+
"data-state": "open",
|
|
622
|
+
"data-scope": "dialog",
|
|
623
|
+
"data-part": "backdrop",
|
|
624
|
+
className: _("owo-dialog-backdrop", s, l?.backdrop),
|
|
625
|
+
onClick: t
|
|
626
|
+
}), /* @__PURE__ */ p("div", {
|
|
627
|
+
ref: f,
|
|
628
|
+
role: "dialog",
|
|
629
|
+
"aria-modal": "true",
|
|
630
|
+
tabIndex: -1,
|
|
631
|
+
"data-state": "open",
|
|
632
|
+
"data-size": n,
|
|
633
|
+
className: _("owo-dialog", U.panel, c, a),
|
|
634
|
+
...d,
|
|
635
|
+
children: r
|
|
636
|
+
})]
|
|
637
|
+
})
|
|
638
|
+
}) : null;
|
|
639
|
+
}
|
|
640
|
+
W.Header = ce, W.Body = le, W.Footer = ue;
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region src/components/ConfirmDialog.tsx
|
|
643
|
+
var de = n(null);
|
|
644
|
+
function fe() {
|
|
645
|
+
let e = a(de);
|
|
646
|
+
if (!e) throw Error("useConfirm must be used within <ConfirmProvider>");
|
|
647
|
+
return e;
|
|
648
|
+
}
|
|
649
|
+
function pe({ children: e }) {
|
|
650
|
+
let [t, n] = d(null), r = u(null), a = i((e) => (r.current && r.current.resolve(!1), new Promise((t) => {
|
|
651
|
+
let i = {
|
|
652
|
+
options: e,
|
|
653
|
+
resolve: t
|
|
654
|
+
};
|
|
655
|
+
r.current = i, n(i);
|
|
656
|
+
})), []), o = i((e) => {
|
|
657
|
+
r.current &&= (r.current.resolve(e), null), n(null);
|
|
658
|
+
}, []);
|
|
659
|
+
return /* @__PURE__ */ m(de.Provider, {
|
|
660
|
+
value: a,
|
|
661
|
+
children: [e, /* @__PURE__ */ p(W, {
|
|
662
|
+
open: t !== null,
|
|
663
|
+
onClose: () => o(!1),
|
|
664
|
+
children: t && /* @__PURE__ */ m(f, { children: [
|
|
665
|
+
/* @__PURE__ */ p(W.Header, { children: t.options.title }),
|
|
666
|
+
/* @__PURE__ */ p(W.Body, { children: typeof t.options.description == "string" ? /* @__PURE__ */ p("p", {
|
|
667
|
+
className: U.confirmDescription,
|
|
668
|
+
children: t.options.description
|
|
669
|
+
}) : t.options.description }),
|
|
670
|
+
/* @__PURE__ */ m(W.Footer, { children: [/* @__PURE__ */ p(L, {
|
|
671
|
+
variant: "ghost",
|
|
672
|
+
size: "sm",
|
|
673
|
+
onClick: () => o(!1),
|
|
674
|
+
children: t.options.cancelLabel ?? "取消"
|
|
675
|
+
}), /* @__PURE__ */ p(L, {
|
|
676
|
+
variant: t.options.variant ?? "primary",
|
|
677
|
+
size: "sm",
|
|
678
|
+
onClick: () => o(!0),
|
|
679
|
+
children: t.options.confirmLabel ?? "确认"
|
|
680
|
+
})] })
|
|
681
|
+
] })
|
|
682
|
+
})]
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
687
|
+
var me = Math.min, he = Math.max, ge = Math.round, _e = Math.floor, G = (e) => ({
|
|
688
|
+
x: e,
|
|
689
|
+
y: e
|
|
690
|
+
}), ve = {
|
|
691
|
+
left: "right",
|
|
692
|
+
right: "left",
|
|
693
|
+
bottom: "top",
|
|
694
|
+
top: "bottom"
|
|
695
|
+
};
|
|
696
|
+
function ye(e, t, n) {
|
|
697
|
+
return he(e, me(t, n));
|
|
698
|
+
}
|
|
699
|
+
function be(e, t) {
|
|
700
|
+
return typeof e == "function" ? e(t) : e;
|
|
701
|
+
}
|
|
702
|
+
function xe(e) {
|
|
703
|
+
return e.split("-")[0];
|
|
704
|
+
}
|
|
705
|
+
function Se(e) {
|
|
706
|
+
return e.split("-")[1];
|
|
707
|
+
}
|
|
708
|
+
function Ce(e) {
|
|
709
|
+
return e === "x" ? "y" : "x";
|
|
710
|
+
}
|
|
711
|
+
function we(e) {
|
|
712
|
+
return e === "y" ? "height" : "width";
|
|
713
|
+
}
|
|
714
|
+
function K(e) {
|
|
715
|
+
let t = e[0];
|
|
716
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
717
|
+
}
|
|
718
|
+
function Te(e) {
|
|
719
|
+
return Ce(K(e));
|
|
720
|
+
}
|
|
721
|
+
function Ee(e, t, n) {
|
|
722
|
+
n === void 0 && (n = !1);
|
|
723
|
+
let r = Se(e), i = Te(e), a = we(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
724
|
+
return t.reference[a] > t.floating[a] && (o = Fe(o)), [o, Fe(o)];
|
|
725
|
+
}
|
|
726
|
+
function De(e) {
|
|
727
|
+
let t = Fe(e);
|
|
728
|
+
return [
|
|
729
|
+
Oe(e),
|
|
730
|
+
t,
|
|
731
|
+
Oe(t)
|
|
732
|
+
];
|
|
733
|
+
}
|
|
734
|
+
function Oe(e) {
|
|
735
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
736
|
+
}
|
|
737
|
+
var ke = ["left", "right"], Ae = ["right", "left"], je = ["top", "bottom"], Me = ["bottom", "top"];
|
|
738
|
+
function Ne(e, t, n) {
|
|
739
|
+
switch (e) {
|
|
740
|
+
case "top":
|
|
741
|
+
case "bottom": return n ? t ? Ae : ke : t ? ke : Ae;
|
|
742
|
+
case "left":
|
|
743
|
+
case "right": return t ? je : Me;
|
|
744
|
+
default: return [];
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function Pe(e, t, n, r) {
|
|
748
|
+
let i = Se(e), a = Ne(xe(e), n === "start", r);
|
|
749
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Oe)))), a;
|
|
750
|
+
}
|
|
751
|
+
function Fe(e) {
|
|
752
|
+
let t = xe(e);
|
|
753
|
+
return ve[t] + e.slice(t.length);
|
|
754
|
+
}
|
|
755
|
+
function Ie(e) {
|
|
756
|
+
return {
|
|
757
|
+
top: 0,
|
|
758
|
+
right: 0,
|
|
759
|
+
bottom: 0,
|
|
760
|
+
left: 0,
|
|
761
|
+
...e
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
function Le(e) {
|
|
765
|
+
return typeof e == "number" ? {
|
|
766
|
+
top: e,
|
|
767
|
+
right: e,
|
|
768
|
+
bottom: e,
|
|
769
|
+
left: e
|
|
770
|
+
} : Ie(e);
|
|
771
|
+
}
|
|
772
|
+
function Re(e) {
|
|
773
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
774
|
+
return {
|
|
775
|
+
width: r,
|
|
776
|
+
height: i,
|
|
777
|
+
top: n,
|
|
778
|
+
left: t,
|
|
779
|
+
right: t + r,
|
|
780
|
+
bottom: n + i,
|
|
781
|
+
x: t,
|
|
782
|
+
y: n
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
//#endregion
|
|
786
|
+
//#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
787
|
+
function ze(e, t, n) {
|
|
788
|
+
let { reference: r, floating: i } = e, a = K(t), o = Te(t), s = we(o), c = xe(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
789
|
+
switch (c) {
|
|
790
|
+
case "top":
|
|
791
|
+
p = {
|
|
792
|
+
x: u,
|
|
793
|
+
y: r.y - i.height
|
|
794
|
+
};
|
|
795
|
+
break;
|
|
796
|
+
case "bottom":
|
|
797
|
+
p = {
|
|
798
|
+
x: u,
|
|
799
|
+
y: r.y + r.height
|
|
800
|
+
};
|
|
801
|
+
break;
|
|
802
|
+
case "right":
|
|
803
|
+
p = {
|
|
804
|
+
x: r.x + r.width,
|
|
805
|
+
y: d
|
|
806
|
+
};
|
|
807
|
+
break;
|
|
808
|
+
case "left":
|
|
809
|
+
p = {
|
|
810
|
+
x: r.x - i.width,
|
|
811
|
+
y: d
|
|
812
|
+
};
|
|
813
|
+
break;
|
|
814
|
+
default: p = {
|
|
815
|
+
x: r.x,
|
|
816
|
+
y: r.y
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
switch (Se(t)) {
|
|
820
|
+
case "start":
|
|
821
|
+
p[o] -= f * (n && l ? -1 : 1);
|
|
822
|
+
break;
|
|
823
|
+
case "end":
|
|
824
|
+
p[o] += f * (n && l ? -1 : 1);
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
return p;
|
|
828
|
+
}
|
|
829
|
+
async function Be(e, t) {
|
|
830
|
+
t === void 0 && (t = {});
|
|
831
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = be(t, e), p = Le(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Re(await i.getClippingRect({
|
|
832
|
+
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
833
|
+
boundary: c,
|
|
834
|
+
rootBoundary: l,
|
|
835
|
+
strategy: s
|
|
836
|
+
})), g = u === "floating" ? {
|
|
837
|
+
x: n,
|
|
838
|
+
y: r,
|
|
839
|
+
width: a.floating.width,
|
|
840
|
+
height: a.floating.height
|
|
841
|
+
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
842
|
+
x: 1,
|
|
843
|
+
y: 1
|
|
844
|
+
}, y = Re(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
845
|
+
elements: o,
|
|
846
|
+
rect: g,
|
|
847
|
+
offsetParent: _,
|
|
848
|
+
strategy: s
|
|
849
|
+
}) : g);
|
|
850
|
+
return {
|
|
851
|
+
top: (h.top - y.top + p.top) / v.y,
|
|
852
|
+
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
853
|
+
left: (h.left - y.left + p.left) / v.x,
|
|
854
|
+
right: (y.right - h.right + p.right) / v.x
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
var Ve = 50, He = async (e, t, n) => {
|
|
858
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
859
|
+
...o,
|
|
860
|
+
detectOverflow: Be
|
|
861
|
+
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
862
|
+
reference: e,
|
|
863
|
+
floating: t,
|
|
864
|
+
strategy: i
|
|
865
|
+
}), { x: u, y: d } = ze(l, r, c), f = r, p = 0, m = {};
|
|
866
|
+
for (let n = 0; n < a.length; n++) {
|
|
867
|
+
let h = a[n];
|
|
868
|
+
if (!h) continue;
|
|
869
|
+
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
870
|
+
x: u,
|
|
871
|
+
y: d,
|
|
872
|
+
initialPlacement: r,
|
|
873
|
+
placement: f,
|
|
874
|
+
strategy: i,
|
|
875
|
+
middlewareData: m,
|
|
876
|
+
rects: l,
|
|
877
|
+
platform: s,
|
|
878
|
+
elements: {
|
|
879
|
+
reference: e,
|
|
880
|
+
floating: t
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
u = v ?? u, d = y ?? d, m[g] = {
|
|
884
|
+
...m[g],
|
|
885
|
+
...b
|
|
886
|
+
}, x && p < Ve && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
887
|
+
reference: e,
|
|
888
|
+
floating: t,
|
|
889
|
+
strategy: i
|
|
890
|
+
}) : x.rects), {x: u, y: d} = ze(l, f, c)), n = -1);
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
x: u,
|
|
894
|
+
y: d,
|
|
895
|
+
placement: f,
|
|
896
|
+
strategy: i,
|
|
897
|
+
middlewareData: m
|
|
898
|
+
};
|
|
899
|
+
}, Ue = (e) => ({
|
|
900
|
+
name: "arrow",
|
|
901
|
+
options: e,
|
|
902
|
+
async fn(t) {
|
|
903
|
+
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = be(e, t) || {};
|
|
904
|
+
if (l == null) return {};
|
|
905
|
+
let d = Le(u), f = {
|
|
906
|
+
x: n,
|
|
907
|
+
y: r
|
|
908
|
+
}, p = Te(i), m = we(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
|
|
909
|
+
(!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
|
|
910
|
+
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = me(d[_], T), D = me(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = ye(O, A, k), M = !c.arrow && Se(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
|
|
911
|
+
return {
|
|
912
|
+
[p]: f[p] + N,
|
|
913
|
+
data: {
|
|
914
|
+
[p]: j,
|
|
915
|
+
centerOffset: A - j - N,
|
|
916
|
+
...M && { alignmentOffset: N }
|
|
917
|
+
},
|
|
918
|
+
reset: M
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
}), We = function(e) {
|
|
922
|
+
return e === void 0 && (e = {}), {
|
|
923
|
+
name: "flip",
|
|
924
|
+
options: e,
|
|
925
|
+
async fn(t) {
|
|
926
|
+
var n;
|
|
927
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = be(e, t);
|
|
928
|
+
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
929
|
+
let g = xe(r), _ = K(o), v = xe(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Fe(o)] : De(o)), x = p !== "none";
|
|
930
|
+
!d && x && b.push(...Pe(o, m, p, y));
|
|
931
|
+
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
932
|
+
if (l && w.push(C[g]), u) {
|
|
933
|
+
let e = Ee(r, a, y);
|
|
934
|
+
w.push(C[e[0]], C[e[1]]);
|
|
935
|
+
}
|
|
936
|
+
if (T = [...T, {
|
|
937
|
+
placement: r,
|
|
938
|
+
overflows: w
|
|
939
|
+
}], !w.every((e) => e <= 0)) {
|
|
940
|
+
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
941
|
+
if (t && (!(u === "alignment" && _ !== K(t)) || T.every((e) => K(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
942
|
+
data: {
|
|
943
|
+
index: e,
|
|
944
|
+
overflows: T
|
|
945
|
+
},
|
|
946
|
+
reset: { placement: t }
|
|
947
|
+
};
|
|
948
|
+
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
949
|
+
if (!n) switch (f) {
|
|
950
|
+
case "bestFit": {
|
|
951
|
+
let e = T.filter((e) => {
|
|
952
|
+
if (x) {
|
|
953
|
+
let t = K(e.placement);
|
|
954
|
+
return t === _ || t === "y";
|
|
955
|
+
}
|
|
956
|
+
return !0;
|
|
957
|
+
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
958
|
+
e && (n = e);
|
|
959
|
+
break;
|
|
960
|
+
}
|
|
961
|
+
case "initialPlacement":
|
|
962
|
+
n = o;
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
if (r !== n) return { reset: { placement: n } };
|
|
966
|
+
}
|
|
967
|
+
return {};
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
}, Ge = /* @__PURE__ */ new Set(["left", "top"]);
|
|
971
|
+
async function Ke(e, t) {
|
|
972
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = xe(n), s = Se(n), c = K(n) === "y", l = Ge.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = be(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
973
|
+
mainAxis: d,
|
|
974
|
+
crossAxis: 0,
|
|
975
|
+
alignmentAxis: null
|
|
976
|
+
} : {
|
|
977
|
+
mainAxis: d.mainAxis || 0,
|
|
978
|
+
crossAxis: d.crossAxis || 0,
|
|
979
|
+
alignmentAxis: d.alignmentAxis
|
|
980
|
+
};
|
|
981
|
+
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
982
|
+
x: p * u,
|
|
983
|
+
y: f * l
|
|
984
|
+
} : {
|
|
985
|
+
x: f * l,
|
|
986
|
+
y: p * u
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
var qe = function(e) {
|
|
990
|
+
return e === void 0 && (e = 0), {
|
|
991
|
+
name: "offset",
|
|
992
|
+
options: e,
|
|
993
|
+
async fn(t) {
|
|
994
|
+
var n;
|
|
995
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Ke(t, e);
|
|
996
|
+
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
997
|
+
x: r + s.x,
|
|
998
|
+
y: i + s.y,
|
|
999
|
+
data: {
|
|
1000
|
+
...s,
|
|
1001
|
+
placement: a
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
}, Je = function(e) {
|
|
1007
|
+
return e === void 0 && (e = {}), {
|
|
1008
|
+
name: "shift",
|
|
1009
|
+
options: e,
|
|
1010
|
+
async fn(t) {
|
|
1011
|
+
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
1012
|
+
let { x: t, y: n } = e;
|
|
1013
|
+
return {
|
|
1014
|
+
x: t,
|
|
1015
|
+
y: n
|
|
1016
|
+
};
|
|
1017
|
+
} }, ...l } = be(e, t), u = {
|
|
1018
|
+
x: n,
|
|
1019
|
+
y: r
|
|
1020
|
+
}, d = await a.detectOverflow(t, l), f = K(xe(i)), p = Ce(f), m = u[p], h = u[f];
|
|
1021
|
+
if (o) {
|
|
1022
|
+
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
1023
|
+
m = ye(n, m, r);
|
|
1024
|
+
}
|
|
1025
|
+
if (s) {
|
|
1026
|
+
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
1027
|
+
h = ye(n, h, r);
|
|
1028
|
+
}
|
|
1029
|
+
let g = c.fn({
|
|
1030
|
+
...t,
|
|
1031
|
+
[p]: m,
|
|
1032
|
+
[f]: h
|
|
1033
|
+
});
|
|
1034
|
+
return {
|
|
1035
|
+
...g,
|
|
1036
|
+
data: {
|
|
1037
|
+
x: g.x - n,
|
|
1038
|
+
y: g.y - r,
|
|
1039
|
+
enabled: {
|
|
1040
|
+
[p]: o,
|
|
1041
|
+
[f]: s
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
1050
|
+
function Ye() {
|
|
1051
|
+
return typeof window < "u";
|
|
1052
|
+
}
|
|
1053
|
+
function Xe(e) {
|
|
1054
|
+
return Ze(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
1055
|
+
}
|
|
1056
|
+
function q(e) {
|
|
1057
|
+
var t;
|
|
1058
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
1059
|
+
}
|
|
1060
|
+
function J(e) {
|
|
1061
|
+
return ((Ze(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
1062
|
+
}
|
|
1063
|
+
function Ze(e) {
|
|
1064
|
+
return Ye() ? e instanceof Node || e instanceof q(e).Node : !1;
|
|
1065
|
+
}
|
|
1066
|
+
function Y(e) {
|
|
1067
|
+
return Ye() ? e instanceof Element || e instanceof q(e).Element : !1;
|
|
1068
|
+
}
|
|
1069
|
+
function X(e) {
|
|
1070
|
+
return Ye() ? e instanceof HTMLElement || e instanceof q(e).HTMLElement : !1;
|
|
1071
|
+
}
|
|
1072
|
+
function Qe(e) {
|
|
1073
|
+
return !Ye() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof q(e).ShadowRoot;
|
|
1074
|
+
}
|
|
1075
|
+
function $e(e) {
|
|
1076
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
|
|
1077
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
1078
|
+
}
|
|
1079
|
+
function et(e) {
|
|
1080
|
+
return /^(table|td|th)$/.test(Xe(e));
|
|
1081
|
+
}
|
|
1082
|
+
function tt(e) {
|
|
1083
|
+
try {
|
|
1084
|
+
if (e.matches(":popover-open")) return !0;
|
|
1085
|
+
} catch {}
|
|
1086
|
+
try {
|
|
1087
|
+
return e.matches(":modal");
|
|
1088
|
+
} catch {
|
|
1089
|
+
return !1;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
var nt = /transform|translate|scale|rotate|perspective|filter/, rt = /paint|layout|strict|content/, it = (e) => !!e && e !== "none", at;
|
|
1093
|
+
function ot(e) {
|
|
1094
|
+
let t = Y(e) ? Z(e) : e;
|
|
1095
|
+
return it(t.transform) || it(t.translate) || it(t.scale) || it(t.rotate) || it(t.perspective) || !ct() && (it(t.backdropFilter) || it(t.filter)) || nt.test(t.willChange || "") || rt.test(t.contain || "");
|
|
1096
|
+
}
|
|
1097
|
+
function st(e) {
|
|
1098
|
+
let t = dt(e);
|
|
1099
|
+
for (; X(t) && !lt(t);) {
|
|
1100
|
+
if (ot(t)) return t;
|
|
1101
|
+
if (tt(t)) return null;
|
|
1102
|
+
t = dt(t);
|
|
1103
|
+
}
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1106
|
+
function ct() {
|
|
1107
|
+
return at ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), at;
|
|
1108
|
+
}
|
|
1109
|
+
function lt(e) {
|
|
1110
|
+
return /^(html|body|#document)$/.test(Xe(e));
|
|
1111
|
+
}
|
|
1112
|
+
function Z(e) {
|
|
1113
|
+
return q(e).getComputedStyle(e);
|
|
1114
|
+
}
|
|
1115
|
+
function ut(e) {
|
|
1116
|
+
return Y(e) ? {
|
|
1117
|
+
scrollLeft: e.scrollLeft,
|
|
1118
|
+
scrollTop: e.scrollTop
|
|
1119
|
+
} : {
|
|
1120
|
+
scrollLeft: e.scrollX,
|
|
1121
|
+
scrollTop: e.scrollY
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
function dt(e) {
|
|
1125
|
+
if (Xe(e) === "html") return e;
|
|
1126
|
+
let t = e.assignedSlot || e.parentNode || Qe(e) && e.host || J(e);
|
|
1127
|
+
return Qe(t) ? t.host : t;
|
|
1128
|
+
}
|
|
1129
|
+
function ft(e) {
|
|
1130
|
+
let t = dt(e);
|
|
1131
|
+
return lt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : X(t) && $e(t) ? t : ft(t);
|
|
1132
|
+
}
|
|
1133
|
+
function pt(e, t, n) {
|
|
1134
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
1135
|
+
let r = ft(e), i = r === e.ownerDocument?.body, a = q(r);
|
|
1136
|
+
if (i) {
|
|
1137
|
+
let e = mt(a);
|
|
1138
|
+
return t.concat(a, a.visualViewport || [], $e(r) ? r : [], e && n ? pt(e) : []);
|
|
1139
|
+
} else return t.concat(r, pt(r, [], n));
|
|
1140
|
+
}
|
|
1141
|
+
function mt(e) {
|
|
1142
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
1143
|
+
}
|
|
1144
|
+
//#endregion
|
|
1145
|
+
//#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
1146
|
+
function ht(e) {
|
|
1147
|
+
let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = X(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = ge(n) !== a || ge(r) !== o;
|
|
1148
|
+
return s && (n = a, r = o), {
|
|
1149
|
+
width: n,
|
|
1150
|
+
height: r,
|
|
1151
|
+
$: s
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
function gt(e) {
|
|
1155
|
+
return Y(e) ? e : e.contextElement;
|
|
1156
|
+
}
|
|
1157
|
+
function _t(e) {
|
|
1158
|
+
let t = gt(e);
|
|
1159
|
+
if (!X(t)) return G(1);
|
|
1160
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = ht(t), o = (a ? ge(n.width) : n.width) / r, s = (a ? ge(n.height) : n.height) / i;
|
|
1161
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
1162
|
+
x: o,
|
|
1163
|
+
y: s
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
var vt = /* @__PURE__ */ G(0);
|
|
1167
|
+
function yt(e) {
|
|
1168
|
+
let t = q(e);
|
|
1169
|
+
return !ct() || !t.visualViewport ? vt : {
|
|
1170
|
+
x: t.visualViewport.offsetLeft,
|
|
1171
|
+
y: t.visualViewport.offsetTop
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
function bt(e, t, n) {
|
|
1175
|
+
return t === void 0 && (t = !1), !n || t && n !== q(e) ? !1 : t;
|
|
1176
|
+
}
|
|
1177
|
+
function xt(e, t, n, r) {
|
|
1178
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1179
|
+
let i = e.getBoundingClientRect(), a = gt(e), o = G(1);
|
|
1180
|
+
t && (r ? Y(r) && (o = _t(r)) : o = _t(e));
|
|
1181
|
+
let s = bt(a, n, r) ? yt(a) : G(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
1182
|
+
if (a) {
|
|
1183
|
+
let e = q(a), t = r && Y(r) ? q(r) : r, n = e, i = mt(n);
|
|
1184
|
+
for (; i && r && t !== n;) {
|
|
1185
|
+
let e = _t(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
1186
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = q(i), i = mt(n);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
return Re({
|
|
1190
|
+
width: u,
|
|
1191
|
+
height: d,
|
|
1192
|
+
x: c,
|
|
1193
|
+
y: l
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
function St(e, t) {
|
|
1197
|
+
let n = ut(e).scrollLeft;
|
|
1198
|
+
return t ? t.left + n : xt(J(e)).left + n;
|
|
1199
|
+
}
|
|
1200
|
+
function Ct(e, t) {
|
|
1201
|
+
let n = e.getBoundingClientRect();
|
|
1202
|
+
return {
|
|
1203
|
+
x: n.left + t.scrollLeft - St(e, n),
|
|
1204
|
+
y: n.top + t.scrollTop
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
function wt(e) {
|
|
1208
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = J(r), s = t ? tt(t.floating) : !1;
|
|
1209
|
+
if (r === o || s && a) return n;
|
|
1210
|
+
let c = {
|
|
1211
|
+
scrollLeft: 0,
|
|
1212
|
+
scrollTop: 0
|
|
1213
|
+
}, l = G(1), u = G(0), d = X(r);
|
|
1214
|
+
if ((d || !d && !a) && ((Xe(r) !== "body" || $e(o)) && (c = ut(r)), d)) {
|
|
1215
|
+
let e = xt(r);
|
|
1216
|
+
l = _t(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
1217
|
+
}
|
|
1218
|
+
let f = o && !d && !a ? Ct(o, c) : G(0);
|
|
1219
|
+
return {
|
|
1220
|
+
width: n.width * l.x,
|
|
1221
|
+
height: n.height * l.y,
|
|
1222
|
+
x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
|
|
1223
|
+
y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
function Tt(e) {
|
|
1227
|
+
return Array.from(e.getClientRects());
|
|
1228
|
+
}
|
|
1229
|
+
function Et(e) {
|
|
1230
|
+
let t = J(e), n = ut(e), r = e.ownerDocument.body, i = he(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = he(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + St(e), s = -n.scrollTop;
|
|
1231
|
+
return Z(r).direction === "rtl" && (o += he(t.clientWidth, r.clientWidth) - i), {
|
|
1232
|
+
width: i,
|
|
1233
|
+
height: a,
|
|
1234
|
+
x: o,
|
|
1235
|
+
y: s
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
var Dt = 25;
|
|
1239
|
+
function Ot(e, t) {
|
|
1240
|
+
let n = q(e), r = J(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
1241
|
+
if (i) {
|
|
1242
|
+
a = i.width, o = i.height;
|
|
1243
|
+
let e = ct();
|
|
1244
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
1245
|
+
}
|
|
1246
|
+
let l = St(r);
|
|
1247
|
+
if (l <= 0) {
|
|
1248
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
1249
|
+
o <= Dt && (a -= o);
|
|
1250
|
+
} else l <= Dt && (a += l);
|
|
1251
|
+
return {
|
|
1252
|
+
width: a,
|
|
1253
|
+
height: o,
|
|
1254
|
+
x: s,
|
|
1255
|
+
y: c
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
function kt(e, t) {
|
|
1259
|
+
let n = xt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = X(e) ? _t(e) : G(1);
|
|
1260
|
+
return {
|
|
1261
|
+
width: e.clientWidth * a.x,
|
|
1262
|
+
height: e.clientHeight * a.y,
|
|
1263
|
+
x: i * a.x,
|
|
1264
|
+
y: r * a.y
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function At(e, t, n) {
|
|
1268
|
+
let r;
|
|
1269
|
+
if (t === "viewport") r = Ot(e, n);
|
|
1270
|
+
else if (t === "document") r = Et(J(e));
|
|
1271
|
+
else if (Y(t)) r = kt(t, n);
|
|
1272
|
+
else {
|
|
1273
|
+
let n = yt(e);
|
|
1274
|
+
r = {
|
|
1275
|
+
x: t.x - n.x,
|
|
1276
|
+
y: t.y - n.y,
|
|
1277
|
+
width: t.width,
|
|
1278
|
+
height: t.height
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
return Re(r);
|
|
1282
|
+
}
|
|
1283
|
+
function jt(e, t) {
|
|
1284
|
+
let n = dt(e);
|
|
1285
|
+
return n === t || !Y(n) || lt(n) ? !1 : Z(n).position === "fixed" || jt(n, t);
|
|
1286
|
+
}
|
|
1287
|
+
function Mt(e, t) {
|
|
1288
|
+
let n = t.get(e);
|
|
1289
|
+
if (n) return n;
|
|
1290
|
+
let r = pt(e, [], !1).filter((e) => Y(e) && Xe(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? dt(e) : e;
|
|
1291
|
+
for (; Y(o) && !lt(o);) {
|
|
1292
|
+
let t = Z(o), n = ot(o);
|
|
1293
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || $e(o) && !n && jt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = dt(o);
|
|
1294
|
+
}
|
|
1295
|
+
return t.set(e, r), r;
|
|
1296
|
+
}
|
|
1297
|
+
function Nt(e) {
|
|
1298
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? tt(t) ? [] : Mt(t, this._c) : [].concat(n), r], o = At(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
1299
|
+
for (let e = 1; e < a.length; e++) {
|
|
1300
|
+
let n = At(t, a[e], i);
|
|
1301
|
+
s = he(n.top, s), c = me(n.right, c), l = me(n.bottom, l), u = he(n.left, u);
|
|
1302
|
+
}
|
|
1303
|
+
return {
|
|
1304
|
+
width: c - u,
|
|
1305
|
+
height: l - s,
|
|
1306
|
+
x: u,
|
|
1307
|
+
y: s
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
function Pt(e) {
|
|
1311
|
+
let { width: t, height: n } = ht(e);
|
|
1312
|
+
return {
|
|
1313
|
+
width: t,
|
|
1314
|
+
height: n
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function Ft(e, t, n) {
|
|
1318
|
+
let r = X(t), i = J(t), a = n === "fixed", o = xt(e, !0, a, t), s = {
|
|
1319
|
+
scrollLeft: 0,
|
|
1320
|
+
scrollTop: 0
|
|
1321
|
+
}, c = G(0);
|
|
1322
|
+
function l() {
|
|
1323
|
+
c.x = St(i);
|
|
1324
|
+
}
|
|
1325
|
+
if (r || !r && !a) if ((Xe(t) !== "body" || $e(i)) && (s = ut(t)), r) {
|
|
1326
|
+
let e = xt(t, !0, a, t);
|
|
1327
|
+
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
1328
|
+
} else i && l();
|
|
1329
|
+
a && !r && i && l();
|
|
1330
|
+
let u = i && !r && !a ? Ct(i, s) : G(0);
|
|
1331
|
+
return {
|
|
1332
|
+
x: o.left + s.scrollLeft - c.x - u.x,
|
|
1333
|
+
y: o.top + s.scrollTop - c.y - u.y,
|
|
1334
|
+
width: o.width,
|
|
1335
|
+
height: o.height
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
function It(e) {
|
|
1339
|
+
return Z(e).position === "static";
|
|
1340
|
+
}
|
|
1341
|
+
function Lt(e, t) {
|
|
1342
|
+
if (!X(e) || Z(e).position === "fixed") return null;
|
|
1343
|
+
if (t) return t(e);
|
|
1344
|
+
let n = e.offsetParent;
|
|
1345
|
+
return J(e) === n && (n = n.ownerDocument.body), n;
|
|
1346
|
+
}
|
|
1347
|
+
function Rt(e, t) {
|
|
1348
|
+
let n = q(e);
|
|
1349
|
+
if (tt(e)) return n;
|
|
1350
|
+
if (!X(e)) {
|
|
1351
|
+
let t = dt(e);
|
|
1352
|
+
for (; t && !lt(t);) {
|
|
1353
|
+
if (Y(t) && !It(t)) return t;
|
|
1354
|
+
t = dt(t);
|
|
1355
|
+
}
|
|
1356
|
+
return n;
|
|
1357
|
+
}
|
|
1358
|
+
let r = Lt(e, t);
|
|
1359
|
+
for (; r && et(r) && It(r);) r = Lt(r, t);
|
|
1360
|
+
return r && lt(r) && It(r) && !ot(r) ? n : r || st(e) || n;
|
|
1361
|
+
}
|
|
1362
|
+
var zt = async function(e) {
|
|
1363
|
+
let t = this.getOffsetParent || Rt, n = this.getDimensions, r = await n(e.floating);
|
|
1364
|
+
return {
|
|
1365
|
+
reference: Ft(e.reference, await t(e.floating), e.strategy),
|
|
1366
|
+
floating: {
|
|
1367
|
+
x: 0,
|
|
1368
|
+
y: 0,
|
|
1369
|
+
width: r.width,
|
|
1370
|
+
height: r.height
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1374
|
+
function Bt(e) {
|
|
1375
|
+
return Z(e).direction === "rtl";
|
|
1376
|
+
}
|
|
1377
|
+
var Vt = {
|
|
1378
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: wt,
|
|
1379
|
+
getDocumentElement: J,
|
|
1380
|
+
getClippingRect: Nt,
|
|
1381
|
+
getOffsetParent: Rt,
|
|
1382
|
+
getElementRects: zt,
|
|
1383
|
+
getClientRects: Tt,
|
|
1384
|
+
getDimensions: Pt,
|
|
1385
|
+
getScale: _t,
|
|
1386
|
+
isElement: Y,
|
|
1387
|
+
isRTL: Bt
|
|
1388
|
+
};
|
|
1389
|
+
function Ht(e, t) {
|
|
1390
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1391
|
+
}
|
|
1392
|
+
function Ut(e, t) {
|
|
1393
|
+
let n = null, r, i = J(e);
|
|
1394
|
+
function a() {
|
|
1395
|
+
var e;
|
|
1396
|
+
clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
|
|
1397
|
+
}
|
|
1398
|
+
function o(s, c) {
|
|
1399
|
+
s === void 0 && (s = !1), c === void 0 && (c = 1), a();
|
|
1400
|
+
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
1401
|
+
if (s || t(), !f || !p) return;
|
|
1402
|
+
let m = _e(d), h = _e(i.clientWidth - (u + f)), g = _e(i.clientHeight - (d + p)), _ = _e(u), v = {
|
|
1403
|
+
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
1404
|
+
threshold: he(0, me(1, c)) || 1
|
|
1405
|
+
}, y = !0;
|
|
1406
|
+
function b(t) {
|
|
1407
|
+
let n = t[0].intersectionRatio;
|
|
1408
|
+
if (n !== c) {
|
|
1409
|
+
if (!y) return o();
|
|
1410
|
+
n ? o(!1, n) : r = setTimeout(() => {
|
|
1411
|
+
o(!1, 1e-7);
|
|
1412
|
+
}, 1e3);
|
|
1413
|
+
}
|
|
1414
|
+
n === 1 && !Ht(l, e.getBoundingClientRect()) && o(), y = !1;
|
|
1415
|
+
}
|
|
1416
|
+
try {
|
|
1417
|
+
n = new IntersectionObserver(b, {
|
|
1418
|
+
...v,
|
|
1419
|
+
root: i.ownerDocument
|
|
1420
|
+
});
|
|
1421
|
+
} catch {
|
|
1422
|
+
n = new IntersectionObserver(b, v);
|
|
1423
|
+
}
|
|
1424
|
+
n.observe(e);
|
|
1425
|
+
}
|
|
1426
|
+
return o(!0), a;
|
|
1427
|
+
}
|
|
1428
|
+
function Wt(e, t, n, r) {
|
|
1429
|
+
r === void 0 && (r = {});
|
|
1430
|
+
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = gt(e), u = i || a ? [...l ? pt(l) : [], ...t ? pt(t) : []] : [];
|
|
1431
|
+
u.forEach((e) => {
|
|
1432
|
+
i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
|
|
1433
|
+
});
|
|
1434
|
+
let d = l && s ? Ut(l, n) : null, f = -1, p = null;
|
|
1435
|
+
o && (p = new ResizeObserver((e) => {
|
|
1436
|
+
let [r] = e;
|
|
1437
|
+
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1438
|
+
var e;
|
|
1439
|
+
(e = p) == null || e.observe(t);
|
|
1440
|
+
})), n();
|
|
1441
|
+
}), l && !c && p.observe(l), t && p.observe(t));
|
|
1442
|
+
let m, h = c ? xt(e) : null;
|
|
1443
|
+
c && g();
|
|
1444
|
+
function g() {
|
|
1445
|
+
let t = xt(e);
|
|
1446
|
+
h && !Ht(h, t) && n(), h = t, m = requestAnimationFrame(g);
|
|
1447
|
+
}
|
|
1448
|
+
return n(), () => {
|
|
1449
|
+
var e;
|
|
1450
|
+
u.forEach((e) => {
|
|
1451
|
+
i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
|
|
1452
|
+
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
var Gt = qe, Kt = Je, qt = We, Jt = Ue, Yt = (e, t, n) => {
|
|
1456
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
1457
|
+
platform: Vt,
|
|
1458
|
+
...n
|
|
1459
|
+
}, a = {
|
|
1460
|
+
...i.platform,
|
|
1461
|
+
_c: r
|
|
1462
|
+
};
|
|
1463
|
+
return He(e, t, {
|
|
1464
|
+
...i,
|
|
1465
|
+
platform: a
|
|
1466
|
+
});
|
|
1467
|
+
}, Xt = "_trigger_e00wn_1", Zt = "_content_e00wn_10", Qt = "_subTrigger_e00wn_61", $t = "_itemMain_e00wn_90", en = "_itemInset_e00wn_106", tn = "_shortcut_e00wn_118", nn = "_indicator_e00wn_119", rn = "_submenuIndicator_e00wn_120", Q = {
|
|
1468
|
+
trigger: Xt,
|
|
1469
|
+
content: Zt,
|
|
1470
|
+
"owo-dropdown-menu-in": "_owo-dropdown-menu-in_e00wn_1",
|
|
1471
|
+
subTrigger: Qt,
|
|
1472
|
+
itemMain: $t,
|
|
1473
|
+
itemInset: en,
|
|
1474
|
+
shortcut: tn,
|
|
1475
|
+
indicator: nn,
|
|
1476
|
+
submenuIndicator: rn
|
|
1477
|
+
}, an = n(null), on = n(null);
|
|
1478
|
+
function sn(e) {
|
|
1479
|
+
let t = a(an);
|
|
1480
|
+
if (!t) throw Error(`${e} must be used within DropdownMenu.`);
|
|
1481
|
+
return t;
|
|
1482
|
+
}
|
|
1483
|
+
function cn(e) {
|
|
1484
|
+
let t = a(on);
|
|
1485
|
+
if (!t) throw Error(`${e} must be used within DropdownMenu.Content.`);
|
|
1486
|
+
return t;
|
|
1487
|
+
}
|
|
1488
|
+
function ln(e, t) {
|
|
1489
|
+
return (n) => {
|
|
1490
|
+
e?.(n), t(n);
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
function un(...e) {
|
|
1494
|
+
return (t) => {
|
|
1495
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
function dn(e) {
|
|
1499
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(dn).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? dn(e.props.children) : "";
|
|
1500
|
+
}
|
|
1501
|
+
function fn(e) {
|
|
1502
|
+
return [...e].sort((e, t) => {
|
|
1503
|
+
let n = e.ref.current, r = t.ref.current;
|
|
1504
|
+
if (!n || !r) return 0;
|
|
1505
|
+
let i = n.compareDocumentPosition(r);
|
|
1506
|
+
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
function pn(e, t) {
|
|
1510
|
+
return t === "center" ? e : `${e}-${t}`;
|
|
1511
|
+
}
|
|
1512
|
+
function mn(e) {
|
|
1513
|
+
let t = e.split("-");
|
|
1514
|
+
return {
|
|
1515
|
+
side: t[0],
|
|
1516
|
+
align: t[1] ?? "center"
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
function hn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom", align: o = "start", sideOffset: c = 8, alignOffset: f = 0, collisionPadding: m = 8, portal: h = !0, contentRole: g = "menu", classNames: _, children: v }) {
|
|
1520
|
+
let y = a(on), [b, x] = d(t), S = e !== void 0, C = S ? e : b, w = u(null), T = u(null), E = u("selected"), D = s(), O = s(), k = i((e) => {
|
|
1521
|
+
S || x(e), n?.(e);
|
|
1522
|
+
}, [S, n]), A = i(() => {
|
|
1523
|
+
k(!1);
|
|
1524
|
+
}, [k]), j = i(() => {
|
|
1525
|
+
k(!1), y?.closeTree();
|
|
1526
|
+
}, [y, k]), M = i(() => {
|
|
1527
|
+
k(!C);
|
|
1528
|
+
}, [C, k]), N = i(() => {
|
|
1529
|
+
w.current?.focus();
|
|
1530
|
+
}, []), ee = l(() => ({
|
|
1531
|
+
open: C,
|
|
1532
|
+
setOpen: k,
|
|
1533
|
+
toggleOpen: M,
|
|
1534
|
+
triggerRef: w,
|
|
1535
|
+
contentRef: T,
|
|
1536
|
+
side: r,
|
|
1537
|
+
align: o,
|
|
1538
|
+
sideOffset: c,
|
|
1539
|
+
alignOffset: f,
|
|
1540
|
+
collisionPadding: m,
|
|
1541
|
+
portal: h,
|
|
1542
|
+
contentRole: g,
|
|
1543
|
+
triggerId: D,
|
|
1544
|
+
contentId: O,
|
|
1545
|
+
focusIntentRef: E,
|
|
1546
|
+
parentList: y,
|
|
1547
|
+
isSubmenu: !!y,
|
|
1548
|
+
closeSelf: A,
|
|
1549
|
+
closeTree: j,
|
|
1550
|
+
focusTrigger: N,
|
|
1551
|
+
classNames: _
|
|
1552
|
+
}), [
|
|
1553
|
+
C,
|
|
1554
|
+
o,
|
|
1555
|
+
f,
|
|
1556
|
+
_,
|
|
1557
|
+
A,
|
|
1558
|
+
j,
|
|
1559
|
+
m,
|
|
1560
|
+
g,
|
|
1561
|
+
y,
|
|
1562
|
+
h,
|
|
1563
|
+
k,
|
|
1564
|
+
r,
|
|
1565
|
+
c,
|
|
1566
|
+
M,
|
|
1567
|
+
D,
|
|
1568
|
+
O,
|
|
1569
|
+
N
|
|
1570
|
+
]);
|
|
1571
|
+
return /* @__PURE__ */ p(an.Provider, {
|
|
1572
|
+
value: ee,
|
|
1573
|
+
children: v
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
function gn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
|
|
1577
|
+
let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } = sn("DropdownMenu.Trigger"), v = e.only(a), y = v.props ?? {}, b = typeof y.className == "string" ? y.className : void 0, x = {
|
|
1578
|
+
id: d,
|
|
1579
|
+
"data-state": o ? "open" : "closed",
|
|
1580
|
+
"aria-expanded": o,
|
|
1581
|
+
"aria-haspopup": u,
|
|
1582
|
+
"aria-controls": o ? f : void 0,
|
|
1583
|
+
onClick: ln(y.onClick, (e) => {
|
|
1584
|
+
if (r) {
|
|
1585
|
+
e.preventDefault();
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
m.current = "selected", c();
|
|
1589
|
+
}),
|
|
1590
|
+
onKeyDown: ln(y.onKeyDown, (e) => {
|
|
1591
|
+
r || (e.key === "ArrowDown" ? (e.preventDefault(), m.current = "first", s(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), m.current = "last", s(!0)) : !h && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m.current = "selected", c()));
|
|
1592
|
+
})
|
|
1593
|
+
};
|
|
1594
|
+
return n ? t(v, {
|
|
1595
|
+
...x,
|
|
1596
|
+
ref: un(l, y.ref),
|
|
1597
|
+
className: _(Q.trigger, g?.trigger, i, b),
|
|
1598
|
+
type: v.type === "button" ? y.type ?? "button" : y.type
|
|
1599
|
+
}) : /* @__PURE__ */ p("button", {
|
|
1600
|
+
ref: l,
|
|
1601
|
+
disabled: r,
|
|
1602
|
+
type: "button",
|
|
1603
|
+
"data-scope": "dropdown-menu",
|
|
1604
|
+
"data-part": "trigger",
|
|
1605
|
+
className: _(Q.trigger, g?.trigger, i),
|
|
1606
|
+
...x,
|
|
1607
|
+
children: v
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, maxHeight: a = 320, ...s }) {
|
|
1611
|
+
let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: ee } = sn("DropdownMenu.Content"), P = u([]), [F, I] = d(null), [L, R] = d(null), [te, ne] = d(null), [z, B] = d(!1), re = u(""), V = u(null), ie = i((e) => (P.current = [...P.current.filter((t) => t.id !== e.id), e], () => {
|
|
1612
|
+
P.current = P.current.filter((t) => t.id !== e.id);
|
|
1613
|
+
}), []), H = i(() => fn(P.current), []), ae = i((e) => {
|
|
1614
|
+
O.current = e;
|
|
1615
|
+
}, [O]);
|
|
1616
|
+
o(() => {
|
|
1617
|
+
B(!0);
|
|
1618
|
+
}, []);
|
|
1619
|
+
let oe = l(() => ({
|
|
1620
|
+
role: T,
|
|
1621
|
+
highlightedId: F,
|
|
1622
|
+
setHighlightedId: I,
|
|
1623
|
+
registerItem: ie,
|
|
1624
|
+
getItems: H,
|
|
1625
|
+
requestFocusIntent: ae,
|
|
1626
|
+
closeTree: M,
|
|
1627
|
+
closeSelf: j,
|
|
1628
|
+
focusTrigger: N,
|
|
1629
|
+
activeSubmenuId: L,
|
|
1630
|
+
setActiveSubmenuId: R,
|
|
1631
|
+
contentRef: v
|
|
1632
|
+
}), [
|
|
1633
|
+
L,
|
|
1634
|
+
j,
|
|
1635
|
+
M,
|
|
1636
|
+
v,
|
|
1637
|
+
T,
|
|
1638
|
+
N,
|
|
1639
|
+
H,
|
|
1640
|
+
F,
|
|
1641
|
+
ie,
|
|
1642
|
+
ae
|
|
1643
|
+
]);
|
|
1644
|
+
c(() => {
|
|
1645
|
+
if (!(!f || !z || !g.current || !v.current)) return Wt(g.current, v.current, () => {
|
|
1646
|
+
!g.current || !v.current || Yt(g.current, v.current, {
|
|
1647
|
+
placement: pn(y, b),
|
|
1648
|
+
strategy: "fixed",
|
|
1649
|
+
middleware: [
|
|
1650
|
+
Gt({
|
|
1651
|
+
mainAxis: x,
|
|
1652
|
+
crossAxis: S
|
|
1653
|
+
}),
|
|
1654
|
+
qt({ padding: C }),
|
|
1655
|
+
Kt({ padding: C })
|
|
1656
|
+
]
|
|
1657
|
+
}).then(({ x: e, y: t, placement: n }) => {
|
|
1658
|
+
let r = mn(n);
|
|
1659
|
+
ne({
|
|
1660
|
+
top: t,
|
|
1661
|
+
left: e,
|
|
1662
|
+
side: r.side,
|
|
1663
|
+
align: r.align
|
|
1664
|
+
});
|
|
1665
|
+
});
|
|
1666
|
+
});
|
|
1667
|
+
}, [
|
|
1668
|
+
b,
|
|
1669
|
+
S,
|
|
1670
|
+
C,
|
|
1671
|
+
v,
|
|
1672
|
+
z,
|
|
1673
|
+
f,
|
|
1674
|
+
y,
|
|
1675
|
+
x,
|
|
1676
|
+
g
|
|
1677
|
+
]), o(() => {
|
|
1678
|
+
if (!f) {
|
|
1679
|
+
I(null), R(null);
|
|
1680
|
+
return;
|
|
1681
|
+
}
|
|
1682
|
+
let e = H().filter((e) => !e.disabled);
|
|
1683
|
+
if (e.length === 0) return;
|
|
1684
|
+
let t = e[0];
|
|
1685
|
+
O.current === "last" ? t = e[e.length - 1] : O.current === "selected" && (t = e.find((e) => e.selected) ?? e[0]), I(t.id), requestAnimationFrame(() => {
|
|
1686
|
+
v.current?.focus(), t.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1687
|
+
});
|
|
1688
|
+
}, [
|
|
1689
|
+
v,
|
|
1690
|
+
O,
|
|
1691
|
+
H,
|
|
1692
|
+
f
|
|
1693
|
+
]), o(() => {
|
|
1694
|
+
if (!f) return;
|
|
1695
|
+
function e(e) {
|
|
1696
|
+
let t = e.target, n = g.current?.contains(t), r = v.current?.contains(t);
|
|
1697
|
+
if (!n && !r) {
|
|
1698
|
+
let e = k?.contentRef.current?.contains(t);
|
|
1699
|
+
if (A && e) {
|
|
1700
|
+
j(), k?.setActiveSubmenuId(null);
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
M();
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1707
|
+
}, [
|
|
1708
|
+
j,
|
|
1709
|
+
M,
|
|
1710
|
+
v,
|
|
1711
|
+
A,
|
|
1712
|
+
f,
|
|
1713
|
+
k,
|
|
1714
|
+
g
|
|
1715
|
+
]), o(() => {
|
|
1716
|
+
if (f) return () => {
|
|
1717
|
+
V.current && clearTimeout(V.current);
|
|
1718
|
+
};
|
|
1719
|
+
}, [f]);
|
|
1720
|
+
let U = i((e) => {
|
|
1721
|
+
if (I(e), !e) {
|
|
1722
|
+
R(null);
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
H().find((t) => t.id === e)?.submenu || R(null);
|
|
1726
|
+
}, [H]), se = i((e, t = "first") => {
|
|
1727
|
+
let n = H().filter((e) => !e.disabled);
|
|
1728
|
+
if (n.length === 0) return;
|
|
1729
|
+
let r = n.findIndex((e) => e.id === F);
|
|
1730
|
+
if (r === -1) {
|
|
1731
|
+
U(t === "last" ? n[n.length - 1].id : n[0].id);
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
let i = n[(r + e + n.length) % n.length];
|
|
1735
|
+
U(i.id), i.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1736
|
+
}, [
|
|
1737
|
+
H,
|
|
1738
|
+
F,
|
|
1739
|
+
U
|
|
1740
|
+
]), ce = i((e) => {
|
|
1741
|
+
let t = e.length === 1 ? e.toLowerCase() : "";
|
|
1742
|
+
if (!t) return;
|
|
1743
|
+
V.current && clearTimeout(V.current), re.current += t, V.current = setTimeout(() => {
|
|
1744
|
+
re.current = "", V.current = null;
|
|
1745
|
+
}, 350);
|
|
1746
|
+
let n = H().filter((e) => !e.disabled);
|
|
1747
|
+
if (n.length === 0) return;
|
|
1748
|
+
let r = n.findIndex((e) => e.id === F), i = (r >= 0 ? [...n.slice(r + 1), ...n.slice(0, r + 1)] : n).find((e) => e.textValue.toLowerCase().startsWith(re.current));
|
|
1749
|
+
i && (U(i.id), i.ref.current?.scrollIntoView({ block: "nearest" }));
|
|
1750
|
+
}, [
|
|
1751
|
+
H,
|
|
1752
|
+
F,
|
|
1753
|
+
U
|
|
1754
|
+
]), le = i((e) => {
|
|
1755
|
+
let t = H(), n = t.find((e) => e.id === F) ?? null;
|
|
1756
|
+
switch (e.key) {
|
|
1757
|
+
case "ArrowDown":
|
|
1758
|
+
e.preventDefault(), se(1);
|
|
1759
|
+
break;
|
|
1760
|
+
case "ArrowUp":
|
|
1761
|
+
e.preventDefault(), se(-1, "last");
|
|
1762
|
+
break;
|
|
1763
|
+
case "Home":
|
|
1764
|
+
e.preventDefault();
|
|
1765
|
+
{
|
|
1766
|
+
let e = t.find((e) => !e.disabled);
|
|
1767
|
+
e && U(e.id);
|
|
1768
|
+
}
|
|
1769
|
+
break;
|
|
1770
|
+
case "End":
|
|
1771
|
+
e.preventDefault();
|
|
1772
|
+
{
|
|
1773
|
+
let e = t.filter((e) => !e.disabled), n = e[e.length - 1];
|
|
1774
|
+
n && U(n.id);
|
|
1775
|
+
}
|
|
1776
|
+
break;
|
|
1777
|
+
case "Enter":
|
|
1778
|
+
case " ":
|
|
1779
|
+
n && !n.disabled && (e.preventDefault(), n.click());
|
|
1780
|
+
break;
|
|
1781
|
+
case "ArrowRight":
|
|
1782
|
+
n?.submenu && (e.preventDefault(), n.openSubmenu?.());
|
|
1783
|
+
break;
|
|
1784
|
+
case "ArrowLeft":
|
|
1785
|
+
A && (e.preventDefault(), j(), N(), k?.setActiveSubmenuId(null));
|
|
1786
|
+
break;
|
|
1787
|
+
case "Tab":
|
|
1788
|
+
M();
|
|
1789
|
+
break;
|
|
1790
|
+
case "Escape":
|
|
1791
|
+
e.preventDefault(), j(), N(), A && k?.setActiveSubmenuId(null);
|
|
1792
|
+
break;
|
|
1793
|
+
default: ce(e.key);
|
|
1794
|
+
}
|
|
1795
|
+
}, [
|
|
1796
|
+
j,
|
|
1797
|
+
M,
|
|
1798
|
+
N,
|
|
1799
|
+
H,
|
|
1800
|
+
ce,
|
|
1801
|
+
F,
|
|
1802
|
+
U,
|
|
1803
|
+
A,
|
|
1804
|
+
se,
|
|
1805
|
+
k
|
|
1806
|
+
]);
|
|
1807
|
+
if (!f || !z) return null;
|
|
1808
|
+
let ue = /* @__PURE__ */ p(on.Provider, {
|
|
1809
|
+
value: oe,
|
|
1810
|
+
children: /* @__PURE__ */ p("div", {
|
|
1811
|
+
ref: v,
|
|
1812
|
+
id: D,
|
|
1813
|
+
role: T,
|
|
1814
|
+
tabIndex: -1,
|
|
1815
|
+
"aria-labelledby": T === "menu" ? E : void 0,
|
|
1816
|
+
"data-state": "open",
|
|
1817
|
+
"data-side": te?.side ?? y,
|
|
1818
|
+
"data-align": te?.align ?? b,
|
|
1819
|
+
"data-scope": "dropdown-menu",
|
|
1820
|
+
"data-part": "content",
|
|
1821
|
+
className: _(Q.content, ee?.content, e),
|
|
1822
|
+
style: {
|
|
1823
|
+
...n,
|
|
1824
|
+
position: "fixed",
|
|
1825
|
+
top: te?.top ?? 0,
|
|
1826
|
+
left: te?.left ?? 0,
|
|
1827
|
+
maxHeight: a,
|
|
1828
|
+
minWidth: r ? g.current?.getBoundingClientRect().width : void 0
|
|
1829
|
+
},
|
|
1830
|
+
onKeyDown: le,
|
|
1831
|
+
...s,
|
|
1832
|
+
children: t
|
|
1833
|
+
})
|
|
1834
|
+
});
|
|
1835
|
+
return w ? h(ue, document.body) : ue;
|
|
1836
|
+
}
|
|
1837
|
+
function vn({ className: e, children: t, ...n }) {
|
|
1838
|
+
let { classNames: r } = sn("DropdownMenu.Group");
|
|
1839
|
+
return /* @__PURE__ */ p("div", {
|
|
1840
|
+
"data-scope": "dropdown-menu",
|
|
1841
|
+
"data-part": "group",
|
|
1842
|
+
className: _(r?.group, e),
|
|
1843
|
+
...n,
|
|
1844
|
+
children: t
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
function yn({ className: e, children: t, ...n }) {
|
|
1848
|
+
let { classNames: r } = sn("DropdownMenu.Label");
|
|
1849
|
+
return /* @__PURE__ */ p("div", {
|
|
1850
|
+
"data-scope": "dropdown-menu",
|
|
1851
|
+
"data-part": "label",
|
|
1852
|
+
className: _(r?.label, e),
|
|
1853
|
+
...n,
|
|
1854
|
+
children: t
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
function bn({ className: e, ...t }) {
|
|
1858
|
+
let { classNames: n } = sn("DropdownMenu.Separator");
|
|
1859
|
+
return /* @__PURE__ */ p("div", {
|
|
1860
|
+
role: "separator",
|
|
1861
|
+
"data-scope": "dropdown-menu",
|
|
1862
|
+
"data-part": "separator",
|
|
1863
|
+
className: _(n?.separator, e),
|
|
1864
|
+
...t
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
function xn({ className: e, children: t, inset: n = !1, disabled: r = !1, selected: a = !1, destructive: c = !1, closeOnSelect: d = !0, shortcut: f, indicator: h, onSelect: g, onMouseEnter: v, onClick: y, ...b }) {
|
|
1868
|
+
let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } = cn("DropdownMenu.Item"), { classNames: k } = sn("DropdownMenu.Item"), A = l(() => dn(t), [t]), j = w === x, M = i(() => {
|
|
1869
|
+
r || (g?.(), d && D());
|
|
1870
|
+
}, [
|
|
1871
|
+
d,
|
|
1872
|
+
D,
|
|
1873
|
+
r,
|
|
1874
|
+
g
|
|
1875
|
+
]);
|
|
1876
|
+
return o(() => E({
|
|
1877
|
+
id: x,
|
|
1878
|
+
ref: S,
|
|
1879
|
+
disabled: r,
|
|
1880
|
+
submenu: !1,
|
|
1881
|
+
selected: a,
|
|
1882
|
+
textValue: A,
|
|
1883
|
+
closeOnSelect: d,
|
|
1884
|
+
click: M
|
|
1885
|
+
}), [
|
|
1886
|
+
d,
|
|
1887
|
+
r,
|
|
1888
|
+
M,
|
|
1889
|
+
x,
|
|
1890
|
+
E,
|
|
1891
|
+
a,
|
|
1892
|
+
A
|
|
1893
|
+
]), /* @__PURE__ */ m("button", {
|
|
1894
|
+
ref: S,
|
|
1895
|
+
id: x,
|
|
1896
|
+
type: "button",
|
|
1897
|
+
role: C === "listbox" ? "option" : "menuitem",
|
|
1898
|
+
tabIndex: -1,
|
|
1899
|
+
disabled: r,
|
|
1900
|
+
"aria-selected": C === "listbox" ? a : void 0,
|
|
1901
|
+
"data-highlighted": j || void 0,
|
|
1902
|
+
"data-selected": a || void 0,
|
|
1903
|
+
"data-disabled": r || void 0,
|
|
1904
|
+
"data-destructive": c || void 0,
|
|
1905
|
+
"data-scope": "dropdown-menu",
|
|
1906
|
+
"data-part": "item",
|
|
1907
|
+
className: _(n && Q.itemInset, k?.item, e),
|
|
1908
|
+
onMouseEnter: ln(v, () => {
|
|
1909
|
+
r || (T(x), O(null));
|
|
1910
|
+
}),
|
|
1911
|
+
onClick: ln(y, (e) => {
|
|
1912
|
+
e.preventDefault(), M();
|
|
1913
|
+
}),
|
|
1914
|
+
...b,
|
|
1915
|
+
children: [
|
|
1916
|
+
/* @__PURE__ */ p("span", {
|
|
1917
|
+
className: Q.itemMain,
|
|
1918
|
+
children: t
|
|
1919
|
+
}),
|
|
1920
|
+
f ? /* @__PURE__ */ p("span", {
|
|
1921
|
+
className: Q.shortcut,
|
|
1922
|
+
children: f
|
|
1923
|
+
}) : null,
|
|
1924
|
+
a ? /* @__PURE__ */ p("span", {
|
|
1925
|
+
className: Q.indicator,
|
|
1926
|
+
children: h ?? "✓"
|
|
1927
|
+
}) : null
|
|
1928
|
+
]
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
function Sn(e) {
|
|
1932
|
+
return /* @__PURE__ */ p(hn, {
|
|
1933
|
+
side: "right",
|
|
1934
|
+
align: "start",
|
|
1935
|
+
sideOffset: 6,
|
|
1936
|
+
...e,
|
|
1937
|
+
contentRole: "menu"
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
function Cn({ className: e, children: t, inset: n = !1, disabled: r = !1, destructive: a = !1, shortcut: c, onSelect: d, onMouseEnter: f, onClick: h, ...g }) {
|
|
1941
|
+
let v = s(), y = u(null), b = sn("DropdownMenu.SubTrigger"), { highlightedId: x, setHighlightedId: S, registerItem: C, setActiveSubmenuId: w, activeSubmenuId: T } = cn("DropdownMenu.SubTrigger"), E = l(() => dn(t), [t]), D = x === v, O = b.open && T === v, k = i(() => {
|
|
1942
|
+
r || (b.focusIntentRef.current = "first", S(v), w(v), b.setOpen(!0));
|
|
1943
|
+
}, [
|
|
1944
|
+
r,
|
|
1945
|
+
v,
|
|
1946
|
+
w,
|
|
1947
|
+
S,
|
|
1948
|
+
b
|
|
1949
|
+
]);
|
|
1950
|
+
return o(() => C({
|
|
1951
|
+
id: v,
|
|
1952
|
+
ref: y,
|
|
1953
|
+
disabled: r,
|
|
1954
|
+
submenu: !0,
|
|
1955
|
+
selected: !1,
|
|
1956
|
+
textValue: E,
|
|
1957
|
+
closeOnSelect: !1,
|
|
1958
|
+
click: k,
|
|
1959
|
+
openSubmenu: k
|
|
1960
|
+
}), [
|
|
1961
|
+
r,
|
|
1962
|
+
v,
|
|
1963
|
+
k,
|
|
1964
|
+
C,
|
|
1965
|
+
E
|
|
1966
|
+
]), o(() => {
|
|
1967
|
+
T !== v && b.open && b.setOpen(!1);
|
|
1968
|
+
}, [
|
|
1969
|
+
T,
|
|
1970
|
+
v,
|
|
1971
|
+
b
|
|
1972
|
+
]), /* @__PURE__ */ m("button", {
|
|
1973
|
+
ref: un(y, b.triggerRef),
|
|
1974
|
+
id: b.triggerId,
|
|
1975
|
+
type: "button",
|
|
1976
|
+
role: "menuitem",
|
|
1977
|
+
tabIndex: -1,
|
|
1978
|
+
"aria-haspopup": "menu",
|
|
1979
|
+
"aria-expanded": b.open,
|
|
1980
|
+
"aria-controls": b.open ? b.contentId : void 0,
|
|
1981
|
+
"data-highlighted": D || void 0,
|
|
1982
|
+
"data-state": O ? "open" : "closed",
|
|
1983
|
+
"data-disabled": r || void 0,
|
|
1984
|
+
"data-destructive": a || void 0,
|
|
1985
|
+
className: _(Q.subTrigger, n && Q.itemInset, e),
|
|
1986
|
+
onMouseEnter: ln(f, () => {
|
|
1987
|
+
k();
|
|
1988
|
+
}),
|
|
1989
|
+
onClick: ln(h, (e) => {
|
|
1990
|
+
e.preventDefault(), k(), d?.();
|
|
1991
|
+
}),
|
|
1992
|
+
...g,
|
|
1993
|
+
children: [
|
|
1994
|
+
/* @__PURE__ */ p("span", {
|
|
1995
|
+
className: Q.itemMain,
|
|
1996
|
+
children: t
|
|
1997
|
+
}),
|
|
1998
|
+
c ? /* @__PURE__ */ p("span", {
|
|
1999
|
+
className: Q.shortcut,
|
|
2000
|
+
children: c
|
|
2001
|
+
}) : null,
|
|
2002
|
+
/* @__PURE__ */ p("span", {
|
|
2003
|
+
className: Q.submenuIndicator,
|
|
2004
|
+
"aria-hidden": "true",
|
|
2005
|
+
children: "›"
|
|
2006
|
+
})
|
|
2007
|
+
]
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
var wn = Object.assign(hn, {
|
|
2011
|
+
Trigger: gn,
|
|
2012
|
+
Content: _n,
|
|
2013
|
+
Group: vn,
|
|
2014
|
+
Label: yn,
|
|
2015
|
+
Item: xn,
|
|
2016
|
+
Separator: bn,
|
|
2017
|
+
Submenu: Sn,
|
|
2018
|
+
SubTrigger: Cn
|
|
2019
|
+
}), Tn = {
|
|
2020
|
+
panel: "_panel_7f715_1",
|
|
2021
|
+
backdrop: "_backdrop_7f715_55"
|
|
2022
|
+
};
|
|
2023
|
+
//#endregion
|
|
2024
|
+
//#region src/components/Drawer.tsx
|
|
2025
|
+
function En({ as: e = "aside", open: t, children: n, side: r = "right", position: i = "fixed", showBackdrop: a = !0, onClose: o, closeLabel: s = "关闭抽屉", backdropClassName: c, className: l, classNames: u, ...d }) {
|
|
2026
|
+
return /* @__PURE__ */ m(f, { children: [a && t && o && /* @__PURE__ */ p("button", {
|
|
2027
|
+
type: "button",
|
|
2028
|
+
"aria-label": s,
|
|
2029
|
+
"data-state": "open",
|
|
2030
|
+
"data-scope": "drawer",
|
|
2031
|
+
"data-part": "backdrop",
|
|
2032
|
+
"data-position": i,
|
|
2033
|
+
className: _("owo-drawer-backdrop", Tn.backdrop, c, u?.backdrop),
|
|
2034
|
+
onClick: o
|
|
2035
|
+
}), /* @__PURE__ */ p(e, {
|
|
2036
|
+
"aria-hidden": !t,
|
|
2037
|
+
"data-state": t ? "open" : "closed",
|
|
2038
|
+
"data-side": r,
|
|
2039
|
+
"data-position": i,
|
|
2040
|
+
"data-scope": "drawer",
|
|
2041
|
+
"data-part": "panel",
|
|
2042
|
+
className: _("owo-drawer", Tn.panel, l, u?.panel),
|
|
2043
|
+
...d,
|
|
2044
|
+
children: n
|
|
2045
|
+
})] });
|
|
2046
|
+
}
|
|
2047
|
+
var Dn = {
|
|
2048
|
+
root: "_root_1fz2l_1",
|
|
2049
|
+
label: "_label_1fz2l_7",
|
|
2050
|
+
help: "_help_1fz2l_15"
|
|
2051
|
+
};
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/components/Field.tsx
|
|
2054
|
+
function On({ label: e, help: t, htmlFor: n, children: r, className: i, classNames: a, ...o }) {
|
|
2055
|
+
return /* @__PURE__ */ m("div", {
|
|
2056
|
+
className: _("owo-field", Dn.root, i),
|
|
2057
|
+
...o,
|
|
2058
|
+
children: [
|
|
2059
|
+
/* @__PURE__ */ p("label", {
|
|
2060
|
+
htmlFor: n,
|
|
2061
|
+
"data-part": "label",
|
|
2062
|
+
className: _(Dn.label, a?.label),
|
|
2063
|
+
children: e
|
|
2064
|
+
}),
|
|
2065
|
+
r,
|
|
2066
|
+
t ? /* @__PURE__ */ p("span", {
|
|
2067
|
+
"data-part": "help",
|
|
2068
|
+
className: _(Dn.help, a?.help),
|
|
2069
|
+
children: t
|
|
2070
|
+
}) : null
|
|
2071
|
+
]
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
var kn = { root: "_root_1hqa8_1" };
|
|
2075
|
+
//#endregion
|
|
2076
|
+
//#region src/components/IconButton.tsx
|
|
2077
|
+
function An({ variant: e = "ghost", size: t = "md", label: n, icon: r, className: i, ...a }) {
|
|
2078
|
+
let o = _("owo-icon-button", kn.root, i);
|
|
2079
|
+
if ("href" in a && a.href) {
|
|
2080
|
+
let { href: i, ...s } = a;
|
|
2081
|
+
return /* @__PURE__ */ p("a", {
|
|
2082
|
+
href: i,
|
|
2083
|
+
"aria-label": n,
|
|
2084
|
+
title: s.title ?? n,
|
|
2085
|
+
"data-variant": e,
|
|
2086
|
+
"data-size": t,
|
|
2087
|
+
className: o,
|
|
2088
|
+
...s,
|
|
2089
|
+
children: r
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
let s = a;
|
|
2093
|
+
return /* @__PURE__ */ p("button", {
|
|
2094
|
+
type: s.type ?? "button",
|
|
2095
|
+
"aria-label": n,
|
|
2096
|
+
title: s.title ?? n,
|
|
2097
|
+
"data-variant": e,
|
|
2098
|
+
"data-size": t,
|
|
2099
|
+
className: o,
|
|
2100
|
+
...s,
|
|
2101
|
+
children: r
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
var jn = { root: "_root_8zge1_1" };
|
|
2105
|
+
//#endregion
|
|
2106
|
+
//#region src/components/Input.tsx
|
|
2107
|
+
function Mn(e) {
|
|
2108
|
+
let { className: t, tone: n = "default", size: r = "md", ...i } = e;
|
|
2109
|
+
return e.as === "textarea" ? /* @__PURE__ */ p("textarea", {
|
|
2110
|
+
"data-tone": n,
|
|
2111
|
+
"data-size": r,
|
|
2112
|
+
className: _("owo-input", jn.root, t),
|
|
2113
|
+
...i
|
|
2114
|
+
}) : /* @__PURE__ */ p("input", {
|
|
2115
|
+
"data-tone": n,
|
|
2116
|
+
"data-size": r,
|
|
2117
|
+
className: _("owo-input", jn.root, t),
|
|
2118
|
+
...i
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
var Nn = { root: "_root_1226l_1" };
|
|
2122
|
+
//#endregion
|
|
2123
|
+
//#region src/components/Panel.tsx
|
|
2124
|
+
function Pn({ as: e = "section", variant: t = "default", padding: n = "none", className: r, children: i, ...a }) {
|
|
2125
|
+
return /* @__PURE__ */ p(e, {
|
|
2126
|
+
"data-variant": t,
|
|
2127
|
+
"data-padding": n === "none" ? void 0 : n,
|
|
2128
|
+
"data-scope": "panel",
|
|
2129
|
+
className: _("owo-panel", Nn.root, r),
|
|
2130
|
+
...a,
|
|
2131
|
+
children: i
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function Fn({ className: e, children: t, ...n }) {
|
|
2135
|
+
return /* @__PURE__ */ p("div", {
|
|
2136
|
+
"data-scope": "panel",
|
|
2137
|
+
"data-part": "header",
|
|
2138
|
+
className: _(e),
|
|
2139
|
+
...n,
|
|
2140
|
+
children: t
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2143
|
+
function In({ className: e, children: t, ...n }) {
|
|
2144
|
+
return /* @__PURE__ */ p("div", {
|
|
2145
|
+
"data-scope": "panel",
|
|
2146
|
+
"data-part": "body",
|
|
2147
|
+
className: _(e),
|
|
2148
|
+
...n,
|
|
2149
|
+
children: t
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
function Ln({ className: e, children: t, ...n }) {
|
|
2153
|
+
return /* @__PURE__ */ p("div", {
|
|
2154
|
+
"data-scope": "panel",
|
|
2155
|
+
"data-part": "footer",
|
|
2156
|
+
className: _(e),
|
|
2157
|
+
...n,
|
|
2158
|
+
children: t
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
var Rn = {
|
|
2162
|
+
root: "_root_biv8a_1",
|
|
2163
|
+
item: "_item_biv8a_41"
|
|
2164
|
+
};
|
|
2165
|
+
//#endregion
|
|
2166
|
+
//#region src/components/SegmentedControl.tsx
|
|
2167
|
+
function zn({ value: e, onChange: t, options: n, size: r = "md", className: i, ariaLabel: a }) {
|
|
2168
|
+
return /* @__PURE__ */ p("div", {
|
|
2169
|
+
role: "tablist",
|
|
2170
|
+
"aria-label": a,
|
|
2171
|
+
"data-size": r,
|
|
2172
|
+
className: _("owo-segmented-control", Rn.root, i),
|
|
2173
|
+
children: n.map((n) => {
|
|
2174
|
+
let r = n.value === e;
|
|
2175
|
+
return /* @__PURE__ */ p("button", {
|
|
2176
|
+
type: "button",
|
|
2177
|
+
role: "tab",
|
|
2178
|
+
"aria-selected": r,
|
|
2179
|
+
disabled: n.disabled,
|
|
2180
|
+
"data-active": r ? "true" : void 0,
|
|
2181
|
+
className: Rn.item,
|
|
2182
|
+
onClick: () => t(n.value),
|
|
2183
|
+
children: n.label
|
|
2184
|
+
}, n.value);
|
|
2185
|
+
})
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
var Bn = {
|
|
2189
|
+
root: "_root_pixr0_1",
|
|
2190
|
+
valueText: "_valueText_pixr0_91",
|
|
2191
|
+
placeholder: "_placeholder_pixr0_97"
|
|
2192
|
+
};
|
|
2193
|
+
//#endregion
|
|
2194
|
+
//#region src/components/Select.tsx
|
|
2195
|
+
function Vn({ value: e, onChange: t, options: n, placeholder: r = "Select…", size: a = "md", tone: c = "default", disabled: f = !1, className: h, ariaLabel: g, renderValue: v, renderOption: y, classNames: b }) {
|
|
2196
|
+
let [x, S] = d(!1), [C, w] = d(-1), T = u(null), E = u(null), D = s(), O = n.find((t) => t.value === e), k = l(() => n.reduce((e, t, n) => (t.disabled || e.push(n), e), []), [n]), A = i(() => {
|
|
2197
|
+
if (f || n.length === 0) return;
|
|
2198
|
+
S(!0);
|
|
2199
|
+
let t = n.findIndex((t) => t.value === e);
|
|
2200
|
+
w(t >= 0 ? t : k[0] ?? -1);
|
|
2201
|
+
}, [
|
|
2202
|
+
f,
|
|
2203
|
+
n,
|
|
2204
|
+
e,
|
|
2205
|
+
k
|
|
2206
|
+
]), j = i(() => {
|
|
2207
|
+
S(!1), w(-1);
|
|
2208
|
+
}, []), M = i((e) => {
|
|
2209
|
+
e.disabled || (t(e.value), j());
|
|
2210
|
+
}, [t, j]);
|
|
2211
|
+
o(() => {
|
|
2212
|
+
if (!x) return;
|
|
2213
|
+
function e(e) {
|
|
2214
|
+
T.current && !T.current.contains(e.target) && j();
|
|
2215
|
+
}
|
|
2216
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2217
|
+
}, [x, j]), o(() => {
|
|
2218
|
+
!x || C < 0 || (E.current?.children[C])?.scrollIntoView({ block: "nearest" });
|
|
2219
|
+
}, [x, C]);
|
|
2220
|
+
function N(e) {
|
|
2221
|
+
if (!f) switch (e.key) {
|
|
2222
|
+
case "Enter":
|
|
2223
|
+
case " ":
|
|
2224
|
+
e.preventDefault(), x ? C >= 0 && n[C] && !n[C].disabled && M(n[C]) : A();
|
|
2225
|
+
break;
|
|
2226
|
+
case "ArrowDown":
|
|
2227
|
+
if (e.preventDefault(), !x) A();
|
|
2228
|
+
else {
|
|
2229
|
+
let e = k[k.indexOf(C) + 1];
|
|
2230
|
+
e !== void 0 && w(e);
|
|
2231
|
+
}
|
|
2232
|
+
break;
|
|
2233
|
+
case "ArrowUp":
|
|
2234
|
+
if (e.preventDefault(), !x) A();
|
|
2235
|
+
else {
|
|
2236
|
+
let e = k[k.indexOf(C) - 1];
|
|
2237
|
+
e !== void 0 && w(e);
|
|
2238
|
+
}
|
|
2239
|
+
break;
|
|
2240
|
+
case "Escape":
|
|
2241
|
+
x && (e.preventDefault(), j());
|
|
2242
|
+
break;
|
|
2243
|
+
case "Tab":
|
|
2244
|
+
x && j();
|
|
2245
|
+
break;
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
let ee = e !== "" && O, P = v ? v({
|
|
2249
|
+
open: x,
|
|
2250
|
+
placeholder: r,
|
|
2251
|
+
selectedOption: O
|
|
2252
|
+
}) : /* @__PURE__ */ p("span", {
|
|
2253
|
+
className: _(Bn.valueText, !ee && Bn.placeholder),
|
|
2254
|
+
children: ee ? O.label : r
|
|
2255
|
+
});
|
|
2256
|
+
return /* @__PURE__ */ m("div", {
|
|
2257
|
+
ref: T,
|
|
2258
|
+
"data-state": x ? "open" : "closed",
|
|
2259
|
+
"data-disabled": f || void 0,
|
|
2260
|
+
"data-size": a,
|
|
2261
|
+
"data-tone": c,
|
|
2262
|
+
"data-scope": "select",
|
|
2263
|
+
className: _("owo-select", Bn.root, h),
|
|
2264
|
+
children: [/* @__PURE__ */ m("button", {
|
|
2265
|
+
type: "button",
|
|
2266
|
+
role: "combobox",
|
|
2267
|
+
"aria-expanded": x,
|
|
2268
|
+
"aria-haspopup": "listbox",
|
|
2269
|
+
"aria-controls": D,
|
|
2270
|
+
"aria-label": g,
|
|
2271
|
+
"aria-activedescendant": x && C >= 0 ? `${D}-opt-${C}` : void 0,
|
|
2272
|
+
"data-state": x ? "open" : "closed",
|
|
2273
|
+
"data-disabled": f || void 0,
|
|
2274
|
+
"data-tone": c,
|
|
2275
|
+
"data-size": a,
|
|
2276
|
+
"data-has-value": ee || void 0,
|
|
2277
|
+
"data-scope": "select",
|
|
2278
|
+
"data-part": "trigger",
|
|
2279
|
+
disabled: f,
|
|
2280
|
+
className: _(b?.trigger),
|
|
2281
|
+
onClick: () => x ? j() : A(),
|
|
2282
|
+
onKeyDown: N,
|
|
2283
|
+
children: [P, /* @__PURE__ */ p("svg", {
|
|
2284
|
+
"aria-hidden": "true",
|
|
2285
|
+
"data-state": x ? "open" : "closed",
|
|
2286
|
+
"data-scope": "select",
|
|
2287
|
+
"data-part": "chevron",
|
|
2288
|
+
className: _(b?.chevron),
|
|
2289
|
+
viewBox: "0 0 16 16",
|
|
2290
|
+
fill: "none",
|
|
2291
|
+
stroke: "currentColor",
|
|
2292
|
+
strokeWidth: "2",
|
|
2293
|
+
strokeLinecap: "round",
|
|
2294
|
+
strokeLinejoin: "round",
|
|
2295
|
+
children: /* @__PURE__ */ p("path", { d: "M4 6l4 4 4-4" })
|
|
2296
|
+
})]
|
|
2297
|
+
}), x && /* @__PURE__ */ p("ul", {
|
|
2298
|
+
ref: E,
|
|
2299
|
+
id: D,
|
|
2300
|
+
role: "listbox",
|
|
2301
|
+
"aria-label": g,
|
|
2302
|
+
"data-state": "open",
|
|
2303
|
+
"data-size": a,
|
|
2304
|
+
"data-scope": "select",
|
|
2305
|
+
"data-part": "dropdown",
|
|
2306
|
+
className: _(b?.dropdown),
|
|
2307
|
+
children: n.map((t, n) => /* @__PURE__ */ p("li", {
|
|
2308
|
+
id: `${D}-opt-${n}`,
|
|
2309
|
+
role: "option",
|
|
2310
|
+
"aria-selected": t.value === e,
|
|
2311
|
+
"aria-disabled": t.disabled || void 0,
|
|
2312
|
+
"data-state": t.value === e ? "selected" : n === C ? "highlighted" : "idle",
|
|
2313
|
+
"data-focused": n === C || void 0,
|
|
2314
|
+
"data-selected": t.value === e || void 0,
|
|
2315
|
+
"data-disabled": t.disabled || void 0,
|
|
2316
|
+
"data-highlighted": n === C || void 0,
|
|
2317
|
+
"data-scope": "select",
|
|
2318
|
+
"data-part": "option",
|
|
2319
|
+
className: _(b?.option),
|
|
2320
|
+
onClick: () => M(t),
|
|
2321
|
+
onMouseEnter: () => !t.disabled && w(n),
|
|
2322
|
+
children: y ? y({
|
|
2323
|
+
option: t,
|
|
2324
|
+
index: n,
|
|
2325
|
+
selected: t.value === e,
|
|
2326
|
+
highlighted: n === C
|
|
2327
|
+
}) : t.label
|
|
2328
|
+
}, t.value))
|
|
2329
|
+
})]
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
var Hn = {
|
|
2333
|
+
root: "_root_1sshx_1",
|
|
2334
|
+
"owo-skeleton-breathe": "_owo-skeleton-breathe_1sshx_1",
|
|
2335
|
+
"owo-skeleton-scan": "_owo-skeleton-scan_1sshx_1"
|
|
2336
|
+
}, Un = {
|
|
2337
|
+
slow: "4s",
|
|
2338
|
+
medium: "3s",
|
|
2339
|
+
fast: "2s"
|
|
2340
|
+
};
|
|
2341
|
+
function Wn({ className: e, animation: t = "scan", tone: n = "default", speed: r = "medium", style: i, ...a }) {
|
|
2342
|
+
let o = n === "warm" ? "emphasis" : n, s = {
|
|
2343
|
+
...i,
|
|
2344
|
+
"--_owo-skeleton-scan-duration": Un[r]
|
|
2345
|
+
};
|
|
2346
|
+
return /* @__PURE__ */ p("div", {
|
|
2347
|
+
className: _("owo-skeleton", Hn.root, e),
|
|
2348
|
+
"data-animation": t,
|
|
2349
|
+
"data-tone": o,
|
|
2350
|
+
"aria-hidden": "true",
|
|
2351
|
+
style: s,
|
|
2352
|
+
...a
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
var $ = {
|
|
2356
|
+
root: "_root_h4455_1",
|
|
2357
|
+
withIcon: "_withIcon_h4455_19",
|
|
2358
|
+
icon: "_icon_h4455_25",
|
|
2359
|
+
text: "_text_h4455_36",
|
|
2360
|
+
title: "_title_h4455_40",
|
|
2361
|
+
body: "_body_h4455_50",
|
|
2362
|
+
action: "_action_h4455_68"
|
|
2363
|
+
};
|
|
2364
|
+
//#endregion
|
|
2365
|
+
//#region src/components/StatusNotice.tsx
|
|
2366
|
+
function Gn({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r, description: i, action: a, className: o, children: s, classNames: c, ...l }) {
|
|
2367
|
+
if (t === "vertical") {
|
|
2368
|
+
let t = n || r || i || a;
|
|
2369
|
+
return /* @__PURE__ */ p("div", {
|
|
2370
|
+
"data-tone": e,
|
|
2371
|
+
"data-layout": "vertical",
|
|
2372
|
+
className: _("owo-status-notice", $.root, o),
|
|
2373
|
+
...l,
|
|
2374
|
+
children: /* @__PURE__ */ p("div", {
|
|
2375
|
+
"data-part": "body",
|
|
2376
|
+
className: _($.body, c?.body),
|
|
2377
|
+
children: t ? /* @__PURE__ */ m(f, { children: [
|
|
2378
|
+
n ? /* @__PURE__ */ p("div", {
|
|
2379
|
+
"data-part": "icon",
|
|
2380
|
+
className: _($.icon, c?.icon),
|
|
2381
|
+
children: n
|
|
2382
|
+
}) : null,
|
|
2383
|
+
r ? /* @__PURE__ */ p("div", {
|
|
2384
|
+
"data-part": "title",
|
|
2385
|
+
className: _($.title, c?.title),
|
|
2386
|
+
children: r
|
|
2387
|
+
}) : null,
|
|
2388
|
+
i ? /* @__PURE__ */ p("div", { children: i }) : s,
|
|
2389
|
+
a ? /* @__PURE__ */ p("div", {
|
|
2390
|
+
"data-part": "action",
|
|
2391
|
+
className: _($.action, c?.action),
|
|
2392
|
+
children: a
|
|
2393
|
+
}) : null
|
|
2394
|
+
] }) : s
|
|
2395
|
+
})
|
|
2396
|
+
});
|
|
2397
|
+
}
|
|
2398
|
+
return /* @__PURE__ */ m("div", {
|
|
2399
|
+
"data-tone": e,
|
|
2400
|
+
className: _("owo-status-notice", $.root, n && $.withIcon, o),
|
|
2401
|
+
...l,
|
|
2402
|
+
children: [n ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
2403
|
+
"data-part": "icon",
|
|
2404
|
+
className: _($.icon, c?.icon),
|
|
2405
|
+
"aria-hidden": "true",
|
|
2406
|
+
children: n
|
|
2407
|
+
}), /* @__PURE__ */ m("div", {
|
|
2408
|
+
"data-part": "body",
|
|
2409
|
+
className: _($.text, c?.body),
|
|
2410
|
+
children: [r ? /* @__PURE__ */ p("div", {
|
|
2411
|
+
"data-part": "title",
|
|
2412
|
+
className: _($.title, c?.title),
|
|
2413
|
+
children: r
|
|
2414
|
+
}) : null, s]
|
|
2415
|
+
})] }) : /* @__PURE__ */ m("div", {
|
|
2416
|
+
"data-part": "body",
|
|
2417
|
+
className: _(c?.body),
|
|
2418
|
+
children: [r ? /* @__PURE__ */ p("div", {
|
|
2419
|
+
"data-part": "title",
|
|
2420
|
+
className: _($.title, c?.title),
|
|
2421
|
+
children: r
|
|
2422
|
+
}) : null, s]
|
|
2423
|
+
}), a ? /* @__PURE__ */ p("div", {
|
|
2424
|
+
"data-part": "action",
|
|
2425
|
+
className: _($.action, c?.action),
|
|
2426
|
+
children: a
|
|
2427
|
+
}) : null]
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
var Kn = {
|
|
2431
|
+
root: "_root_1qzgu_1",
|
|
2432
|
+
thumb: "_thumb_1qzgu_81"
|
|
2433
|
+
};
|
|
2434
|
+
//#endregion
|
|
2435
|
+
//#region src/components/Switch.tsx
|
|
2436
|
+
function qn({ checked: e, onChange: t, size: n = "md", disabled: r = !1, className: i, ariaLabel: a }) {
|
|
2437
|
+
return /* @__PURE__ */ p("button", {
|
|
2438
|
+
type: "button",
|
|
2439
|
+
role: "switch",
|
|
2440
|
+
"aria-checked": e,
|
|
2441
|
+
"aria-label": a,
|
|
2442
|
+
disabled: r,
|
|
2443
|
+
"data-size": n,
|
|
2444
|
+
className: _("owo-switch", Kn.root, i),
|
|
2445
|
+
onClick: () => t(!e),
|
|
2446
|
+
children: /* @__PURE__ */ p("span", {
|
|
2447
|
+
"aria-hidden": "true",
|
|
2448
|
+
className: Kn.thumb
|
|
2449
|
+
})
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
var Jn = { root: "_root_1dxq8_1" }, Yn = n(null);
|
|
2453
|
+
function Xn(e) {
|
|
2454
|
+
let t = a(Yn);
|
|
2455
|
+
if (!t) throw Error(`${e} must be used within Tabs.Root`);
|
|
2456
|
+
return t;
|
|
2457
|
+
}
|
|
2458
|
+
function Zn(e) {
|
|
2459
|
+
return e.replace(/[^a-zA-Z0-9_-]+/g, "-");
|
|
2460
|
+
}
|
|
2461
|
+
function Qn({ value: e, defaultValue: t, onValueChange: n }) {
|
|
2462
|
+
let [r, i] = d(t ?? ""), a = e !== void 0, o = a ? e : r;
|
|
2463
|
+
function s(e) {
|
|
2464
|
+
a || i(e), n?.(e);
|
|
2465
|
+
}
|
|
2466
|
+
return [o, s];
|
|
2467
|
+
}
|
|
2468
|
+
function $n({ children: e, value: t, defaultValue: n, onValueChange: r, className: i, ...a }) {
|
|
2469
|
+
let [o, c] = Qn({
|
|
2470
|
+
value: t,
|
|
2471
|
+
defaultValue: n,
|
|
2472
|
+
onValueChange: r
|
|
2473
|
+
}), u = s(), d = l(() => ({
|
|
2474
|
+
value: o,
|
|
2475
|
+
setValue: c,
|
|
2476
|
+
baseId: u
|
|
2477
|
+
}), [
|
|
2478
|
+
u,
|
|
2479
|
+
o,
|
|
2480
|
+
c
|
|
2481
|
+
]);
|
|
2482
|
+
return /* @__PURE__ */ p(Yn.Provider, {
|
|
2483
|
+
value: d,
|
|
2484
|
+
children: /* @__PURE__ */ p("div", {
|
|
2485
|
+
"data-scope": "tabs",
|
|
2486
|
+
className: _("owo-tabs", Jn.root, i),
|
|
2487
|
+
...a,
|
|
2488
|
+
children: e
|
|
2489
|
+
})
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
function er({ children: e, className: t, ariaLabel: n, ...r }) {
|
|
2493
|
+
return /* @__PURE__ */ p("div", {
|
|
2494
|
+
role: "tablist",
|
|
2495
|
+
"aria-label": n,
|
|
2496
|
+
"data-scope": "tabs",
|
|
2497
|
+
"data-part": "list",
|
|
2498
|
+
className: _(t),
|
|
2499
|
+
...r,
|
|
2500
|
+
children: e
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
function tr({ children: e, className: t, value: n, disabled: r, onClick: i, onKeyDown: a, ...o }) {
|
|
2504
|
+
let { value: s, setValue: c, baseId: l } = Xn("Tabs.Trigger"), u = s === n, d = `${l}-trigger-${Zn(n)}`, f = `${l}-panel-${Zn(n)}`;
|
|
2505
|
+
function m(e, t) {
|
|
2506
|
+
let n = e.closest("[role=\"tablist\"]");
|
|
2507
|
+
if (!n) return;
|
|
2508
|
+
let r = Array.from(n.querySelectorAll("[role=\"tab\"]:not([disabled])")), i = r.indexOf(e);
|
|
2509
|
+
if (i < 0) return;
|
|
2510
|
+
let a;
|
|
2511
|
+
t === "first" && (a = r[0]), t === "last" && (a = r[r.length - 1]), t === "next" && (a = r[(i + 1) % r.length]), t === "prev" && (a = r[(i - 1 + r.length) % r.length]), a && (a.focus(), a.click());
|
|
2512
|
+
}
|
|
2513
|
+
return /* @__PURE__ */ p("button", {
|
|
2514
|
+
type: "button",
|
|
2515
|
+
id: d,
|
|
2516
|
+
role: "tab",
|
|
2517
|
+
"aria-selected": u,
|
|
2518
|
+
"aria-controls": f,
|
|
2519
|
+
tabIndex: u ? 0 : -1,
|
|
2520
|
+
"data-state": u ? "active" : "inactive",
|
|
2521
|
+
"data-scope": "tabs",
|
|
2522
|
+
"data-part": "trigger",
|
|
2523
|
+
disabled: r,
|
|
2524
|
+
className: _(t),
|
|
2525
|
+
onClick: (e) => {
|
|
2526
|
+
i?.(e), !e.defaultPrevented && !r && c(n);
|
|
2527
|
+
},
|
|
2528
|
+
onKeyDown: (e) => {
|
|
2529
|
+
if (a?.(e), e.defaultPrevented || r) return;
|
|
2530
|
+
let t = e.currentTarget;
|
|
2531
|
+
switch (e.key) {
|
|
2532
|
+
case "ArrowRight":
|
|
2533
|
+
e.preventDefault(), m(t, "next");
|
|
2534
|
+
break;
|
|
2535
|
+
case "ArrowLeft":
|
|
2536
|
+
e.preventDefault(), m(t, "prev");
|
|
2537
|
+
break;
|
|
2538
|
+
case "Home":
|
|
2539
|
+
e.preventDefault(), m(t, "first");
|
|
2540
|
+
break;
|
|
2541
|
+
case "End":
|
|
2542
|
+
e.preventDefault(), m(t, "last");
|
|
2543
|
+
break;
|
|
2544
|
+
}
|
|
2545
|
+
},
|
|
2546
|
+
...o,
|
|
2547
|
+
children: e
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
function nr({ children: e, className: t, value: n, ...r }) {
|
|
2551
|
+
let { value: i, baseId: a } = Xn("Tabs.Content"), o = i === n, s = `${a}-trigger-${Zn(n)}`, c = `${a}-panel-${Zn(n)}`;
|
|
2552
|
+
return o ? /* @__PURE__ */ p("div", {
|
|
2553
|
+
id: c,
|
|
2554
|
+
role: "tabpanel",
|
|
2555
|
+
"aria-labelledby": s,
|
|
2556
|
+
"data-state": "active",
|
|
2557
|
+
"data-scope": "tabs",
|
|
2558
|
+
"data-part": "content",
|
|
2559
|
+
className: _(t),
|
|
2560
|
+
...r,
|
|
2561
|
+
children: e
|
|
2562
|
+
}) : null;
|
|
2563
|
+
}
|
|
2564
|
+
var rr = Object.assign($n, {
|
|
2565
|
+
Root: $n,
|
|
2566
|
+
List: er,
|
|
2567
|
+
Trigger: tr,
|
|
2568
|
+
Content: nr
|
|
2569
|
+
}), ir = { root: "_root_17j1y_1" };
|
|
2570
|
+
//#endregion
|
|
2571
|
+
//#region src/components/Textarea.tsx
|
|
2572
|
+
function ar({ className: e, tone: t = "default", size: n = "md", resize: r = "vertical", autoResize: a = !1, style: s, onInput: c, rows: l = 3, ...d }) {
|
|
2573
|
+
let f = u(null), m = c, h = i(() => {
|
|
2574
|
+
if (!a || !f.current) return;
|
|
2575
|
+
let e = f.current;
|
|
2576
|
+
e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
|
|
2577
|
+
}, [a]);
|
|
2578
|
+
o(() => {
|
|
2579
|
+
h();
|
|
2580
|
+
}, [
|
|
2581
|
+
h,
|
|
2582
|
+
d.value,
|
|
2583
|
+
d.defaultValue,
|
|
2584
|
+
l
|
|
2585
|
+
]);
|
|
2586
|
+
function g(e) {
|
|
2587
|
+
h(), m?.(e);
|
|
2588
|
+
}
|
|
2589
|
+
let v = {
|
|
2590
|
+
...s,
|
|
2591
|
+
resize: a ? "none" : r
|
|
2592
|
+
};
|
|
2593
|
+
return /* @__PURE__ */ p("textarea", {
|
|
2594
|
+
...d,
|
|
2595
|
+
ref: f,
|
|
2596
|
+
rows: l,
|
|
2597
|
+
"data-tone": t,
|
|
2598
|
+
"data-size": n,
|
|
2599
|
+
"data-auto-resize": a || void 0,
|
|
2600
|
+
className: _("owo-input", jn.root, "owo-textarea", ir.root, e),
|
|
2601
|
+
style: v,
|
|
2602
|
+
onInput: g
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
//#endregion
|
|
2606
|
+
//#region src/styles/ui/toast.module.css
|
|
2607
|
+
var or = "_container_73rls_1", sr = "_toast_73rls_12", cr = "_toastDefault_73rls_32", lr = {
|
|
2608
|
+
container: or,
|
|
2609
|
+
toast: sr,
|
|
2610
|
+
"toast-in": "_toast-in_73rls_1",
|
|
2611
|
+
toastDefault: cr
|
|
2612
|
+
}, ur = n(null), dr = 5, fr = 4e3;
|
|
2613
|
+
function pr() {
|
|
2614
|
+
let e = a(ur);
|
|
2615
|
+
if (!e) throw Error("useToast must be used within <ToastProvider>");
|
|
2616
|
+
return e;
|
|
2617
|
+
}
|
|
2618
|
+
function mr({ tone: e }) {
|
|
2619
|
+
let t = {
|
|
2620
|
+
width: 16,
|
|
2621
|
+
height: 16,
|
|
2622
|
+
viewBox: "0 0 16 16",
|
|
2623
|
+
fill: "none",
|
|
2624
|
+
stroke: "currentColor",
|
|
2625
|
+
strokeWidth: 2,
|
|
2626
|
+
strokeLinecap: "round",
|
|
2627
|
+
strokeLinejoin: "round"
|
|
2628
|
+
};
|
|
2629
|
+
switch (e) {
|
|
2630
|
+
case "success": return /* @__PURE__ */ p("svg", {
|
|
2631
|
+
...t,
|
|
2632
|
+
children: /* @__PURE__ */ p("path", { d: "M3.5 8.5l3 3 6-7" })
|
|
2633
|
+
});
|
|
2634
|
+
case "warning": return /* @__PURE__ */ m("svg", {
|
|
2635
|
+
...t,
|
|
2636
|
+
children: [/* @__PURE__ */ p("path", { d: "M8 5v4" }), /* @__PURE__ */ p("circle", {
|
|
2637
|
+
cx: "8",
|
|
2638
|
+
cy: "11.5",
|
|
2639
|
+
r: "0.5",
|
|
2640
|
+
fill: "currentColor",
|
|
2641
|
+
stroke: "none"
|
|
2642
|
+
})]
|
|
2643
|
+
});
|
|
2644
|
+
case "danger": return /* @__PURE__ */ p("svg", {
|
|
2645
|
+
...t,
|
|
2646
|
+
children: /* @__PURE__ */ p("path", { d: "M4.5 4.5l7 7M11.5 4.5l-7 7" })
|
|
2647
|
+
});
|
|
2648
|
+
case "info": return /* @__PURE__ */ m("svg", {
|
|
2649
|
+
...t,
|
|
2650
|
+
children: [/* @__PURE__ */ p("circle", {
|
|
2651
|
+
cx: "8",
|
|
2652
|
+
cy: "3.5",
|
|
2653
|
+
r: "1.2",
|
|
2654
|
+
fill: "currentColor",
|
|
2655
|
+
stroke: "none"
|
|
2656
|
+
}), /* @__PURE__ */ p("path", { d: "M8 7v5.5" })]
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
function hr(e, t) {
|
|
2661
|
+
return typeof e == "string" ? {
|
|
2662
|
+
message: e,
|
|
2663
|
+
duration: t ?? fr
|
|
2664
|
+
} : {
|
|
2665
|
+
title: e.title,
|
|
2666
|
+
message: e.message,
|
|
2667
|
+
duration: e.duration ?? t ?? fr
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
function gr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
|
|
2671
|
+
let i = () => t(e.id), a = /* @__PURE__ */ p(mr, { tone: e.tone });
|
|
2672
|
+
return n ? /* @__PURE__ */ p("div", {
|
|
2673
|
+
role: "status",
|
|
2674
|
+
"aria-live": "polite",
|
|
2675
|
+
"data-state": "open",
|
|
2676
|
+
"data-tone": e.tone,
|
|
2677
|
+
"data-scope": "toast",
|
|
2678
|
+
"data-part": "toast",
|
|
2679
|
+
className: _("owo-toast", lr.toast, r?.toast),
|
|
2680
|
+
children: n({
|
|
2681
|
+
item: e,
|
|
2682
|
+
dismiss: i,
|
|
2683
|
+
icon: a
|
|
2684
|
+
})
|
|
2685
|
+
}) : /* @__PURE__ */ m("div", {
|
|
2686
|
+
role: "status",
|
|
2687
|
+
"aria-live": "polite",
|
|
2688
|
+
"data-state": "open",
|
|
2689
|
+
"data-tone": e.tone,
|
|
2690
|
+
"data-scope": "toast",
|
|
2691
|
+
"data-part": "toast",
|
|
2692
|
+
className: _("owo-toast", lr.toast, lr.toastDefault, r?.toast),
|
|
2693
|
+
children: [
|
|
2694
|
+
/* @__PURE__ */ p("span", {
|
|
2695
|
+
"data-scope": "toast",
|
|
2696
|
+
"data-part": "icon",
|
|
2697
|
+
className: _(r?.icon),
|
|
2698
|
+
"aria-hidden": "true",
|
|
2699
|
+
children: a
|
|
2700
|
+
}),
|
|
2701
|
+
/* @__PURE__ */ m("span", {
|
|
2702
|
+
"data-scope": "toast",
|
|
2703
|
+
"data-part": "content",
|
|
2704
|
+
className: _(r?.content),
|
|
2705
|
+
children: [e.title ? /* @__PURE__ */ p("span", {
|
|
2706
|
+
"data-scope": "toast",
|
|
2707
|
+
"data-part": "title",
|
|
2708
|
+
className: _(r?.title),
|
|
2709
|
+
children: e.title
|
|
2710
|
+
}) : null, /* @__PURE__ */ p("span", {
|
|
2711
|
+
"data-scope": "toast",
|
|
2712
|
+
"data-part": "message",
|
|
2713
|
+
className: _(r?.message),
|
|
2714
|
+
children: e.message
|
|
2715
|
+
})]
|
|
2716
|
+
}),
|
|
2717
|
+
/* @__PURE__ */ p("button", {
|
|
2718
|
+
type: "button",
|
|
2719
|
+
onClick: i,
|
|
2720
|
+
"data-scope": "toast",
|
|
2721
|
+
"data-part": "close",
|
|
2722
|
+
className: _(r?.close),
|
|
2723
|
+
"aria-label": "Dismiss",
|
|
2724
|
+
children: /* @__PURE__ */ p("svg", {
|
|
2725
|
+
width: "14",
|
|
2726
|
+
height: "14",
|
|
2727
|
+
viewBox: "0 0 16 16",
|
|
2728
|
+
fill: "none",
|
|
2729
|
+
stroke: "currentColor",
|
|
2730
|
+
strokeWidth: "2",
|
|
2731
|
+
strokeLinecap: "round",
|
|
2732
|
+
children: /* @__PURE__ */ p("path", { d: "M4 4l8 8M12 4l-8 8" })
|
|
2733
|
+
})
|
|
2734
|
+
})
|
|
2735
|
+
]
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
function _r({ children: e, renderToast: t, classNames: n }) {
|
|
2739
|
+
let [r, a] = d([]), o = u(0), s = u(/* @__PURE__ */ new Map()), c = i((e) => {
|
|
2740
|
+
let t = s.current.get(e);
|
|
2741
|
+
t && clearTimeout(t), s.current.delete(e), a((t) => t.filter((t) => t.id !== e));
|
|
2742
|
+
}, []), f = i((e, t, n) => {
|
|
2743
|
+
let r = o.current++, i = {
|
|
2744
|
+
id: r,
|
|
2745
|
+
tone: e,
|
|
2746
|
+
...hr(t, n)
|
|
2747
|
+
};
|
|
2748
|
+
a((e) => {
|
|
2749
|
+
let t = [...e, i];
|
|
2750
|
+
if (t.length > dr) {
|
|
2751
|
+
let e = t.slice(0, t.length - dr);
|
|
2752
|
+
for (let t of e) {
|
|
2753
|
+
let e = s.current.get(t.id);
|
|
2754
|
+
e && clearTimeout(e), s.current.delete(t.id);
|
|
2755
|
+
}
|
|
2756
|
+
return t.slice(-dr);
|
|
2757
|
+
}
|
|
2758
|
+
return t;
|
|
2759
|
+
}), i.duration > 0 && s.current.set(r, setTimeout(() => c(r), i.duration));
|
|
2760
|
+
}, [c]), h = l(() => ({
|
|
2761
|
+
success: (e, t) => f("success", e, t),
|
|
2762
|
+
warning: (e, t) => f("warning", e, t),
|
|
2763
|
+
danger: (e, t) => f("danger", e, t),
|
|
2764
|
+
info: (e, t) => f("info", e, t)
|
|
2765
|
+
}), [f]);
|
|
2766
|
+
return /* @__PURE__ */ m(ur.Provider, {
|
|
2767
|
+
value: h,
|
|
2768
|
+
children: [e, /* @__PURE__ */ p("div", {
|
|
2769
|
+
"aria-label": "Notifications",
|
|
2770
|
+
"data-state": r.length > 0 ? "open" : "closed",
|
|
2771
|
+
"data-scope": "toast",
|
|
2772
|
+
"data-part": "container",
|
|
2773
|
+
className: _("owo-toast-container", lr.container, n?.container),
|
|
2774
|
+
children: r.map((e) => /* @__PURE__ */ p(gr, {
|
|
2775
|
+
item: e,
|
|
2776
|
+
onDismiss: c,
|
|
2777
|
+
renderToast: t,
|
|
2778
|
+
classNames: n
|
|
2779
|
+
}, e.id))
|
|
2780
|
+
})]
|
|
2781
|
+
});
|
|
2782
|
+
}
|
|
2783
|
+
var vr = {
|
|
2784
|
+
trigger: "_trigger_xunrw_1",
|
|
2785
|
+
content: "_content_xunrw_5",
|
|
2786
|
+
"tooltip-in": "_tooltip-in_xunrw_1"
|
|
2787
|
+
}, yr = 6, br = 8, xr = 4;
|
|
2788
|
+
function Sr(e) {
|
|
2789
|
+
return e.split("-")[0];
|
|
2790
|
+
}
|
|
2791
|
+
var Cr = {
|
|
2792
|
+
top: "",
|
|
2793
|
+
bottom: "rotate(180deg)",
|
|
2794
|
+
left: "rotate(-90deg)",
|
|
2795
|
+
right: "rotate(90deg)"
|
|
2796
|
+
};
|
|
2797
|
+
function wr({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
|
|
2798
|
+
let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), ee = s(), P = i(() => {
|
|
2799
|
+
clearTimeout(M.current), clearTimeout(N.current);
|
|
2800
|
+
}, []), F = i(() => {
|
|
2801
|
+
P(), M.current = setTimeout(() => S(!0), r);
|
|
2802
|
+
}, [P, r]), I = i(() => {
|
|
2803
|
+
P(), S(!0);
|
|
2804
|
+
}, [P]), L = i(() => {
|
|
2805
|
+
P(), N.current = setTimeout(() => S(!1), a);
|
|
2806
|
+
}, [P, a]), R = i((e) => {
|
|
2807
|
+
if (e.target === k.current) {
|
|
2808
|
+
F();
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
I();
|
|
2812
|
+
}, [F, I]), te = i((e) => {
|
|
2813
|
+
e.pointerType !== "mouse" && I();
|
|
2814
|
+
}, [I]), ne = i((e) => {
|
|
2815
|
+
e.key === "Escape" && x && S(!1);
|
|
2816
|
+
}, [x]);
|
|
2817
|
+
c(() => {
|
|
2818
|
+
if (!x || !k.current || !A.current) return;
|
|
2819
|
+
let e = [
|
|
2820
|
+
Gt(l ? br + yr : br),
|
|
2821
|
+
qt({ padding: xr }),
|
|
2822
|
+
Kt({ padding: xr })
|
|
2823
|
+
];
|
|
2824
|
+
return l && j.current && e.push(Jt({ element: j.current })), Wt(k.current, A.current, () => {
|
|
2825
|
+
!k.current || !A.current || Yt(k.current, A.current, {
|
|
2826
|
+
placement: t,
|
|
2827
|
+
strategy: "fixed",
|
|
2828
|
+
middleware: e
|
|
2829
|
+
}).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
|
|
2830
|
+
w({
|
|
2831
|
+
top: t,
|
|
2832
|
+
left: e
|
|
2833
|
+
}), E(Sr(n)), r.arrow && O({
|
|
2834
|
+
x: r.arrow.x,
|
|
2835
|
+
y: r.arrow.y
|
|
2836
|
+
});
|
|
2837
|
+
});
|
|
2838
|
+
});
|
|
2839
|
+
}, [
|
|
2840
|
+
x,
|
|
2841
|
+
t,
|
|
2842
|
+
l
|
|
2843
|
+
]), o(() => {
|
|
2844
|
+
if (x) return document.addEventListener("keydown", ne), () => document.removeEventListener("keydown", ne);
|
|
2845
|
+
}, [x, ne]), o(() => P, [P]);
|
|
2846
|
+
let z = { position: "absolute" }, B = T;
|
|
2847
|
+
return B === "top" || B === "bottom" ? (z.left = D.x ?? 0, z[B === "top" ? "bottom" : "top"] = -yr, z.transform = Cr[B] || void 0) : (z.top = D.y ?? 0, z[B === "left" ? "right" : "left"] = -yr, z.transform = Cr[B]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
2848
|
+
ref: k,
|
|
2849
|
+
"data-state": x ? "open" : "closed",
|
|
2850
|
+
"data-scope": "tooltip",
|
|
2851
|
+
"data-part": "trigger",
|
|
2852
|
+
className: _("owo-tooltip-trigger", vr.trigger, b?.trigger),
|
|
2853
|
+
onMouseEnter: F,
|
|
2854
|
+
onMouseLeave: L,
|
|
2855
|
+
onFocus: R,
|
|
2856
|
+
onBlur: L,
|
|
2857
|
+
onPointerDown: te,
|
|
2858
|
+
"aria-describedby": x ? ee : void 0,
|
|
2859
|
+
children: y
|
|
2860
|
+
}), x && h(/* @__PURE__ */ m("div", {
|
|
2861
|
+
ref: A,
|
|
2862
|
+
id: ee,
|
|
2863
|
+
role: "tooltip",
|
|
2864
|
+
"data-state": x ? "open" : "closed",
|
|
2865
|
+
"data-placement": T,
|
|
2866
|
+
"data-density": n,
|
|
2867
|
+
"data-scope": "tooltip",
|
|
2868
|
+
"data-part": "content",
|
|
2869
|
+
className: _("owo-tooltip", vr.content, b?.content, v),
|
|
2870
|
+
style: C ? {
|
|
2871
|
+
top: C.top,
|
|
2872
|
+
left: C.left
|
|
2873
|
+
} : { visibility: "hidden" },
|
|
2874
|
+
onMouseEnter: F,
|
|
2875
|
+
onMouseLeave: L,
|
|
2876
|
+
children: [e, l && /* @__PURE__ */ p("span", {
|
|
2877
|
+
ref: j,
|
|
2878
|
+
"data-scope": "tooltip",
|
|
2879
|
+
"data-part": "arrow",
|
|
2880
|
+
className: _(b?.arrow),
|
|
2881
|
+
style: z,
|
|
2882
|
+
children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
|
|
2883
|
+
width: yr * 2,
|
|
2884
|
+
height: yr,
|
|
2885
|
+
viewBox: "0 0 12 6",
|
|
2886
|
+
children: /* @__PURE__ */ p("path", {
|
|
2887
|
+
d: "M0 0l6 6 6-6z",
|
|
2888
|
+
fill: "currentColor"
|
|
2889
|
+
})
|
|
2890
|
+
})
|
|
2891
|
+
})]
|
|
2892
|
+
}), document.body)] });
|
|
2893
|
+
}
|
|
2894
|
+
//#endregion
|
|
2895
|
+
export { b as Avatar, S as Badge, L as Button, ie as Collapsible, V as CollapsibleContent, B as CollapsibleRoot, re as CollapsibleTrigger, pe as ConfirmProvider, W as Dialog, En as Drawer, wn as DropdownMenu, On as Field, An as IconButton, Mn as Input, Pn as Panel, In as PanelBody, Ln as PanelFooter, Fn as PanelHeader, zn as SegmentedControl, Vn as Select, Wn as Skeleton, P as Spinner, Gn as StatusNotice, qn as Switch, rr as Tabs, nr as TabsContent, er as TabsList, $n as TabsRoot, tr as TabsTrigger, ar as Textarea, _r as ToastProvider, wr as Tooltip, I as buttonClassName, fe as useConfirm, pr as useToast };
|