aura-toast 0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dami Code
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # AuraToast
2
+
3
+ A premium npm package for a toast manager with a unique glassmorphism design and a strict "single-toast-at-a-time" constraint.
4
+
5
+ ## Features
6
+
7
+ - ✨ **Unique Aesthetic**: Modern glassmorphism design with `backdrop-filter`, glowing borders, and sleek transitions.
8
+ - 🚫 **Anti-Clutter**: Enforces a single toast policy. New toasts automatically replace the current one.
9
+ - 🛠️ **Framework Agnostic Core**: Core logic is written in TypeScript and can be used with any framework.
10
+ - ⚛️ **React Ready**: Comes with first-class React support (`AuraProvider`, `useAuraToast`).
11
+ - 🎨 **Highly Customizable**: Uses CSS variables for easy theme adjustments.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install aura-toast
17
+ ```
18
+
19
+ ## Quick Start (React)
20
+
21
+ 1. Import the styles in your main entry file (e.g., `main.tsx` or `App.tsx`):
22
+
23
+ ```tsx
24
+ import 'aura-toast/dist/style.css';
25
+ ```
26
+
27
+ 2. Wrap your application with `AuraProvider`:
28
+
29
+ ```tsx
30
+ import { AuraProvider } from 'aura-toast';
31
+ ```
32
+
33
+ ## Live Demo
34
+
35
+ Check out the interactive showcase: [Live Demo Link (GitHub Pages/Vercel)]
36
+
37
+ > [!TIP]
38
+ > **Single Toast Policy**: AuraToast is designed for focus. Each new toast replaces the previous one with a smooth transition, preventing UI clutter.
39
+
40
+ 2. Trigger toasts using the `auraToast` object:
41
+
42
+ ```tsx
43
+ import { auraToast } from 'aura-toast';
44
+
45
+ function MyComponent() {
46
+ const handleClick = () => {
47
+ auraToast.success('Changes saved successfully!', {
48
+ action: {
49
+ label: 'Undo',
50
+ onClick: () => console.log('Undo clicked'),
51
+ }
52
+ });
53
+ };
54
+
55
+ return <button onClick={handleClick}>Save</button>;
56
+ }
57
+ ```
58
+
59
+ ## API
60
+
61
+ ### `auraToast.success(message, config?)`
62
+ ### `auraToast.error(message, config?)`
63
+ ### `auraToast.info(message, config?)`
64
+ ### `auraToast.warning(message, config?)`
65
+ ### `auraToast.dismiss()`
66
+
67
+ #### Configuration Object
68
+ | Property | Type | Description |
69
+ | --- | --- | --- |
70
+ | `duration` | `number` | Time in ms before auto-dismiss (default: 4000). Set to 0 to disable. |
71
+ | `action` | `{ label: string, onClick: () => void }` | Optional action button. |
72
+
73
+ ## Customization
74
+
75
+ You can override the default styles by providing values for these CSS variables:
76
+
77
+ ```css
78
+ :root {
79
+ --aura-bg: rgba(17, 25, 40, 0.75);
80
+ --aura-success: #10b981;
81
+ /* ... see aura-toast.css for more */
82
+ }
83
+ ```
84
+
85
+ ## License
86
+
87
+ MIT
@@ -0,0 +1,32 @@
1
+ "use strict";var hr=Object.defineProperty;var pr=(s,a,h)=>a in s?hr(s,a,{enumerable:!0,configurable:!0,writable:!0,value:h}):s[a]=h;var J=(s,a,h)=>(pr(s,typeof a!="symbol"?a+"":a,h),h);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./react");class yr{constructor(){J(this,"state",null);J(this,"listeners",new Set);J(this,"timeoutId",null)}getState(){return this.state}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.listeners.forEach(a=>a(this.state))}show(a){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);const h=a.id||Math.random().toString(36).substring(2,9);this.state={...a,id:h,type:a.type||"info",duration:a.duration??4e3},this.notify(),this.state&&this.state.duration&&this.state.duration>0&&(this.timeoutId=setTimeout(()=>{this.dismiss()},this.state.duration))}dismiss(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.state=null,this.notify()}}const T=new yr,mr={success:(s,a)=>T.show({...a,message:s,type:"success"}),error:(s,a)=>T.show({...a,message:s,type:"error"}),info:(s,a)=>T.show({...a,message:s,type:"info"}),warning:(s,a)=>T.show({...a,message:s,type:"warning"}),dismiss:()=>T.dismiss()};var te={exports:{}},$={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ke;function gr(){if(ke)return $;ke=1;var s=Y,a=Symbol.for("react.element"),h=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,O=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function j(R,p,P){var g,x={},S=null,M=null;P!==void 0&&(S=""+P),p.key!==void 0&&(S=""+p.key),p.ref!==void 0&&(M=p.ref);for(g in p)E.call(p,g)&&!w.hasOwnProperty(g)&&(x[g]=p[g]);if(R&&R.defaultProps)for(g in p=R.defaultProps,p)x[g]===void 0&&(x[g]=p[g]);return{$$typeof:a,type:R,key:S,ref:M,props:x,_owner:O.current}}return $.Fragment=h,$.jsx=j,$.jsxs=j,$}var N={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ce;function br(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var s=Y,a=Symbol.for("react.element"),h=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),R=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),ne=Symbol.iterator,Pe="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[Pe];return typeof r=="function"?r:null}var I=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ae("error",e,t)}}function Ae(e,r,t){{var n=I.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var De=!1,Fe=!1,We=!1,Le=!1,$e=!1,ae;ae=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===w||$e||e===O||e===P||e===g||Le||e===M||De||Fe||We||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===x||e.$$typeof===j||e.$$typeof===R||e.$$typeof===p||e.$$typeof===ae||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function ie(e){return e.displayName||"Context"}function _(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case h:return"Portal";case w:return"Profiler";case O:return"StrictMode";case P:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return ie(r)+".Consumer";case j:var t=e;return ie(t._context)+".Provider";case p:return Ye(e,e.render,"ForwardRef");case x:var n=e.displayName||null;return n!==null?n:_(e.type)||"Memo";case S:{var u=e,c=u._payload,o=u._init;try{return _(o(c))}catch{return null}}}return null}var k=Object.assign,F=0,oe,se,ue,le,ce,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Me(){{if(F===0){oe=console.log,se=console.info,ue=console.warn,le=console.error,ce=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Ve(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:oe}),info:k({},e,{value:se}),warn:k({},e,{value:ue}),error:k({},e,{value:le}),group:k({},e,{value:ce}),groupCollapsed:k({},e,{value:fe}),groupEnd:k({},e,{value:de})})}F<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=I.ReactCurrentDispatcher,z;function V(e,r,t){{if(z===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);z=n&&n[1]||""}return`
18
+ `+z+e}}var G=!1,U;{var Ue=typeof WeakMap=="function"?WeakMap:Map;U=new Ue}function he(e,r){if(!e||G)return"";{var t=U.get(e);if(t!==void 0)return t}var n;G=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=K.current,K.current=null,Me();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(m){n=m}Reflect.construct(e,[],o)}else{try{o.call()}catch(m){n=m}e.call(o.prototype)}}else{try{throw Error()}catch(m){n=m}e()}}catch(m){if(m&&n&&typeof m.stack=="string"){for(var i=m.stack.split(`
19
+ `),y=n.stack.split(`
20
+ `),f=i.length-1,d=y.length-1;f>=1&&d>=0&&i[f]!==y[d];)d--;for(;f>=1&&d>=0;f--,d--)if(i[f]!==y[d]){if(f!==1||d!==1)do if(f--,d--,d<0||i[f]!==y[d]){var b=`
21
+ `+i[f].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,b),b}while(f>=1&&d>=0);break}}}finally{G=!1,K.current=c,Ve(),Error.prepareStackTrace=u}var D=e?e.displayName||e.name:"",C=D?V(D):"";return typeof e=="function"&&U.set(e,C),C}function Be(e,r,t){return he(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,qe(e));if(typeof e=="string")return V(e);switch(e){case P:return V("Suspense");case g:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Be(e.render);case x:return B(e.type,r,t);case S:{var n=e,u=n._payload,c=n._init;try{return B(c(u),r,t)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,pe={},ye=I.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Je(e,r,t,n,u){{var c=Function.call.bind(W);for(var o in e)if(c(e,o)){var i=void 0;try{if(typeof e[o]!="function"){var y=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}i=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){i=f}i&&!(i instanceof Error)&&(q(u),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof i),q(null)),i instanceof Error&&!(i.message in pe)&&(pe[i.message]=!0,q(u),v("Failed %s type: %s",t,i.message),q(null))}}}var Ke=Array.isArray;function X(e){return Ke(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ge(e){if(Ge(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),me(e)}var L=I.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},be,Ee,H;H={};function He(e){if(W.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(W.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&L.current&&r&&L.current.stateNode!==r){var t=_(L.current.type);H[t]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(L.current.type),e.ref),H[t]=!0)}}function er(e,r){{var t=function(){be||(be=!0,v("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){Ee||(Ee=!0,v("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,u,c,o){var i={$$typeof:a,type:e,key:r,ref:t,props:o,_owner:c};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function nr(e,r,t,n,u){{var c,o={},i=null,y=null;t!==void 0&&(ge(t),i=""+t),Ze(r)&&(ge(r.key),i=""+r.key),He(r)&&(y=r.ref,Qe(r,u));for(c in r)W.call(r,c)&&!Xe.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var f=e.defaultProps;for(c in f)o[c]===void 0&&(o[c]=f[c])}if(i||y){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&er(o,d),y&&rr(o,d)}return tr(e,i,y,u,n,L.current,o)}}var Z=I.ReactCurrentOwner,Re=I.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function _e(){{if(Z.current){var e=_(Z.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function ar(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
+
25
+ Check your code at `+r+":"+t+"."}return""}}var xe={};function ir(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
+
27
+ Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(xe[t])return;xe[t]=!0;var n="";e&&e._owner&&e._owner!==Z.current&&(n=" It was passed a child from "+_(e._owner.type)+"."),A(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Te(e,r){{if(typeof e!="object")return;if(X(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&je(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var u=Ie(e);if(typeof u=="function"&&u!==e.entries)for(var c=u.call(e),o;!(o=c.next()).done;)ee(o.value)&&je(o.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===x))t=r.propTypes;else return;if(t){var n=_(r);Je(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var u=_(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var we={};function Se(e,r,t,n,u,c){{var o=Ne(e);if(!o){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ar(u);y?i+=y:i+=_e();var f;e===null?f="null":X(e)?f="array":e!==void 0&&e.$$typeof===a?(f="<"+(_(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,i)}var d=nr(e,r,t,u,c);if(d==null)return d;if(o){var b=r.children;if(b!==void 0)if(n)if(X(b)){for(var D=0;D<b.length;D++)Te(b[D],e);Object.freeze&&Object.freeze(b)}else v("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 Te(b,e)}if(W.call(r,"key")){var C=_(e),m=Object.keys(r).filter(function(vr){return vr!=="key"}),re=m.length>0?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}";if(!we[C+re]){var dr=m.length>0?"{"+m.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
28
+ let props = %s;
29
+ <%s {...props} />
30
+ React keys must be passed directly to JSX without using spread:
31
+ let props = %s;
32
+ <%s key={someKey} {...props} />`,re,C,dr,C),we[C+re]=!0}}return e===E?sr(d):or(d),d}}function ur(e,r,t){return Se(e,r,t,!0)}function lr(e,r,t){return Se(e,r,t,!1)}var cr=lr,fr=ur;N.Fragment=E,N.jsx=cr,N.jsxs=fr}()),N}process.env.NODE_ENV==="production"?te.exports=gr():te.exports=br();var l=te.exports;const Er=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),l.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),Rr=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),l.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),_r=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),l.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),xr=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),l.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),l.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Oe=({config:s})=>{var w,j;const[a,h]=Y.useState(!1),E=()=>{h(!0),setTimeout(()=>{T.dismiss()},300)},O={success:Er,error:Rr,info:_r,warning:xr}[s.type||"info"];return l.jsxs("div",{className:`aura-toast ${s.type||"info"} ${a?"aura-toast-exit":"aura-toast-enter"} ${s.className||""}`,style:{...s.style,...(w=s.style)!=null&&w["--type-color"]?{"--type-color":s.style["--type-color"]}:{},...(j=s.style)!=null&&j["--type-glow"]?{"--type-glow":s.style["--type-glow"]}:{}},children:[l.jsx("div",{className:"aura-icon",children:l.jsx(O,{})}),l.jsxs("div",{className:"aura-content",children:[l.jsx("p",{className:"aura-message",children:s.message}),s.action&&l.jsx("button",{className:"aura-action",onClick:()=>{var R;(R=s.action)==null||R.onClick(),E()},children:s.action.label})]}),l.jsx("button",{className:"aura-close",onClick:E,"aria-label":"Close",children:l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})};const jr=({children:s})=>{const[a,h]=Y.useState(null);return Y.useEffect(()=>T.subscribe(E=>{h(E)}),[]),l.jsxs(l.Fragment,{children:[s,l.jsx("div",{className:"aura-container",children:a&&l.jsx(Oe,{config:a},a.id)})]})};exports.AuraProvider=jr;exports.AuraToast=Oe;exports.auraToast=mr;exports.toastStore=T;
@@ -0,0 +1,758 @@
1
+ var hr = Object.defineProperty;
2
+ var pr = (s, a, h) => a in s ? hr(s, a, { enumerable: !0, configurable: !0, writable: !0, value: h }) : s[a] = h;
3
+ var J = (s, a, h) => (pr(s, typeof a != "symbol" ? a + "" : a, h), h);
4
+ import Se, { useState as Oe, useEffect as yr } from "./react";
5
+ class mr {
6
+ constructor() {
7
+ J(this, "state", null);
8
+ J(this, "listeners", /* @__PURE__ */ new Set());
9
+ J(this, "timeoutId", null);
10
+ }
11
+ getState() {
12
+ return this.state;
13
+ }
14
+ subscribe(a) {
15
+ return this.listeners.add(a), () => this.listeners.delete(a);
16
+ }
17
+ notify() {
18
+ this.listeners.forEach((a) => a(this.state));
19
+ }
20
+ show(a) {
21
+ this.timeoutId && (clearTimeout(this.timeoutId), this.timeoutId = null);
22
+ const h = a.id || Math.random().toString(36).substring(2, 9);
23
+ this.state = {
24
+ ...a,
25
+ id: h,
26
+ type: a.type || "info",
27
+ duration: a.duration ?? 4e3
28
+ }, this.notify(), this.state && this.state.duration && this.state.duration > 0 && (this.timeoutId = setTimeout(() => {
29
+ this.dismiss();
30
+ }, this.state.duration));
31
+ }
32
+ dismiss() {
33
+ this.timeoutId && (clearTimeout(this.timeoutId), this.timeoutId = null), this.state = null, this.notify();
34
+ }
35
+ }
36
+ const S = new mr(), kr = {
37
+ success: (s, a) => S.show({ ...a, message: s, type: "success" }),
38
+ error: (s, a) => S.show({ ...a, message: s, type: "error" }),
39
+ info: (s, a) => S.show({ ...a, message: s, type: "info" }),
40
+ warning: (s, a) => S.show({ ...a, message: s, type: "warning" }),
41
+ dismiss: () => S.dismiss()
42
+ };
43
+ var re = { exports: {} }, $ = {};
44
+ /**
45
+ * @license React
46
+ * react-jsx-runtime.production.min.js
47
+ *
48
+ * Copyright (c) Facebook, Inc. and its affiliates.
49
+ *
50
+ * This source code is licensed under the MIT license found in the
51
+ * LICENSE file in the root directory of this source tree.
52
+ */
53
+ var ke;
54
+ function gr() {
55
+ if (ke)
56
+ return $;
57
+ ke = 1;
58
+ var s = Se, a = Symbol.for("react.element"), h = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, O = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
59
+ function j(x, p, P) {
60
+ var g, _ = {}, T = null, Y = null;
61
+ P !== void 0 && (T = "" + P), p.key !== void 0 && (T = "" + p.key), p.ref !== void 0 && (Y = p.ref);
62
+ for (g in p)
63
+ E.call(p, g) && !w.hasOwnProperty(g) && (_[g] = p[g]);
64
+ if (x && x.defaultProps)
65
+ for (g in p = x.defaultProps, p)
66
+ _[g] === void 0 && (_[g] = p[g]);
67
+ return { $$typeof: a, type: x, key: T, ref: Y, props: _, _owner: O.current };
68
+ }
69
+ return $.Fragment = h, $.jsx = j, $.jsxs = j, $;
70
+ }
71
+ var N = {};
72
+ /**
73
+ * @license React
74
+ * react-jsx-runtime.development.js
75
+ *
76
+ * Copyright (c) Facebook, Inc. and its affiliates.
77
+ *
78
+ * This source code is licensed under the MIT license found in the
79
+ * LICENSE file in the root directory of this source tree.
80
+ */
81
+ var Ce;
82
+ function br() {
83
+ return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
84
+ var s = Se, a = Symbol.for("react.element"), h = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), x = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), te = Symbol.iterator, Pe = "@@iterator";
85
+ function Ie(e) {
86
+ if (e === null || typeof e != "object")
87
+ return null;
88
+ var r = te && e[te] || e[Pe];
89
+ return typeof r == "function" ? r : null;
90
+ }
91
+ var I = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
92
+ function v(e) {
93
+ {
94
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
95
+ t[n - 1] = arguments[n];
96
+ De("error", e, t);
97
+ }
98
+ }
99
+ function De(e, r, t) {
100
+ {
101
+ var n = I.ReactDebugCurrentFrame, u = n.getStackAddendum();
102
+ u !== "" && (r += "%s", t = t.concat([u]));
103
+ var c = t.map(function(o) {
104
+ return String(o);
105
+ });
106
+ c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
107
+ }
108
+ }
109
+ var Ae = !1, Fe = !1, We = !1, Le = !1, $e = !1, ne;
110
+ ne = Symbol.for("react.module.reference");
111
+ function Ne(e) {
112
+ return !!(typeof e == "string" || typeof e == "function" || e === E || e === w || $e || e === O || e === P || e === g || Le || e === Y || Ae || Fe || We || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === _ || e.$$typeof === j || e.$$typeof === x || e.$$typeof === p || // This needs to include all possible module reference object
113
+ // types supported by any Flight configuration anywhere since
114
+ // we don't know which Flight build this will end up being used
115
+ // with.
116
+ e.$$typeof === ne || e.getModuleId !== void 0));
117
+ }
118
+ function Ye(e, r, t) {
119
+ var n = e.displayName;
120
+ if (n)
121
+ return n;
122
+ var u = r.displayName || r.name || "";
123
+ return u !== "" ? t + "(" + u + ")" : t;
124
+ }
125
+ function ae(e) {
126
+ return e.displayName || "Context";
127
+ }
128
+ function R(e) {
129
+ if (e == null)
130
+ return null;
131
+ if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
132
+ return e.displayName || e.name || null;
133
+ if (typeof e == "string")
134
+ return e;
135
+ switch (e) {
136
+ case E:
137
+ return "Fragment";
138
+ case h:
139
+ return "Portal";
140
+ case w:
141
+ return "Profiler";
142
+ case O:
143
+ return "StrictMode";
144
+ case P:
145
+ return "Suspense";
146
+ case g:
147
+ return "SuspenseList";
148
+ }
149
+ if (typeof e == "object")
150
+ switch (e.$$typeof) {
151
+ case x:
152
+ var r = e;
153
+ return ae(r) + ".Consumer";
154
+ case j:
155
+ var t = e;
156
+ return ae(t._context) + ".Provider";
157
+ case p:
158
+ return Ye(e, e.render, "ForwardRef");
159
+ case _:
160
+ var n = e.displayName || null;
161
+ return n !== null ? n : R(e.type) || "Memo";
162
+ case T: {
163
+ var u = e, c = u._payload, o = u._init;
164
+ try {
165
+ return R(o(c));
166
+ } catch {
167
+ return null;
168
+ }
169
+ }
170
+ }
171
+ return null;
172
+ }
173
+ var k = Object.assign, F = 0, ie, oe, se, ue, le, ce, fe;
174
+ function de() {
175
+ }
176
+ de.__reactDisabledLog = !0;
177
+ function Me() {
178
+ {
179
+ if (F === 0) {
180
+ ie = console.log, oe = console.info, se = console.warn, ue = console.error, le = console.group, ce = console.groupCollapsed, fe = console.groupEnd;
181
+ var e = {
182
+ configurable: !0,
183
+ enumerable: !0,
184
+ value: de,
185
+ writable: !0
186
+ };
187
+ Object.defineProperties(console, {
188
+ info: e,
189
+ log: e,
190
+ warn: e,
191
+ error: e,
192
+ group: e,
193
+ groupCollapsed: e,
194
+ groupEnd: e
195
+ });
196
+ }
197
+ F++;
198
+ }
199
+ }
200
+ function Ve() {
201
+ {
202
+ if (F--, F === 0) {
203
+ var e = {
204
+ configurable: !0,
205
+ enumerable: !0,
206
+ writable: !0
207
+ };
208
+ Object.defineProperties(console, {
209
+ log: k({}, e, {
210
+ value: ie
211
+ }),
212
+ info: k({}, e, {
213
+ value: oe
214
+ }),
215
+ warn: k({}, e, {
216
+ value: se
217
+ }),
218
+ error: k({}, e, {
219
+ value: ue
220
+ }),
221
+ group: k({}, e, {
222
+ value: le
223
+ }),
224
+ groupCollapsed: k({}, e, {
225
+ value: ce
226
+ }),
227
+ groupEnd: k({}, e, {
228
+ value: fe
229
+ })
230
+ });
231
+ }
232
+ F < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
233
+ }
234
+ }
235
+ var q = I.ReactCurrentDispatcher, K;
236
+ function M(e, r, t) {
237
+ {
238
+ if (K === void 0)
239
+ try {
240
+ throw Error();
241
+ } catch (u) {
242
+ var n = u.stack.trim().match(/\n( *(at )?)/);
243
+ K = n && n[1] || "";
244
+ }
245
+ return `
246
+ ` + K + e;
247
+ }
248
+ }
249
+ var z = !1, V;
250
+ {
251
+ var Ue = typeof WeakMap == "function" ? WeakMap : Map;
252
+ V = new Ue();
253
+ }
254
+ function ve(e, r) {
255
+ if (!e || z)
256
+ return "";
257
+ {
258
+ var t = V.get(e);
259
+ if (t !== void 0)
260
+ return t;
261
+ }
262
+ var n;
263
+ z = !0;
264
+ var u = Error.prepareStackTrace;
265
+ Error.prepareStackTrace = void 0;
266
+ var c;
267
+ c = q.current, q.current = null, Me();
268
+ try {
269
+ if (r) {
270
+ var o = function() {
271
+ throw Error();
272
+ };
273
+ if (Object.defineProperty(o.prototype, "props", {
274
+ set: function() {
275
+ throw Error();
276
+ }
277
+ }), typeof Reflect == "object" && Reflect.construct) {
278
+ try {
279
+ Reflect.construct(o, []);
280
+ } catch (m) {
281
+ n = m;
282
+ }
283
+ Reflect.construct(e, [], o);
284
+ } else {
285
+ try {
286
+ o.call();
287
+ } catch (m) {
288
+ n = m;
289
+ }
290
+ e.call(o.prototype);
291
+ }
292
+ } else {
293
+ try {
294
+ throw Error();
295
+ } catch (m) {
296
+ n = m;
297
+ }
298
+ e();
299
+ }
300
+ } catch (m) {
301
+ if (m && n && typeof m.stack == "string") {
302
+ for (var i = m.stack.split(`
303
+ `), y = n.stack.split(`
304
+ `), f = i.length - 1, d = y.length - 1; f >= 1 && d >= 0 && i[f] !== y[d]; )
305
+ d--;
306
+ for (; f >= 1 && d >= 0; f--, d--)
307
+ if (i[f] !== y[d]) {
308
+ if (f !== 1 || d !== 1)
309
+ do
310
+ if (f--, d--, d < 0 || i[f] !== y[d]) {
311
+ var b = `
312
+ ` + i[f].replace(" at new ", " at ");
313
+ return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, b), b;
314
+ }
315
+ while (f >= 1 && d >= 0);
316
+ break;
317
+ }
318
+ }
319
+ } finally {
320
+ z = !1, q.current = c, Ve(), Error.prepareStackTrace = u;
321
+ }
322
+ var A = e ? e.displayName || e.name : "", C = A ? M(A) : "";
323
+ return typeof e == "function" && V.set(e, C), C;
324
+ }
325
+ function Be(e, r, t) {
326
+ return ve(e, !1);
327
+ }
328
+ function Je(e) {
329
+ var r = e.prototype;
330
+ return !!(r && r.isReactComponent);
331
+ }
332
+ function U(e, r, t) {
333
+ if (e == null)
334
+ return "";
335
+ if (typeof e == "function")
336
+ return ve(e, Je(e));
337
+ if (typeof e == "string")
338
+ return M(e);
339
+ switch (e) {
340
+ case P:
341
+ return M("Suspense");
342
+ case g:
343
+ return M("SuspenseList");
344
+ }
345
+ if (typeof e == "object")
346
+ switch (e.$$typeof) {
347
+ case p:
348
+ return Be(e.render);
349
+ case _:
350
+ return U(e.type, r, t);
351
+ case T: {
352
+ var n = e, u = n._payload, c = n._init;
353
+ try {
354
+ return U(c(u), r, t);
355
+ } catch {
356
+ }
357
+ }
358
+ }
359
+ return "";
360
+ }
361
+ var W = Object.prototype.hasOwnProperty, he = {}, pe = I.ReactDebugCurrentFrame;
362
+ function B(e) {
363
+ if (e) {
364
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
365
+ pe.setExtraStackFrame(t);
366
+ } else
367
+ pe.setExtraStackFrame(null);
368
+ }
369
+ function qe(e, r, t, n, u) {
370
+ {
371
+ var c = Function.call.bind(W);
372
+ for (var o in e)
373
+ if (c(e, o)) {
374
+ var i = void 0;
375
+ try {
376
+ if (typeof e[o] != "function") {
377
+ var y = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
378
+ throw y.name = "Invariant Violation", y;
379
+ }
380
+ i = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
381
+ } catch (f) {
382
+ i = f;
383
+ }
384
+ i && !(i instanceof Error) && (B(u), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof i), B(null)), i instanceof Error && !(i.message in he) && (he[i.message] = !0, B(u), v("Failed %s type: %s", t, i.message), B(null));
385
+ }
386
+ }
387
+ }
388
+ var Ke = Array.isArray;
389
+ function G(e) {
390
+ return Ke(e);
391
+ }
392
+ function ze(e) {
393
+ {
394
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
395
+ return t;
396
+ }
397
+ }
398
+ function Ge(e) {
399
+ try {
400
+ return ye(e), !1;
401
+ } catch {
402
+ return !0;
403
+ }
404
+ }
405
+ function ye(e) {
406
+ return "" + e;
407
+ }
408
+ function me(e) {
409
+ if (Ge(e))
410
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), ye(e);
411
+ }
412
+ var L = I.ReactCurrentOwner, Xe = {
413
+ key: !0,
414
+ ref: !0,
415
+ __self: !0,
416
+ __source: !0
417
+ }, ge, be, X;
418
+ X = {};
419
+ function He(e) {
420
+ if (W.call(e, "ref")) {
421
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
422
+ if (r && r.isReactWarning)
423
+ return !1;
424
+ }
425
+ return e.ref !== void 0;
426
+ }
427
+ function Ze(e) {
428
+ if (W.call(e, "key")) {
429
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
430
+ if (r && r.isReactWarning)
431
+ return !1;
432
+ }
433
+ return e.key !== void 0;
434
+ }
435
+ function Qe(e, r) {
436
+ if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
437
+ var t = R(L.current.type);
438
+ X[t] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', R(L.current.type), e.ref), X[t] = !0);
439
+ }
440
+ }
441
+ function er(e, r) {
442
+ {
443
+ var t = function() {
444
+ ge || (ge = !0, v("%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://reactjs.org/link/special-props)", r));
445
+ };
446
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
447
+ get: t,
448
+ configurable: !0
449
+ });
450
+ }
451
+ }
452
+ function rr(e, r) {
453
+ {
454
+ var t = function() {
455
+ be || (be = !0, v("%s: `ref` 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://reactjs.org/link/special-props)", r));
456
+ };
457
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
458
+ get: t,
459
+ configurable: !0
460
+ });
461
+ }
462
+ }
463
+ var tr = function(e, r, t, n, u, c, o) {
464
+ var i = {
465
+ // This tag allows us to uniquely identify this as a React Element
466
+ $$typeof: a,
467
+ // Built-in properties that belong on the element
468
+ type: e,
469
+ key: r,
470
+ ref: t,
471
+ props: o,
472
+ // Record the component responsible for creating this element.
473
+ _owner: c
474
+ };
475
+ return i._store = {}, Object.defineProperty(i._store, "validated", {
476
+ configurable: !1,
477
+ enumerable: !1,
478
+ writable: !0,
479
+ value: !1
480
+ }), Object.defineProperty(i, "_self", {
481
+ configurable: !1,
482
+ enumerable: !1,
483
+ writable: !1,
484
+ value: n
485
+ }), Object.defineProperty(i, "_source", {
486
+ configurable: !1,
487
+ enumerable: !1,
488
+ writable: !1,
489
+ value: u
490
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
491
+ };
492
+ function nr(e, r, t, n, u) {
493
+ {
494
+ var c, o = {}, i = null, y = null;
495
+ t !== void 0 && (me(t), i = "" + t), Ze(r) && (me(r.key), i = "" + r.key), He(r) && (y = r.ref, Qe(r, u));
496
+ for (c in r)
497
+ W.call(r, c) && !Xe.hasOwnProperty(c) && (o[c] = r[c]);
498
+ if (e && e.defaultProps) {
499
+ var f = e.defaultProps;
500
+ for (c in f)
501
+ o[c] === void 0 && (o[c] = f[c]);
502
+ }
503
+ if (i || y) {
504
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
505
+ i && er(o, d), y && rr(o, d);
506
+ }
507
+ return tr(e, i, y, u, n, L.current, o);
508
+ }
509
+ }
510
+ var H = I.ReactCurrentOwner, Ee = I.ReactDebugCurrentFrame;
511
+ function D(e) {
512
+ if (e) {
513
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
514
+ Ee.setExtraStackFrame(t);
515
+ } else
516
+ Ee.setExtraStackFrame(null);
517
+ }
518
+ var Z;
519
+ Z = !1;
520
+ function Q(e) {
521
+ return typeof e == "object" && e !== null && e.$$typeof === a;
522
+ }
523
+ function xe() {
524
+ {
525
+ if (H.current) {
526
+ var e = R(H.current.type);
527
+ if (e)
528
+ return `
529
+
530
+ Check the render method of \`` + e + "`.";
531
+ }
532
+ return "";
533
+ }
534
+ }
535
+ function ar(e) {
536
+ {
537
+ if (e !== void 0) {
538
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
539
+ return `
540
+
541
+ Check your code at ` + r + ":" + t + ".";
542
+ }
543
+ return "";
544
+ }
545
+ }
546
+ var Re = {};
547
+ function ir(e) {
548
+ {
549
+ var r = xe();
550
+ if (!r) {
551
+ var t = typeof e == "string" ? e : e.displayName || e.name;
552
+ t && (r = `
553
+
554
+ Check the top-level render call using <` + t + ">.");
555
+ }
556
+ return r;
557
+ }
558
+ }
559
+ function _e(e, r) {
560
+ {
561
+ if (!e._store || e._store.validated || e.key != null)
562
+ return;
563
+ e._store.validated = !0;
564
+ var t = ir(r);
565
+ if (Re[t])
566
+ return;
567
+ Re[t] = !0;
568
+ var n = "";
569
+ e && e._owner && e._owner !== H.current && (n = " It was passed a child from " + R(e._owner.type) + "."), D(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
570
+ }
571
+ }
572
+ function je(e, r) {
573
+ {
574
+ if (typeof e != "object")
575
+ return;
576
+ if (G(e))
577
+ for (var t = 0; t < e.length; t++) {
578
+ var n = e[t];
579
+ Q(n) && _e(n, r);
580
+ }
581
+ else if (Q(e))
582
+ e._store && (e._store.validated = !0);
583
+ else if (e) {
584
+ var u = Ie(e);
585
+ if (typeof u == "function" && u !== e.entries)
586
+ for (var c = u.call(e), o; !(o = c.next()).done; )
587
+ Q(o.value) && _e(o.value, r);
588
+ }
589
+ }
590
+ }
591
+ function or(e) {
592
+ {
593
+ var r = e.type;
594
+ if (r == null || typeof r == "string")
595
+ return;
596
+ var t;
597
+ if (typeof r == "function")
598
+ t = r.propTypes;
599
+ else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
600
+ // Inner props are checked in the reconciler.
601
+ r.$$typeof === _))
602
+ t = r.propTypes;
603
+ else
604
+ return;
605
+ if (t) {
606
+ var n = R(r);
607
+ qe(t, e.props, "prop", n, e);
608
+ } else if (r.PropTypes !== void 0 && !Z) {
609
+ Z = !0;
610
+ var u = R(r);
611
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
612
+ }
613
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
614
+ }
615
+ }
616
+ function sr(e) {
617
+ {
618
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
619
+ var n = r[t];
620
+ if (n !== "children" && n !== "key") {
621
+ D(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
622
+ break;
623
+ }
624
+ }
625
+ e.ref !== null && (D(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
626
+ }
627
+ }
628
+ var we = {};
629
+ function Te(e, r, t, n, u, c) {
630
+ {
631
+ var o = Ne(e);
632
+ if (!o) {
633
+ var i = "";
634
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
635
+ var y = ar(u);
636
+ y ? i += y : i += xe();
637
+ var f;
638
+ e === null ? f = "null" : G(e) ? f = "array" : e !== void 0 && e.$$typeof === a ? (f = "<" + (R(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, i);
639
+ }
640
+ var d = nr(e, r, t, u, c);
641
+ if (d == null)
642
+ return d;
643
+ if (o) {
644
+ var b = r.children;
645
+ if (b !== void 0)
646
+ if (n)
647
+ if (G(b)) {
648
+ for (var A = 0; A < b.length; A++)
649
+ je(b[A], e);
650
+ Object.freeze && Object.freeze(b);
651
+ } else
652
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
653
+ else
654
+ je(b, e);
655
+ }
656
+ if (W.call(r, "key")) {
657
+ var C = R(e), m = Object.keys(r).filter(function(vr) {
658
+ return vr !== "key";
659
+ }), ee = m.length > 0 ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}";
660
+ if (!we[C + ee]) {
661
+ var dr = m.length > 0 ? "{" + m.join(": ..., ") + ": ...}" : "{}";
662
+ v(`A props object containing a "key" prop is being spread into JSX:
663
+ let props = %s;
664
+ <%s {...props} />
665
+ React keys must be passed directly to JSX without using spread:
666
+ let props = %s;
667
+ <%s key={someKey} {...props} />`, ee, C, dr, C), we[C + ee] = !0;
668
+ }
669
+ }
670
+ return e === E ? sr(d) : or(d), d;
671
+ }
672
+ }
673
+ function ur(e, r, t) {
674
+ return Te(e, r, t, !0);
675
+ }
676
+ function lr(e, r, t) {
677
+ return Te(e, r, t, !1);
678
+ }
679
+ var cr = lr, fr = ur;
680
+ N.Fragment = E, N.jsx = cr, N.jsxs = fr;
681
+ }()), N;
682
+ }
683
+ process.env.NODE_ENV === "production" ? re.exports = gr() : re.exports = br();
684
+ var l = re.exports;
685
+ const Er = () => /* @__PURE__ */ l.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
686
+ /* @__PURE__ */ l.jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
687
+ /* @__PURE__ */ l.jsx("polyline", { points: "22 4 12 14.01 9 11.01" })
688
+ ] }), xr = () => /* @__PURE__ */ l.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
689
+ /* @__PURE__ */ l.jsx("circle", { cx: "12", cy: "12", r: "10" }),
690
+ /* @__PURE__ */ l.jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
691
+ /* @__PURE__ */ l.jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
692
+ ] }), Rr = () => /* @__PURE__ */ l.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
693
+ /* @__PURE__ */ l.jsx("circle", { cx: "12", cy: "12", r: "10" }),
694
+ /* @__PURE__ */ l.jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
695
+ /* @__PURE__ */ l.jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
696
+ ] }), _r = () => /* @__PURE__ */ l.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
697
+ /* @__PURE__ */ l.jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
698
+ /* @__PURE__ */ l.jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
699
+ /* @__PURE__ */ l.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
700
+ ] }), jr = ({ config: s }) => {
701
+ var w, j;
702
+ const [a, h] = Oe(!1), E = () => {
703
+ h(!0), setTimeout(() => {
704
+ S.dismiss();
705
+ }, 300);
706
+ }, O = {
707
+ success: Er,
708
+ error: xr,
709
+ info: Rr,
710
+ warning: _r
711
+ }[s.type || "info"];
712
+ return /* @__PURE__ */ l.jsxs(
713
+ "div",
714
+ {
715
+ className: `aura-toast ${s.type || "info"} ${a ? "aura-toast-exit" : "aura-toast-enter"} ${s.className || ""}`,
716
+ style: {
717
+ ...s.style,
718
+ ...(w = s.style) != null && w["--type-color"] ? { "--type-color": s.style["--type-color"] } : {},
719
+ ...(j = s.style) != null && j["--type-glow"] ? { "--type-glow": s.style["--type-glow"] } : {}
720
+ },
721
+ children: [
722
+ /* @__PURE__ */ l.jsx("div", { className: "aura-icon", children: /* @__PURE__ */ l.jsx(O, {}) }),
723
+ /* @__PURE__ */ l.jsxs("div", { className: "aura-content", children: [
724
+ /* @__PURE__ */ l.jsx("p", { className: "aura-message", children: s.message }),
725
+ s.action && /* @__PURE__ */ l.jsx("button", { className: "aura-action", onClick: () => {
726
+ var x;
727
+ (x = s.action) == null || x.onClick(), E();
728
+ }, children: s.action.label })
729
+ ] }),
730
+ /* @__PURE__ */ l.jsx("button", { className: "aura-close", onClick: E, "aria-label": "Close", children: /* @__PURE__ */ l.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
731
+ /* @__PURE__ */ l.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
732
+ /* @__PURE__ */ l.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
733
+ ] }) })
734
+ ]
735
+ }
736
+ );
737
+ };
738
+ const Cr = ({ children: s }) => {
739
+ const [a, h] = Oe(null);
740
+ return yr(() => S.subscribe((E) => {
741
+ h(E);
742
+ }), []), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
743
+ s,
744
+ /* @__PURE__ */ l.jsx("div", { className: "aura-container", children: a && /* @__PURE__ */ l.jsx(
745
+ jr,
746
+ {
747
+ config: a
748
+ },
749
+ a.id
750
+ ) })
751
+ ] });
752
+ };
753
+ export {
754
+ Cr as AuraProvider,
755
+ jr as AuraToast,
756
+ kr as auraToast,
757
+ S as toastStore
758
+ };
@@ -0,0 +1,21 @@
1
+ import { ToastConfig, ToastState, Listener } from '../types';
2
+
3
+ declare class ToastStore {
4
+ private state;
5
+ private listeners;
6
+ private timeoutId;
7
+ getState(): ToastState;
8
+ subscribe(listener: Listener): () => void;
9
+ private notify;
10
+ show(config: ToastConfig): void;
11
+ dismiss(): void;
12
+ }
13
+ export declare const toastStore: ToastStore;
14
+ export declare const auraToast: {
15
+ success: (message: string, config?: Omit<ToastConfig, "message" | "type">) => void;
16
+ error: (message: string, config?: Omit<ToastConfig, "message" | "type">) => void;
17
+ info: (message: string, config?: Omit<ToastConfig, "message" | "type">) => void;
18
+ warning: (message: string, config?: Omit<ToastConfig, "message" | "type">) => void;
19
+ dismiss: () => void;
20
+ };
21
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export * from './core/ToastStore';
3
+ export * from './react/AuraProvider';
4
+ export * from './react/AuraToast';
@@ -0,0 +1,5 @@
1
+ import { default as React } from '../react';
2
+
3
+ export declare const AuraProvider: React.FC<{
4
+ children: React.ReactNode;
5
+ }>;
@@ -0,0 +1,6 @@
1
+ import { default as React } from '../react';
2
+ import { ToastConfig } from '../types';
3
+
4
+ export declare const AuraToast: React.FC<{
5
+ config: ToastConfig;
6
+ }>;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";:root{--aura-bg: rgba(17, 25, 40, .75);--aura-border: rgba(255, 255, 255, .125);--aura-text: #ffffff;--aura-text-muted: rgba(255, 255, 255, .6);--aura-font: "Inter", system-ui, -apple-system, sans-serif;--aura-success: #10b981;--aura-error: #ef4444;--aura-info: #3b82f6;--aura-warning: #f59e0b;--aura-glow-success: rgba(16, 185, 129, .5);--aura-glow-error: rgba(239, 68, 68, .5);--aura-glow-info: rgba(59, 130, 246, .5);--aura-glow-warning: rgba(245, 158, 11, .5)}.aura-container{position:fixed;top:2rem;right:2rem;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;pointer-events:none}.aura-toast{pointer-events:auto;min-width:320px;max-width:440px;padding:1rem 1.25rem;border-radius:16px;background:var(--aura-bg);backdrop-filter:blur(16px) saturate(180%);-webkit-backdrop-filter:blur(16px) saturate(180%);border:1px solid var(--aura-border);box-shadow:0 8px 32px #0000005e,inset 0 0 0 1px #ffffff0d;display:flex;gap:1rem;align-items:flex-start;font-family:var(--aura-font);color:var(--aura-text);overflow:hidden;position:relative;transition:all .4s cubic-bezier(.18,.89,.32,1.28)}.aura-toast:before{content:"";position:absolute;top:0;left:0;width:4px;height:100%;background:var(--type-color);box-shadow:0 0 15px var(--type-glow)}.aura-toast.success{--type-color: var(--aura-success);--type-glow: var(--aura-glow-success)}.aura-toast.error{--type-color: var(--aura-error);--type-glow: var(--aura-glow-error)}.aura-toast.info{--type-color: var(--aura-info);--type-glow: var(--aura-glow-info)}.aura-toast.warning{--type-color: var(--aura-warning);--type-glow: var(--aura-glow-warning)}.aura-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;margin-top:2px}.aura-content{flex-grow:1}.aura-message{font-size:.9375rem;font-weight:500;line-height:1.5;margin:0}.aura-action{margin-top:.75rem;font-size:.875rem;font-weight:600;color:var(--type-color);background:none;border:none;padding:0;cursor:pointer;text-transform:uppercase;letter-spacing:.05em;transition:opacity .2s}.aura-action:hover{opacity:.8}.aura-close{background:none;border:none;color:var(--aura-text-muted);cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;margin-right:-4px;margin-top:-2px;transition:color .2s}.aura-close:hover{color:var(--aura-text)}@keyframes aura-slide-in{0%{transform:translate(100%) scale(.9);opacity:0}to{transform:translate(0) scale(1);opacity:1}}@keyframes aura-fade-out{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(20%) scale(.95);opacity:0}}.aura-toast-enter{animation:aura-slide-in .5s cubic-bezier(.18,.89,.32,1.28) forwards}.aura-toast-exit{animation:aura-fade-out .3s ease-in forwards}
@@ -0,0 +1,15 @@
1
+ export type ToastType = 'success' | 'error' | 'info' | 'warning';
2
+ export interface ToastConfig {
3
+ message: string;
4
+ type?: ToastType;
5
+ duration?: number;
6
+ id?: string;
7
+ action?: {
8
+ label: string;
9
+ onClick: () => void;
10
+ };
11
+ style?: React.CSSProperties;
12
+ className?: string;
13
+ }
14
+ export type ToastState = ToastConfig | null;
15
+ export type Listener = (state: ToastState) => void;
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "aura-toast",
3
+ "version": "0.1.0",
4
+ "description": "Premium glassmorphism toast manager with single-toast constraint",
5
+ "main": "dist/aura-toast.cjs.js",
6
+ "module": "dist/aura-toast.es.js",
7
+ "style": "dist/style.css",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "sideEffects": false,
13
+ "scripts": {
14
+ "dev": "vite",
15
+ "build": "vite build && tsc-alias",
16
+ "test": "vitest run",
17
+ "preview": "vite preview"
18
+ },
19
+ "keywords": [
20
+ "toast",
21
+ "notification",
22
+ "glassmorphism",
23
+ "premium",
24
+ "ui"
25
+ ],
26
+ "author": "DamiCode",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/damicode18/aura-toast.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/damicode18/aura-toast/issues"
34
+ },
35
+ "homepage": "https://github.com/damicode18/aura-toast#readme",
36
+ "devDependencies": {
37
+ "@testing-library/jest-dom": "^6.9.1",
38
+ "@testing-library/react": "^16.3.2",
39
+ "@types/node": "^20.0.0",
40
+ "@types/react": "^18.2.0",
41
+ "@types/react-dom": "^18.2.0",
42
+ "@vitejs/plugin-react": "^4.0.0",
43
+ "@vitest/ui": "^4.1.0",
44
+ "jsdom": "^28.1.0",
45
+ "react": "^18.2.0",
46
+ "react-dom": "^18.2.0",
47
+ "tsc-alias": "^1.8.0",
48
+ "typescript": "^5.0.0",
49
+ "vite": "^4.4.0",
50
+ "vite-plugin-dts": "^3.0.0",
51
+ "vitest": "^4.1.0"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^18.2.0",
55
+ "react-dom": "^18.2.0"
56
+ }
57
+ }