tango-ui-cw 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("react"),Wt=require("react-dom"),t=require("prop-types"),Zt=require("tailwind-merge"),tt="tango:theme",st="tango:themeTokens",Gt="light",qt=["primary","input-accent","modal-ok-bg","drawer-ok-bg","datepicker-confirm-bg"],Lt=d.createContext(null),Pt=()=>typeof window<"u",ot=(e,s)=>{if(!Pt())return s;try{const r=window.localStorage.getItem(e);return r?JSON.parse(r):s}catch{return s}},rt=(e,s)=>{if(Pt())try{window.localStorage.setItem(e,JSON.stringify(s))}catch{}};function Xt({children:e}){const[s,r]=d.useState(()=>ot(tt,Gt)==="dark"?"dark":"light"),[n,c]=d.useState(()=>ot(st,{})),l=d.useRef(new Set);d.useEffect(()=>{typeof document>"u"||(document.documentElement.dataset.theme=s)},[s]),d.useEffect(()=>{rt(tt,s)},[s]),d.useEffect(()=>{if(typeof document>"u")return;const u=document.documentElement,m=new Set(Object.keys(n));l.current.forEach(f=>{m.has(f)||u.style.removeProperty(`--${f}`)}),Object.entries(n).forEach(([f,C])=>{C==null||C===""?u.style.removeProperty(`--${f}`):u.style.setProperty(`--${f}`,String(C))}),l.current=m,rt(st,n)},[n]);const a=u=>{c(m=>{const f=typeof u=="function"?u(m):u;return{...m,...f||{}}})},i=(u,m=qt)=>{a(f=>{const C={...f};return m.forEach(L=>{C[L]=u}),C})},p=()=>{c({})},h=()=>{r(u=>u==="dark"?"light":"dark")};return o.jsx(Lt.Provider,{value:{theme:s,setTheme:r,toggleTheme:h,themeTokens:n,setThemeTokens:a,setThemeColor:i,resetThemeTokens:p},children:e})}function Jt(){return d.useContext(Lt)}const Qt=new Set(["root","slots","tw","className","css","style"]),Pe={tw:"",css:{}},be=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Y=(e,s="px")=>typeof e=="number"?`${e}${s}`:e,me=e=>typeof e=="string"&&e.startsWith("$")?`var(--${e.slice(1)})`:e,es=e=>e.includes("-")?e.replace(/-([a-z])/g,(s,r)=>r.toUpperCase()):e,ts=e=>/(color|background|border|fill|stroke|shadow)$/i.test(e),ss={mt:(e,s)=>{e.marginTop=Y(s)},mr:(e,s)=>{e.marginRight=Y(s)},mb:(e,s)=>{e.marginBottom=Y(s)},ml:(e,s)=>{e.marginLeft=Y(s)},mx:(e,s)=>{e.marginLeft=Y(s),e.marginRight=Y(s)},my:(e,s)=>{e.marginTop=Y(s),e.marginBottom=Y(s)},m:(e,s)=>{e.margin=Y(s)},pt:(e,s)=>{e.paddingTop=Y(s)},pr:(e,s)=>{e.paddingRight=Y(s)},pb:(e,s)=>{e.paddingBottom=Y(s)},pl:(e,s)=>{e.paddingLeft=Y(s)},px:(e,s)=>{e.paddingLeft=Y(s),e.paddingRight=Y(s)},py:(e,s)=>{e.paddingTop=Y(s),e.paddingBottom=Y(s)},p:(e,s)=>{e.padding=Y(s)},g:(e,s)=>{e.gap=Y(s)},rg:(e,s)=>{e.rowGap=Y(s)},cg:(e,s)=>{e.columnGap=Y(s)},w:(e,s)=>{e.width=Y(s)},h:(e,s)=>{e.height=Y(s)},mw:(e,s)=>{e.minWidth=Y(s)},mh:(e,s)=>{e.minHeight=Y(s)},maxw:(e,s)=>{e.maxWidth=Y(s)},maxh:(e,s)=>{e.maxHeight=Y(s)},vw:(e,s)=>{e.width=typeof s=="number"?`${s}vw`:s},vh:(e,s)=>{e.height=typeof s=="number"?`${s}vh`:s},presentw:(e,s)=>{e.width=typeof s=="number"?`${s}%`:s},presenth:(e,s)=>{e.height=typeof s=="number"?`${s}%`:s},size:(e,s)=>{e.fontSize=Y(s)},fw:(e,s)=>{e.fontWeight=s},fwb:e=>{e.fontWeight="bold"},fwn:e=>{e.fontWeight="normal"},tac:e=>{e.textAlign="center"},tar:e=>{e.textAlign="right"},tal:e=>{e.textAlign="left"},lh:(e,s)=>{e.lineHeight=Y(s)},ls:(e,s)=>{e.letterSpacing=Y(s)},c:(e,s)=>{e.color=me(s)},bg:(e,s)=>{e.background=me(s)},bgc:(e,s)=>{e.backgroundColor=me(s)},b:(e,s)=>{e.border=s===1?"1px solid var(--border)":me(s)},br:(e,s)=>{e.borderRadius=Y(s)},bw:(e,s)=>{e.borderWidth=Y(s)},bs:(e,s)=>{e.borderStyle=s},bColor:(e,s)=>{e.borderColor=me(s)},boxshadow:(e,s)=>{e.boxShadow=me(s)},bgSize:(e,s)=>{e.backgroundSize=s},bgPosition:(e,s)=>{e.backgroundPosition=s},bgRepeat:(e,s)=>{e.backgroundRepeat=s},rel:e=>{e.position="relative"},ab:e=>{e.position="absolute"},fixed:e=>{e.position="fixed"},sticky:e=>{e.position="sticky"},center:e=>{e.position="absolute",e.inset=0,e.margin="auto"},inset:(e,s)=>{e.inset=Y(s)},top:(e,s)=>{e.top=Y(s)},right:(e,s)=>{e.right=Y(s)},bottom:(e,s)=>{e.bottom=Y(s)},left:(e,s)=>{e.left=Y(s)},z:(e,s)=>{e.zIndex=s},flex:e=>{e.display="flex"},iflex:e=>{e.display="inline-flex"},fd:(e,s)=>{e.flexDirection=s},fwrap:(e,s="wrap")=>{e.flexWrap=s},aic:e=>{e.alignItems="center"},ai:(e,s)=>{e.alignItems=s},jcc:e=>{e.justifyContent="center"},jc:(e,s)=>{e.justifyContent=s},ac:(e,s)=>{e.alignContent=s},as:(e,s)=>{e.alignSelf=s},f:(e,s)=>{e.flex=typeof s=="number"?s:`${s}`},fl:e=>{e.float="left"},fr:e=>{e.float="right"},ar:(e,s)=>{e.aspectRatio=s},tran:(e,s)=>{e.transition=typeof s=="number"?`${s}s`:s},op:(e,s)=>{e.opacity=s},oh:e=>{e.overflow="hidden"},ohauto:e=>{e.overflow="auto"},oxh:e=>{e.overflowX="hidden"},oxa:e=>{e.overflowX="auto"},oyh:e=>{e.overflowY="hidden"},oya:e=>{e.overflowY="auto"},cur:(e,s)=>{e.cursor=s},pe:(e,s)=>{e.pointerEvents=s},boxsizing:e=>{e.boxSizing="border-box"},none:e=>{e.display="none"},block:e=>{e.display="block"},inline:e=>{e.display="inline"},ib:e=>{e.display="inline-block"},hidden:e=>{e.visibility="hidden"},shown:e=>{e.visibility="visible"}},ve=(e={})=>be(e)?Object.entries(e).reduce((s,[r,n])=>{if(Qt.has(r))return s;const c=ss[r];if(c)return c(s,n),s;const l=es(r),a=typeof n=="string"&&(n.startsWith("$")||ts(l))?me(n):n;return s[l]=a,s},{}):{},z=(...e)=>{const s=e.filter(Boolean).join(" ").trim();return s?Zt.twMerge(s):""},Te=e=>{if(typeof e=="string")return{tw:e,css:{}};if(!be(e))return{...Pe};if(!("tw"in e||"className"in e||"css"in e||"style"in e))return{tw:"",css:ve(e)};const r=[e.className,e.tw].filter(Boolean).join(" "),n=be(e.css)?ve(e.css):{},c=be(e.style)?ve(e.style):{};return{tw:r,css:{...n,...c}}},os=(e,s)=>be(e)?"root"in e||"slots"in e||"tw"in e||"className"in e||"css"in e||"style"in e?!0:s.some(r=>r!=="root"&&r in e):!1,rs=e=>{const s={};return e.forEach(r=>{s[r]={...Pe}}),s.root||(s.root={...Pe}),s},W=(e,s=["root"])=>{const r=rs(s);if(typeof e=="string")return r.root.tw=e,r;if(!be(e))return r;if(!os(e,s))return r.root.css=ve(e),r;const n=Te({tw:[e.className,e.tw].filter(Boolean).join(" "),css:e.css,style:e.style}),c=Te(e.root);r.root={tw:z(n.tw,c.tw),css:{...n.css,...c.css}};const l=be(e.slots)?e.slots:{};return Object.keys(r).forEach(a=>{if(a==="root")return;const i=Te(e[a]),p=Te(l[a]);r[a]={tw:z(i.tw,p.tw),css:{...i.css,...p.css}}}),r},x=({baseClassName:e="",className:s="",baseStyle:r={},style:n={},sxSlot:c=Pe}={})=>({className:z(e,s,c.tw),style:{...r||{},...c.css||{},...n||{}}}),as=["root","icon","content"],at={success:"text-[var(--notice-success-text)]",fail:"text-[var(--notice-fail-text)]",caution:"text-[var(--notice-caution-text)]"},nt={default:{base:"fixed top-5 left-1/2 -translate-x-1/2",enter:"animate-[noticeSlideDown_0.3s_cubic-bezier(0.22,1,0.36,1)_forwards]"},md:{base:"fixed bottom-5 left-5",enter:"animate-[noticeSlideFromBottom_0.3s_ease-out_forwards]"}};function ns(e,s){const{type:r="success",icon:n,message:c,variant:l="default",duration:a=3e3,onClose:i,sx:p={},style:h={},className:u="",...m}=e,[f,C]=d.useState(!1),L=at[r]?r:"success",P=nt[l]?l:"default",D=W(p,as),N=d.useCallback(()=>{C(!0);const M=setTimeout(()=>i==null?void 0:i(),300);return()=>clearTimeout(M)},[i]);d.useEffect(()=>{if(!i||a<=0)return;const M=setTimeout(N,a);return()=>clearTimeout(M)},[i,a,N]);const S=nt[P],v=P==="default"?"animate-[noticeSlideUpFade_0.3s_ease-in_forwards]":"animate-[noticeSlideToBottom_0.3s_ease-in_forwards]",T=x({baseClassName:z("inline-flex items-center gap-2 px-3 py-2 text-sm z-[999]","rounded-[var(--notice-radius)]","bg-[var(--notice-bg)] text-[var(--notice-foreground)]","shadow-[var(--notice-shadow)]",S.base,f?v:S.enter,P==="md"&&at[L]),className:u,sxSlot:D.root,baseStyle:{borderRadius:"var(--notice-radius)"},style:h}),b=x({baseClassName:"flex-shrink-0 text-[var(--notice-foreground)]",sxSlot:D.icon}),y=x({baseClassName:"inline-block",sxSlot:D.content});return o.jsxs("div",{ref:s,role:"alert",className:T.className,style:T.style,...m,children:[P!=="md"&&n&&o.jsx("span",{className:b.className,style:b.style,children:n}),o.jsx("span",{className:y.className,style:y.style,children:c})]})}const Ne=d.forwardRef(ns);Ne.displayName="Notice";Ne.propTypes={type:t.oneOf(["success","fail","caution"]),icon:t.node,message:t.node,variant:t.oneOf(["default","md"]),duration:t.number,onClose:t.func,sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string};const Ot=d.createContext(null),ls=o.jsx("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:o.jsx("path",{d:"M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0",fill:"var(--notice-success-text)"})}),cs=o.jsx("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:o.jsx("path",{d:"M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",fill:"var(--notice-fail-text)"})}),is=o.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:[o.jsx("path",{d:"M512 909.061224c-218.906122 0-397.061224-178.155102-397.061224-397.061224s178.155102-397.061224 397.061224-397.061224 397.061224 178.155102 397.061224 397.061224-178.155102 397.061224-397.061224 397.061224z",fill:"var(--notice-caution-text)"}),o.jsx("path",{d:"M512 690.677551m-31.346939 0a31.346939 31.346939 0 1 0 62.693878 0 31.346939 31.346939 0 1 0-62.693878 0Z",fill:"var(--notice-fail-text)"}),o.jsx("path",{d:"M512 584.097959c-11.493878 0-20.897959-9.404082-20.897959-20.897959v-261.22449c0-11.493878 9.404082-20.897959 20.897959-20.897959s20.897959 9.404082 20.897959 20.897959v261.22449c0 12.016327-9.404082 20.897959-20.897959 20.897959z",fill:"var(--notice-fail-text)"})]}),ds={success:ls,fail:cs,caution:is};function us({children:e}){const[s,r]=d.useState([]),[n,c]=d.useState(!1);d.useEffect(()=>{c(!0)},[]);const l=d.useCallback(i=>{r(p=>p.filter(h=>h.id!==i))},[]),a=d.useCallback((i,p,h="default")=>{const u=Date.now()+Math.random();r(m=>[...m,{id:u,type:i,message:p,variant:h,icon:ds[i]}])},[]);return o.jsxs(Ot.Provider,{value:{add:a,remove:l},children:[e,n&&Wt.createPortal(o.jsx("div",{id:"notification-container",className:"flex flex-col items-center gap-2",children:s.map(i=>o.jsx(Ne,{...i,onClose:()=>l(i.id)},i.id))}),document.body)]})}function ps(){const e=d.useContext(Ot);if(!e)throw new Error("useNotice must be used inside <NoticeProvider />");return e}function ms(){const{add:e}=ps();return{success:s=>e("success",s),fail:s=>e("fail",s),caution:s=>e("caution",s),md:{success:s=>e("success",s,"md"),fail:s=>e("fail",s,"md"),caution:s=>e("caution",s,"md")}}}const _t="tango:locale",xe="zh-CN",bs={zh:"zh-CN",ZH:"zh-CN","zh-CN":"zh-CN","zh-cn":"zh-CN",cn:"zh-CN",CN:"zh-CN",en:"en-US",EN:"en-US","en-US":"en-US","en-us":"en-US",us:"en-US",US:"en-US"},At={"zh-CN":{button:{default:"按钮",loading:"加载中",iconAlt:"图标",toggle:"切换",light:"浅色",dark:"暗色",blue:"蓝色",green:"绿色",token:"自定义词条",reset:"重置",locale:"语言",chinese:"中文",english:"英文",successDemo:"成功",outlineDemo:"描边",submit:"提交",confirm:"确认",cancel:"取消",search:"搜索",save:"保存",delete:"删除",back:"返回",next:"下一步",prev:"上一步",add:"新增"},banner:{cancel:"取消",action:"操作"},colorpicker:{hex:"HEX",rgb:"RGB",hsl:"HSL"},date:{weekdayPrefix:"星期",weekdayShortPrefix:"周"},datepicker:{placeholder:"YYYY-MM-DD",placeholderTime:"YYYY-MM-DD HH:mm",timeLabel:"时间",confirm:"确定",cancel:"关闭",prevMonth:"上一月",nextMonth:"下一月"},drawer:{title:"基础标题",okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},modal:{title:"基础标题",okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},search:{placeholder:"请输入内容",btnText:"搜索"},materialInput:{label:""},materialButton:{default:"按钮",loading:"加载中",iconAlt:"图标"},table:{empty:"暂无数据",prev:"上一页",next:"下一页",page:"页",total:"共 {total} 条",perPage:"条/页"}},"en-US":{button:{default:"Button",loading:"Loading",iconAlt:"icon",toggle:"Toggle",light:"Light",dark:"Dark",blue:"Blue",green:"Green",token:"Token",reset:"Reset",locale:"Locale",chinese:"Chinese",english:"English",successDemo:"Success",outlineDemo:"Outline",submit:"Submit",confirm:"Confirm",cancel:"Cancel",search:"Search",save:"Save",delete:"Delete",back:"Back",next:"Next",prev:"Previous",add:"Add"},banner:{cancel:"Cancel",action:"Action"},colorpicker:{hex:"HEX",rgb:"RGB",hsl:"HSL"},date:{weekdayPrefix:"",weekdayShortPrefix:""},datepicker:{placeholder:"YYYY-MM-DD",placeholderTime:"YYYY-MM-DD HH:mm",timeLabel:"Time",confirm:"Confirm",cancel:"Close",prevMonth:"Previous month",nextMonth:"Next month"},drawer:{title:"Drawer",okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},modal:{title:"Modal",okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},search:{placeholder:"Search...",btnText:"Search"},materialInput:{label:""},materialButton:{default:"Button",loading:"Loading",iconAlt:"icon"},table:{empty:"No data",prev:"Previous",next:"Next",page:"Page",total:"{total} items",perPage:"/ page"}}},Ye=()=>{},Mt=d.createContext({locale:xe,setLocale:Ye,toggleLocale:Ye,messages:At,t:(e,s="")=>s}),lt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zt=(e,s)=>{const r={...e};return Object.entries(s||{}).forEach(([n,c])=>{lt(c)&<(r[n])?r[n]=zt(r[n],c):r[n]=c}),r},xs=(e,s)=>s.split(".").reduce((r,n)=>{if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},e),Se=e=>typeof e!="string"||!e.trim()?xe:bs[e]||e,gs=()=>{if(typeof window>"u")return xe;try{const e=window.localStorage.getItem(_t);return Se(e||xe)}catch{return xe}};function fs({children:e,locale:s,defaultLocale:r=xe,onLocaleChange:n=Ye,messages:c={}}){const l=Se(r),a=s==null?null:Se(s),[i,p]=d.useState(()=>gs()||l),h=a||i,u=L=>{const P=Se(L);a==null&&p(P),n(P)};d.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(_t,h)}catch{}},[h]);const m=d.useMemo(()=>zt(At,c),[c]),f=()=>{u(h==="zh-CN"?"en-US":"zh-CN")},C=(L,P="")=>{const D=m[h]||m[xe]||{},N=xs(D,L);return N==null||N===""?P:String(N)};return o.jsx(Mt.Provider,{value:{locale:h,setLocale:u,toggleLocale:f,messages:m,t:C},children:e})}function re(){return d.useContext(Mt)}const hs="_materialBtn_wlueu_4",ys="_materialBtnSmall_wlueu_26",vs="_materialBtnMedium_wlueu_32",Ss="_materialBtnLarge_wlueu_38",Ns="_materialBtnHuge_wlueu_44",ws="_materialBtnDisabled_wlueu_51",Cs="_ripple_wlueu_59",he={materialBtn:hs,materialBtnSmall:ys,materialBtnMedium:vs,materialBtnLarge:Ss,materialBtnHuge:Ns,materialBtnDisabled:ws,ripple:Cs},ct=["root","content","icon","loading"],Ts={small:"small",medium:"medium",large:"large",huge:"huge"},ks={small:12,medium:14,large:16,huge:20},it={default:{backgroundColor:"var(--primary)",color:"var(--primary-foreground)",borderColor:"var(--border)"},transparent:{backgroundColor:"var(--transparent)",color:"var(--primary-foreground)",borderColor:"var(--button-transparent-border)"},danger:{backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)",borderColor:"transparent"},success:{backgroundColor:"var(--success)",color:"var(--success-foreground)",borderColor:"transparent"}},js={default:{backgroundColor:"var(--transparent)",color:"var(--button-outline-foreground)",borderColor:"var(--border)"},transparent:{backgroundColor:"var(--transparent)",color:"var(--button-outline-foreground)",borderColor:"var(--button-transparent-border)"},danger:{backgroundColor:"var(--transparent)",color:"var(--destructive)",borderColor:"var(--destructive)"},success:{backgroundColor:"var(--transparent)",color:"var(--success)",borderColor:"var(--success)"}},Ls={backgroundColor:"var(--muted)",color:"var(--muted-foreground)",borderColor:"transparent",cursor:"not-allowed"},Fe={default:"按钮",loading:"加载中",iconAlt:"图标"},Ps=e=>e.charAt(0).toUpperCase()+e.slice(1),Os=e=>e===!0||e==="light"||e==="dark"?!0:Array.isArray(e)&&e.length>0?e[0]===!0||e[0]==="light"||e[0]==="dark":!1,_s=e=>e==="light"?"light":e==="dark"||e===!0||Array.isArray(e)&&e.length>=2&&e[1]==="dark"?"dark":"light",dt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Oe(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a=()=>{},children:i,disabled:p=!1,outline:h=!1,icon:u=null,iconPosition:m=null,loading:f=!1,i18nKey:C=null,localeText:L={},rippleColor:P,"aria-label":D,...N}=e,{t:S}=re(),v=d.useRef(null),T=dt(r,"medium",Ts),b=dt(s,"default",it),y=Os(f),M=_s(f),_=p||y,E=ks[T],O=m==="right"?"right":u||y?"left":null,k=P??"var(--material-button-ripple)",w={default:S("materialButton.default",Fe.default),loading:S("materialButton.loading",Fe.loading),iconAlt:S("materialButton.iconAlt",Fe.iconAlt),...L},U=(C&&typeof w[C]=="string"?w[C]:null)||(C?S(`materialButton.${C}`,w.default):w.default),I=y?w.loading:U,$=i??I,A=D||(i==null?String($||w.default):void 0),F=W(n,ct),H=_?Ls:h?js[b]:it[b],K=he[`materialBtn${Ps(T)}`],Z=F.root.css||{},R=typeof n=="string"?n:"",J=new Set([...ct,"root","slots","tw","className","css","style"]),le=typeof n=="object"?Object.fromEntries(Object.entries(n).filter(([ee])=>!J.has(ee))):{},de=[he.materialBtn,K,_&&he.materialBtnDisabled,F.root.tw,R,l].filter(Boolean).join(" "),ue={...H,...le,...Z,...c},pe=x({baseClassName:"inline-flex items-center relative z-[1]",sxSlot:F.content}),G=x({baseClassName:"inline-flex items-center justify-center shrink-0 transition-all duration-300 relative z-[1]",baseStyle:{width:`${E}px`,height:`${E}px`},sxSlot:F.icon}),X=x({baseClassName:"inline-flex items-center justify-center shrink-0 animate-spin relative z-[1]",baseStyle:{width:`${E}px`,height:`${E}px`,color:M==="light"?"var(--button-loading-light)":"var(--button-loading-dark)"},sxSlot:F.loading}),B=d.useCallback(ee=>{if(_)return;const se=v.current;if(!se)return;const g=document.createElement("span"),V=Math.max(se.clientWidth,se.clientHeight),Q=V/2;Object.assign(g.style,{width:`${V}px`,height:`${V}px`,left:`${ee.clientX-se.getBoundingClientRect().left-Q}px`,top:`${ee.clientY-se.getBoundingClientRect().top-Q}px`}),g.className=he.ripple,g.style.background=k;const ne=se.querySelector(`.${he.ripple}`);ne&&ne.remove(),se.appendChild(g)},[_,k]),q=()=>{if(!u)return null;if(typeof u=="string")return o.jsx("img",{src:u,alt:w.iconAlt,className:G.className,style:G.style,"aria-hidden":"true"});if(d.isValidElement(u))return d.cloneElement(u,{className:z(G.className,u.props.className),style:{...G.style,...u.props.style},"aria-hidden":!0});if(typeof u=="function"){const ee=u;return o.jsx(ee,{className:G.className,style:G.style,"aria-hidden":"true"})}return o.jsx("span",{className:G.className,style:G.style,"aria-hidden":"true",children:u})},ae=()=>o.jsx("svg",{viewBox:"0 0 1024 1024",role:"presentation",className:X.className,style:X.style,"aria-hidden":"true",children:o.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"currentColor"})});return o.jsxs("button",{ref:v,className:de,style:ue,onClick:ee=>{B(ee),a==null||a(ee)},disabled:_,"aria-label":A,"data-variant":b,"data-size":T,"data-icon-position":O||void 0,...N,children:[O==="left"&&o.jsxs(o.Fragment,{children:[y&&ae(),!y&&u&&q()]}),o.jsx("span",{className:pe.className,style:pe.style,children:$}),O==="right"&&o.jsxs(o.Fragment,{children:[y&&ae(),!y&&u&&q()]})]})}Oe.propTypes={type:t.oneOf(["default","transparent","danger","success"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,onClick:t.func,className:t.string,children:t.node,disabled:t.bool,outline:t.bool,icon:t.oneOfType([t.elementType,t.node,t.string]),iconPosition:t.oneOf(["left","right"]),loading:t.oneOfType([t.bool,t.oneOf(["light","dark"]),t.array]),i18nKey:t.string,localeText:t.object,rippleColor:t.string};const As=["root","content","icon","loading"],De={default:"按钮",loading:"加载中",iconAlt:"图标"},Ms="inline-flex select-none items-center justify-center whitespace-nowrap rounded-[var(--radius)] border align-middle font-medium tracking-[0.5px] transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--input-accent)] focus-visible:ring-offset-2",Re={small:{iconSize:12,className:"text-xs px-2 py-1 gap-1"},medium:{iconSize:14,className:"text-sm px-4 py-2 gap-1.5"},large:{iconSize:16,className:"text-base px-5 py-3 gap-2"},huge:{iconSize:20,className:"text-[25px] px-[45px] py-[18px] gap-3"}},ut={default:"bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",transparent:"bg-[var(--transparent)] text-[var(--primary-foreground)] border-[var(--button-transparent-border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",danger:"bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--destructive)]",success:"bg-[var(--success)] text-[var(--success-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--success)]"},zs="bg-[var(--transparent)]",Es={default:"text-[var(--button-outline-foreground)] border-[var(--border)]",transparent:"text-[var(--button-outline-foreground)] border-[var(--button-transparent-border)]",danger:"text-[var(--destructive)] border-[var(--destructive)]",success:"text-[var(--success)] border-[var(--success)]"},$s="shadow-[var(--button-enu-shadow)] hover:shadow-[var(--button-enu-hover-shadow)] active:translate-y-px active:shadow-[var(--button-enu-active-shadow)]",Bs={default:"bg-[var(--button-enu-bg)] text-[var(--button-enu-fg)] border-transparent",transparent:"bg-[var(--transparent)] text-[var(--button-enu-fg)] border-[var(--button-transparent-border)]",danger:"bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent",success:"bg-[var(--success)] text-[var(--success-foreground)] border-transparent"},Is="bg-[var(--muted)] text-[var(--muted-foreground)] border-transparent cursor-not-allowed shadow-none hover:shadow-none",Fs=e=>e===!0||e==="light"||e==="dark"?!0:Array.isArray(e)&&e.length>0?e[0]===!0||e[0]==="light"||e[0]==="dark":!1,Ds=e=>e==="light"?"light":e==="dark"||e===!0||Array.isArray(e)&&e.length>=2&&e[1]==="dark"?"dark":"light",pt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function oe(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a=()=>{},children:i,disabled:p=!1,outline:h=!1,enu:u=!1,icon:m=null,iconPosition:f=null,loading:C=!1,i18nKey:L=null,localeText:P={},"aria-label":D,...N}=e,{t:S}=re(),v=pt(r,"medium",Re),T=pt(s,"default",ut),b=Fs(C),y=Ds(C),M=p||b,_=Re[v].iconSize,E=f==="right"?"right":m||b?"left":null,O=W(n,As),k={default:S("button.default",De.default),loading:S("button.loading",De.loading),iconAlt:S("button.iconAlt",De.iconAlt),...P},j=(L&&typeof k[L]=="string"?k[L]:null)||(L?S(`button.${L}`,k.default):k.default),U=b?k.loading:j,I=i??U,$=D||(i==null?String(I||k.default):void 0);let A=ut[T];h&&(A=z(A,zs,Es[T])),u&&(A=z(A,$s,Bs[T]));const F=x({baseClassName:z(Ms,Re[v].className,A,M&&Is,b&&"cursor-wait"),className:l,style:c,sxSlot:O.root}),H=x({baseClassName:"inline-flex items-center",sxSlot:O.content}),K=x({baseClassName:"inline-flex items-center justify-center shrink-0 transition-all duration-300",baseStyle:{width:`${_}px`,height:`${_}px`},sxSlot:O.icon}),Z=x({baseClassName:"inline-flex items-center justify-center shrink-0 animate-spin",baseStyle:{width:`${_}px`,height:`${_}px`,color:y==="light"?"var(--button-loading-light)":"var(--button-loading-dark)"},sxSlot:O.loading}),R=()=>{if(!m)return null;if(typeof m=="string")return o.jsx("img",{src:m,alt:k.iconAlt,className:K.className,style:K.style,"aria-hidden":"true"});if(d.isValidElement(m))return d.cloneElement(m,{className:z(K.className,m.props.className),style:{...K.style,...m.props.style},"aria-hidden":!0});if(typeof m=="function"){const le=m;return o.jsx(le,{className:K.className,style:K.style,"aria-hidden":"true"})}return o.jsx("span",{className:K.className,style:K.style,"aria-hidden":"true",children:m})},J=()=>o.jsx("svg",{viewBox:"0 0 1024 1024",role:"presentation",className:Z.className,style:Z.style,"aria-hidden":"true",children:o.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"currentColor"})});return o.jsxs("button",{className:F.className,style:F.style,onClick:a,disabled:M,"aria-label":$,"data-variant":T,"data-size":v,"data-icon-position":E||void 0,...N,children:[E==="left"&&o.jsxs(o.Fragment,{children:[b&&J(),!b&&m&&R()]}),o.jsx("span",{className:H.className,style:H.style,children:I}),E==="right"&&o.jsxs(o.Fragment,{children:[b&&J(),!b&&m&&R()]})]})}oe.propTypes={type:t.oneOf(["default","transparent","danger","success"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,onClick:t.func,className:t.string,children:t.node,disabled:t.bool,outline:t.bool,enu:t.bool,icon:t.oneOfType([t.elementType,t.node,t.string]),iconPosition:t.oneOf(["left","right"]),loading:t.oneOfType([t.bool,t.oneOf(["light","dark"]),t.array]),i18nKey:t.string,localeText:t.object};oe.MaterialButton=Oe;const Rs=["root","input","label"],Vs={small:"small",medium:"medium",large:"large",huge:"huge"},Ys={small:{wrapper:"h-10 text-sm",label:"text-sm",labelFloat:"text-[10px]",pt:"pt-5"},medium:{wrapper:"h-12 text-base",label:"text-base",labelFloat:"text-xs",pt:"pt-6"},large:{wrapper:"h-14 text-lg",label:"text-lg",labelFloat:"text-sm",pt:"pt-7"},huge:{wrapper:"h-16 text-xl",label:"text-xl",labelFloat:"text-base",pt:"pt-8"}},Ks={label:""},Us=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function _e(e){const{size:s="medium",sx:r={},style:n={},className:c="",onChange:l,value:a,defaultValue:i,disabled:p=!1,label:h,localeText:u,type:m="text",...f}=e,{t:C}=re(),L=Us(s,"medium",Vs),P=a!==void 0,[D,N]=d.useState(i??""),[S,v]=d.useState(!1),T=P?a:D,b=S||String(T).length>0,y=h??(u==null?void 0:u.label)??C("materialInput.label",Ks.label),M=W(r,Rs),_={tw:z(M.root.tw,M.input.tw),css:{...M.root.css,...M.input.css}},E=z("relative inline-flex",M.root.tw),O=Ys[L],k=z("w-[300px] bg-transparent text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out","border-b border-b-[var(--border)]","hover:border-b-[var(--input-accent)]","focus:border-b-[var(--input-accent)]",p&&"text-[var(--muted-foreground)] border-b-[var(--muted)] cursor-not-allowed hover:border-b-[var(--muted)]",O.wrapper,O.pt),w=x({baseClassName:k,className:c,style:n,sxSlot:_}),j=z("absolute left-0 transition-all duration-200 ease-in-out pointer-events-none",b?`top-1 ${O.labelFloat} text-[var(--input-accent)]`:`top-1/2 -translate-y-1/2 ${O.label} text-[var(--muted-foreground)]`,S&&b&&"text-[var(--input-accent)]",p&&"text-[var(--muted-foreground)]",M.label.tw),U=x({baseClassName:j,sxSlot:{tw:"",css:M.label.css}}),I=d.useCallback(Z=>{const R=Z.target.value;P||N(R),l==null||l(R)},[P,l]),$=d.useCallback(Z=>{var R;v(!0),(R=f.onFocus)==null||R.call(f,Z)},[f.onFocus]),A=d.useCallback(Z=>{var R;v(!1),(R=f.onBlur)==null||R.call(f,Z)},[f.onBlur]),{onFocus:F,onBlur:H,...K}=f;return o.jsxs("div",{className:E,children:[o.jsx("input",{...K,type:m,className:w.className,style:w.style,value:T,disabled:p||void 0,onChange:I,onFocus:$,onBlur:A,"aria-label":y||void 0}),y&&o.jsx("label",{className:U.className,style:U.style,children:y})]})}_e.propTypes={size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,onChange:t.func,value:t.string,defaultValue:t.string,disabled:t.bool,label:t.string,localeText:t.shape({label:t.string}),type:t.string};const Hs=["root","input"],Ws={small:"small",medium:"medium",large:"large",huge:"huge"},Zs={small:"h-8 text-xs px-2.5",medium:"h-10 text-sm px-3",large:"h-12 text-base px-3.5",huge:"h-14 text-lg px-4"},Gs=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Ae(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a,onChange:i,value:p,defaultValue:h,disabled:u=!1,placeholder:m="",maxlength:f=524288,status:C,...L}=e,P=Gs(r,"medium",Ws),D=s==="textarea",N=s==="password",S=C==="error",v=W(n,Hs),T={tw:z(v.root.tw,v.input.tw),css:{...v.root.css,...v.input.css}},b=z("inline-flex",v.root.tw),y=z("w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out","border-[var(--border)] shadow-[var(--input-shadow)]","hover:border-[var(--input-accent)]","focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",S&&"border-[var(--input-error-border)] bg-[var(--input-error-bg)] text-[var(--input-error-fg)] hover:border-[var(--input-error-border)] focus:shadow-[var(--input-error-focus-shadow)]",u&&"bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",Zs[P]),M=x({baseClassName:y,className:l,style:c,sxSlot:T}),_=p!==void 0,E={className:M.className,style:M.style,onClick:a,onChange:i?O=>i(O.target.value):void 0,value:_?p:void 0,defaultValue:_?void 0:h??"",disabled:u||void 0,placeholder:m,maxLength:f,"aria-invalid":S||void 0,...N?{autoComplete:"current-password"}:{},...L};return o.jsx("div",{className:b,children:D?o.jsx("textarea",{...E,className:`${E.className} min-h-[80px] py-2 resize-y`}):o.jsx("input",{...E,type:N?"password":"text"})})}Ae.propTypes={type:t.oneOf(["default","textarea","password"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,onClick:t.func,onChange:t.func,value:t.string,defaultValue:t.string,disabled:t.bool,placeholder:t.string,maxlength:t.number,status:t.oneOf(["default","error"])};Ae.MaterialInput=_e;const fe=["root"];function qs(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex items-center px-4 bg-[var(--layout-header-bg)] text-[var(--layout-header-color)]",className:c,sxSlot:i.root,baseStyle:{height:"var(--layout-header-height)",borderBottom:"1px solid var(--layout-border)"},style:n});return o.jsx("header",{ref:s,className:p.className,style:p.style,...a,children:l})}const Me=d.forwardRef(qs);Me.displayName="LayoutHeader";Me.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Xs(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex items-center px-4 bg-[var(--layout-footer-bg)] text-[var(--layout-footer-color)]",className:c,sxSlot:i.root,baseStyle:{height:"var(--layout-footer-height)",borderTop:"1px solid var(--layout-border)"},style:n});return o.jsx("footer",{ref:s,className:p.className,style:p.style,...a,children:l})}const ze=d.forwardRef(Xs);ze.displayName="LayoutFooter";ze.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Js(e,s){const{sx:r={},style:n={},className:c="",width:l,children:a,...i}=e,p=W(r,fe),h=x({baseClassName:"overflow-auto flex flex-col bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",className:c,sxSlot:p.root,baseStyle:{width:siderWidth,minWidth:siderWidth,maxWidth:"100%",borderRight:"1px solid var(--layout-border)"},style:n});return o.jsx("aside",{ref:s,className:h.className,style:h.style,...i,children:a})}const we=d.forwardRef(Js);we.displayName="LayoutSider";we.propTypes={width:t.oneOfType([t.string,t.number]),sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Qs(e,s){const{sx:r={},style:n={},className:c="",width:l,children:a,...i}=e,p=W(r,fe),h=l??"var(--layout-toc-width)",u=x({baseClassName:"overflow-auto flex flex-col bg-[var(--layout-toc-bg)] text-[var(--layout-toc-color)]",className:c,sxSlot:p.root,baseStyle:{width:h,minWidth:h,maxWidth:"100%",borderLeft:"1px solid var(--layout-border)"},style:n});return o.jsx("nav",{ref:s,className:u.className,style:u.style,...i,children:a})}const Ce=d.forwardRef(Qs);Ce.displayName="LayoutToc";Ce.propTypes={width:t.oneOfType([t.string,t.number]),sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function eo(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex-1 flex flex-col bg-[var(--layout-content-bg)] text-[var(--layout-content-color)]",className:c,sxSlot:i.root,baseStyle:{},style:n});return o.jsx("main",{ref:s,className:p.className,style:p.style,...a,children:l})}const Ee=d.forwardRef(eo);Ee.displayName="LayoutContent";Ee.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function to(e,s){const{sx:r={},style:n={},className:c="",hasSider:l,children:a,...i}=e,p=W(r,fe),h=l??d.Children.toArray(a).some(m=>{var f,C;return d.isValidElement(m)&&(m.type===we||m.type===Ce||((f=m.type)==null?void 0:f.displayName)==="LayoutSider"||((C=m.type)==null?void 0:C.displayName)==="LayoutToc")}),u=x({baseClassName:z("flex flex-1 flex-col min-h-0",h?"md:flex-row":""),className:c,sxSlot:p.root,style:n});return o.jsx("section",{ref:s,className:u.className,style:u.style,...i,children:a})}const te=d.forwardRef(to);te.displayName="Layout";te.Header=Me;te.Footer=ze;te.Sider=we;te.Content=Ee;te.Toc=Ce;te.propTypes={hasSider:t.bool,sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};const Et=Me,$t=ze,Bt=we,It=Ee,Ft=Ce,so=["root","button","list","item"],Dt=Symbol("LIST_IGNORE"),mt=o.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[o.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),o.jsx("path",{d:"M14 2v6h6"})]}),bt=o.jsx("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:o.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function oo(e,s){const{sx:r={},style:n={},className:c="",accept:l="image/*",multiple:a=!1,onChange:i=()=>{},beforeUpload:p=()=>{},files:h=[],showUploadList:u=!0,maxCount:m=20,maxSize:f=100,btnText:C="选择文件",btnStyle:L,showSize:P=!0,disabled:D=!1,...N}=e,S=d.useId(),v=h||[],T=W(r,so),b=d.useCallback(async(k,w)=>{if(!p)return!0;try{const j=await p(k,w);return j===void 0?!0:j}catch{return!1}},[p]),y=d.useCallback(async k=>{const j=Array.from(k.target.files||[]).filter($=>$.size/1024/1024>f?(console.warn(`[Tango Upload] ${$.name} 超过 ${f}MB,已被过滤`),!1):!0),U=a?j.slice(0,m):j.slice(0,1),I=[];for(const $ of U){const A=await b($,U);if(A===!1){console.warn(`[Tango Upload] ${$.name} 被 beforeUpload 拦截`);continue}if(A===Dt){console.warn(`[Tango Upload] ${$.name} 被 LIST_IGNORE 忽略`);continue}if(A instanceof Blob){const F=A instanceof File?A:new File([A],$.name,{type:$.type});I.push(F)}else I.push($)}k.target.value="",i(I)},[a,m,f,b,i]),M=d.useCallback((k,w)=>{const j=v.filter((U,I)=>I!==w);i(j)},[v,i]),_=x({baseClassName:"inline-flex flex-col gap-3",className:c,sxSlot:T.root,style:n}),E=x({baseClassName:z("list-none p-0 m-0 max-h-[150px] max-w-[400px] overflow-y-auto","border border-[var(--upload-border)] rounded-[var(--upload-radius)]","bg-[var(--upload-list-bg)]",v.length===0&&"border-transparent"),baseStyle:{borderRadius:"var(--upload-radius)"},sxSlot:T.list}),O=x({baseClassName:z("flex items-center gap-2 px-3 py-1.5 text-sm","text-[var(--upload-item-text)] hover:bg-[var(--upload-item-hover-bg)]","transition-colors"),sxSlot:T.item});return o.jsxs("div",{ref:s,className:_.className,style:_.style,...N,children:[o.jsx("input",{id:S,type:"file",accept:l,multiple:a,className:"hidden",onChange:y,disabled:D,"aria-hidden":"true",tabIndex:-1}),o.jsx(oe,{disabled:D,style:L,sx:T.button,onClick:()=>{var k;return(k=document.getElementById(S))==null?void 0:k.click()},children:C}),u&&v.length>0&&o.jsx("ul",{className:E.className,style:E.style,children:a?v.map((k,w)=>o.jsxs("li",{className:O.className,style:O.style,children:[o.jsx("span",{className:"flex-shrink-0 text-[var(--upload-icon-color)]",children:mt}),o.jsxs("span",{className:"flex-1 truncate",children:[k.name,P&&o.jsxs("span",{className:"ml-1 text-xs text-[var(--muted-foreground)]",children:["(",(k.size/1024).toFixed(2)," KB)"]})]}),o.jsx("button",{type:"button",className:"flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",onClick:()=>M(k,w),"aria-label":`删除 ${k.name}`,children:bt})]},w)):o.jsxs("li",{className:O.className,style:O.style,children:[o.jsx("span",{className:"flex-shrink-0 text-[var(--upload-icon-color)]",children:mt}),o.jsxs("span",{className:"flex-1 truncate",children:[v[0].name,P&&o.jsxs("span",{className:"ml-1 text-xs text-[var(--muted-foreground)]",children:["(",(v[0].size/1024).toFixed(2)," KB)"]})]}),o.jsx("button",{type:"button",className:"flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",onClick:()=>M(v[0],0),"aria-label":`删除 ${v[0].name}`,children:bt})]})})]})}const $e=d.forwardRef(oo);$e.displayName="Upload";$e.LIST_IGNORE=Dt;$e.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,accept:t.string,multiple:t.bool,onChange:t.func,beforeUpload:t.func,files:t.array,showUploadList:t.bool,maxCount:t.number,maxSize:t.number,btnText:t.string,btnStyle:t.object,showSize:t.bool,disabled:t.bool};const ro=["root","icon","content","actions","closeIcon"],xt={cancel:"取消",action:"操作"},gt={small:{rootClass:"px-[15px] py-[8px] h-[45px] rounded-[6px] gap-[8px] border",iconSize:20,contentClass:"text-[14px]",closeIconSize:18,buttonBorderRadius:"0.8rem",buttonGap:"8px",buttonFontSize:"13px"},normal:{rootClass:"px-[20px] py-[10px] h-[52px] rounded-[8px] gap-[10px] border",iconSize:22,contentClass:"text-[15px]",closeIconSize:20,buttonBorderRadius:"1rem",buttonGap:"10px",buttonFontSize:"14px"},large:{rootClass:"px-[25px] py-[12px] h-[60px] rounded-[10px] gap-[12px] border-[1.5px]",iconSize:26,contentClass:"text-[16px]",closeIconSize:22,buttonBorderRadius:"1.2rem",buttonGap:"12px",buttonFontSize:"15px"}},ft={info:{bgVar:"--banner-info-bg",borderVar:"--banner-info-border",iconVar:"--banner-info-icon",textVar:"--banner-info-text"},success:{bgVar:"--banner-success-bg",borderVar:"--banner-success-border",iconVar:"--banner-success-icon",textVar:"--banner-success-text"},warning:{bgVar:"--banner-warning-bg",borderVar:"--banner-warning-border",iconVar:"--banner-warning-icon",textVar:"--banner-warning-text"},error:{bgVar:"--banner-error-bg",borderVar:"--banner-error-border",iconVar:"--banner-error-icon",textVar:"--banner-error-text"}},ht=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Ke(e){const{children:s,onCancel:r=()=>{},onAction:n=()=>{},size:c="normal",cancelText:l,actionText:a,level:i="info",transparent:p=!1,bannerBgColor:h,bannerBorderColor:u,bannerIconColor:m,sx:f={},style:C={},className:L="",i18nKey:P,localeText:D={},...N}=e,{t:S}=re(),v=ht(c,"normal",gt),T=ht(i,"info",ft),b=gt[v],y=ft[T],M=W(f,ro),_={cancel:S("banner.cancel",xt.cancel),action:S("banner.action",xt.action),...D},E=l??(P==="cancel"?S("banner.cancel",_.cancel):_.cancel),O=a??(P==="action"?S("banner.action",_.action):_.action),k=s??E,w=h||(p===!0?"transparent":`var(${y.bgVar})`),j=u||`var(${y.borderVar})`,U=m||`var(${y.iconVar})`,I=`var(${y.textVar})`,$=x({baseClassName:z("flex w-full items-center justify-start transition-colors duration-200",b.rootClass),className:L,style:{backgroundColor:w,borderColor:j,color:p===!0?"var(--muted-foreground)":I,...C},sxSlot:M.root}),A=x({baseClassName:"shrink-0",baseStyle:{width:`${b.iconSize}px`,height:`${b.iconSize}px`,color:U},sxSlot:M.icon}),F=x({baseClassName:z("flex-grow text-left",b.contentClass),sxSlot:M.content}),H=x({baseClassName:"flex items-center justify-end flex-1",baseStyle:{gap:b.buttonGap},sxSlot:M.actions}),K=x({baseClassName:"shrink-0 cursor-pointer",baseStyle:{width:`${b.closeIconSize}px`,height:`${b.closeIconSize}px`,color:"var(--banner-close-icon)"},sxSlot:M.closeIcon}),Z=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z"}),o.jsx("path",{d:"M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z"}),o.jsx("path",{d:"M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z"})]}),R=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z"}),o.jsx("path",{d:"M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z"}),o.jsx("path",{d:"M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z"})]}),J=o.jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("path",{d:"M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z"})}),le=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z"}),o.jsx("path",{d:"M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z"})]}),de=o.jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("path",{d:"M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z"})}),ue={success:le,warning:R,error:J,info:Z};return o.jsxs("div",{className:$.className,style:$.style,"data-level":T,"data-size":v,...N,children:[o.jsx("div",{className:A.className,style:A.style,children:ue[T]}),o.jsx("div",{className:F.className,style:F.style,children:k}),o.jsxs("div",{className:H.className,style:H.style,children:[o.jsx(oe,{type:"transparent",sx:{c:"var(--banner-btn-text)",br:b.buttonBorderRadius,bColor:"transparent",s:b.buttonFontSize},onClick:r,size:v==="normal"?"medium":v,children:E}),o.jsx(oe,{type:"transparent",sx:{c:"var(--banner-btn-text)",br:b.buttonBorderRadius,b:1,bColor:"var(--banner-btn-border)",s:b.buttonFontSize},onClick:n,size:v==="normal"?"medium":v,children:O}),o.jsx("div",{className:K.className,style:K.style,onClick:r,children:de})]})]})}Ke.propTypes={children:t.node,onCancel:t.func,onAction:t.func,size:t.oneOf(["small","normal","large"]),cancelText:t.string,actionText:t.string,level:t.oneOf(["info","success","warning","error"]),transparent:t.bool,bannerBgColor:t.string,bannerBorderColor:t.string,bannerIconColor:t.string,sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,i18nKey:t.string,localeText:t.object};const ao=["root","input","text"],Ve={hex:"HEX",rgb:"RGB",hsl:"HSL"},yt={small:{inputSize:20,fontSize:"11px",gap:"6px"},medium:{inputSize:28,fontSize:"12px",gap:"10px"},large:{inputSize:36,fontSize:"14px",gap:"14px"}},no={hex:"hex",rgb:"rgb",hsl:"hsl"},vt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s,lo=e=>{const s=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),n=parseInt(e.slice(5,7),16);return`rgb(${s}, ${r}, ${n})`},co=e=>{let s=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;const c=Math.max(s,r,n),l=Math.min(s,r,n);let a=0,i=0,p=(c+l)/2;if(c!==l){const h=c-l;i=p>.5?h/(2-c-l):h/(c+l),c===s?a=(r-n)/h+(r<n?6:0):c===r?a=(n-s)/h+2:a=(s-r)/h+4,a/=6}return`hsl(${Math.round(a*360)}, ${Math.round(i*100)}%, ${Math.round(p*100)}%)`},io=(e,s)=>{switch(s){case"rgb":return lo(e);case"hsl":return co(e);default:return e.toUpperCase()}};function Ue(e){const{value:s,defaultValue:r="#000000",onChange:n=()=>{},disabled:c=!1,showText:l=!1,format:a="hex",size:i="medium",sx:p={},style:h={},className:u="",i18nKey:m,localeText:f={},...C}=e,{t:L}=re(),P=vt(i,"medium",yt),D=vt(a,"hex",no),N=yt[P],[S,v]=d.useState(r),T=s??S,b=W(p,ao),y={hex:L("colorpicker.hex",Ve.hex),rgb:L("colorpicker.rgb",Ve.rgb),hsl:L("colorpicker.hsl",Ve.hsl),...f},M=j=>{const U=j.target.value;s===void 0&&v(U),n(U)},_=[];if(l){const j=m||(typeof l=="string"?l:null)||D;_.push({label:y[j],value:io(T,j)})}const E=x({baseClassName:z("inline-flex items-center",c&&"cursor-not-allowed opacity-60"),className:u,baseStyle:{gap:N.gap},style:h,sxSlot:b.root}),O=x({baseClassName:z("shrink-0 cursor-pointer border-2 border-[var(--border)] rounded-full bg-transparent overflow-hidden transition-colors duration-200",c&&"cursor-not-allowed"),baseStyle:{width:`${N.inputSize}px`,height:`${N.inputSize}px`,padding:0},sxSlot:b.input}),k=x({baseClassName:"flex flex-col text-[var(--muted-foreground)]",baseStyle:{fontSize:N.fontSize},sxSlot:b.text});return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("react"),Wt=require("react-dom"),t=require("prop-types"),Zt=require("tailwind-merge"),tt="tango:theme",st="tango:themeTokens",Gt="light",qt=["primary","input-accent","modal-ok-bg","drawer-ok-bg","datepicker-confirm-bg"],Lt=d.createContext(null),Pt=()=>typeof window<"u",ot=(e,s)=>{if(!Pt())return s;try{const r=window.localStorage.getItem(e);return r?JSON.parse(r):s}catch{return s}},rt=(e,s)=>{if(Pt())try{window.localStorage.setItem(e,JSON.stringify(s))}catch{}};function Xt({children:e}){const[s,r]=d.useState(()=>ot(tt,Gt)==="dark"?"dark":"light"),[n,c]=d.useState(()=>ot(st,{})),l=d.useRef(new Set);d.useEffect(()=>{typeof document>"u"||(document.documentElement.dataset.theme=s)},[s]),d.useEffect(()=>{rt(tt,s)},[s]),d.useEffect(()=>{if(typeof document>"u")return;const u=document.documentElement,m=new Set(Object.keys(n));l.current.forEach(f=>{m.has(f)||u.style.removeProperty(`--${f}`)}),Object.entries(n).forEach(([f,C])=>{C==null||C===""?u.style.removeProperty(`--${f}`):u.style.setProperty(`--${f}`,String(C))}),l.current=m,rt(st,n)},[n]);const a=u=>{c(m=>{const f=typeof u=="function"?u(m):u;return{...m,...f||{}}})},i=(u,m=qt)=>{a(f=>{const C={...f};return m.forEach(L=>{C[L]=u}),C})},p=()=>{c({})},h=()=>{r(u=>u==="dark"?"light":"dark")};return o.jsx(Lt.Provider,{value:{theme:s,setTheme:r,toggleTheme:h,themeTokens:n,setThemeTokens:a,setThemeColor:i,resetThemeTokens:p},children:e})}function Jt(){return d.useContext(Lt)}const Qt=new Set(["root","slots","tw","className","css","style"]),Pe={tw:"",css:{}},be=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Y=(e,s="px")=>typeof e=="number"?`${e}${s}`:e,me=e=>typeof e=="string"&&e.startsWith("$")?`var(--${e.slice(1)})`:e,es=e=>e.includes("-")?e.replace(/-([a-z])/g,(s,r)=>r.toUpperCase()):e,ts=e=>/(color|background|border|fill|stroke|shadow)$/i.test(e),ss={mt:(e,s)=>{e.marginTop=Y(s)},mr:(e,s)=>{e.marginRight=Y(s)},mb:(e,s)=>{e.marginBottom=Y(s)},ml:(e,s)=>{e.marginLeft=Y(s)},mx:(e,s)=>{e.marginLeft=Y(s),e.marginRight=Y(s)},my:(e,s)=>{e.marginTop=Y(s),e.marginBottom=Y(s)},m:(e,s)=>{e.margin=Y(s)},pt:(e,s)=>{e.paddingTop=Y(s)},pr:(e,s)=>{e.paddingRight=Y(s)},pb:(e,s)=>{e.paddingBottom=Y(s)},pl:(e,s)=>{e.paddingLeft=Y(s)},px:(e,s)=>{e.paddingLeft=Y(s),e.paddingRight=Y(s)},py:(e,s)=>{e.paddingTop=Y(s),e.paddingBottom=Y(s)},p:(e,s)=>{e.padding=Y(s)},g:(e,s)=>{e.gap=Y(s)},rg:(e,s)=>{e.rowGap=Y(s)},cg:(e,s)=>{e.columnGap=Y(s)},w:(e,s)=>{e.width=Y(s)},h:(e,s)=>{e.height=Y(s)},mw:(e,s)=>{e.minWidth=Y(s)},mh:(e,s)=>{e.minHeight=Y(s)},maxw:(e,s)=>{e.maxWidth=Y(s)},maxh:(e,s)=>{e.maxHeight=Y(s)},vw:(e,s)=>{e.width=typeof s=="number"?`${s}vw`:s},vh:(e,s)=>{e.height=typeof s=="number"?`${s}vh`:s},presentw:(e,s)=>{e.width=typeof s=="number"?`${s}%`:s},presenth:(e,s)=>{e.height=typeof s=="number"?`${s}%`:s},size:(e,s)=>{e.fontSize=Y(s)},fw:(e,s)=>{e.fontWeight=s},fwb:e=>{e.fontWeight="bold"},fwn:e=>{e.fontWeight="normal"},tac:e=>{e.textAlign="center"},tar:e=>{e.textAlign="right"},tal:e=>{e.textAlign="left"},lh:(e,s)=>{e.lineHeight=Y(s)},ls:(e,s)=>{e.letterSpacing=Y(s)},c:(e,s)=>{e.color=me(s)},bg:(e,s)=>{e.background=me(s)},bgc:(e,s)=>{e.backgroundColor=me(s)},b:(e,s)=>{e.border=s===1?"1px solid var(--border)":me(s)},br:(e,s)=>{e.borderRadius=Y(s)},bw:(e,s)=>{e.borderWidth=Y(s)},bs:(e,s)=>{e.borderStyle=s},bColor:(e,s)=>{e.borderColor=me(s)},boxshadow:(e,s)=>{e.boxShadow=me(s)},bgSize:(e,s)=>{e.backgroundSize=s},bgPosition:(e,s)=>{e.backgroundPosition=s},bgRepeat:(e,s)=>{e.backgroundRepeat=s},rel:e=>{e.position="relative"},ab:e=>{e.position="absolute"},fixed:e=>{e.position="fixed"},sticky:e=>{e.position="sticky"},center:e=>{e.position="absolute",e.inset=0,e.margin="auto"},inset:(e,s)=>{e.inset=Y(s)},top:(e,s)=>{e.top=Y(s)},right:(e,s)=>{e.right=Y(s)},bottom:(e,s)=>{e.bottom=Y(s)},left:(e,s)=>{e.left=Y(s)},z:(e,s)=>{e.zIndex=s},flex:e=>{e.display="flex"},iflex:e=>{e.display="inline-flex"},fd:(e,s)=>{e.flexDirection=s},fwrap:(e,s="wrap")=>{e.flexWrap=s},aic:e=>{e.alignItems="center"},ai:(e,s)=>{e.alignItems=s},jcc:e=>{e.justifyContent="center"},jc:(e,s)=>{e.justifyContent=s},ac:(e,s)=>{e.alignContent=s},as:(e,s)=>{e.alignSelf=s},f:(e,s)=>{e.flex=typeof s=="number"?s:`${s}`},fl:e=>{e.float="left"},fr:e=>{e.float="right"},ar:(e,s)=>{e.aspectRatio=s},tran:(e,s)=>{e.transition=typeof s=="number"?`${s}s`:s},op:(e,s)=>{e.opacity=s},oh:e=>{e.overflow="hidden"},ohauto:e=>{e.overflow="auto"},oxh:e=>{e.overflowX="hidden"},oxa:e=>{e.overflowX="auto"},oyh:e=>{e.overflowY="hidden"},oya:e=>{e.overflowY="auto"},cur:(e,s)=>{e.cursor=s},pe:(e,s)=>{e.pointerEvents=s},boxsizing:e=>{e.boxSizing="border-box"},none:e=>{e.display="none"},block:e=>{e.display="block"},inline:e=>{e.display="inline"},ib:e=>{e.display="inline-block"},hidden:e=>{e.visibility="hidden"},shown:e=>{e.visibility="visible"}},ve=(e={})=>be(e)?Object.entries(e).reduce((s,[r,n])=>{if(Qt.has(r))return s;const c=ss[r];if(c)return c(s,n),s;const l=es(r),a=typeof n=="string"&&(n.startsWith("$")||ts(l))?me(n):n;return s[l]=a,s},{}):{},z=(...e)=>{const s=e.filter(Boolean).join(" ").trim();return s?Zt.twMerge(s):""},Te=e=>{if(typeof e=="string")return{tw:e,css:{}};if(!be(e))return{...Pe};if(!("tw"in e||"className"in e||"css"in e||"style"in e))return{tw:"",css:ve(e)};const r=[e.className,e.tw].filter(Boolean).join(" "),n=be(e.css)?ve(e.css):{},c=be(e.style)?ve(e.style):{};return{tw:r,css:{...n,...c}}},os=(e,s)=>be(e)?"root"in e||"slots"in e||"tw"in e||"className"in e||"css"in e||"style"in e?!0:s.some(r=>r!=="root"&&r in e):!1,rs=e=>{const s={};return e.forEach(r=>{s[r]={...Pe}}),s.root||(s.root={...Pe}),s},W=(e,s=["root"])=>{const r=rs(s);if(typeof e=="string")return r.root.tw=e,r;if(!be(e))return r;if(!os(e,s))return r.root.css=ve(e),r;const n=Te({tw:[e.className,e.tw].filter(Boolean).join(" "),css:e.css,style:e.style}),c=Te(e.root);r.root={tw:z(n.tw,c.tw),css:{...n.css,...c.css}};const l=be(e.slots)?e.slots:{};return Object.keys(r).forEach(a=>{if(a==="root")return;const i=Te(e[a]),p=Te(l[a]);r[a]={tw:z(i.tw,p.tw),css:{...i.css,...p.css}}}),r},x=({baseClassName:e="",className:s="",baseStyle:r={},style:n={},sxSlot:c=Pe}={})=>({className:z(e,s,c.tw),style:{...r||{},...c.css||{},...n||{}}}),as=["root","icon","content"],at={success:"text-[var(--notice-success-text)]",fail:"text-[var(--notice-fail-text)]",caution:"text-[var(--notice-caution-text)]"},nt={default:{base:"fixed top-5 left-1/2 -translate-x-1/2",enter:"animate-[noticeSlideDown_0.3s_cubic-bezier(0.22,1,0.36,1)_forwards]"},md:{base:"fixed bottom-5 left-5",enter:"animate-[noticeSlideFromBottom_0.3s_ease-out_forwards]"}};function ns(e,s){const{type:r="success",icon:n,message:c,variant:l="default",duration:a=3e3,onClose:i,sx:p={},style:h={},className:u="",...m}=e,[f,C]=d.useState(!1),L=at[r]?r:"success",P=nt[l]?l:"default",D=W(p,as),N=d.useCallback(()=>{C(!0);const M=setTimeout(()=>i==null?void 0:i(),300);return()=>clearTimeout(M)},[i]);d.useEffect(()=>{if(!i||a<=0)return;const M=setTimeout(N,a);return()=>clearTimeout(M)},[i,a,N]);const S=nt[P],v=P==="default"?"animate-[noticeSlideUpFade_0.3s_ease-in_forwards]":"animate-[noticeSlideToBottom_0.3s_ease-in_forwards]",T=x({baseClassName:z("inline-flex items-center gap-2 px-3 py-2 text-sm z-[999]","rounded-[var(--notice-radius)]","bg-[var(--notice-bg)] text-[var(--notice-foreground)]","shadow-[var(--notice-shadow)]",S.base,f?v:S.enter,P==="md"&&at[L]),className:u,sxSlot:D.root,baseStyle:{borderRadius:"var(--notice-radius)"},style:h}),b=x({baseClassName:"flex-shrink-0 text-[var(--notice-foreground)]",sxSlot:D.icon}),y=x({baseClassName:"inline-block",sxSlot:D.content});return o.jsxs("div",{ref:s,role:"alert",className:T.className,style:T.style,...m,children:[P!=="md"&&n&&o.jsx("span",{className:b.className,style:b.style,children:n}),o.jsx("span",{className:y.className,style:y.style,children:c})]})}const Ne=d.forwardRef(ns);Ne.displayName="Notice";Ne.propTypes={type:t.oneOf(["success","fail","caution"]),icon:t.node,message:t.node,variant:t.oneOf(["default","md"]),duration:t.number,onClose:t.func,sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string};const Ot=d.createContext(null),ls=o.jsx("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:o.jsx("path",{d:"M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0",fill:"var(--notice-success-text)"})}),cs=o.jsx("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:o.jsx("path",{d:"M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",fill:"var(--notice-fail-text)"})}),is=o.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em",children:[o.jsx("path",{d:"M512 909.061224c-218.906122 0-397.061224-178.155102-397.061224-397.061224s178.155102-397.061224 397.061224-397.061224 397.061224 178.155102 397.061224 397.061224-178.155102 397.061224-397.061224 397.061224z",fill:"var(--notice-caution-text)"}),o.jsx("path",{d:"M512 690.677551m-31.346939 0a31.346939 31.346939 0 1 0 62.693878 0 31.346939 31.346939 0 1 0-62.693878 0Z",fill:"var(--notice-fail-text)"}),o.jsx("path",{d:"M512 584.097959c-11.493878 0-20.897959-9.404082-20.897959-20.897959v-261.22449c0-11.493878 9.404082-20.897959 20.897959-20.897959s20.897959 9.404082 20.897959 20.897959v261.22449c0 12.016327-9.404082 20.897959-20.897959 20.897959z",fill:"var(--notice-fail-text)"})]}),ds={success:ls,fail:cs,caution:is};function us({children:e}){const[s,r]=d.useState([]),[n,c]=d.useState(!1);d.useEffect(()=>{c(!0)},[]);const l=d.useCallback(i=>{r(p=>p.filter(h=>h.id!==i))},[]),a=d.useCallback((i,p,h="default")=>{const u=Date.now()+Math.random();r(m=>[...m,{id:u,type:i,message:p,variant:h,icon:ds[i]}])},[]);return o.jsxs(Ot.Provider,{value:{add:a,remove:l},children:[e,n&&Wt.createPortal(o.jsx("div",{id:"notification-container",className:"flex flex-col items-center gap-2",children:s.map(i=>o.jsx(Ne,{...i,onClose:()=>l(i.id)},i.id))}),document.body)]})}function ps(){const e=d.useContext(Ot);if(!e)throw new Error("useNotice must be used inside <NoticeProvider />");return e}function ms(){const{add:e}=ps();return{success:s=>e("success",s),fail:s=>e("fail",s),caution:s=>e("caution",s),md:{success:s=>e("success",s,"md"),fail:s=>e("fail",s,"md"),caution:s=>e("caution",s,"md")}}}const _t="tango:locale",xe="zh-CN",bs={zh:"zh-CN",ZH:"zh-CN","zh-CN":"zh-CN","zh-cn":"zh-CN",cn:"zh-CN",CN:"zh-CN",en:"en-US",EN:"en-US","en-US":"en-US","en-us":"en-US",us:"en-US",US:"en-US"},At={"zh-CN":{button:{default:"按钮",loading:"加载中",iconAlt:"图标",toggle:"切换",light:"浅色",dark:"暗色",blue:"蓝色",green:"绿色",token:"自定义词条",reset:"重置",locale:"语言",chinese:"中文",english:"英文",successDemo:"成功",outlineDemo:"描边",submit:"提交",confirm:"确认",cancel:"取消",search:"搜索",save:"保存",delete:"删除",back:"返回",next:"下一步",prev:"上一步",add:"新增"},banner:{cancel:"取消",action:"操作"},colorpicker:{hex:"HEX",rgb:"RGB",hsl:"HSL"},date:{weekdayPrefix:"星期",weekdayShortPrefix:"周"},datepicker:{placeholder:"YYYY-MM-DD",placeholderTime:"YYYY-MM-DD HH:mm",timeLabel:"时间",confirm:"确定",cancel:"关闭",prevMonth:"上一月",nextMonth:"下一月"},drawer:{title:"基础标题",okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},modal:{title:"基础标题",okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},search:{placeholder:"请输入内容",btnText:"搜索"},materialInput:{label:""},materialButton:{default:"按钮",loading:"加载中",iconAlt:"图标"},table:{empty:"暂无数据",prev:"上一页",next:"下一页",page:"页",total:"共 {total} 条",perPage:"条/页"}},"en-US":{button:{default:"Button",loading:"Loading",iconAlt:"icon",toggle:"Toggle",light:"Light",dark:"Dark",blue:"Blue",green:"Green",token:"Token",reset:"Reset",locale:"Locale",chinese:"Chinese",english:"English",successDemo:"Success",outlineDemo:"Outline",submit:"Submit",confirm:"Confirm",cancel:"Cancel",search:"Search",save:"Save",delete:"Delete",back:"Back",next:"Next",prev:"Previous",add:"Add"},banner:{cancel:"Cancel",action:"Action"},colorpicker:{hex:"HEX",rgb:"RGB",hsl:"HSL"},date:{weekdayPrefix:"",weekdayShortPrefix:""},datepicker:{placeholder:"YYYY-MM-DD",placeholderTime:"YYYY-MM-DD HH:mm",timeLabel:"Time",confirm:"Confirm",cancel:"Close",prevMonth:"Previous month",nextMonth:"Next month"},drawer:{title:"Drawer",okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},modal:{title:"Modal",okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},search:{placeholder:"Search...",btnText:"Search"},materialInput:{label:""},materialButton:{default:"Button",loading:"Loading",iconAlt:"icon"},table:{empty:"No data",prev:"Previous",next:"Next",page:"Page",total:"{total} items",perPage:"/ page"}}},Ye=()=>{},Mt=d.createContext({locale:xe,setLocale:Ye,toggleLocale:Ye,messages:At,t:(e,s="")=>s}),lt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zt=(e,s)=>{const r={...e};return Object.entries(s||{}).forEach(([n,c])=>{lt(c)&<(r[n])?r[n]=zt(r[n],c):r[n]=c}),r},xs=(e,s)=>s.split(".").reduce((r,n)=>{if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},e),Se=e=>typeof e!="string"||!e.trim()?xe:bs[e]||e,gs=()=>{if(typeof window>"u")return xe;try{const e=window.localStorage.getItem(_t);return Se(e||xe)}catch{return xe}};function fs({children:e,locale:s,defaultLocale:r=xe,onLocaleChange:n=Ye,messages:c={}}){const l=Se(r),a=s==null?null:Se(s),[i,p]=d.useState(()=>gs()||l),h=a||i,u=L=>{const P=Se(L);a==null&&p(P),n(P)};d.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(_t,h)}catch{}},[h]);const m=d.useMemo(()=>zt(At,c),[c]),f=()=>{u(h==="zh-CN"?"en-US":"zh-CN")},C=(L,P="")=>{const D=m[h]||m[xe]||{},N=xs(D,L);return N==null||N===""?P:String(N)};return o.jsx(Mt.Provider,{value:{locale:h,setLocale:u,toggleLocale:f,messages:m,t:C},children:e})}function re(){return d.useContext(Mt)}const hs="_materialBtn_wlueu_4",ys="_materialBtnSmall_wlueu_26",vs="_materialBtnMedium_wlueu_32",Ss="_materialBtnLarge_wlueu_38",Ns="_materialBtnHuge_wlueu_44",ws="_materialBtnDisabled_wlueu_51",Cs="_ripple_wlueu_59",he={materialBtn:hs,materialBtnSmall:ys,materialBtnMedium:vs,materialBtnLarge:Ss,materialBtnHuge:Ns,materialBtnDisabled:ws,ripple:Cs},ct=["root","content","icon","loading"],Ts={small:"small",medium:"medium",large:"large",huge:"huge"},ks={small:12,medium:14,large:16,huge:20},it={default:{backgroundColor:"var(--primary)",color:"var(--primary-foreground)",borderColor:"var(--border)"},transparent:{backgroundColor:"var(--transparent)",color:"var(--primary-foreground)",borderColor:"var(--button-transparent-border)"},danger:{backgroundColor:"var(--destructive)",color:"var(--destructive-foreground)",borderColor:"transparent"},success:{backgroundColor:"var(--success)",color:"var(--success-foreground)",borderColor:"transparent"}},js={default:{backgroundColor:"var(--transparent)",color:"var(--button-outline-foreground)",borderColor:"var(--border)"},transparent:{backgroundColor:"var(--transparent)",color:"var(--button-outline-foreground)",borderColor:"var(--button-transparent-border)"},danger:{backgroundColor:"var(--transparent)",color:"var(--destructive)",borderColor:"var(--destructive)"},success:{backgroundColor:"var(--transparent)",color:"var(--success)",borderColor:"var(--success)"}},Ls={backgroundColor:"var(--muted)",color:"var(--muted-foreground)",borderColor:"transparent",cursor:"not-allowed"},Fe={default:"按钮",loading:"加载中",iconAlt:"图标"},Ps=e=>e.charAt(0).toUpperCase()+e.slice(1),Os=e=>e===!0||e==="light"||e==="dark"?!0:Array.isArray(e)&&e.length>0?e[0]===!0||e[0]==="light"||e[0]==="dark":!1,_s=e=>e==="light"?"light":e==="dark"||e===!0||Array.isArray(e)&&e.length>=2&&e[1]==="dark"?"dark":"light",dt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Oe(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a=()=>{},children:i,disabled:p=!1,outline:h=!1,icon:u=null,iconPosition:m=null,loading:f=!1,i18nKey:C=null,localeText:L={},rippleColor:P,"aria-label":D,...N}=e,{t:S}=re(),v=d.useRef(null),T=dt(r,"medium",Ts),b=dt(s,"default",it),y=Os(f),M=_s(f),_=p||y,E=ks[T],O=m==="right"?"right":u||y?"left":null,k=P??"var(--material-button-ripple)",w={default:S("materialButton.default",Fe.default),loading:S("materialButton.loading",Fe.loading),iconAlt:S("materialButton.iconAlt",Fe.iconAlt),...L},U=(C&&typeof w[C]=="string"?w[C]:null)||(C?S(`materialButton.${C}`,w.default):w.default),I=y?w.loading:U,$=i??I,A=D||(i==null?String($||w.default):void 0),F=W(n,ct),H=_?Ls:h?js[b]:it[b],K=he[`materialBtn${Ps(T)}`],Z=F.root.css||{},R=typeof n=="string"?n:"",J=new Set([...ct,"root","slots","tw","className","css","style"]),le=typeof n=="object"?Object.fromEntries(Object.entries(n).filter(([ee])=>!J.has(ee))):{},de=[he.materialBtn,K,_&&he.materialBtnDisabled,F.root.tw,R,l].filter(Boolean).join(" "),ue={...H,...le,...Z,...c},pe=x({baseClassName:"inline-flex items-center relative z-[1]",sxSlot:F.content}),G=x({baseClassName:"inline-flex items-center justify-center shrink-0 transition-all duration-300 relative z-[1]",baseStyle:{width:`${E}px`,height:`${E}px`},sxSlot:F.icon}),X=x({baseClassName:"inline-flex items-center justify-center shrink-0 animate-spin relative z-[1]",baseStyle:{width:`${E}px`,height:`${E}px`,color:M==="light"?"var(--button-loading-light)":"var(--button-loading-dark)"},sxSlot:F.loading}),B=d.useCallback(ee=>{if(_)return;const se=v.current;if(!se)return;const g=document.createElement("span"),V=Math.max(se.clientWidth,se.clientHeight),Q=V/2;Object.assign(g.style,{width:`${V}px`,height:`${V}px`,left:`${ee.clientX-se.getBoundingClientRect().left-Q}px`,top:`${ee.clientY-se.getBoundingClientRect().top-Q}px`}),g.className=he.ripple,g.style.background=k;const ne=se.querySelector(`.${he.ripple}`);ne&&ne.remove(),se.appendChild(g)},[_,k]),q=()=>{if(!u)return null;if(typeof u=="string")return o.jsx("img",{src:u,alt:w.iconAlt,className:G.className,style:G.style,"aria-hidden":"true"});if(d.isValidElement(u))return d.cloneElement(u,{className:z(G.className,u.props.className),style:{...G.style,...u.props.style},"aria-hidden":!0});if(typeof u=="function"){const ee=u;return o.jsx(ee,{className:G.className,style:G.style,"aria-hidden":"true"})}return o.jsx("span",{className:G.className,style:G.style,"aria-hidden":"true",children:u})},ae=()=>o.jsx("svg",{viewBox:"0 0 1024 1024",role:"presentation",className:X.className,style:X.style,"aria-hidden":"true",children:o.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"currentColor"})});return o.jsxs("button",{ref:v,className:de,style:ue,onClick:ee=>{B(ee),a==null||a(ee)},disabled:_,"aria-label":A,"data-variant":b,"data-size":T,"data-icon-position":O||void 0,...N,children:[O==="left"&&o.jsxs(o.Fragment,{children:[y&&ae(),!y&&u&&q()]}),o.jsx("span",{className:pe.className,style:pe.style,children:$}),O==="right"&&o.jsxs(o.Fragment,{children:[y&&ae(),!y&&u&&q()]})]})}Oe.propTypes={type:t.oneOf(["default","transparent","danger","success"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,onClick:t.func,className:t.string,children:t.node,disabled:t.bool,outline:t.bool,icon:t.oneOfType([t.elementType,t.node,t.string]),iconPosition:t.oneOf(["left","right"]),loading:t.oneOfType([t.bool,t.oneOf(["light","dark"]),t.array]),i18nKey:t.string,localeText:t.object,rippleColor:t.string};const As=["root","content","icon","loading"],De={default:"按钮",loading:"加载中",iconAlt:"图标"},Ms="inline-flex select-none items-center justify-center whitespace-nowrap rounded-[var(--radius)] border align-middle font-medium tracking-[0.5px] transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--input-accent)] focus-visible:ring-offset-2",Re={small:{iconSize:12,className:"text-xs px-2 py-1 gap-1"},medium:{iconSize:14,className:"text-sm px-4 py-2 gap-1.5"},large:{iconSize:16,className:"text-base px-5 py-3 gap-2"},huge:{iconSize:20,className:"text-[25px] px-[45px] py-[18px] gap-3"}},ut={default:"bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",transparent:"bg-[var(--transparent)] text-[var(--primary-foreground)] border-[var(--button-transparent-border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",danger:"bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--destructive)]",success:"bg-[var(--success)] text-[var(--success-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--success)]"},zs="bg-[var(--transparent)]",Es={default:"text-[var(--button-outline-foreground)] border-[var(--border)]",transparent:"text-[var(--button-outline-foreground)] border-[var(--button-transparent-border)]",danger:"text-[var(--destructive)] border-[var(--destructive)]",success:"text-[var(--success)] border-[var(--success)]"},$s="shadow-[var(--button-enu-shadow)] hover:shadow-[var(--button-enu-hover-shadow)] active:translate-y-px active:shadow-[var(--button-enu-active-shadow)]",Bs={default:"bg-[var(--button-enu-bg)] text-[var(--button-enu-fg)] border-transparent",transparent:"bg-[var(--transparent)] text-[var(--button-enu-fg)] border-[var(--button-transparent-border)]",danger:"bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent",success:"bg-[var(--success)] text-[var(--success-foreground)] border-transparent"},Is="bg-[var(--muted)] text-[var(--muted-foreground)] border-transparent cursor-not-allowed shadow-none hover:shadow-none",Fs=e=>e===!0||e==="light"||e==="dark"?!0:Array.isArray(e)&&e.length>0?e[0]===!0||e[0]==="light"||e[0]==="dark":!1,Ds=e=>e==="light"?"light":e==="dark"||e===!0||Array.isArray(e)&&e.length>=2&&e[1]==="dark"?"dark":"light",pt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function oe(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a=()=>{},children:i,disabled:p=!1,outline:h=!1,enu:u=!1,icon:m=null,iconPosition:f=null,loading:C=!1,i18nKey:L=null,localeText:P={},"aria-label":D,...N}=e,{t:S}=re(),v=pt(r,"medium",Re),T=pt(s,"default",ut),b=Fs(C),y=Ds(C),M=p||b,_=Re[v].iconSize,E=f==="right"?"right":m||b?"left":null,O=W(n,As),k={default:S("button.default",De.default),loading:S("button.loading",De.loading),iconAlt:S("button.iconAlt",De.iconAlt),...P},j=(L&&typeof k[L]=="string"?k[L]:null)||(L?S(`button.${L}`,k.default):k.default),U=b?k.loading:j,I=i??U,$=D||(i==null?String(I||k.default):void 0);let A=ut[T];h&&(A=z(A,zs,Es[T])),u&&(A=z(A,$s,Bs[T]));const F=x({baseClassName:z(Ms,Re[v].className,A,M&&Is,b&&"cursor-wait"),className:l,style:c,sxSlot:O.root}),H=x({baseClassName:"inline-flex items-center",sxSlot:O.content}),K=x({baseClassName:"inline-flex items-center justify-center shrink-0 transition-all duration-300",baseStyle:{width:`${_}px`,height:`${_}px`},sxSlot:O.icon}),Z=x({baseClassName:"inline-flex items-center justify-center shrink-0 animate-spin",baseStyle:{width:`${_}px`,height:`${_}px`,color:y==="light"?"var(--button-loading-light)":"var(--button-loading-dark)"},sxSlot:O.loading}),R=()=>{if(!m)return null;if(typeof m=="string")return o.jsx("img",{src:m,alt:k.iconAlt,className:K.className,style:K.style,"aria-hidden":"true"});if(d.isValidElement(m))return d.cloneElement(m,{className:z(K.className,m.props.className),style:{...K.style,...m.props.style},"aria-hidden":!0});if(typeof m=="function"){const le=m;return o.jsx(le,{className:K.className,style:K.style,"aria-hidden":"true"})}return o.jsx("span",{className:K.className,style:K.style,"aria-hidden":"true",children:m})},J=()=>o.jsx("svg",{viewBox:"0 0 1024 1024",role:"presentation",className:Z.className,style:Z.style,"aria-hidden":"true",children:o.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"currentColor"})});return o.jsxs("button",{className:F.className,style:F.style,onClick:a,disabled:M,"aria-label":$,"data-variant":T,"data-size":v,"data-icon-position":E||void 0,...N,children:[E==="left"&&o.jsxs(o.Fragment,{children:[b&&J(),!b&&m&&R()]}),o.jsx("span",{className:H.className,style:H.style,children:I}),E==="right"&&o.jsxs(o.Fragment,{children:[b&&J(),!b&&m&&R()]})]})}oe.propTypes={type:t.oneOf(["default","transparent","danger","success"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,onClick:t.func,className:t.string,children:t.node,disabled:t.bool,outline:t.bool,enu:t.bool,icon:t.oneOfType([t.elementType,t.node,t.string]),iconPosition:t.oneOf(["left","right"]),loading:t.oneOfType([t.bool,t.oneOf(["light","dark"]),t.array]),i18nKey:t.string,localeText:t.object};oe.MaterialButton=Oe;const Rs=["root","input","label"],Vs={small:"small",medium:"medium",large:"large",huge:"huge"},Ys={small:{wrapper:"h-10 text-sm",label:"text-sm",labelFloat:"text-[10px]",pt:"pt-5"},medium:{wrapper:"h-12 text-base",label:"text-base",labelFloat:"text-xs",pt:"pt-6"},large:{wrapper:"h-14 text-lg",label:"text-lg",labelFloat:"text-sm",pt:"pt-7"},huge:{wrapper:"h-16 text-xl",label:"text-xl",labelFloat:"text-base",pt:"pt-8"}},Ks={label:""},Us=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function _e(e){const{size:s="medium",sx:r={},style:n={},className:c="",onChange:l,value:a,defaultValue:i,disabled:p=!1,label:h,localeText:u,type:m="text",...f}=e,{t:C}=re(),L=Us(s,"medium",Vs),P=a!==void 0,[D,N]=d.useState(i??""),[S,v]=d.useState(!1),T=P?a:D,b=S||String(T).length>0,y=h??(u==null?void 0:u.label)??C("materialInput.label",Ks.label),M=W(r,Rs),_={tw:z(M.root.tw,M.input.tw),css:{...M.root.css,...M.input.css}},E=z("relative inline-flex",M.root.tw),O=Ys[L],k=z("w-[300px] bg-transparent text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out","border-b border-b-[var(--border)]","hover:border-b-[var(--input-accent)]","focus:border-b-[var(--input-accent)]",p&&"text-[var(--muted-foreground)] border-b-[var(--muted)] cursor-not-allowed hover:border-b-[var(--muted)]",O.wrapper,O.pt),w=x({baseClassName:k,className:c,style:n,sxSlot:_}),j=z("absolute left-0 transition-all duration-200 ease-in-out pointer-events-none",b?`top-1 ${O.labelFloat} text-[var(--input-accent)]`:`top-1/2 -translate-y-1/2 ${O.label} text-[var(--muted-foreground)]`,S&&b&&"text-[var(--input-accent)]",p&&"text-[var(--muted-foreground)]",M.label.tw),U=x({baseClassName:j,sxSlot:{tw:"",css:M.label.css}}),I=d.useCallback(Z=>{const R=Z.target.value;P||N(R),l==null||l(R)},[P,l]),$=d.useCallback(Z=>{var R;v(!0),(R=f.onFocus)==null||R.call(f,Z)},[f.onFocus]),A=d.useCallback(Z=>{var R;v(!1),(R=f.onBlur)==null||R.call(f,Z)},[f.onBlur]),{onFocus:F,onBlur:H,...K}=f;return o.jsxs("div",{className:E,children:[o.jsx("input",{...K,type:m,className:w.className,style:w.style,value:T,disabled:p||void 0,onChange:I,onFocus:$,onBlur:A,"aria-label":y||void 0}),y&&o.jsx("label",{className:U.className,style:U.style,children:y})]})}_e.propTypes={size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,onChange:t.func,value:t.string,defaultValue:t.string,disabled:t.bool,label:t.string,localeText:t.shape({label:t.string}),type:t.string};const Hs=["root","input"],Ws={small:"small",medium:"medium",large:"large",huge:"huge"},Zs={small:"h-8 text-xs px-2.5",medium:"h-10 text-sm px-3",large:"h-12 text-base px-3.5",huge:"h-14 text-lg px-4"},Gs=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Ae(e){const{type:s="default",size:r="medium",sx:n={},style:c={},className:l="",onClick:a,onChange:i,value:p,defaultValue:h,disabled:u=!1,placeholder:m="",maxlength:f=524288,status:C,...L}=e,P=Gs(r,"medium",Ws),D=s==="textarea",N=s==="password",S=C==="error",v=W(n,Hs),T={tw:z(v.root.tw,v.input.tw),css:{...v.root.css,...v.input.css}},b=z("inline-flex",v.root.tw),y=z("w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out","border-[var(--border)] shadow-[var(--input-shadow)]","hover:border-[var(--input-accent)]","focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",S&&"border-[var(--input-error-border)] bg-[var(--input-error-bg)] text-[var(--input-error-fg)] hover:border-[var(--input-error-border)] focus:shadow-[var(--input-error-focus-shadow)]",u&&"bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",Zs[P]),M=x({baseClassName:y,className:l,style:c,sxSlot:T}),_=p!==void 0,E={className:M.className,style:M.style,onClick:a,onChange:i?O=>i(O.target.value):void 0,value:_?p:void 0,defaultValue:_?void 0:h??"",disabled:u||void 0,placeholder:m,maxLength:f,"aria-invalid":S||void 0,...N?{autoComplete:"current-password"}:{},...L};return o.jsx("div",{className:b,children:D?o.jsx("textarea",{...E,className:`${E.className} min-h-[80px] py-2 resize-y`}):o.jsx("input",{...E,type:N?"password":"text"})})}Ae.propTypes={type:t.oneOf(["default","textarea","password"]),size:t.oneOf(["small","medium","large","huge"]),sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,onClick:t.func,onChange:t.func,value:t.string,defaultValue:t.string,disabled:t.bool,placeholder:t.string,maxlength:t.number,status:t.oneOf(["default","error"])};Ae.MaterialInput=_e;const fe=["root"];function qs(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex items-center px-4 bg-[var(--layout-header-bg)] text-[var(--layout-header-color)]",className:c,sxSlot:i.root,baseStyle:{height:"var(--layout-header-height)",borderBottom:"1px solid var(--layout-border)"},style:n});return o.jsx("header",{ref:s,className:p.className,style:p.style,...a,children:l})}const Me=d.forwardRef(qs);Me.displayName="LayoutHeader";Me.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Xs(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex items-center px-4 bg-[var(--layout-footer-bg)] text-[var(--layout-footer-color)]",className:c,sxSlot:i.root,baseStyle:{height:"var(--layout-footer-height)",borderTop:"1px solid var(--layout-border)"},style:n});return o.jsx("footer",{ref:s,className:p.className,style:p.style,...a,children:l})}const ze=d.forwardRef(Xs);ze.displayName="LayoutFooter";ze.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Js(e,s){const{sx:r={},style:n={},className:c="",width:l,children:a,...i}=e,p=W(r,fe),h=l??"var(--layout-sider-width)",u=x({baseClassName:"overflow-auto flex flex-col bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",className:c,sxSlot:p.root,baseStyle:{width:h,minWidth:h,maxWidth:"100%",borderRight:"1px solid var(--layout-border)"},style:n});return o.jsx("aside",{ref:s,className:u.className,style:u.style,...i,children:a})}const we=d.forwardRef(Js);we.displayName="LayoutSider";we.propTypes={width:t.oneOfType([t.string,t.number]),sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function Qs(e,s){const{sx:r={},style:n={},className:c="",width:l,children:a,...i}=e,p=W(r,fe),h=l??"var(--layout-toc-width)",u=x({baseClassName:"overflow-auto flex flex-col bg-[var(--layout-toc-bg)] text-[var(--layout-toc-color)]",className:c,sxSlot:p.root,baseStyle:{width:h,minWidth:h,maxWidth:"100%",borderLeft:"1px solid var(--layout-border)"},style:n});return o.jsx("nav",{ref:s,className:u.className,style:u.style,...i,children:a})}const Ce=d.forwardRef(Qs);Ce.displayName="LayoutToc";Ce.propTypes={width:t.oneOfType([t.string,t.number]),sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function eo(e,s){const{sx:r={},style:n={},className:c="",children:l,...a}=e,i=W(r,fe),p=x({baseClassName:"flex-1 flex flex-col bg-[var(--layout-content-bg)] text-[var(--layout-content-color)]",className:c,sxSlot:i.root,baseStyle:{},style:n});return o.jsx("main",{ref:s,className:p.className,style:p.style,...a,children:l})}const Ee=d.forwardRef(eo);Ee.displayName="LayoutContent";Ee.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};function to(e,s){const{sx:r={},style:n={},className:c="",hasSider:l,children:a,...i}=e,p=W(r,fe),h=l??d.Children.toArray(a).some(m=>{var f,C;return d.isValidElement(m)&&(m.type===we||m.type===Ce||((f=m.type)==null?void 0:f.displayName)==="LayoutSider"||((C=m.type)==null?void 0:C.displayName)==="LayoutToc")}),u=x({baseClassName:z("flex flex-1 flex-col min-h-0",h?"md:flex-row":""),className:c,sxSlot:p.root,style:n});return o.jsx("section",{ref:s,className:u.className,style:u.style,...i,children:a})}const te=d.forwardRef(to);te.displayName="Layout";te.Header=Me;te.Footer=ze;te.Sider=we;te.Content=Ee;te.Toc=Ce;te.propTypes={hasSider:t.bool,sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,children:t.node};const Et=Me,$t=ze,Bt=we,It=Ee,Ft=Ce,so=["root","button","list","item"],Dt=Symbol("LIST_IGNORE"),mt=o.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[o.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),o.jsx("path",{d:"M14 2v6h6"})]}),bt=o.jsx("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:o.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function oo(e,s){const{sx:r={},style:n={},className:c="",accept:l="image/*",multiple:a=!1,onChange:i=()=>{},beforeUpload:p=()=>{},files:h=[],showUploadList:u=!0,maxCount:m=20,maxSize:f=100,btnText:C="选择文件",btnStyle:L,showSize:P=!0,disabled:D=!1,...N}=e,S=d.useId(),v=h||[],T=W(r,so),b=d.useCallback(async(k,w)=>{if(!p)return!0;try{const j=await p(k,w);return j===void 0?!0:j}catch{return!1}},[p]),y=d.useCallback(async k=>{const j=Array.from(k.target.files||[]).filter($=>$.size/1024/1024>f?(console.warn(`[Tango Upload] ${$.name} 超过 ${f}MB,已被过滤`),!1):!0),U=a?j.slice(0,m):j.slice(0,1),I=[];for(const $ of U){const A=await b($,U);if(A===!1){console.warn(`[Tango Upload] ${$.name} 被 beforeUpload 拦截`);continue}if(A===Dt){console.warn(`[Tango Upload] ${$.name} 被 LIST_IGNORE 忽略`);continue}if(A instanceof Blob){const F=A instanceof File?A:new File([A],$.name,{type:$.type});I.push(F)}else I.push($)}k.target.value="",i(I)},[a,m,f,b,i]),M=d.useCallback((k,w)=>{const j=v.filter((U,I)=>I!==w);i(j)},[v,i]),_=x({baseClassName:"inline-flex flex-col gap-3",className:c,sxSlot:T.root,style:n}),E=x({baseClassName:z("list-none p-0 m-0 max-h-[150px] max-w-[400px] overflow-y-auto","border border-[var(--upload-border)] rounded-[var(--upload-radius)]","bg-[var(--upload-list-bg)]",v.length===0&&"border-transparent"),baseStyle:{borderRadius:"var(--upload-radius)"},sxSlot:T.list}),O=x({baseClassName:z("flex items-center gap-2 px-3 py-1.5 text-sm","text-[var(--upload-item-text)] hover:bg-[var(--upload-item-hover-bg)]","transition-colors"),sxSlot:T.item});return o.jsxs("div",{ref:s,className:_.className,style:_.style,...N,children:[o.jsx("input",{id:S,type:"file",accept:l,multiple:a,className:"hidden",onChange:y,disabled:D,"aria-hidden":"true",tabIndex:-1}),o.jsx(oe,{disabled:D,style:L,sx:T.button,onClick:()=>{var k;return(k=document.getElementById(S))==null?void 0:k.click()},children:C}),u&&v.length>0&&o.jsx("ul",{className:E.className,style:E.style,children:a?v.map((k,w)=>o.jsxs("li",{className:O.className,style:O.style,children:[o.jsx("span",{className:"flex-shrink-0 text-[var(--upload-icon-color)]",children:mt}),o.jsxs("span",{className:"flex-1 truncate",children:[k.name,P&&o.jsxs("span",{className:"ml-1 text-xs text-[var(--muted-foreground)]",children:["(",(k.size/1024).toFixed(2)," KB)"]})]}),o.jsx("button",{type:"button",className:"flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",onClick:()=>M(k,w),"aria-label":`删除 ${k.name}`,children:bt})]},w)):o.jsxs("li",{className:O.className,style:O.style,children:[o.jsx("span",{className:"flex-shrink-0 text-[var(--upload-icon-color)]",children:mt}),o.jsxs("span",{className:"flex-1 truncate",children:[v[0].name,P&&o.jsxs("span",{className:"ml-1 text-xs text-[var(--muted-foreground)]",children:["(",(v[0].size/1024).toFixed(2)," KB)"]})]}),o.jsx("button",{type:"button",className:"flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",onClick:()=>M(v[0],0),"aria-label":`删除 ${v[0].name}`,children:bt})]})})]})}const $e=d.forwardRef(oo);$e.displayName="Upload";$e.LIST_IGNORE=Dt;$e.propTypes={sx:t.oneOfType([t.string,t.object]),style:t.object,className:t.string,accept:t.string,multiple:t.bool,onChange:t.func,beforeUpload:t.func,files:t.array,showUploadList:t.bool,maxCount:t.number,maxSize:t.number,btnText:t.string,btnStyle:t.object,showSize:t.bool,disabled:t.bool};const ro=["root","icon","content","actions","closeIcon"],xt={cancel:"取消",action:"操作"},gt={small:{rootClass:"px-[15px] py-[8px] h-[45px] rounded-[6px] gap-[8px] border",iconSize:20,contentClass:"text-[14px]",closeIconSize:18,buttonBorderRadius:"0.8rem",buttonGap:"8px",buttonFontSize:"13px"},normal:{rootClass:"px-[20px] py-[10px] h-[52px] rounded-[8px] gap-[10px] border",iconSize:22,contentClass:"text-[15px]",closeIconSize:20,buttonBorderRadius:"1rem",buttonGap:"10px",buttonFontSize:"14px"},large:{rootClass:"px-[25px] py-[12px] h-[60px] rounded-[10px] gap-[12px] border-[1.5px]",iconSize:26,contentClass:"text-[16px]",closeIconSize:22,buttonBorderRadius:"1.2rem",buttonGap:"12px",buttonFontSize:"15px"}},ft={info:{bgVar:"--banner-info-bg",borderVar:"--banner-info-border",iconVar:"--banner-info-icon",textVar:"--banner-info-text"},success:{bgVar:"--banner-success-bg",borderVar:"--banner-success-border",iconVar:"--banner-success-icon",textVar:"--banner-success-text"},warning:{bgVar:"--banner-warning-bg",borderVar:"--banner-warning-border",iconVar:"--banner-warning-icon",textVar:"--banner-warning-text"},error:{bgVar:"--banner-error-bg",borderVar:"--banner-error-border",iconVar:"--banner-error-icon",textVar:"--banner-error-text"}},ht=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s;function Ke(e){const{children:s,onCancel:r=()=>{},onAction:n=()=>{},size:c="normal",cancelText:l,actionText:a,level:i="info",transparent:p=!1,bannerBgColor:h,bannerBorderColor:u,bannerIconColor:m,sx:f={},style:C={},className:L="",i18nKey:P,localeText:D={},...N}=e,{t:S}=re(),v=ht(c,"normal",gt),T=ht(i,"info",ft),b=gt[v],y=ft[T],M=W(f,ro),_={cancel:S("banner.cancel",xt.cancel),action:S("banner.action",xt.action),...D},E=l??(P==="cancel"?S("banner.cancel",_.cancel):_.cancel),O=a??(P==="action"?S("banner.action",_.action):_.action),k=s??E,w=h||(p===!0?"transparent":`var(${y.bgVar})`),j=u||`var(${y.borderVar})`,U=m||`var(${y.iconVar})`,I=`var(${y.textVar})`,$=x({baseClassName:z("flex w-full items-center justify-start transition-colors duration-200",b.rootClass),className:L,style:{backgroundColor:w,borderColor:j,color:p===!0?"var(--muted-foreground)":I,...C},sxSlot:M.root}),A=x({baseClassName:"shrink-0",baseStyle:{width:`${b.iconSize}px`,height:`${b.iconSize}px`,color:U},sxSlot:M.icon}),F=x({baseClassName:z("flex-grow text-left",b.contentClass),sxSlot:M.content}),H=x({baseClassName:"flex items-center justify-end flex-1",baseStyle:{gap:b.buttonGap},sxSlot:M.actions}),K=x({baseClassName:"shrink-0 cursor-pointer",baseStyle:{width:`${b.closeIconSize}px`,height:`${b.closeIconSize}px`,color:"var(--banner-close-icon)"},sxSlot:M.closeIcon}),Z=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z"}),o.jsx("path",{d:"M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z"}),o.jsx("path",{d:"M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z"})]}),R=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z"}),o.jsx("path",{d:"M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z"}),o.jsx("path",{d:"M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z"})]}),J=o.jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("path",{d:"M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z"})}),le=o.jsxs("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z"}),o.jsx("path",{d:"M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z"})]}),de=o.jsx("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("path",{d:"M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z"})}),ue={success:le,warning:R,error:J,info:Z};return o.jsxs("div",{className:$.className,style:$.style,"data-level":T,"data-size":v,...N,children:[o.jsx("div",{className:A.className,style:A.style,children:ue[T]}),o.jsx("div",{className:F.className,style:F.style,children:k}),o.jsxs("div",{className:H.className,style:H.style,children:[o.jsx(oe,{type:"transparent",sx:{c:"var(--banner-btn-text)",br:b.buttonBorderRadius,bColor:"transparent",s:b.buttonFontSize},onClick:r,size:v==="normal"?"medium":v,children:E}),o.jsx(oe,{type:"transparent",sx:{c:"var(--banner-btn-text)",br:b.buttonBorderRadius,b:1,bColor:"var(--banner-btn-border)",s:b.buttonFontSize},onClick:n,size:v==="normal"?"medium":v,children:O}),o.jsx("div",{className:K.className,style:K.style,onClick:r,children:de})]})]})}Ke.propTypes={children:t.node,onCancel:t.func,onAction:t.func,size:t.oneOf(["small","normal","large"]),cancelText:t.string,actionText:t.string,level:t.oneOf(["info","success","warning","error"]),transparent:t.bool,bannerBgColor:t.string,bannerBorderColor:t.string,bannerIconColor:t.string,sx:t.oneOfType([t.object,t.string]),style:t.object,className:t.string,i18nKey:t.string,localeText:t.object};const ao=["root","input","text"],Ve={hex:"HEX",rgb:"RGB",hsl:"HSL"},yt={small:{inputSize:20,fontSize:"11px",gap:"6px"},medium:{inputSize:28,fontSize:"12px",gap:"10px"},large:{inputSize:36,fontSize:"14px",gap:"14px"}},no={hex:"hex",rgb:"rgb",hsl:"hsl"},vt=(e,s,r)=>Object.prototype.hasOwnProperty.call(r,e)?e:s,lo=e=>{const s=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),n=parseInt(e.slice(5,7),16);return`rgb(${s}, ${r}, ${n})`},co=e=>{let s=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;const c=Math.max(s,r,n),l=Math.min(s,r,n);let a=0,i=0,p=(c+l)/2;if(c!==l){const h=c-l;i=p>.5?h/(2-c-l):h/(c+l),c===s?a=(r-n)/h+(r<n?6:0):c===r?a=(n-s)/h+2:a=(s-r)/h+4,a/=6}return`hsl(${Math.round(a*360)}, ${Math.round(i*100)}%, ${Math.round(p*100)}%)`},io=(e,s)=>{switch(s){case"rgb":return lo(e);case"hsl":return co(e);default:return e.toUpperCase()}};function Ue(e){const{value:s,defaultValue:r="#000000",onChange:n=()=>{},disabled:c=!1,showText:l=!1,format:a="hex",size:i="medium",sx:p={},style:h={},className:u="",i18nKey:m,localeText:f={},...C}=e,{t:L}=re(),P=vt(i,"medium",yt),D=vt(a,"hex",no),N=yt[P],[S,v]=d.useState(r),T=s??S,b=W(p,ao),y={hex:L("colorpicker.hex",Ve.hex),rgb:L("colorpicker.rgb",Ve.rgb),hsl:L("colorpicker.hsl",Ve.hsl),...f},M=j=>{const U=j.target.value;s===void 0&&v(U),n(U)},_=[];if(l){const j=m||(typeof l=="string"?l:null)||D;_.push({label:y[j],value:io(T,j)})}const E=x({baseClassName:z("inline-flex items-center",c&&"cursor-not-allowed opacity-60"),className:u,baseStyle:{gap:N.gap},style:h,sxSlot:b.root}),O=x({baseClassName:z("shrink-0 cursor-pointer border-2 border-[var(--border)] rounded-full bg-transparent overflow-hidden transition-colors duration-200",c&&"cursor-not-allowed"),baseStyle:{width:`${N.inputSize}px`,height:`${N.inputSize}px`,padding:0},sxSlot:b.input}),k=x({baseClassName:"flex flex-col text-[var(--muted-foreground)]",baseStyle:{fontSize:N.fontSize},sxSlot:b.text});return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
|
|
3
3
|
.tango-cp-input::-webkit-color-swatch-wrapper { padding: 0; }
|
|
4
4
|
.tango-cp-input::-webkit-color-swatch { border: 0; border-radius: 9999px; }
|
|
5
5
|
.tango-cp-input::-moz-color-swatch { border: 0; border-radius: 9999px; }
|
package/dist/index.js
CHANGED
|
@@ -1528,13 +1528,13 @@ function Ho(e, o) {
|
|
|
1528
1528
|
width: l,
|
|
1529
1529
|
children: a,
|
|
1530
1530
|
...i
|
|
1531
|
-
} = e, u = W(r, we), h = b({
|
|
1531
|
+
} = e, u = W(r, we), h = l ?? "var(--layout-sider-width)", d = b({
|
|
1532
1532
|
baseClassName: "overflow-auto flex flex-col bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",
|
|
1533
1533
|
className: c,
|
|
1534
1534
|
sxSlot: u.root,
|
|
1535
1535
|
baseStyle: {
|
|
1536
|
-
width:
|
|
1537
|
-
minWidth:
|
|
1536
|
+
width: h,
|
|
1537
|
+
minWidth: h,
|
|
1538
1538
|
maxWidth: "100%",
|
|
1539
1539
|
borderRight: "1px solid var(--layout-border)"
|
|
1540
1540
|
},
|
|
@@ -1544,8 +1544,8 @@ function Ho(e, o) {
|
|
|
1544
1544
|
"aside",
|
|
1545
1545
|
{
|
|
1546
1546
|
ref: o,
|
|
1547
|
-
className:
|
|
1548
|
-
style:
|
|
1547
|
+
className: d.className,
|
|
1548
|
+
style: d.style,
|
|
1549
1549
|
...i,
|
|
1550
1550
|
children: a
|
|
1551
1551
|
}
|