@jerry-fd/ui 0.5.6 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +5 -4
  2. package/index.js +2 -2
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1629,7 +1629,7 @@ type UIViewTransitionProps = {
1629
1629
  /** 视图切换过程中是否冻结点击事件,动画完成后自动恢复。 */
1630
1630
  lockPointerDuringTransition?: boolean;
1631
1631
  };
1632
- declare function UIViewTransition({ activeKey, animation, dimmed, lockPointerDuringTransition, className, viewClassName, children, }: UIViewTransitionProps): react_jsx_runtime.JSX.Element;
1632
+ declare const UIViewTransition: React__default.ForwardRefExoticComponent<UIViewTransitionProps & React__default.RefAttributes<HTMLDivElement>>;
1633
1633
 
1634
1634
  type UIMorphingModalLength = number | string;
1635
1635
  type UIMorphingModalExpandedSize = {
@@ -1696,8 +1696,8 @@ type UIScreenControls<T extends UIScreenValue = UIScreenValue> = {
1696
1696
  declare function useUIScreen<T extends UIScreenValue = UIScreenValue>(): UIScreenControls<T>;
1697
1697
  /** 声明 `UIScreen` 中的一个可切换视图。 */
1698
1698
  type UIScreenViewProps<T extends UIScreenValue = UIScreenValue> = {
1699
- /** 当前视图的唯一标识,同时也用于按声明顺序推导切换方向。 */
1700
- value: T;
1699
+ /** 当前视图的唯一标识,支持单值或多个值共用同一个视图槽位。 */
1700
+ value: T | readonly T[];
1701
1701
  /** 进入当前视图时使用的动画,优先级高于 `UIScreen` 的默认动画。 */
1702
1702
  animation?: AnimationName;
1703
1703
  /** 应用在当前视图动画包裹层上的类名。 */
@@ -1714,7 +1714,8 @@ type UIScreenProps<T extends UIScreenValue = UIScreenValue> = Omit<UIViewTransit
1714
1714
  onScreenChange?: (screen: T) => void;
1715
1715
  children: React__default.ReactNode;
1716
1716
  };
1717
- type UIScreenComponent = (<T extends UIScreenValue>(props: UIScreenProps<T>) => React__default.ReactElement) & {
1717
+ type UIScreenRootComponent = <T extends UIScreenValue>(props: UIScreenProps<T> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1718
+ type UIScreenComponent = UIScreenRootComponent & {
1718
1719
  View: <T extends UIScreenValue>(props: UIScreenViewProps<T>) => React__default.ReactElement;
1719
1720
  };
1720
1721
  declare const UIScreen: UIScreenComponent;
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-PICBT6ES.js';import {a as a$1,k,o,r}from'./chunk-U66T3F2Z.js';export{q as DropdownMenu,o as Skeleton,n as Switch,j as Tabs,b as UIProvider,d as debounce,p as dropdownMenuStyles,f as mergeRefs,e as throttle,r as useFlag}from'./chunk-U66T3F2Z.js';import {b,c,F,J,G,H,I,P as P$1,Q,i,E}from'./chunk-G54QLYD2.js';export{P as Button,v as Card,D as Command,K as Popover,L as Spinner,i as Tooltip,f as TooltipArrow,h as TooltipProvider,d as TooltipRoot,e as TooltipTrigger,N as baseButtonStyle,O as buttonVariants,c as cn,g as tooltipVariants,b as tv,a as twMergeConfig,M as useDisableContentMenu}from'./chunk-G54QLYD2.js';import {a}from'./chunk-M7AD2PUT.js';import {Slot,Collapsible,ScrollArea,HoverCard,Portal}from'radix-ui';import*as P from'react';import P__default,{useRef,useState,useLayoutEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {CircleAlert,Copy,CheckCheck}from'lucide-react';import {m,AnimatePresence}from'motion/react';import {Drawer}from'vaul';import eo from'react-use-measure';var Qe=new WeakMap;function je(e){return((...t)=>{let r=Qe.get(e),o=t.map(String).join("_");if(r){let i=r.get(o);if(i)return i}else r=new Map,Qe.set(e,r);let a=e(...t);return r.set(o,a),a})}function oa(e,t,r="zh-CN"){return new Intl.NumberFormat(r,t).format(e)}function aa(e,t,r="zh-CN"){return new Intl.NumberFormat(r,{style:"currency",...t}).format(e)}function na(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",compactDisplay:"short"}).format(e)}var ia=je((e,t=2)=>e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(r=>{if(!r.length)return "";if(/\s+/.test(e))return r.match(/./u)?.[0].toUpperCase();let o=new RegExp(".".repeat(t),"u"),a=r.match(o)?.[0];return a?a.charAt(0).toUpperCase()+a.slice(1):e.charAt(0).toUpperCase()+e.slice(1,2)}).join(""));function pa(e,t){return Array.isArray(t)?e.filter(r=>t.some(o=>o===r.value)):e.find(r=>r.value===t)}function da(e){return Array.from(new Set(e))}function ma(e){return e.filter(pr)}function pr(e){return !!e}function dr(e,t){return t.reduce((r,o)=>(r[o]=e[o],r),{})}function ua(e,t){let r=new Set(t.map(String)),o=Object.keys(e).filter(a=>!r.has(a));return dr(e,o)}var ut={};a(ut,{AVATAR_ROOT_NAME:()=>rt,Badge:()=>mt,BrandLogo:()=>pt,Image:()=>De,Indicator:()=>st,Notification:()=>dt,Root:()=>it,Status:()=>ct,avatarRingVariants:()=>nt,avatarStatusVariants:()=>lt,avatarVariants:()=>be});function oe(e,t,r,o,a){let i=P__default.Children.map(e,(s,l)=>{if(!P__default.isValidElement(s))return s;let c=s.type?.displayName||"",p=r.includes(c)?t:{},d=s.props;return P__default.cloneElement(s,{...p,key:`${o}-${l}`},oe(d?.children,t,r,o,d?.asChild))});return a?i?.[0]:i}function et(e){let t=P.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 80",...e,children:[jsxs("g",{fill:"#fff",clipPath:`url(#${t})`,children:[jsx("ellipse",{cx:40,cy:78,fillOpacity:.72,rx:32,ry:24}),jsx("circle",{cx:40,cy:32,r:16,opacity:.9})]}),jsx("defs",{children:jsx("clipPath",{id:t,children:jsx("rect",{width:80,height:80,fill:"#fff",rx:40})})})]})}function tt(e){let t=P.useId(),r=P.useId(),o=P.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none",viewBox:"0 0 56 56",...e,children:[jsxs("g",{clipPath:`url(#${t})`,children:[jsx("rect",{width:56,height:56,className:"fill-bg-soft",rx:28}),jsx("path",{className:"fill-bg-soft",d:"M0 0h56v56H0z"}),jsx("g",{filter:`url(#${r})`,opacity:.48,children:jsx("path",{fill:"#fff",d:"M7 24.9a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 017 73.9v-49z"})}),jsx("path",{className:"fill-bg-soft",d:"M12.6 28.7a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"}),jsx("g",{filter:`url(#${o})`,children:jsx("path",{fill:"#fff",fillOpacity:.8,d:"M21 14a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 0121 63V14z"})}),jsx("path",{className:"fill-bg-soft",d:"M26.6 17.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm9.8-29.4a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"})]}),jsxs("defs",{children:[jsxs("filter",{id:r,width:34.6,height:62.6,x:3,y:18.1,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:2}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"})]}),jsxs("filter",{id:o,width:42.6,height:70.6,x:13,y:3.2,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:4}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"}),jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),jsx("feOffset",{dy:4}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",k2:-1,k3:1,operator:"arithmetic"}),jsx("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsx("feBlend",{in2:"shape",result:"effect2_innerShadow_36237_4888"})]}),jsx("clipPath",{id:t,children:jsx("rect",{width:56,height:56,fill:"#fff",rx:28})})]})]})}var rt="AvatarRoot",ot="AvatarImage",at="AvatarIndicator",ur="AvatarStatus",fr="AvatarBrandLogo",gr="AvatarNotification",vr="AvatarBadge",Ve=Slot.Root,be=b({slots:{root:["relative flex shrink-0 items-center justify-center rounded-full","text-center uppercase select-none"],image:"size-full rounded-full object-cover",indicator:"absolute flex size-32 items-center justify-center drop-shadow-[0_2px_4px_#1b1c1d0a]"},variants:{withRing:{true:""},size:{80:{root:"size-80 text-title-h5"},72:{root:"size-72 text-title-h5"},64:{root:"size-64 text-title-h5"},56:{root:"size-56 text-label-lg"},48:{root:"size-48 text-label-lg"},42:{root:"size-42 text-label-md"},38:{root:"size-38 text-label-md"},32:{root:"size-32 text-label-sm"},24:{root:"size-24 text-label-xs"},20:{root:"size-20 text-label-xs"}},color:{gray:{root:"bg-bg-soft text-static-black/80"},yellow:{root:"bg-yellow-500 text-static-white"},blue:{root:"bg-blue-500 text-static-white"},sky:{root:"bg-sky-500 text-static-white"},purple:{root:"bg-purple-500 text-static-white"},red:{root:"bg-red-500 text-static-white"},green:{root:"bg-green-500 text-static-white"},teal:{root:"bg-teal-500 text-static-white"},violet:{root:"bg-violet-500 text-static-white"},pink:{root:"bg-pink-500 text-static-white"},orange:{root:"bg-orange-500 text-static-white"}}},compoundVariants:[{size:["80","72"],class:{indicator:"-right-8"}},{size:"64",class:{indicator:"-right-8 scale-[.875]"}},{size:"56",class:{indicator:"-right-6 scale-75"}},{size:"48",class:{indicator:"-right-6 scale-[.625]"}},{size:"42",class:{indicator:"-right-6 scale-[.5725]"}},{size:"38",class:{indicator:"-right-6 scale-[.5625]"}},{size:"32",class:{indicator:"-right-6 scale-50"}},{size:"24",class:{indicator:"-right-4 scale-[.375]"}},{size:"20",class:{indicator:"-right-4 scale-[.3125]"}},{withRing:true,size:"80",class:{indicator:"-right-12"}},{withRing:true,size:"72",class:{indicator:"-right-13"}},{withRing:true,size:"64",class:{indicator:"-right-12"}},{withRing:true,size:"56",class:{indicator:"-right-10"}},{withRing:true,size:["48","42","38","32"],class:{indicator:"-right-9"}},{withRing:true,size:["24","20"],class:{indicator:"-right-7"}}],defaultVariants:{size:"48",color:"gray"}}),nt=b({base:"ring-2 ring-offset-2",variants:{color:{gray:"ring-black/10",yellow:"ring-yellow-500",blue:"ring-blue-500",sky:"ring-sky-500",purple:"ring-purple-500",red:"ring-red-500",green:"ring-green-500",teal:"ring-teal-500",violet:"ring-violet-500",pink:"ring-pink-500",orange:"ring-orange-500",white:"ring-static-white",black:"ring-static-black"}},defaultVariants:{color:"gray"}}),De=P.forwardRef(({asChild:e,className:t,size:r,color:o,...a},i)=>{let s=e?Ve:"img",{image:l}=be({size:r,color:o});return jsx(s,{ref:i,className:l({class:t}),...a})});De.displayName=ot;var it=P.forwardRef(({asChild:e,children:t,size:r,color:o,ring:a,className:i,placeholderType:s="user",...l},c$1)=>{let p=P.useId(),d=e?Ve:"div",u=a?nt({color:a===true?o:typeof a=="string"?a:void 0}):void 0,{root:m}=be({size:r,color:o}),h=c(m(),u,i),g={size:r,color:o};if(!t)return jsx("div",{className:h,...l,children:jsx(De,{asChild:true,children:s==="company"?jsx(tt,{}):jsx(et,{})})});let b=oe(t,g,[ot,at],p,e);return jsx(d,{ref:c$1,className:h,...l,children:b})});it.displayName=rt;function st({size:e,color:t,className:r,position:o="bottom",withRing:a,...i}){let{indicator:s}=be({size:e,color:t,withRing:a});return jsx("div",{className:c(s({class:r}),{"top-0 origin-top-right":o==="top","bottom-0 origin-bottom-right":o==="bottom"}),...i})}st.displayName=at;var lt=b({base:"box-content size-12 rounded-full border-4 border-bg-white",variants:{status:{online:"bg-success-base",offline:"bg-gray-500",busy:"bg-error-base",away:"bg-away-base"}},defaultVariants:{status:"online"}});function ct({status:e,className:t,...r}){return jsx("div",{className:lt({status:e,class:t}),...r})}ct.displayName=ur;var pt=P.forwardRef(({asChild:e,className:t,...r},o)=>jsx(e?Ve:"img",{draggable:false,ref:o,className:c("box-content size-24 rounded-full border-2 border-bg-white",t),...r}));pt.displayName=fr;function dt({className:e,...t}){return jsx("div",{className:c("box-content size-12 rounded-full border-2 border-bg-white bg-error-base",e),...t})}dt.displayName=gr;function mt({className:e,...t}){return jsx("div",{className:c("box-content rounded-full border-2 border-bg-white bg-error-base px-6 text-static-white",e),...t})}mt.displayName=vr;function ne({className:e,variant:t="neutral",mode:r="stroke",size:o="small",...a}){return jsx(P$1,{variant:t,mode:r,size:o,className:c("absolute top-12 right-10 z-10 m-auto aspect-square rounded-full border-transparent text-text-soft hover:text-text-strong",e),...a,children:jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M10.4854 1.99998L2.00007 10.4853",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.4854 10.4844L2.00007 1.99908",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}var ke=b({slots:{root:"relative flex w-fit max-w-xl flex-col rounded-[12px] border border-stroke-soft p-0 text-md",content:"",arrowCls:"",header:"flex items-center pe-28 select-none",close:"rounded-full"},variants:{variant:{default:{root:"gap-8 bg-bg-white p-16 pt-12",close:"top-12 right-12 hover:bg-bg-weak"},accent:{root:"bg-bg-weak p-4",content:"rounded-[8px] bg-bg-white px-12 py-8 shadow-sm",header:"px-12 py-4 pb-6",close:"top-9 right-8 hover:bg-bg-white",arrowCls:"bg-bg-weak"}}},defaultVariants:{variant:"default"}});function xr({variant:e,className:t,contentClassName:r,side:o="bottom",align:a="start",arrow:i=true,unstyled:s=true,closeable:l=true,sideOffset:c$1=1,title:p,content:d,children:u,asChild:m,defaultOpen:h,open:g,onOpenChange:b,onClose:T,...f}){let{root:C,content:x,header:y,close:N,arrowCls:I$1}=ke({variant:e}),[w,O]=P__default.useState(h??false),V=g!==void 0,S=V?g:w,W=P__default.useCallback(M=>{V||O(M),b?.(M);},[V,b]);return jsxs(F,{open:S,onOpenChange:W,children:[V&&S&&jsx(J,{}),jsx(G,{className:c(V&&S&&"relative z-20"),asChild:m,children:u}),jsxs(H,{className:C({className:t}),arrowClassName:I$1(),unstyled:s,side:o,align:a,sideOffset:c$1,arrow:i,...f,children:[p&&jsxs("header",{className:y(),children:[jsx("h4",{className:"text-16 m-0 leading-26 font-medium text-text-strong",children:p}),l&&jsx(I,{asChild:true,onClick:T,children:jsx(ne,{size:"xsmall",mode:"ghost",className:N({class:"size-24 p-0"})})})]}),jsx("div",{className:x({className:r}),children:d})]})]})}function Rr({variant:e="default",title:t,content:r,children:o,defaultOpen:a,className:i,side:s="top",align:l="center",sideOffset:c$1=1,arrow:p=true,open:d,contentClassName:u,onOpenChange:m$1,onConfirm:h,onCancel:g,...b}){let{root:T,content:f,header:C,arrowCls:x}=ke({variant:e}),[y,N]=P__default.useState(a??false),I$1=d!==void 0,w=I$1?d:y,O=P__default.useCallback(M=>{I$1||N(M),m$1?.(M);},[I$1,m$1]),[V,S]=P__default.useState(false),W=P__default.useCallback(async()=>{O(false);try{S(!0),await h?.();}catch{}finally{S(false);}},[O,h]);return jsxs(F,{open:w,onOpenChange:O,children:[jsx(AnimatePresence,{children:w&&jsx(J,{as:m.div,...k,className:"bg-black/5"})}),jsx(G,{className:c(w&&"relative z-20"),children:jsx("div",{className:"inline-flex items-center",children:P__default.isValidElement(o)?P__default.cloneElement(o,{loading:V}):o})}),jsxs(H,{className:T({className:c("max-w-lg",i)}),arrowClassName:x(),unstyled:true,side:s,align:l,sideOffset:c$1,arrow:p,...b,children:[t&&jsxs("header",{className:C({className:"gap-6"}),children:[jsx(CircleAlert,{className:"text-red-500",size:16}),jsx("h4",{className:"m-0 text-15 leading-26 font-medium text-text-strong",children:t})]}),jsxs("div",{className:f({className:u}),children:[r,jsxs("div",{className:"mt-8 flex justify-end gap-12",children:[jsx(I,{unstyled:true,onClick:g,asChild:true,children:jsx(P$1,{size:"xsmall",variant:"neutral",mode:"stroke",className:"h-26",children:"Cancel"})}),jsx(P$1,{size:"xsmall",mode:"stroke",className:"h-26",onClick:W,children:"Confirm"})]})]})]})]})}function vt({...e}){return jsx(Drawer.Root,{"data-slot":"drawer",...e})}function ht({...e}){return jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function wr({...e}){return jsx(Drawer.Portal,{"data-slot":"drawer-portal",...e})}function ze({...e}){return jsx(Drawer.Close,{"data-slot":"drawer-close",...e})}function Pr({className:e,...t}){return jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:c("fixed inset-0 z-50 bg-black/10 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0",e),...t})}var Tr={top:"inset-x-8 top-8 max-h-[80vh]",bottom:"inset-x-8 bottom-8 mt-96 max-h-[80vh]",left:"inset-y-8 left-8 w-3/5",right:"inset-y-8 right-8 w-3/5"};function xt({className:e,direction:t,children:r,...o}){let a=P.useRef({"--initial-transform":"calc(100% + 8px)"});return jsxs(wr,{"data-slot":"drawer-portal",children:[jsx(Pr,{}),jsx(Drawer.Content,{"data-slot":"drawer-content",style:a.current,className:c("group/drawer-content fixed z-50 flex h-auto flex-col rounded-[12px] bg-static-white outline-none",t&&Tr[t],e),...o,children:r})]})}function yt({className:e,...t}){return jsx("div",{"data-slot":"drawer-header",className:c("flex flex-col px-16 py-12",e),...t})}function bt({className:e,...t}){return jsx("div",{"data-slot":"drawer-body",className:c("scrollbar-thin overflow-y-auto p-16 select-text",e),...t})}function Ct({className:e,...t}){return jsx("div",{"data-slot":"drawer-footer",className:c("mt-auto flex flex-col gap-8 px-16 py-18",e),...t})}function Rt({className:e,...t}){return jsx(Drawer.Title,{"data-slot":"drawer-title",className:c("m-0 text-xl leading-32 font-medium text-text-strong",e),...t})}function wt({className:e,...t}){return jsx(Drawer.Description,{"data-slot":"drawer-description",className:c("m-0 text-md text-text-sub",e),...t})}function Nr({direction:e="right",dismissible:t=true,skeletonItemCount:r=5,className:o,footerClassName:a,bodyClassName:i,headerClassName:s,title:l="Title",description:c$1,footer:p,trigger:d,container:u,children:m,open:h,onOpenChange:g,loading:b,handleOnly:T=true,style:f,width:C,onClose:x,onOk:y,...N}){let I=Q(),w=P__default.useRef({...f,width:C}),[O,V]=P__default.useState(false),[S,W]=P__default.useState(false),M=h!==void 0,Qt=M?h:O,te=P__default.useCallback(q=>{!q&&S||(M||V(q),g?.(q));},[M,g,S]),jt=P__default.useCallback(async()=>{if(!y){te(false);return}let q=y();if(q instanceof Promise){W(true);try{await q,te(!1);}catch{}finally{W(false);}}else te(false);},[y,te]),re=!S&&t;return jsxs(vt,{container:u,direction:e,dismissible:re,handleOnly:T,autoFocus:true,open:Qt,onOpenChange:te,...N,children:[d&&jsx(ht,{asChild:true,children:d}),jsxs(xt,{direction:e,className:c(u&&u!==document.body&&"absolute",o),style:w.current,children:[t&&jsx(ze,{asChild:true,children:jsx(ne,{disabled:!re})}),t===false&&jsx(ne,{disabled:!re,onClick:x}),jsxs(yt,{className:c("border-b border-b-stroke-antd",s),children:[jsx(Rt,{className:"pe-42",asChild:true,children:typeof l=="string"?jsx("h3",{children:l}):jsx("div",{children:l})}),jsx(wt,{className:c(!c$1&&"sr-only"),children:c$1})]}),jsxs(bt,{className:i,children:[b&&jsx(Ar,{count:r}),!b&&m]}),jsxs(Ct,{className:c("flex-row border-t border-t-stroke-antd",a),children:[p,!p&&jsxs(Fragment,{children:[t&&jsx(ze,{asChild:true,children:jsx(P$1,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!re,children:I("close")})}),t===false&&jsx(P$1,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!re,onClick:x,children:I("close")}),jsx(P$1,{variant:"neutral",mode:"filled",className:"w-3/5",loading:b||S,onClick:jt,children:I("ok")})]})]})]})]})}function Ar({count:e=5}){let t=Array.from({length:e});return jsxs("div",{className:"flex flex-col gap-16",children:[jsxs("div",{className:"flex flex-row items-center gap-12",children:[jsx(o,{className:"size-58 rounded-2xl"}),jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsx(o,{className:"mb-4 h-14 w-3/10"}),jsx(o,{className:"h-10 w-7/10"}),jsx(o,{className:"h-10 w-9/10"})]})]}),t.map((r,o$1)=>jsxs("div",{className:"flex flex-col gap-8",children:[jsx(o,{className:"h-12 w-5/10"}),jsx(o,{className:"h-12 w-7/10"}),jsx(o,{className:"h-12 w-full"})]},o$1))]})}function Dr(e){let[t,r]=P__default.useState(false),[o,a]=P__default.useState(null),i=P__default.useCallback(p=>{a(p),r(true);},[]),s=P__default.useCallback(()=>{r(false),a(null);},[]),l=P__default.useCallback(p=>{r(p),p||a(null);},[]);return [{...e,open:t,onOpenChange:l,onClose:s},o,i,s]}var Pt=async e=>{if(!e)return;if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement("textarea");t.setAttribute("readonly",""),t.tabIndex=-1,t.style.position="fixed",t.style.left="-9999px",t.value=e,document.body.appendChild(t);let r=document.getSelection();if(r){let o=r.rangeCount>0&&r.getRangeAt(0);t.select(),document.execCommand("copy"),o&&(r.removeAllRanges(),r.addRange(o));}document.body.removeChild(t);};var Ur={initial:{scale:.5,opacity:0,filter:"blur(2px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:.5,opacity:0,filter:"blur(2px)"}},kr={opacity:{duration:.25},filter:{duration:.25},scale:{duration:.35,ease:[.34,1.56,.64,1]}},zr={variants:Ur,initial:"initial",animate:"animate",exit:"exit",transition:kr};function Oe({initial:e=false,state:t,states:r,asDiv:o,className:a,style:i,...s}){let l=o?m.div:m.span;return jsx(AnimatePresence,{initial:e,mode:"popLayout",children:jsx(l,{className:c("inline-flex items-center justify-center",a),...zr,style:i,...s,children:r[t]},t)})}function Me({swap:e,on:t,off:r,className:o}){return jsx(Oe,{state:e?"on":"off",states:{on:t,off:r},className:o})}function Lr({content:e,delay:t=700,tooltipDelayDuration:r=700,variant:o="neutral",mode:a="stroke",size:i$1="small",as:s="button",children:l,onCopy:c$1,className:p}){let d=Q(),[u,m]=P__default.useState(false),[h,g]=P__default.useState(false),[b,T]=P__default.useState(false),f=P__default.useRef(null),C=P__default.useRef(null);P__default.useEffect(()=>()=>{f.current&&clearTimeout(f.current),C.current&&clearTimeout(C.current);},[]);let x=P__default.useCallback(async()=>{u||(m(true),T(true),await Pt(e),c$1?.(e),f.current=setTimeout(()=>{T(false),C.current=setTimeout(()=>m(false),150);},t));},[u,t,e,c$1]),y=jsx(Me,{swap:u,on:jsx(CheckCheck,{width:"1em",height:"1em"}),off:jsx(Copy,{width:"1em",height:"1em"})}),N=(()=>{switch(s){case "text":return jsx("span",{className:c("relative cursor-pointer before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",p),onClick:x,children:jsx("span",{className:"relative z-1",children:l??e})});case "inline":return jsxs("span",{className:c("relative inline-flex cursor-pointer items-center gap-6 before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",p),onClick:x,children:[jsx("span",{className:"relative z-1",children:l??e}),jsx("span",{className:c("inline-flex items-center text-zinc-500",u&&"text-primary-base"),children:y})]});default:return jsx(P$1,{variant:o,mode:a,size:i$1,className:c(u&&"cursor-not-allowed",p),onClick:x,startContent:y})}})();return jsx(i,{content:d(u?"copied":"copy"),size:i$1,open:b||h,delayDuration:r,onOpenChange:g,hideWhenDetached:true,children:N})}var Fr=b({base:"flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset",variants:{variant:{filled:"text-static-white",lighter:"",outline:"ring-current"},ring:{true:""},color:{neutral:"",slate:"",red:"",orange:"",amber:"",yellow:"",lime:"",green:"",emerald:"",teal:"",cyan:"",sky:"",blue:"",indigo:"",violet:"",purple:"",fuchsia:"",pink:"",rose:""}},compoundVariants:[{variant:"filled",color:"neutral",class:"bg-black/90"},{variant:"filled",color:"slate",class:"bg-slate-500"},{variant:"filled",color:"red",class:"bg-red-500"},{variant:"filled",color:"orange",class:"bg-orange-500"},{variant:"filled",color:"amber",class:"bg-amber-500"},{variant:"filled",color:"yellow",class:"bg-yellow-500"},{variant:"filled",color:"lime",class:"bg-lime-500"},{variant:"filled",color:"green",class:"bg-green-500"},{variant:"filled",color:"emerald",class:"bg-emerald-500"},{variant:"filled",color:"teal",class:"bg-teal-500"},{variant:"filled",color:"cyan",class:"bg-cyan-500"},{variant:"filled",color:"sky",class:"bg-sky-500"},{variant:"filled",color:"blue",class:"bg-blue-500"},{variant:"filled",color:"indigo",class:"bg-indigo-500"},{variant:"filled",color:"violet",class:"bg-violet-500"},{variant:"filled",color:"purple",class:"bg-purple-500"},{variant:"filled",color:"fuchsia",class:"bg-fuchsia-500"},{variant:"filled",color:"pink",class:"bg-pink-500"},{variant:"filled",color:"rose",class:"bg-rose-500"},{variant:"filled",ring:true,color:"neutral",class:"ring-neutral-700"},{variant:"filled",ring:true,color:"slate",class:"ring-slate-600"},{variant:"filled",ring:true,color:"red",class:"ring-red-700"},{variant:"filled",ring:true,color:"orange",class:"ring-orange-600"},{variant:"filled",ring:true,color:"amber",class:"ring-amber-600"},{variant:"filled",ring:true,color:"yellow",class:"ring-yellow-600"},{variant:"filled",ring:true,color:"lime",class:"ring-lime-600"},{variant:"filled",ring:true,color:"green",class:"ring-green-600"},{variant:"filled",ring:true,color:"emerald",class:"ring-emerald-600"},{variant:"filled",ring:true,color:"teal",class:"ring-teal-600"},{variant:"filled",ring:true,color:"cyan",class:"ring-cyan-600"},{variant:"filled",ring:true,color:"sky",class:"ring-sky-600"},{variant:"filled",ring:true,color:"blue",class:"ring-blue-700"},{variant:"filled",ring:true,color:"indigo",class:"ring-indigo-600"},{variant:"filled",ring:true,color:"violet",class:"ring-violet-600"},{variant:"filled",ring:true,color:"purple",class:"ring-purple-600"},{variant:"filled",ring:true,color:"fuchsia",class:"ring-fuchsia-600"},{variant:"filled",ring:true,color:"pink",class:"ring-pink-600"},{variant:"filled",ring:true,color:"rose",class:"ring-rose-600"},{variant:"lighter",color:"neutral",class:"bg-neutral-100 text-neutral-600"},{variant:"lighter",color:"slate",class:"bg-slate-100 text-slate-500"},{variant:"lighter",color:"red",class:"bg-red-50 text-red-500"},{variant:"lighter",color:"orange",class:"bg-orange-50 text-orange-500"},{variant:"lighter",color:"amber",class:"bg-amber-50 text-amber-500"},{variant:"lighter",color:"yellow",class:"bg-yellow-50 text-yellow-500"},{variant:"lighter",color:"lime",class:"bg-lime-50 text-lime-500"},{variant:"lighter",color:"green",class:"bg-green-50 text-green-500"},{variant:"lighter",color:"emerald",class:"bg-emerald-50 text-emerald-500"},{variant:"lighter",color:"teal",class:"bg-teal-50 text-teal-500"},{variant:"lighter",color:"cyan",class:"bg-cyan-50 text-cyan-500"},{variant:"lighter",color:"sky",class:"bg-sky-50 text-sky-500"},{variant:"lighter",color:"blue",class:"bg-blue-50 text-blue-500"},{variant:"lighter",color:"indigo",class:"bg-indigo-50 text-indigo-500"},{variant:"lighter",color:"violet",class:"bg-violet-50 text-violet-500"},{variant:"lighter",color:"purple",class:"bg-purple-50 text-purple-500"},{variant:"lighter",color:"fuchsia",class:"bg-fuchsia-50 text-fuchsia-500"},{variant:"lighter",color:"pink",class:"bg-pink-50 text-pink-500"},{variant:"lighter",color:"rose",class:"bg-rose-50 text-rose-500"},{variant:["lighter","outline"],ring:true,color:"neutral",class:"ring-neutral-200"},{variant:["lighter","outline"],ring:true,color:"slate",class:"ring-slate-200"},{variant:["lighter","outline"],ring:true,color:"red",class:"ring-red-200"},{variant:["lighter","outline"],ring:true,color:"orange",class:"ring-orange-200"},{variant:["lighter","outline"],ring:true,color:"amber",class:"ring-amber-200"},{variant:["lighter","outline"],ring:true,color:"yellow",class:"ring-yellow-200"},{variant:["lighter","outline"],ring:true,color:"lime",class:"ring-lime-200"},{variant:["lighter","outline"],ring:true,color:"green",class:"ring-green-200"},{variant:["lighter","outline"],ring:true,color:"emerald",class:"ring-emerald-200"},{variant:["lighter","outline"],ring:true,color:"teal",class:"ring-teal-200"},{variant:["lighter","outline"],ring:true,color:"cyan",class:"ring-cyan-200"},{variant:["lighter","outline"],ring:true,color:"sky",class:"ring-sky-200"},{variant:["lighter","outline"],ring:true,color:"blue",class:"ring-blue-200"},{variant:["lighter","outline"],ring:true,color:"indigo",class:"ring-indigo-200"},{variant:["lighter","outline"],ring:true,color:"violet",class:"ring-violet-200"},{variant:["lighter","outline"],ring:true,color:"purple",class:"ring-purple-200"},{variant:["lighter","outline"],ring:true,color:"fuchsia",class:"ring-fuchsia-200"},{variant:["lighter","outline"],ring:true,color:"pink",class:"ring-pink-200"},{variant:["lighter","outline"],ring:true,color:"rose",class:"ring-rose-200"},{variant:"outline",color:"neutral",class:"text-neutral-500"},{variant:"outline",color:"slate",class:"text-slate-400"},{variant:"outline",color:"red",class:"text-red-500"},{variant:"outline",color:"orange",class:"text-orange-500"},{variant:"outline",color:"amber",class:"text-amber-500"},{variant:"outline",color:"yellow",class:"text-yellow-500"},{variant:"outline",color:"lime",class:"text-lime-500"},{variant:"outline",color:"green",class:"text-green-500"},{variant:"outline",color:"emerald",class:"text-emerald-500"},{variant:"outline",color:"teal",class:"text-teal-500"},{variant:"outline",color:"cyan",class:"text-cyan-500"},{variant:"outline",color:"sky",class:"text-sky-500"},{variant:"outline",color:"blue",class:"text-blue-500"},{variant:"outline",color:"indigo",class:"text-indigo-500"},{variant:"outline",color:"violet",class:"text-violet-500"},{variant:"outline",color:"purple",class:"text-purple-500"},{variant:"outline",color:"fuchsia",class:"text-fuchsia-500"},{variant:"outline",color:"pink",class:"text-pink-500"},{variant:"outline",color:"rose",class:"text-rose-500"}],defaultVariants:{variant:"outline",color:"slate"}});function Pn({asChild:e,children:t,className:r,color:o,variant:a,ring:i,...s}){let l=e?Slot.Root:"div",c=Fr({variant:a,color:o,ring:i,className:r});return jsx(l,{className:c,...s,children:t})}function An({...e}){return jsx(Collapsible.Root,{"data-slot":"collapsible",...e})}function Vn({...e}){return jsx(Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Dn({className:e,...t}){return jsx(Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",className:c("collapsible-content",e),...t})}var $r="BadgeRoot",Nt="BadgeIcon",At="BadgeDot",_e=b({slots:{root:"inline-flex w-fit appearance-none items-center justify-center border-none leading-none font-medium whitespace-nowrap transition duration-200 ease-out select-none",icon:"uicon shrink-0",dot:["uidot flex items-center justify-center","before:size-4 before:rounded-full before:bg-current"]},variants:{size:{medium:{root:"h-24 gap-4 px-10 text-md has-[>.uicon]:gap-6 has-[>.uidot]:gap-4",icon:"-mx-2 size-14",dot:"-mx-4 size-16 before:size-6"},small:{root:"h-20 gap-4 px-8 text-sm has-[>.uicon]:gap-4 has-[>.uidot]:gap-3",icon:"-mx-px size-12",dot:"-mx-4 size-16 before:size-5"},xsmall:{root:"h-16 gap-3 px-7 text-xs has-[>.uicon]:gap-4 has-[>.uidot]:gap-4",icon:"-mx-px size-10",dot:"-mx-5 size-16"}},variant:{filled:{root:"text-static-white"},outline:{root:"ring-1 ring-current ring-inset"},lighter:"",ghost:""},color:{primary:"",info:"",success:"",warning:"",error:"",neutral:""},shape:{default:"",circle:{root:"rounded-full"}},disabled:{true:{root:"cursor-not-allowed opacity-75"}}},compoundVariants:[{shape:"default",size:"xsmall",class:{root:"rounded-[3px] px-5"}},{shape:"default",size:"small",class:{root:"rounded-[4px] px-6"}},{shape:"default",size:"medium",class:{root:"rounded-lg px-7",icon:"ms-0"}},{variant:"filled",color:"primary",class:{root:"bg-primary-base"}},{variant:"filled",color:"info",class:{root:"bg-cyan-500"}},{variant:"filled",color:"success",class:{root:"bg-emerald-500"}},{variant:"filled",color:"warning",class:{root:"bg-orange-500"}},{variant:"filled",color:"error",class:{root:"bg-red-600"}},{variant:"filled",color:"neutral",class:{root:"bg-black/90"}},{variant:"outline",color:"primary",class:{root:"text-primary-base"}},{variant:"outline",color:"info",class:{root:"text-cyan-600"}},{variant:"outline",color:"success",class:{root:"text-emerald-500"}},{variant:"outline",color:"warning",class:{root:"text-orange-500"}},{variant:"outline",color:"error",class:{root:"text-red-600"}},{variant:"outline",color:"neutral",class:{root:"text-neutral-600 ring-neutral-200"}},{variant:"lighter",color:"primary",class:{root:"bg-blue-50 text-primary-base"}},{variant:"lighter",color:"info",class:{root:"bg-cyan-50 text-cyan-600"}},{variant:"lighter",color:"success",class:{root:"bg-emerald-50 text-emerald-600"}},{variant:"lighter",color:"warning",class:{root:"bg-orange-50 text-orange-600"}},{variant:"lighter",color:"error",class:{root:"bg-red-50 text-red-600"}},{variant:"lighter",color:"neutral",class:{root:"bg-neutral-100 text-neutral-600"}},{variant:"ghost",color:"primary",class:{root:"text-primary-base"}},{variant:"ghost",color:"info",class:{root:"text-cyan-600"}},{variant:"ghost",color:"success",class:{root:"text-emerald-600"}},{variant:"ghost",color:"warning",class:{root:"text-orange-600"}},{variant:"ghost",color:"error",class:{root:"text-red-600"}},{variant:"ghost",color:"neutral",class:{root:"text-neutral-600"}}],defaultVariants:{variant:"filled",color:"primary",size:"medium",shape:"default"}}),Vt=({asChild:e,size:t,variant:r,color:o,shape:a,children:i,className:s,disabled:l,...c})=>{let p=P.useId(),d=e?Slot.Root:"div",{root:u}=_e({variant:r,color:o,size:t,shape:a,disabled:l}),h=oe(i,{size:t,variant:r,color:o},[Nt,At],p,e);return jsx(d,{"data-slot":"badge",className:u({class:s}),...c,children:h})};Vt.displayName=$r;function Dt({className:e,size:t,variant:r,color:o,as:a,...i}){let s=a||"div",{icon:l}=_e({size:t,variant:r,color:o});return jsx(s,{"data-slot":"icon",className:l({class:e}),...i})}Dt.displayName=Nt;function Et({size:e,variant:t,color:r,className:o,...a}){let{dot:i}=_e({size:e,variant:t,color:r});return jsx("div",{"data-slot":"dot",className:i({class:o}),...a})}Et.displayName=At;function Mn({icon:e,dot:t,children:r,asChild:o,...a}){return jsxs(Vt,{asChild:o,...a,children:[e&&!o&&jsx(Dt,{as:e}),t&&!o&&jsx(Et,{}),r]})}function qr({className:e,scrollBarClassName:t,children:r,...o}){return jsxs(ScrollArea.Root,{"data-slot":"scroll-area",className:c("relative",e),...o,children:[jsx(ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary-base focus-visible:outline-1",children:r}),jsx(Ut,{orientation:"vertical",className:t}),jsx(Ut,{orientation:"horizontal",className:t}),jsx(ScrollArea.Corner,{})]})}function Ut({className:e,orientation:t="vertical",...r}){return jsx(ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:c("flex touch-none p-2 transition-colors select-none data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-10 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",e),...r,children:jsx(ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-stroke-sub"})})}function Zr({open:e,defaultOpen:t,openDelay:r=300,closeDelay:o,asChild:a=true,arrow:i=true,content:s,children:l,onOpenChange:c,...p}){return jsxs(Xr,{"data-slot":"hover-card",open:e,defaultOpen:t,openDelay:r,closeDelay:o,onOpenChange:c,children:[jsx(Jr,{asChild:a,children:l}),jsxs(Qr,{...p,children:[s,i&&jsx(HoverCard.Arrow,{asChild:true,children:jsx(E,{className:"-translate-y-6.5"})})]})]})}function Xr({...e}){return jsx(HoverCard.Root,{"data-slot":"hover-card",...e})}function Jr({...e}){return jsx(HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function Qr({className:e,align:t="center",sideOffset:r=4,collisionPadding:o=16,...a}){return jsx(HoverCard.Portal,{"data-slot":"hover-card-portal",children:jsx(HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:r,collisionPadding:o,className:c("z-50 rounded-2xl bg-bg-white px-10 py-6 text-md text-text-strong shadow-regular-md ring-1 ring-stroke-soft outline-hidden duration-100 ring-inset","origin-(--radix-hover-card-content-transform-origin) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a})})}var to={initial:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},exit:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"}},ro={type:"spring",bounce:.1,duration:.25},oo={ease:[.26,.08,.25,1],duration:.27};function ao({activeKey:e,children:t,className:r,rootClassName:o,defaultCardHeight:a,initialKey:i,variants:s=to,transition:l=oo,rootTransition:c=ro}){let[p,{height:d}]=eo(),u=P.useRef(a??0);d>0&&(u.current=d);let m$1=e===i?a:d||u.current;return jsx(a$1,{children:jsx(m.div,{"data-slot":"animation-root",className:o,initial:false,animate:{height:m$1},transition:c,children:jsx("div",{ref:p,"data-slot":"animation-container",children:jsx(AnimatePresence,{mode:"popLayout",initial:false,children:jsx(m.div,{"data-slot":"animation-page",variants:s,transition:l,initial:"initial",animate:"animate",exit:"exit",className:r,children:t},e)})})})})}function $(e,t){let r=P.useRef(void 0),{current:o}=r;return P.useEffect(()=>{(!t||e!==void 0)&&(r.current=e);},[e,t]),o}var lo={type:"tween",duration:.3,ease:[.25,1,.5,1]},co={type:"tween",duration:.38,ease:[.25,1,.5,1]},Re={type:"spring",stiffness:260,damping:30},po={type:"tween",duration:.35,ease:"easeIn"},mo={type:"tween",duration:.35,ease:"easeOut"},uo={type:"tween",duration:.35,ease:"linear"},j={type:"tween",duration:.25,ease:"easeInOut"},Ge=[.25,.1,.25,1],_t=1.12,fo=.93,we={type:"tween",duration:.22,ease:Ge},go={scale:{type:"tween",duration:.22,ease:Ge},opacity:{type:"tween",duration:.16,ease:Ge}},vo={type:"spring",stiffness:260,damping:30},ho=.7,xo=.9,Ht="bg-white";function Ft(e){return e?ho:xo}function Fe(e,t){return e==="x"?{x:t}:{y:t}}function Gt(e,t=lo){return {supportsDimmed:false,variants:{enterFrom:({direction:r})=>({...Fe(e,r===0?0:r>0?"100%":"-100%"),zIndex:1,transition:t}),active:{...Fe(e,0),zIndex:1,transition:t},exit:({direction:r})=>({...Fe(e,r<0?"100%":"-100%"),zIndex:0,transition:t})}}}function yo(){return {supportsDimmed:true,variants:{enterFrom:({direction:e,dimmed:t})=>e===0?{x:0,opacity:1,transition:Re}:{x:e>0?"100%":"-20%",opacity:e>0?1:Ft(t),zIndex:1,transition:Re},active:{x:0,opacity:1,zIndex:1,transition:Re},exit:({direction:e,dimmed:t})=>({x:e<0?"100%":"-20%",opacity:e<0?1:Ft(t),zIndex:e<0?5:0,transition:Re})}}}function bo(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>({clipPath:e>0?"inset(0 100% 0 0)":"inset(0 0 0 0)",zIndex:1}),active:({direction:e})=>({clipPath:"inset(0 0 0 0)",zIndex:1,transition:e>0?po:void 0}),exit:({direction:e})=>e<0?{clipPath:"inset(0 100% 0 0)",zIndex:2,transition:mo}:{opacity:.999,zIndex:0,transition:uo}}}}function Co(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{x:0,scale:1,opacity:1,zIndex:1,transition:j}:e>0?{x:"200%",opacity:1,zIndex:2,transition:j}:{scale:.7,opacity:0,zIndex:0,transition:j},active:{x:0,scale:1,opacity:1,zIndex:1,transition:j},exit:({direction:e})=>e<0?{x:"200%",opacity:1,zIndex:2,transition:j}:{x:0,scale:.7,opacity:0,zIndex:0,transition:j}}}}function Ro(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{scale:1,opacity:1,zIndex:1,transition:we}:{scale:e>0?_t:fo,opacity:0,zIndex:e>0?1:0,transition:we},active:{scale:1,opacity:1,zIndex:1,transition:we},exit:({direction:e})=>e<0?{scale:_t,opacity:0,zIndex:2,transition:go}:{scale:1,opacity:0,zIndex:0,transition:we}}}}var Kt={slide:Gt("x"),slideVertical:Gt("y",co),slideLayers:yo(),reveal:bo(),pushSlide:Co(),zoomFade:Ro()};function Pe(e,t){let r=Kt[e.animation].variants[t];return typeof r=="function"?r(e,{},{}):r}var wo={enterFrom:e=>Pe(e,"enterFrom"),active:e=>Pe(e,"active"),exit:e=>Pe(e,"exit")};function Ke({activeKey:e,animation:t="slideLayers",dimmed:r=true,lockPointerDuringTransition:o=true,className:a,viewClassName:i,children:s}){let l=$(e),c$1=l!==void 0&&e!==l,p=c$1?e>l?1:-1:0,d=useRef(null),[u,m$1]=useState(false),h=Kt[t],g={animation:t,direction:p,dimmed:!!(r&&h.supportsDimmed)},b=Pe(g,"active"),T=typeof b=="string"?b:{...b,transition:{duration:0}},f=useRef(new Map),[C,x]=eo(),[y,N]=useState(void 0);useLayoutEffect(()=>{if(!x.height)return;let w=f.current.get(e);(!w||Math.abs(w-x.height)>1)&&(f.current.set(e,x.height),N(x.height));},[x.height,e]),useLayoutEffect(()=>{let w=f.current.get(e);w&&N(w);},[e]),useLayoutEffect(()=>{if(!o){d.current=null,m$1(false);return}c$1&&(d.current=e,m$1(true));},[e,c$1,o]);let I=P__default.useCallback(w=>{d.current===w&&(d.current=null,m$1(false));},[m$1]);return jsx(a$1,{children:jsxs(m.div,{"data-slot":"ui-transition-root",className:c("relative w-full overflow-hidden",g.dimmed&&"bg-black",u&&"pointer-events-none",a),initial:false,animate:{height:y},style:{height:y},transition:vo,children:[!f.current.has(e)&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0",children:jsx("div",{ref:C,className:c(Ht,i),children:s})}),jsx(AnimatePresence,{initial:false,custom:g,mode:"sync",children:jsx(m.div,{"data-slot":"ui-transition-item",custom:g,variants:wo,initial:p===0?false:"enterFrom",animate:c$1?"active":T,exit:"exit",onAnimationComplete:()=>I(e),className:c("absolute inset-0 size-full",Ht,i),children:s},e)})]})})}function Wt(e,t){let r=$(e);P.useEffect(()=>{t&&!r&&e?To(t):t&&!e&&r&&$t(t);},[t,e,r]),P.useEffect(()=>()=>{t&&e&&$t(t);},[t,e]);}function To(e){if(e){let r=e.clientHeight,o=(r-24)/r;e.style.overflow="hidden",e.style.willChange="transform",e.style.transition="transform 250ms linear",e.style.transform=`translateY(calc(env(safe-area-inset-top, 0) - 24px)) scale(${o})`;}}function $t(e){function t(){e.style.removeProperty("overflow"),e.style.removeProperty("will-change"),e.style.removeProperty("transition"),e.removeEventListener("transitionend",t);}e&&(e.style.removeProperty("transform"),e.addEventListener("transitionend",t));}var So={variants:{initial:{opacity:0},animate:{opacity:.05},exit:{opacity:0}},initial:"initial",animate:"animate",exit:"exit"},No={initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24}},Ao={variants:No,initial:"initial",animate:"animate",exit:"exit"},Vo={duration:.3,delay:.35},Do={variants:{initial:{borderRadius:24,opacity:0},exit:{borderRadius:24,opacity:0},animate:{borderRadius:24,opacity:1}},initial:"initial",animate:"animate",exit:"exit"},Eo=100,Uo=300,ko={width:440,height:680};function We(e){return typeof e=="number"?`${e}px`:e}function zo({open:e,loading:t,visual:r$1,backgroundViewRef:o,children:a,className:i,containerClassName:s,defaultSize:l=Eo,expandedSize:c$1=ko,onCloseComplete:p,onContentAnimationComplete:d,onExpandedChangeComplete:u}){let[m$1,h]=P.useState(!!e),[g,b,T]=r(false),f=P.useRef(false),C=P.useRef(null),x=P.useRef(false),y=P.useRef(null),N=P.useRef({"--modal-size":We(l),"--modal-expanded-width":We(c$1.width),"--modal-expanded-height":We(c$1.height)});Wt(!!(e&&g&&o?.current),o?.current);let I=P.useCallback(()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{y.current=null,h(false);},Uo);},[]),w=P.useCallback(()=>{C.current!==null&&(u?.(C.current),C.current=null),f.current&&(f.current=false,I());},[u,I]),O=P.useCallback(()=>{x.current&&(x.current=false,p?.());},[p]),V=P.useCallback(S=>{if(S==="animate"){d?.("entered");return}S==="exit"&&d?.("exited");},[d]);return P.useEffect(()=>{e&&(y.current&&(clearTimeout(y.current),y.current=null),f.current=false,x.current=false,h(true));},[e]),P.useEffect(()=>{if(m$1){if(e){if(t){g&&(C.current=false),T();return}g||(C.current=true),b();return}if(x.current=true,!f.current){if(g){C.current=false,f.current=true,T();return}I();}}},[T,g,t,e,m$1,I,b]),P.useEffect(()=>()=>{y.current&&clearTimeout(y.current);},[]),jsx(a$1,{children:jsx(AnimatePresence,{onExitComplete:O,children:m$1&&jsxs(Portal.Root,{style:N.current,"data-slot":"ui-modal-root",children:[jsx(m.div,{"data-slot":"ui-modal-backdrop",className:"fixed inset-0 z-10 bg-black",...So}),jsxs(m.div,{layout:true,"data-slot":"ui-modal-container","data-state":g&&"expanded",className:c("flex flex-col items-center justify-start bg-white p-16 ring-1 ring-stone-950/6","fixed top-1/2 left-1/2 z-20 -translate-x-1/2 -translate-y-1/2","h-(--modal-size) w-(--modal-size)","data-[state=expanded]:h-(--modal-expanded-height) data-[state=expanded]:w-(--modal-expanded-width)",s),onLayoutAnimationComplete:w,...Do,children:[jsx(m.div,{"data-slot":"ui-modal-visual",layout:true,children:r$1}),jsx(AnimatePresence,{children:g&&jsx(m.div,{"data-slot":"ui-modal-content",onAnimationComplete:V,...Ao,transition:Vo,className:c("flex w-full flex-col overflow-hidden",i),children:a},"content")})]})]})})})}var Zt=P__default.createContext(null);function Oo(){let e=P__default.useContext(Zt);if(!e)throw new Error("useUIScreen must be used within <UIScreen>");return e}function Ye({value:e,animation:t,className:r,children:o}){return jsx(Fragment,{children:o})}Ye.displayName="UIScreen.View";function Mo(e){return P__default.isValidElement(e)&&e.type===Ye}function Xt(e,t=[]){return P__default.Children.forEach(e,r=>{if(P__default.isValidElement(r)&&r.type===P__default.Fragment){Xt(r.props.children,t);return}Mo(r)&&t.push({value:r.props.value,animation:r.props.animation,className:r.props.className,activeKey:t.length,children:r.props.children});}),t}function Bo(e){let t=new Set;e.forEach(({value:r})=>{if(t.has(r))throw new Error(`Duplicate UIScreen.View value "${String(r)}".`);t.add(r);});}function Jt({screen:e,defaultScreen:t,onScreenChange:r,children:o,...a}){let i=e!==void 0,[s,l]=P__default.useState(t),c$1=e??s,p=$(c$1),d=P__default.useRef(null),u=Xt(o);if(!u.length)throw new Error("UIScreen requires at least one UIScreen.View child.");if(e!==void 0&&t!==void 0)throw new Error("UIScreen accepts either screen or defaultScreen, but not both.");if(c$1===void 0)throw new Error("UIScreen requires either a screen or defaultScreen prop.");let m=c$1;Bo(u);let h=u.find(f=>f.value===m);if(!h)throw new Error(`UIScreen could not find a UIScreen.View matching screen "${String(m)}".`);let g=d.current,b=g!==null&&p===g.from&&m===g.to;P__default.useLayoutEffect(()=>{let f=d.current;f&&m!==f.from&&(d.current=null);},[m]);let T=P__default.useMemo(()=>({screen:m,navigate:(f,C)=>{let x=C?.animation;d.current=f!==m&&x?{from:m,to:f,animation:x}:null,i||l(f),r?.(f);}}),[i,r,m]);return jsx(Zt.Provider,{value:T,children:jsx(Ke,{...a,animation:(b?g.animation:h.animation)??a.animation,viewClassName:c(a.viewClassName,h.className),activeKey:h.activeKey,children:h.children})})}Jt.displayName="UIScreen";var Lo=Object.assign(Jt,{View:Ye});var Ho=()=>{let[,e]=P.useState(false);return P.useCallback(()=>{e(t=>!t);},[])};var Fo=(e=false)=>{let[t,r]=P.useState(e),o=P.useCallback(()=>{r(a=>!a);},[]);return [t,o]};
2
- export{ao as AnimationCard,ut as Avatar,Mn as Badge,An as Collapsible,Dn as CollapsibleContent,Vn as CollapsibleTrigger,Pn as ColorPanel,Lr as CopyableText,Nr as Drawer,Zr as HoverCard,Rr as PopConfirm,xr as PopoverPreset,qr as ScrollArea,Oe as StateSwitcher,Me as Swap,zo as UIMorphingModal,Lo as UIScreen,Ke as UIViewTransition,ma as compact,pa as findOption,aa as formatCurrency,na as formatIntegerCompact,oa as formatNumber,ia as getFirstLetters,ua as omit,dr as pick,da as unique,Dr as useDrawer,Ho as useForceUpdate,$ as usePrevious,Fo as useToggle,Oo as useUIScreen};
1
+ import'./chunk-PICBT6ES.js';import {a as a$1,k,o,r}from'./chunk-U66T3F2Z.js';export{q as DropdownMenu,o as Skeleton,n as Switch,j as Tabs,b as UIProvider,d as debounce,p as dropdownMenuStyles,f as mergeRefs,e as throttle,r as useFlag}from'./chunk-U66T3F2Z.js';import {b,c,F,J,G,H,I as I$1,P,Q,i,E}from'./chunk-G54QLYD2.js';export{P as Button,v as Card,D as Command,K as Popover,L as Spinner,i as Tooltip,f as TooltipArrow,h as TooltipProvider,d as TooltipRoot,e as TooltipTrigger,N as baseButtonStyle,O as buttonVariants,c as cn,g as tooltipVariants,b as tv,a as twMergeConfig,M as useDisableContentMenu}from'./chunk-G54QLYD2.js';import {a}from'./chunk-M7AD2PUT.js';import {Slot,Collapsible,ScrollArea,HoverCard,Portal}from'radix-ui';import*as I from'react';import I__default,{useRef,useState,useLayoutEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {CircleAlert,Copy,CheckCheck}from'lucide-react';import {m,AnimatePresence}from'motion/react';import {Drawer}from'vaul';import ro from'react-use-measure';var Qe=new WeakMap;function je(e){return((...t)=>{let r=Qe.get(e),o=t.map(String).join("_");if(r){let i=r.get(o);if(i)return i}else r=new Map,Qe.set(e,r);let a=e(...t);return r.set(o,a),a})}function na(e,t,r="zh-CN"){return new Intl.NumberFormat(r,t).format(e)}function ia(e,t,r="zh-CN"){return new Intl.NumberFormat(r,{style:"currency",...t}).format(e)}function sa(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",compactDisplay:"short"}).format(e)}var la=je((e,t=2)=>e.replace(/[.,!@#$%^&*()_+=\-`~[\]/\\{}:"|<>?]+/gi,"").trim().split(/\s+/).slice(0,t).map(r=>{if(!r.length)return "";if(/\s+/.test(e))return r.match(/./u)?.[0].toUpperCase();let o=new RegExp(".".repeat(t),"u"),a=r.match(o)?.[0];return a?a.charAt(0).toUpperCase()+a.slice(1):e.charAt(0).toUpperCase()+e.slice(1,2)}).join(""));function ma(e,t){return Array.isArray(t)?e.filter(r=>t.some(o=>o===r.value)):e.find(r=>r.value===t)}function ua(e){return Array.from(new Set(e))}function fa(e){return e.filter(mr)}function mr(e){return !!e}function ur(e,t){return t.reduce((r,o)=>(r[o]=e[o],r),{})}function ga(e,t){let r=new Set(t.map(String)),o=Object.keys(e).filter(a=>!r.has(a));return ur(e,o)}var ut={};a(ut,{AVATAR_ROOT_NAME:()=>rt,Badge:()=>mt,BrandLogo:()=>pt,Image:()=>De,Indicator:()=>st,Notification:()=>dt,Root:()=>it,Status:()=>ct,avatarRingVariants:()=>nt,avatarStatusVariants:()=>lt,avatarVariants:()=>be});function oe(e,t,r,o,a){let i=I__default.Children.map(e,(s,c)=>{if(!I__default.isValidElement(s))return s;let m=s.type?.displayName||"",l=r.includes(m)?t:{},f=s.props;return I__default.cloneElement(s,{...l,key:`${o}-${c}`},oe(f?.children,t,r,o,f?.asChild))});return a?i?.[0]:i}function et(e){let t=I.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 80",...e,children:[jsxs("g",{fill:"#fff",clipPath:`url(#${t})`,children:[jsx("ellipse",{cx:40,cy:78,fillOpacity:.72,rx:32,ry:24}),jsx("circle",{cx:40,cy:32,r:16,opacity:.9})]}),jsx("defs",{children:jsx("clipPath",{id:t,children:jsx("rect",{width:80,height:80,fill:"#fff",rx:40})})})]})}function tt(e){let t=I.useId(),r=I.useId(),o=I.useId();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:56,height:56,fill:"none",viewBox:"0 0 56 56",...e,children:[jsxs("g",{clipPath:`url(#${t})`,children:[jsx("rect",{width:56,height:56,className:"fill-bg-soft",rx:28}),jsx("path",{className:"fill-bg-soft",d:"M0 0h56v56H0z"}),jsx("g",{filter:`url(#${r})`,opacity:.48,children:jsx("path",{fill:"#fff",d:"M7 24.9a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 017 73.9v-49z"})}),jsx("path",{className:"fill-bg-soft",d:"M12.6 28.7a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"}),jsx("g",{filter:`url(#${o})`,children:jsx("path",{fill:"#fff",fillOpacity:.8,d:"M21 14a2.8 2.8 0 012.8-2.8h21a2.8 2.8 0 012.8 2.8v49a2.8 2.8 0 01-2.8 2.8h-21A2.8 2.8 0 0121 63V14z"})}),jsx("path",{className:"fill-bg-soft",d:"M26.6 17.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm9.8-29.4a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7V22a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2zm0 9.8a.7.7 0 01.7-.7h4.2a.7.7 0 01.7.7v4.2a.7.7 0 01-.7.7h-4.2a.7.7 0 01-.7-.7v-4.2z"})]}),jsxs("defs",{children:[jsxs("filter",{id:r,width:34.6,height:62.6,x:3,y:18.1,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:2}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"})]}),jsxs("filter",{id:o,width:42.6,height:70.6,x:13,y:3.2,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:4}),jsx("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_36237_4888"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_backgroundBlur_36237_4888",result:"shape"}),jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),jsx("feOffset",{dy:4}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",k2:-1,k3:1,operator:"arithmetic"}),jsx("feColorMatrix",{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsx("feBlend",{in2:"shape",result:"effect2_innerShadow_36237_4888"})]}),jsx("clipPath",{id:t,children:jsx("rect",{width:56,height:56,fill:"#fff",rx:28})})]})]})}var rt="AvatarRoot",ot="AvatarImage",at="AvatarIndicator",gr="AvatarStatus",vr="AvatarBrandLogo",hr="AvatarNotification",xr="AvatarBadge",Ve=Slot.Root,be=b({slots:{root:["relative flex shrink-0 items-center justify-center rounded-full","text-center uppercase select-none"],image:"size-full rounded-full object-cover",indicator:"absolute flex size-32 items-center justify-center drop-shadow-[0_2px_4px_#1b1c1d0a]"},variants:{withRing:{true:""},size:{80:{root:"size-80 text-title-h5"},72:{root:"size-72 text-title-h5"},64:{root:"size-64 text-title-h5"},56:{root:"size-56 text-label-lg"},48:{root:"size-48 text-label-lg"},42:{root:"size-42 text-label-md"},38:{root:"size-38 text-label-md"},32:{root:"size-32 text-label-sm"},24:{root:"size-24 text-label-xs"},20:{root:"size-20 text-label-xs"}},color:{gray:{root:"bg-bg-soft text-static-black/80"},yellow:{root:"bg-yellow-500 text-static-white"},blue:{root:"bg-blue-500 text-static-white"},sky:{root:"bg-sky-500 text-static-white"},purple:{root:"bg-purple-500 text-static-white"},red:{root:"bg-red-500 text-static-white"},green:{root:"bg-green-500 text-static-white"},teal:{root:"bg-teal-500 text-static-white"},violet:{root:"bg-violet-500 text-static-white"},pink:{root:"bg-pink-500 text-static-white"},orange:{root:"bg-orange-500 text-static-white"}}},compoundVariants:[{size:["80","72"],class:{indicator:"-right-8"}},{size:"64",class:{indicator:"-right-8 scale-[.875]"}},{size:"56",class:{indicator:"-right-6 scale-75"}},{size:"48",class:{indicator:"-right-6 scale-[.625]"}},{size:"42",class:{indicator:"-right-6 scale-[.5725]"}},{size:"38",class:{indicator:"-right-6 scale-[.5625]"}},{size:"32",class:{indicator:"-right-6 scale-50"}},{size:"24",class:{indicator:"-right-4 scale-[.375]"}},{size:"20",class:{indicator:"-right-4 scale-[.3125]"}},{withRing:true,size:"80",class:{indicator:"-right-12"}},{withRing:true,size:"72",class:{indicator:"-right-13"}},{withRing:true,size:"64",class:{indicator:"-right-12"}},{withRing:true,size:"56",class:{indicator:"-right-10"}},{withRing:true,size:["48","42","38","32"],class:{indicator:"-right-9"}},{withRing:true,size:["24","20"],class:{indicator:"-right-7"}}],defaultVariants:{size:"48",color:"gray"}}),nt=b({base:"ring-2 ring-offset-2",variants:{color:{gray:"ring-black/10",yellow:"ring-yellow-500",blue:"ring-blue-500",sky:"ring-sky-500",purple:"ring-purple-500",red:"ring-red-500",green:"ring-green-500",teal:"ring-teal-500",violet:"ring-violet-500",pink:"ring-pink-500",orange:"ring-orange-500",white:"ring-static-white",black:"ring-static-black"}},defaultVariants:{color:"gray"}}),De=I.forwardRef(({asChild:e,className:t,size:r,color:o,...a},i)=>{let s=e?Ve:"img",{image:c}=be({size:r,color:o});return jsx(s,{ref:i,className:c({class:t}),...a})});De.displayName=ot;var it=I.forwardRef(({asChild:e,children:t,size:r,color:o,ring:a,className:i,placeholderType:s="user",...c$1},m)=>{let l=I.useId(),f=e?Ve:"div",p=a?nt({color:a===true?o:typeof a=="string"?a:void 0}):void 0,{root:y}=be({size:r,color:o}),d=c(y(),p,i),h={size:r,color:o};if(!t)return jsx("div",{className:d,...c$1,children:jsx(De,{asChild:true,children:s==="company"?jsx(tt,{}):jsx(et,{})})});let x=oe(t,h,[ot,at],l,e);return jsx(f,{ref:m,className:d,...c$1,children:x})});it.displayName=rt;function st({size:e,color:t,className:r,position:o="bottom",withRing:a,...i}){let{indicator:s}=be({size:e,color:t,withRing:a});return jsx("div",{className:c(s({class:r}),{"top-0 origin-top-right":o==="top","bottom-0 origin-bottom-right":o==="bottom"}),...i})}st.displayName=at;var lt=b({base:"box-content size-12 rounded-full border-4 border-bg-white",variants:{status:{online:"bg-success-base",offline:"bg-gray-500",busy:"bg-error-base",away:"bg-away-base"}},defaultVariants:{status:"online"}});function ct({status:e,className:t,...r}){return jsx("div",{className:lt({status:e,class:t}),...r})}ct.displayName=gr;var pt=I.forwardRef(({asChild:e,className:t,...r},o)=>jsx(e?Ve:"img",{draggable:false,ref:o,className:c("box-content size-24 rounded-full border-2 border-bg-white",t),...r}));pt.displayName=vr;function dt({className:e,...t}){return jsx("div",{className:c("box-content size-12 rounded-full border-2 border-bg-white bg-error-base",e),...t})}dt.displayName=hr;function mt({className:e,...t}){return jsx("div",{className:c("box-content rounded-full border-2 border-bg-white bg-error-base px-6 text-static-white",e),...t})}mt.displayName=xr;function ne({className:e,variant:t="neutral",mode:r="stroke",size:o="small",...a}){return jsx(P,{variant:t,mode:r,size:o,className:c("absolute top-12 right-10 z-10 m-auto aspect-square rounded-full border-transparent text-text-soft hover:text-text-strong",e),...a,children:jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M10.4854 1.99998L2.00007 10.4853",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.4854 10.4844L2.00007 1.99908",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}var ke=b({slots:{root:"relative flex w-fit max-w-xl flex-col rounded-[12px] border border-stroke-soft p-0 text-md",content:"",arrowCls:"",header:"flex items-center pe-28 select-none",close:"rounded-full"},variants:{variant:{default:{root:"gap-8 bg-bg-white p-16 pt-12",close:"top-12 right-12 hover:bg-bg-weak"},accent:{root:"bg-bg-weak p-4",content:"rounded-[8px] bg-bg-white px-12 py-8 shadow-sm",header:"px-12 py-4 pb-6",close:"top-9 right-8 hover:bg-bg-white",arrowCls:"bg-bg-weak"}}},defaultVariants:{variant:"default"}});function br({variant:e,className:t,contentClassName:r,side:o="bottom",align:a="start",arrow:i=true,unstyled:s=true,closeable:c$1=true,sideOffset:m=1,title:l,content:f,children:p,asChild:y,defaultOpen:d,open:h,onOpenChange:x,onClose:w,...R}){let{root:u,content:C,header:g,close:N,arrowCls:P}=ke({variant:e}),[V,T]=I__default.useState(d??false),D=h!==void 0,S=D?h:V,W=I__default.useCallback(M=>{D||T(M),x?.(M);},[D,x]);return jsxs(F,{open:S,onOpenChange:W,children:[D&&S&&jsx(J,{}),jsx(G,{className:c(D&&S&&"relative z-20"),asChild:y,children:p}),jsxs(H,{className:u({className:t}),arrowClassName:P(),unstyled:s,side:o,align:a,sideOffset:m,arrow:i,...R,children:[l&&jsxs("header",{className:g(),children:[jsx("h4",{className:"text-16 m-0 leading-26 font-medium text-text-strong",children:l}),c$1&&jsx(I$1,{asChild:true,onClick:w,children:jsx(ne,{size:"xsmall",mode:"ghost",className:N({class:"size-24 p-0"})})})]}),jsx("div",{className:C({className:r}),children:f})]})]})}function Pr({variant:e="default",title:t,content:r,children:o,defaultOpen:a,className:i,side:s="top",align:c$1="center",sideOffset:m$1=1,arrow:l=true,open:f,contentClassName:p,onOpenChange:y,onConfirm:d,onCancel:h,...x}){let{root:w,content:R,header:u,arrowCls:C}=ke({variant:e}),[g,N]=I__default.useState(a??false),P$1=f!==void 0,V=P$1?f:g,T=I__default.useCallback(M=>{P$1||N(M),y?.(M);},[P$1,y]),[D,S]=I__default.useState(false),W=I__default.useCallback(async()=>{T(false);try{S(!0),await d?.();}catch{}finally{S(false);}},[T,d]);return jsxs(F,{open:V,onOpenChange:T,children:[jsx(AnimatePresence,{children:V&&jsx(J,{as:m.div,...k,className:"bg-black/5"})}),jsx(G,{className:c(V&&"relative z-20"),children:jsx("div",{className:"inline-flex items-center",children:I__default.isValidElement(o)?I__default.cloneElement(o,{loading:D}):o})}),jsxs(H,{className:w({className:c("max-w-lg",i)}),arrowClassName:C(),unstyled:true,side:s,align:c$1,sideOffset:m$1,arrow:l,...x,children:[t&&jsxs("header",{className:u({className:"gap-6"}),children:[jsx(CircleAlert,{className:"text-red-500",size:16}),jsx("h4",{className:"m-0 text-15 leading-26 font-medium text-text-strong",children:t})]}),jsxs("div",{className:R({className:p}),children:[r,jsxs("div",{className:"mt-8 flex justify-end gap-12",children:[jsx(I$1,{unstyled:true,onClick:h,asChild:true,children:jsx(P,{size:"xsmall",variant:"neutral",mode:"stroke",className:"h-26",children:"Cancel"})}),jsx(P,{size:"xsmall",mode:"stroke",className:"h-26",onClick:W,children:"Confirm"})]})]})]})]})}function vt({...e}){return jsx(Drawer.Root,{"data-slot":"drawer",...e})}function ht({...e}){return jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Tr({...e}){return jsx(Drawer.Portal,{"data-slot":"drawer-portal",...e})}function ze({...e}){return jsx(Drawer.Close,{"data-slot":"drawer-close",...e})}function Ir({className:e,...t}){return jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:c("fixed inset-0 z-50 bg-black/10 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0",e),...t})}var Sr={top:"inset-x-8 top-8 max-h-[80vh]",bottom:"inset-x-8 bottom-8 mt-96 max-h-[80vh]",left:"inset-y-8 left-8 w-3/5",right:"inset-y-8 right-8 w-3/5"};function xt({className:e,direction:t,children:r,...o}){let a=I.useRef({"--initial-transform":"calc(100% + 8px)"});return jsxs(Tr,{"data-slot":"drawer-portal",children:[jsx(Ir,{}),jsx(Drawer.Content,{"data-slot":"drawer-content",style:a.current,className:c("group/drawer-content fixed z-50 flex h-auto flex-col rounded-[12px] bg-static-white outline-none",t&&Sr[t],e),...o,children:r})]})}function yt({className:e,...t}){return jsx("div",{"data-slot":"drawer-header",className:c("flex flex-col px-16 py-12",e),...t})}function bt({className:e,...t}){return jsx("div",{"data-slot":"drawer-body",className:c("scrollbar-thin overflow-y-auto p-16 select-text",e),...t})}function Rt({className:e,...t}){return jsx("div",{"data-slot":"drawer-footer",className:c("mt-auto flex flex-col gap-8 px-16 py-18",e),...t})}function Ct({className:e,...t}){return jsx(Drawer.Title,{"data-slot":"drawer-title",className:c("m-0 text-xl leading-32 font-medium text-text-strong",e),...t})}function wt({className:e,...t}){return jsx(Drawer.Description,{"data-slot":"drawer-description",className:c("m-0 text-md text-text-sub",e),...t})}function Vr({direction:e="right",dismissible:t=true,skeletonItemCount:r=5,className:o,footerClassName:a,bodyClassName:i,headerClassName:s,title:c$1="Title",description:m,footer:l,trigger:f,container:p,children:y,open:d,onOpenChange:h,loading:x,handleOnly:w=true,style:R,width:u,onClose:C,onOk:g,...N}){let P$1=Q(),V=I__default.useRef({...R,width:u}),[T,D]=I__default.useState(false),[S,W]=I__default.useState(false),M=d!==void 0,er=M?d:T,te=I__default.useCallback(q=>{!q&&S||(M||D(q),h?.(q));},[M,h,S]),tr=I__default.useCallback(async()=>{if(!g){te(false);return}let q=g();if(q instanceof Promise){W(true);try{await q,te(!1);}catch{}finally{W(false);}}else te(false);},[g,te]),re=!S&&t;return jsxs(vt,{container:p,direction:e,dismissible:re,handleOnly:w,autoFocus:true,open:er,onOpenChange:te,...N,children:[f&&jsx(ht,{asChild:true,children:f}),jsxs(xt,{direction:e,className:c(p&&p!==document.body&&"absolute",o),style:V.current,children:[t&&jsx(ze,{asChild:true,children:jsx(ne,{disabled:!re})}),t===false&&jsx(ne,{disabled:!re,onClick:C}),jsxs(yt,{className:c("border-b border-b-stroke-antd",s),children:[jsx(Ct,{className:"pe-42",asChild:true,children:typeof c$1=="string"?jsx("h3",{children:c$1}):jsx("div",{children:c$1})}),jsx(wt,{className:c(!m&&"sr-only"),children:m})]}),jsxs(bt,{className:i,children:[x&&jsx(Dr,{count:r}),!x&&y]}),jsxs(Rt,{className:c("flex-row border-t border-t-stroke-antd",a),children:[l,!l&&jsxs(Fragment,{children:[t&&jsx(ze,{asChild:true,children:jsx(P,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!re,children:P$1("close")})}),t===false&&jsx(P,{variant:"neutral",mode:"stroke",className:"w-2/5",disabled:!re,onClick:C,children:P$1("close")}),jsx(P,{variant:"neutral",mode:"filled",className:"w-3/5",loading:x||S,onClick:tr,children:P$1("ok")})]})]})]})]})}function Dr({count:e=5}){let t=Array.from({length:e});return jsxs("div",{className:"flex flex-col gap-16",children:[jsxs("div",{className:"flex flex-row items-center gap-12",children:[jsx(o,{className:"size-58 rounded-2xl"}),jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsx(o,{className:"mb-4 h-14 w-3/10"}),jsx(o,{className:"h-10 w-7/10"}),jsx(o,{className:"h-10 w-9/10"})]})]}),t.map((r,o$1)=>jsxs("div",{className:"flex flex-col gap-8",children:[jsx(o,{className:"h-12 w-5/10"}),jsx(o,{className:"h-12 w-7/10"}),jsx(o,{className:"h-12 w-full"})]},o$1))]})}function Ur(e){let[t,r]=I__default.useState(false),[o,a]=I__default.useState(null),i=I__default.useCallback(l=>{a(l),r(true);},[]),s=I__default.useCallback(()=>{r(false),a(null);},[]),c=I__default.useCallback(l=>{r(l),l||a(null);},[]);return [{...e,open:t,onOpenChange:c,onClose:s},o,i,s]}var Pt=async e=>{if(!e)return;if(navigator.clipboard){await navigator.clipboard.writeText(e);return}let t=document.createElement("textarea");t.setAttribute("readonly",""),t.tabIndex=-1,t.style.position="fixed",t.style.left="-9999px",t.value=e,document.body.appendChild(t);let r=document.getSelection();if(r){let o=r.rangeCount>0&&r.getRangeAt(0);t.select(),document.execCommand("copy"),o&&(r.removeAllRanges(),r.addRange(o));}document.body.removeChild(t);};var zr={initial:{scale:.5,opacity:0,filter:"blur(2px)"},animate:{scale:1,opacity:1,filter:"blur(0px)"},exit:{scale:.5,opacity:0,filter:"blur(2px)"}},Or={opacity:{duration:.25},filter:{duration:.25},scale:{duration:.35,ease:[.34,1.56,.64,1]}},Mr={variants:zr,initial:"initial",animate:"animate",exit:"exit",transition:Or};function Oe({initial:e=false,state:t,states:r,asDiv:o,className:a,style:i,...s}){let c$1=o?m.div:m.span;return jsx(AnimatePresence,{initial:e,mode:"popLayout",children:jsx(c$1,{className:c("inline-flex items-center justify-center",a),...Mr,style:i,...s,children:r[t]},t)})}function Me({swap:e,on:t,off:r,className:o}){return jsx(Oe,{state:e?"on":"off",states:{on:t,off:r},className:o})}function Hr({content:e,delay:t=700,tooltipDelayDuration:r=700,variant:o="neutral",mode:a="stroke",size:i$1="small",as:s="button",children:c$1,onCopy:m,className:l}){let f=Q(),[p,y]=I__default.useState(false),[d,h]=I__default.useState(false),[x,w]=I__default.useState(false),R=I__default.useRef(null),u=I__default.useRef(null);I__default.useEffect(()=>()=>{R.current&&clearTimeout(R.current),u.current&&clearTimeout(u.current);},[]);let C=I__default.useCallback(async()=>{p||(y(true),w(true),await Pt(e),m?.(e),R.current=setTimeout(()=>{w(false),u.current=setTimeout(()=>y(false),150);},t));},[p,t,e,m]),g=jsx(Me,{swap:p,on:jsx(CheckCheck,{width:"1em",height:"1em"}),off:jsx(Copy,{width:"1em",height:"1em"})}),N=(()=>{switch(s){case "text":return jsx("span",{className:c("relative cursor-pointer before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",l),onClick:C,children:jsx("span",{className:"relative z-1",children:c$1??e})});case "inline":return jsxs("span",{className:c("relative inline-flex cursor-pointer items-center gap-6 before:absolute before:-inset-x-4 before:-inset-y-1 before:rounded-md hover:before:bg-bg-antd",l),onClick:C,children:[jsx("span",{className:"relative z-1",children:c$1??e}),jsx("span",{className:c("inline-flex items-center text-zinc-500",p&&"text-primary-base"),children:g})]});default:return jsx(P,{variant:o,mode:a,size:i$1,className:c(p&&"cursor-not-allowed",l),onClick:C,startContent:g})}})();return jsx(i,{content:f(p?"copied":"copy"),size:i$1,open:x||d,delayDuration:r,onOpenChange:h,hideWhenDetached:true,children:N})}var Kr=b({base:"flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset",variants:{variant:{filled:"text-static-white",lighter:"",outline:"ring-current"},ring:{true:""},color:{neutral:"",slate:"",red:"",orange:"",amber:"",yellow:"",lime:"",green:"",emerald:"",teal:"",cyan:"",sky:"",blue:"",indigo:"",violet:"",purple:"",fuchsia:"",pink:"",rose:""}},compoundVariants:[{variant:"filled",color:"neutral",class:"bg-black/90"},{variant:"filled",color:"slate",class:"bg-slate-500"},{variant:"filled",color:"red",class:"bg-red-500"},{variant:"filled",color:"orange",class:"bg-orange-500"},{variant:"filled",color:"amber",class:"bg-amber-500"},{variant:"filled",color:"yellow",class:"bg-yellow-500"},{variant:"filled",color:"lime",class:"bg-lime-500"},{variant:"filled",color:"green",class:"bg-green-500"},{variant:"filled",color:"emerald",class:"bg-emerald-500"},{variant:"filled",color:"teal",class:"bg-teal-500"},{variant:"filled",color:"cyan",class:"bg-cyan-500"},{variant:"filled",color:"sky",class:"bg-sky-500"},{variant:"filled",color:"blue",class:"bg-blue-500"},{variant:"filled",color:"indigo",class:"bg-indigo-500"},{variant:"filled",color:"violet",class:"bg-violet-500"},{variant:"filled",color:"purple",class:"bg-purple-500"},{variant:"filled",color:"fuchsia",class:"bg-fuchsia-500"},{variant:"filled",color:"pink",class:"bg-pink-500"},{variant:"filled",color:"rose",class:"bg-rose-500"},{variant:"filled",ring:true,color:"neutral",class:"ring-neutral-700"},{variant:"filled",ring:true,color:"slate",class:"ring-slate-600"},{variant:"filled",ring:true,color:"red",class:"ring-red-700"},{variant:"filled",ring:true,color:"orange",class:"ring-orange-600"},{variant:"filled",ring:true,color:"amber",class:"ring-amber-600"},{variant:"filled",ring:true,color:"yellow",class:"ring-yellow-600"},{variant:"filled",ring:true,color:"lime",class:"ring-lime-600"},{variant:"filled",ring:true,color:"green",class:"ring-green-600"},{variant:"filled",ring:true,color:"emerald",class:"ring-emerald-600"},{variant:"filled",ring:true,color:"teal",class:"ring-teal-600"},{variant:"filled",ring:true,color:"cyan",class:"ring-cyan-600"},{variant:"filled",ring:true,color:"sky",class:"ring-sky-600"},{variant:"filled",ring:true,color:"blue",class:"ring-blue-700"},{variant:"filled",ring:true,color:"indigo",class:"ring-indigo-600"},{variant:"filled",ring:true,color:"violet",class:"ring-violet-600"},{variant:"filled",ring:true,color:"purple",class:"ring-purple-600"},{variant:"filled",ring:true,color:"fuchsia",class:"ring-fuchsia-600"},{variant:"filled",ring:true,color:"pink",class:"ring-pink-600"},{variant:"filled",ring:true,color:"rose",class:"ring-rose-600"},{variant:"lighter",color:"neutral",class:"bg-neutral-100 text-neutral-600"},{variant:"lighter",color:"slate",class:"bg-slate-100 text-slate-500"},{variant:"lighter",color:"red",class:"bg-red-50 text-red-500"},{variant:"lighter",color:"orange",class:"bg-orange-50 text-orange-500"},{variant:"lighter",color:"amber",class:"bg-amber-50 text-amber-500"},{variant:"lighter",color:"yellow",class:"bg-yellow-50 text-yellow-500"},{variant:"lighter",color:"lime",class:"bg-lime-50 text-lime-500"},{variant:"lighter",color:"green",class:"bg-green-50 text-green-500"},{variant:"lighter",color:"emerald",class:"bg-emerald-50 text-emerald-500"},{variant:"lighter",color:"teal",class:"bg-teal-50 text-teal-500"},{variant:"lighter",color:"cyan",class:"bg-cyan-50 text-cyan-500"},{variant:"lighter",color:"sky",class:"bg-sky-50 text-sky-500"},{variant:"lighter",color:"blue",class:"bg-blue-50 text-blue-500"},{variant:"lighter",color:"indigo",class:"bg-indigo-50 text-indigo-500"},{variant:"lighter",color:"violet",class:"bg-violet-50 text-violet-500"},{variant:"lighter",color:"purple",class:"bg-purple-50 text-purple-500"},{variant:"lighter",color:"fuchsia",class:"bg-fuchsia-50 text-fuchsia-500"},{variant:"lighter",color:"pink",class:"bg-pink-50 text-pink-500"},{variant:"lighter",color:"rose",class:"bg-rose-50 text-rose-500"},{variant:["lighter","outline"],ring:true,color:"neutral",class:"ring-neutral-200"},{variant:["lighter","outline"],ring:true,color:"slate",class:"ring-slate-200"},{variant:["lighter","outline"],ring:true,color:"red",class:"ring-red-200"},{variant:["lighter","outline"],ring:true,color:"orange",class:"ring-orange-200"},{variant:["lighter","outline"],ring:true,color:"amber",class:"ring-amber-200"},{variant:["lighter","outline"],ring:true,color:"yellow",class:"ring-yellow-200"},{variant:["lighter","outline"],ring:true,color:"lime",class:"ring-lime-200"},{variant:["lighter","outline"],ring:true,color:"green",class:"ring-green-200"},{variant:["lighter","outline"],ring:true,color:"emerald",class:"ring-emerald-200"},{variant:["lighter","outline"],ring:true,color:"teal",class:"ring-teal-200"},{variant:["lighter","outline"],ring:true,color:"cyan",class:"ring-cyan-200"},{variant:["lighter","outline"],ring:true,color:"sky",class:"ring-sky-200"},{variant:["lighter","outline"],ring:true,color:"blue",class:"ring-blue-200"},{variant:["lighter","outline"],ring:true,color:"indigo",class:"ring-indigo-200"},{variant:["lighter","outline"],ring:true,color:"violet",class:"ring-violet-200"},{variant:["lighter","outline"],ring:true,color:"purple",class:"ring-purple-200"},{variant:["lighter","outline"],ring:true,color:"fuchsia",class:"ring-fuchsia-200"},{variant:["lighter","outline"],ring:true,color:"pink",class:"ring-pink-200"},{variant:["lighter","outline"],ring:true,color:"rose",class:"ring-rose-200"},{variant:"outline",color:"neutral",class:"text-neutral-500"},{variant:"outline",color:"slate",class:"text-slate-400"},{variant:"outline",color:"red",class:"text-red-500"},{variant:"outline",color:"orange",class:"text-orange-500"},{variant:"outline",color:"amber",class:"text-amber-500"},{variant:"outline",color:"yellow",class:"text-yellow-500"},{variant:"outline",color:"lime",class:"text-lime-500"},{variant:"outline",color:"green",class:"text-green-500"},{variant:"outline",color:"emerald",class:"text-emerald-500"},{variant:"outline",color:"teal",class:"text-teal-500"},{variant:"outline",color:"cyan",class:"text-cyan-500"},{variant:"outline",color:"sky",class:"text-sky-500"},{variant:"outline",color:"blue",class:"text-blue-500"},{variant:"outline",color:"indigo",class:"text-indigo-500"},{variant:"outline",color:"violet",class:"text-violet-500"},{variant:"outline",color:"purple",class:"text-purple-500"},{variant:"outline",color:"fuchsia",class:"text-fuchsia-500"},{variant:"outline",color:"pink",class:"text-pink-500"},{variant:"outline",color:"rose",class:"text-rose-500"}],defaultVariants:{variant:"outline",color:"slate"}});function In({asChild:e,children:t,className:r,color:o,variant:a,ring:i,...s}){let c=e?Slot.Root:"div",m=Kr({variant:a,color:o,ring:i,className:r});return jsx(c,{className:m,...s,children:t})}function Dn({...e}){return jsx(Collapsible.Root,{"data-slot":"collapsible",...e})}function En({...e}){return jsx(Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Un({className:e,...t}){return jsx(Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",className:c("collapsible-content",e),...t})}var qr="BadgeRoot",Nt="BadgeIcon",At="BadgeDot",_e=b({slots:{root:"inline-flex w-fit appearance-none items-center justify-center border-none leading-none font-medium whitespace-nowrap transition duration-200 ease-out select-none",icon:"uicon shrink-0",dot:["uidot flex items-center justify-center","before:size-4 before:rounded-full before:bg-current"]},variants:{size:{medium:{root:"h-24 gap-4 px-10 text-md has-[>.uicon]:gap-6 has-[>.uidot]:gap-4",icon:"-mx-2 size-14",dot:"-mx-4 size-16 before:size-6"},small:{root:"h-20 gap-4 px-8 text-sm has-[>.uicon]:gap-4 has-[>.uidot]:gap-3",icon:"-mx-px size-12",dot:"-mx-4 size-16 before:size-5"},xsmall:{root:"h-16 gap-3 px-7 text-xs has-[>.uicon]:gap-4 has-[>.uidot]:gap-4",icon:"-mx-px size-10",dot:"-mx-5 size-16"}},variant:{filled:{root:"text-static-white"},outline:{root:"ring-1 ring-current ring-inset"},lighter:"",ghost:""},color:{primary:"",info:"",success:"",warning:"",error:"",neutral:""},shape:{default:"",circle:{root:"rounded-full"}},disabled:{true:{root:"cursor-not-allowed opacity-75"}}},compoundVariants:[{shape:"default",size:"xsmall",class:{root:"rounded-[3px] px-5"}},{shape:"default",size:"small",class:{root:"rounded-[4px] px-6"}},{shape:"default",size:"medium",class:{root:"rounded-lg px-7",icon:"ms-0"}},{variant:"filled",color:"primary",class:{root:"bg-primary-base"}},{variant:"filled",color:"info",class:{root:"bg-cyan-500"}},{variant:"filled",color:"success",class:{root:"bg-emerald-500"}},{variant:"filled",color:"warning",class:{root:"bg-orange-500"}},{variant:"filled",color:"error",class:{root:"bg-red-600"}},{variant:"filled",color:"neutral",class:{root:"bg-black/90"}},{variant:"outline",color:"primary",class:{root:"text-primary-base"}},{variant:"outline",color:"info",class:{root:"text-cyan-600"}},{variant:"outline",color:"success",class:{root:"text-emerald-500"}},{variant:"outline",color:"warning",class:{root:"text-orange-500"}},{variant:"outline",color:"error",class:{root:"text-red-600"}},{variant:"outline",color:"neutral",class:{root:"text-neutral-600 ring-neutral-200"}},{variant:"lighter",color:"primary",class:{root:"bg-blue-50 text-primary-base"}},{variant:"lighter",color:"info",class:{root:"bg-cyan-50 text-cyan-600"}},{variant:"lighter",color:"success",class:{root:"bg-emerald-50 text-emerald-600"}},{variant:"lighter",color:"warning",class:{root:"bg-orange-50 text-orange-600"}},{variant:"lighter",color:"error",class:{root:"bg-red-50 text-red-600"}},{variant:"lighter",color:"neutral",class:{root:"bg-neutral-100 text-neutral-600"}},{variant:"ghost",color:"primary",class:{root:"text-primary-base"}},{variant:"ghost",color:"info",class:{root:"text-cyan-600"}},{variant:"ghost",color:"success",class:{root:"text-emerald-600"}},{variant:"ghost",color:"warning",class:{root:"text-orange-600"}},{variant:"ghost",color:"error",class:{root:"text-red-600"}},{variant:"ghost",color:"neutral",class:{root:"text-neutral-600"}}],defaultVariants:{variant:"filled",color:"primary",size:"medium",shape:"default"}}),Vt=({asChild:e,size:t,variant:r,color:o,shape:a,children:i,className:s,disabled:c,...m})=>{let l=I.useId(),f=e?Slot.Root:"div",{root:p}=_e({variant:r,color:o,size:t,shape:a,disabled:c}),d=oe(i,{size:t,variant:r,color:o},[Nt,At],l,e);return jsx(f,{"data-slot":"badge",className:p({class:s}),...m,children:d})};Vt.displayName=qr;function Dt({className:e,size:t,variant:r,color:o,as:a,...i}){let s=a||"div",{icon:c}=_e({size:t,variant:r,color:o});return jsx(s,{"data-slot":"icon",className:c({class:e}),...i})}Dt.displayName=Nt;function Et({size:e,variant:t,color:r,className:o,...a}){let{dot:i}=_e({size:e,variant:t,color:r});return jsx("div",{"data-slot":"dot",className:i({class:o}),...a})}Et.displayName=At;function Ln({icon:e,dot:t,children:r,asChild:o,...a}){return jsxs(Vt,{asChild:o,...a,children:[e&&!o&&jsx(Dt,{as:e}),t&&!o&&jsx(Et,{}),r]})}function Zr({className:e,scrollBarClassName:t,children:r,...o}){return jsxs(ScrollArea.Root,{"data-slot":"scroll-area",className:c("relative",e),...o,children:[jsx(ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-primary-base focus-visible:outline-1",children:r}),jsx(Ut,{orientation:"vertical",className:t}),jsx(Ut,{orientation:"horizontal",className:t}),jsx(ScrollArea.Corner,{})]})}function Ut({className:e,orientation:t="vertical",...r}){return jsx(ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:c("flex touch-none p-2 transition-colors select-none data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-10 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",e),...r,children:jsx(ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-stroke-sub"})})}function Jr({open:e,defaultOpen:t,openDelay:r=300,closeDelay:o,asChild:a=true,arrow:i=true,content:s,children:c,onOpenChange:m,...l}){return jsxs(Qr,{"data-slot":"hover-card",open:e,defaultOpen:t,openDelay:r,closeDelay:o,onOpenChange:m,children:[jsx(jr,{asChild:a,children:c}),jsxs(eo,{...l,children:[s,i&&jsx(HoverCard.Arrow,{asChild:true,children:jsx(E,{className:"-translate-y-6.5"})})]})]})}function Qr({...e}){return jsx(HoverCard.Root,{"data-slot":"hover-card",...e})}function jr({...e}){return jsx(HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function eo({className:e,align:t="center",sideOffset:r=4,collisionPadding:o=16,...a}){return jsx(HoverCard.Portal,{"data-slot":"hover-card-portal",children:jsx(HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:r,collisionPadding:o,className:c("z-50 rounded-2xl bg-bg-white px-10 py-6 text-md text-text-strong shadow-regular-md ring-1 ring-stroke-soft outline-hidden duration-100 ring-inset","origin-(--radix-hover-card-content-transform-origin) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...a})})}var oo={initial:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},exit:{opacity:0,scale:.96,y:4,filter:"blur(2px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"}},ao={type:"spring",bounce:.1,duration:.25},no={ease:[.26,.08,.25,1],duration:.27};function io({activeKey:e,children:t,className:r,rootClassName:o,defaultCardHeight:a,initialKey:i,variants:s=oo,transition:c=no,rootTransition:m$1=ao}){let[l,{height:f}]=ro(),p=I.useRef(a??0);f>0&&(p.current=f);let y=e===i?a:f||p.current;return jsx(a$1,{children:jsx(m.div,{"data-slot":"animation-root",className:o,initial:false,animate:{height:y},transition:m$1,children:jsx("div",{ref:l,"data-slot":"animation-container",children:jsx(AnimatePresence,{mode:"popLayout",initial:false,children:jsx(m.div,{"data-slot":"animation-page",variants:s,transition:c,initial:"initial",animate:"animate",exit:"exit",className:r,children:t},e)})})})})}function $(e,t){let r=I.useRef(void 0),{current:o}=r;return I.useEffect(()=>{(!t||e!==void 0)&&(r.current=e);},[e,t]),o}var co={type:"tween",duration:.3,ease:[.25,1,.5,1]},po={type:"tween",duration:.38,ease:[.25,1,.5,1]},Ce={type:"spring",stiffness:260,damping:30},mo={type:"tween",duration:.35,ease:"easeIn"},uo={type:"tween",duration:.35,ease:"easeOut"},fo={type:"tween",duration:.35,ease:"linear"},j={type:"tween",duration:.25,ease:"easeInOut"},Ge=[.25,.1,.25,1],_t=1.12,go=.93,we={type:"tween",duration:.22,ease:Ge},vo={scale:{type:"tween",duration:.22,ease:Ge},opacity:{type:"tween",duration:.16,ease:Ge}},ho={type:"spring",stiffness:260,damping:30},xo=.7,yo=.9,Ht="bg-white";function Ft(e){return e?xo:yo}function Fe(e,t){return e==="x"?{x:t}:{y:t}}function Gt(e,t=co){return {supportsDimmed:false,variants:{enterFrom:({direction:r})=>({...Fe(e,r===0?0:r>0?"100%":"-100%"),zIndex:1,transition:t}),active:{...Fe(e,0),zIndex:1,transition:t},exit:({direction:r})=>({...Fe(e,r<0?"100%":"-100%"),zIndex:0,transition:t})}}}function bo(){return {supportsDimmed:true,variants:{enterFrom:({direction:e,dimmed:t})=>e===0?{x:0,opacity:1,transition:Ce}:{x:e>0?"100%":"-20%",opacity:e>0?1:Ft(t),zIndex:1,transition:Ce},active:{x:0,opacity:1,zIndex:1,transition:Ce},exit:({direction:e,dimmed:t})=>({x:e<0?"100%":"-20%",opacity:e<0?1:Ft(t),zIndex:e<0?5:0,transition:Ce})}}}function Ro(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>({clipPath:e>0?"inset(0 100% 0 0)":"inset(0 0 0 0)",zIndex:1}),active:({direction:e})=>({clipPath:"inset(0 0 0 0)",zIndex:1,transition:e>0?mo:void 0}),exit:({direction:e})=>e<0?{clipPath:"inset(0 100% 0 0)",zIndex:2,transition:uo}:{opacity:.999,zIndex:0,transition:fo}}}}function Co(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{x:0,scale:1,opacity:1,zIndex:1,transition:j}:e>0?{x:"200%",opacity:1,zIndex:2,transition:j}:{scale:.7,opacity:0,zIndex:0,transition:j},active:{x:0,scale:1,opacity:1,zIndex:1,transition:j},exit:({direction:e})=>e<0?{x:"200%",opacity:1,zIndex:2,transition:j}:{x:0,scale:.7,opacity:0,zIndex:0,transition:j}}}}function wo(){return {supportsDimmed:false,variants:{enterFrom:({direction:e})=>e===0?{scale:1,opacity:1,zIndex:1,transition:we}:{scale:e>0?_t:go,opacity:0,zIndex:e>0?1:0,transition:we},active:{scale:1,opacity:1,zIndex:1,transition:we},exit:({direction:e})=>e<0?{scale:_t,opacity:0,zIndex:2,transition:vo}:{scale:1,opacity:0,zIndex:0,transition:we}}}}var $t={slide:Gt("x"),slideVertical:Gt("y",po),slideLayers:bo(),reveal:Ro(),pushSlide:Co(),zoomFade:wo()};function Pe(e,t){let r=$t[e.animation].variants[t];return typeof r=="function"?r(e,{},{}):r}var Po={enterFrom:e=>Pe(e,"enterFrom"),active:e=>Pe(e,"active"),exit:e=>Pe(e,"exit")};function Wt({activeKey:e,animation:t="slideLayers",dimmed:r=true,lockPointerDuringTransition:o=true,className:a,viewClassName:i,children:s},c$1){let m$1=$(e),l=m$1!==void 0&&e!==m$1,f=l?e>m$1?1:-1:0,p=useRef(null),[y,d]=useState(false),h=$t[t],x={animation:t,direction:f,dimmed:!!(r&&h.supportsDimmed)},w=Pe(x,"active"),R=typeof w=="string"?w:{...w,transition:{duration:0}},u=useRef(new Map),[C,g]=ro(),[N,P]=useState(void 0);useLayoutEffect(()=>{if(!g.height)return;let T=u.current.get(e);(!T||Math.abs(T-g.height)>1)&&(u.current.set(e,g.height),P(g.height));},[g.height,e]),useLayoutEffect(()=>{let T=u.current.get(e);T&&P(T);},[e]),useLayoutEffect(()=>{if(!o){p.current=null,d(false);return}l&&(p.current=e,d(true));},[e,l,o]);let V=I__default.useCallback(T=>{p.current===T&&(p.current=null,d(false));},[d]);return jsx(a$1,{children:jsxs(m.div,{"data-slot":"ui-transition-root",ref:c$1,className:c("relative w-full overflow-hidden",x.dimmed&&"bg-black",y&&"pointer-events-none",a),initial:false,animate:{height:N},style:{height:N},transition:ho,children:[!u.current.has(e)&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0",children:jsx("div",{ref:C,className:c(Ht,i),children:s})}),jsx(AnimatePresence,{initial:false,custom:x,mode:"sync",children:jsx(m.div,{"data-slot":"ui-transition-item",custom:x,variants:Po,initial:f===0?false:"enterFrom",animate:l?"active":R,exit:"exit",onAnimationComplete:()=>V(e),className:c("absolute inset-0 size-full",Ht,i),children:s},e)})]})})}Wt.displayName="UIViewTransition";var Ke=I__default.forwardRef(Wt);function Yt(e,t){let r=$(e);I.useEffect(()=>{t&&!r&&e?Io(t):t&&!e&&r&&qt(t);},[t,e,r]),I.useEffect(()=>()=>{t&&e&&qt(t);},[t,e]);}function Io(e){if(e){let r=e.clientHeight,o=(r-24)/r;e.style.overflow="hidden",e.style.willChange="transform",e.style.transition="transform 250ms linear",e.style.transform=`translateY(calc(env(safe-area-inset-top, 0) - 24px)) scale(${o})`;}}function qt(e){function t(){e.style.removeProperty("overflow"),e.style.removeProperty("will-change"),e.style.removeProperty("transition"),e.removeEventListener("transitionend",t);}e&&(e.style.removeProperty("transform"),e.addEventListener("transitionend",t));}var No={variants:{initial:{opacity:0},animate:{opacity:.05},exit:{opacity:0}},initial:"initial",animate:"animate",exit:"exit"},Ao={initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24}},Vo={variants:Ao,initial:"initial",animate:"animate",exit:"exit"},Do={duration:.3,delay:.35},Eo={variants:{initial:{borderRadius:24,opacity:0},exit:{borderRadius:24,opacity:0},animate:{borderRadius:24,opacity:1}},initial:"initial",animate:"animate",exit:"exit"},Uo=100,ko=300,zo={width:440,height:680};function We(e){return typeof e=="number"?`${e}px`:e}function Oo({open:e,loading:t,visual:r$1,backgroundViewRef:o,children:a,className:i,containerClassName:s,defaultSize:c$1=Uo,expandedSize:m$1=zo,onCloseComplete:l,onContentAnimationComplete:f,onExpandedChangeComplete:p}){let[y,d]=I.useState(!!e),[h,x,w]=r(false),R=I.useRef(false),u=I.useRef(null),C=I.useRef(false),g=I.useRef(null),N=I.useRef({"--modal-size":We(c$1),"--modal-expanded-width":We(m$1.width),"--modal-expanded-height":We(m$1.height)});Yt(!!(e&&h&&o?.current),o?.current);let P=I.useCallback(()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{g.current=null,d(false);},ko);},[]),V=I.useCallback(()=>{u.current!==null&&(p?.(u.current),u.current=null),R.current&&(R.current=false,P());},[p,P]),T=I.useCallback(()=>{C.current&&(C.current=false,l?.());},[l]),D=I.useCallback(S=>{if(S==="animate"){f?.("entered");return}S==="exit"&&f?.("exited");},[f]);return I.useEffect(()=>{e&&(g.current&&(clearTimeout(g.current),g.current=null),R.current=false,C.current=false,d(true));},[e]),I.useEffect(()=>{if(y){if(e){if(t){h&&(u.current=false),w();return}h||(u.current=true),x();return}if(C.current=true,!R.current){if(h){u.current=false,R.current=true,w();return}P();}}},[w,h,t,e,y,P,x]),I.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),jsx(a$1,{children:jsx(AnimatePresence,{onExitComplete:T,children:y&&jsxs(Portal.Root,{style:N.current,"data-slot":"ui-modal-root",children:[jsx(m.div,{"data-slot":"ui-modal-backdrop",className:"fixed inset-0 z-10 bg-black",...No}),jsxs(m.div,{layout:true,"data-slot":"ui-modal-container","data-state":h&&"expanded",className:c("flex flex-col items-center justify-start bg-white p-16 ring-1 ring-stone-950/6","fixed top-1/2 left-1/2 z-20 -translate-x-1/2 -translate-y-1/2","h-(--modal-size) w-(--modal-size)","data-[state=expanded]:h-(--modal-expanded-height) data-[state=expanded]:w-(--modal-expanded-width)",s),onLayoutAnimationComplete:V,...Eo,children:[jsx(m.div,{"data-slot":"ui-modal-visual",layout:true,children:r$1}),jsx(AnimatePresence,{children:h&&jsx(m.div,{"data-slot":"ui-modal-content",onAnimationComplete:D,...Vo,transition:Do,className:c("flex w-full flex-col overflow-hidden",i),children:a},"content")})]})]})})})}var Jt=I__default.createContext(null);function Mo(){let e=I__default.useContext(Jt);if(!e)throw new Error("useUIScreen must be used within <UIScreen>");return e}function Ye({value:e,animation:t,className:r,children:o}){return jsx(Fragment,{children:o})}Ye.displayName="UIScreen.View";function Bo(e){return I__default.isValidElement(e)&&e.type===Ye}function Qt(e,t=[]){return I__default.Children.forEach(e,r=>{if(I__default.isValidElement(r)&&r.type===I__default.Fragment){Qt(r.props.children,t);return}if(!Bo(r))return;let o=r.props.value,a=Array.isArray(o)?Array.from(o):[o];t.push({values:a,animation:r.props.animation,className:r.props.className,activeKey:t.length,children:r.props.children});}),t}function Lo(e){let t=new Set;e.forEach(({values:r})=>{if(!r.length)throw new Error("UIScreen.View value must not be an empty array.");r.forEach(o=>{if(t.has(o))throw new Error(`Duplicate UIScreen.View value "${String(o)}".`);t.add(o);});});}function jt({screen:e,defaultScreen:t,onScreenChange:r,children:o,...a},i){let s=e!==void 0,[c$1,m]=I__default.useState(t),l=e??c$1,f=$(l),p=I__default.useRef(null),y=Qt(o);if(!y.length)throw new Error("UIScreen requires at least one UIScreen.View child.");if(e!==void 0&&t!==void 0)throw new Error("UIScreen accepts either screen or defaultScreen, but not both.");if(l===void 0)throw new Error("UIScreen requires either a screen or defaultScreen prop.");let d=l;Lo(y);let h=y.find(u=>u.values.includes(d));if(!h)throw new Error(`UIScreen could not find a UIScreen.View matching screen "${String(d)}".`);let x=p.current,w=x!==null&&f===x.from&&d===x.to;I__default.useLayoutEffect(()=>{let u=p.current;u&&d!==u.from&&(p.current=null);},[d]);let R=I__default.useMemo(()=>({screen:d,navigate:(u,C)=>{let g=C?.animation;p.current=u!==d&&g?{from:d,to:u,animation:g}:null,s||m(u),r?.(u);}}),[s,r,d]);return jsx(Jt.Provider,{value:R,children:jsx(Ke,{ref:i,...a,animation:(w?x.animation:h.animation)??a.animation,viewClassName:c(a.viewClassName,h.className),activeKey:h.activeKey,children:h.children})})}jt.displayName="UIScreen";var _o=I__default.forwardRef(jt),Ho=Object.assign(_o,{View:Ye});var Go=()=>{let[,e]=I.useState(false);return I.useCallback(()=>{e(t=>!t);},[])};var Ko=(e=false)=>{let[t,r]=I.useState(e),o=I.useCallback(()=>{r(a=>!a);},[]);return [t,o]};
2
+ export{io as AnimationCard,ut as Avatar,Ln as Badge,Dn as Collapsible,Un as CollapsibleContent,En as CollapsibleTrigger,In as ColorPanel,Hr as CopyableText,Vr as Drawer,Jr as HoverCard,Pr as PopConfirm,br as PopoverPreset,Zr as ScrollArea,Oe as StateSwitcher,Me as Swap,Oo as UIMorphingModal,Ho as UIScreen,Ke as UIViewTransition,fa as compact,ma as findOption,ia as formatCurrency,sa as formatIntegerCompact,na as formatNumber,la as getFirstLetters,ga as omit,ur as pick,ua as unique,Ur as useDrawer,Go as useForceUpdate,$ as usePrevious,Ko as useToggle,Mo as useUIScreen};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jerry-fd/ui",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "UI component library based on Ant Design (Client-side only)",
5
5
  "type": "module",
6
6
  "sideEffects": ["index.js", "*.css"],