@julien-wiegandt/open-ui 0.3.9 → 0.3.10
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 +1 -1
- package/dist/open-ui.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/open-ui.js
CHANGED
|
@@ -3708,7 +3708,7 @@ function wt(n, e, t) {
|
|
|
3708
3708
|
const g = n.current;
|
|
3709
3709
|
if (!g) return;
|
|
3710
3710
|
const p = Rc(g), _ = Ni(p);
|
|
3711
|
-
|
|
3711
|
+
a(_);
|
|
3712
3712
|
} catch (g) {
|
|
3713
3713
|
console.error("[AutoContrast] error:", g);
|
|
3714
3714
|
}
|
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&&Sr(n.hoverstyle)}
|
|
122
122
|
}
|
|
123
|
-
`,ue=y.forwardRef(({children:n,...e},t)=>{const r=y.useMemo(()=>({...{display:"flex",direction:"column"},...e}),[e]);return k.jsx(Yd,{ref:t,...r,children:n})});ue.displayName="Flex";const kr=y.createContext({theme:ec,setTheme:()=>{},autoContrast:!0}),Oi=()=>{const{autoContrast:n}=y.useContext(kr);return n},nc=n=>{if(n.themes.length===0)throw new Error("No themes provided");const[e,t]=y.useState(n.themes[0]);y.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=y.useMemo(()=>({theme:e,setTheme:r,autoContrast:i}),[e,i]);return k.jsx(kr.Provider,{value:o,children:n.children})},Rn=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"},ic=n=>{const t=window.getComputedStyle(n).backgroundColor;return t==="rgba(0, 0, 0, 0)"||t==="transparent"?n.parentElement?ic(n.parentElement):"#ffffff":t};function ft(n,e,t){const{theme:r}=y.useContext(kr),o=!Oi()||!!e,[s,a]=y.useState(t?Rn(t):void 0);return y.useLayoutEffect(()=>{if(o)return;const c=n.current;if(!c)return;const u=()=>{try{const g=n.current;if(!g)return;const p=ic(g),_=Rn(p);console.log(`[AutoContrast] theme=${r.mode} bg=${p} -> text=${_}`),a(_)}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}const oc=y.forwardRef(({hasNotification:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"currentColor",d=y.useRef(n);return y.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]),k.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:k.jsx("g",{ref:c,children:k.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=y.forwardRef(({isVisible:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"currentColor";return y.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]),k.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:k.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=y.forwardRef(({isCopied:n,size:e=24,strokeWidth:t=2,animated:r=!0,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(n),d=ft(a,!!i),h=i??d??"currentColor";return y.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]),k.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:[k.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"}),k.jsx("rect",{ref:c,width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",fill:"none"})]})}),ac=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=ft(s,!!r),d=r??f??"currentColor";return y.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]),k.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:[k.jsx("circle",{ref:a,cx:"5",cy:"12",r:"1",fill:d}),k.jsx("circle",{ref:c,cx:"12",cy:"12",r:"1",fill:d}),k.jsx("circle",{ref:u,cx:"19",cy:"12",r:"1",fill:d})]})}),lc=y.forwardRef(({isOpen:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),d=ft(a,!!i),h=i??d??"currentColor";return y.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]),k.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:[k.jsx("path",{ref:c,d:"M4 6L20 6",stroke:h,strokeWidth:t,strokeLinecap:"round"}),k.jsx("path",{ref:u,d:"M4 12L20 12",stroke:h,strokeWidth:t,strokeLinecap:"round"}),k.jsx("path",{ref:f,d:"M4 18L20 18",stroke:h,strokeWidth:t,strokeLinecap:"round"})]})}),cc=y.forwardRef(({isLiked:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"#FF4500";return y.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]),k.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:k.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=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=ft(s,!!r),f=r??u??"currentColor";return y.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]),k.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:[k.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"}),k.jsx("path",{ref:c,d:"M6 12h16"})]})}),fc=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=ft(s,!!r),d=r??f??"currentColor";return y.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]),k.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:[k.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"}),k.jsxs("g",{ref:c,children:[k.jsx("path",{d:"M20 3v4"}),k.jsx("path",{d:"M19 5h4"})]}),k.jsxs("g",{ref:u,children:[k.jsx("path",{d:"M5 17v4"}),k.jsx("path",{d:"M4 19h4"})]})]})}),dc=y.forwardRef(({isSyncing:n=!1,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(n),f=ft(a,!!i),d=i??f??"currentColor";return y.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]),k.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:k.jsx("g",{ref:c,children:k.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,on=()=>{const[n,e]=y.useState(hc());y.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}=y.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}},Hd=["default","primary","secondary","error"];function he(n,e){return typeof n=="string"&&!Hd.includes(n)?Cr(n):e.palette[n]}function In(...n){return y.useCallback(e=>{n.forEach(t=>{t&&(typeof t=="function"?t(e):t.current=e)})},[...n])}const jd=(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"}},Xd=Ae.p`
|
|
123
|
+
`,ue=y.forwardRef(({children:n,...e},t)=>{const r=y.useMemo(()=>({...{display:"flex",direction:"column"},...e}),[e]);return k.jsx(Yd,{ref:t,...r,children:n})});ue.displayName="Flex";const kr=y.createContext({theme:ec,setTheme:()=>{},autoContrast:!0}),Oi=()=>{const{autoContrast:n}=y.useContext(kr);return n},nc=n=>{if(n.themes.length===0)throw new Error("No themes provided");const[e,t]=y.useState(n.themes[0]);y.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=y.useMemo(()=>({theme:e,setTheme:r,autoContrast:i}),[e,i]);return k.jsx(kr.Provider,{value:o,children:n.children})},Rn=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"},ic=n=>{const t=window.getComputedStyle(n).backgroundColor;return t==="rgba(0, 0, 0, 0)"||t==="transparent"?n.parentElement?ic(n.parentElement):"#ffffff":t};function ft(n,e,t){const{theme:r}=y.useContext(kr),o=!Oi()||!!e,[s,a]=y.useState(t?Rn(t):void 0);return y.useLayoutEffect(()=>{if(o)return;const c=n.current;if(!c)return;const u=()=>{try{const g=n.current;if(!g)return;const p=ic(g),_=Rn(p);a(_)}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}const oc=y.forwardRef(({hasNotification:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"currentColor",d=y.useRef(n);return y.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]),k.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:k.jsx("g",{ref:c,children:k.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=y.forwardRef(({isVisible:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"currentColor";return y.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]),k.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:k.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=y.forwardRef(({isCopied:n,size:e=24,strokeWidth:t=2,animated:r=!0,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(n),d=ft(a,!!i),h=i??d??"currentColor";return y.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]),k.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:[k.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"}),k.jsx("rect",{ref:c,width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",fill:"none"})]})}),ac=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=ft(s,!!r),d=r??f??"currentColor";return y.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]),k.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:[k.jsx("circle",{ref:a,cx:"5",cy:"12",r:"1",fill:d}),k.jsx("circle",{ref:c,cx:"12",cy:"12",r:"1",fill:d}),k.jsx("circle",{ref:u,cx:"19",cy:"12",r:"1",fill:d})]})}),lc=y.forwardRef(({isOpen:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),d=ft(a,!!i),h=i??d??"currentColor";return y.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]),k.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:[k.jsx("path",{ref:c,d:"M4 6L20 6",stroke:h,strokeWidth:t,strokeLinecap:"round"}),k.jsx("path",{ref:u,d:"M4 12L20 12",stroke:h,strokeWidth:t,strokeLinecap:"round"}),k.jsx("path",{ref:f,d:"M4 18L20 18",stroke:h,strokeWidth:t,strokeLinecap:"round"})]})}),cc=y.forwardRef(({isLiked:n,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=ft(a,!!i),f=i??u??"#FF4500";return y.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]),k.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:k.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=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=ft(s,!!r),f=r??u??"currentColor";return y.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]),k.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:[k.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"}),k.jsx("path",{ref:c,d:"M6 12h16"})]})}),fc=y.forwardRef(({size:n=24,strokeWidth:e=2,animated:t=!0,color:r,...i},o)=>{const s=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=ft(s,!!r),d=r??f??"currentColor";return y.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]),k.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:[k.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"}),k.jsxs("g",{ref:c,children:[k.jsx("path",{d:"M20 3v4"}),k.jsx("path",{d:"M19 5h4"})]}),k.jsxs("g",{ref:u,children:[k.jsx("path",{d:"M5 17v4"}),k.jsx("path",{d:"M4 19h4"})]})]})}),dc=y.forwardRef(({isSyncing:n=!1,size:e=24,strokeWidth:t=2,animated:r=!1,color:i,...o},s)=>{const a=y.useRef(null),c=y.useRef(null),u=y.useRef(n),f=ft(a,!!i),d=i??f??"currentColor";return y.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]),k.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:k.jsx("g",{ref:c,children:k.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,on=()=>{const[n,e]=y.useState(hc());y.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}=y.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}},Hd=["default","primary","secondary","error"];function he(n,e){return typeof n=="string"&&!Hd.includes(n)?Cr(n):e.palette[n]}function In(...n){return y.useCallback(e=>{n.forEach(t=>{t&&(typeof t=="function"?t(e):t.current=e)})},[...n])}const jd=(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"}},Xd=Ae.p`
|
|
124
124
|
font-family: ${({theme:n})=>n.text.fontFamily};
|
|
125
125
|
margin: 0;
|
|
126
126
|
color: ${({color:n})=>n};
|