@sriramvenkatesan/react-toast-popup 1.1.3

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.
@@ -0,0 +1,21 @@
1
+ type PositionType = "bottom-left" | "bottom-right" | "top-left" | "top-right";
2
+ interface NotificationProps {
3
+ type: "success" | "info" | "warning" | "error";
4
+ message: string;
5
+ onClose: () => void;
6
+ animation?: "fade" | "pop" | "slide";
7
+ }
8
+ interface NotificationProps {
9
+ type: "success" | "info" | "warning" | "error";
10
+ message: string;
11
+ duration: number;
12
+ animation?: "fade" | "pop" | "slide";
13
+ }
14
+ interface UseNotificationReturn {
15
+ NotificationComponent: JSX.Element;
16
+ triggerNotification: (notificationProps: NotificationProps) => void;
17
+ }
18
+
19
+ declare const useNotification: (position?: PositionType) => UseNotificationReturn;
20
+
21
+ export { useNotification as default };
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";var e=require("react"),r=function(){return r=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},r.apply(this,arguments)};function t(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var n,o={exports:{}},a={};var i,c={};
2
+ /**
3
+ * @license React
4
+ * react-jsx-runtime.development.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */"production"===process.env.NODE_ENV?o.exports=function(){if(n)return a;n=1;var r=e,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,n){var o,a={},l=null,u=null;for(o in void 0!==n&&(l=""+n),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)i.call(r,o)&&!s.hasOwnProperty(o)&&(a[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===a[o]&&(a[o]=r[o]);return{$$typeof:t,type:e,key:l,ref:u,props:a,_owner:c.current}}return a.Fragment=o,a.jsx=l,a.jsxs=l,a}():o.exports=(i||(i=1,"production"!==process.env.NODE_ENV&&function(){var r=e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,g="@@iterator",h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];!function(e,r,t){var n=h.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(r+="%s",t=t.concat([n]));var o=t.map((function(e){return String(e)}));o.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,o)}("error",e,t)}var w,O=!1,j=!1,x=!1,k=!1,S=!1;function _(e){return e.displayName||"Context"}function E(e){if(null==e)return null;if("number"==typeof e.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return _(e)+".Consumer";case s:return _(e._context)+".Provider";case u:return function(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return""!==o?t+"("+o+")":t}(e,e.render,"ForwardRef");case y:var r=e.displayName||null;return null!==r?r:E(e.type)||"Memo";case d:var t=e,c=t._payload,m=t._init;try{return E(m(c))}catch(e){return null}}return null}w=Symbol.for("react.module.reference");var R,P,C,N,T,D,I,$=Object.assign,L=0;function z(){}z.__reactDisabledLog=!0;var F,U=h.ReactCurrentDispatcher;function A(e,r,t){if(void 0===F)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);F=n&&n[1]||""}return"\n"+F+e}var B,M=!1,W="function"==typeof WeakMap?WeakMap:Map;function V(e,r){if(!e||M)return"";var t,n=B.get(e);if(void 0!==n)return n;M=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=U.current,U.current=null,function(){if(0===L){R=console.log,P=console.info,C=console.warn,N=console.error,T=console.group,D=console.groupCollapsed,I=console.groupEnd;var e={configurable:!0,enumerable:!0,value:z,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){t=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){t=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){t=e}e()}}catch(r){if(r&&t&&"string"==typeof r.stack){for(var c=r.stack.split("\n"),s=t.stack.split("\n"),l=c.length-1,u=s.length-1;l>=1&&u>=0&&c[l]!==s[u];)u--;for(;l>=1&&u>=0;l--,u--)if(c[l]!==s[u]){if(1!==l||1!==u)do{if(l--,--u<0||c[l]!==s[u]){var f="\n"+c[l].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&B.set(e,f),f}}while(l>=1&&u>=0);break}}}finally{M=!1,U.current=o,function(){if(0==--L){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},e,{value:R}),info:$({},e,{value:P}),warn:$({},e,{value:C}),error:$({},e,{value:N}),group:$({},e,{value:T}),groupCollapsed:$({},e,{value:D}),groupEnd:$({},e,{value:I})})}L<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var p=e?e.displayName||e.name:"",y=p?A(p):"";return"function"==typeof e&&B.set(e,y),y}function Y(e,r,t){if(null==e)return"";if("function"==typeof e)return V(e,!(!(n=e.prototype)||!n.isReactComponent));var n;if("string"==typeof e)return A(e);switch(e){case f:return A("Suspense");case p:return A("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return V(e.render,!1);case y:return Y(e.type,r,t);case d:var o=e,a=o._payload,i=o._init;try{return Y(i(a),r,t)}catch(e){}}return""}B=new W;var Z=Object.prototype.hasOwnProperty,q={},H=h.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);H.setExtraStackFrame(t)}else H.setExtraStackFrame(null)}var K=Array.isArray;function X(e){return K(e)}function G(e){return""+e}function Q(e){if(function(e){try{return G(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),G(e)}var ee,re,te,ne=h.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};te={};var ae=function(e,r,n,o,a,i,c){var s={$$typeof:t,type:e,key:r,ref:n,props:c,_owner:i,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ie(e,r,t,n,o){var a,i={},c=null,s=null;for(a in void 0!==t&&(Q(t),c=""+t),function(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(r)&&(Q(r.key),c=""+r.key),function(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return void 0!==e.ref}(r)&&(s=r.ref,function(e,r){if("string"==typeof e.ref&&ne.current&&r&&ne.current.stateNode!==r){var t=E(ne.current.type);te[t]||(b('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',E(ne.current.type),e.ref),te[t]=!0)}}(r,o)),r)Z.call(r,a)&&!oe.hasOwnProperty(a)&&(i[a]=r[a]);if(e&&e.defaultProps){var l=e.defaultProps;for(a in l)void 0===i[a]&&(i[a]=l[a])}if(c||s){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,r){var t=function(){ee||(ee=!0,b("%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})}(i,u),s&&function(e,r){var t=function(){re||(re=!0,b("%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})}(i,u)}return ae(e,c,s,o,n,ne.current,i)}var ce,se=h.ReactCurrentOwner,le=h.ReactDebugCurrentFrame;function ue(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);le.setExtraStackFrame(t)}else le.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function pe(){if(se.current){var e=E(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ce=!1;var ye={};function de(e,r){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var r=pe();if(!r){var t="string"==typeof e?e:e.displayName||e.name;t&&(r="\n\nCheck the top-level render call using <"+t+">.")}return r}(r);if(!ye[t]){ye[t]=!0;var n="";e&&e._owner&&e._owner!==se.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),ue(e),b('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),ue(null)}}}function me(e,r){if("object"==typeof e)if(X(e))for(var t=0;t<e.length;t++){var n=e[t];fe(n)&&de(n,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var r=v&&e[v]||e[g];return"function"==typeof r?r:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)fe(a.value)&&de(a.value,r)}}function ve(e){var r,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==u&&t.$$typeof!==y)return;r=t.propTypes}if(r){var n=E(t);!function(e,r,t,n,o){var a=Function.call.bind(Z);for(var i in e)if(a(e,i)){var c=void 0;try{if("function"!=typeof e[i]){var s=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}c=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){c=e}!c||c instanceof Error||(J(o),b("%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,i,typeof c),J(null)),c instanceof Error&&!(c.message in q)&&(q[c.message]=!0,J(o),b("Failed %s type: %s",t,c.message),J(null))}}(r,e.props,"prop",n,e)}else void 0===t.PropTypes||ce||(ce=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ge={};function he(e,r,n,c,v,g){var h=function(e){return"string"==typeof e||"function"==typeof e||!!(e===o||e===i||S||e===a||e===f||e===p||k||e===m||O||j||x)||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===w||void 0!==e.getModuleId)}(e);if(!h){var _,R="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),R+=pe(),null===e?_="null":X(e)?_="array":void 0!==e&&e.$$typeof===t?(_="<"+(E(e.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,R)}var P=ie(e,r,n,v,g);if(null==P)return P;if(h){var C=r.children;if(void 0!==C)if(c)if(X(C)){for(var N=0;N<C.length;N++)me(C[N],e);Object.freeze&&Object.freeze(C)}else b("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 me(C,e)}if(Z.call(r,"key")){var T=E(e),D=Object.keys(r).filter((function(e){return"key"!==e})),I=D.length>0?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}";ge[T+I]||(b('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',I,T,D.length>0?"{"+D.join(": ..., ")+": ...}":"{}",T),ge[T+I]=!0)}return e===o?function(e){for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if("children"!==n&&"key"!==n){ue(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ue(null);break}}null!==e.ref&&(ue(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(P):ve(P),P}var be=function(e,r,t){return he(e,r,t,!1)},we=function(e,r,t){return he(e,r,t,!0)};c.Fragment=o,c.jsx=be,c.jsxs=we}()),c);var s=o.exports,l={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u=e.createContext&&e.createContext(l),f=["attr","size","title"];function p(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(r.indexOf(n)>=0)continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},y.apply(this,arguments)}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function m(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){v(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function v(e,r,t){return r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function g(r){return r&&r.map(((r,t)=>e.createElement(r.tag,m({key:t},r.attr),g(r.child))))}function h(r){return t=>e.createElement(b,y({attr:m({},r.attr)},t),g(r.child))}function b(r){var t=t=>{var n,{attr:o,size:a,title:i}=r,c=p(r,f),s=a||t.size||"1em";return t.className&&(n=t.className),r.className&&(n=(n?n+" ":"")+r.className),e.createElement("svg",y({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,c,{className:n,style:m(m({color:r.color||t.color},t.style),r.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),i&&e.createElement("title",null,i),r.children)};return void 0!==u?e.createElement(u.Consumer,null,(e=>t(e))):t(l)}function w(e){return h({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M799.855 166.312c.023.007.043.018.084.059l57.69 57.69c.041.041.052.06.059.084a.118.118 0 0 1 0 .069c-.007.023-.018.042-.059.083L569.926 512l287.703 287.703c.041.04.052.06.059.083a.118.118 0 0 1 0 .07c-.007.022-.018.042-.059.083l-57.69 57.69c-.041.041-.06.052-.084.059a.118.118 0 0 1-.069 0c-.023-.007-.042-.018-.083-.059L512 569.926 224.297 857.629c-.04.041-.06.052-.083.059a.118.118 0 0 1-.07 0c-.022-.007-.042-.018-.083-.059l-57.69-57.69c-.041-.041-.052-.06-.059-.084a.118.118 0 0 1 0-.069c.007-.023.018-.042.059-.083L454.073 512 166.371 224.297c-.041-.04-.052-.06-.059-.083a.118.118 0 0 1 0-.07c.007-.022.018-.042.059-.083l57.69-57.69c.041-.041.06-.052.084-.059a.118.118 0 0 1 .069 0c.023.007.042.018.083.059L512 454.073l287.703-287.702c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"},child:[]}]})(e)}!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".notification {\r\n /* A11y */\r\n outline: none;\r\n /* A11y */\r\n padding: 15px;\r\n margin: 10px;\r\n color: white;\r\n display: flex;\r\n align-items: center;\r\n border-radius: 5px;\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\n.success {\r\n background-color: #4caf50;\r\n}\r\n.info {\r\n background-color: #2196f3;\r\n}\r\n.warning {\r\n background-color: #ff9800;\r\n}\r\n.error {\r\n background-color: #f44336;\r\n}\r\n\r\n/* Positioning */\r\n.top-right {\r\n position: fixed;\r\n top: 20px;\r\n right: 20px;\r\n}\r\n\r\n.top-left {\r\n position: fixed;\r\n top: 20px;\r\n left: 20px;\r\n}\r\n\r\n.bottom-right {\r\n position: fixed;\r\n bottom: 20px;\r\n right: 20px;\r\n}\r\n\r\n.bottom-left {\r\n position: fixed;\r\n bottom: 20px;\r\n left: 20px;\r\n}\r\n\r\n.notification-container {\r\n display: flex;\r\n /* Stack notifications from bottom to top */\r\n align-items: flex-end; /* Align notifications to the right */\r\n}\r\n\r\n.notification-container.bottom {\r\n flex-direction: column-reverse;\r\n}\r\n.notification-container.top {\r\n flex-direction: column;\r\n}\r\n/* Positioning */\r\n\r\n.closeBtn {\r\n margin-left: 5px;\r\n background: none;\r\n border: none;\r\n padding: 0;\r\n cursor: pointer;\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n/* Animations */\r\n@keyframes fadeIn {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes popup {\r\n from {\r\n transform: scale(0.5);\r\n opacity: 0;\r\n }\r\n to {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes slideIn {\r\n from {\r\n transform: translateY(100%);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n}\r\n\r\n.fadeIn {\r\n animation: fadeIn 0.5s;\r\n}\r\n.popup {\r\n animation: popup 0.5s ease-out;\r\n}\r\n.slideIn {\r\n animation: slideIn 0.5s ease-out;\r\n}\r\n/* Animations */\r\n");for(var O,j={marginRight:"10px"},x={success:s.jsx((function(e){return h({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0 0 51.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}),{style:j}),info:s.jsx((function(e){return h({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}),{style:j}),warning:s.jsx((function(e){return h({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M464 720a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"},child:[]}]})(e)}),{style:j}),error:s.jsx((function(e){return h({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372Zm128.013 198.826c.023.007.042.018.083.059l45.02 45.019c.04.04.05.06.058.083a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082L557.254 512l127.861 127.862a.268.268 0 0 1 .05.06l.009.023a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082l-45.019 45.02c-.04.04-.06.05-.083.058a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059L512 557.254 384.14 685.115c-.042.041-.06.052-.084.059a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059l-45.02-45.019c-.04-.04-.05-.06-.058-.083a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082L466.745 512l-127.86-127.86a.268.268 0 0 1-.05-.061l-.009-.023a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082l45.019-45.02c.04-.04.06-.05.083-.058a.118.118 0 0 1 .07 0c.022.007.041.018.082.059L512 466.745l127.862-127.86c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"},child:[]}]})(e)}),{style:j})},k={fade:"fadeIn",pop:"popup",slide:"slideIn"},S=function(r){var t=r.type,n=void 0===t?"info":t,o=r.message,a=r.onClose,i=r.animation,c=void 0===i?"slide":i,l=e.useRef(null);e.useEffect((function(){l.current&&l.current.focus()}),[]);var u="error"===n||"warning"===n?"alert":"status",f="error"===n||"warning"===n?"assertive":"polite";return s.jsxs("div",{className:"notification ".concat(n," ").concat(k[c]),role:u,"aria-live":f,tabIndex:-1,ref:l,children:[x[n]," ",o,s.jsx("button",{className:"closeBtn",onClick:function(){return a()},children:s.jsx(w,{color:"white"})})]})},_=[],E=0;E<256;++E)_.push((E+256).toString(16).slice(1));var R=new Uint8Array(16);function P(){if(!O&&!(O="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(R)}var C={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function N(e,r,t){if(C.randomUUID&&!r&&!e)return C.randomUUID();var n=(e=e||{}).random||(e.rng||P)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,r=0){return(_[e[r+0]]+_[e[r+1]]+_[e[r+2]]+_[e[r+3]]+"-"+_[e[r+4]]+_[e[r+5]]+"-"+_[e[r+6]]+_[e[r+7]]+"-"+_[e[r+8]]+_[e[r+9]]+"-"+_[e[r+10]]+_[e[r+11]]+_[e[r+12]]+_[e[r+13]]+_[e[r+14]]+_[e[r+15]]).toLowerCase()}(n)}module.exports=function(n){void 0===n&&(n="bottom-right");var o=e.useState([]),a=o[0],i=o[1],c=e.useCallback((function(e){var n=N();i((function(o){return t(t([],o,!0),[r({id:n},e)],!1)})),setTimeout((function(){i((function(e){return e.filter((function(e){return e.id!==n}))}))}),e.duration)}),[]);return{NotificationComponent:s.jsx("div",{className:"notification-container ".concat(n," ").concat(n.split("-")[0]),children:a.map((function(e,n){return s.jsx(S,r({},e,{onClose:function(){return function(e){i((function(r){var n=t([],r,!0);return n.splice(e,1),n}))}(n)}}),e.id)}))}),triggerNotification:c}};
11
+ //# sourceMappingURL=index.js.map