New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

reapop

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reapop - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

127

dist/reapop.cjs.development.js

@@ -62,11 +62,6 @@ 'use strict';

var _s = /*#__PURE__*/$RefreshSig$();
var useTheme = function useTheme() {
_s();
return React.useContext(ThemeContext);
};
_s(useTheme, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
function _extends() {

@@ -150,11 +145,6 @@ _extends = Object.assign ? Object.assign.bind() : function (target) {

var _s$1 = /*#__PURE__*/$RefreshSig$();
var useComponentsContext = function useComponentsContext() {
_s$1();
return React.useContext(ComponentsContext);
};
_s$1(useComponentsContext, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
var _excluded = ["children", "notification", "nodeRef"];

@@ -221,8 +211,2 @@

_c = SlideTransition;
var _c;
$RefreshReg$(_c, "SlideTransition");
var NotificationIcon = function NotificationIcon(props) {

@@ -295,8 +279,2 @@ var theme = props.theme;

_c$1 = NotificationIcon;
var _c$1;
$RefreshReg$(_c$1, "NotificationIcon");
var NotificationDismissIcon = function NotificationDismissIcon(props) {

@@ -320,12 +298,3 @@ var theme = props.theme,

_c$2 = NotificationDismissIcon;
var _c$2;
$RefreshReg$(_c$2, "NotificationDismissIcon");
var _s$2 = /*#__PURE__*/$RefreshSig$();
var NotificationButton = function NotificationButton(props) {
_s$2();
var notification = props.notification,

@@ -375,15 +344,3 @@ theme = props.theme,

_s$2(NotificationButton, "p3sJYXaSRjRHSqFkChzufMjgutM=");
_c$3 = NotificationButton;
var _c$3;
$RefreshReg$(_c$3, "NotificationButton");
var _s$3 = /*#__PURE__*/$RefreshSig$();
var NotificationImage = function NotificationImage(props) {
_s$3();
var notification = props.notification;

@@ -404,12 +361,2 @@ var theme = useTheme();

_s$3(NotificationImage, "VrMvFCCB9Haniz3VCRPNUiCauHs=", false, function () {
return [useTheme];
});
_c$4 = NotificationImage;
var _c$4;
$RefreshReg$(_c$4, "NotificationImage");
var Notification = function Notification(props) {

@@ -491,15 +438,5 @@ var notification = props.notification,

_c$5 = Notification;
var _c$5;
$RefreshReg$(_c$5, "Notification");
var _s$4 = /*#__PURE__*/$RefreshSig$();
var _excluded$1 = ["notification", "dismissNotification"];
var NotificationContainer = function NotificationContainer(props) {
_s$4();
var notification = props.notification,

@@ -569,17 +506,3 @@ _dismissNotification = props.dismissNotification,

_s$4(NotificationContainer, "igJYAJRuH7PPENcXe0Ukc0PLuDk=", false, function () {
return [useComponentsContext, useTheme];
});
_c$6 = NotificationContainer;
var _c$6;
$RefreshReg$(_c$6, "NotificationContainer");
var _s$5 = /*#__PURE__*/$RefreshSig$();
var NotificationsContainer = function NotificationsContainer(props) {
_s$5();
var position = props.position,

@@ -612,17 +535,3 @@ dismissNotification = props.dismissNotification,

_s$5(NotificationsContainer, "VrMvFCCB9Haniz3VCRPNUiCauHs=", false, function () {
return [useTheme];
});
_c$7 = NotificationsContainer;
var _c$7;
$RefreshReg$(_c$7, "NotificationsContainer");
var _s$6 = /*#__PURE__*/$RefreshSig$();
var NotificationsSystem = function NotificationsSystem(props) {
_s$6();
var smallScreenBreakpoint = props.smallScreenBreakpoint || 768;

@@ -671,10 +580,2 @@ var theme = props.theme;

_s$6(NotificationsSystem, "p6w92m0KSUul1HF13ypxP0W3C0Y=");
_c$8 = NotificationsSystem;
var _c$8;
$RefreshReg$(_c$8, "NotificationsSystem");
var NotificationAction;

@@ -805,6 +706,3 @@

var _s$7 = /*#__PURE__*/$RefreshSig$();
var NotificationsProvider = function NotificationsProvider(props) {
_s$7();
var _useReducer = React.useReducer(notificationsReducer(), []),

@@ -833,10 +731,2 @@ notifications = _useReducer[0],

_s$7(NotificationsProvider, "C/anGTSwZtycS2550LCiBZPhCik=");
_c$9 = NotificationsProvider;
var _c$9;
$RefreshReg$(_c$9, "NotificationsProvider");
var _excluded$2 = ["children", "nodeRef"];

@@ -887,8 +777,2 @@

_c$a = FadeTransition;
var _c$a;
$RefreshReg$(_c$a, "FadeTransition");
var _excluded$3 = ["children", "nodeRef"];

@@ -953,17 +837,6 @@

_c$b = GrowTransition;
var _c$b;
$RefreshReg$(_c$b, "GrowTransition");
var _s$8 = /*#__PURE__*/$RefreshSig$();
var useNotifications = function useNotifications() {
_s$8();
return React.useContext(ReapopNotificationsContext);
};
_s$8(useNotifications, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
var _containerPerPosition;

@@ -970,0 +843,0 @@ var containerPerPositionStyles = (_containerPerPosition = {}, _containerPerPosition[POSITIONS.topCenter] = {

2

dist/reapop.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,i=require("react"),e=(t=i)&&"object"==typeof t&&"default"in t?t.default:t,n=require("react-transition-group"),o={defaultProps:{},customizeNotification:null,generateId:null},r=Object.freeze({none:"none",info:"info",success:"success",loading:"loading",warning:"warning",error:"error"}),a=Object.freeze({topCenter:"top-center",topLeft:"top-left",topRight:"top-right",bottomCenter:"bottom-center",bottomLeft:"bottom-left",bottomRight:"bottom-right"}),s=i.createContext({}),c=i.createContext(void 0),f=$RefreshSig$(),u=function(){return f(),i.useContext(c)};function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}).apply(this,arguments)}function p(t,i){if(null==t)return{};var e,n,o={},r=Object.keys(t);for(n=0;n<r.length;n++)i.indexOf(e=r[n])>=0||(o[e]=t[e]);return o}f(u,"gDsCjeeItUuvgOWf1v4qoK9RF6k=");var d=function(){function t(t,i){this.remainingTime=t,this.callback=i}var i=t.prototype;return i.pause=function(){clearTimeout(this.timerId),this.remainingTime-=(new Date).getTime()-this.start.getTime()},i.resume=function(){this.start=new Date,clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remainingTime)},t}(),m=function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return i.map((function(i){return t(i)}));var e={};for(var n in i)e[n]=t(i[n]);return e},g=function(t){return!!t&&t.constructor===Object},x=function(){},h=$RefreshSig$(),b=function(){return h(),i.useContext(s)};h(b,"gDsCjeeItUuvgOWf1v4qoK9RF6k=");var v=["children","notification","nodeRef"],w=function(t){var i=t.duration||300,o=t.children,r=t.notification,s=t.nodeRef,c=p(t,v),f=function(){return s.current},u=[a.topCenter,a.bottomCenter].includes(r.position)?"translateY":"translateX",d=[a.topCenter,a.topLeft,a.bottomLeft].includes(r.position)?"-100%":"100%",m={fill:"forwards",duration:i};return e.createElement(n.Transition,l({nodeRef:s,onEnter:function(){f().animate([{transform:u+"("+d+")",opacity:0},{transform:u+"(0)",opacity:1}],m)},onExit:function(){var t=i;f().animate([{transform:u+"("+d+")",opacity:0}],m),f().animate([{maxHeight:"150px"},{margin:0,maxHeight:0}],l({},m,{duration:250,delay:t}))},timeout:i+250},c),o)};$RefreshReg$(w,"SlideTransition");var y=function(t){var i=t.theme,n=t.notification.status,o={style:i?i.notificationIcon(t.notification):{},className:"reapop__notification-icon"};switch(n){case r.none:return null;case r.info:return e.createElement("svg",l({viewBox:"0 0 16 16",fill:"currentColor"},o),e.createElement("path",{fillRule:"evenodd",d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM8 5.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"}));case r.loading:return e.createElement("svg",l({viewBox:"5 5 40 40",fill:"currentColor"},o),e.createElement("path",{d:"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"},e.createElement("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"0.5s",repeatCount:"indefinite"})));case r.success:return e.createElement("svg",l({viewBox:"0 0 16 16",fill:"currentColor"},o),e.createElement("path",{fillRule:"evenodd",d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}));case r.warning:return e.createElement("svg",l({viewBox:"0 0 16 16",fill:"currentColor"},o),e.createElement("path",{fillRule:"evenodd",d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 5zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}));case r.error:return e.createElement("svg",l({viewBox:"0 0 16 16",fill:"currentColor"},o),e.createElement("path",{fillRule:"evenodd",d:"M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353L11.46.146zm-6.106 4.5a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"}))}};$RefreshReg$(y,"NotificationIcon");var R=function(t){var i=t.theme,n=t.dismissNotification,o=i?i.notificationDismissIcon(t.notification):{};return e.createElement("svg",{className:"reapop__notification-dismiss-icon",style:o,onClick:n,viewBox:"4 4 8 8",fill:"currentColor","data-testid":"dismiss-icon"},e.createElement("path",{fillRule:"evenodd",d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}))};$RefreshReg$(R,"NotificationDismissIcon");var S=$RefreshSig$(),N=function(t){S();var n=t.notification,o=t.theme,r=t.position,a=t.button,s=i.useState(!1),c=s[0],f=s[1],u=i.useState(!1),l=u[1],p={isHovered:c,isActive:u[0]},d=o?o.notificationButton(n,r,p):{},m=o?o.notificationButtonText(n,r,p):{};return e.createElement("button",{"data-testid":"button",style:d,className:"reapop__notification-button",onMouseLeave:function(){return f(!1)},onMouseEnter:function(){return f(!0)},onMouseDown:function(){return l(!0)},onMouseUp:function(){return l(!1)},onClick:"function"==typeof a.onClick?function(){return a.onClick()}:x},e.createElement("span",{className:"reapop__notification-button-text",style:m},a.primary?e.createElement("b",null,a.name):a.name))};S(N,"p3sJYXaSRjRHSqFkChzufMjgutM="),$RefreshReg$(N,"NotificationButton");var C=$RefreshSig$(),E=function(t){C();var i=t.notification,n=u(),o=n?n.notificationImageContainer(i):{},r=n?n.notificationImage(i):{};return e.createElement("div",{className:"reapop__notification-image-container",style:o},e.createElement("span",{className:"reapop__notification-image",style:l({},r,{backgroundImage:"url("+i.image+")"})}))};C(E,"VrMvFCCB9Haniz3VCRPNUiCauHs=",!1,(function(){return[u]})),$RefreshReg$(E,"NotificationImage");var z=function(t){var i,n=t.notification,o=t.dismissNotification,r=t.theme,a=t.components,s=n.id,c=n.title,f=n.message,u=n.dismissible,l=n.showDismissButton,p=n.buttons,d=n.allowHTML,m=n.image,g=["reapop__notification","reapop__notification--"+(i=n).status,"reapop__notification--buttons-"+i.buttons.length,i.dismissible?"reapop__notification--dismissible":""],x=r?r.notification(n):{},h=r?r.notificationMeta(n):{},b=r?r.notificationTitle(n):{},v=r?r.notificationMessage(n):{},w=r?r.notificationButtons(n):{},S=a.NotificationIcon||y,C=function(){return o(s)};return e.createElement("div",{"data-testid":"notification",role:"alert",style:x,className:g.join(" "),onClick:u&&!l?C:void 0},e.createElement(S,{theme:r,notification:n}),m&&e.createElement(E,{notification:n}),e.createElement("div",{style:h,className:"reapop__notification-meta"},c&&(d?e.createElement("h4",{style:b,className:"reapop__notification-title",dangerouslySetInnerHTML:{__html:c}}):e.createElement("h4",{style:b,className:"reapop__notification-title"},c)),f&&(d?e.createElement("div",{style:v,className:"reapop__notification-message",dangerouslySetInnerHTML:{__html:f}}):e.createElement("div",{style:v,className:"reapop__notification-message"},f))),u&&l&&e.createElement(R,{notification:n,theme:r,dismissNotification:C}),p.length?e.createElement("div",{onClick:C,className:"reapop__notification-buttons",style:w},p.map((function(t,i){return e.createElement(N,{key:t.name,position:i,button:t,notification:n,theme:r})}))):null)};$RefreshReg$(z,"Notification");var k=$RefreshSig$(),_=["notification","dismissNotification"],T=function(t){k();var n=t.notification,o=t.dismissNotification,r=p(t,_),a=n.dismissAfter,s=n.onAdd,c=n.onDismiss,f=b(),m=u(),g=f.Transition||w,x=f.Notification||z,h=i.useState(null),v=h[0],y=h[1],R=i.useRef(null);return i.useEffect((function(){return s&&s(),function(){c&&c()}}),[]),i.useEffect((function(){if(!v&&a&&a>0){var t=new d(a,(function(){return o(n.id)}));t.resume(),y(t)}else v&&!a&&(v.pause(),y(null))}),[a]),e.createElement(g,l({notification:n,nodeRef:R},r),e.createElement("div",{ref:R,"data-testid":"timed-notification",onMouseEnter:v?function(){return v.pause()}:void 0,onMouseLeave:v?function(){return v.resume()}:void 0},e.createElement(x,{notification:n,theme:m,dismissNotification:function(){return o(n.id)},components:f})))};k(T,"igJYAJRuH7PPENcXe0Ukc0PLuDk=",!1,(function(){return[b,u]})),$RefreshReg$(T,"NotificationContainer");var $=$RefreshSig$(),I=function(t){$();var i=t.position,o=t.dismissNotification,r=t.singleContainer,s=u(),c=s?s.container(i,r):{},f=function(t,i){var e=["reapop__container","reapop__container--"+t];return i&&e.push("reapop__container--single"),e}(i,r),l=t.notifications;return[a.bottomRight,a.bottomCenter,a.bottomLeft].includes(i)&&(l=l.slice().reverse()),e.createElement("div",{style:c,className:f.join(" ")},e.createElement(n.TransitionGroup,{component:null},l.map((function(t){return e.createElement(T,{key:t.id,notification:t,dismissNotification:o})}))))};$(I,"VrMvFCCB9Haniz3VCRPNUiCauHs=",!1,(function(){return[u]})),$RefreshReg$(I,"NotificationsContainer");var L,H=$RefreshSig$(),M=function(t){H();var n=t.smallScreenBreakpoint||768,o=t.theme,r=t.components||{},f=t.notifications,u=t.dismissNotification,l=i.useState("undefined"==typeof window?0:window.innerWidth),p=l[1],d=l[0]<n,m=d?[a.topCenter]:Object.values(a);return i.useEffect((function(){p(window.innerWidth);var t=function(){return p(window.innerWidth)};return window.addEventListener("resize",t),function(){window.removeEventListener("resize",t)}}),[]),e.createElement(s.Provider,{value:r},e.createElement(c.Provider,{value:o},e.createElement("div",null,m.map((function(t){return e.createElement(I,{key:t,position:t,notifications:f.filter((function(i){return d||t===i.position})),dismissNotification:u,singleContainer:d})})))))};H(M,"p6w92m0KSUul1HF13ypxP0W3C0Y="),$RefreshReg$(M,"NotificationsSystem"),function(t){t.UpsertNotification="reapop/upsertNotification",t.DismissNotification="reapop/dismissNotification",t.DismissNotifications="reapop/dismissNotifications"}(L||(L={}));var B=[],A=function(){return function(t,i){switch(void 0===t&&(t=B),i.type){case L.UpsertNotification:var e=m(i.payload);return~t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?e:t})):[].concat(t,[e]);case L.DismissNotification:var n=i.payload;return t.filter((function(t){return t.id!==n}));case L.DismissNotifications:return[];default:return t}}},D=function(t){var i=m(t),e=l({},o.defaultProps,{status:r.none,buttons:[]});return void 0===i.id&&(i.id=o.generateId?o.generateId(t):Math.random().toString(36).slice(2,7)),Object.entries(e).map((function(t){var e=t[0];void 0===i[e]&&(i[e]=t[1])})),"function"==typeof o.customizeNotification&&o.customizeNotification(i),i},O=function(t){return{type:L.DismissNotification,payload:t}},j=function(){return{type:L.DismissNotifications}},P=function(){var t,i=(t=arguments.length-1)<0||arguments.length<=t?void 0:arguments[t],e={};return"string"==typeof(arguments.length<=0?void 0:arguments[0])&&(e.message=arguments.length<=0?void 0:arguments[0]),"string"==typeof(arguments.length<=1?void 0:arguments[1])&&(e.status=arguments.length<=1?void 0:arguments[1]),g(i)&&(e=l({},e,i)),{type:L.UpsertNotification,payload:D(e)}},W=i.createContext(void 0),U=$RefreshSig$(),F=function(t){U();var n=i.useReducer(A(),[]),o=n[1],r={notifications:n[0],notify:i.useCallback((function(){var t=P.apply(void 0,arguments);return o(t),t.payload}),[o]),dismissNotification:i.useCallback((function(t){return o(O(t))}),[o]),dismissNotifications:i.useCallback((function(){return o(j())}),[o])};return e.createElement(W.Provider,{value:r},t.children)};U(F,"C/anGTSwZtycS2550LCiBZPhCik="),$RefreshReg$(F,"NotificationsProvider");var q=["children","nodeRef"],V=function(t){var i=t.duration||300,o=t.children,r=t.nodeRef,a=p(t,q),s=function(){return r.current},c={fill:"forwards",duration:i};return e.createElement(n.Transition,l({nodeRef:r,onEnter:function(){s().animate([{opacity:0},{opacity:1}],c)},onExit:function(){s().animate([{maxHeight:"150px"},{opacity:0,maxHeight:0,margin:0}],c)},timeout:i+100},a),o)};$RefreshReg$(V,"FadeTransition");var X=["children","nodeRef"],G=function(t){var i=t.duration||300,o=t.children,r=t.nodeRef,a=p(t,X),s=function(){return r.current},c={fill:"forwards",duration:i};return e.createElement(n.Transition,l({nodeRef:r,onEnter:function(){s().animate([{transform:"scale(0.6)",opacity:0},{transform:"scale(1)",opacity:1}],c)},onExit:function(){var t=i;s().animate([{transform:"scale(0.6)",opacity:0}],c),s().animate([{maxHeight:"150px"},{margin:0,maxHeight:0}],{fill:"forwards",duration:t,delay:t})},timeout:i+250},a),o)};$RefreshReg$(G,"GrowTransition");var K,Y=$RefreshSig$(),J=function(){return Y(),i.useContext(W)};Y(J,"gDsCjeeItUuvgOWf1v4qoK9RF6k=");var Z,Q,tt,it=((K={})[a.topCenter]={top:"20px",left:"50%",transform:"translateX(-50%)"},K[a.topRight]={top:"20px",right:"20px"},K[a.topLeft]={top:"20px",left:"20px"},K[a.bottomCenter]={bottom:"20px",left:"50%",transform:"translateX(-50%)"},K[a.bottomRight]={bottom:"20px",right:"20px"},K[a.bottomLeft]={bottom:"20px",left:"20px"},K),et={container:function(t){return l({position:"fixed",zIndex:999999},it[t])}},nt=((Z={})[r.none]="#ffffff",Z[r.info]="#4192ff",Z[r.loading]="#4192ff",Z[r.success]="#32d38b",Z[r.warning]="#f5aa0a",Z[r.error]="#E94C58",Z),ot=l({},et,{notification:function(t){return{display:"flex",width:"350px",height:"100%",position:"relative",borderRadius:"5px",border:"1px solid rgba(0,0,0,.1)",boxShadow:"0 3px 8px 2px rgba(0, 0, 0, 0.3)",backgroundColor:"#2f2f36",color:"#ffffff",marginBottom:"20px",cursor:t.dismissible&&!t.showDismissButton?"pointer":"",zIndex:999}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:nt[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#b9c2cb",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",color:"#ffffff",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",color:"#b9c2cb",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,e){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"#2f2f36",border:"none",borderRadius:0,borderLeft:"1px solid #464c5f",outline:"none",textAlign:"center",color:e.isHovered||e.isActive?"#349ef3":"#ffffff",cursor:"pointer",borderTop:1===i?"1px solid #464c5f":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}}),rt=((Q={})[r.none]="#ffffff",Q[r.info]="#349ef3",Q[r.loading]="#349ef3",Q[r.success]="#4dc657",Q[r.warning]="#f5aa0a",Q[r.error]="#f5311d",Q),at=l({},et,{notification:function(t){return{display:"flex",width:"370px",height:"100%",position:"relative",borderRadius:"8px",border:"none",boxShadow:"0 1px 3px -1px rgba(0, 0, 0, 0.3)",zIndex:999,backgroundColor:"#ffffff",color:"#524c4c",borderLeft:"2px solid",marginBottom:"20px",borderLeftColor:rt[t.status],cursor:t.dismissible&&!t.showDismissButton?"pointer":""}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:rt[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#524c4c",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,e){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"none",border:"none",borderRadius:0,borderLeft:"1px solid rgba(0, 0, 0, 0.09)",outline:"none",textAlign:"center",color:e.isHovered?"#349ef3":e.isActive?"#228ee5":"#524c4c",cursor:"pointer",borderTop:1===i?"1px solid rgba(0, 0, 0, 0.09)":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}}),st=((tt={})[r.none]="#ffffff",tt[r.info]="#007bff",tt[r.loading]="#007bff",tt[r.success]="#28a745",tt[r.warning]="#ffc107",tt[r.error]="#dc3545",tt),ct=l({},et,{notification:function(t){return{display:"flex",width:"350px",height:"100%",position:"relative",borderRadius:"4px",border:"1px solid rgba(0,0,0,.1)",boxShadow:"0 0.25rem 0.75rem rgba(0,0,0,.1)",zIndex:999,backgroundColor:"#ffffff",color:"#524c4c",marginBottom:"20px",cursor:t.dismissible&&!t.showDismissButton?"pointer":""}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:st[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#524c4c",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",color:"#6c757d",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",color:"#212529",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,e){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"none",border:"none",borderRadius:0,borderLeft:"1px solid rgba(0,0,0,.1)",outline:"none",textAlign:"center",color:e.isHovered||e.isActive?"#007bff":"#212529",cursor:"pointer",borderTop:1===i?"1px solid rgba(0, 0, 0, 0.09)":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}});exports.FadeTransition=V,exports.GrowTransition=G,exports.NotificationsProvider=F,exports.POSITIONS=a,exports.STATUSES=r,exports.SlideTransition=w,exports.atalhoTheme=ot,exports.baseTheme=et,exports.bootstrapTheme=ct,exports.default=M,exports.dismissNotification=O,exports.dismissNotifications=j,exports.notify=P,exports.reducer=A,exports.setUpNotifications=function(t){for(var i in t)o[i]=t[i]},exports.useNotifications=J,exports.wyboTheme=at;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,i=require("react"),n=(t=i)&&"object"==typeof t&&"default"in t?t.default:t,e=require("react-transition-group"),o={defaultProps:{},customizeNotification:null,generateId:null},r=Object.freeze({none:"none",info:"info",success:"success",loading:"loading",warning:"warning",error:"error"}),a=Object.freeze({topCenter:"top-center",topLeft:"top-left",topRight:"top-right",bottomCenter:"bottom-center",bottomLeft:"bottom-left",bottomRight:"bottom-right"}),c=i.createContext({}),s=i.createContext(void 0),f=function(){return i.useContext(s)};function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}function l(t,i){if(null==t)return{};var n,e,o={},r=Object.keys(t);for(e=0;e<r.length;e++)i.indexOf(n=r[e])>=0||(o[n]=t[n]);return o}var p,d=function(){function t(t,i){this.remainingTime=t,this.callback=i}var i=t.prototype;return i.pause=function(){clearTimeout(this.timerId),this.remainingTime-=(new Date).getTime()-this.start.getTime()},i.resume=function(){this.start=new Date,clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remainingTime)},t}(),m=function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return i.map((function(i){return t(i)}));var n={};for(var e in i)n[e]=t(i[e]);return n},x=function(t){return!!t&&t.constructor===Object},g=function(){},h=["children","notification","nodeRef"],b=function(t){var i=t.duration||300,o=t.children,r=t.notification,c=t.nodeRef,s=l(t,h),f=function(){return c.current},p=[a.topCenter,a.bottomCenter].includes(r.position)?"translateY":"translateX",d=[a.topCenter,a.topLeft,a.bottomLeft].includes(r.position)?"-100%":"100%",m={fill:"forwards",duration:i};return n.createElement(e.Transition,u({nodeRef:c,onEnter:function(){f().animate([{transform:p+"("+d+")",opacity:0},{transform:p+"(0)",opacity:1}],m)},onExit:function(){var t=i;f().animate([{transform:p+"("+d+")",opacity:0}],m),f().animate([{maxHeight:"150px"},{margin:0,maxHeight:0}],u({},m,{duration:250,delay:t}))},timeout:i+250},s),o)},v=function(t){var i=t.theme,e=t.notification.status,o={style:i?i.notificationIcon(t.notification):{},className:"reapop__notification-icon"};switch(e){case r.none:return null;case r.info:return n.createElement("svg",u({viewBox:"0 0 16 16",fill:"currentColor"},o),n.createElement("path",{fillRule:"evenodd",d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM8 5.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"}));case r.loading:return n.createElement("svg",u({viewBox:"5 5 40 40",fill:"currentColor"},o),n.createElement("path",{d:"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"},n.createElement("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"0.5s",repeatCount:"indefinite"})));case r.success:return n.createElement("svg",u({viewBox:"0 0 16 16",fill:"currentColor"},o),n.createElement("path",{fillRule:"evenodd",d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}));case r.warning:return n.createElement("svg",u({viewBox:"0 0 16 16",fill:"currentColor"},o),n.createElement("path",{fillRule:"evenodd",d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 5zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}));case r.error:return n.createElement("svg",u({viewBox:"0 0 16 16",fill:"currentColor"},o),n.createElement("path",{fillRule:"evenodd",d:"M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353L11.46.146zm-6.106 4.5a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"}))}},w=function(t){var i=t.theme,e=t.dismissNotification,o=i?i.notificationDismissIcon(t.notification):{};return n.createElement("svg",{className:"reapop__notification-dismiss-icon",style:o,onClick:e,viewBox:"4 4 8 8",fill:"currentColor","data-testid":"dismiss-icon"},n.createElement("path",{fillRule:"evenodd",d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}))},y=function(t){var e=t.notification,o=t.theme,r=t.position,a=t.button,c=i.useState(!1),s=c[0],f=c[1],u=i.useState(!1),l=u[1],p={isHovered:s,isActive:u[0]},d=o?o.notificationButton(e,r,p):{},m=o?o.notificationButtonText(e,r,p):{};return n.createElement("button",{"data-testid":"button",style:d,className:"reapop__notification-button",onMouseLeave:function(){return f(!1)},onMouseEnter:function(){return f(!0)},onMouseDown:function(){return l(!0)},onMouseUp:function(){return l(!1)},onClick:"function"==typeof a.onClick?function(){return a.onClick()}:g},n.createElement("span",{className:"reapop__notification-button-text",style:m},a.primary?n.createElement("b",null,a.name):a.name))},E=function(t){var i=t.notification,e=f(),o=e?e.notificationImageContainer(i):{},r=e?e.notificationImage(i):{};return n.createElement("div",{className:"reapop__notification-image-container",style:o},n.createElement("span",{className:"reapop__notification-image",style:u({},r,{backgroundImage:"url("+i.image+")"})}))},S=function(t){var i,e=t.notification,o=t.dismissNotification,r=t.theme,a=t.components,c=e.id,s=e.title,f=e.message,u=e.dismissible,l=e.showDismissButton,p=e.buttons,d=e.allowHTML,m=e.image,x=["reapop__notification","reapop__notification--"+(i=e).status,"reapop__notification--buttons-"+i.buttons.length,i.dismissible?"reapop__notification--dismissible":""],g=r?r.notification(e):{},h=r?r.notificationMeta(e):{},b=r?r.notificationTitle(e):{},S=r?r.notificationMessage(e):{},N=r?r.notificationButtons(e):{},z=a.NotificationIcon||v,_=function(){return o(c)};return n.createElement("div",{"data-testid":"notification",role:"alert",style:g,className:x.join(" "),onClick:u&&!l?_:void 0},n.createElement(z,{theme:r,notification:e}),m&&n.createElement(E,{notification:e}),n.createElement("div",{style:h,className:"reapop__notification-meta"},s&&(d?n.createElement("h4",{style:b,className:"reapop__notification-title",dangerouslySetInnerHTML:{__html:s}}):n.createElement("h4",{style:b,className:"reapop__notification-title"},s)),f&&(d?n.createElement("div",{style:S,className:"reapop__notification-message",dangerouslySetInnerHTML:{__html:f}}):n.createElement("div",{style:S,className:"reapop__notification-message"},f))),u&&l&&n.createElement(w,{notification:e,theme:r,dismissNotification:_}),p.length?n.createElement("div",{onClick:_,className:"reapop__notification-buttons",style:N},p.map((function(t,i){return n.createElement(y,{key:t.name,position:i,button:t,notification:e,theme:r})}))):null)},N=["notification","dismissNotification"],z=function(t){var e=t.notification,o=t.dismissNotification,r=l(t,N),a=e.dismissAfter,s=e.onAdd,p=e.onDismiss,m=i.useContext(c),x=f(),g=m.Transition||b,h=m.Notification||S,v=i.useState(null),w=v[0],y=v[1],E=i.useRef(null);return i.useEffect((function(){return s&&s(),function(){p&&p()}}),[]),i.useEffect((function(){if(!w&&a&&a>0){var t=new d(a,(function(){return o(e.id)}));t.resume(),y(t)}else w&&!a&&(w.pause(),y(null))}),[a]),n.createElement(g,u({notification:e,nodeRef:E},r),n.createElement("div",{ref:E,"data-testid":"timed-notification",onMouseEnter:w?function(){return w.pause()}:void 0,onMouseLeave:w?function(){return w.resume()}:void 0},n.createElement(h,{notification:e,theme:x,dismissNotification:function(){return o(e.id)},components:m})))},_=function(t){var i=t.position,o=t.dismissNotification,r=t.singleContainer,c=f(),s=c?c.container(i,r):{},u=function(t,i){var n=["reapop__container","reapop__container--"+t];return i&&n.push("reapop__container--single"),n}(i,r),l=t.notifications;return[a.bottomRight,a.bottomCenter,a.bottomLeft].includes(i)&&(l=l.slice().reverse()),n.createElement("div",{style:s,className:u.join(" ")},n.createElement(e.TransitionGroup,{component:null},l.map((function(t){return n.createElement(z,{key:t.id,notification:t,dismissNotification:o})}))))};!function(t){t.UpsertNotification="reapop/upsertNotification",t.DismissNotification="reapop/dismissNotification",t.DismissNotifications="reapop/dismissNotifications"}(p||(p={}));var C,T,k,L,I=[],R=function(){return function(t,i){switch(void 0===t&&(t=I),i.type){case p.UpsertNotification:var n=m(i.payload);return~t.findIndex((function(t){return t.id===n.id}))?t.map((function(t){return t.id===n.id?n:t})):[].concat(t,[n]);case p.DismissNotification:var e=i.payload;return t.filter((function(t){return t.id!==e}));case p.DismissNotifications:return[];default:return t}}},H=function(t){var i=m(t),n=u({},o.defaultProps,{status:r.none,buttons:[]});return void 0===i.id&&(i.id=o.generateId?o.generateId(t):Math.random().toString(36).slice(2,7)),Object.entries(n).map((function(t){var n=t[0];void 0===i[n]&&(i[n]=t[1])})),"function"==typeof o.customizeNotification&&o.customizeNotification(i),i},M=function(t){return{type:p.DismissNotification,payload:t}},B=function(){return{type:p.DismissNotifications}},A=function(){var t,i=(t=arguments.length-1)<0||arguments.length<=t?void 0:arguments[t],n={};return"string"==typeof(arguments.length<=0?void 0:arguments[0])&&(n.message=arguments.length<=0?void 0:arguments[0]),"string"==typeof(arguments.length<=1?void 0:arguments[1])&&(n.status=arguments.length<=1?void 0:arguments[1]),x(i)&&(n=u({},n,i)),{type:p.UpsertNotification,payload:H(n)}},D=i.createContext(void 0),O=["children","nodeRef"],j=["children","nodeRef"],W=((C={})[a.topCenter]={top:"20px",left:"50%",transform:"translateX(-50%)"},C[a.topRight]={top:"20px",right:"20px"},C[a.topLeft]={top:"20px",left:"20px"},C[a.bottomCenter]={bottom:"20px",left:"50%",transform:"translateX(-50%)"},C[a.bottomRight]={bottom:"20px",right:"20px"},C[a.bottomLeft]={bottom:"20px",left:"20px"},C),P={container:function(t){return u({position:"fixed",zIndex:999999},W[t])}},U=((T={})[r.none]="#ffffff",T[r.info]="#4192ff",T[r.loading]="#4192ff",T[r.success]="#32d38b",T[r.warning]="#f5aa0a",T[r.error]="#E94C58",T),X=u({},P,{notification:function(t){return{display:"flex",width:"350px",height:"100%",position:"relative",borderRadius:"5px",border:"1px solid rgba(0,0,0,.1)",boxShadow:"0 3px 8px 2px rgba(0, 0, 0, 0.3)",backgroundColor:"#2f2f36",color:"#ffffff",marginBottom:"20px",cursor:t.dismissible&&!t.showDismissButton?"pointer":"",zIndex:999}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:U[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#b9c2cb",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",color:"#ffffff",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",color:"#b9c2cb",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,n){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"#2f2f36",border:"none",borderRadius:0,borderLeft:"1px solid #464c5f",outline:"none",textAlign:"center",color:n.isHovered||n.isActive?"#349ef3":"#ffffff",cursor:"pointer",borderTop:1===i?"1px solid #464c5f":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}}),q=((k={})[r.none]="#ffffff",k[r.info]="#349ef3",k[r.loading]="#349ef3",k[r.success]="#4dc657",k[r.warning]="#f5aa0a",k[r.error]="#f5311d",k),G=u({},P,{notification:function(t){return{display:"flex",width:"370px",height:"100%",position:"relative",borderRadius:"8px",border:"none",boxShadow:"0 1px 3px -1px rgba(0, 0, 0, 0.3)",zIndex:999,backgroundColor:"#ffffff",color:"#524c4c",borderLeft:"2px solid",marginBottom:"20px",borderLeftColor:q[t.status],cursor:t.dismissible&&!t.showDismissButton?"pointer":""}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:q[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#524c4c",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,n){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"none",border:"none",borderRadius:0,borderLeft:"1px solid rgba(0, 0, 0, 0.09)",outline:"none",textAlign:"center",color:n.isHovered?"#349ef3":n.isActive?"#228ee5":"#524c4c",cursor:"pointer",borderTop:1===i?"1px solid rgba(0, 0, 0, 0.09)":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}}),F=((L={})[r.none]="#ffffff",L[r.info]="#007bff",L[r.loading]="#007bff",L[r.success]="#28a745",L[r.warning]="#ffc107",L[r.error]="#dc3545",L),V=u({},P,{notification:function(t){return{display:"flex",width:"350px",height:"100%",position:"relative",borderRadius:"4px",border:"1px solid rgba(0,0,0,.1)",boxShadow:"0 0.25rem 0.75rem rgba(0,0,0,.1)",zIndex:999,backgroundColor:"#ffffff",color:"#524c4c",marginBottom:"20px",cursor:t.dismissible&&!t.showDismissButton?"pointer":""}},notificationIcon:function(t){return{display:t.image?"none":"flex",width:"20px",height:"20px",boxSizing:"border-box",margin:"10px 0 10px 15px",alignSelf:"flex-start",flexShrink:0,color:F[t.status]}},notificationDismissIcon:function(){return{width:"12px",height:"12px",margin:"14px 10px",cursor:"pointer",color:"#524c4c",flexShrink:0}},notificationMeta:function(){return{verticalAlign:"top",boxSizing:"border-box",width:"100%",padding:"10px 20px"}},notificationTitle:function(t){return{margin:t.message?"0 0 10px":0,fontSize:"14px",color:"#6c757d",fontWeight:700,lineHeight:1.428571429}},notificationMessage:function(){return{margin:0,fontSize:"14px",color:"#212529",lineHeight:1.428571429}},notificationImageContainer:function(){return{boxSizing:"border-box",padding:"10px 0 10px 15px"}},notificationImage:function(){return{display:"inline-flex",borderRadius:"40px",width:"40px",height:"40px",backgroundSize:"cover"}},notificationButtons:function(){return{}},notificationButton:function(t,i,n){return{display:"block",width:"100%",height:100/t.buttons.length+"%",minHeight:"40px",boxSizing:"border-box",padding:0,background:"none",border:"none",borderRadius:0,borderLeft:"1px solid rgba(0,0,0,.1)",outline:"none",textAlign:"center",color:n.isHovered||n.isActive?"#007bff":"#212529",cursor:"pointer",borderTop:1===i?"1px solid rgba(0, 0, 0, 0.09)":"none"}},notificationButtonText:function(){return{display:"block",height:"25px",padding:"0 15px",minWidth:"90px",maxWidth:"150px",width:"auto",whiteSpace:"nowrap",overflow:"hidden",margin:"0 auto",textOverflow:"ellipsis",textAlign:"center",fontSize:"14px",lineHeight:"25px"}}});exports.FadeTransition=function(t){var i=t.duration||300,o=t.children,r=t.nodeRef,a=l(t,O),c=function(){return r.current},s={fill:"forwards",duration:i};return n.createElement(e.Transition,u({nodeRef:r,onEnter:function(){c().animate([{opacity:0},{opacity:1}],s)},onExit:function(){c().animate([{maxHeight:"150px"},{opacity:0,maxHeight:0,margin:0}],s)},timeout:i+100},a),o)},exports.GrowTransition=function(t){var i=t.duration||300,o=t.children,r=t.nodeRef,a=l(t,j),c=function(){return r.current},s={fill:"forwards",duration:i};return n.createElement(e.Transition,u({nodeRef:r,onEnter:function(){c().animate([{transform:"scale(0.6)",opacity:0},{transform:"scale(1)",opacity:1}],s)},onExit:function(){var t=i;c().animate([{transform:"scale(0.6)",opacity:0}],s),c().animate([{maxHeight:"150px"},{margin:0,maxHeight:0}],{fill:"forwards",duration:t,delay:t})},timeout:i+250},a),o)},exports.NotificationsProvider=function(t){var e=i.useReducer(R(),[]),o=e[1],r={notifications:e[0],notify:i.useCallback((function(){var t=A.apply(void 0,arguments);return o(t),t.payload}),[o]),dismissNotification:i.useCallback((function(t){return o(M(t))}),[o]),dismissNotifications:i.useCallback((function(){return o(B())}),[o])};return n.createElement(D.Provider,{value:r},t.children)},exports.POSITIONS=a,exports.STATUSES=r,exports.SlideTransition=b,exports.atalhoTheme=X,exports.baseTheme=P,exports.bootstrapTheme=V,exports.default=function(t){var e=t.smallScreenBreakpoint||768,o=t.theme,r=t.components||{},f=t.notifications,u=t.dismissNotification,l=i.useState("undefined"==typeof window?0:window.innerWidth),p=l[1],d=l[0]<e,m=d?[a.topCenter]:Object.values(a);return i.useEffect((function(){p(window.innerWidth);var t=function(){return p(window.innerWidth)};return window.addEventListener("resize",t),function(){window.removeEventListener("resize",t)}}),[]),n.createElement(c.Provider,{value:r},n.createElement(s.Provider,{value:o},n.createElement("div",null,m.map((function(t){return n.createElement(_,{key:t,position:t,notifications:f.filter((function(i){return d||t===i.position})),dismissNotification:u,singleContainer:d})})))))},exports.dismissNotification=M,exports.dismissNotifications=B,exports.notify=A,exports.reducer=R,exports.setUpNotifications=function(t){for(var i in t)o[i]=t[i]},exports.useNotifications=function(){return i.useContext(D)},exports.wyboTheme=G;
//# sourceMappingURL=reapop.cjs.production.min.js.map

@@ -55,11 +55,6 @@ import React, { createContext, useContext, useState, useRef, useEffect, useReducer, useCallback } from 'react';

var _s = /*#__PURE__*/$RefreshSig$();
var useTheme = function useTheme() {
_s();
return useContext(ThemeContext);
};
_s(useTheme, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
function _extends() {

@@ -143,11 +138,6 @@ _extends = Object.assign ? Object.assign.bind() : function (target) {

var _s$1 = /*#__PURE__*/$RefreshSig$();
var useComponentsContext = function useComponentsContext() {
_s$1();
return useContext(ComponentsContext);
};
_s$1(useComponentsContext, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
var _excluded = ["children", "notification", "nodeRef"];

@@ -214,8 +204,2 @@

_c = SlideTransition;
var _c;
$RefreshReg$(_c, "SlideTransition");
var NotificationIcon = function NotificationIcon(props) {

@@ -288,8 +272,2 @@ var theme = props.theme;

_c$1 = NotificationIcon;
var _c$1;
$RefreshReg$(_c$1, "NotificationIcon");
var NotificationDismissIcon = function NotificationDismissIcon(props) {

@@ -313,12 +291,3 @@ var theme = props.theme,

_c$2 = NotificationDismissIcon;
var _c$2;
$RefreshReg$(_c$2, "NotificationDismissIcon");
var _s$2 = /*#__PURE__*/$RefreshSig$();
var NotificationButton = function NotificationButton(props) {
_s$2();
var notification = props.notification,

@@ -368,15 +337,3 @@ theme = props.theme,

_s$2(NotificationButton, "p3sJYXaSRjRHSqFkChzufMjgutM=");
_c$3 = NotificationButton;
var _c$3;
$RefreshReg$(_c$3, "NotificationButton");
var _s$3 = /*#__PURE__*/$RefreshSig$();
var NotificationImage = function NotificationImage(props) {
_s$3();
var notification = props.notification;

@@ -397,12 +354,2 @@ var theme = useTheme();

_s$3(NotificationImage, "VrMvFCCB9Haniz3VCRPNUiCauHs=", false, function () {
return [useTheme];
});
_c$4 = NotificationImage;
var _c$4;
$RefreshReg$(_c$4, "NotificationImage");
var Notification = function Notification(props) {

@@ -484,15 +431,5 @@ var notification = props.notification,

_c$5 = Notification;
var _c$5;
$RefreshReg$(_c$5, "Notification");
var _s$4 = /*#__PURE__*/$RefreshSig$();
var _excluded$1 = ["notification", "dismissNotification"];
var NotificationContainer = function NotificationContainer(props) {
_s$4();
var notification = props.notification,

@@ -562,17 +499,3 @@ _dismissNotification = props.dismissNotification,

_s$4(NotificationContainer, "igJYAJRuH7PPENcXe0Ukc0PLuDk=", false, function () {
return [useComponentsContext, useTheme];
});
_c$6 = NotificationContainer;
var _c$6;
$RefreshReg$(_c$6, "NotificationContainer");
var _s$5 = /*#__PURE__*/$RefreshSig$();
var NotificationsContainer = function NotificationsContainer(props) {
_s$5();
var position = props.position,

@@ -605,17 +528,3 @@ dismissNotification = props.dismissNotification,

_s$5(NotificationsContainer, "VrMvFCCB9Haniz3VCRPNUiCauHs=", false, function () {
return [useTheme];
});
_c$7 = NotificationsContainer;
var _c$7;
$RefreshReg$(_c$7, "NotificationsContainer");
var _s$6 = /*#__PURE__*/$RefreshSig$();
var NotificationsSystem = function NotificationsSystem(props) {
_s$6();
var smallScreenBreakpoint = props.smallScreenBreakpoint || 768;

@@ -664,10 +573,2 @@ var theme = props.theme;

_s$6(NotificationsSystem, "p6w92m0KSUul1HF13ypxP0W3C0Y=");
_c$8 = NotificationsSystem;
var _c$8;
$RefreshReg$(_c$8, "NotificationsSystem");
var NotificationAction;

@@ -798,6 +699,3 @@

var _s$7 = /*#__PURE__*/$RefreshSig$();
var NotificationsProvider = function NotificationsProvider(props) {
_s$7();
var _useReducer = useReducer(notificationsReducer(), []),

@@ -826,10 +724,2 @@ notifications = _useReducer[0],

_s$7(NotificationsProvider, "C/anGTSwZtycS2550LCiBZPhCik=");
_c$9 = NotificationsProvider;
var _c$9;
$RefreshReg$(_c$9, "NotificationsProvider");
var _excluded$2 = ["children", "nodeRef"];

@@ -880,8 +770,2 @@

_c$a = FadeTransition;
var _c$a;
$RefreshReg$(_c$a, "FadeTransition");
var _excluded$3 = ["children", "nodeRef"];

@@ -946,17 +830,6 @@

_c$b = GrowTransition;
var _c$b;
$RefreshReg$(_c$b, "GrowTransition");
var _s$8 = /*#__PURE__*/$RefreshSig$();
var useNotifications = function useNotifications() {
_s$8();
return useContext(ReapopNotificationsContext);
};
_s$8(useNotifications, "gDsCjeeItUuvgOWf1v4qoK9RF6k=");
var _containerPerPosition;

@@ -963,0 +836,0 @@ var containerPerPositionStyles = (_containerPerPosition = {}, _containerPerPosition[POSITIONS.topCenter] = {

{
"name": "reapop",
"version": "4.1.0",
"version": "4.2.0",
"description": "A simple & customizable notifications system for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc