@mantine/notifications 9.0.0-alpha.5 → 9.0.0-alpha.7

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 (39) hide show
  1. package/cjs/NotificationContainer.cjs +51 -47
  2. package/cjs/NotificationContainer.cjs.map +1 -1
  3. package/cjs/Notifications.cjs +145 -159
  4. package/cjs/Notifications.cjs.map +1 -1
  5. package/cjs/Notifications.module.cjs +10 -0
  6. package/cjs/Notifications.module.cjs.map +1 -0
  7. package/cjs/get-auto-close/get-auto-close.cjs +8 -12
  8. package/cjs/get-auto-close/get-auto-close.cjs.map +1 -1
  9. package/cjs/get-grouped-notifications/get-grouped-notifications.cjs +18 -21
  10. package/cjs/get-grouped-notifications/get-grouped-notifications.cjs.map +1 -1
  11. package/cjs/get-notification-state-styles.cjs +43 -45
  12. package/cjs/get-notification-state-styles.cjs.map +1 -1
  13. package/cjs/index.cjs +14 -19
  14. package/cjs/notifications.store.cjs +68 -77
  15. package/cjs/notifications.store.cjs.map +1 -1
  16. package/esm/NotificationContainer.mjs +51 -45
  17. package/esm/NotificationContainer.mjs.map +1 -1
  18. package/esm/Notifications.mjs +138 -150
  19. package/esm/Notifications.mjs.map +1 -1
  20. package/esm/Notifications.module.mjs +10 -0
  21. package/esm/Notifications.module.mjs.map +1 -0
  22. package/esm/get-auto-close/get-auto-close.mjs +8 -10
  23. package/esm/get-auto-close/get-auto-close.mjs.map +1 -1
  24. package/esm/get-grouped-notifications/get-grouped-notifications.mjs +18 -19
  25. package/esm/get-grouped-notifications/get-grouped-notifications.mjs.map +1 -1
  26. package/esm/get-notification-state-styles.mjs +43 -43
  27. package/esm/get-notification-state-styles.mjs.map +1 -1
  28. package/esm/index.mjs +3 -3
  29. package/esm/notifications.store.mjs +66 -73
  30. package/esm/notifications.store.mjs.map +1 -1
  31. package/lib/NotificationContainer.d.ts +4 -1
  32. package/lib/Notifications.d.ts +2 -0
  33. package/package.json +4 -4
  34. package/cjs/Notifications.module.css.cjs +0 -7
  35. package/cjs/Notifications.module.css.cjs.map +0 -1
  36. package/cjs/index.cjs.map +0 -1
  37. package/esm/Notifications.module.css.mjs +0 -5
  38. package/esm/Notifications.module.css.mjs.map +0 -1
  39. package/esm/index.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"get-auto-close.cjs","sources":["../../src/get-auto-close/get-auto-close.ts"],"sourcesContent":["export function getAutoClose(\n autoClose: boolean | number | undefined,\n notificationAutoClose: boolean | number | undefined\n) {\n if (typeof notificationAutoClose === 'number') {\n return notificationAutoClose;\n }\n\n if (notificationAutoClose === false || autoClose === false) {\n return false;\n }\n\n return autoClose;\n}\n"],"names":[],"mappings":";;;AAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GACA,qBAAA,CAAA,CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAA0B,QAAA,CAAA,CAAU,CAAA;AAC7C,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACT,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,qBAAA,CAAA,CAAA,CAAA,CAAA,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,IAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,KAAA,CAAA,CAAO,CAAA;AAC1D,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACT,CAAA;AAEA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACT,CAAA;;"}
1
+ {"version":3,"file":"get-auto-close.cjs","names":[],"sources":["../../src/get-auto-close/get-auto-close.ts"],"sourcesContent":["export function getAutoClose(\n autoClose: boolean | number | undefined,\n notificationAutoClose: boolean | number | undefined\n) {\n if (typeof notificationAutoClose === 'number') {\n return notificationAutoClose;\n }\n\n if (notificationAutoClose === false || autoClose === false) {\n return false;\n }\n\n return autoClose;\n}\n"],"mappings":";;AAAA,SAAgB,aACd,WACA,uBACA;AACA,KAAI,OAAO,0BAA0B,SACnC,QAAO;AAGT,KAAI,0BAA0B,SAAS,cAAc,MACnD,QAAO;AAGT,QAAO"}
@@ -1,27 +1,24 @@
1
- 'use client';
2
- 'use strict';
3
-
1
+ "use client";
2
+ //#region packages/@mantine/notifications/src/get-grouped-notifications/get-grouped-notifications.ts
4
3
  const positions = [
5
- "bottom-center",
6
- "bottom-left",
7
- "bottom-right",
8
- "top-center",
9
- "top-left",
10
- "top-right"
4
+ "bottom-center",
5
+ "bottom-left",
6
+ "bottom-right",
7
+ "top-center",
8
+ "top-left",
9
+ "top-right"
11
10
  ];
12
11
  function getGroupedNotifications(notifications, defaultPosition) {
13
- return notifications.reduce(
14
- (acc, notification) => {
15
- acc[notification.position || defaultPosition].push(notification);
16
- return acc;
17
- },
18
- positions.reduce((acc, item) => {
19
- acc[item] = [];
20
- return acc;
21
- }, {})
22
- );
12
+ return notifications.reduce((acc, notification) => {
13
+ acc[notification.position || defaultPosition].push(notification);
14
+ return acc;
15
+ }, positions.reduce((acc, item) => {
16
+ acc[item] = [];
17
+ return acc;
18
+ }, {}));
23
19
  }
24
-
20
+ //#endregion
25
21
  exports.getGroupedNotifications = getGroupedNotifications;
26
22
  exports.positions = positions;
27
- //# sourceMappingURL=get-grouped-notifications.cjs.map
23
+
24
+ //# sourceMappingURL=get-grouped-notifications.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-grouped-notifications.cjs","sources":["../../src/get-grouped-notifications/get-grouped-notifications.ts"],"sourcesContent":["import { NotificationData, NotificationPosition } from '../notifications.store';\n\nexport type GroupedNotifications = Record<NotificationPosition, NotificationData[]>;\n\nexport const positions: NotificationPosition[] = [\n 'bottom-center',\n 'bottom-left',\n 'bottom-right',\n 'top-center',\n 'top-left',\n 'top-right',\n];\n\nexport function getGroupedNotifications(\n notifications: NotificationData[],\n defaultPosition: NotificationPosition\n) {\n return notifications.reduce<GroupedNotifications>(\n (acc, notification) => {\n acc[notification.position || defaultPosition].push(notification);\n return acc;\n },\n positions.reduce<GroupedNotifications>((acc, item) => {\n acc[item] = [];\n return acc;\n }, {} as GroupedNotifications)\n );\n}\n"],"names":[],"mappings":";;;AAIO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,SAAA,CAAA,CAAA,CAAoC,CAAA;AAAA,CAAA,CAC/C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAA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AAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACT,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,IAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA;AACpD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,IAAI,CAAA,CAAC,CAAA;AACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACT,CAAA,EAAG,CAAA,CAA0B,CAAA;AAAA,CAAA,CAAA,CAC/B,CAAA;AACF,CAAA;;;"}
1
+ {"version":3,"file":"get-grouped-notifications.cjs","names":[],"sources":["../../src/get-grouped-notifications/get-grouped-notifications.ts"],"sourcesContent":["import { NotificationData, NotificationPosition } from '../notifications.store';\n\nexport type GroupedNotifications = Record<NotificationPosition, NotificationData[]>;\n\nexport const positions: NotificationPosition[] = [\n 'bottom-center',\n 'bottom-left',\n 'bottom-right',\n 'top-center',\n 'top-left',\n 'top-right',\n];\n\nexport function getGroupedNotifications(\n notifications: NotificationData[],\n defaultPosition: NotificationPosition\n) {\n return notifications.reduce<GroupedNotifications>(\n (acc, notification) => {\n acc[notification.position || defaultPosition].push(notification);\n return acc;\n },\n positions.reduce<GroupedNotifications>((acc, item) => {\n acc[item] = [];\n return acc;\n }, {} as GroupedNotifications)\n );\n}\n"],"mappings":";;AAIA,MAAa,YAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,wBACd,eACA,iBACA;AACA,QAAO,cAAc,QAClB,KAAK,iBAAiB;AACrB,MAAI,aAAa,YAAY,iBAAiB,KAAK,aAAa;AAChE,SAAO;IAET,UAAU,QAA8B,KAAK,SAAS;AACpD,MAAI,QAAQ,EAAE;AACd,SAAO;IACN,EAAE,CAAyB,CAC/B"}
@@ -1,51 +1,49 @@
1
- 'use client';
2
- 'use strict';
3
-
1
+ "use client";
2
+ //#region packages/@mantine/notifications/src/get-notification-state-styles.ts
4
3
  const transforms = {
5
- left: "translateX(-100%)",
6
- right: "translateX(100%)",
7
- "top-center": "translateY(-100%)",
8
- "bottom-center": "translateY(100%)"
4
+ left: "translateX(-100%)",
5
+ right: "translateX(100%)",
6
+ "top-center": "translateY(-100%)",
7
+ "bottom-center": "translateY(100%)"
9
8
  };
10
9
  const noTransform = {
11
- left: "translateX(0)",
12
- right: "translateX(0)",
13
- "top-center": "translateY(0)",
14
- "bottom-center": "translateY(0)"
10
+ left: "translateX(0)",
11
+ right: "translateX(0)",
12
+ "top-center": "translateY(0)",
13
+ "bottom-center": "translateY(0)"
15
14
  };
16
- function getNotificationStateStyles({
17
- state,
18
- maxHeight,
19
- position,
20
- transitionDuration
21
- }) {
22
- const [vertical, horizontal] = position.split("-");
23
- const property = horizontal === "center" ? `${vertical}-center` : horizontal;
24
- const commonStyles = {
25
- opacity: 0,
26
- maxHeight,
27
- transform: transforms[property],
28
- transitionDuration: `${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,
29
- transitionTimingFunction: "cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",
30
- transitionProperty: "opacity, transform, max-height"
31
- };
32
- const inState = {
33
- opacity: 1,
34
- transform: noTransform[property]
35
- };
36
- const outState = {
37
- opacity: 0,
38
- maxHeight: 0,
39
- transform: transforms[property]
40
- };
41
- const transitionStyles = {
42
- entering: inState,
43
- entered: inState,
44
- exiting: outState,
45
- exited: outState
46
- };
47
- return { ...commonStyles, ...transitionStyles[state] };
15
+ function getNotificationStateStyles({ state, maxHeight, position, transitionDuration }) {
16
+ const [vertical, horizontal] = position.split("-");
17
+ const property = horizontal === "center" ? `${vertical}-center` : horizontal;
18
+ const commonStyles = {
19
+ opacity: 0,
20
+ maxHeight,
21
+ transform: transforms[property],
22
+ transitionDuration: `${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,
23
+ transitionTimingFunction: "cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",
24
+ transitionProperty: "opacity, transform, max-height"
25
+ };
26
+ const inState = {
27
+ opacity: 1,
28
+ transform: noTransform[property]
29
+ };
30
+ const outState = {
31
+ opacity: 0,
32
+ maxHeight: 0,
33
+ transform: transforms[property]
34
+ };
35
+ const transitionStyles = {
36
+ entering: inState,
37
+ entered: inState,
38
+ exiting: outState,
39
+ exited: outState
40
+ };
41
+ return {
42
+ ...commonStyles,
43
+ ...transitionStyles[state]
44
+ };
48
45
  }
49
-
46
+ //#endregion
50
47
  exports.getNotificationStateStyles = getNotificationStateStyles;
51
- //# sourceMappingURL=get-notification-state-styles.cjs.map
48
+
49
+ //# sourceMappingURL=get-notification-state-styles.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-notification-state-styles.cjs","sources":["../src/get-notification-state-styles.ts"],"sourcesContent":["import { TransitionStatus } from 'react-transition-group';\nimport type { NotificationsProps } from './Notifications';\n\ninterface NotificationStateStylesProps {\n state: TransitionStatus;\n maxHeight: number | string;\n position: NotificationsProps['position'];\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 function getNotificationStateStyles({\n state,\n maxHeight,\n position,\n transitionDuration,\n}: NotificationStateStylesProps): React.CSSProperties {\n const [vertical, horizontal] = position!.split('-');\n const property = (\n horizontal === 'center' ? `${vertical}-center` : horizontal\n ) as keyof typeof transforms;\n\n const commonStyles: React.CSSProperties = {\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: React.CSSProperties = {\n opacity: 1,\n transform: noTransform[property],\n };\n\n const outState: React.CSSProperties = {\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 as keyof typeof transitionStyles] };\n}\n"],"names":[],"mappings":";;;AAUA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAA,CAAA,CAAA,CAAa,CAAA;AAAA,CAAA,CACjB,CAAA,CAAA,CAAA,CAAA,EAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACN,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACd,eAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACnB,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA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A,CAAA,CACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACT,MAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CACV,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAE,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAsC,CAAA,CAAA,CAAE,CAAA;AACxF,CAAA;;"}
1
+ {"version":3,"file":"get-notification-state-styles.cjs","names":[],"sources":["../src/get-notification-state-styles.ts"],"sourcesContent":["import { TransitionStatus } from 'react-transition-group';\nimport type { NotificationsProps } from './Notifications';\n\ninterface NotificationStateStylesProps {\n state: TransitionStatus;\n maxHeight: number | string;\n position: NotificationsProps['position'];\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 function getNotificationStateStyles({\n state,\n maxHeight,\n position,\n transitionDuration,\n}: NotificationStateStylesProps): React.CSSProperties {\n const [vertical, horizontal] = position!.split('-');\n const property = (\n horizontal === 'center' ? `${vertical}-center` : horizontal\n ) as keyof typeof transforms;\n\n const commonStyles: React.CSSProperties = {\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: React.CSSProperties = {\n opacity: 1,\n transform: noTransform[property],\n };\n\n const outState: React.CSSProperties = {\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 as keyof typeof transitionStyles] };\n}\n"],"mappings":";;AAUA,MAAM,aAAa;CACjB,MAAM;CACN,OAAO;CACP,cAAc;CACd,iBAAiB;CAClB;AAED,MAAM,cAAc;CAClB,MAAM;CACN,OAAO;CACP,cAAc;CACd,iBAAiB;CAClB;AAED,SAAgB,2BAA2B,EACzC,OACA,WACA,UACA,sBACoD;CACpD,MAAM,CAAC,UAAU,cAAc,SAAU,MAAM,IAAI;CACnD,MAAM,WACJ,eAAe,WAAW,GAAG,SAAS,WAAW;CAGnD,MAAM,eAAoC;EACxC,SAAS;EACT;EACA,WAAW,WAAW;EACtB,oBAAoB,GAAG,mBAAmB,MAAM,mBAAmB,MAAM,mBAAmB;EAC5F,0BAA0B;EAC1B,oBAAoB;EACrB;CAED,MAAM,UAA+B;EACnC,SAAS;EACT,WAAW,YAAY;EACxB;CAED,MAAM,WAAgC;EACpC,SAAS;EACT,WAAW;EACX,WAAW,WAAW;EACvB;CAED,MAAM,mBAAmB;EACvB,UAAU;EACV,SAAS;EACT,SAAS;EACT,QAAQ;EACT;AAED,QAAO;EAAE,GAAG;EAAc,GAAG,iBAAiB;EAAyC"}
package/cjs/index.cjs CHANGED
@@ -1,19 +1,14 @@
1
- 'use strict';
2
-
3
- var notifications_store = require('./notifications.store.cjs');
4
- var Notifications = require('./Notifications.cjs');
5
-
6
-
7
-
8
- exports.cleanNotifications = notifications_store.cleanNotifications;
9
- exports.cleanNotificationsQueue = notifications_store.cleanNotificationsQueue;
10
- exports.createNotificationsStore = notifications_store.createNotificationsStore;
11
- exports.hideNotification = notifications_store.hideNotification;
12
- exports.notifications = notifications_store.notifications;
13
- exports.notificationsStore = notifications_store.notificationsStore;
14
- exports.showNotification = notifications_store.showNotification;
15
- exports.updateNotification = notifications_store.updateNotification;
16
- exports.updateNotificationsState = notifications_store.updateNotificationsState;
17
- exports.useNotifications = notifications_store.useNotifications;
18
- exports.Notifications = Notifications.Notifications;
19
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_notifications_store = require("./notifications.store.cjs");
3
+ const require_Notifications = require("./Notifications.cjs");
4
+ exports.Notifications = require_Notifications.Notifications;
5
+ exports.cleanNotifications = require_notifications_store.cleanNotifications;
6
+ exports.cleanNotificationsQueue = require_notifications_store.cleanNotificationsQueue;
7
+ exports.createNotificationsStore = require_notifications_store.createNotificationsStore;
8
+ exports.hideNotification = require_notifications_store.hideNotification;
9
+ exports.notifications = require_notifications_store.notifications;
10
+ exports.notificationsStore = require_notifications_store.notificationsStore;
11
+ exports.showNotification = require_notifications_store.showNotification;
12
+ exports.updateNotification = require_notifications_store.updateNotification;
13
+ exports.updateNotificationsState = require_notifications_store.updateNotificationsState;
14
+ exports.useNotifications = require_notifications_store.useNotifications;
@@ -1,97 +1,87 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var hooks = require('@mantine/hooks');
5
- var store = require('@mantine/store');
6
-
1
+ "use client";
2
+ let _mantine_hooks = require("@mantine/hooks");
3
+ let _mantine_store = require("@mantine/store");
4
+ //#region packages/@mantine/notifications/src/notifications.store.ts
7
5
  function getDistributedNotifications(data, defaultPosition, limit) {
8
- const queue = [];
9
- const notifications2 = [];
10
- const count = {};
11
- for (const item of data) {
12
- const position = item.position || defaultPosition;
13
- count[position] = count[position] || 0;
14
- count[position] += 1;
15
- if (count[position] <= limit) {
16
- notifications2.push(item);
17
- } else {
18
- queue.push(item);
19
- }
20
- }
21
- return { notifications: notifications2, queue };
6
+ const queue = [];
7
+ const notifications = [];
8
+ const count = {};
9
+ for (const item of data) {
10
+ const position = item.position || defaultPosition;
11
+ count[position] = count[position] || 0;
12
+ count[position] += 1;
13
+ if (count[position] <= limit) notifications.push(item);
14
+ else queue.push(item);
15
+ }
16
+ return {
17
+ notifications,
18
+ queue
19
+ };
22
20
  }
23
- const createNotificationsStore = () => store.createStore({
24
- notifications: [],
25
- queue: [],
26
- defaultPosition: "bottom-right",
27
- limit: 5
21
+ const createNotificationsStore = () => (0, _mantine_store.createStore)({
22
+ notifications: [],
23
+ queue: [],
24
+ defaultPosition: "bottom-right",
25
+ limit: 5
28
26
  });
29
27
  const notificationsStore = createNotificationsStore();
30
- const useNotifications = (store$1 = notificationsStore) => store.useStore(store$1);
28
+ const useNotifications = (store = notificationsStore) => (0, _mantine_store.useStore)(store);
31
29
  function updateNotificationsState(store, update) {
32
- const state = store.getState();
33
- const notifications2 = update([...state.notifications, ...state.queue]);
34
- const updated = getDistributedNotifications(notifications2, state.defaultPosition, state.limit);
35
- store.setState({
36
- notifications: updated.notifications,
37
- queue: updated.queue,
38
- limit: state.limit,
39
- defaultPosition: state.defaultPosition
40
- });
30
+ const state = store.getState();
31
+ const updated = getDistributedNotifications(update([...state.notifications, ...state.queue]), state.defaultPosition, state.limit);
32
+ store.setState({
33
+ notifications: updated.notifications,
34
+ queue: updated.queue,
35
+ limit: state.limit,
36
+ defaultPosition: state.defaultPosition
37
+ });
41
38
  }
42
39
  function showNotification(notification, store = notificationsStore) {
43
- const id = notification.id || hooks.randomId();
44
- updateNotificationsState(store, (notifications2) => {
45
- if (notification.id && notifications2.some((n) => n.id === notification.id)) {
46
- return notifications2;
47
- }
48
- return [...notifications2, { ...notification, id }];
49
- });
50
- return id;
40
+ const id = notification.id || (0, _mantine_hooks.randomId)();
41
+ updateNotificationsState(store, (notifications) => {
42
+ if (notification.id && notifications.some((n) => n.id === notification.id)) return notifications;
43
+ return [...notifications, {
44
+ ...notification,
45
+ id
46
+ }];
47
+ });
48
+ return id;
51
49
  }
52
50
  function hideNotification(id, store = notificationsStore) {
53
- updateNotificationsState(
54
- store,
55
- (notifications2) => notifications2.filter((notification) => {
56
- if (notification.id === id) {
57
- notification.onClose?.(notification);
58
- return false;
59
- }
60
- return true;
61
- })
62
- );
63
- return id;
51
+ updateNotificationsState(store, (notifications) => notifications.filter((notification) => {
52
+ if (notification.id === id) {
53
+ notification.onClose?.(notification);
54
+ return false;
55
+ }
56
+ return true;
57
+ }));
58
+ return id;
64
59
  }
65
60
  function updateNotification(notification, store = notificationsStore) {
66
- updateNotificationsState(
67
- store,
68
- (notifications2) => notifications2.map((item) => {
69
- if (item.id === notification.id) {
70
- return { ...item, ...notification };
71
- }
72
- return item;
73
- })
74
- );
75
- return notification.id;
61
+ updateNotificationsState(store, (notifications) => notifications.map((item) => {
62
+ if (item.id === notification.id) return {
63
+ ...item,
64
+ ...notification
65
+ };
66
+ return item;
67
+ }));
68
+ return notification.id;
76
69
  }
77
70
  function cleanNotifications(store = notificationsStore) {
78
- updateNotificationsState(store, () => []);
71
+ updateNotificationsState(store, () => []);
79
72
  }
80
73
  function cleanNotificationsQueue(store = notificationsStore) {
81
- updateNotificationsState(
82
- store,
83
- (notifications2) => notifications2.slice(0, store.getState().limit)
84
- );
74
+ updateNotificationsState(store, (notifications) => notifications.slice(0, store.getState().limit));
85
75
  }
86
76
  const notifications = {
87
- show: showNotification,
88
- hide: hideNotification,
89
- update: updateNotification,
90
- clean: cleanNotifications,
91
- cleanQueue: cleanNotificationsQueue,
92
- updateState: updateNotificationsState
77
+ show: showNotification,
78
+ hide: hideNotification,
79
+ update: updateNotification,
80
+ clean: cleanNotifications,
81
+ cleanQueue: cleanNotificationsQueue,
82
+ updateState: updateNotificationsState
93
83
  };
94
-
84
+ //#endregion
95
85
  exports.cleanNotifications = cleanNotifications;
96
86
  exports.cleanNotificationsQueue = cleanNotificationsQueue;
97
87
  exports.createNotificationsStore = createNotificationsStore;
@@ -102,4 +92,5 @@ exports.showNotification = showNotification;
102
92
  exports.updateNotification = updateNotification;
103
93
  exports.updateNotificationsState = updateNotificationsState;
104
94
  exports.useNotifications = useNotifications;
105
- //# sourceMappingURL=notifications.store.cjs.map
95
+
96
+ //# sourceMappingURL=notifications.store.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.store.cjs","sources":["../src/notifications.store.ts"],"sourcesContent":["import { NotificationProps } from '@mantine/core';\nimport { randomId } from '@mantine/hooks';\nimport { createStore, MantineStore, useStore } from '@mantine/store';\n\nexport type NotificationPosition =\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\nexport interface NotificationData\n extends Omit<NotificationProps, 'onClose'>, Record<`data-${string}`, any> {\n /** Notification id, can be used to close or update notification */\n id?: string;\n\n /** Position of the notification, if not set, the position is determined based on `position` prop on Notifications component */\n position?: NotificationPosition;\n\n /** Notification message, required for all notifications */\n message: React.ReactNode;\n\n /** Determines whether notification should be closed automatically,\n * number is auto close timeout in ms, overrides `autoClose` from `Notifications`\n * */\n autoClose?: boolean | number;\n\n /** Called when notification closes */\n onClose?: (props: NotificationData) => void;\n\n /** Called when notification opens */\n onOpen?: (props: NotificationData) => void;\n}\n\nexport interface NotificationsState {\n notifications: NotificationData[];\n queue: NotificationData[];\n defaultPosition: NotificationPosition;\n limit: number;\n}\n\nexport type NotificationsStore = MantineStore<NotificationsState>;\n\nfunction getDistributedNotifications(\n data: NotificationData[],\n defaultPosition: NotificationPosition,\n limit: number\n) {\n const queue: NotificationData[] = [];\n const notifications: NotificationData[] = [];\n const count: Record<string, number> = {};\n\n for (const item of data) {\n const position = item.position || defaultPosition;\n count[position] = count[position] || 0;\n count[position] += 1;\n\n if (count[position] <= limit) {\n notifications.push(item);\n } else {\n queue.push(item);\n }\n }\n\n return { notifications, queue };\n}\n\nexport const createNotificationsStore = () =>\n createStore<NotificationsState>({\n notifications: [],\n queue: [],\n defaultPosition: 'bottom-right',\n limit: 5,\n });\n\nexport const notificationsStore = createNotificationsStore();\nexport const useNotifications = (store: NotificationsStore = notificationsStore) => useStore(store);\n\nexport function updateNotificationsState(\n store: NotificationsStore,\n update: (notifications: NotificationData[]) => NotificationData[]\n) {\n const state = store.getState();\n const notifications = update([...state.notifications, ...state.queue]);\n const updated = getDistributedNotifications(notifications, state.defaultPosition, state.limit);\n\n store.setState({\n notifications: updated.notifications,\n queue: updated.queue,\n limit: state.limit,\n defaultPosition: state.defaultPosition,\n });\n}\n\nexport function showNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n const id = notification.id || randomId();\n\n updateNotificationsState(store, (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\nexport function hideNotification(id: string, store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.filter((notification) => {\n if (notification.id === id) {\n notification.onClose?.(notification);\n return false;\n }\n\n return true;\n })\n );\n\n return id;\n}\n\nexport function updateNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n updateNotificationsState(store, (notifications) =>\n notifications.map((item) => {\n if (item.id === notification.id) {\n return { ...item, ...notification };\n }\n\n return item;\n })\n );\n\n return notification.id;\n}\n\nexport function cleanNotifications(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, () => []);\n}\n\nexport function cleanNotificationsQueue(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.slice(0, store.getState().limit)\n );\n}\n\nexport const notifications = {\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean: cleanNotifications,\n cleanQueue: cleanNotificationsQueue,\n updateState: updateNotificationsState,\n} as const;\n"],"names":["notifications","createStore","store","useStore","randomId"],"mappings":";;;;;;AA4CA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,2BAAA,CACP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AAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACR,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACZ,WAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACf,CAAA,CAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"notifications.store.cjs","names":[],"sources":["../src/notifications.store.ts"],"sourcesContent":["import { NotificationProps } from '@mantine/core';\nimport { randomId } from '@mantine/hooks';\nimport { createStore, MantineStore, useStore } from '@mantine/store';\n\nexport type NotificationPosition =\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\nexport interface NotificationData\n extends Omit<NotificationProps, 'onClose'>, Record<`data-${string}`, any> {\n /** Notification id, can be used to close or update notification */\n id?: string;\n\n /** Position of the notification, if not set, the position is determined based on `position` prop on Notifications component */\n position?: NotificationPosition;\n\n /** Notification message, required for all notifications */\n message: React.ReactNode;\n\n /** Determines whether notification should be closed automatically,\n * number is auto close timeout in ms, overrides `autoClose` from `Notifications`\n * */\n autoClose?: boolean | number;\n\n /** Called when notification closes */\n onClose?: (props: NotificationData) => void;\n\n /** Called when notification opens */\n onOpen?: (props: NotificationData) => void;\n}\n\nexport interface NotificationsState {\n notifications: NotificationData[];\n queue: NotificationData[];\n defaultPosition: NotificationPosition;\n limit: number;\n}\n\nexport type NotificationsStore = MantineStore<NotificationsState>;\n\nfunction getDistributedNotifications(\n data: NotificationData[],\n defaultPosition: NotificationPosition,\n limit: number\n) {\n const queue: NotificationData[] = [];\n const notifications: NotificationData[] = [];\n const count: Record<string, number> = {};\n\n for (const item of data) {\n const position = item.position || defaultPosition;\n count[position] = count[position] || 0;\n count[position] += 1;\n\n if (count[position] <= limit) {\n notifications.push(item);\n } else {\n queue.push(item);\n }\n }\n\n return { notifications, queue };\n}\n\nexport const createNotificationsStore = () =>\n createStore<NotificationsState>({\n notifications: [],\n queue: [],\n defaultPosition: 'bottom-right',\n limit: 5,\n });\n\nexport const notificationsStore = createNotificationsStore();\nexport const useNotifications = (store: NotificationsStore = notificationsStore) => useStore(store);\n\nexport function updateNotificationsState(\n store: NotificationsStore,\n update: (notifications: NotificationData[]) => NotificationData[]\n) {\n const state = store.getState();\n const notifications = update([...state.notifications, ...state.queue]);\n const updated = getDistributedNotifications(notifications, state.defaultPosition, state.limit);\n\n store.setState({\n notifications: updated.notifications,\n queue: updated.queue,\n limit: state.limit,\n defaultPosition: state.defaultPosition,\n });\n}\n\nexport function showNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n const id = notification.id || randomId();\n\n updateNotificationsState(store, (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\nexport function hideNotification(id: string, store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.filter((notification) => {\n if (notification.id === id) {\n notification.onClose?.(notification);\n return false;\n }\n\n return true;\n })\n );\n\n return id;\n}\n\nexport function updateNotification(\n notification: NotificationData,\n store: NotificationsStore = notificationsStore\n) {\n updateNotificationsState(store, (notifications) =>\n notifications.map((item) => {\n if (item.id === notification.id) {\n return { ...item, ...notification };\n }\n\n return item;\n })\n );\n\n return notification.id;\n}\n\nexport function cleanNotifications(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, () => []);\n}\n\nexport function cleanNotificationsQueue(store: NotificationsStore = notificationsStore) {\n updateNotificationsState(store, (notifications) =>\n notifications.slice(0, store.getState().limit)\n );\n}\n\nexport const notifications = {\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean: cleanNotifications,\n cleanQueue: cleanNotificationsQueue,\n updateState: updateNotificationsState,\n} as const;\n"],"mappings":";;;;AA4CA,SAAS,4BACP,MACA,iBACA,OACA;CACA,MAAM,QAA4B,EAAE;CACpC,MAAM,gBAAoC,EAAE;CAC5C,MAAM,QAAgC,EAAE;AAExC,MAAK,MAAM,QAAQ,MAAM;EACvB,MAAM,WAAW,KAAK,YAAY;AAClC,QAAM,YAAY,MAAM,aAAa;AACrC,QAAM,aAAa;AAEnB,MAAI,MAAM,aAAa,MACrB,eAAc,KAAK,KAAK;MAExB,OAAM,KAAK,KAAK;;AAIpB,QAAO;EAAE;EAAe;EAAO;;AAGjC,MAAa,kCAAA,GAAA,eAAA,aACqB;CAC9B,eAAe,EAAE;CACjB,OAAO,EAAE;CACT,iBAAiB;CACjB,OAAO;CACR,CAAC;AAEJ,MAAa,qBAAqB,0BAA0B;AAC5D,MAAa,oBAAoB,QAA4B,wBAAA,GAAA,eAAA,UAAgC,MAAM;AAEnG,SAAgB,yBACd,OACA,QACA;CACA,MAAM,QAAQ,MAAM,UAAU;CAE9B,MAAM,UAAU,4BADM,OAAO,CAAC,GAAG,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,EACX,MAAM,iBAAiB,MAAM,MAAM;AAE9F,OAAM,SAAS;EACb,eAAe,QAAQ;EACvB,OAAO,QAAQ;EACf,OAAO,MAAM;EACb,iBAAiB,MAAM;EACxB,CAAC;;AAGJ,SAAgB,iBACd,cACA,QAA4B,oBAC5B;CACA,MAAM,KAAK,aAAa,OAAA,GAAA,eAAA,WAAgB;AAExC,0BAAyB,QAAQ,kBAAkB;AACjD,MAAI,aAAa,MAAM,cAAc,MAAM,MAAM,EAAE,OAAO,aAAa,GAAG,CACxE,QAAO;AAGT,SAAO,CAAC,GAAG,eAAe;GAAE,GAAG;GAAc;GAAI,CAAC;GAClD;AAEF,QAAO;;AAGT,SAAgB,iBAAiB,IAAY,QAA4B,oBAAoB;AAC3F,0BAAyB,QAAQ,kBAC/B,cAAc,QAAQ,iBAAiB;AACrC,MAAI,aAAa,OAAO,IAAI;AAC1B,gBAAa,UAAU,aAAa;AACpC,UAAO;;AAGT,SAAO;GACP,CACH;AAED,QAAO;;AAGT,SAAgB,mBACd,cACA,QAA4B,oBAC5B;AACA,0BAAyB,QAAQ,kBAC/B,cAAc,KAAK,SAAS;AAC1B,MAAI,KAAK,OAAO,aAAa,GAC3B,QAAO;GAAE,GAAG;GAAM,GAAG;GAAc;AAGrC,SAAO;GACP,CACH;AAED,QAAO,aAAa;;AAGtB,SAAgB,mBAAmB,QAA4B,oBAAoB;AACjF,0BAAyB,aAAa,EAAE,CAAC;;AAG3C,SAAgB,wBAAwB,QAA4B,oBAAoB;AACtF,0BAAyB,QAAQ,kBAC/B,cAAc,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAC/C;;AAGH,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,aAAa;CACd"}
@@ -1,48 +1,54 @@
1
- 'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { useRef, useEffect } from 'react';
4
- import { Notification } from '@mantine/core';
5
- import { getAutoClose } from './get-auto-close/get-auto-close.mjs';
6
-
7
- function NotificationContainer({
8
- data,
9
- onHide,
10
- autoClose,
11
- ...others
12
- }) {
13
- const { autoClose: _autoClose, message, ...notificationProps } = data;
14
- const autoCloseDuration = getAutoClose(autoClose, data.autoClose);
15
- const autoCloseTimeout = useRef(-1);
16
- const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);
17
- const handleHide = () => {
18
- onHide(data.id);
19
- cancelAutoClose();
20
- };
21
- const handleAutoClose = () => {
22
- if (typeof autoCloseDuration === "number") {
23
- autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);
24
- }
25
- };
26
- useEffect(() => {
27
- data.onOpen?.(data);
28
- }, []);
29
- useEffect(() => {
30
- handleAutoClose();
31
- return cancelAutoClose;
32
- }, [autoCloseDuration]);
33
- return /* @__PURE__ */ jsx(
34
- Notification,
35
- {
36
- ...others,
37
- ...notificationProps,
38
- onClose: handleHide,
39
- onMouseEnter: cancelAutoClose,
40
- onMouseLeave: handleAutoClose,
41
- children: message
42
- }
43
- );
1
+ "use client";
2
+ import { getAutoClose } from "./get-auto-close/get-auto-close.mjs";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { Notification } from "@mantine/core";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region packages/@mantine/notifications/src/NotificationContainer.tsx
7
+ function NotificationContainer({ data, onHide, autoClose, paused, onHoverStart, onHoverEnd, ...others }) {
8
+ const { autoClose: _autoClose, message, ...notificationProps } = data;
9
+ const autoCloseDuration = getAutoClose(autoClose, data.autoClose);
10
+ const autoCloseTimeout = useRef(-1);
11
+ const [hovered, setHovered] = useState(false);
12
+ const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);
13
+ const handleHide = () => {
14
+ onHide(data.id);
15
+ cancelAutoClose();
16
+ };
17
+ const handleAutoClose = () => {
18
+ cancelAutoClose();
19
+ if (typeof autoCloseDuration === "number") autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);
20
+ };
21
+ const handleMouseEnter = () => {
22
+ setHovered(true);
23
+ onHoverStart?.();
24
+ };
25
+ const handleMouseLeave = () => {
26
+ setHovered(false);
27
+ onHoverEnd?.();
28
+ };
29
+ useEffect(() => {
30
+ data.onOpen?.(data);
31
+ }, []);
32
+ useEffect(() => {
33
+ handleAutoClose();
34
+ return cancelAutoClose;
35
+ }, [autoCloseDuration]);
36
+ useEffect(() => {
37
+ if (paused || hovered) cancelAutoClose();
38
+ else handleAutoClose();
39
+ return cancelAutoClose;
40
+ }, [paused, hovered]);
41
+ return /* @__PURE__ */ jsx(Notification, {
42
+ ...others,
43
+ ...notificationProps,
44
+ onClose: handleHide,
45
+ onMouseEnter: handleMouseEnter,
46
+ onMouseLeave: handleMouseLeave,
47
+ children: message
48
+ });
44
49
  }
45
50
  NotificationContainer.displayName = "@mantine/notifications/NotificationContainer";
46
-
51
+ //#endregion
47
52
  export { NotificationContainer };
48
- //# sourceMappingURL=NotificationContainer.mjs.map
53
+
54
+ //# sourceMappingURL=NotificationContainer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationContainer.mjs","sources":["../src/NotificationContainer.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { Notification, NotificationProps } from '@mantine/core';\nimport { getAutoClose } from './get-auto-close/get-auto-close';\nimport { NotificationData } from './notifications.store';\n\ninterface NotificationContainerProps extends NotificationProps {\n data: NotificationData;\n onHide: (id: string) => void;\n autoClose: number | false;\n}\n\nexport function NotificationContainer({\n data,\n onHide,\n autoClose,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: _autoClose, message, ...notificationProps } = data;\n const autoCloseDuration = getAutoClose(autoClose, data.autoClose);\n const autoCloseTimeout = useRef<number>(-1);\n\n const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);\n\n const handleHide = () => {\n onHide(data.id!);\n cancelAutoClose();\n };\n\n const handleAutoClose = () => {\n if (typeof autoCloseDuration === 'number') {\n autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);\n }\n };\n\n useEffect(() => {\n data.onOpen?.(data);\n }, []);\n\n useEffect(() => {\n handleAutoClose();\n return cancelAutoClose;\n }, [autoCloseDuration]);\n\n return (\n <Notification\n {...others}\n {...notificationProps}\n onClose={handleHide}\n onMouseEnter={cancelAutoClose}\n onMouseLeave={handleAutoClose}\n >\n {message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\n"],"names":[],"mappings":";;;;;;AAWO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,qBAAA,CAAsB,CAAA;AAAA,CAAA,CACpC,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACL,CAAA,CAAA,CAA+B,CAAA;AAC7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAkB,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA;AACjE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,SAAA,CAAA,CAAW,CAAA,CAAA,CAAA,C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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEb,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CACH,CAAA;AAEJ,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"NotificationContainer.mjs","names":[],"sources":["../src/NotificationContainer.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { Notification, NotificationProps } from '@mantine/core';\nimport { getAutoClose } from './get-auto-close/get-auto-close';\nimport { NotificationData } from './notifications.store';\n\ninterface NotificationContainerProps extends NotificationProps {\n data: NotificationData;\n onHide: (id: string) => void;\n autoClose: number | false;\n paused: boolean;\n onHoverStart?: () => void;\n onHoverEnd?: () => void;\n}\n\nexport function NotificationContainer({\n data,\n onHide,\n autoClose,\n paused,\n onHoverStart,\n onHoverEnd,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: _autoClose, message, ...notificationProps } = data;\n const autoCloseDuration = getAutoClose(autoClose, data.autoClose);\n const autoCloseTimeout = useRef<number>(-1);\n const [hovered, setHovered] = useState(false);\n\n const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);\n\n const handleHide = () => {\n onHide(data.id!);\n cancelAutoClose();\n };\n\n const handleAutoClose = () => {\n cancelAutoClose();\n if (typeof autoCloseDuration === 'number') {\n autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);\n }\n };\n\n const handleMouseEnter = () => {\n setHovered(true);\n onHoverStart?.();\n };\n\n const handleMouseLeave = () => {\n setHovered(false);\n onHoverEnd?.();\n };\n\n useEffect(() => {\n data.onOpen?.(data);\n }, []);\n\n useEffect(() => {\n handleAutoClose();\n return cancelAutoClose;\n }, [autoCloseDuration]);\n\n useEffect(() => {\n if (paused || hovered) {\n cancelAutoClose();\n } else {\n handleAutoClose();\n }\n\n return cancelAutoClose;\n }, [paused, hovered]);\n\n return (\n <Notification\n {...others}\n {...notificationProps}\n onClose={handleHide}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\n"],"mappings":";;;;;;AAcA,SAAgB,sBAAsB,EACpC,MACA,QACA,WACA,QACA,cACA,YACA,GAAG,UAC0B;CAC7B,MAAM,EAAE,WAAW,YAAY,SAAS,GAAG,sBAAsB;CACjE,MAAM,oBAAoB,aAAa,WAAW,KAAK,UAAU;CACjE,MAAM,mBAAmB,OAAe,GAAG;CAC3C,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,MAAM,wBAAwB,OAAO,aAAa,iBAAiB,QAAQ;CAE3E,MAAM,mBAAmB;AACvB,SAAO,KAAK,GAAI;AAChB,mBAAiB;;CAGnB,MAAM,wBAAwB;AAC5B,mBAAiB;AACjB,MAAI,OAAO,sBAAsB,SAC/B,kBAAiB,UAAU,OAAO,WAAW,YAAY,kBAAkB;;CAI/E,MAAM,yBAAyB;AAC7B,aAAW,KAAK;AAChB,kBAAgB;;CAGlB,MAAM,yBAAyB;AAC7B,aAAW,MAAM;AACjB,gBAAc;;AAGhB,iBAAgB;AACd,OAAK,SAAS,KAAK;IAClB,EAAE,CAAC;AAEN,iBAAgB;AACd,mBAAiB;AACjB,SAAO;IACN,CAAC,kBAAkB,CAAC;AAEvB,iBAAgB;AACd,MAAI,UAAU,QACZ,kBAAiB;MAEjB,kBAAiB;AAGnB,SAAO;IACN,CAAC,QAAQ,QAAQ,CAAC;AAErB,QACE,oBAAC,cAAD;EACE,GAAI;EACJ,GAAI;EACJ,SAAS;EACT,cAAc;EACd,cAAc;YAEb;EACY,CAAA;;AAInB,sBAAsB,cAAc"}