@mantine/notifications 6.0.13 → 7.0.0-alpha.13

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.
Files changed (88) hide show
  1. package/cjs/{NotificationContainer/NotificationContainer.js → NotificationContainer.js} +37 -44
  2. package/cjs/NotificationContainer.js.map +1 -0
  3. package/cjs/Notifications.js +179 -0
  4. package/cjs/Notifications.js.map +1 -0
  5. package/cjs/Notifications.module.css.js +8 -0
  6. package/cjs/Notifications.module.css.js.map +1 -0
  7. package/cjs/{NotificationContainer/get-auto-close → get-auto-close}/get-auto-close.js +1 -1
  8. package/cjs/get-auto-close/get-auto-close.js.map +1 -0
  9. package/cjs/{Notifications/get-notification-state-styles/get-notification-state-styles.js → get-notification-state-styles.js} +3 -3
  10. package/cjs/get-notification-state-styles.js.map +1 -0
  11. package/cjs/index.css +15 -0
  12. package/cjs/index.js +13 -8
  13. package/cjs/index.js.map +1 -1
  14. package/cjs/notifications.store.js +107 -0
  15. package/cjs/notifications.store.js.map +1 -0
  16. package/esm/NotificationContainer.js +75 -0
  17. package/esm/NotificationContainer.js.map +1 -0
  18. package/esm/Notifications.js +171 -0
  19. package/esm/Notifications.js.map +1 -0
  20. package/esm/Notifications.module.css.js +4 -0
  21. package/esm/Notifications.module.css.js.map +1 -0
  22. package/esm/{NotificationContainer/get-auto-close → get-auto-close}/get-auto-close.js +1 -1
  23. package/esm/get-auto-close/get-auto-close.js.map +1 -0
  24. package/esm/{Notifications/get-notification-state-styles/get-notification-state-styles.js → get-notification-state-styles.js} +3 -3
  25. package/esm/get-notification-state-styles.js.map +1 -0
  26. package/esm/index.css +15 -0
  27. package/esm/index.js +3 -2
  28. package/esm/index.js.map +1 -1
  29. package/esm/notifications.store.js +94 -0
  30. package/esm/notifications.store.js.map +1 -0
  31. package/lib/NotificationContainer.d.ts +11 -0
  32. package/lib/NotificationContainer.d.ts.map +1 -0
  33. package/lib/Notifications.d.ts +61 -0
  34. package/lib/Notifications.d.ts.map +1 -0
  35. package/lib/get-auto-close/get-auto-close.d.ts +2 -0
  36. package/lib/get-auto-close/get-auto-close.d.ts.map +1 -0
  37. package/lib/get-notification-state-styles.d.ts +12 -0
  38. package/lib/get-notification-state-styles.d.ts.map +1 -0
  39. package/lib/index.d.ts +4 -4
  40. package/lib/index.d.ts.map +1 -1
  41. package/lib/notifications.store.d.ts +41 -0
  42. package/lib/notifications.store.d.ts.map +1 -0
  43. package/package.json +16 -10
  44. package/cjs/NotificationContainer/NotificationContainer.js.map +0 -1
  45. package/cjs/NotificationContainer/get-auto-close/get-auto-close.js.map +0 -1
  46. package/cjs/Notifications/Notifications.js +0 -152
  47. package/cjs/Notifications/Notifications.js.map +0 -1
  48. package/cjs/Notifications/Notifications.styles.js +0 -22
  49. package/cjs/Notifications/Notifications.styles.js.map +0 -1
  50. package/cjs/Notifications/get-notification-state-styles/get-notification-state-styles.js.map +0 -1
  51. package/cjs/Notifications/get-position-styles/get-position-styles.js +0 -16
  52. package/cjs/Notifications/get-position-styles/get-position-styles.js.map +0 -1
  53. package/cjs/Notifications/use-notifications-state/use-notifications-state.js +0 -70
  54. package/cjs/Notifications/use-notifications-state/use-notifications-state.js.map +0 -1
  55. package/cjs/events.js +0 -29
  56. package/cjs/events.js.map +0 -1
  57. package/esm/NotificationContainer/NotificationContainer.js +0 -82
  58. package/esm/NotificationContainer/NotificationContainer.js.map +0 -1
  59. package/esm/NotificationContainer/get-auto-close/get-auto-close.js.map +0 -1
  60. package/esm/Notifications/Notifications.js +0 -144
  61. package/esm/Notifications/Notifications.js.map +0 -1
  62. package/esm/Notifications/Notifications.styles.js +0 -18
  63. package/esm/Notifications/Notifications.styles.js.map +0 -1
  64. package/esm/Notifications/get-notification-state-styles/get-notification-state-styles.js.map +0 -1
  65. package/esm/Notifications/get-position-styles/get-position-styles.js +0 -12
  66. package/esm/Notifications/get-position-styles/get-position-styles.js.map +0 -1
  67. package/esm/Notifications/use-notifications-state/use-notifications-state.js +0 -66
  68. package/esm/Notifications/use-notifications-state/use-notifications-state.js.map +0 -1
  69. package/esm/events.js +0 -18
  70. package/esm/events.js.map +0 -1
  71. package/lib/NotificationContainer/NotificationContainer.d.ts +0 -15
  72. package/lib/NotificationContainer/NotificationContainer.d.ts.map +0 -1
  73. package/lib/NotificationContainer/get-auto-close/get-auto-close.d.ts +0 -2
  74. package/lib/NotificationContainer/get-auto-close/get-auto-close.d.ts.map +0 -1
  75. package/lib/Notifications/Notifications.d.ts +0 -25
  76. package/lib/Notifications/Notifications.d.ts.map +0 -1
  77. package/lib/Notifications/Notifications.styles.d.ts +0 -14
  78. package/lib/Notifications/Notifications.styles.d.ts.map +0 -1
  79. package/lib/Notifications/get-notification-state-styles/get-notification-state-styles.d.ts +0 -12
  80. package/lib/Notifications/get-notification-state-styles/get-notification-state-styles.d.ts.map +0 -1
  81. package/lib/Notifications/get-position-styles/get-position-styles.d.ts +0 -4
  82. package/lib/Notifications/get-position-styles/get-position-styles.d.ts.map +0 -1
  83. package/lib/Notifications/use-notifications-state/use-notifications-state.d.ts +0 -13
  84. package/lib/Notifications/use-notifications-state/use-notifications-state.d.ts.map +0 -1
  85. package/lib/events.d.ts +0 -20
  86. package/lib/events.d.ts.map +0 -1
  87. package/lib/types.d.ts +0 -15
  88. package/lib/types.d.ts.map +0 -1
@@ -1,18 +0,0 @@
1
- import { createStyles } from '@mantine/core';
2
-
3
- var useStyles = createStyles((theme, { zIndex }) => ({
4
- notifications: {
5
- width: `calc(100% - ${theme.spacing.md} * 2)`,
6
- boxSizing: "border-box",
7
- position: "fixed",
8
- zIndex
9
- },
10
- notification: {
11
- "&:not(:first-of-type)": {
12
- marginTop: theme.spacing.sm
13
- }
14
- }
15
- }));
16
-
17
- export default useStyles;
18
- //# sourceMappingURL=Notifications.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notifications.styles.js","sources":["../../src/Notifications/Notifications.styles.ts"],"sourcesContent":["import { createStyles } from '@mantine/core';\n\ninterface NotificationsStylesParams {\n zIndex: React.CSSProperties['zIndex'];\n}\n\nexport default createStyles((theme, { zIndex }: NotificationsStylesParams) => ({\n notifications: {\n width: `calc(100% - ${theme.spacing.md} * 2)`,\n boxSizing: 'border-box',\n position: 'fixed',\n zIndex,\n },\n\n notification: {\n '&:not(:first-of-type)': {\n marginTop: theme.spacing.sm,\n },\n },\n}));\n"],"names":[],"mappings":";;AACA,gBAAe,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM;AACpD,EAAE,aAAa,EAAE;AACjB,IAAI,KAAK,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC;AACjD,IAAI,SAAS,EAAE,YAAY;AAC3B,IAAI,QAAQ,EAAE,OAAO;AACrB,IAAI,MAAM;AACV,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,uBAAuB,EAAE;AAC7B,MAAM,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;AACjC,KAAK;AACL,GAAG;AACH,CAAC,CAAC,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-state-styles.js","sources":["../../../src/Notifications/get-notification-state-styles/get-notification-state-styles.ts"],"sourcesContent":["import { TransitionStatus } from 'react-transition-group';\nimport { CSSObject } from '@mantine/core';\nimport { NotificationsPositioning } from '../../types';\n\ninterface NotificationStateStylesProps {\n state: TransitionStatus;\n maxHeight: number | string;\n positioning: NotificationsPositioning;\n transitionDuration: number;\n}\n\nconst transforms = {\n left: 'translateX(-100%)',\n right: 'translateX(100%)',\n 'top-center': 'translateY(-100%)',\n 'bottom-center': 'translateY(100%)',\n};\n\nconst noTransform = {\n left: 'translateX(0)',\n right: 'translateX(0)',\n 'top-center': 'translateY(0)',\n 'bottom-center': 'translateY(0)',\n};\n\nexport default function getNotificationStateStyles({\n state,\n maxHeight,\n positioning,\n transitionDuration,\n}: NotificationStateStylesProps): CSSObject {\n const [vertical, horizontal] = positioning;\n const property = horizontal === 'center' ? `${vertical}-center` : horizontal;\n\n const commonStyles: CSSObject = {\n opacity: 0,\n maxHeight,\n transform: transforms[property],\n transitionDuration: `${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,\n transitionTimingFunction: 'cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear',\n transitionProperty: 'opacity, transform, max-height',\n };\n\n const inState: CSSObject = {\n opacity: 1,\n transform: noTransform[property],\n };\n\n const outState: CSSObject = {\n opacity: 0,\n maxHeight: 0,\n transform: transforms[property],\n };\n\n const transitionStyles = {\n entering: inState,\n entered: inState,\n exiting: outState,\n exited: outState,\n };\n\n return { ...commonStyles, ...transitionStyles[state] };\n}\n"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;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kB,EAAE,gCAAgC;AACxD,GAAG,CAAC;AACJ,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC;AACpC,GAAG,CAAC;AACJ,EAAE,MAAM,QAAQ,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,SAAS,EAAE,CAAC;AAChB,IAAI,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC;AACnC,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAG;AAC3B,IAAI,QAAQ,EAAE,OAAO;AACrB,IAAI,OAAO,EAAE,OAAO;AACpB,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,MAAM,EAAE,QAAQ;AACpB,GAAG,CAAC;AACJ,EAAE,OAAO,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;AACnF;;;;"}
@@ -1,12 +0,0 @@
1
- function getPositionStyles([vertical, horizontal], spacing) {
2
- const styles = {};
3
- vertical === "top" && (styles.top = spacing);
4
- vertical === "bottom" && (styles.bottom = spacing);
5
- horizontal === "left" && (styles.left = spacing);
6
- horizontal === "right" && (styles.right = spacing);
7
- horizontal === "center" && (styles.left = "50%", styles.transform = "translateX(-50%)");
8
- return styles;
9
- }
10
-
11
- export default getPositionStyles;
12
- //# sourceMappingURL=get-position-styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-position-styles.js","sources":["../../../src/Notifications/get-position-styles/get-position-styles.ts"],"sourcesContent":["import { CSSObject } from '@mantine/core';\nimport { NotificationsPositioning } from '../../types';\n\nexport default function getPositionStyles(\n [vertical, horizontal]: NotificationsPositioning,\n spacing: number | string\n) {\n const styles: CSSObject = {};\n\n vertical === 'top' && (styles.top = spacing);\n vertical === 'bottom' && (styles.bottom = spacing);\n\n horizontal === 'left' && (styles.left = spacing);\n horizontal === 'right' && (styles.right = spacing);\n horizontal === 'center' && ((styles.left = '50%'), (styles.transform = 'translateX(-50%)'));\n\n return styles;\n}\n"],"names":[],"mappings":"AAAe,SAAS,iBAAiB,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE;AAC3E,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,QAAQ,KAAK,KAAK,KAAK,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;AAC/C,EAAE,QAAQ,KAAK,QAAQ,KAAK,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;AACrD,EAAE,UAAU,KAAK,MAAM,KAAK,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;AACnD,EAAE,UAAU,KAAK,OAAO,KAAK,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;AACrD,EAAE,UAAU,KAAK,QAAQ,KAAK,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,MAAM,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;AAC1F,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
@@ -1,66 +0,0 @@
1
- import { useQueue, randomId } from '@mantine/hooks';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
- function useNotificationsState({ limit }) {
23
- const { state, queue, update, cleanQueue } = useQueue({
24
- initialValues: [],
25
- limit
26
- });
27
- const showNotification = (notification) => {
28
- const id = notification.id || randomId();
29
- update((notifications) => {
30
- if (notification.id && notifications.some((n) => n.id === notification.id)) {
31
- return notifications;
32
- }
33
- return [...notifications, __spreadProps(__spreadValues({}, notification), { id })];
34
- });
35
- return id;
36
- };
37
- const updateNotification = (notification) => update((notifications) => {
38
- const index = notifications.findIndex((n) => n.id === notification.id);
39
- if (index === -1) {
40
- return notifications;
41
- }
42
- const newNotifications = [...notifications];
43
- newNotifications[index] = notification;
44
- return newNotifications;
45
- });
46
- const hideNotification = (id) => update((notifications) => notifications.filter((notification) => {
47
- if (notification.id === id) {
48
- typeof notification.onClose === "function" && notification.onClose(notification);
49
- return false;
50
- }
51
- return true;
52
- }));
53
- const clean = () => update(() => []);
54
- return {
55
- notifications: state,
56
- queue,
57
- showNotification,
58
- updateNotification,
59
- hideNotification,
60
- cleanQueue,
61
- clean
62
- };
63
- }
64
-
65
- export default useNotificationsState;
66
- //# sourceMappingURL=use-notifications-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-notifications-state.js","sources":["../../../src/Notifications/use-notifications-state/use-notifications-state.ts"],"sourcesContent":["import { useQueue, randomId } from '@mantine/hooks';\nimport { NotificationProps } from '../../types';\n\nexport default function useNotificationsState({ limit }: { limit: number }) {\n const { state, queue, update, cleanQueue } = useQueue<NotificationProps>({\n initialValues: [],\n limit,\n });\n\n const showNotification = (notification: NotificationProps) => {\n const id = notification.id || randomId();\n\n update((notifications) => {\n if (notification.id && notifications.some((n) => n.id === notification.id)) {\n return notifications;\n }\n\n return [...notifications, { ...notification, id }];\n });\n\n return id;\n };\n\n const updateNotification = (notification: NotificationProps) =>\n update((notifications) => {\n const index = notifications.findIndex((n) => n.id === notification.id);\n\n if (index === -1) {\n return notifications;\n }\n\n const newNotifications = [...notifications];\n newNotifications[index] = notification;\n\n return newNotifications;\n });\n\n const hideNotification = (id: string) =>\n update((notifications) =>\n notifications.filter((notification) => {\n if (notification.id === id) {\n typeof notification.onClose === 'function' && notification.onClose(notification);\n return false;\n }\n\n return true;\n })\n );\n\n const clean = () => update(() => []);\n\n return {\n notifications: state,\n queue,\n showNotification,\n updateNotification,\n hideNotification,\n cleanQueue,\n clean,\n };\n}\n"],"names":[],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,I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AK,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC,CAAC;AAC3E,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACtB,MAAM,OAAO,aAAa,CAAC;AAC3B,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;AAChD,IAAI,gBAAgB,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC;AAC3C,IAAI,OAAO,gBAAgB,CAAC;AAC5B,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK;AACpG,IAAI,IAAI,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE;AAChC,MAAM,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,IAAI,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACvF,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC,CAAC;AACN,EAAE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,EAAE,OAAO;AACT,IAAI,aAAa,EAAE,KAAK;AACxB,IAAI,KAAK;AACT,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,UAAU;AACd,IAAI,KAAK;AACT,GAAG,CAAC;AACJ;;;;"}
package/esm/events.js DELETED
@@ -1,18 +0,0 @@
1
- import { createUseExternalEvents } from '@mantine/utils';
2
-
3
- const [useNotificationsEvents, createEvent] = createUseExternalEvents("mantine-notifications");
4
- const showNotification = createEvent("show");
5
- const hideNotification = createEvent("hide");
6
- const cleanNotifications = createEvent("clean");
7
- const cleanNotificationsQueue = createEvent("cleanQueue");
8
- const updateNotification = createEvent("update");
9
- const notifications = {
10
- show: showNotification,
11
- hide: hideNotification,
12
- clean: cleanNotifications,
13
- cleanQueue: cleanNotificationsQueue,
14
- update: updateNotification
15
- };
16
-
17
- export { cleanNotifications, cleanNotificationsQueue, createEvent, hideNotification, notifications, showNotification, updateNotification, useNotificationsEvents };
18
- //# sourceMappingURL=events.js.map
package/esm/events.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@mantine/utils';\nimport type { NotificationProps } from './types';\n\nexport type NotificationsEvents = {\n show(notification: NotificationProps): void;\n hide(id: string): void;\n update(notification: NotificationProps & { id: string }): void;\n clean(): void;\n cleanQueue(): void;\n};\n\nexport const [useNotificationsEvents, createEvent] =\n createUseExternalEvents<NotificationsEvents>('mantine-notifications');\n\nexport const showNotification = createEvent('show');\nexport const hideNotification = createEvent('hide');\nexport const cleanNotifications = createEvent('clean');\nexport const cleanNotificationsQueue = createEvent('cleanQueue');\nexport const updateNotification = createEvent('update');\n\nexport const notifications: NotificationsEvents = {\n show: showNotification,\n hide: hideNotification,\n clean: cleanNotifications,\n cleanQueue: cleanNotificationsQueue,\n update: updateNotification,\n};\n"],"names":[],"mappings":";;AACY,MAAC,CAAC,sBAAsB,EAAE,WAAW,CAAC,GAAG,uBAAuB,CAAC,uBAAuB,EAAE;AAC1F,MAAC,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE;AACxC,MAAC,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE;AACxC,MAAC,kBAAkB,GAAG,WAAW,CAAC,OAAO,EAAE;AAC3C,MAAC,uBAAuB,GAAG,WAAW,CAAC,YAAY,EAAE;AACrD,MAAC,kBAAkB,GAAG,WAAW,CAAC,QAAQ,EAAE;AAC5C,MAAC,aAAa,GAAG;AAC7B,EAAE,IAAI,EAAE,gBAAgB;AACxB,EAAE,IAAI,EAAE,gBAAgB;AACxB,EAAE,KAAK,EAAE,kBAAkB;AAC3B,EAAE,UAAU,EAAE,uBAAuB;AACrC,EAAE,MAAM,EAAE,kBAAkB;AAC5B;;;;"}
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { DefaultProps } from '@mantine/core';
3
- import { NotificationProps } from '../types';
4
- export interface NotificationContainerProps extends DefaultProps {
5
- notification: NotificationProps;
6
- onHide(id: string): void;
7
- autoClose: false | number;
8
- innerRef: React.ForwardedRef<HTMLDivElement>;
9
- }
10
- declare function NotificationContainer({ notification, autoClose, onHide, innerRef, ...others }: NotificationContainerProps): JSX.Element;
11
- declare namespace NotificationContainer {
12
- var displayName: string;
13
- }
14
- export default NotificationContainer;
15
- //# sourceMappingURL=NotificationContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationContainer.d.ts","sourceRoot":"","sources":["../../src/NotificationContainer/NotificationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAgB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,0BAA2B,SAAQ,YAAY;IAC9D,YAAY,EAAE,iBAAiB,CAAC;IAChC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;CAC9C;AAED,iBAAwB,qBAAqB,CAAC,EAC5C,YAAY,EACZ,SAAS,EACT,MAAM,EACN,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,0BAA0B,eA2C5B;kBAjDuB,qBAAqB;;;eAArB,qBAAqB"}
@@ -1,2 +0,0 @@
1
- export default function getAutoClose(autoClose: boolean | number, notificationAutoClose: boolean | number): number | boolean;
2
- //# sourceMappingURL=get-auto-close.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-auto-close.d.ts","sourceRoot":"","sources":["../../../src/NotificationContainer/get-auto-close/get-auto-close.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,SAAS,EAAE,OAAO,GAAG,MAAM,EAC3B,qBAAqB,EAAE,OAAO,GAAG,MAAM,oBAWxC"}
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { DefaultProps, PortalProps } from '@mantine/core';
3
- import { NotificationsEvents } from '../events';
4
- type NotificationsStaticMethods = NotificationsEvents;
5
- export interface NotificationsProps extends Omit<DefaultProps, 'style'>, React.ComponentPropsWithoutRef<'div'> {
6
- /** Notifications position */
7
- position?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
8
- /** Auto close timeout for all notifications, false to disable auto close, can be overwritten for individual notifications by notifications.show function */
9
- autoClose?: number | false;
10
- /** Notification transitions duration, 0 to turn transitions off */
11
- transitionDuration?: number;
12
- /** Notification width, cannot exceed 100% */
13
- containerWidth?: number | string;
14
- /** Notification max-height, used for transitions */
15
- notificationMaxHeight?: number | string;
16
- /** Maximum amount of notifications displayed at a time, other new notifications will be added to queue */
17
- limit?: number;
18
- /** Notifications container z-index */
19
- zIndex?: React.CSSProperties['zIndex'];
20
- /** Target element of Portal component */
21
- target?: PortalProps['target'];
22
- }
23
- export declare const Notifications: React.FC<NotificationsProps> & NotificationsStaticMethods;
24
- export {};
25
- //# sourceMappingURL=Notifications.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notifications.d.ts","sourceRoot":"","sources":["../../src/Notifications/Notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAiC,WAAW,EAAO,MAAM,eAAe,CAAC;AAG9F,OAAO,EAEL,mBAAmB,EAEpB,MAAM,WAAW,CAAC;AAgBnB,KAAK,0BAA0B,GAAG,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EACjC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACvC,6BAA6B;IAC7B,QAAQ,CAAC,EACL,UAAU,GACV,WAAW,GACX,YAAY,GACZ,aAAa,GACb,cAAc,GACd,eAAe,CAAC;IAEpB,4JAA4J;IAC5J,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE3B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC,0GAA0G;IAC1G,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sCAAsC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEvC,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG,0BAgG1D,CAAC"}
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- interface NotificationsStylesParams {
3
- zIndex: React.CSSProperties['zIndex'];
4
- }
5
- declare const _default: (params: NotificationsStylesParams, options?: import("@mantine/core").UseStylesOptions<string>) => {
6
- classes: {
7
- notifications: string;
8
- notification: string;
9
- };
10
- cx: (...args: any) => string;
11
- theme: import("@mantine/core").MantineTheme;
12
- };
13
- export default _default;
14
- //# sourceMappingURL=Notifications.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notifications.styles.d.ts","sourceRoot":"","sources":["../../src/Notifications/Notifications.styles.ts"],"names":[],"mappings":";AAEA,UAAU,yBAAyB;IACjC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;CACvC;;;;;;;;;AAED,wBAaI"}
@@ -1,12 +0,0 @@
1
- import { TransitionStatus } from 'react-transition-group';
2
- import { CSSObject } from '@mantine/core';
3
- import { NotificationsPositioning } from '../../types';
4
- interface NotificationStateStylesProps {
5
- state: TransitionStatus;
6
- maxHeight: number | string;
7
- positioning: NotificationsPositioning;
8
- transitionDuration: number;
9
- }
10
- export default function getNotificationStateStyles({ state, maxHeight, positioning, transitionDuration, }: NotificationStateStylesProps): CSSObject;
11
- export {};
12
- //# sourceMappingURL=get-notification-state-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-state-styles.d.ts","sourceRoot":"","sources":["../../../src/Notifications/get-notification-state-styles/get-notification-state-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,UAAU,4BAA4B;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,WAAW,EAAE,wBAAwB,CAAC;IACtC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAgBD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,KAAK,EACL,SAAS,EACT,WAAW,EACX,kBAAkB,GACnB,EAAE,4BAA4B,GAAG,SAAS,CAgC1C"}
@@ -1,4 +0,0 @@
1
- import { CSSObject } from '@mantine/core';
2
- import { NotificationsPositioning } from '../../types';
3
- export default function getPositionStyles([vertical, horizontal]: NotificationsPositioning, spacing: number | string): CSSObject;
4
- //# sourceMappingURL=get-position-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-position-styles.d.ts","sourceRoot":"","sources":["../../../src/Notifications/get-position-styles/get-position-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,wBAAwB,EAChD,OAAO,EAAE,MAAM,GAAG,MAAM,aAYzB"}
@@ -1,13 +0,0 @@
1
- import { NotificationProps } from '../../types';
2
- export default function useNotificationsState({ limit }: {
3
- limit: number;
4
- }): {
5
- notifications: NotificationProps[];
6
- queue: NotificationProps[];
7
- showNotification: (notification: NotificationProps) => string;
8
- updateNotification: (notification: NotificationProps) => void;
9
- hideNotification: (id: string) => void;
10
- cleanQueue: () => void;
11
- clean: () => void;
12
- };
13
- //# sourceMappingURL=use-notifications-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-notifications-state.d.ts","sourceRoot":"","sources":["../../../src/Notifications/use-notifications-state/use-notifications-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE;;;qCAMhC,iBAAiB;uCAcf,iBAAiB;2BAc7B,MAAM;;;EAuBrC"}
package/lib/events.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { NotificationProps } from './types';
2
- export type NotificationsEvents = {
3
- show(notification: NotificationProps): void;
4
- hide(id: string): void;
5
- update(notification: NotificationProps & {
6
- id: string;
7
- }): void;
8
- clean(): void;
9
- cleanQueue(): void;
10
- };
11
- export declare const useNotificationsEvents: (events: NotificationsEvents) => void, createEvent: <EventKey extends keyof NotificationsEvents>(event: EventKey) => (...payload: Parameters<NotificationsEvents[EventKey]>[0] extends undefined ? [undefined?] : [Parameters<NotificationsEvents[EventKey]>[0]]) => void;
12
- export declare const showNotification: (payload_0: NotificationProps) => void;
13
- export declare const hideNotification: (payload_0: string) => void;
14
- export declare const cleanNotifications: (payload_0?: undefined) => void;
15
- export declare const cleanNotificationsQueue: (payload_0?: undefined) => void;
16
- export declare const updateNotification: (payload_0: NotificationProps & {
17
- id: string;
18
- }) => void;
19
- export declare const notifications: NotificationsEvents;
20
- //# sourceMappingURL=events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,YAAY,EAAE,iBAAiB,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D,KAAK,IAAI,IAAI,CAAC;IACd,UAAU,IAAI,IAAI,CAAC;CACpB,CAAC;AAEF,eAAO,MAAO,sBAAsB,yCAAE,WAAW,uNACsB,CAAC;AAExE,eAAO,MAAM,gBAAgB,wCAAsB,CAAC;AACpD,eAAO,MAAM,gBAAgB,6BAAsB,CAAC;AACpD,eAAO,MAAM,kBAAkB,iCAAuB,CAAC;AACvD,eAAO,MAAM,uBAAuB,iCAA4B,CAAC;AACjE,eAAO,MAAM,kBAAkB;QAZkB,MAAM;UAYA,CAAC;AAExD,eAAO,MAAM,aAAa,EAAE,mBAM3B,CAAC"}
package/lib/types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { NotificationProps as NotificationComponentProps } from '@mantine/core';
3
- export interface NotificationProps extends Omit<NotificationComponentProps, 'onClose'> {
4
- id?: string;
5
- message: React.ReactNode;
6
- autoClose?: boolean | number;
7
- onClose?(props: NotificationProps): void;
8
- onOpen?(props: NotificationProps): void;
9
- }
10
- export interface NotificationsContextProps {
11
- notifications: NotificationProps[];
12
- queue: NotificationProps[];
13
- }
14
- export type NotificationsPositioning = ['top' | 'bottom', 'left' | 'right' | 'center'];
15
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAErF,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,0BAA0B,EAAE,SAAS,CAAC;IACpF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,GAAG,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC"}