UNPKG

@prerak12/chaoscomponents

Version:

A library built over tailwindcss where you can customize your components as per your needs (not necessary except for colors and some basic props). With just one word change you can switch from normal to google's floating style.

179 lines (175 loc) 27.8 kB
(function(_,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(_=typeof globalThis<"u"?globalThis:_||self,d(_.chaoscomponents={},_.React))})(this,function(_,d){"use strict";var Z={exports:{}},I={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ce;function Te(){if(ce)return I;ce=1;var s=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(m,c,n){var f=null;if(n!==void 0&&(f=""+n),c.key!==void 0&&(f=""+c.key),"key"in c){n={};for(var t in c)t!=="key"&&(n[t]=c[t])}else n=c;return c=n.ref,{$$typeof:s,type:m,key:f,ref:c!==void 0?c:null,props:n}}return I.Fragment=a,I.jsx=l,I.jsxs=l,I}var L={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ie;function $e(){return ie||(ie=1,process.env.NODE_ENV!=="production"&&function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case S:return"Portal";case F:return"Profiler";case Q:return"StrictMode";case ee:return"Suspense";case te:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case M:return(e.displayName||"Context")+".Provider";case U:return(e._context.displayName||"Context")+".Consumer";case q:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case oe:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function a(e){return""+e}function l(e){try{a(e);var r=!1}catch{r=!0}if(r){r=console;var o=r.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),a(e)}}function m(){}function c(){if(G===0){pe=console.log,xe=console.info,ve=console.warn,ye=console.error,Ee=console.group,he=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:m,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}function n(){if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:pe}),info:B({},e,{value:xe}),warn:B({},e,{value:ve}),error:B({},e,{value:ye}),group:B({},e,{value:Ee}),groupCollapsed:B({},e,{value:he}),groupEnd:B({},e,{value:je})})}0>G&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function f(e){if(se===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);se=r&&r[1]||"",we=-1<o.stack.indexOf(` at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return` `+se+e+we}function t(e,r){if(!e||ae)return"";var o=le.get(e);if(o!==void 0)return o;ae=!0,o=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var b=null;b=Y.H,Y.H=null,c();try{var N={DetermineComponentFrameRoot:function(){try{if(r){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(P){var D=P}Reflect.construct(e,[],z)}else{try{z.call()}catch(P){D=P}e.call(z.prototype)}}else{try{throw Error()}catch(P){D=P}(z=e())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(P){if(P&&D&&typeof P.stack=="string")return[P.stack,D.stack]}return[null,null]}};N.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(N.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(N.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=N.DetermineComponentFrameRoot(),O=u[0],J=u[1];if(O&&J){var T=O.split(` `),W=J.split(` `);for(u=E=0;E<T.length&&!T[E].includes("DetermineComponentFrameRoot");)E++;for(;u<W.length&&!W[u].includes("DetermineComponentFrameRoot");)u++;if(E===T.length||u===W.length)for(E=T.length-1,u=W.length-1;1<=E&&0<=u&&T[E]!==W[u];)u--;for(;1<=E&&0<=u;E--,u--)if(T[E]!==W[u]){if(E!==1||u!==1)do if(E--,u--,0>u||T[E]!==W[u]){var H=` `+T[E].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),typeof e=="function"&&le.set(e,H),H}while(1<=E&&0<=u);break}}}finally{ae=!1,Y.H=b,n(),Error.prepareStackTrace=o}return T=(T=e?e.displayName||e.name:"")?f(T):"",typeof e=="function"&&le.set(e,T),T}function w(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return t(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return f(e);switch(e){case ee:return f("Suspense");case te:return f("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case q:return e=t(e.render,!1),e;case re:return w(e.type);case oe:r=e._payload,e=e._init;try{return w(e(r))}catch{}}return""}function g(){var e=Y.A;return e===null?null:e.getOwner()}function p(e){if(ge.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function k(e,r){function o(){ke||(ke=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function y(){var e=s(this.type);return Ne[e]||(Ne[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function h(e,r,o,b,N,E){return o=E.ref,e={$$typeof:R,type:e,key:r,props:E,_owner:N},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,r,o,b,N,E){if(typeof e=="string"||typeof e=="function"||e===X||e===F||e===Q||e===ee||e===te||e===Xe||typeof e=="object"&&e!==null&&(e.$$typeof===oe||e.$$typeof===re||e.$$typeof===M||e.$$typeof===U||e.$$typeof===q||e.$$typeof===Ge||e.getModuleId!==void 0)){var u=r.children;if(u!==void 0)if(b)if(ne(u)){for(b=0;b<u.length;b++)v(u[b],e);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(u,e)}else u="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?b="null":ne(e)?b="array":e!==void 0&&e.$$typeof===R?(b="<"+(s(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,u);if(ge.call(r,"key")){u=s(e);var O=Object.keys(r).filter(function(T){return T!=="key"});b=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",_e[u+b]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,b,u,O,u),_e[u+b]=!0)}if(u=null,o!==void 0&&(l(o),u=""+o),p(r)&&(l(r.key),u=""+r.key),"key"in r){o={};for(var J in r)J!=="key"&&(o[J]=r[J])}else o=r;return u&&k(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),h(e,u,E,N,g(),o)}function v(e,r){if(typeof e=="object"&&e&&e.$$typeof!==He){if(ne(e))for(var o=0;o<e.length;o++){var b=e[o];x(b)&&C(b,r)}else if(x(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?o=null:(o=be&&e[be]||e["@@iterator"],o=typeof o=="function"?o:null),typeof o=="function"&&o!==e.entries&&(o=o.call(e),o!==e))for(;!(e=o.next()).done;)x(e.value)&&C(e.value,r)}}function x(e){return typeof e=="object"&&e!==null&&e.$$typeof===R}function C(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=A(r),!Ce[r])){Ce[r]=!0;var o="";e&&e._owner!=null&&e._owner!==g()&&(o=null,typeof e._owner.tag=="number"?o=s(e._owner.type):typeof e._owner.name=="string"&&(o=e._owner.name),o=" It was passed a child from "+o+".");var b=Y.getCurrentStack;Y.getCurrentStack=function(){var N=w(e.type);return b&&(N+=b()||""),N},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,o),Y.getCurrentStack=b}}function A(e){var r="",o=g();return o&&(o=s(o.type))&&(r=` Check the render method of \``+o+"`."),r||(e=s(e))&&(r=` Check the top-level render call using <`+e+">."),r}var $=d,R=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),M=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),Xe=Symbol.for("react.offscreen"),be=Symbol.iterator,Fe=Symbol.for("react.client.reference"),Y=$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge=Object.prototype.hasOwnProperty,B=Object.assign,Ge=Symbol.for("react.client.reference"),ne=Array.isArray,G=0,pe,xe,ve,ye,Ee,he,je;m.__reactDisabledLog=!0;var se,we,ae=!1,le=new(typeof WeakMap=="function"?WeakMap:Map),He=Symbol.for("react.client.reference"),ke,Ne={},_e={},Ce={};L.Fragment=X,L.jsx=function(e,r,o,b,N){return j(e,r,o,!1,b,N)},L.jsxs=function(e,r,o,b,N){return j(e,r,o,!0,b,N)}}()),L}var ue;function Se(){return ue||(ue=1,process.env.NODE_ENV==="production"?Z.exports=Te():Z.exports=$e()),Z.exports}var i=Se();const Ae=({label:s,width:a="auto",height:l="auto",disabled:m=!1,bgColor:c="white",textColor:n="black",rounded:f="sm",hoverBgColor:t="rgb(0, 150, 255)",hoverTextColor:w="white",borderColor:g="transparent",gap:p="0px",onClick:k,children:y})=>{const[h,j]=d.useState(!0);return d.useEffect(()=>{(a!=="auto"||l!=="auto")&&j(!1)},[a,l]),i.jsx("button",{className:` flex items-center justify-center relative transition-all duration-300 bg-blue-500 disabled:opacity-70 ${h&&"px-4 py-1"} ${f&&f==="none"&&"rounded-none"} ${f&&f==="sm"&&"rounded-sm"} ${f&&f==="md"&&"rounded-md"} ${f&&f==="lg"&&"rounded-lg"} ${f&&f==="full"&&"rounded-full"} `,style:{backgroundColor:c,color:n,width:h?"auto":a,height:h?"auto":l,border:`1px solid ${g}`,gap:p},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=t,v.currentTarget.style.color=w},onMouseLeave:v=>{v.currentTarget.style.backgroundColor=c,v.currentTarget.style.color=n},disabled:m,onClick:k,children:s||y})};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Re=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fe=(...s)=>s.filter((a,l,m)=>!!a&&a.trim()!==""&&m.indexOf(a)===l).join(" ").trim();/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Oe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pe=d.forwardRef(({color:s="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:m,className:c="",children:n,iconNode:f,...t},w)=>d.createElement("svg",{ref:w,...Oe,width:a,height:a,stroke:s,strokeWidth:m?Number(l)*24/Number(a):l,className:fe("lucide",c),...t},[...f.map(([g,p])=>d.createElement(g,p)),...Array.isArray(n)?n:[n]]));/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V=(s,a)=>{const l=d.forwardRef(({className:m,...c},n)=>d.createElement(Pe,{ref:n,iconNode:a,className:fe(`lucide-${Re(s)}`,m),...c}));return l.displayName=`${s}`,l};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Me=V("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const de=V("EyeClosed",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const me=V("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K=V("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ze=({placeholder:s,buttonStyle:a="normal",width:l="200px",height:m="40px",bgColor:c="#000",outlineColor:n="rgb(0, 150, 255)",textColor:f="white",rounded:t="sm",type:w="text",disabled:g=!1,borderColor:p="rgb(0, 150, 255)",minLength:k=1,maxLength:y,value:h,setValue:j})=>{const[v,x]=d.useState(!1),[C,A]=d.useState(w);return d.useEffect(()=>{h&&j&&j(h)},[h,j]),a==="google"?i.jsxs("div",{className:` relative w-fit ${g&&"opacity-70"} border border-transparent ${t&&t==="none"&&"rounded-none"} ${t&&t==="sm"&&"rounded-sm"} ${t&&t==="md"&&"rounded-md"} ${t&&t==="lg"&&"rounded-lg"} ${t&&t==="full"&&"rounded-full"} `,style:{backgroundColor:c},children:[i.jsx("input",{className:` peer relative z-10 bg-transparent px-2 transition-all duration-300 ${t&&t==="none"&&"rounded-none"} ${t&&t==="sm"&&"rounded-sm"} ${t&&t==="md"&&"rounded-md"} ${t&&t==="lg"&&"rounded-lg"} ${t&&t==="full"&&"rounded-full"} `,style:{width:l,height:m,color:f,outline:v?"1px solid "+n:"1px solid transparent",border:v?"1px solid transparent":"1px solid "+p},type:C,disabled:g,onFocus:()=>x(!0),onBlur:()=>x(!1),minLength:k,maxLength:y,value:h,onChange:$=>j&&j($.target.value)}),i.jsx("label",{className:`absolute transition-all duration-300 -translate-y-1/2 transalate-y-[-50%] ${h?"text-xs top-0 left-2 z-10":"top-1/2 left-2 peer-focus:top-0 peer-focus:left-2 peer-focus:text-xs peer-focus:z-10"}`,style:{backgroundColor:c,color:v?n:f},children:s}),w==="password"&&i.jsx("button",{className:"absolute transition-all duration-300 -translate-y-1/2 top-1/2 right-2 z-10 bg-transparent opacity-60 hover:opacity-100 cursor-pointer text-xs",style:{color:f},onClick:()=>A(C==="password"?"text":"password"),children:C==="password"?i.jsx(de,{size:16}):i.jsx(me,{size:16})})]}):i.jsxs("div",{className:` relative w-fit border border-transparent ${t&&t==="none"&&"rounded-none"} ${t&&t==="sm"&&"rounded-sm"} ${t&&t==="md"&&"rounded-md"} ${t&&t==="lg"&&"rounded-lg"} ${t&&t==="full"&&"rounded-full"} `,children:[i.jsx("input",{className:` px-2 transition-all duration-300 disabled:opacity-70 ${t&&t==="none"&&"rounded-none"} ${t&&t==="sm"&&"rounded-sm"} ${t&&t==="md"&&"rounded-md"} ${t&&t==="lg"&&"rounded-lg"} ${t&&t==="full"&&"rounded-full"} `,style:{width:l,height:m,color:f,backgroundColor:c,outline:v?"1px solid "+n:"1px solid transparent",border:v?"1px solid transparent":"1px solid "+p},type:C,placeholder:s,disabled:g,onFocus:()=>x(!0),onBlur:()=>x(!1),minLength:k,maxLength:y,value:h,onChange:$=>j&&j($.target.value)}),w==="password"&&i.jsx("button",{className:"absolute transition-all duration-300 -translate-y-1/2 top-1/2 right-2 z-10 bg-transparent opacity-60 hover:opacity-100 cursor-pointer text-xs",style:{color:f},onClick:()=>A(C==="password"?"text":"password"),children:C==="password"?i.jsx(de,{size:16}):i.jsx(me,{size:16})})]})},Ye=({children:s})=>i.jsx("div",{className:"w-full min-h-screen bg-black",children:s}),Be=({alertType:s="info",alertHeading:a,alertText:l,borderColor:m="transparent",rounded:c="none",children:n})=>{const[f,t]=d.useState("-top-30");return d.useEffect(()=>{t("top-5"),setTimeout(()=>{t("-top-30")},5e3)},[]),i.jsxs("div",{className:` w-11/12 min-h-14 ${f} left-1/2 -translate-x-1/2 fixed rounded-lg z-[100] transition-all duration-300 ${s==="success"&&"bg-green-600"} ${s==="error"&&"bg-red-500"} ${s==="warning"&&"bg-orange-500"} ${s==="info"&&"bg-blue-500"} ${s==="black"&&"bg-black"} ${c==="none"&&"rounded-none"} ${c==="sm"&&"rounded-sm"} ${c==="md"&&"rounded-md"} ${c==="lg"&&"rounded-lg"} ${c==="full"&&"rounded-full"} `,style:{border:`1px solid ${m}`},children:[i.jsx("button",{className:"absolute top-1 right-1 cursor-pointer text-white transition-all duration-300 hover:text-gray-300",onClick:()=>t("-top-30"),children:i.jsx(K,{size:16})}),i.jsxs("div",{className:`w-full h-full text-white flex flex-col justify-center ${a?"items-start pl-10":"items-center"}`,children:[a&&i.jsx("div",{className:"text-base font-bold",children:a}),l&&l]}),n]})},We=({toastText:s,toastHeading:a,rounded:l="sm",bgColor:m="black",textColor:c="white",borderColor:n="white",button:f=!1,buttonLabel:t,buttonBackgroundColor:w,buttonTextColor:g,buttonRounded:p,buttonBorderColor:k,buttonOnClick:y,children:h})=>{const[j,v]=d.useState("-right-50");return d.useEffect(()=>{v("right-5"),setTimeout(()=>{v("-right-50")},5e3)},[]),i.jsxs("div",{className:` fixed bottom-5 ${j} p-4 flex flex-col justify-center ${a?"items-start gap-2":"items-center"} transition-all duration-300 rounded-md ${l==="none"&&"rounded-none"} ${l==="sm"&&"rounded-sm"} ${l==="md"&&"rounded-md"} ${l==="lg"&&"rounded-lg"} ${l==="full"&&"rounded-full"} `,style:{border:`1px solid ${n}`,backgroundColor:m,color:c},children:[i.jsx("button",{className:"absolute top-1 right-1 cursor-pointer transition-all duration-300",style:{backgroundColor:m,color:c},onClick:()=>v("-right-50"),children:i.jsx(K,{size:16})}),a&&i.jsx("div",{className:"text-base font-bold",children:a}),s&&s,f&&i.jsx("button",{className:` px-2 py-1 border border-white ${p==="none"&&"rounded-none"} ${p==="sm"&&"rounded-sm"} ${p==="md"&&"rounded-md"} ${p==="lg"&&"rounded-lg"} ${p==="full"&&"rounded-full"} `,style:{backgroundColor:w||m,color:g||c,borderColor:k||n},onClick:y,children:t}),h]})},Ue=({label:s,width:a="auto",height:l="auto",bgColor:m="white",textColor:c="black",rounded:n="sm",hoverBgColor:f="gray",hoverTextColor:t="white",borderColor:w="transparent",toolTipLabel:g,toolTipPosition:p="right",toolTipWidth:k="auto",toolTipHeight:y="auto",toolTipBorderColor:h="transparent",toolTipBgColor:j="white",toolTipTextColor:v="black",toolTipRounded:x="sm",isButton:C=!1,onClick:A})=>{const[$,R]=d.useState(!0),[S,X]=d.useState(!0),[Q,F]=d.useState(!1),U=d.useRef(null);return d.useEffect(()=>{(a!=="auto"||l!=="auto")&&R(!1)},[a,l]),d.useEffect(()=>{(k!=="auto"||y!=="auto")&&X(!1)},[k,y]),i.jsxs("div",{className:"w-fit relative",children:[i.jsx("button",{className:` transition-all duration-300 ${$&&"px-4 py-1"} ${n&&n==="none"&&"rounded-none"} ${n&&n==="sm"&&"rounded-sm"} ${n&&n==="md"&&"rounded-md"} ${n&&n==="lg"&&"rounded-lg"} ${n&&n==="full"&&"rounded-full"} `,style:{width:$?"auto":a,height:$?"auto":l,backgroundColor:m,color:c,border:`1px solid ${w}`},onMouseEnter:M=>{M.currentTarget.style.backgroundColor=f,M.currentTarget.style.color=t,U.current=setTimeout(()=>{F(!0)},300)},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=m,M.currentTarget.style.color=c,U.current&&clearTimeout(U.current),F(!1)},onClick:A,disabled:C,children:s}),Q&&i.jsx("div",{className:` transition-all duration-300 absolute z-[999] ${S&&"px-4 py-1"} ${x&&x==="none"&&"rounded-none"} ${x&&x==="sm"&&"rounded-sm"} ${x&&x==="md"&&"rounded-md"} ${x&&x==="lg"&&"rounded-lg"} ${x&&x==="full"&&"rounded-full"} ${p==="top"&&"-translate-y-1/2 -top-10"} ${p==="bottom"&&"translate-y-1/2 -bottom-10"} ${p==="right"&&"translate-x-1/2 -translate-y-1/2 top-1/2 -right-19"} ${p==="left"&&"-translate-x-1/2 -translate-y-1/2 top-1/2 -left-19"} `,style:{width:S?"auto":k,height:S?"auto":y,backgroundColor:j,color:v,border:`1px solid ${h}`},children:g})]})},Je=({label:s,width:a="fit-content",height:l="auto",bgColor:m="white",textColor:c="black",textSize:n="md",borderColor:f="transparent",rounded:t="md",crossButton:w=!1,crossButtonColor:g="black",crossColor:p="white",onCrossClick:k})=>{const[y,h]=d.useState(!0);return d.useEffect(()=>{(a!=="fit-content"||l!=="auto")&&h(!1)},[a,l]),i.jsxs("div",{className:` relative transition-all duration-300 bg-blue-500 disabled:opacity-70 flex items-center justify-center ${y&&""} ${t&&t==="none"&&"rounded-none"} ${t&&t==="sm"&&"rounded-sm"} ${t&&t==="md"&&"rounded-md"} ${t&&t==="lg"&&"rounded-lg"} ${t&&t==="full"&&"rounded-full"} ${n==="xs"&&"text-xs"} ${n==="sm"&&"text-sm"} ${n==="md"&&"text-md"} ${n==="lg"&&"text-lg"} `,style:{backgroundColor:m,color:c,width:y?"fit-content":a,height:y?"auto":l,border:`1px solid ${f}`},children:[s,w&&i.jsx("button",{className:"absolute -translate-y-1/2 -right-2 top-0 rounded-full",onClick:k,style:{backgroundColor:g,color:p},children:i.jsx(K,{size:10})})]})},Ie=({label:s,width:a="fit-content",height:l="auto",borderColor:m="transparent",textColor:c="white",textSize:n,bgColor:f="gray",bgBlurColor:t="#111",opacity:w="0.8",rounded:g="md",isCrossEnabled:p=!1,onCrossClick:k,onClickOutside:y,children:h})=>{const[j,v]=d.useState(!0),[x,C]=d.useState("0"),A=d.useRef(null);return d.useEffect(()=>{(a!=="fit-content"||l!=="auto")&&v(!1)},[a,l]),d.useEffect(()=>{const $=R=>{A.current&&!A.current.contains(R.target)&&(y==null||y())};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[y]),d.useEffect(()=>(C("1"),document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]),i.jsx("div",{className:"fixed top-0 left-0 w-full h-screen flex items-center justify-center z-[9999]",style:{backgroundColor:t,opacity:w},children:i.jsxs("div",{ref:A,className:` flex flex-col items-center justify-center gap-2 text-base transition-all duration-300 relative ${j&&"px-5 py-4"} ${g&&g==="none"&&"rounded-none"} ${g&&g==="sm"&&"rounded-sm"} ${g&&g==="md"&&"rounded-md"} ${g&&g==="lg"&&"rounded-lg"} ${g&&g==="full"&&"rounded-full"} `,style:{width:j?"fit-content":a,height:j?"auto":l,border:`1px solid ${m}`,color:c,backgroundColor:f,fontSize:n,opacity:x},children:[p&&i.jsx("button",{className:"absolute top-0 right-0 text-white text-2xl bg-transparent border border-transparent",onClick:k,children:i.jsx(K,{size:16})}),s&&i.jsx("span",{children:s}),h]})})},Le=({label:s,width:a="300px",height:l="40px",bgColor:m="transparent",textColor:c="white",textSize:n="none",hoverBgColor:f="#4a5565",hoverTextColor:t="white",isLabelBold:w=!1,borderColor:g="white",collapsibleLabel:p,collapsibleBgColor:k="transparent",collapsibleTextColor:y="white",collapsibleTextSize:h="none",overallBorderColor:j="transparent",children:v})=>{const[x,C]=d.useState(!1),[A,$]=d.useState("0px"),R=d.useRef(null);return d.useEffect(()=>{R.current&&$(x?`${R.current.scrollHeight}px`:"0px")},[x]),i.jsxs("div",{style:{width:a,minHeight:l,backgroundColor:m,border:`1px solid ${j}`},children:[i.jsxs("div",{className:"w-full h-full flex justify-between items-center p-2 border border-transparent transition-all duration-300",onMouseEnter:S=>{S.currentTarget.style.backgroundColor=f,S.currentTarget.style.color=t},onMouseLeave:S=>{S.currentTarget.style.backgroundColor=m,S.currentTarget.style.color=c},style:{width:a,height:l,backgroundColor:m,color:c,fontSize:n},onClick:()=>C(S=>!S),children:[i.jsx("p",{className:`${w&&"font-bold"}`,children:s}),i.jsx("div",{className:`${x&&"rotate-540"} p-2 transition-all duration-500`,children:i.jsx(Me,{size:n==="none"?16:n})})]}),i.jsx("div",{className:` transition-all duration-500 overflow-hidden `,style:{width:a,maxHeight:A,backgroundColor:k,color:y,borderTop:`1px solid ${g}`,fontSize:h},children:i.jsxs("div",{className:"p-2",ref:R,children:[p&&p,v]})})]})};_.Alert=Be,_.AlertBox=Ie,_.Badge=Je,_.Button=Ae,_.ChaosComponents=Ye,_.Collapsible=Le,_.Input=ze,_.Toast=We,_.ToolTip=Ue,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=index.umd.js.map