@moontra/moonui 3.0.0 → 3.1.0

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.
@@ -1,20 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  /** @license MoonUI v1.0.0 - MIT License - https://moonui.dev */
4
- "use client";import{c as T,d as D,e as $}from"../chunk-X5ULQZNC.global.js";var e=T(D());var i={default:{name:"Default",description:"MoonUI's standard theme",category:"general",radius:.5,light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%",cardForeground:"222.2 84% 4.9%",popover:"0 0% 100%",popoverForeground:"222.2 84% 4.9%",primary:"217.2 91.2% 59.8%",primaryForeground:"222.2 47.4% 11.2%",secondary:"217.2 32.6% 94%",secondaryForeground:"217.2 91.2% 59.8%",muted:"217.2 32.6% 96%",mutedForeground:"215.4 16.3% 46.9%",accent:"217.2 32.6% 94%",accentForeground:"217.2 91.2% 59.8%",destructive:"0 84.2% 60.2%",destructiveForeground:"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"217.2 91.2% 59.8%",chart1:"12 76% 61%",chart2:"173 58% 39%",chart3:"197 37% 24%",chart4:"43 74% 66%",chart5:"27 87% 67%"},dark:{background:"224 71% 4%",foreground:"213 31% 91%",card:"224 71% 4%",cardForeground:"213 31% 91%",popover:"224 71% 4%",popoverForeground:"213 31% 91%",primary:"210 40% 98%",primaryForeground:"222.2 47.4% 1.2%",secondary:"222.2 84% 4.9%",secondaryForeground:"210 40% 98%",muted:"223 47% 11%",mutedForeground:"215.4 16.3% 56.9%",accent:"216 34% 17%",accentForeground:"210 40% 98%",destructive:"0 63% 31%",destructiveForeground:"210 40% 98%",border:"216 34% 17%",input:"216 34% 17%",ring:"216 34% 17%",chart1:"220 70% 50%",chart2:"160 60% 45%",chart3:"30 80% 55%",chart4:"280 65% 60%",chart5:"340 75% 55%"}},brand:{name:"Brand",description:"MoonUI's purple brand identity",category:"general",radius:.5,light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%",cardForeground:"222.2 84% 4.9%",popover:"0 0% 100%",popoverForeground:"222.2 84% 4.9%",primary:"271.5 81.3% 55.9%",primaryForeground:"0 0% 100%",secondary:"217.2 32.6% 94%",secondaryForeground:"271.5 81.3% 55.9%",muted:"217.2 32.6% 96%",mutedForeground:"215.4 16.3% 46.9%",accent:"217.2 32.6% 94%",accentForeground:"271.5 81.3% 55.9%",destructive:"0 84.2% 60.2%",destructiveForeground:"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"271.5 81.3% 55.9%",chart1:"12 76% 61%",chart2:"173 58% 39%",chart3:"197 37% 24%",chart4:"43 74% 66%",chart5:"27 87% 67%"},dark:{background:"224 71% 4%",foreground:"213 31% 91%",card:"224 71% 4%",cardForeground:"213 31% 91%",popover:"224 71% 4%",popoverForeground:"213 31% 91%",primary:"271.5 81.3% 55.9%",primaryForeground:"0 0% 100%",secondary:"222.2 84% 4.9%",secondaryForeground:"210 40% 98%",muted:"223 47% 11%",mutedForeground:"215.4 16.3% 56.9%",accent:"216 34% 17%",accentForeground:"210 40% 98%",destructive:"0 63% 31%",destructiveForeground:"210 40% 98%",border:"216 34% 17%",input:"216 34% 17%",ring:"270.7 91% 65.1%",chart1:"220 70% 50%",chart2:"160 60% 45%",chart3:"30 80% 55%",chart4:"280 65% 60%",chart5:"340 75% 55%"}},corporate:{name:"Corporate",description:"Professional theme for business applications",category:"business",radius:.25,light:{background:"0 0% 100%",foreground:"221 39% 11%",card:"0 0% 100%",cardForeground:"221 39% 11%",popover:"0 0% 100%",popoverForeground:"221 39% 11%",primary:"221 83% 53%",primaryForeground:"0 0% 100%",secondary:"215 28% 17%",secondaryForeground:"0 0% 100%",muted:"213 27% 84%",mutedForeground:"215 20% 40%",accent:"213 27% 84%",accentForeground:"221 39% 11%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"214 32% 91%",input:"214 32% 91%",ring:"221 83% 53%",chart1:"221 83% 53%",chart2:"212 95% 68%",chart3:"216 92% 60%",chart4:"210 98% 78%",chart5:"212 97% 87%"},dark:{background:"221 39% 7%",foreground:"213 31% 91%",card:"221 39% 9%",cardForeground:"213 31% 91%",popover:"0 0% 100%",popoverForeground:"221 39% 11%",primary:"217 91% 60%",primaryForeground:"221 39% 11%",secondary:"215 28% 25%",secondaryForeground:"213 31% 91%",muted:"215 28% 17%",mutedForeground:"215 20% 65%",accent:"215 28% 20%",accentForeground:"213 31% 91%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"215 28% 17%",input:"215 28% 17%",ring:"217 91% 60%",chart1:"221 83% 53%",chart2:"212 95% 68%",chart3:"216 92% 60%",chart4:"210 98% 78%",chart5:"212 97% 87%"}},creative:{name:"Creative",description:"Vibrant theme for creative projects",category:"creative",radius:1,light:{background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 58%",primaryForeground:"0 0% 100%",secondary:"270 95% 75%",secondaryForeground:"240 10% 3.9%",muted:"270 95% 95%",mutedForeground:"240 5% 45%",accent:"292 84% 61%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 90%",input:"270 50% 90%",ring:"262 83% 58%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"},dark:{background:"240 10% 3.9%",foreground:"0 0% 95%",card:"240 10% 5.9%",cardForeground:"0 0% 95%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 68%",primaryForeground:"240 10% 3.9%",secondary:"270 50% 20%",secondaryForeground:"0 0% 95%",muted:"270 50% 15%",mutedForeground:"270 10% 60%",accent:"292 84% 71%",accentForeground:"240 10% 3.9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 18%",input:"270 50% 18%",ring:"262 83% 68%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"}},nature:{name:"Nature",description:"Nature-inspired green tones",category:"creative",radius:.75,light:{background:"0 0% 100%",foreground:"140 10% 13%",card:"0 0% 100%",cardForeground:"140 10% 13%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 45%",primaryForeground:"0 0% 100%",secondary:"138 76% 97%",secondaryForeground:"140 10% 13%",muted:"138 50% 95%",mutedForeground:"140 10% 40%",accent:"142 76% 36%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"140 30% 90%",input:"140 30% 90%",ring:"142 71% 45%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"},dark:{background:"140 10% 8%",foreground:"138 31% 91%",card:"140 10% 10%",cardForeground:"138 31% 91%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 55%",primaryForeground:"140 10% 13%",secondary:"138 30% 20%",secondaryForeground:"138 31% 91%",muted:"138 30% 15%",mutedForeground:"138 10% 60%",accent:"142 76% 46%",accentForeground:"140 10% 13%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"138 30% 18%",input:"138 30% 18%",ring:"142 71% 55%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"}},minimal:{name:"Minimal",description:"Clean and minimal design",category:"general",radius:0,light:{background:"0 0% 100%",foreground:"0 0% 9%",card:"0 0% 100%",cardForeground:"0 0% 9%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 9%",primaryForeground:"0 0% 100%",secondary:"0 0% 96%",secondaryForeground:"0 0% 9%",muted:"0 0% 96%",mutedForeground:"0 0% 45%",accent:"0 0% 85%",accentForeground:"0 0% 9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 91%",input:"0 0% 91%",ring:"0 0% 9%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"},dark:{background:"0 0% 3.9%",foreground:"0 0% 98%",card:"0 0% 5.9%",cardForeground:"0 0% 98%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 98%",primaryForeground:"0 0% 3.9%",secondary:"0 0% 14%",secondaryForeground:"0 0% 98%",muted:"0 0% 14%",mutedForeground:"0 0% 60%",accent:"0 0% 20%",accentForeground:"0 0% 98%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 14%",input:"0 0% 14%",ring:"0 0% 98%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"}},ocean:{name:"Ocean",description:"Ocean-inspired blue tones",category:"creative",radius:.5,light:{background:"0 0% 100%",foreground:"200 20% 10%",card:"0 0% 100%",cardForeground:"200 20% 10%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 48%",primaryForeground:"0 0% 100%",secondary:"197 71% 95%",secondaryForeground:"200 20% 10%",muted:"197 71% 95%",mutedForeground:"200 15% 40%",accent:"186 100% 94%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"197 50% 90%",input:"197 50% 90%",ring:"199 89% 48%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"},dark:{background:"200 20% 6%",foreground:"197 71% 93%",card:"200 20% 8%",cardForeground:"197 71% 93%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 58%",primaryForeground:"200 20% 10%",secondary:"200 50% 15%",secondaryForeground:"197 71% 93%",muted:"200 50% 12%",mutedForeground:"200 15% 65%",accent:"186 100% 40%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"200 50% 15%",input:"200 50% 15%",ring:"199 89% 58%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"}}};var E=T($());var O=d=>"--"+d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([a-zA-Z])(\d)/g,"$1-$2").toLowerCase(),l="data-moonui-theme-vars",S=e.createContext(null),M=()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",U=({children:d,defaultPreset:v="default",preset:g,overrides:o,persist:t=!1,storageKey:n="moonui-theme-preset"})=>{let[h,u]=e.useState(v),[s,k]=e.useState({}),[F,P]=e.useState("light"),[R,C]=e.useState(null),m=g??h,p=o??s;e.useEffect(()=>{if(t)try{if(!g){let r=window.localStorage.getItem(n);r&&r in i&&u(r)}if(!o){let r=window.localStorage.getItem(`${n}-overrides`);if(r){let a=JSON.parse(r);a&&typeof a=="object"&&k(a)}}}catch{}},[t,n,g,o]),e.useEffect(()=>{if(!(!t||o))try{let r=`${n}-overrides`;Object.keys(s).length===0?window.localStorage.removeItem(r):window.localStorage.setItem(r,JSON.stringify(s))}catch{}},[t,n,s,o]),e.useEffect(()=>{P(M());let r=document.documentElement,a=new MutationObserver(()=>P(M()));return a.observe(r,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[]),e.useEffect(()=>{let r=document.documentElement,a=r.getAttribute(l);if(a){for(let c of a.split(","))r.style.removeProperty(c);r.removeAttribute(l)}let j=Object.keys(p).length>0;if(m==="default"&&!j){C(null);return}let y=i[m]??i.default,N={...F==="dark"?y.dark:y.light,radius:`${y.radius}rem`,...p},f=[];for(let[c,b]of Object.entries(N)){if(b==null||b==="")continue;let w=c.startsWith("--")?c:O(c);r.style.setProperty(w,b),f.push(w)}return r.setAttribute(l,f.join(",")),C(N),()=>{for(let c of f)r.style.removeProperty(c);r.removeAttribute(l)}},[m,p,F]);let x=e.useCallback(r=>{if(u(r),t)try{window.localStorage.setItem(n,r)}catch{}},[t,n]),A=e.useMemo(()=>({preset:m,setPreset:x,presets:i,colorMode:F,overrides:p,setOverrides:k,appliedTokens:R}),[m,x,F,p,R]);return(0,E.jsx)(S.Provider,{value:A,children:d})},z=()=>{let d=e.useContext(S);if(!d)throw new Error("useTheme, <ThemeProvider> icinde cagrilmalidir.");return d},J=(d,{selector:v=":root",darkSelector:g=".dark"}={})=>{let o=i[d]??i.default,t=(n,h)=>Object.entries(n).filter(([,u])=>u).map(([u,s])=>` ${O(u)}: ${s};`).concat(h?[` --radius: ${h};`]:[]).join(`
5
- `);return`${v} {
6
- ${t(o.light,`${o.radius}rem`)}
7
- }
8
-
9
- ${g} {
10
- ${t(o.dark)}
11
- }
12
- `};export{U as ThemeProvider,i as themePresets,J as themeToCss,z as useTheme};
13
-
14
- if (typeof window !== 'undefined' && !window.React) {
15
- console.warn('MoonUI: React not found. Please include React and ReactDOM before MoonUI.');
16
- }
17
- //# sourceMappingURL=theme.global.js.mapd:"215 28% 17%",mutedForeground:"215 20% 65%",accent:"215 28% 20%",accentForeground:"213 31% 91%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"215 28% 17%",input:"215 28% 17%",ring:"217 91% 60%",chart1:"221 83% 53%",chart2:"212 95% 68%",chart3:"216 92% 60%",chart4:"210 98% 78%",chart5:"212 97% 87%"}},creative:{name:"Creative",description:"Vibrant theme for creative projects",category:"creative",radius:1,light:{background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 58%",primaryForeground:"0 0% 100%",secondary:"270 95% 75%",secondaryForeground:"240 10% 3.9%",muted:"270 95% 95%",mutedForeground:"240 5% 45%",accent:"292 84% 61%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 90%",input:"270 50% 90%",ring:"262 83% 58%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"},dark:{background:"240 10% 3.9%",foreground:"0 0% 95%",card:"240 10% 5.9%",cardForeground:"0 0% 95%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 68%",primaryForeground:"240 10% 3.9%",secondary:"270 50% 20%",secondaryForeground:"0 0% 95%",muted:"270 50% 15%",mutedForeground:"270 10% 60%",accent:"292 84% 71%",accentForeground:"240 10% 3.9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 18%",input:"270 50% 18%",ring:"262 83% 68%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"}},nature:{name:"Nature",description:"Nature-inspired green tones",category:"creative",radius:.75,light:{background:"0 0% 100%",foreground:"140 10% 13%",card:"0 0% 100%",cardForeground:"140 10% 13%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 45%",primaryForeground:"0 0% 100%",secondary:"138 76% 97%",secondaryForeground:"140 10% 13%",muted:"138 50% 95%",mutedForeground:"140 10% 40%",accent:"142 76% 36%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"140 30% 90%",input:"140 30% 90%",ring:"142 71% 45%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"},dark:{background:"140 10% 8%",foreground:"138 31% 91%",card:"140 10% 10%",cardForeground:"138 31% 91%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 55%",primaryForeground:"140 10% 13%",secondary:"138 30% 20%",secondaryForeground:"138 31% 91%",muted:"138 30% 15%",mutedForeground:"138 10% 60%",accent:"142 76% 46%",accentForeground:"140 10% 13%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"138 30% 18%",input:"138 30% 18%",ring:"142 71% 55%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"}},minimal:{name:"Minimal",description:"Clean and minimal design",category:"general",radius:0,light:{background:"0 0% 100%",foreground:"0 0% 9%",card:"0 0% 100%",cardForeground:"0 0% 9%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 9%",primaryForeground:"0 0% 100%",secondary:"0 0% 96%",secondaryForeground:"0 0% 9%",muted:"0 0% 96%",mutedForeground:"0 0% 45%",accent:"0 0% 85%",accentForeground:"0 0% 9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 91%",input:"0 0% 91%",ring:"0 0% 9%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"},dark:{background:"0 0% 3.9%",foreground:"0 0% 98%",card:"0 0% 5.9%",cardForeground:"0 0% 98%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 98%",primaryForeground:"0 0% 3.9%",secondary:"0 0% 14%",secondaryForeground:"0 0% 98%",muted:"0 0% 14%",mutedForeground:"0 0% 60%",accent:"0 0% 20%",accentForeground:"0 0% 98%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 14%",input:"0 0% 14%",ring:"0 0% 98%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"}},ocean:{name:"Ocean",description:"Ocean-inspired blue tones",category:"creative",radius:.5,light:{background:"0 0% 100%",foreground:"200 20% 10%",card:"0 0% 100%",cardForeground:"200 20% 10%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 48%",primaryForeground:"0 0% 100%",secondary:"197 71% 95%",secondaryForeground:"200 20% 10%",muted:"197 71% 95%",mutedForeground:"200 15% 40%",accent:"186 100% 94%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"197 50% 90%",input:"197 50% 90%",ring:"199 89% 48%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"},dark:{background:"200 20% 6%",foreground:"197 71% 93%",card:"200 20% 8%",cardForeground:"197 71% 93%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 58%",primaryForeground:"200 20% 10%",secondary:"200 50% 15%",secondaryForeground:"197 71% 93%",muted:"200 50% 12%",mutedForeground:"200 15% 65%",accent:"186 100% 40%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"200 50% 15%",input:"200 50% 15%",ring:"199 89% 58%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"}}};var le=O(A());var de=e=>"--"+e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([a-zA-Z])(\d)/g,"$1-$2").toLowerCase(),C="data-moonui-theme-vars",pe=p.createContext(null),se=()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",ze=({children:e,defaultPreset:r="default",preset:t,overrides:o,persist:n=!1,storageKey:c="moonui-theme-preset"})=>{let[i,s]=p.useState(r),[a,f]=p.useState({}),[k,U]=p.useState("light"),[q,L]=p.useState(null),v=t??i,F=o??a;p.useEffect(()=>{if(n)try{if(!t){let d=window.localStorage.getItem(c);d&&d in m&&s(d)}if(!o){let d=window.localStorage.getItem(`${c}-overrides`);if(d){let g=JSON.parse(d);g&&typeof g=="object"&&f(g)}}}catch{}},[n,c,t,o]),p.useEffect(()=>{if(!(!n||o))try{let d=`${c}-overrides`;Object.keys(a).length===0?window.localStorage.removeItem(d):window.localStorage.setItem(d,JSON.stringify(a))}catch{}},[n,c,a,o]),p.useEffect(()=>{U(se());let d=document.documentElement,g=new MutationObserver(()=>U(se()));return g.observe(d,{attributes:!0,attributeFilter:["class"]}),()=>g.disconnect()},[]),p.useEffect(()=>{let d=document.documentElement,g=d.getAttribute(C);if(g){for(let h of g.split(","))d.style.removeProperty(h);d.removeAttribute(C)}let ge=Object.keys(F).length>0;if(v==="default"&&!ge){L(null);return}let w=m[v]??m.default,B={...k==="dark"?w.dark:w.light,radius:`${w.radius}rem`,...F},$=[];for(let[h,x]of Object.entries(B)){if(x==null||x==="")continue;let W=h.startsWith("--")?h:de(h);d.style.setProperty(W,x),$.push(W)}return d.setAttribute(C,$.join(",")),L(B),()=>{for(let h of $)d.style.removeProperty(h);d.removeAttribute(C)}},[v,F,k]);let z=p.useCallback(d=>{if(s(d),n)try{window.localStorage.setItem(c,d)}catch{}},[n,c]),fe=p.useMemo(()=>({preset:v,setPreset:z,presets:m,colorMode:k,overrides:F,setOverrides:f,appliedTokens:q}),[v,z,k,F,q]);return(0,le.jsx)(pe.Provider,{value:fe,children:e})},Be=()=>{let e=p.useContext(pe);if(!e)throw new Error("useTheme, <ThemeProvider> icinde cagrilmalidir.");return e},We=(e,{selector:r=":root",darkSelector:t=".dark"}={})=>{let o=m[e]??m.default,n=(c,i)=>Object.entries(c).filter(([,s])=>s).map(([s,a])=>` ${de(s)}: ${a};`).concat(i?[` --radius: ${i};`]:[]).join(`
4
+ "use client";var me=Object.create;var _=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var T=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),be=(e,r)=>{for(var t in r)_(e,t,{get:r[t],enumerable:!0})},H=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ye(r))!Fe.call(e,n)&&n!==t&&_(e,n,{get:()=>r[n],enumerable:!(o=he(r,n))||o.enumerable});return e};var O=(e,r,t)=>(t=e!=null?me(ve(e)):{},H(r||!e||!e.__esModule?_(t,"default",{value:e,enumerable:!0}):t,e)),ke=e=>H(_({},"__esModule",{value:!0}),e);var ne=T(u=>{"use strict";var b=Symbol.for("react.element"),_e=Symbol.for("react.portal"),Te=Symbol.for("react.fragment"),Pe=Symbol.for("react.strict_mode"),Re=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),Ee=Symbol.for("react.context"),Ce=Symbol.for("react.forward_ref"),we=Symbol.for("react.suspense"),$e=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),J=Symbol.iterator;function Oe(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var G={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,X={};function y(e,r,t){this.props=e,this.context=r,this.refs=X,this.updater=t||G}y.prototype.isReactComponent={};y.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")};y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function K(){}K.prototype=y.prototype;function N(e,r,t){this.props=e,this.context=r,this.refs=X,this.updater=t||G}var I=N.prototype=new K;I.constructor=N;Q(I,y.prototype);I.isPureReactComponent=!0;var Y=Array.isArray,ee=Object.prototype.hasOwnProperty,D={current:null},re={key:!0,ref:!0,__self:!0,__source:!0};function te(e,r,t){var o,n={},c=null,i=null;if(r!=null)for(o in r.ref!==void 0&&(i=r.ref),r.key!==void 0&&(c=""+r.key),r)ee.call(r,o)&&!re.hasOwnProperty(o)&&(n[o]=r[o]);var s=arguments.length-2;if(s===1)n.children=t;else if(1<s){for(var a=Array(s),f=0;f<s;f++)a[f]=arguments[f+2];n.children=a}if(e&&e.defaultProps)for(o in s=e.defaultProps,s)n[o]===void 0&&(n[o]=s[o]);return{$$typeof:b,type:e,key:c,ref:i,props:n,_owner:D.current}}function je(e,r){return{$$typeof:b,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}function M(e){return typeof e=="object"&&e!==null&&e.$$typeof===b}function Ne(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(t){return r[t]})}var Z=/\/+/g;function j(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Ne(""+e.key):r.toString(36)}function R(e,r,t,o,n){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case b:case _e:i=!0}}if(i)return i=e,n=n(i),e=o===""?"."+j(i,0):o,Y(n)?(t="",e!=null&&(t=e.replace(Z,"$&/")+"/"),R(n,r,t,"",function(f){return f})):n!=null&&(M(n)&&(n=je(n,t+(!n.key||i&&i.key===n.key?"":(""+n.key).replace(Z,"$&/")+"/")+e)),r.push(n)),1;if(i=0,o=o===""?".":o+":",Y(e))for(var s=0;s<e.length;s++){c=e[s];var a=o+j(c,s);i+=R(c,r,t,a,n)}else if(a=Oe(e),typeof a=="function")for(e=a.call(e),s=0;!(c=e.next()).done;)c=c.value,a=o+j(c,s++),i+=R(c,r,t,a,n);else if(c==="object")throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return i}function P(e,r,t){if(e==null)return e;var o=[],n=0;return R(e,o,"","",function(c){return r.call(t,c,n++)}),o}function Ie(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var l={current:null},S={transition:null},De={ReactCurrentDispatcher:l,ReactCurrentBatchConfig:S,ReactCurrentOwner:D};function oe(){throw Error("act(...) is not supported in production builds of React.")}u.Children={map:P,forEach:function(e,r,t){P(e,function(){r.apply(this,arguments)},t)},count:function(e){var r=0;return P(e,function(){r++}),r},toArray:function(e){return P(e,function(r){return r})||[]},only:function(e){if(!M(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};u.Component=y;u.Fragment=Te;u.Profiler=Re;u.PureComponent=N;u.StrictMode=Pe;u.Suspense=we;u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=De;u.act=oe;u.cloneElement=function(e,r,t){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=Q({},e.props),n=e.key,c=e.ref,i=e._owner;if(r!=null){if(r.ref!==void 0&&(c=r.ref,i=D.current),r.key!==void 0&&(n=""+r.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in r)ee.call(r,a)&&!re.hasOwnProperty(a)&&(o[a]=r[a]===void 0&&s!==void 0?s[a]:r[a])}var a=arguments.length-2;if(a===1)o.children=t;else if(1<a){s=Array(a);for(var f=0;f<a;f++)s[f]=arguments[f+2];o.children=s}return{$$typeof:b,type:e.type,key:n,ref:c,props:o,_owner:i}};u.createContext=function(e){return e={$$typeof:Ee,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Se,_context:e},e.Consumer=e};u.createElement=te;u.createFactory=function(e){var r=te.bind(null,e);return r.type=e,r};u.createRef=function(){return{current:null}};u.forwardRef=function(e){return{$$typeof:Ce,render:e}};u.isValidElement=M;u.lazy=function(e){return{$$typeof:xe,_payload:{_status:-1,_result:e},_init:Ie}};u.memo=function(e,r){return{$$typeof:$e,type:e,compare:r===void 0?null:r}};u.startTransition=function(e){var r=S.transition;S.transition={};try{e()}finally{S.transition=r}};u.unstable_act=oe;u.useCallback=function(e,r){return l.current.useCallback(e,r)};u.useContext=function(e){return l.current.useContext(e)};u.useDebugValue=function(){};u.useDeferredValue=function(e){return l.current.useDeferredValue(e)};u.useEffect=function(e,r){return l.current.useEffect(e,r)};u.useId=function(){return l.current.useId()};u.useImperativeHandle=function(e,r,t){return l.current.useImperativeHandle(e,r,t)};u.useInsertionEffect=function(e,r){return l.current.useInsertionEffect(e,r)};u.useLayoutEffect=function(e,r){return l.current.useLayoutEffect(e,r)};u.useMemo=function(e,r){return l.current.useMemo(e,r)};u.useReducer=function(e,r,t){return l.current.useReducer(e,r,t)};u.useRef=function(e){return l.current.useRef(e)};u.useState=function(e){return l.current.useState(e)};u.useSyncExternalStore=function(e,r,t){return l.current.useSyncExternalStore(e,r,t)};u.useTransition=function(){return l.current.useTransition()};u.version="18.3.1"});var V=T((Ze,ue)=>{"use strict";ue.exports=ne()});var ae=T(E=>{"use strict";var Me=V(),Ve=Symbol.for("react.element"),Ae=Symbol.for("react.fragment"),Ue=Object.prototype.hasOwnProperty,qe=Me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Le={key:!0,ref:!0,__self:!0,__source:!0};function ce(e,r,t){var o,n={},c=null,i=null;t!==void 0&&(c=""+t),r.key!==void 0&&(c=""+r.key),r.ref!==void 0&&(i=r.ref);for(o in r)Ue.call(r,o)&&!Le.hasOwnProperty(o)&&(n[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps,r)n[o]===void 0&&(n[o]=r[o]);return{$$typeof:Ve,type:e,key:c,ref:i,props:n,_owner:qe.current}}E.Fragment=Ae;E.jsx=ce;E.jsxs=ce});var A=T((Xe,ie)=>{"use strict";ie.exports=ae()});var He={};be(He,{ThemeProvider:()=>ze,themePresets:()=>m,themeToCss:()=>We,useTheme:()=>Be});module.exports=ke(He);var p=O(V());var m={default:{name:"Default",description:"MoonUI's standard theme",category:"general",radius:.5,light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%",cardForeground:"222.2 84% 4.9%",popover:"0 0% 100%",popoverForeground:"222.2 84% 4.9%",primary:"217.2 91.2% 59.8%",primaryForeground:"222.2 47.4% 11.2%",secondary:"217.2 32.6% 94%",secondaryForeground:"217.2 91.2% 59.8%",muted:"217.2 32.6% 96%",mutedForeground:"215.4 16.3% 46.9%",accent:"217.2 32.6% 94%",accentForeground:"217.2 91.2% 59.8%",destructive:"0 84.2% 60.2%",destructiveForeground:"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"217.2 91.2% 59.8%",chart1:"12 76% 61%",chart2:"173 58% 39%",chart3:"197 37% 24%",chart4:"43 74% 66%",chart5:"27 87% 67%"},dark:{background:"224 71% 4%",foreground:"213 31% 91%",card:"224 71% 4%",cardForeground:"213 31% 91%",popover:"224 71% 4%",popoverForeground:"213 31% 91%",primary:"210 40% 98%",primaryForeground:"222.2 47.4% 1.2%",secondary:"222.2 84% 4.9%",secondaryForeground:"210 40% 98%",muted:"223 47% 11%",mutedForeground:"215.4 16.3% 56.9%",accent:"216 34% 17%",accentForeground:"210 40% 98%",destructive:"0 63% 31%",destructiveForeground:"210 40% 98%",border:"216 34% 17%",input:"216 34% 17%",ring:"216 34% 17%",chart1:"220 70% 50%",chart2:"160 60% 45%",chart3:"30 80% 55%",chart4:"280 65% 60%",chart5:"340 75% 55%"}},brand:{name:"Brand",description:"MoonUI's purple brand identity",category:"general",radius:.5,light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%",cardForeground:"222.2 84% 4.9%",popover:"0 0% 100%",popoverForeground:"222.2 84% 4.9%",primary:"271.5 81.3% 55.9%",primaryForeground:"0 0% 100%",secondary:"217.2 32.6% 94%",secondaryForeground:"271.5 81.3% 55.9%",muted:"217.2 32.6% 96%",mutedForeground:"215.4 16.3% 46.9%",accent:"217.2 32.6% 94%",accentForeground:"271.5 81.3% 55.9%",destructive:"0 84.2% 60.2%",destructiveForeground:"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"271.5 81.3% 55.9%",chart1:"12 76% 61%",chart2:"173 58% 39%",chart3:"197 37% 24%",chart4:"43 74% 66%",chart5:"27 87% 67%"},dark:{background:"224 71% 4%",foreground:"213 31% 91%",card:"224 71% 4%",cardForeground:"213 31% 91%",popover:"224 71% 4%",popoverForeground:"213 31% 91%",primary:"271.5 81.3% 55.9%",primaryForeground:"0 0% 100%",secondary:"222.2 84% 4.9%",secondaryForeground:"210 40% 98%",muted:"223 47% 11%",mutedForeground:"215.4 16.3% 56.9%",accent:"216 34% 17%",accentForeground:"210 40% 98%",destructive:"0 63% 31%",destructiveForeground:"210 40% 98%",border:"216 34% 17%",input:"216 34% 17%",ring:"270.7 91% 65.1%",chart1:"220 70% 50%",chart2:"160 60% 45%",chart3:"30 80% 55%",chart4:"280 65% 60%",chart5:"340 75% 55%"}},corporate:{name:"Corporate",description:"Professional theme for business applications",category:"business",radius:.25,light:{background:"0 0% 100%",foreground:"221 39% 11%",card:"0 0% 100%",cardForeground:"221 39% 11%",popover:"0 0% 100%",popoverForeground:"221 39% 11%",primary:"221 83% 53%",primaryForeground:"0 0% 100%",secondary:"215 28% 17%",secondaryForeground:"0 0% 100%",muted:"213 27% 84%",mutedForeground:"215 20% 40%",accent:"213 27% 84%",accentForeground:"221 39% 11%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"214 32% 91%",input:"214 32% 91%",ring:"221 83% 53%",chart1:"221 83% 53%",chart2:"212 95% 68%",chart3:"216 92% 60%",chart4:"210 98% 78%",chart5:"212 97% 87%"},dark:{background:"221 39% 7%",foreground:"213 31% 91%",card:"221 39% 9%",cardForeground:"213 31% 91%",popover:"0 0% 100%",popoverForeground:"221 39% 11%",primary:"217 91% 60%",primaryForeground:"221 39% 11%",secondary:"215 28% 25%",secondaryForeground:"213 31% 91%",muted:"215 28% 17%",mutedForeground:"215 20% 65%",accent:"215 28% 20%",accentForeground:"213 31% 91%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"215 28% 17%",input:"215 28% 17%",ring:"217 91% 60%",chart1:"221 83% 53%",chart2:"212 95% 68%",chart3:"216 92% 60%",chart4:"210 98% 78%",chart5:"212 97% 87%"}},creative:{name:"Creative",description:"Vibrant theme for creative projects",category:"creative",radius:1,light:{background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 58%",primaryForeground:"0 0% 100%",secondary:"270 95% 75%",secondaryForeground:"240 10% 3.9%",muted:"270 95% 95%",mutedForeground:"240 5% 45%",accent:"292 84% 61%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 90%",input:"270 50% 90%",ring:"262 83% 58%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"},dark:{background:"240 10% 3.9%",foreground:"0 0% 95%",card:"240 10% 5.9%",cardForeground:"0 0% 95%",popover:"0 0% 100%",popoverForeground:"240 10% 3.9%",primary:"262 83% 68%",primaryForeground:"240 10% 3.9%",secondary:"270 50% 20%",secondaryForeground:"0 0% 95%",muted:"270 50% 15%",mutedForeground:"270 10% 60%",accent:"292 84% 71%",accentForeground:"240 10% 3.9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"270 50% 18%",input:"270 50% 18%",ring:"262 83% 68%",chart1:"262 83% 58%",chart2:"292 84% 61%",chart3:"330 81% 60%",chart4:"350 80% 72%",chart5:"10 80% 80%"}},nature:{name:"Nature",description:"Nature-inspired green tones",category:"creative",radius:.75,light:{background:"0 0% 100%",foreground:"140 10% 13%",card:"0 0% 100%",cardForeground:"140 10% 13%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 45%",primaryForeground:"0 0% 100%",secondary:"138 76% 97%",secondaryForeground:"140 10% 13%",muted:"138 50% 95%",mutedForeground:"140 10% 40%",accent:"142 76% 36%",accentForeground:"0 0% 100%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"140 30% 90%",input:"140 30% 90%",ring:"142 71% 45%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"},dark:{background:"140 10% 8%",foreground:"138 31% 91%",card:"140 10% 10%",cardForeground:"138 31% 91%",popover:"0 0% 100%",popoverForeground:"140 10% 13%",primary:"142 71% 55%",primaryForeground:"140 10% 13%",secondary:"138 30% 20%",secondaryForeground:"138 31% 91%",muted:"138 30% 15%",mutedForeground:"138 10% 60%",accent:"142 76% 46%",accentForeground:"140 10% 13%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"138 30% 18%",input:"138 30% 18%",ring:"142 71% 55%",chart1:"142 71% 45%",chart2:"120 61% 50%",chart3:"100 61% 45%",chart4:"80 61% 50%",chart5:"60 70% 50%"}},minimal:{name:"Minimal",description:"Clean and minimal design",category:"general",radius:0,light:{background:"0 0% 100%",foreground:"0 0% 9%",card:"0 0% 100%",cardForeground:"0 0% 9%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 9%",primaryForeground:"0 0% 100%",secondary:"0 0% 96%",secondaryForeground:"0 0% 9%",muted:"0 0% 96%",mutedForeground:"0 0% 45%",accent:"0 0% 85%",accentForeground:"0 0% 9%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 91%",input:"0 0% 91%",ring:"0 0% 9%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"},dark:{background:"0 0% 3.9%",foreground:"0 0% 98%",card:"0 0% 5.9%",cardForeground:"0 0% 98%",popover:"0 0% 100%",popoverForeground:"0 0% 9%",primary:"0 0% 98%",primaryForeground:"0 0% 3.9%",secondary:"0 0% 14%",secondaryForeground:"0 0% 98%",muted:"0 0% 14%",mutedForeground:"0 0% 60%",accent:"0 0% 20%",accentForeground:"0 0% 98%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"0 0% 14%",input:"0 0% 14%",ring:"0 0% 98%",chart1:"0 0% 20%",chart2:"0 0% 40%",chart3:"0 0% 60%",chart4:"0 0% 80%",chart5:"0 0% 90%"}},ocean:{name:"Ocean",description:"Ocean-inspired blue tones",category:"creative",radius:.5,light:{background:"0 0% 100%",foreground:"200 20% 10%",card:"0 0% 100%",cardForeground:"200 20% 10%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 48%",primaryForeground:"0 0% 100%",secondary:"197 71% 95%",secondaryForeground:"200 20% 10%",muted:"197 71% 95%",mutedForeground:"200 15% 40%",accent:"186 100% 94%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"197 50% 90%",input:"197 50% 90%",ring:"199 89% 48%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"},dark:{background:"200 20% 6%",foreground:"197 71% 93%",card:"200 20% 8%",cardForeground:"197 71% 93%",popover:"0 0% 100%",popoverForeground:"200 20% 10%",primary:"199 89% 58%",primaryForeground:"200 20% 10%",secondary:"200 50% 15%",secondaryForeground:"197 71% 93%",muted:"200 50% 12%",mutedForeground:"200 15% 65%",accent:"186 100% 40%",accentForeground:"200 20% 10%",destructive:"0 84.2% 60.2%",destructiveForeground:"0 0% 100%",border:"200 50% 15%",input:"200 50% 15%",ring:"199 89% 58%",chart1:"199 89% 48%",chart2:"195 89% 50%",chart3:"190 89% 52%",chart4:"185 89% 54%",chart5:"180 89% 56%"}}};var le=O(A());var de=e=>"--"+e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([a-zA-Z])(\d)/g,"$1-$2").toLowerCase(),C="data-moonui-theme-vars",pe=p.createContext(null),se=()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",ze=({children:e,defaultPreset:r="default",preset:t,overrides:o,persist:n=!1,storageKey:c="moonui-theme-preset"})=>{let[i,s]=p.useState(r),[a,f]=p.useState({}),[k,U]=p.useState("light"),[q,L]=p.useState(null),v=t??i,F=o??a;p.useEffect(()=>{if(n)try{if(!t){let d=window.localStorage.getItem(c);d&&d in m&&s(d)}if(!o){let d=window.localStorage.getItem(`${c}-overrides`);if(d){let g=JSON.parse(d);g&&typeof g=="object"&&f(g)}}}catch{}},[n,c,t,o]),p.useEffect(()=>{if(!(!n||o))try{let d=`${c}-overrides`;Object.keys(a).length===0?window.localStorage.removeItem(d):window.localStorage.setItem(d,JSON.stringify(a))}catch{}},[n,c,a,o]),p.useEffect(()=>{U(se());let d=document.documentElement,g=new MutationObserver(()=>U(se()));return g.observe(d,{attributes:!0,attributeFilter:["class"]}),()=>g.disconnect()},[]),p.useEffect(()=>{let d=document.documentElement,g=d.getAttribute(C);if(g){for(let h of g.split(","))d.style.removeProperty(h);d.removeAttribute(C)}let ge=Object.keys(F).length>0;if(v==="default"&&!ge){L(null);return}let w=m[v]??m.default,B={...k==="dark"?w.dark:w.light,radius:`${w.radius}rem`,...F},$=[];for(let[h,x]of Object.entries(B)){if(x==null||x==="")continue;let W=h.startsWith("--")?h:de(h);d.style.setProperty(W,x),$.push(W)}return d.setAttribute(C,$.join(",")),L(B),()=>{for(let h of $)d.style.removeProperty(h);d.removeAttribute(C)}},[v,F,k]);let z=p.useCallback(d=>{if(s(d),n)try{window.localStorage.setItem(c,d)}catch{}},[n,c]),fe=p.useMemo(()=>({preset:v,setPreset:z,presets:m,colorMode:k,overrides:F,setOverrides:f,appliedTokens:q}),[v,z,k,F,q]);return(0,le.jsx)(pe.Provider,{value:fe,children:e})},Be=()=>{let e=p.useContext(pe);if(!e)throw new Error("useTheme, <ThemeProvider> icinde cagrilmalidir.");return e},We=(e,{selector:r=":root",darkSelector:t=".dark"}={})=>{let o=m[e]??m.default,n=(c,i)=>Object.entries(c).filter(([,s])=>s).map(([s,a])=>` ${de(s)}: ${a};`).concat(i?[` --radius: ${i};`]:[]).join(`
18
5
  `);return`${r} {
19
6
  ${n(o.light,`${o.radius}rem`)}
20
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Premium React component library with modern design and customization",
5
5
  "author": "MoonUI",
6
6
  "license": "MIT",
@@ -84,6 +84,7 @@
84
84
  "@radix-ui/react-aspect-ratio": "^1.1.7",
85
85
  "@radix-ui/react-avatar": "^1.1.10",
86
86
  "@radix-ui/react-checkbox": "^1.3.2",
87
+ "@radix-ui/react-collapsible": "^1.1.12",
87
88
  "@radix-ui/react-dialog": "^1.1.14",
88
89
  "@radix-ui/react-dropdown-menu": "^2.1.15",
89
90
  "@radix-ui/react-hover-card": "^1.1.14",
@@ -91,6 +92,7 @@
91
92
  "@radix-ui/react-menubar": "^1.1.15",
92
93
  "@radix-ui/react-navigation-menu": "^1.2.13",
93
94
  "@radix-ui/react-popover": "^1.1.14",
95
+ "@radix-ui/react-scroll-area": "^1.2.10",
94
96
  "@radix-ui/react-select": "^2.2.5",
95
97
  "@radix-ui/react-separator": "^1.1.7",
96
98
  "@radix-ui/react-slider": "^1.3.5",
@@ -98,10 +100,15 @@
98
100
  "@radix-ui/react-switch": "^1.2.5",
99
101
  "@radix-ui/react-tabs": "^1.1.12",
100
102
  "@radix-ui/react-toast": "^1.2.14",
103
+ "@radix-ui/react-toggle": "^1.1.10",
101
104
  "@radix-ui/react-tooltip": "^1.2.7",
105
+ "@tanstack/react-table": "^8.21.3",
102
106
  "class-variance-authority": "^0.7.0",
103
107
  "clsx": "^2.0.0",
108
+ "cmdk": "^1.1.1",
109
+ "embla-carousel-react": "^8.6.0",
104
110
  "framer-motion": "^12.23.6",
111
+ "input-otp": "^1.4.2",
105
112
  "lucide-react": "^0.525.0",
106
113
  "tailwind-merge": "^2.5.0",
107
114
  "date-fns": "^3.3.1"
@@ -0,0 +1,291 @@
1
+ import React from 'react'
2
+ import { render, screen, fireEvent } from '@testing-library/react'
3
+ import userEvent from '@testing-library/user-event'
4
+
5
+ // Embla, jsdom'da boyut ölçemediği için (tüm elemanlar 0px) gerçek scroll davranışı
6
+ // üretemez — API'yi deterministik test edebilmek için embla-carousel-react mock'lanır.
7
+ jest.mock('embla-carousel-react', () => {
8
+ const mockApi = {
9
+ canScrollPrev: jest.fn(() => true),
10
+ canScrollNext: jest.fn(() => true),
11
+ scrollPrev: jest.fn(),
12
+ scrollNext: jest.fn(),
13
+ on: jest.fn(),
14
+ off: jest.fn(),
15
+ }
16
+ return {
17
+ __esModule: true,
18
+ default: jest.fn(() => [jest.fn(), mockApi]),
19
+ __mockApi: mockApi,
20
+ }
21
+ })
22
+
23
+ import {
24
+ Carousel,
25
+ CarouselContent,
26
+ CarouselItem,
27
+ CarouselPrevious,
28
+ CarouselNext,
29
+ useCarousel,
30
+ } from '../carousel'
31
+
32
+ const embla = jest.requireMock('embla-carousel-react') as {
33
+ default: jest.Mock
34
+ __mockApi: {
35
+ canScrollPrev: jest.Mock
36
+ canScrollNext: jest.Mock
37
+ scrollPrev: jest.Mock
38
+ scrollNext: jest.Mock
39
+ on: jest.Mock
40
+ off: jest.Mock
41
+ }
42
+ }
43
+ const mockApi = embla.__mockApi
44
+
45
+ const renderCarousel = (props: React.ComponentProps<typeof Carousel> = {}) =>
46
+ render(
47
+ <Carousel data-testid="carousel" {...props}>
48
+ <CarouselContent data-testid="carousel-content">
49
+ <CarouselItem data-testid="carousel-item-1">Slide 1</CarouselItem>
50
+ <CarouselItem data-testid="carousel-item-2">Slide 2</CarouselItem>
51
+ </CarouselContent>
52
+ <CarouselPrevious data-testid="carousel-previous" />
53
+ <CarouselNext data-testid="carousel-next" />
54
+ </Carousel>
55
+ )
56
+
57
+ describe('Carousel Components', () => {
58
+ beforeEach(() => {
59
+ jest.clearAllMocks()
60
+ mockApi.canScrollPrev.mockReturnValue(true)
61
+ mockApi.canScrollNext.mockReturnValue(true)
62
+ })
63
+
64
+ describe('Carousel Root', () => {
65
+ it('renders with carousel accessibility attributes', () => {
66
+ renderCarousel()
67
+
68
+ const carousel = screen.getByTestId('carousel')
69
+ expect(carousel).toBeInTheDocument()
70
+ expect(carousel).toHaveAttribute('role', 'region')
71
+ expect(carousel).toHaveAttribute('aria-roledescription', 'carousel')
72
+ })
73
+
74
+ it('applies moonui-theme and custom className', () => {
75
+ renderCarousel({ className: 'custom-carousel' })
76
+
77
+ const carousel = screen.getByTestId('carousel')
78
+ expect(carousel).toHaveClass('moonui-theme', 'relative', 'custom-carousel')
79
+ })
80
+
81
+ it('forwards ref correctly', () => {
82
+ const ref = React.createRef<HTMLDivElement>()
83
+ render(
84
+ <Carousel ref={ref}>
85
+ <CarouselContent>
86
+ <CarouselItem>Slide 1</CarouselItem>
87
+ </CarouselContent>
88
+ </Carousel>
89
+ )
90
+
91
+ expect(ref.current).toBeInstanceOf(HTMLDivElement)
92
+ })
93
+
94
+ it('maintains displayName', () => {
95
+ expect(Carousel.displayName).toBe('Carousel')
96
+ expect(CarouselContent.displayName).toBe('CarouselContent')
97
+ expect(CarouselItem.displayName).toBe('CarouselItem')
98
+ expect(CarouselPrevious.displayName).toBe('CarouselPrevious')
99
+ expect(CarouselNext.displayName).toBe('CarouselNext')
100
+ })
101
+
102
+ it('calls setApi with the embla api', () => {
103
+ const setApi = jest.fn()
104
+ renderCarousel({ setApi })
105
+
106
+ expect(setApi).toHaveBeenCalledWith(mockApi)
107
+ })
108
+
109
+ it('passes horizontal axis to embla by default', () => {
110
+ renderCarousel()
111
+
112
+ expect(embla.default).toHaveBeenCalledWith(
113
+ expect.objectContaining({ axis: 'x' }),
114
+ undefined
115
+ )
116
+ })
117
+
118
+ it('passes vertical axis to embla when orientation is vertical', () => {
119
+ renderCarousel({ orientation: 'vertical' })
120
+
121
+ expect(embla.default).toHaveBeenCalledWith(
122
+ expect.objectContaining({ axis: 'y' }),
123
+ undefined
124
+ )
125
+ })
126
+
127
+ it('forwards opts and plugins to embla', () => {
128
+ const plugins: never[] = []
129
+ renderCarousel({ opts: { loop: true }, plugins })
130
+
131
+ expect(embla.default).toHaveBeenCalledWith(
132
+ expect.objectContaining({ loop: true, axis: 'x' }),
133
+ plugins
134
+ )
135
+ })
136
+
137
+ it('subscribes to embla select and reInit events', () => {
138
+ renderCarousel()
139
+
140
+ expect(mockApi.on).toHaveBeenCalledWith('select', expect.any(Function))
141
+ expect(mockApi.on).toHaveBeenCalledWith('reInit', expect.any(Function))
142
+ })
143
+ })
144
+
145
+ describe('Keyboard Navigation', () => {
146
+ it('scrolls next on ArrowRight in horizontal orientation', () => {
147
+ renderCarousel()
148
+
149
+ fireEvent.keyDown(screen.getByTestId('carousel'), { key: 'ArrowRight' })
150
+ expect(mockApi.scrollNext).toHaveBeenCalledTimes(1)
151
+ })
152
+
153
+ it('scrolls prev on ArrowLeft in horizontal orientation', () => {
154
+ renderCarousel()
155
+
156
+ fireEvent.keyDown(screen.getByTestId('carousel'), { key: 'ArrowLeft' })
157
+ expect(mockApi.scrollPrev).toHaveBeenCalledTimes(1)
158
+ })
159
+
160
+ it('scrolls with ArrowUp/ArrowDown in vertical orientation', () => {
161
+ renderCarousel({ orientation: 'vertical' })
162
+
163
+ const carousel = screen.getByTestId('carousel')
164
+ fireEvent.keyDown(carousel, { key: 'ArrowDown' })
165
+ expect(mockApi.scrollNext).toHaveBeenCalledTimes(1)
166
+
167
+ fireEvent.keyDown(carousel, { key: 'ArrowUp' })
168
+ expect(mockApi.scrollPrev).toHaveBeenCalledTimes(1)
169
+ })
170
+
171
+ it('ignores horizontal arrow keys in vertical orientation', () => {
172
+ renderCarousel({ orientation: 'vertical' })
173
+
174
+ fireEvent.keyDown(screen.getByTestId('carousel'), { key: 'ArrowRight' })
175
+ expect(mockApi.scrollNext).not.toHaveBeenCalled()
176
+ })
177
+ })
178
+
179
+ describe('CarouselContent', () => {
180
+ it('applies horizontal orientation classes by default', () => {
181
+ renderCarousel()
182
+
183
+ const content = screen.getByTestId('carousel-content')
184
+ expect(content).toHaveClass('flex', '-ml-4')
185
+ // Dış sarmalayıcı overflow-hidden olmalı (embla viewport)
186
+ expect(content.parentElement).toHaveClass('overflow-hidden')
187
+ })
188
+
189
+ it('applies vertical orientation classes', () => {
190
+ renderCarousel({ orientation: 'vertical' })
191
+
192
+ const content = screen.getByTestId('carousel-content')
193
+ expect(content).toHaveClass('flex', '-mt-4', 'flex-col')
194
+ })
195
+
196
+ it('applies custom className', () => {
197
+ render(
198
+ <Carousel>
199
+ <CarouselContent className="custom-content" data-testid="content">
200
+ <CarouselItem>Slide</CarouselItem>
201
+ </CarouselContent>
202
+ </Carousel>
203
+ )
204
+
205
+ expect(screen.getByTestId('content')).toHaveClass('custom-content')
206
+ })
207
+ })
208
+
209
+ describe('CarouselItem', () => {
210
+ it('renders with slide accessibility attributes', () => {
211
+ renderCarousel()
212
+
213
+ const item = screen.getByTestId('carousel-item-1')
214
+ expect(item).toHaveAttribute('role', 'group')
215
+ expect(item).toHaveAttribute('aria-roledescription', 'slide')
216
+ })
217
+
218
+ it('applies horizontal item classes by default', () => {
219
+ renderCarousel()
220
+
221
+ const item = screen.getByTestId('carousel-item-1')
222
+ expect(item).toHaveClass('min-w-0', 'shrink-0', 'grow-0', 'basis-full', 'pl-4')
223
+ })
224
+
225
+ it('applies vertical item classes', () => {
226
+ renderCarousel({ orientation: 'vertical' })
227
+
228
+ const item = screen.getByTestId('carousel-item-1')
229
+ expect(item).toHaveClass('pt-4')
230
+ })
231
+ })
232
+
233
+ describe('CarouselPrevious / CarouselNext', () => {
234
+ it('scrolls prev when previous button is clicked', async () => {
235
+ const user = userEvent.setup()
236
+ renderCarousel()
237
+
238
+ await user.click(screen.getByTestId('carousel-previous'))
239
+ expect(mockApi.scrollPrev).toHaveBeenCalledTimes(1)
240
+ })
241
+
242
+ it('scrolls next when next button is clicked', async () => {
243
+ const user = userEvent.setup()
244
+ renderCarousel()
245
+
246
+ await user.click(screen.getByTestId('carousel-next'))
247
+ expect(mockApi.scrollNext).toHaveBeenCalledTimes(1)
248
+ })
249
+
250
+ it('renders screen reader labels', () => {
251
+ renderCarousel()
252
+
253
+ expect(screen.getByText('Previous slide')).toHaveClass('sr-only')
254
+ expect(screen.getByText('Next slide')).toHaveClass('sr-only')
255
+ })
256
+
257
+ it('disables buttons when scrolling is not possible', () => {
258
+ mockApi.canScrollPrev.mockReturnValue(false)
259
+ mockApi.canScrollNext.mockReturnValue(false)
260
+ renderCarousel()
261
+
262
+ expect(screen.getByTestId('carousel-previous')).toBeDisabled()
263
+ expect(screen.getByTestId('carousel-next')).toBeDisabled()
264
+ })
265
+
266
+ it('does not scroll when disabled button is clicked', async () => {
267
+ mockApi.canScrollNext.mockReturnValue(false)
268
+ const user = userEvent.setup()
269
+ renderCarousel()
270
+
271
+ await user.click(screen.getByTestId('carousel-next'))
272
+ expect(mockApi.scrollNext).not.toHaveBeenCalled()
273
+ })
274
+ })
275
+
276
+ describe('useCarousel', () => {
277
+ it('throws when used outside of Carousel', () => {
278
+ const Broken = () => {
279
+ useCarousel()
280
+ return null
281
+ }
282
+
283
+ // React'in error boundary console çıktısını sustur
284
+ const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {})
285
+ expect(() => render(<Broken />)).toThrow(
286
+ 'useCarousel must be used within a <Carousel />'
287
+ )
288
+ consoleSpy.mockRestore()
289
+ })
290
+ })
291
+ })