@moontra/moonui 2.5.1 → 3.0.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,7 +1,20 @@
1
1
  'use client';
2
2
 
3
3
  /** @license MoonUI v1.0.0 - MIT License - https://moonui.dev */
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(`
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(`
5
18
  `);return`${r} {
6
19
  ${n(o.light,`${o.radius}rem`)}
7
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui",
3
- "version": "2.5.1",
3
+ "version": "3.0.0",
4
4
  "description": "Premium React component library with modern design and customization",
5
5
  "author": "MoonUI",
6
6
  "license": "MIT",
@@ -65,12 +65,13 @@
65
65
  "lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
66
66
  "clean": "rm -rf dist",
67
67
  "prepublishOnly": "npm run clean && npm run build",
68
- "pub": "npm version patch && npm run build && npm publish --access=public",
69
- "pub:minor": "npm version minor && npm run build && npm publish --access=public",
70
- "pub:major": "npm version major && npm run build && npm publish --access=public",
68
+ "pub": "npm publish",
71
69
  "test": "cd ../.. && npx jest packages/moonui",
72
70
  "test:watch": "cd ../.. && npx jest packages/moonui --watch",
73
- "test:coverage": "cd ../.. && npx jest packages/moonui --coverage"
71
+ "test:coverage": "cd ../.. && npx jest packages/moonui --coverage",
72
+ "version:patch": "npm version patch --no-git-tag-version",
73
+ "version:minor": "npm version minor --no-git-tag-version",
74
+ "version:major": "npm version major --no-git-tag-version"
74
75
  },
75
76
  "peerDependencies": {
76
77
  "react": "^18.0.0 || ^19.0.0",
@@ -122,5 +123,8 @@
122
123
  "tsup": "^7.1.0",
123
124
  "typescript": "^5.1.6"
124
125
  },
125
- "style": "src/styles/tokens.css"
126
+ "style": "src/styles/tokens.css",
127
+ "publishConfig": {
128
+ "access": "public"
129
+ }
126
130
  }
@@ -263,43 +263,33 @@
263
263
  /* ===== Utility Classes ===== */
264
264
 
265
265
  @layer utilities {
266
- /* Shadow Utilities */
266
+ /* Shadow Utilities — YALNIZCA Tailwind'de karsiligi OLMAYAN ozel golgeler.
267
+ shadow-sm/md/lg/xl/2xl KALDIRILDI (#35): Tailwind'in ayni adli utility'lerini eziyorlardi
268
+ (design-system olceyi bir kademe kaydiriyordu). Artik Tailwind kanonik. */
267
269
  .shadow-xs { box-shadow: var(--shadow-xs); }
268
- .shadow-sm { box-shadow: var(--shadow-sm); }
269
- .shadow-md { box-shadow: var(--shadow-md); }
270
- .shadow-lg { box-shadow: var(--shadow-lg); }
271
- .shadow-xl { box-shadow: var(--shadow-xl); }
272
- .shadow-2xl { box-shadow: var(--shadow-2xl); }
273
-
270
+
274
271
  .shadow-primary { box-shadow: var(--shadow-primary); }
275
272
  .shadow-success { box-shadow: var(--shadow-success); }
276
273
  .shadow-error { box-shadow: var(--shadow-error); }
277
274
  .shadow-warning { box-shadow: var(--shadow-warning); }
278
-
275
+
279
276
  .shadow-inner-xs { box-shadow: var(--shadow-inner-xs); }
280
277
  .shadow-inner-sm { box-shadow: var(--shadow-inner-sm); }
281
278
  .shadow-inner-md { box-shadow: var(--shadow-inner-md); }
282
-
283
- /* Animation Utilities */
284
- .animate-none { animation: none; }
285
- .animate-spin { animation: spin 1s linear infinite; }
286
- .animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
287
- .animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
288
- .animate-bounce { animation: bounce 1s infinite; }
279
+
280
+ /* Animation Utilities — YALNIZCA ozel animasyonlar.
281
+ animate-none/spin/ping/pulse/bounce KALDIRILDI (#35): Tailwind'in ayni adli
282
+ utility'leriyle cakisiyordu (Tailwind'inkiyle ozdes davranis, Tailwind kanonik). */
289
283
  .animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-out); }
290
284
  .animate-fade-out { animation: fadeOut var(--duration-normal) var(--ease-out); }
291
285
  .animate-slide-in { animation: slideIn var(--duration-normal) var(--ease-out); }
292
286
  .animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-out); }
293
-
294
- /* Transition Utilities */
295
- .transition-none { transition: none; }
296
- .transition-all { transition-property: all; }
297
- .transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; }
298
- .transition-opacity { transition-property: opacity; }
299
- .transition-shadow { transition-property: box-shadow; }
300
- .transition-transform { transition-property: transform; }
301
-
302
- /* Duration Utilities */
287
+
288
+ /* Transition Utilities — transition-none/all/colors/opacity/shadow/transform KALDIRILDI
289
+ (#35): Tailwind'in ayni adli utility'leriyle cakisiyordu (ozdes davranis, Tailwind kanonik). */
290
+
291
+ /* Duration Utilities Tailwind sayisal duration (duration-75 vb.) kullanir;
292
+ bu adlandirilmis olanlar cakismaz, kalir. */
303
293
  .duration-instant { transition-duration: var(--duration-instant); }
304
294
  .duration-fast { transition-duration: var(--duration-fast); }
305
295
  .duration-normal { transition-duration: var(--duration-normal); }
@@ -307,42 +297,15 @@
307
297
  .duration-slower { transition-duration: var(--duration-slower); }
308
298
  .duration-slowest { transition-duration: var(--duration-slowest); }
309
299
 
310
- /* Easing Utilities */
311
- .ease-linear { transition-timing-function: var(--ease-linear); }
312
- .ease-in { transition-timing-function: var(--ease-in); }
313
- .ease-out { transition-timing-function: var(--ease-out); }
314
- .ease-in-out { transition-timing-function: var(--ease-in-out); }
300
+ /* Easing Utilities — ease-linear/in/out/in-out KALDIRILDI (#35): Tailwind ile cakisiyordu.
301
+ ease-bounce ozel (Tailwind'de yok), kaldi. */
315
302
  .ease-bounce { transition-timing-function: var(--ease-bounce); }
316
303
  }
317
304
 
318
- /* ===== Keyframes ===== */
319
-
320
- @keyframes spin {
321
- to { transform: rotate(360deg); }
322
- }
323
-
324
- @keyframes ping {
325
- 75%, 100% {
326
- transform: scale(2);
327
- opacity: 0;
328
- }
329
- }
330
-
331
- @keyframes pulse {
332
- 0%, 100% { opacity: 1; }
333
- 50% { opacity: .5; }
334
- }
335
-
336
- @keyframes bounce {
337
- 0%, 100% {
338
- transform: translateY(-25%);
339
- animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
340
- }
341
- 50% {
342
- transform: translateY(0);
343
- animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
344
- }
345
- }
305
+ /* ===== Keyframes =====
306
+ spin/ping/pulse/bounce KALDIRILDI (#35): ilgili animate-* utility'leri Tailwind ile
307
+ cakistigi icin kaldirilinca bu keyframe'ler oludu kaldi ve Tailwind'inkileri kopyaliyordu.
308
+ Asagidakiler (fadeIn/fadeOut/slideIn/scaleIn) ozel animate-* siniflarinca kullaniliyor. */
346
309
 
347
310
  @keyframes fadeIn {
348
311
  from { opacity: 0; }