import{j as i,t as o,r as p,u as h}from"./index-PIYO-9hw.js";function x({id:t,value:a,onChange:e,placeholder:r,disabled:s=!1,readOnly:n=!1,type:l="text",style:u,className:g}){const c={width:"100%",padding:"6px 10px",fontSize:o.typography.fontSizeMd,fontFamily:o.typography.fontFamily,color:o.colors.ink,backgroundColor:s||n?o.colors.bgLight:o.colors.white,border:`1px solid ${o.colors.border}`,borderRadius:o.radius.sm,outline:"none",boxSizing:"border-box",transition:`border-color ${o.transition.fast}, box-shadow ${o.transition.fast}`,...u};return i.jsx("input",{id:t,type:l,value:a,onChange:e,placeholder:r,disabled:s,readOnly:n,className:g,style:c,onFocus:d=>{!s&&!n&&(d.currentTarget.style.borderColor=o.colors.accentBorder,d.currentTarget.style.boxShadow=`0 0 0 2px ${o.colors.accentBg}`)},onBlur:d=>{d.currentTarget.style.borderColor=o.colors.border,d.currentTarget.style.boxShadow="none"}})}function m({id:t,options:a,value:e,onChange:r,placeholder:s,disabled:n=!1,style:l,className:u}){const g={padding:"6px 28px 6px 10px",fontSize:o.typography.fontSizeMd,fontFamily:o.typography.fontFamily,color:o.colors.muted,backgroundColor:o.colors.white,border:`1px solid ${o.colors.border}`,borderRadius:o.radius.md,outline:"none",cursor:n?"not-allowed":"pointer",boxSizing:"border-box",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",transition:`border-color ${o.transition.fast}`,opacity:n?.6:1,...l};return i.jsxs("select",{id:t,value:e,onChange:r,disabled:n,className:u,style:g,children:[s&&i.jsx("option",{value:"",disabled:!0,children:s}),a.map(c=>i.jsx("option",{value:c.value,children:c.label},c.value))]})}function y({size:t=24,style:a,className:e,delay:r=300}){const[s,n]=p.useState(r===0);return p.useEffect(()=>{if(r<=0){n(!0);return}const l=setTimeout(()=>n(!0),r);return()=>clearTimeout(l)},[r]),s?i.jsx("div",{className:e,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...a},children:i.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",style:{animation:"spin 0.8s linear infinite"},children:[i.jsx("style",{children:`
          @keyframes spin {
            to { transform: rotate(360deg); }
          }
        `}),i.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:o.colors.borderLight,strokeWidth:"3"}),i.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",fill:"none",stroke:o.colors.accent,strokeWidth:"3",strokeLinecap:"round"})]})}):null}const f=t=>({height:34,minWidth:34,fontSize:16,fontWeight:600,lineHeight:1,color:t?"#f0f6fc":"#1c2541",background:t?"rgba(88, 166, 255, 0.15)":"#eef2ff",border:`1px solid ${t?"#1f6feb":"#c7d2fe"}`,borderRadius:8,cursor:"pointer",padding:"0 10px",display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontFamily:o.typography.fontFamily,transition:`color ${o.transition.fast}, background ${o.transition.fast}, border-color ${o.transition.fast}, box-shadow ${o.transition.fast}`,boxShadow:t?"0 0 8px rgba(88, 166, 255, 0.3)":"0 1px 3px rgba(79, 70, 229, 0.15)"});function w({style:t,className:a}){const{isDark:e,toggle:r}=h();return i.jsx("button",{type:"button",className:a,onClick:r,title:e?"Switch to light mode":"Switch to dark mode","aria-label":e?"Switch to light mode":"Switch to dark mode",style:{...f(e),...t},children:e?"☀️":"🌙"})}export{x as I,y as S,w as T,m as a};
