Socket
Socket
Sign inDemoInstall

@mantine/notifications

Package Overview
Dependencies
Maintainers
1
Versions
363
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mantine/notifications - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

dist/src/mantine-core/src/Drawer/Drawer.d.ts

2

dist/lib.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@mantine/theme"),require("clsx"),require("@mantine/hooks"),require("react-jss"),require("react-transition-group"),require("@modulz/radix-icons"),require("@mantine/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["react","@mantine/theme","clsx","@mantine/hooks","react-jss","react-transition-group","@modulz/radix-icons","@mantine/core","nanoid"],e):"object"==typeof exports?exports["@mantine/notifications"]=e(require("react"),require("@mantine/theme"),require("clsx"),require("@mantine/hooks"),require("react-jss"),require("react-transition-group"),require("@modulz/radix-icons"),require("@mantine/core"),require("nanoid")):t["@mantine/notifications"]=e(t.react,t["@mantine/theme"],t.clsx,t["@mantine/hooks"],t["react-jss"],t["react-transition-group"],t["@modulz/radix-icons"],t["@mantine/core"],t.nanoid)}(this,(function(t,e,i,n,o,r,a,c,u){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([function(e,i){e.exports=t},function(t,i){t.exports=e},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationsContext=void 0;var n=i(0);e.NotificationsContext=n.createContext(null),e.NotificationsContext.displayName="@mantine/notifications/NotificationsContext"},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Notification=void 0;var a=r(i(0)),c=r(i(3)),u=i(14),s=i(1),l=i(15),f=r(i(16));function d(t){var e,i=t.className,r=t.color,d=void 0===r?"blue":r,p=t.loading,m=void 0!==p&&p,h=t.disallowClose,v=void 0!==h&&h,b=t.title,y=t.icon,g=t.children,O=t.onClose,x=t.closeButtonProps,_=t.themeOverride,N=o(t,["className","color","loading","disallowClose","title","icon","children","onClose","closeButtonProps","themeOverride"]),j=f.default({color:d,theme:s.useMantineTheme(_)});return a.default.createElement(l.Paper,n({shadow:"sm",padding:"sm",className:c.default(j.notification,(e={},e[j.withIcon]=y||m,e),i),role:"alert"},N),y&&!m&&a.default.createElement("div",{className:j.icon},y),m&&a.default.createElement(l.Loader,{size:28,color:d,className:j.loader}),a.default.createElement("div",{className:j.body},b&&a.default.createElement(l.Text,{className:j.title,size:"sm",weight:500,themeOverride:_},b),a.default.createElement(l.Text,{className:j.description,size:"sm",themeOverride:_},g)),!v&&a.default.createElement(l.ActionIcon,n({},x,{color:"gray",onClick:O,themeOverride:_}),a.default.createElement(u.Cross2Icon,null)))}e.Notification=d,d.displayName="@mantine/notifications/Notification"},function(t,e){t.exports=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Notification=e.NotificationsProvider=e.useNotifications=void 0;var n=i(8);Object.defineProperty(e,"useNotifications",{enumerable:!0,get:function(){return n.useNotifications}});var o=i(9);Object.defineProperty(e,"NotificationsProvider",{enumerable:!0,get:function(){return o.NotificationsProvider}});var r=i(5);Object.defineProperty(e,"Notification",{enumerable:!0,get:function(){return r.Notification}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNotifications=void 0;var n=i(0),o=i(2);e.useNotifications=function(){var t=n.useContext(o.NotificationsContext);if(!t)throw new Error("@mantine/notifications: NotificationsProvider was not found in tree");return t}},function(t,e,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationsProvider=void 0;var a=r(i(0)),c=r(i(3)),u=i(10),s=i(1),l=i(4),f=i(2),d=r(i(11)),p=r(i(12)),m=r(i(13)),h=r(i(18)),v=r(i(19)),b=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"];function y(t){var e=t.className,i=t.position,r=void 0===i?"bottom-right":i,y=t.themeOverride,g=t.autoClose,O=void 0===g?4e3:g,x=t.duration,_=void 0===x?250:x,N=t.containerWidth,j=void 0===N?440:N,P=t.notificationMaxHeight,w=void 0===P?200:P,C=t.limit,M=void 0===C?5:C,E=t.style,q=t.children,T=o(t,["className","position","themeOverride","autoClose","duration","containerWidth","notificationMaxHeight","limit","style","children"]),S=v.default({limit:M}),z=S.notifications,H=S.showNotification,I=S.updateNotification,k=S.hideNotification,R=l.useReducedMotion()?1:_,D=s.useMantineTheme(y),B=h.default({theme:D}),L=(b.includes(r)?r:"bottom-right").split("-"),W=z.map((function(t){return a.default.createElement(u.Transition,{key:t.id,timeout:R,unmountOnExit:!0,mountOnEnter:!0,onEnter:function(t){return t.offsetHeight}},(function(e){return a.default.createElement(m.default,{notification:t,onHide:k,className:B.notification,autoClose:O,style:n({},p.default({state:e,positioning:L,transitionDuration:R,maxHeight:w}))})}))}));return a.default.createElement(f.NotificationsContext.Provider,{value:{notifications:z,showNotification:H,hideNotification:k,updateNotification:I}},a.default.createElement("div",n({className:c.default(B.notifications,e),style:n(n({maxWidth:j},d.default(L,j,D.spacing.md)),E)},T),a.default.createElement(u.TransitionGroup,null,W)),q)}e.NotificationsProvider=y,y.displayName="@mantine/notifications/NotificationsProvider"},function(t,e){t.exports=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i){var n=t[0],o=t[1],r={};return"top"===n&&(r.top=i),"bottom"===n&&(r.bottom=i),"left"===o&&(r.left=i),"right"===o&&(r.right=i),"center"===o&&(r.left="calc(50% - "+e/2+"px)"),r}},function(t,e,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},r={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};e.default=function(t){var e=t.state,i=t.maxHeight,a=t.positioning,c=t.transitionDuration,u=a[0],s=a[1],l="center"===s?u+"-center":s,f={opacity:1,transform:r[l]},d={opacity:0,maxHeight:0,transform:o[l]},p={entering:f,entered:f,exiting:d,exited:d};return n(n({},{opacity:0,maxHeight:i,transform:o[l],transitionDuration:c+"ms, "+c+"ms, "+c+"ms",transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"}),p[e])}},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(e,t,i);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=r(i(0)),u=i(5),s=a(i(17));function l(t){var e=t.className,i=t.style,n=t.themeOverride,o=t.notification,r=t.autoClose,a=t.onHide,l=s.default(r,o),f=c.useRef(),d=function(){"function"==typeof o.onClose&&o.onClose(o),a(o.id),window.clearTimeout(f.current)},p=function(){clearTimeout(f.current)},m=function(){"number"==typeof l&&(f.current=window.setTimeout(d,l))};return c.useEffect((function(){"function"==typeof o.onOpen&&o.onOpen(o)}),[]),c.useEffect((function(){return m(),p}),[r,o.autoClose]),c.default.createElement(u.Notification,{style:i,className:e,title:o.title,themeOverride:n,onClose:d,color:o.color,icon:o.icon,loading:o.loading,disallowClose:o.disallowClose,onMouseEnter:p,onMouseLeave:m},o.message)}e.default=l,l.displayName="@mantine/notifications/NotificationContainer"},function(t,e){t.exports=a},function(t,e){t.exports=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6),o=i(1);e.default=n.createUseStyles({withIcon:{paddingLeft:"10px !important","&::before":{display:"none !important"}},notification:function(t){var e=t.color,i=t.theme;return{boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:22,paddingRight:5,paddingTop:10,paddingBottom:10,borderRadius:4,"&::before":{content:"''",display:"block",position:"absolute",width:6,top:4,bottom:4,left:4,borderRadius:4,backgroundColor:o.getThemeColor({theme:i,color:e,shade:5})},"& $icon":{backgroundColor:o.getThemeColor({theme:i,color:e,shade:5}),color:i.white}}},body:{flex:1,maxWidth:"calc(100% - 40px)",marginRight:10},loader:function(t){return{marginRight:t.theme.spacing.md}},icon:function(t){var e=t.theme;return{boxSizing:"border-box",marginRight:e.spacing.md,width:28,height:28,borderRadius:28,display:"flex",alignItems:"center",justifyContent:"center",color:e.white}},title:{lineHeight:1.4,marginBottom:2,overflow:"hidden",textOverflow:"ellipsis"},description:function(t){var e=t.theme;return{color:e.colors.gray[6],lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis","&:only-child":{color:e.colors.gray[9]}}}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return"number"==typeof e.autoClose?e.autoClose:!1!==e.autoClose&&!1!==t&&t}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6);e.default=n.createUseStyles({notifications:function(t){return{width:"calc(100% - "+2*t.theme.spacing.md+"px)",boxSizing:"border-box",position:"fixed",zIndex:1e3}},notification:function(t){return{"& + &":{marginTop:t.theme.spacing.sm}}}})},function(t,e,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],a=0,c=r.length;a<c;a++,o++)n[o]=r[a];return n};Object.defineProperty(e,"__esModule",{value:!0});var r=i(20),a=i(4);e.default=function(t){var e=t.limit,i=a.useQueue({initialValues:[],limit:e}),c=i.state,u=i.update;return{notifications:c,showNotification:function(t){return u((function(e){return t.id&&e.some((function(e){return e.id===t.id}))?e:o(e,[n(n({},t),{id:t.id||r.nanoid()})])}))},updateNotification:function(t,e){return u((function(i){var n=i.findIndex((function(e){return e.id===t}));if(-1===n)return i;var r=o(i);return r[n]=e,r}))},hideNotification:function(t){return u((function(e){return e.filter((function(e){return e.id!==t}))}))}}}},function(t,e){t.exports=u}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@mantine/hooks"),require("clsx"),require("react-transition-group"),require("@mantine/theme"),require("@mantine/core"),require("react-jss"),require("nanoid")):"function"==typeof define&&define.amd?define(["react","@mantine/hooks","clsx","react-transition-group","@mantine/theme","@mantine/core","react-jss","nanoid"],e):"object"==typeof exports?exports["@mantine/notifications"]=e(require("react"),require("@mantine/hooks"),require("clsx"),require("react-transition-group"),require("@mantine/theme"),require("@mantine/core"),require("react-jss"),require("nanoid")):t["@mantine/notifications"]=e(t.react,t["@mantine/hooks"],t.clsx,t["react-transition-group"],t["@mantine/theme"],t["@mantine/core"],t["react-jss"],t.nanoid)}(this,(function(t,e,n,i,o,r,a,u){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationsContext=void 0;var i=n(0);e.NotificationsContext=i.createContext(null),e.NotificationsContext.displayName="@mantine/notifications/NotificationsContext"},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationsProvider=e.useNotifications=void 0;var i=n(4);Object.defineProperty(e,"useNotifications",{enumerable:!0,get:function(){return i.useNotifications}});var o=n(5);Object.defineProperty(e,"NotificationsProvider",{enumerable:!0,get:function(){return o.NotificationsProvider}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNotifications=void 0;var i=n(0),o=n(1);e.useNotifications=function(){var t=i.useContext(o.NotificationsContext);if(!t)throw new Error("@mantine/notifications: NotificationsProvider was not found in tree");return t}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationsProvider=void 0;var a=r(n(0)),u=r(n(6)),c=n(7),s=n(8),f=n(2),l=n(1),d=r(n(9)),p=r(n(10)),m=r(n(11)),h=r(n(14)),v=r(n(16)),y=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"];function b(t){var e=t.className,n=t.position,r=void 0===n?"bottom-right":n,b=t.themeOverride,g=t.autoClose,_=void 0===g?4e3:g,O=t.duration,x=void 0===O?250:O,j=t.containerWidth,N=void 0===j?440:j,P=t.notificationMaxHeight,M=void 0===P?200:P,C=t.limit,w=void 0===C?5:C,q=t.style,E=t.children,S=o(t,["className","position","themeOverride","autoClose","duration","containerWidth","notificationMaxHeight","limit","style","children"]),T=v.default({limit:w}),H=T.notifications,D=T.showNotification,k=T.updateNotification,z=T.hideNotification,X=f.useReducedMotion()?1:x,Y=s.useMantineTheme(b),I=h.default({theme:Y}),W=(y.includes(r)?r:"bottom-right").split("-"),A=H.map((function(t){return a.default.createElement(c.Transition,{key:t.id,timeout:X,unmountOnExit:!0,mountOnEnter:!0,onEnter:function(t){return t.offsetHeight}},(function(e){return a.default.createElement(m.default,{notification:t,onHide:z,className:I.notification,autoClose:_,style:i({},p.default({state:e,positioning:W,transitionDuration:X,maxHeight:M}))})}))}));return a.default.createElement(l.NotificationsContext.Provider,{value:{notifications:H,showNotification:D,hideNotification:z,updateNotification:k}},a.default.createElement("div",i({className:u.default(I.notifications,e),style:i(i({maxWidth:N},d.default(W,N,Y.spacing.md)),q)},S),a.default.createElement(c.TransitionGroup,null,A)),E)}e.NotificationsProvider=b,b.displayName="@mantine/notifications/NotificationsProvider"},function(t,e){t.exports=n},function(t,e){t.exports=i},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){var i=t[0],o=t[1],r={};return"top"===i&&(r.top=n),"bottom"===i&&(r.bottom=n),"left"===o&&(r.left=n),"right"===o&&(r.right=n),"center"===o&&(r.left="calc(50% - "+e/2+"px)"),r}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},r={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};e.default=function(t){var e=t.state,n=t.maxHeight,a=t.positioning,u=t.transitionDuration,c=a[0],s=a[1],f="center"===s?c+"-center":s,l={opacity:1,transform:r[f]},d={opacity:0,maxHeight:0,transform:o[f]},p={entering:l,entered:l,exiting:d,exited:d};return i(i({},{opacity:0,maxHeight:n,transform:o[f],transitionDuration:u+"ms, "+u+"ms, "+u+"ms",transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"}),p[e])}},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=r(n(0)),c=n(12),s=a(n(13));function f(t){var e=t.className,n=t.style,i=t.themeOverride,o=t.notification,r=t.autoClose,a=t.onHide,f=s.default(r,o),l=u.useRef(),d=function(){"function"==typeof o.onClose&&o.onClose(o),a(o.id),window.clearTimeout(l.current)},p=function(){clearTimeout(l.current)},m=function(){"number"==typeof f&&(l.current=window.setTimeout(d,f))};return u.useEffect((function(){"function"==typeof o.onOpen&&o.onOpen(o)}),[]),u.useEffect((function(){return m(),p}),[r,o.autoClose]),u.default.createElement(c.Notification,{style:n,className:e,title:o.title,themeOverride:i,onClose:d,color:o.color,icon:o.icon,loading:o.loading,disallowClose:o.disallowClose,onMouseEnter:p,onMouseLeave:m},o.message)}e.default=f,f.displayName="@mantine/notifications/NotificationContainer"},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return"number"==typeof e.autoClose?e.autoClose:!1!==e.autoClose&&!1!==t&&t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(15);e.default=i.createUseStyles({notifications:function(t){return{width:"calc(100% - "+2*t.theme.spacing.md+"px)",boxSizing:"border-box",position:"fixed",zIndex:1e3}},notification:function(t){return{"& + &":{marginTop:t.theme.spacing.sm}}}})},function(t,e){t.exports=a},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),o=0;for(e=0;e<n;e++)for(var r=arguments[e],a=0,u=r.length;a<u;a++,o++)i[o]=r[a];return i};Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),a=n(2);e.default=function(t){var e=t.limit,n=a.useQueue({initialValues:[],limit:e}),u=n.state,c=n.update;return{notifications:u,showNotification:function(t){return c((function(e){return t.id&&e.some((function(e){return e.id===t.id}))?e:o(e,[i(i({},t),{id:t.id||r.nanoid()})])}))},updateNotification:function(t,e){return c((function(n){var i=n.findIndex((function(e){return e.id===t}));if(-1===i)return n;var r=o(n);return r[i]=e,r}))},hideNotification:function(t){return c((function(e){return e.filter((function(e){return e.id!==t}))}))}}}},function(t,e){t.exports=u}])}));
//# sourceMappingURL=lib.js.map

@@ -15,2 +15,4 @@ import React from 'react';

size?: MantineNumberSize;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLButtonElement>;
}

@@ -24,4 +26,7 @@ export declare const ACTION_ICON_SIZES: {

};
export declare const ActionIcon: React.ForwardRefExoticComponent<ActionIconProps & React.RefAttributes<HTMLButtonElement>>;
export declare function ActionIcon({ className, color, children, radius, size, variant, themeOverride, elementRef, ...others }: ActionIconProps): JSX.Element;
export declare namespace ActionIcon {
var displayName: string;
}
export {};
//# sourceMappingURL=ActionIcon.d.ts.map

@@ -17,5 +17,10 @@ import React from 'react';

size?: MantineNumberSize;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLButtonElement>;
}
export declare const Burger: React.ForwardRefExoticComponent<BurgerProps & React.RefAttributes<HTMLButtonElement>>;
export declare function Burger({ className, opened, color, size, themeOverride, elementRef, ...others }: BurgerProps): JSX.Element;
export declare namespace Burger {
var displayName: string;
}
export {};
//# sourceMappingURL=Burger.d.ts.map

@@ -27,5 +27,10 @@ import React from 'react';

id?: string;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLInputElement>;
}
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
export declare function Checkbox({ className, checked, onChange, color, themeOverride, label, disabled, intermediate, id, size, wrapperProps, style, inputStyle, inputClassName, elementRef, ...others }: CheckboxProps): JSX.Element;
export declare namespace Checkbox {
var displayName: string;
}
export {};
//# sourceMappingURL=Checkbox.d.ts.map

@@ -13,2 +13,3 @@ export { ActionIcon, ACTION_ICON_SIZES } from './ActionIcon/ActionIcon';

export { Container, CONTAINER_SIZES } from './Container/Container';
export { Drawer, DRAWER_SIZES } from './Drawer/Drawer';
export { ElementsGroup } from './ElementsGroup/ElementsGroup';

@@ -25,2 +26,3 @@ export { Highlight } from './Highlight/Highlight';

export { Modal, MODAL_SIZES } from './Modal/Modal';
export { Notification } from './Notification/Notification';
export { Overlay } from './Overlay/Overlay';

@@ -34,3 +36,3 @@ export { Paper } from './Paper/Paper';

export { Spoiler } from './Spoiler/Spoiler';
export { Switch } from './Switch/Switch';
export { Switch, SWITCH_SIZES } from './Switch/Switch';
export { Table } from './Table/Table';

@@ -37,0 +39,0 @@ export { Tabs, Tab } from './Tabs/Tabs';

@@ -1,3 +0,3 @@

declare const _default: (data?: unknown) => Record<"input" | "icon" | "withIcon" | "invalid" | "rightSection" | "inputWrapper" | "defaultVariant" | "filledVariant" | "unstyledVariant", string>;
declare const _default: (data?: unknown) => Record<"input" | "icon" | "invalid" | "rightSection" | "withIcon" | "inputWrapper" | "defaultVariant" | "filledVariant" | "unstyledVariant", string>;
export default _default;
//# sourceMappingURL=Input.styles.d.ts.map

@@ -14,5 +14,8 @@ import React from 'react';

interface InputWrapperProps extends DefaultProps, InputWrapperBaseProps, React.ComponentPropsWithoutRef<'div'> {
/** Input that should be wrapped */
children: React.ReactNode;
/** htmlFor label prop */
id?: string;
/** Render label as label with htmlFor or as div */
labelElement?: 'label' | 'div';
children: React.ReactChild;
}

@@ -19,0 +22,0 @@ export declare function InputWrapper({ className, label, children, required, id, error, description, themeOverride, labelElement, ...others }: InputWrapperProps): JSX.Element;

@@ -1,3 +0,3 @@

declare const _default: (data?: unknown) => Record<"label" | "description" | "error" | "required" | "inputWrapper", string>;
declare const _default: (data?: unknown) => Record<"label" | "error" | "required" | "inputWrapper" | "description", string>;
export default _default;
//# sourceMappingURL=InputWrapper.styles.d.ts.map

@@ -53,4 +53,8 @@ import React from 'react';

controlRefProp?: string;
/** Menu body z-index */
zIndex?: number;
/** Get control ref */
elementRef?: React.ForwardedRef<HTMLButtonElement>;
}
export declare function Menu({ control, children, onClose, onOpen, opened, themeOverride, menuPosition, style, menuId, menuBodyProps, closeOnItemClick, transitionDuration, size, shadow, transition, transitionTimingFunction, menuButtonLabel, controlRefProp, ...others }: MenuProps): JSX.Element;
export declare function Menu({ control, children, onClose, onOpen, opened, themeOverride, menuPosition, style, menuId, menuBodyProps, closeOnItemClick, transitionDuration, size, shadow, transition, transitionTimingFunction, menuButtonLabel, controlRefProp, zIndex, elementRef, ...others }: MenuProps): JSX.Element;
export declare namespace Menu {

@@ -57,0 +61,0 @@ var displayName: string;

@@ -25,4 +25,6 @@ import React from 'react';

closeOnItemClick?: boolean;
/** Menu body z-index */
zIndex?: number;
}
export declare function MenuBody({ className, themeOverride, opened, onClose, transition, transitionDuration, transitionTimingFunction, style, children, size, shadow, closeOnClickOutside, closeOnItemClick, ...others }: MenuBodyProps): JSX.Element;
export declare function MenuBody({ className, themeOverride, opened, onClose, transition, transitionDuration, transitionTimingFunction, style, children, size, shadow, closeOnClickOutside, closeOnItemClick, zIndex, ...others }: MenuBodyProps): JSX.Element;
export declare namespace MenuBody {

@@ -29,0 +31,0 @@ var displayName: string;

@@ -10,3 +10,3 @@ import React from 'react';

}
export declare function MenuButton({ children, onHover, hovered, themeOverride, elementRef, icon, color, disabled, cmd, className, ...others }: MenuButtonProps): JSX.Element;
export declare function MenuButton({ children, onHover, hovered, themeOverride, elementRef, icon, color, disabled, rightSection, className, ...others }: MenuButtonProps): JSX.Element;
export declare namespace MenuButton {

@@ -13,0 +13,0 @@ var displayName: string;

@@ -6,3 +6,3 @@ import React from 'react';

color?: string;
cmd?: React.ReactNode;
rightSection?: React.ReactNode;
}

@@ -9,0 +9,0 @@ export interface MenuItemType {

@@ -10,5 +10,10 @@ import React from 'react';

radius?: MantineNumberSize;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLDivElement>;
}
export declare const Paper: React.ForwardRefExoticComponent<PaperProps & React.RefAttributes<HTMLDivElement>>;
export declare function Paper({ className, children, padding, radius, shadow, themeOverride, elementRef, ...others }: PaperProps): JSX.Element;
export declare namespace Paper {
var displayName: string;
}
export {};
//# sourceMappingURL=Paper.d.ts.map

@@ -8,5 +8,10 @@ import React from 'react';

hidePasswordLabel?: string;
/** Focus input when toggle button is pressed */
focusInputOnToggle?: boolean;
}
export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
export declare function PasswordInput({ radius, disabled, hidePasswordLabel, showPasswordLabel, themeOverride, focusInputOnToggle, elementRef, ...others }: PasswordInputProps): JSX.Element;
export declare namespace PasswordInput {
var displayName: string;
}
export {};
//# sourceMappingURL=PasswordInput.d.ts.map

@@ -8,6 +8,10 @@ import React from 'react';

value: string;
/** Active radio color */
color?: string;
/** Predefined label fontSize, radio width, height and border-radius */
size?: MantineSize;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLInputElement>;
}
export declare function Radio({ className, themeOverride, id, children, style, size, ...others }: RadioProps): JSX.Element;
export declare function Radio({ className, themeOverride, id, children, style, size, elementRef, title, disabled, color, ...others }: RadioProps): JSX.Element;
export declare namespace Radio {

@@ -14,0 +18,0 @@ var displayName: string;

@@ -8,4 +8,4 @@ export declare const sizes: {

};
declare const _default: (data?: unknown) => Record<"label" | "radio" | "wrapper", string>;
declare const _default: (data?: unknown) => Record<"label" | "radio" | "wrapper" | "labelDisabled", string>;
export default _default;
//# sourceMappingURL=Radio.styles.d.ts.map
import React from 'react';
import { DefaultProps, MantineNumberSize } from '@mantine/theme';
import { DefaultProps, MantineNumberSize, MantineSize } from '@mantine/theme';
import { InputWrapperBaseProps } from '../InputWrapper/InputWrapper';

@@ -28,4 +28,8 @@ import { Radio } from './Radio/Radio';

spacing?: MantineNumberSize;
/** Active radio color */
color?: string;
/** Predefined label fontSize, radio width, height and border-radius */
size?: MantineSize;
}
export declare function RadioGroup({ className, themeOverride, name, children, value, defaultValue, onChange, variant, spacing, ...others }: RadioGroupProps): JSX.Element;
export declare function RadioGroup({ className, themeOverride, name, children, value, defaultValue, onChange, variant, spacing, color, size, ...others }: RadioGroupProps): JSX.Element;
export declare namespace RadioGroup {

@@ -32,0 +36,0 @@ var displayName: string;

@@ -10,3 +10,3 @@ import React from 'react';

}
interface SelectProps extends DefaultProps, InputWrapperBaseProps, InputProps, React.ComponentPropsWithoutRef<'select'> {
interface SelectProps extends DefaultProps, InputWrapperBaseProps, Omit<InputProps, 'rightSection' | 'rightSectionWidth' | 'rightSectionProps'>, React.ComponentPropsWithoutRef<'select'> {
/** id is used to bind input and label, if not passed unique id will be generated for each input */

@@ -22,5 +22,10 @@ id?: string;

wrapperProps?: Record<string, any>;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLSelectElement>;
}
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
export declare function Select({ id, className, required, label, error, style, data, placeholder, themeOverride, wrapperProps, inputStyle, description, elementRef, ...others }: SelectProps): JSX.Element;
export declare namespace Select {
var displayName: string;
}
export {};
//# sourceMappingURL=Select.d.ts.map

@@ -11,3 +11,3 @@ import React from 'react';

/** Get ref of spoiler toggle button */
controlRef?: React.MutableRefObject<HTMLButtonElement> | React.RefCallback<HTMLButtonElement>;
controlRef?: React.ForwardedRef<HTMLButtonElement>;
/** Spoiler reveal transition duration in ms, 0 or null to turn off animation */

@@ -14,0 +14,0 @@ transitionDuration?: number;

import React from 'react';
import { DefaultProps, MantineNumberSize, MantineSize } from '@mantine/theme';
export declare const SWITCH_SIZES: Record<MantineSize, {
width: number;
height: number;
}>;
interface SwitchProps extends DefaultProps, Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'size'> {

@@ -20,5 +24,10 @@ /** Id is used to bind input and label, if not passed unique id will be generated for each input */

wrapperProps?: Record<string, any>;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLInputElement>;
}
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
export declare function Switch({ className, color, label, id, style, size, radius, themeOverride, wrapperProps, inputStyle, inputClassName, elementRef, ...others }: SwitchProps): JSX.Element;
export declare namespace Switch {
var displayName: string;
}
export {};
//# sourceMappingURL=Switch.d.ts.map

@@ -0,3 +1,8 @@

import { MantineSize } from '@mantine/theme';
export declare const sizes: Record<MantineSize, {
width: number;
height: number;
}>;
declare const _default: (data?: unknown) => Record<"label" | "switch" | "wrapper", string>;
export default _default;
//# sourceMappingURL=Switch.styles.d.ts.map

@@ -6,2 +6,3 @@ import React from 'react';

children?: React.ReactNode;
elementRef?: React.ForwardedRef<HTMLButtonElement>;
}

@@ -11,3 +12,2 @@ export interface TabType {

props: TabProps;
ref?: React.RefObject<HTMLButtonElement> | ((instance: HTMLButtonElement) => void);
}

@@ -14,0 +14,0 @@ export declare function Tab(props: TabProps): any;

@@ -18,5 +18,10 @@ import React from 'react';

wrapperProps?: Record<string, any>;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLTextAreaElement>;
}
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
export declare function Textarea({ autosize, maxRows, minRows, label, error, description, id, className, required, themeOverride, style, wrapperProps, inputStyle, elementRef, ...others }: TextareaProps): JSX.Element;
export declare namespace Textarea {
var displayName: string;
}
export {};
//# sourceMappingURL=Textarea.d.ts.map

@@ -14,5 +14,10 @@ import React from 'react';

wrapperProps?: Record<string, any>;
/** Get element ref */
elementRef?: React.ForwardedRef<HTMLInputElement>;
}
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
export declare function TextInput({ className, id, label, error, required, type, style, icon, description, themeOverride, wrapperProps, elementRef, ...others }: TextInputProps): JSX.Element;
export declare namespace TextInput {
var displayName: string;
}
export {};
//# sourceMappingURL=TextInput.d.ts.map

@@ -8,5 +8,5 @@ import React from 'react';

}
export declare type MantineTransitionName = 'fade' | 'skew-up' | 'slide-down';
export declare type MantineTransitionName = 'fade' | 'skew-up' | 'skew-down' | 'rotate-up' | 'rotate-down' | 'slide-down' | 'slide-up' | 'slide-right' | 'slide-left';
export declare type MantineTransition = MantineTransitionName | MantineTransitionStyles;
export declare const transitions: Record<MantineTransitionName, MantineTransitionStyles>;
//# sourceMappingURL=transitions.d.ts.map
export { useNotifications } from './use-notifications/use-notifications';
export { NotificationsProvider } from './NotificationsProvider/NotificationsProvider';
export { Notification } from './Notification/Notification';
//# sourceMappingURL=index.d.ts.map
{
"name": "@mantine/notifications",
"version": "0.5.2",
"version": "0.5.3",
"main": "dist/lib.js",

@@ -10,5 +10,5 @@ "license": "MIT",

"peerDependencies": {
"@mantine/core": "0.5.2",
"@mantine/hooks": "0.5.2",
"@mantine/theme": "0.5.2",
"@mantine/core": "0.5.3",
"@mantine/hooks": "0.5.3",
"@mantine/theme": "0.5.3",
"react": ">=16.8.0",

@@ -15,0 +15,0 @@ "react-dom": ">=16.8.0",

export { useNotifications } from './use-notifications/use-notifications';
export { NotificationsProvider } from './NotificationsProvider/NotificationsProvider';
export { Notification } from './Notification/Notification';

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

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

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

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

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

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

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

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

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

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

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