@julien-wiegandt/open-ui 0.3.11 → 0.3.12
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/open-ui.js +4 -4
- package/dist/open-ui.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/open-ui.js
CHANGED
|
@@ -3639,7 +3639,7 @@ const Mf = (n, e) => {
|
|
|
3639
3639
|
Object.entries(c).forEach(([u, d]) => {
|
|
3640
3640
|
s.style.setProperty(`--oui-${a}-${u}`, d);
|
|
3641
3641
|
});
|
|
3642
|
-
})
|
|
3642
|
+
});
|
|
3643
3643
|
}, [e]);
|
|
3644
3644
|
const r = ({ index: s, theme: a }) => {
|
|
3645
3645
|
const c = s !== void 0 ? n.themes[s] : a;
|
|
@@ -5205,7 +5205,7 @@ const Li = {
|
|
|
5205
5205
|
size: m.size,
|
|
5206
5206
|
radius: m.radius,
|
|
5207
5207
|
onClick: () => F(A),
|
|
5208
|
-
children: /* @__PURE__ */ E(je, {
|
|
5208
|
+
children: /* @__PURE__ */ E(je, { style: { fontSize: "inherit" }, children: A.label })
|
|
5209
5209
|
},
|
|
5210
5210
|
A.key
|
|
5211
5211
|
))
|
|
@@ -5312,7 +5312,7 @@ const fh = Le.input`
|
|
|
5312
5312
|
i && /* @__PURE__ */ E(
|
|
5313
5313
|
je,
|
|
5314
5314
|
{
|
|
5315
|
-
color: s?.color ?? (c ? t.palette.error.main :
|
|
5315
|
+
color: s?.color ?? (c ? t.palette.error.main : void 0),
|
|
5316
5316
|
size: "12",
|
|
5317
5317
|
...s,
|
|
5318
5318
|
children: i
|
|
@@ -6167,7 +6167,7 @@ const Ch = Le.div`
|
|
|
6167
6167
|
i && /* @__PURE__ */ E(
|
|
6168
6168
|
je,
|
|
6169
6169
|
{
|
|
6170
|
-
color: s?.color ?? (c ? t.palette.error.main :
|
|
6170
|
+
color: s?.color ?? (c ? t.palette.error.main : void 0),
|
|
6171
6171
|
size: "12",
|
|
6172
6172
|
...s,
|
|
6173
6173
|
children: i
|
package/dist/open-ui.umd.cjs
CHANGED
|
@@ -120,7 +120,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Mi]+=1);const is=n=>typeof n=
|
|
|
120
120
|
|
|
121
121
|
${n=>n.hoverstyle&&Tr(n.hoverstyle)}
|
|
122
122
|
}
|
|
123
|
-
`,Er=_.createContext({theme:ec,setTheme:()=>{},autoContrast:!0}),Oi=()=>{const{autoContrast:n}=_.useContext(Er);return n},nc=n=>{if(n.themes.length===0)throw new Error("No themes provided");const[e,t]=_.useState(n.themes[0]);_.useLayoutEffect(()=>{const s=document.documentElement;s.style.setProperty("--oui-mode",e.mode??"light"),s.style.setProperty("--oui-radius",$e[e.radius]),s.style.setProperty("--oui-fg",e.semantic.foreground),s.style.setProperty("--oui-bg",e.semantic.background),s.style.setProperty("--oui-surface",e.semantic.surface),s.style.setProperty("--oui-muted",e.semantic.muted),s.style.setProperty("--oui-border",e.semantic.border),s.style.setProperty("--oui-shadow",e.semantic.shadow),Object.entries(e.palette).forEach(([a,c])=>{Object.entries(c).forEach(([u,f])=>{s.style.setProperty(`--oui-${a}-${u}`,f)})}),console.log("[Theme] Variables injected on root",e.mode)},[e]);const r=({index:s,theme:a})=>{const c=s!==void 0?n.themes[s]:a;if(!c)throw new Error("Theme not found");t(c)},i=n.autoContrast!==!1,o=_.useMemo(()=>({theme:e,setTheme:r,autoContrast:i}),[e,i]);return T.jsx(Er.Provider,{value:o,children:n.children})},rr=n=>{const e=n.trim().toLowerCase();if(e==="transparent")return"#000000";let t=0,r=0,i=0;if(e.startsWith("#")){let s=e.slice(1);if(s.length===3||s.length===4?s=s.slice(0,3).split("").map(a=>a+a).join(""):s.length===8&&(s=s.slice(0,6)),s.length!==6)throw new Error("Invalid hexadecimal color format.");t=parseInt(s.substring(0,2),16),r=parseInt(s.substring(2,4),16),i=parseInt(s.substring(4,6),16)}else if(e.startsWith("rgb")){const s=e.match(/-?\d+(\.\d+)?/g)?.map(Number);if(!s||s.length<3)throw new Error("Invalid RGB color format.");[t,r,i]=s}else if(e.startsWith("hsl")){const s=e.match(/-?\d+(\.\d+)?/g)?.map(Number);if(!s||s.length<3)throw new Error("Invalid HSL color format.");let[a,c,u]=s;c/=100,u/=100;const f=(1-Math.abs(2*u-1))*c,d=f*(1-Math.abs(a/60%2-1)),h=u-f/2;let l=0,g=0,p=0;0<=a&&a<60?(l=f,g=d,p=0):60<=a&&a<120?(l=d,g=f,p=0):120<=a&&a<180?(l=0,g=f,p=d):180<=a&&a<240?(l=0,g=d,p=f):240<=a&&a<300?(l=d,g=0,p=f):300<=a&&a<360&&(l=f,g=0,p=d),t=Math.round((l+h)*255),r=Math.round((g+h)*255),i=Math.round((p+h)*255)}else throw new Error("Unsupported color format.");if(isNaN(t)||isNaN(r)||isNaN(i))throw new Error("Invalid color values.");return(t*299+r*587+i*114)/1e3>=128?"#000000":"#FFFFFF"},Hd=n=>{const e=n.match(/rgba?\(\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?\s*\)/);return e?{r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:e[4]!==void 0?parseFloat(e[4]):1}:null},ic=(n,e)=>{const t=n.a+e.a*(1-n.a);return t===0?{r:255,g:255,b:255,a:0}:{r:(n.r*n.a+e.r*e.a*(1-n.a))/t,g:(n.g*n.a+e.g*e.a*(1-n.a))/t,b:(n.b*n.a+e.b*e.a*(1-n.a))/t,a:t}},jd=n=>{const e=[];let t=n;for(;t;){const r=window.getComputedStyle(t).backgroundColor,i=Hd(r);if(i&&i.a>0&&(e.push(i),i.a>=1))break;t=t.parentElement}return e},Xd=n=>{const e=jd(n);if(e.length===0)return"rgb(255, 255, 255)";let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)t=ic(e[r],t);return t.a<1&&(t=ic(t,{r:255,g:255,b:255,a:1})),`rgb(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)})`};function Me(n,e,t){const{theme:r}=_.useContext(Er),o=!Oi()||!!e,[s,a]=_.useState(t?rr(t):void 0);return _.useLayoutEffect(()=>{if(o)return;const c=n.current;if(!c)return;const u=()=>{try{const g=n.current;if(!g)return;const p=Xd(g),y=rr(p);a(y)}catch(g){console.error("[AutoContrast] error:",g)}};u();const d=[50,150,300,500].map(g=>setTimeout(u,g)),h=new MutationObserver(()=>{u()});let l=c;for(;l;)h.observe(l,{attributes:!0,attributeFilter:["style","class"]}),l=l.parentElement;return()=>{h.disconnect(),d.forEach(clearTimeout)}},[o,r]),o?void 0:s}function At(...n){return _.useCallback(e=>{n.forEach(t=>{t&&(typeof t=="function"?t(e):t.current=e)})},[...n])}const ue=_.forwardRef(({children:n,...e},t)=>{const r=_.useRef(null),i=At(t,r),o=Me(r,!!e.color),s=_.useMemo(()=>({...{display:"flex",direction:"column"},...e}),[e]);return T.jsx(Yd,{ref:i,...s,color:e.color??o,children:n})});ue.displayName="Flex";const oc=_.forwardRef(({hasNotification:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"currentColor",d=_.useRef(n);return _.useLayoutEffect(()=>{r&&n&&!d.current&&j.fromTo(c.current,{rotation:-15},{rotation:15,duration:.1,repeat:5,yoyo:!0,ease:"power2.inOut",transformOrigin:"50% 20%",onComplete:()=>{j.to(c.current,{rotation:0,duration:.2})}}),d.current=n},[n,r]),T.jsx("svg",{ref:h=>{a.current=h,typeof s=="function"?s(h):s&&(s.current=h)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:T.jsx("g",{ref:c,children:T.jsx("path",{d:"M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 01-3.46 0",stroke:f,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"})})})}),Di=_.forwardRef(({isVisible:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"currentColor";return _.useLayoutEffect(()=>{if(r&&c.current){const d=c.current,h=d.getTotalLength();n?j.fromTo(d,{strokeDasharray:h,strokeDashoffset:h,opacity:0},{strokeDashoffset:0,opacity:1,duration:.6,ease:"power3.out",delay:.2}):j.to(d,{strokeDashoffset:h,opacity:0,duration:.3,ease:"power2.in"})}},[n,r]),T.jsx("svg",{ref:d=>{a.current=d,typeof s=="function"?s(d):s&&(s.current=d)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:T.jsx("path",{ref:c,d:"M5 13L9 17L19 7",stroke:f,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",style:r?{opacity:n?void 0:0}:void 0})})}),sc=_.forwardRef(({isCopied:n,size:e=24,strokeWidth:t=2,animated:r=!0,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(n),d=Me(a,!!i),h=i??d??"currentColor";return _.useLayoutEffect(()=>{if(!r){j.set([c.current,u.current],{x:0,y:0,scale:1,opacity:1});return}const l=j.context(()=>{n||j.to(c.current,{x:1,y:1,duration:1.5,repeat:-1,yoyo:!0,ease:"sine.inOut"})});return n&&!f.current&&j.timeline().to(c.current,{scale:1.1,x:2,y:2,duration:.2,ease:"power2.out"}).to(c.current,{scale:1,x:0,y:0,duration:.4,ease:"bounce.out"}),f.current=n,()=>l.revert()},[n,r]),T.jsxs("svg",{ref:l=>{a.current=l,typeof s=="function"?s(l):s&&(s.current=l)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:h,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:[T.jsx("path",{ref:u,d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}),T.jsx("rect",{ref:c,width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",fill:"none"})]})}),ac=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=Me(s,!!r),d=r??f??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current,u.current],{y:0,opacity:1,scale:1});return}const h=j.context(()=>{const l=[a.current,c.current,u.current];j.to(l,{y:-4,duration:.5,repeat:-1,yoyo:!0,stagger:{each:.15,repeat:-1,yoyo:!0},ease:"power1.inOut"}),j.to(l,{opacity:.4,duration:.5,repeat:-1,yoyo:!0,stagger:{each:.15,repeat:-1,yoyo:!0},ease:"power1.inOut"})});return()=>h.revert()},[t]),T.jsxs("svg",{ref:h=>{s.current=h,typeof o=="function"?o(h):o&&(o.current=h)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("circle",{ref:a,cx:"5",cy:"12",r:"1",fill:d}),T.jsx("circle",{ref:c,cx:"12",cy:"12",r:"1",fill:d}),T.jsx("circle",{ref:u,cx:"19",cy:"12",r:"1",fill:d})]})}),lc=_.forwardRef(({isOpen:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),d=Me(a,!!i),h=i??d??"currentColor";return _.useLayoutEffect(()=>{if(!r)return;const l=j.timeline({defaults:{duration:.2,ease:"power2.inOut"}});n?l.to(c.current,{attr:{d:"M6 18L18 6"}},0).to(u.current,{autoAlpha:0},0).to(f.current,{attr:{d:"M6 6L18 18"}},0):l.to(c.current,{attr:{d:"M4 6L20 6"}},0).to(u.current,{autoAlpha:1},0).to(f.current,{attr:{d:"M4 18L20 18"}},0)},[n,r]),T.jsxs("svg",{ref:l=>{a.current=l,typeof s=="function"?s(l):s&&(s.current=l)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[T.jsx("path",{ref:c,d:"M4 6L20 6",stroke:h,strokeWidth:t,strokeLinecap:"round"}),T.jsx("path",{ref:u,d:"M4 12L20 12",stroke:h,strokeWidth:t,strokeLinecap:"round"}),T.jsx("path",{ref:f,d:"M4 18L20 18",stroke:h,strokeWidth:t,strokeLinecap:"round"})]})}),cc=_.forwardRef(({isLiked:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"#FF4500";return _.useLayoutEffect(()=>{if(!r){j.set(c.current,{fill:n?f:"none",stroke:f});return}const d=j.timeline({defaults:{duration:.2,ease:"power3.inOut"}});n?d.to(c.current,{fill:f,scale:1.2,transformOrigin:"center center"}).to(c.current,{scale:1}):d.to(c.current,{fill:"none"})},[n,r,f]),T.jsx("svg",{ref:d=>{a.current=d,typeof s=="function"?s(d):s&&(s.current=d)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:T.jsx("path",{ref:c,d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:f,strokeWidth:t,strokeLinejoin:"round",fill:"none"})})}),uc=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=Me(s,!!r),f=r??u??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current],{x:0,y:0,scale:1,opacity:1});return}const d=j.context(()=>{j.timeline({repeat:-1,defaults:{ease:"power2.inOut"}}).to([a.current,c.current],{x:25,opacity:0,duration:.8,ease:"power2.in"}).set([a.current,c.current],{x:-25}).to([a.current,c.current],{x:0,opacity:1,duration:.8,ease:"power2.out"}).to({},{duration:.4})});return()=>d.revert()},[t]),T.jsxs("svg",{ref:d=>{s.current=d,typeof o=="function"?o(d):o&&(o.current=d)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:f,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("path",{ref:a,d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"}),T.jsx("path",{ref:c,d:"M6 12h16"})]})}),fc=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=Me(s,!!r),d=r??f??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current,u.current],{scale:1,opacity:1,rotation:0});return}const h=j.context(()=>{j.to(a.current,{scale:1.1,rotation:5,duration:.8,repeat:-1,yoyo:!0,ease:"sine.inOut",transformOrigin:"center center"}),j.to(c.current,{opacity:.3,scale:.7,duration:.6,repeat:-1,yoyo:!0,ease:"power1.inOut",delay:.2,transformOrigin:"center center"}),j.to(u.current,{opacity:.3,scale:.7,duration:.7,repeat:-1,yoyo:!0,ease:"power1.inOut",delay:.4,transformOrigin:"center center"})});return()=>h.revert()},[t]),T.jsxs("svg",{ref:h=>{s.current=h,typeof o=="function"?o(h):o&&(o.current=h)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("path",{ref:a,d:"M9.937 15.5A2 2 0 0 0 8.5 14.063L2 12l6.5-2.063A2 2 0 0 0 9.937 8.5L12 2l2.063 6.5a2 2 0 0 0 1.437 1.437L22 12l-6.5 2.063a2 2 0 0 0-1.437 1.437L12 22l-2.063-6.5Z"}),T.jsxs("g",{ref:c,children:[T.jsx("path",{d:"M20 3v4"}),T.jsx("path",{d:"M19 5h4"})]}),T.jsxs("g",{ref:u,children:[T.jsx("path",{d:"M5 17v4"}),T.jsx("path",{d:"M4 19h4"})]})]})}),dc=_.forwardRef(({isSyncing:n=!1,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(n),f=Me(a,!!i),d=i??f??"currentColor";return _.useLayoutEffect(()=>{if(!r)return;const h=c.current,l=u.current;return h&&(!l&&n?j.to(h,{rotation:360,repeat:-1,ease:"linear",duration:1,transformOrigin:"50% 50%"}):n||(j.killTweensOf(h),j.set(h,{rotation:0}))),u.current=n,()=>{c.current&&j.killTweensOf(c.current)}},[n,r]),T.jsx("svg",{ref:h=>{a.current=h,typeof s=="function"?s(h):s&&(s.current=h)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:T.jsx("g",{ref:c,children:T.jsx("path",{d:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:d,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"})})})}),Ai={sm:768,md:1024,lg:1280,xl:1280},hc=()=>typeof window<"u"?window.innerWidth:0,an=()=>{const[n,e]=_.useState(hc());_.useEffect(()=>{const a=()=>{e(hc())};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]);const{breakpoint:t,isMobile:r,isTablet:i,isLaptop:o,isDesktop:s}=_.useMemo(()=>{let a="sm";return n>=Ai.lg?a="xl":n>=Ai.md?a="lg":n>=Ai.sm?a="md":a="sm",{breakpoint:a,isMobile:a==="sm",isTablet:a==="md",isLaptop:a==="lg",isDesktop:a==="xl"}},[n]);return{width:n,breakpoint:t,isMobile:r,isTablet:i,isLaptop:o,isDesktop:s}},Vd=["default","primary","secondary","error"];function _e(n,e){return typeof n=="string"&&!Vd.includes(n)?kr(n):e.palette[n]}const Ud=(n,e)=>e==="sm"?`${Number(n)/(8/7)}px`:`${n}px`,pc=n=>{switch(n){case"regular":return"400";case"medium":return"500";case"semibold":return"600";case"bold":return"700";default:return"400"}},qd=Re.p`
|
|
123
|
+
`,Er=_.createContext({theme:ec,setTheme:()=>{},autoContrast:!0}),Oi=()=>{const{autoContrast:n}=_.useContext(Er);return n},nc=n=>{if(n.themes.length===0)throw new Error("No themes provided");const[e,t]=_.useState(n.themes[0]);_.useLayoutEffect(()=>{const s=document.documentElement;s.style.setProperty("--oui-mode",e.mode??"light"),s.style.setProperty("--oui-radius",$e[e.radius]),s.style.setProperty("--oui-fg",e.semantic.foreground),s.style.setProperty("--oui-bg",e.semantic.background),s.style.setProperty("--oui-surface",e.semantic.surface),s.style.setProperty("--oui-muted",e.semantic.muted),s.style.setProperty("--oui-border",e.semantic.border),s.style.setProperty("--oui-shadow",e.semantic.shadow),Object.entries(e.palette).forEach(([a,c])=>{Object.entries(c).forEach(([u,f])=>{s.style.setProperty(`--oui-${a}-${u}`,f)})})},[e]);const r=({index:s,theme:a})=>{const c=s!==void 0?n.themes[s]:a;if(!c)throw new Error("Theme not found");t(c)},i=n.autoContrast!==!1,o=_.useMemo(()=>({theme:e,setTheme:r,autoContrast:i}),[e,i]);return T.jsx(Er.Provider,{value:o,children:n.children})},rr=n=>{const e=n.trim().toLowerCase();if(e==="transparent")return"#000000";let t=0,r=0,i=0;if(e.startsWith("#")){let s=e.slice(1);if(s.length===3||s.length===4?s=s.slice(0,3).split("").map(a=>a+a).join(""):s.length===8&&(s=s.slice(0,6)),s.length!==6)throw new Error("Invalid hexadecimal color format.");t=parseInt(s.substring(0,2),16),r=parseInt(s.substring(2,4),16),i=parseInt(s.substring(4,6),16)}else if(e.startsWith("rgb")){const s=e.match(/-?\d+(\.\d+)?/g)?.map(Number);if(!s||s.length<3)throw new Error("Invalid RGB color format.");[t,r,i]=s}else if(e.startsWith("hsl")){const s=e.match(/-?\d+(\.\d+)?/g)?.map(Number);if(!s||s.length<3)throw new Error("Invalid HSL color format.");let[a,c,u]=s;c/=100,u/=100;const f=(1-Math.abs(2*u-1))*c,d=f*(1-Math.abs(a/60%2-1)),h=u-f/2;let l=0,g=0,p=0;0<=a&&a<60?(l=f,g=d,p=0):60<=a&&a<120?(l=d,g=f,p=0):120<=a&&a<180?(l=0,g=f,p=d):180<=a&&a<240?(l=0,g=d,p=f):240<=a&&a<300?(l=d,g=0,p=f):300<=a&&a<360&&(l=f,g=0,p=d),t=Math.round((l+h)*255),r=Math.round((g+h)*255),i=Math.round((p+h)*255)}else throw new Error("Unsupported color format.");if(isNaN(t)||isNaN(r)||isNaN(i))throw new Error("Invalid color values.");return(t*299+r*587+i*114)/1e3>=128?"#000000":"#FFFFFF"},Hd=n=>{const e=n.match(/rgba?\(\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?\s*\)/);return e?{r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:e[4]!==void 0?parseFloat(e[4]):1}:null},ic=(n,e)=>{const t=n.a+e.a*(1-n.a);return t===0?{r:255,g:255,b:255,a:0}:{r:(n.r*n.a+e.r*e.a*(1-n.a))/t,g:(n.g*n.a+e.g*e.a*(1-n.a))/t,b:(n.b*n.a+e.b*e.a*(1-n.a))/t,a:t}},jd=n=>{const e=[];let t=n;for(;t;){const r=window.getComputedStyle(t).backgroundColor,i=Hd(r);if(i&&i.a>0&&(e.push(i),i.a>=1))break;t=t.parentElement}return e},Xd=n=>{const e=jd(n);if(e.length===0)return"rgb(255, 255, 255)";let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)t=ic(e[r],t);return t.a<1&&(t=ic(t,{r:255,g:255,b:255,a:1})),`rgb(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)})`};function Me(n,e,t){const{theme:r}=_.useContext(Er),o=!Oi()||!!e,[s,a]=_.useState(t?rr(t):void 0);return _.useLayoutEffect(()=>{if(o)return;const c=n.current;if(!c)return;const u=()=>{try{const g=n.current;if(!g)return;const p=Xd(g),y=rr(p);a(y)}catch(g){console.error("[AutoContrast] error:",g)}};u();const d=[50,150,300,500].map(g=>setTimeout(u,g)),h=new MutationObserver(()=>{u()});let l=c;for(;l;)h.observe(l,{attributes:!0,attributeFilter:["style","class"]}),l=l.parentElement;return()=>{h.disconnect(),d.forEach(clearTimeout)}},[o,r]),o?void 0:s}function At(...n){return _.useCallback(e=>{n.forEach(t=>{t&&(typeof t=="function"?t(e):t.current=e)})},[...n])}const ue=_.forwardRef(({children:n,...e},t)=>{const r=_.useRef(null),i=At(t,r),o=Me(r,!!e.color),s=_.useMemo(()=>({...{display:"flex",direction:"column"},...e}),[e]);return T.jsx(Yd,{ref:i,...s,color:e.color??o,children:n})});ue.displayName="Flex";const oc=_.forwardRef(({hasNotification:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"currentColor",d=_.useRef(n);return _.useLayoutEffect(()=>{r&&n&&!d.current&&j.fromTo(c.current,{rotation:-15},{rotation:15,duration:.1,repeat:5,yoyo:!0,ease:"power2.inOut",transformOrigin:"50% 20%",onComplete:()=>{j.to(c.current,{rotation:0,duration:.2})}}),d.current=n},[n,r]),T.jsx("svg",{ref:h=>{a.current=h,typeof s=="function"?s(h):s&&(s.current=h)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:T.jsx("g",{ref:c,children:T.jsx("path",{d:"M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 01-3.46 0",stroke:f,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"})})})}),Di=_.forwardRef(({isVisible:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"currentColor";return _.useLayoutEffect(()=>{if(r&&c.current){const d=c.current,h=d.getTotalLength();n?j.fromTo(d,{strokeDasharray:h,strokeDashoffset:h,opacity:0},{strokeDashoffset:0,opacity:1,duration:.6,ease:"power3.out",delay:.2}):j.to(d,{strokeDashoffset:h,opacity:0,duration:.3,ease:"power2.in"})}},[n,r]),T.jsx("svg",{ref:d=>{a.current=d,typeof s=="function"?s(d):s&&(s.current=d)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:T.jsx("path",{ref:c,d:"M5 13L9 17L19 7",stroke:f,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",style:r?{opacity:n?void 0:0}:void 0})})}),sc=_.forwardRef(({isCopied:n,size:e=24,strokeWidth:t=2,animated:r=!0,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(n),d=Me(a,!!i),h=i??d??"currentColor";return _.useLayoutEffect(()=>{if(!r){j.set([c.current,u.current],{x:0,y:0,scale:1,opacity:1});return}const l=j.context(()=>{n||j.to(c.current,{x:1,y:1,duration:1.5,repeat:-1,yoyo:!0,ease:"sine.inOut"})});return n&&!f.current&&j.timeline().to(c.current,{scale:1.1,x:2,y:2,duration:.2,ease:"power2.out"}).to(c.current,{scale:1,x:0,y:0,duration:.4,ease:"bounce.out"}),f.current=n,()=>l.revert()},[n,r]),T.jsxs("svg",{ref:l=>{a.current=l,typeof s=="function"?s(l):s&&(s.current=l)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:h,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:[T.jsx("path",{ref:u,d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}),T.jsx("rect",{ref:c,width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",fill:"none"})]})}),ac=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=Me(s,!!r),d=r??f??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current,u.current],{y:0,opacity:1,scale:1});return}const h=j.context(()=>{const l=[a.current,c.current,u.current];j.to(l,{y:-4,duration:.5,repeat:-1,yoyo:!0,stagger:{each:.15,repeat:-1,yoyo:!0},ease:"power1.inOut"}),j.to(l,{opacity:.4,duration:.5,repeat:-1,yoyo:!0,stagger:{each:.15,repeat:-1,yoyo:!0},ease:"power1.inOut"})});return()=>h.revert()},[t]),T.jsxs("svg",{ref:h=>{s.current=h,typeof o=="function"?o(h):o&&(o.current=h)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("circle",{ref:a,cx:"5",cy:"12",r:"1",fill:d}),T.jsx("circle",{ref:c,cx:"12",cy:"12",r:"1",fill:d}),T.jsx("circle",{ref:u,cx:"19",cy:"12",r:"1",fill:d})]})}),lc=_.forwardRef(({isOpen:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),d=Me(a,!!i),h=i??d??"currentColor";return _.useLayoutEffect(()=>{if(!r)return;const l=j.timeline({defaults:{duration:.2,ease:"power2.inOut"}});n?l.to(c.current,{attr:{d:"M6 18L18 6"}},0).to(u.current,{autoAlpha:0},0).to(f.current,{attr:{d:"M6 6L18 18"}},0):l.to(c.current,{attr:{d:"M4 6L20 6"}},0).to(u.current,{autoAlpha:1},0).to(f.current,{attr:{d:"M4 18L20 18"}},0)},[n,r]),T.jsxs("svg",{ref:l=>{a.current=l,typeof s=="function"?s(l):s&&(s.current=l)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[T.jsx("path",{ref:c,d:"M4 6L20 6",stroke:h,strokeWidth:t,strokeLinecap:"round"}),T.jsx("path",{ref:u,d:"M4 12L20 12",stroke:h,strokeWidth:t,strokeLinecap:"round"}),T.jsx("path",{ref:f,d:"M4 18L20 18",stroke:h,strokeWidth:t,strokeLinecap:"round"})]})}),cc=_.forwardRef(({isLiked:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=Me(a,!!i),f=i??u??"#FF4500";return _.useLayoutEffect(()=>{if(!r){j.set(c.current,{fill:n?f:"none",stroke:f});return}const d=j.timeline({defaults:{duration:.2,ease:"power3.inOut"}});n?d.to(c.current,{fill:f,scale:1.2,transformOrigin:"center center"}).to(c.current,{scale:1}):d.to(c.current,{fill:"none"})},[n,r,f]),T.jsx("svg",{ref:d=>{a.current=d,typeof s=="function"?s(d):s&&(s.current=d)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,style:{overflow:"visible",...o.style},children:T.jsx("path",{ref:c,d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:f,strokeWidth:t,strokeLinejoin:"round",fill:"none"})})}),uc=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=Me(s,!!r),f=r??u??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current],{x:0,y:0,scale:1,opacity:1});return}const d=j.context(()=>{j.timeline({repeat:-1,defaults:{ease:"power2.inOut"}}).to([a.current,c.current],{x:25,opacity:0,duration:.8,ease:"power2.in"}).set([a.current,c.current],{x:-25}).to([a.current,c.current],{x:0,opacity:1,duration:.8,ease:"power2.out"}).to({},{duration:.4})});return()=>d.revert()},[t]),T.jsxs("svg",{ref:d=>{s.current=d,typeof o=="function"?o(d):o&&(o.current=d)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:f,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("path",{ref:a,d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"}),T.jsx("path",{ref:c,d:"M6 12h16"})]})}),fc=_.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=_.useRef(null),a=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=Me(s,!!r),d=r??f??"currentColor";return _.useLayoutEffect(()=>{if(!t){j.set([a.current,c.current,u.current],{scale:1,opacity:1,rotation:0});return}const h=j.context(()=>{j.to(a.current,{scale:1.1,rotation:5,duration:.8,repeat:-1,yoyo:!0,ease:"sine.inOut",transformOrigin:"center center"}),j.to(c.current,{opacity:.3,scale:.7,duration:.6,repeat:-1,yoyo:!0,ease:"power1.inOut",delay:.2,transformOrigin:"center center"}),j.to(u.current,{opacity:.3,scale:.7,duration:.7,repeat:-1,yoyo:!0,ease:"power1.inOut",delay:.4,transformOrigin:"center center"})});return()=>h.revert()},[t]),T.jsxs("svg",{ref:h=>{s.current=h,typeof o=="function"?o(h):o&&(o.current=h)},width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:e,strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...i,style:{overflow:"visible",...i.style},children:[T.jsx("path",{ref:a,d:"M9.937 15.5A2 2 0 0 0 8.5 14.063L2 12l6.5-2.063A2 2 0 0 0 9.937 8.5L12 2l2.063 6.5a2 2 0 0 0 1.437 1.437L22 12l-6.5 2.063a2 2 0 0 0-1.437 1.437L12 22l-2.063-6.5Z"}),T.jsxs("g",{ref:c,children:[T.jsx("path",{d:"M20 3v4"}),T.jsx("path",{d:"M19 5h4"})]}),T.jsxs("g",{ref:u,children:[T.jsx("path",{d:"M5 17v4"}),T.jsx("path",{d:"M4 19h4"})]})]})}),dc=_.forwardRef(({isSyncing:n=!1,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=_.useRef(null),c=_.useRef(null),u=_.useRef(n),f=Me(a,!!i),d=i??f??"currentColor";return _.useLayoutEffect(()=>{if(!r)return;const h=c.current,l=u.current;return h&&(!l&&n?j.to(h,{rotation:360,repeat:-1,ease:"linear",duration:1,transformOrigin:"50% 50%"}):n||(j.killTweensOf(h),j.set(h,{rotation:0}))),u.current=n,()=>{c.current&&j.killTweensOf(c.current)}},[n,r]),T.jsx("svg",{ref:h=>{a.current=h,typeof s=="function"?s(h):s&&(s.current=h)},width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:T.jsx("g",{ref:c,children:T.jsx("path",{d:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:d,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"})})})}),Ai={sm:768,md:1024,lg:1280,xl:1280},hc=()=>typeof window<"u"?window.innerWidth:0,an=()=>{const[n,e]=_.useState(hc());_.useEffect(()=>{const a=()=>{e(hc())};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]);const{breakpoint:t,isMobile:r,isTablet:i,isLaptop:o,isDesktop:s}=_.useMemo(()=>{let a="sm";return n>=Ai.lg?a="xl":n>=Ai.md?a="lg":n>=Ai.sm?a="md":a="sm",{breakpoint:a,isMobile:a==="sm",isTablet:a==="md",isLaptop:a==="lg",isDesktop:a==="xl"}},[n]);return{width:n,breakpoint:t,isMobile:r,isTablet:i,isLaptop:o,isDesktop:s}},Vd=["default","primary","secondary","error"];function _e(n,e){return typeof n=="string"&&!Vd.includes(n)?kr(n):e.palette[n]}const Ud=(n,e)=>e==="sm"?`${Number(n)/(8/7)}px`:`${n}px`,pc=n=>{switch(n){case"regular":return"400";case"medium":return"500";case"semibold":return"600";case"bold":return"700";default:return"400"}},qd=Re.p`
|
|
124
124
|
font-family: ${({theme:n})=>n.text.fontFamily};
|
|
125
125
|
margin: 0;
|
|
126
126
|
color: ${({color:n})=>n};
|
|
@@ -247,7 +247,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Mi]+=1);const is=n=>typeof n=
|
|
|
247
247
|
&:hover {
|
|
248
248
|
background-color: ${({variant:n,color:e,theme:t})=>{const r=_e(e,t);switch(n){case"contained":return"rgba(255, 255, 255, 0.15)";case"outlined":case"text":case"soft":default:return`${r.main}18`}}};
|
|
249
249
|
}
|
|
250
|
-
`,vc=_.forwardRef((n,e)=>{const{children:t,options:r,onSelect:i,content:o,...s}=n,[a,c]=_.useState(!1),[u,f]=_.useState(!1),d=_.useRef(null),h=_.useRef(null),l=_.useRef(null),[g,p]=_.useState({height:0,width:0}),[y,w]=_.useState({height:0,width:0}),[S,b]=_.useState({top:0,left:0}),P=Mr("dropdown",s),m=_.useMemo(()=>({...{trigger:"click",placement:"bottom",zIndex:100,color:"primary",variant:"contained",size:"md",gap:8},...P}),[P]);_.useEffect(()=>{a&&f(!0)},[a]),_.useLayoutEffect(()=>{d.current&&(a?j.to(d.current,{autoAlpha:1,y:0,duration:.3,ease:"power2.out"}):u&&j.to(d.current,{autoAlpha:0,y:-10,duration:.2,ease:"power2.in",onComplete:()=>f(!1)}))},[a,u]),_.useEffect(()=>{if(h?.current&&u){const{clientHeight:$,clientWidth:R}=h.current;w({height:$,width:R})}},[h?.current,u]),_.useEffect(()=>{if(d?.current&&u){const{clientHeight:$,clientWidth:R}=d.current;p({height:$,width:R})}},[d?.current,u,o,r]),_.useLayoutEffect(()=>{const $=()=>{if(!u||!h.current||!d.current||g.height===0||g.width===0||y.height===0)return;const R=h.current.getBoundingClientRect(),N=window.scrollY,H=window.scrollX,{height:ee,width:K}=g,{height:G,width:U}=y,F=m.gap;let q={top:0,left:0};const Z=R.left+H+U/2,Pe=R.top+N+G/2;switch(m.placement){case"top":q={top:R.top+N-ee-F,left:Z-K/2};break;case"top-left":q={top:R.top+N-ee-F,left:R.left+H};break;case"top-right":q={top:R.top+N-ee-F,left:R.left+H+U-K};break;case"left":q={top:Pe-ee/2,left:R.left+H-K-F};break;case"left-top":q={top:R.top+N,left:R.left+H-K-F};break;case"left-bottom":q={top:R.top+N+G-ee,left:R.left+H-K-F};break;case"right":q={top:Pe-ee/2,left:R.left+H+U+F};break;case"right-top":q={top:R.top+N,left:R.left+H+U+F};break;case"right-bottom":q={top:R.top+N+G-ee,left:R.left+H+U+F};break;case"bottom-left":q={top:R.top+N+G+F,left:R.left+H};break;case"bottom-right":q={top:R.top+N+G+F,left:R.left+H+U-K};break;case"bottom":default:q={top:R.top+N+G+F,left:Z-K/2};break}b(q)};return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[u,m.placement,g,y]),_.useEffect(()=>{if(m.trigger!=="click"||!a)return;const $=R=>{h.current&&!h.current.contains(R.target)&&d.current&&!d.current.contains(R.target)&&c(!1)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[a,m.trigger]),_.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),_.useEffect(()=>{u||(p({height:0,width:0}),w({height:0,width:0}),b({top:0,left:0}))},[u]);const v=$=>{if(h.current=$,_.isValidElement(t)){const R=t.ref;typeof R=="function"?R($):R!=null&&typeof R=="object"&&(R.current=$)}},C=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(!0),100)},k=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(!1),150)},M=()=>{c($=>!$)},W=$=>{i?.($),c(!1)};if(!_.isValidElement(t))return T.jsx(T.Fragment,{children:t});const I={ref:v};m.trigger==="hover"?(I.onMouseEnter=C,I.onMouseLeave=k):I.onClick=M;const z=m.trigger==="hover"?{onMouseEnter:C,onMouseLeave:k}:{},O=T.jsx(th,{ref:d,color:m.color,variant:m.variant,bgcolor:m.bgcolor,radius:m.radius,size:m.size,...z,style:{position:"absolute",top:`${S.top}px`,left:`${S.left}px`,zIndex:m.zIndex,visibility:"hidden",...m.style},children:o??r?.map($=>T.jsx(rh,{color:m.color,variant:m.variant,size:m.size,radius:m.radius,onClick:()=>W($),children:T.jsx(Ie,{
|
|
250
|
+
`,vc=_.forwardRef((n,e)=>{const{children:t,options:r,onSelect:i,content:o,...s}=n,[a,c]=_.useState(!1),[u,f]=_.useState(!1),d=_.useRef(null),h=_.useRef(null),l=_.useRef(null),[g,p]=_.useState({height:0,width:0}),[y,w]=_.useState({height:0,width:0}),[S,b]=_.useState({top:0,left:0}),P=Mr("dropdown",s),m=_.useMemo(()=>({...{trigger:"click",placement:"bottom",zIndex:100,color:"primary",variant:"contained",size:"md",gap:8},...P}),[P]);_.useEffect(()=>{a&&f(!0)},[a]),_.useLayoutEffect(()=>{d.current&&(a?j.to(d.current,{autoAlpha:1,y:0,duration:.3,ease:"power2.out"}):u&&j.to(d.current,{autoAlpha:0,y:-10,duration:.2,ease:"power2.in",onComplete:()=>f(!1)}))},[a,u]),_.useEffect(()=>{if(h?.current&&u){const{clientHeight:$,clientWidth:R}=h.current;w({height:$,width:R})}},[h?.current,u]),_.useEffect(()=>{if(d?.current&&u){const{clientHeight:$,clientWidth:R}=d.current;p({height:$,width:R})}},[d?.current,u,o,r]),_.useLayoutEffect(()=>{const $=()=>{if(!u||!h.current||!d.current||g.height===0||g.width===0||y.height===0)return;const R=h.current.getBoundingClientRect(),N=window.scrollY,H=window.scrollX,{height:ee,width:K}=g,{height:G,width:U}=y,F=m.gap;let q={top:0,left:0};const Z=R.left+H+U/2,Pe=R.top+N+G/2;switch(m.placement){case"top":q={top:R.top+N-ee-F,left:Z-K/2};break;case"top-left":q={top:R.top+N-ee-F,left:R.left+H};break;case"top-right":q={top:R.top+N-ee-F,left:R.left+H+U-K};break;case"left":q={top:Pe-ee/2,left:R.left+H-K-F};break;case"left-top":q={top:R.top+N,left:R.left+H-K-F};break;case"left-bottom":q={top:R.top+N+G-ee,left:R.left+H-K-F};break;case"right":q={top:Pe-ee/2,left:R.left+H+U+F};break;case"right-top":q={top:R.top+N,left:R.left+H+U+F};break;case"right-bottom":q={top:R.top+N+G-ee,left:R.left+H+U+F};break;case"bottom-left":q={top:R.top+N+G+F,left:R.left+H};break;case"bottom-right":q={top:R.top+N+G+F,left:R.left+H+U-K};break;case"bottom":default:q={top:R.top+N+G+F,left:Z-K/2};break}b(q)};return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[u,m.placement,g,y]),_.useEffect(()=>{if(m.trigger!=="click"||!a)return;const $=R=>{h.current&&!h.current.contains(R.target)&&d.current&&!d.current.contains(R.target)&&c(!1)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[a,m.trigger]),_.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),_.useEffect(()=>{u||(p({height:0,width:0}),w({height:0,width:0}),b({top:0,left:0}))},[u]);const v=$=>{if(h.current=$,_.isValidElement(t)){const R=t.ref;typeof R=="function"?R($):R!=null&&typeof R=="object"&&(R.current=$)}},C=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(!0),100)},k=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(!1),150)},M=()=>{c($=>!$)},W=$=>{i?.($),c(!1)};if(!_.isValidElement(t))return T.jsx(T.Fragment,{children:t});const I={ref:v};m.trigger==="hover"?(I.onMouseEnter=C,I.onMouseLeave=k):I.onClick=M;const z=m.trigger==="hover"?{onMouseEnter:C,onMouseLeave:k}:{},O=T.jsx(th,{ref:d,color:m.color,variant:m.variant,bgcolor:m.bgcolor,radius:m.radius,size:m.size,...z,style:{position:"absolute",top:`${S.top}px`,left:`${S.left}px`,zIndex:m.zIndex,visibility:"hidden",...m.style},children:o??r?.map($=>T.jsx(rh,{color:m.color,variant:m.variant,size:m.size,radius:m.radius,onClick:()=>W($),children:T.jsx(Ie,{style:{fontSize:"inherit"},children:$.label})},$.key))});return T.jsxs(T.Fragment,{children:[_.cloneElement(t,I),u&&Kn.createPortal(O,document.body)]})});vc.displayName="Dropdown";const nh=Re.img`
|
|
251
251
|
${n=>n.initstyle&&Tr(n.initstyle)}
|
|
252
252
|
&:hover {
|
|
253
253
|
${n=>n.hoverstyle&&Tr(n.hoverstyle)}
|
|
@@ -301,7 +301,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Mi]+=1);const is=n=>typeof n=
|
|
|
301
301
|
border: none;
|
|
302
302
|
border-radius: ${({theme:n})=>$e[n.radius]};
|
|
303
303
|
}
|
|
304
|
-
`,Sc=_.forwardRef((n,e)=>{const t=Ve(),r=Mr("input",n),{label:i,required:o,labelProps:s,containerStyle:a,error:c,errorStyle:u,color:f="default",...d}=r,h=_.useRef(null),l=At(e,h),g=Me(h,!!s?.color);return T.jsxs(ue,{direction:"column",style:a,children:[(i||o)&&T.jsxs(ue,{direction:"row",gap:.5,align:"center",mb:d.type==="color"?"0px":"4px",style:{minHeight:"1.2em"},children:[i&&T.jsx(Ie,{color:s?.color??(c?t.palette.error.main:
|
|
304
|
+
`,Sc=_.forwardRef((n,e)=>{const t=Ve(),r=Mr("input",n),{label:i,required:o,labelProps:s,containerStyle:a,error:c,errorStyle:u,color:f="default",...d}=r,h=_.useRef(null),l=At(e,h),g=Me(h,!!s?.color);return T.jsxs(ue,{direction:"column",style:a,children:[(i||o)&&T.jsxs(ue,{direction:"row",gap:.5,align:"center",mb:d.type==="color"?"0px":"4px",style:{minHeight:"1.2em"},children:[i&&T.jsx(Ie,{color:s?.color??(c?t.palette.error.main:void 0),size:"12",...s,children:i},i),o&&T.jsx(Ie,{color:t.palette.error.main,size:"12",children:"*"})]}),T.jsx(ih,{ref:l,error:c,color:f,style:{color:g,...d.style},...d}),c&&T.jsx(Ie,{color:t.palette.error.main,size:"10",mt:d.type==="color"?"0px":"4px",style:{minHeight:"1.2em",...u},children:c})]})});Sc.displayName="Input";const oh=(n,e)=>{switch(n){case 1:return e==="sm"?"28px":"32px";case 2:return e==="sm"?"22px":"24px";case 3:return"20px";case 4:return"18px";case 5:return"16px";case 6:return"14px";default:return"1rem"}},sh=Re.h1`
|
|
305
305
|
font-family: ${({theme:n})=>n.title.fontFamily};
|
|
306
306
|
margin: 0;
|
|
307
307
|
color: ${({color:n})=>n};
|
|
@@ -370,7 +370,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Mi]+=1);const is=n=>typeof n=
|
|
|
370
370
|
|
|
371
371
|
width: ${({w:n})=>n};
|
|
372
372
|
height: ${({h:n})=>n};
|
|
373
|
-
`,Ac=_.forwardRef((n,e)=>{const t=Ve(),r=Mr("textarea",n),{label:i,required:o,labelProps:s,containerStyle:a,error:c,errorStyle:u,color:f="default",...d}=r,h=_.useRef(null),l=At(e,h),g=Me(h,!!s?.color);return T.jsxs(ue,{direction:"column",style:a,children:[(i||o)&&T.jsxs(ue,{direction:"row",gap:.5,align:"center",mb:"4px",style:{minHeight:"1.2em"},children:[i&&T.jsx(Ie,{color:s?.color??(c?t.palette.error.main:
|
|
373
|
+
`,Ac=_.forwardRef((n,e)=>{const t=Ve(),r=Mr("textarea",n),{label:i,required:o,labelProps:s,containerStyle:a,error:c,errorStyle:u,color:f="default",...d}=r,h=_.useRef(null),l=At(e,h),g=Me(h,!!s?.color);return T.jsxs(ue,{direction:"column",style:a,children:[(i||o)&&T.jsxs(ue,{direction:"row",gap:.5,align:"center",mb:"4px",style:{minHeight:"1.2em"},children:[i&&T.jsx(Ie,{color:s?.color??(c?t.palette.error.main:void 0),size:"12",...s,children:i}),o&&T.jsx(Ie,{color:t.palette.error.main,size:"12",children:"*"})]}),T.jsx(gh,{ref:l,error:c,style:{color:g,...d.style},...d}),c&&T.jsx(Ie,{color:t.palette.error.main,size:"10",mt:"4px",style:{minHeight:"1.2em",...u},children:c})]})});Ac.displayName="TextArea";const mh=Re(ue)`
|
|
374
374
|
box-shadow: ${()=>rc[2]};
|
|
375
375
|
z-index: 99999;
|
|
376
376
|
background-color: white;
|