Files
SnowCatQQ/release-tools/webui-static/assets/chunk-5PILOUBS-KHYNqMZE.js
T
2026-11-12 06:29:38 +08:00

2 lines
4.3 KiB
JavaScript

import{t as J,f as L,ar as Q,E as W,y as O,X as S,v as Z,x as ee,b7 as se,aG as ae,al as te,av as re,z as oe,B as le,n as de,D as f,Y as M,b8 as ne}from"./index-DiaaLdUu.js";import{j as x,r as p}from"./react-vendor-jWT2yUdV.js";var V=J({slots:{base:["flex","flex-col","relative","overflow-hidden","h-auto","outline-none","text-foreground","box-border","bg-content1",...L],header:["flex","p-3","z-10","w-full","justify-start","items-center","shrink-0","overflow-inherit","color-inherit","subpixel-antialiased"],body:["relative","flex","flex-1","w-full","p-3","flex-auto","flex-col","place-content-inherit","align-items-inherit","h-auto","break-words","text-left","overflow-y-auto","subpixel-antialiased"],footer:["p-3","h-auto","flex","w-full","items-center","overflow-hidden","color-inherit","subpixel-antialiased"]},variants:{shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},radius:{none:{base:"rounded-none",header:"rounded-none",footer:"rounded-none"},sm:{base:"rounded-small",header:"rounded-t-small",footer:"rounded-b-small"},md:{base:"rounded-medium",header:"rounded-t-medium",footer:"rounded-b-medium"},lg:{base:"rounded-large",header:"rounded-t-large",footer:"rounded-b-large"}},fullWidth:{true:{base:"w-full"}},isHoverable:{true:{base:"data-[hover=true]:bg-content2 dark:data-[hover=true]:bg-content2"}},isPressable:{true:{base:"cursor-pointer"}},isBlurred:{true:{base:["bg-background/80","dark:bg-background/20","backdrop-blur-md","backdrop-saturate-150"]}},isFooterBlurred:{true:{footer:["bg-background/10","backdrop-blur","backdrop-saturate-150"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:"",false:{base:"transition-transform-background motion-reduce:transition-none"}}},compoundVariants:[{isPressable:!0,class:"data-[pressed=true]:scale-[0.97] tap-highlight-transparent"}],defaultVariants:{radius:"lg",shadow:"md",fullWidth:!1,isHoverable:!1,isPressable:!1,isDisabled:!1,isFooterBlurred:!1}}),[ie,ue]=Q({name:"CardContext",strict:!0,errorMessage:"useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"}),E=W((e,o)=>{var a;const{as:l,className:d,children:s,...u}=e,n=l||"div",b=O(o),{slots:t,classNames:m}=ue(),C=S(m==null?void 0:m.body,d);return x.jsx(n,{ref:b,className:(a=t.body)==null?void 0:a.call(t,{class:C}),...u,children:s})});E.displayName="HeroUI.CardBody";var pe=E;function be(e){var o,a,l,d;const s=Z(),[u,n]=ee(e,V.variantKeys),{ref:b,as:t,children:m,onClick:C,onPress:T,autoFocus:z,className:U,classNames:c,allowTextSelectionOnPress:G=!0,...h}=u,i=O(b),P=t||(e.isPressable?"button":"div"),$=typeof P=="string",r=(a=(o=e.disableAnimation)!=null?o:s==null?void 0:s.disableAnimation)!=null?a:!1,w=(d=(l=e.disableRipple)!=null?l:s==null?void 0:s.disableRipple)!=null?d:!1,H=S(c==null?void 0:c.base,U),{onClear:B,onPress:F,ripples:g}=se(),_=p.useCallback(R=>{w||r||i.current&&F(R)},[w,r,i,F]),{buttonProps:j,isPressed:y}=ae({onPress:te(T,_),elementType:t,isDisabled:!e.isPressable,onClick:C,allowTextSelectionOnPress:G,...h},i),{hoverProps:N,isHovered:k}=re({isDisabled:!e.isHoverable,...h}),{isFocusVisible:D,isFocused:K,focusProps:A}=oe({autoFocus:z}),v=p.useMemo(()=>V({...n,disableAnimation:r}),[le(n),r]),X=p.useMemo(()=>({slots:v,classNames:c,disableAnimation:r,isDisabled:e.isDisabled,isFooterBlurred:e.isFooterBlurred,fullWidth:e.fullWidth}),[v,c,e.isDisabled,e.isFooterBlurred,r,e.fullWidth]),Y=p.useCallback((R={})=>({ref:i,className:v.base({class:H}),tabIndex:e.isPressable?0:-1,"data-hover":f(k),"data-pressed":f(y),"data-focus":f(K),"data-focus-visible":f(D),"data-disabled":f(e.isDisabled),...de(e.isPressable?{...j,...A,role:"button"}:{},e.isHoverable?N:{},M(h,{enabled:$}),M(R))}),[i,v,H,$,e.isPressable,e.isHoverable,e.isDisabled,k,y,D,j,A,N,h]),q=p.useCallback(()=>({ripples:g,onClear:B}),[g,B]);return{context:X,domRef:i,Component:P,classNames:c,children:m,isHovered:k,isPressed:y,disableAnimation:r,isPressable:e.isPressable,isHoverable:e.isHoverable,disableRipple:w,handlePress:_,isFocusVisible:D,getCardProps:Y,getRippleProps:q}}var I=W((e,o)=>{const{children:a,context:l,Component:d,isPressable:s,disableAnimation:u,disableRipple:n,getCardProps:b,getRippleProps:t}=be({...e,ref:o});return x.jsxs(d,{...b(),children:[x.jsx(ie,{value:l,children:a}),s&&!u&&!n&&x.jsx(ne,{...t()})]})});I.displayName="HeroUI.Card";var me=I;export{me as a,pe as c,ue as u};