@mantine/notifications 5.2.5 → 5.3.0

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.
@@ -53,7 +53,7 @@ function NotificationContainer(_a) {
53
53
  "onHide",
54
54
  "innerRef"
55
55
  ]);
56
- const _a2 = notification, { autoClose: notificationAutoClose } = _a2, notificationProps = __objRest(_a2, ["autoClose"]);
56
+ const _a2 = notification, { autoClose: notificationAutoClose, message } = _a2, notificationProps = __objRest(_a2, ["autoClose", "message"]);
57
57
  const autoCloseTimeout = getAutoClose['default'](autoClose, notificationAutoClose);
58
58
  const hideTimeout = React.useRef();
59
59
  const handleHide = () => {
@@ -82,7 +82,7 @@ function NotificationContainer(_a) {
82
82
  onMouseEnter: cancelDelayedHide,
83
83
  onMouseLeave: handleDelayedHide,
84
84
  ref: innerRef
85
- }), notification.message);
85
+ }), message);
86
86
  }
87
87
  NotificationContainer.displayName = "@mantine/notifications/NotificationContainer";
88
88
 
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationContainer.js","sources":["../../src/NotificationContainer/NotificationContainer.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Notification, DefaultProps } from '@mantine/core';\nimport getAutoClose from './get-auto-close/get-auto-close';\nimport { NotificationProps } from '../types';\n\nexport interface NotificationContainerProps extends DefaultProps {\n notification: NotificationProps;\n onHide(id: string): void;\n autoClose: false | number;\n innerRef: React.ForwardedRef<HTMLDivElement>;\n}\n\nexport default function NotificationContainer({\n notification,\n autoClose,\n onHide,\n innerRef,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: notificationAutoClose, ...notificationProps } = notification;\n const autoCloseTimeout = getAutoClose(autoClose, notificationAutoClose);\n const hideTimeout = useRef<number>();\n\n const handleHide = () => {\n onHide(notification.id);\n window.clearTimeout(hideTimeout.current);\n };\n\n const cancelDelayedHide = () => {\n clearTimeout(hideTimeout.current);\n };\n\n const handleDelayedHide = () => {\n if (typeof autoCloseTimeout === 'number') {\n hideTimeout.current = window.setTimeout(handleHide, autoCloseTimeout);\n }\n };\n\n useEffect(() => {\n if (typeof notification.onOpen === 'function') {\n notification.onOpen(notification);\n }\n }, []);\n\n useEffect(() => {\n handleDelayedHide();\n return cancelDelayedHide;\n }, [autoClose, notification.autoClose]);\n\n return (\n <Notification\n {...notificationProps}\n {...others}\n onClose={handleHide}\n onMouseEnter={cancelDelayedHide}\n onMouseLeave={handleDelayedHide}\n ref={innerRef}\n >\n {notification.message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\n"],"names":["getAutoClose","useRef","useEffect","React","Notification"],"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,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AE,EAAE,CAAC,CAAC;AACT,EAAEA,eAAS,CAAC,MAAM;AAClB,IAAI,iBAAiB,EAAE,CAAC;AACxB,IAAI,OAAO,iBAAiB,CAAC;AAC7B,GAAG,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,iBAAY,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAAE;AACxI,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,GAAG,EAAE,QAAQ;AACjB,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
1
+ {"version":3,"file":"NotificationContainer.js","sources":["../../src/NotificationContainer/NotificationContainer.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Notification, DefaultProps } from '@mantine/core';\nimport getAutoClose from './get-auto-close/get-auto-close';\nimport { NotificationProps } from '../types';\n\nexport interface NotificationContainerProps extends DefaultProps {\n notification: NotificationProps;\n onHide(id: string): void;\n autoClose: false | number;\n innerRef: React.ForwardedRef<HTMLDivElement>;\n}\n\nexport default function NotificationContainer({\n notification,\n autoClose,\n onHide,\n innerRef,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: notificationAutoClose, message, ...notificationProps } = notification;\n const autoCloseTimeout = getAutoClose(autoClose, notificationAutoClose);\n const hideTimeout = useRef<number>();\n\n const handleHide = () => {\n onHide(notification.id);\n window.clearTimeout(hideTimeout.current);\n };\n\n const cancelDelayedHide = () => {\n clearTimeout(hideTimeout.current);\n };\n\n const handleDelayedHide = () => {\n if (typeof autoCloseTimeout === 'number') {\n hideTimeout.current = window.setTimeout(handleHide, autoCloseTimeout);\n }\n };\n\n useEffect(() => {\n if (typeof notification.onOpen === 'function') {\n notification.onOpen(notification);\n }\n }, []);\n\n useEffect(() => {\n handleDelayedHide();\n return cancelDelayedHide;\n }, [autoClose, notification.autoClose]);\n\n return (\n <Notification\n {...notificationProps}\n {...others}\n onClose={handleHide}\n onMouseEnter={cancelDelayedHide}\n onMouseLeave={handleDelayedHide}\n ref={innerRef}\n >\n {message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\n"],"names":["getAutoClose","useRef","useEffect","React","Notification"],"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,C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,EAAEA,eAAS,CAAC,MAAM;AAClB,IAAI,iBAAiB,EAAE,CAAC;AACxB,IAAI,OAAO,iBAAiB,CAAC;AAC7B,GAAG,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,iBAAY,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAAE;AACxI,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,GAAG,EAAE,QAAQ;AACjB,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACf,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
@@ -65,7 +65,8 @@ function NotificationsProvider(_a) {
65
65
  limit = 5,
66
66
  zIndex = core.getDefaultZIndex("overlay"),
67
67
  style,
68
- children
68
+ children,
69
+ target
69
70
  } = _b, others = __objRest(_b, [
70
71
  "className",
71
72
  "position",
@@ -76,7 +77,8 @@ function NotificationsProvider(_a) {
76
77
  "limit",
77
78
  "zIndex",
78
79
  "style",
79
- "children"
80
+ "children",
81
+ "target"
80
82
  ]);
81
83
  const forceUpdate = hooks.useForceUpdate();
82
84
  const refs = React.useRef({});
@@ -133,7 +135,9 @@ function NotificationsProvider(_a) {
133
135
  })));
134
136
  return /* @__PURE__ */ React__default.createElement(Notifications_context.NotificationsContext.Provider, {
135
137
  value: { notifications, queue }
136
- }, /* @__PURE__ */ React__default.createElement(core.Portal, null, /* @__PURE__ */ React__default.createElement(core.Box, __spreadValues({
138
+ }, /* @__PURE__ */ React__default.createElement(core.Portal, {
139
+ target
140
+ }, /* @__PURE__ */ React__default.createElement(core.Box, __spreadValues({
137
141
  className: cx(classes.notifications, className),
138
142
  style,
139
143
  sx: __spreadValues({
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsProvider.js","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\nimport { DefaultProps, Portal, MantineStyleSystemSize, getDefaultZIndex, Box } from '@mantine/core';\nimport { useReducedMotion, useForceUpdate, useDidUpdate } from '@mantine/hooks';\nimport { NotificationsContext } from '../Notifications.context';\nimport { NotificationsProviderPositioning } from '../types';\nimport { useNotificationsEvents } from '../events';\nimport getPositionStyles from './get-position-styles/get-position-styles';\nimport getNotificationStateStyles from './get-notification-state-styles/get-notification-state-styles';\nimport NotificationContainer from '../NotificationContainer/NotificationContainer';\nimport useStyles from './NotificationsProvider.styles';\nimport useNotificationsState from './use-notifications-state/use-notifications-state';\n\nconst POSITIONS = [\n 'top-left',\n 'top-right',\n 'top-center',\n 'bottom-left',\n 'bottom-right',\n 'bottom-center',\n] as const;\n\nexport interface NotificationProviderProps\n extends Omit<DefaultProps, MantineStyleSystemSize>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Notifications position */\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\n /** Auto close timeout for all notifications, false to disable auto close, can be overwritten for individual notifications by showNotification function */\n autoClose?: number | false;\n\n /** Notification transitions duration, 0 to turn transitions off */\n transitionDuration?: number;\n\n /** Notification width in px, cannot exceed 100% */\n containerWidth?: number;\n\n /** Notification max-height in px, used for transitions */\n notificationMaxHeight?: number;\n\n /** Maximum amount of notifications displayed at a time, other new notifications will be added to queue */\n limit?: number;\n\n /** Notifications container z-index */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Your application */\n children?: React.ReactNode;\n}\n\nexport function NotificationsProvider({\n className,\n position = 'bottom-right',\n autoClose = 4000,\n transitionDuration = 250,\n containerWidth = 440,\n notificationMaxHeight = 200,\n limit = 5,\n zIndex = getDefaultZIndex('overlay'),\n style,\n children,\n ...others\n}: NotificationProviderProps) {\n const forceUpdate = useForceUpdate();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n const {\n notifications,\n queue,\n showNotification,\n updateNotification,\n hideNotification,\n clean,\n cleanQueue,\n } = useNotificationsState({ limit });\n\n const { classes, cx, theme } = useStyles({ zIndex });\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n const positioning = (POSITIONS.includes(position) ? position : 'bottom-right').split(\n '-'\n ) as NotificationsProviderPositioning;\n\n useDidUpdate(() => {\n if (notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = notifications.length;\n }, [notifications]);\n\n useNotificationsEvents({\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean,\n cleanQueue,\n });\n\n const items = notifications.map((notification) => (\n <Transition\n key={notification.id}\n timeout={duration}\n onEnter={() => refs.current[notification.id].offsetHeight}\n nodeRef={{ current: refs.current[notification.id] }}\n >\n {(state) => (\n <NotificationContainer\n innerRef={(node) => {\n refs.current[notification.id] = node;\n }}\n notification={notification}\n onHide={hideNotification}\n className={classes.notification}\n autoClose={autoClose}\n sx={[\n {\n ...getNotificationStateStyles({\n state,\n positioning,\n transitionDuration: duration,\n maxHeight: notificationMaxHeight,\n }),\n },\n ...(Array.isArray(notification.sx) ? notification.sx : [notification.sx]),\n ]}\n />\n )}\n </Transition>\n ));\n\n return (\n <NotificationsContext.Provider value={{ notifications, queue }}>\n <Portal>\n <Box\n className={cx(classes.notifications, className)}\n style={style}\n sx={{\n maxWidth: containerWidth,\n ...getPositionStyles(positioning, containerWidth, theme.spacing.md),\n }}\n {...others}\n >\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </Portal>\n\n {children}\n </NotificationsContext.Provider>\n );\n}\n\nNotificationsProvider.displayName = '@mantine/notifications/NotificationsProvider';\n"],"names":["getDefaultZIndex","useForceUpdate","useRef","useNotificationsState","useStyles","useReducedMotion","useDidUpdate","useNotificationsEvents","React","Transition","NotificationContainer","getNotificationStateStyles","NotificationsContext","Portal","Box","getPositionStyles","TransitionGroup"],"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;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,IAAI,SA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T,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;AAC7E,KAAK;AACL,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,EAAE,uBAAuBH,cAAK,CAAC,aAAa,CAACI,0CAAoB,CAAC,QAAQ,EAAE;AAC5E,IAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;AACnC,GAAG,kBAAkBJ,cAAK,CAAC,aAAa,CAACK,WAAM,EAAE,IAAI,kBAAkBL,cAAK,CAAC,aAAa,CAACM,QAAG,EAAE,cAAc,CAAC;AAC/G,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;AACnD,IAAI,KAAK;AACT,IAAI,EAAE,EAAE,cAAc,CAAC;AACvB,MAAM,QAAQ,EAAE,cAAc;AAC9B,KAAK,EAAEC,4BAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACxE,GAAG,EAAE,MAAM,CAAC,kBAAkBP,cAAK,CAAC,aAAa,CAACQ,oCAAe,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC7F,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
1
+ {"version":3,"file":"NotificationsProvider.js","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\nimport {\n DefaultProps,\n Portal,\n MantineStyleSystemSize,\n getDefaultZIndex,\n Box,\n PortalProps,\n} from '@mantine/core';\nimport { useReducedMotion, useForceUpdate, useDidUpdate } from '@mantine/hooks';\nimport { NotificationsContext } from '../Notifications.context';\nimport { NotificationsProviderPositioning } from '../types';\nimport { useNotificationsEvents } from '../events';\nimport getPositionStyles from './get-position-styles/get-position-styles';\nimport getNotificationStateStyles from './get-notification-state-styles/get-notification-state-styles';\nimport NotificationContainer from '../NotificationContainer/NotificationContainer';\nimport useStyles from './NotificationsProvider.styles';\nimport useNotificationsState from './use-notifications-state/use-notifications-state';\n\nconst POSITIONS = [\n 'top-left',\n 'top-right',\n 'top-center',\n 'bottom-left',\n 'bottom-right',\n 'bottom-center',\n] as const;\n\nexport interface NotificationProviderProps\n extends Omit<DefaultProps, MantineStyleSystemSize>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Notifications position */\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\n /** Auto close timeout for all notifications, false to disable auto close, can be overwritten for individual notifications by showNotification function */\n autoClose?: number | false;\n\n /** Notification transitions duration, 0 to turn transitions off */\n transitionDuration?: number;\n\n /** Notification width in px, cannot exceed 100% */\n containerWidth?: number;\n\n /** Notification max-height in px, used for transitions */\n notificationMaxHeight?: number;\n\n /** Maximum amount of notifications displayed at a time, other new notifications will be added to queue */\n limit?: number;\n\n /** Notifications container z-index */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Target element of Portal component */\n target?: PortalProps['target'];\n}\n\nexport function NotificationsProvider({\n className,\n position = 'bottom-right',\n autoClose = 4000,\n transitionDuration = 250,\n containerWidth = 440,\n notificationMaxHeight = 200,\n limit = 5,\n zIndex = getDefaultZIndex('overlay'),\n style,\n children,\n target,\n ...others\n}: NotificationProviderProps) {\n const forceUpdate = useForceUpdate();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n const {\n notifications,\n queue,\n showNotification,\n updateNotification,\n hideNotification,\n clean,\n cleanQueue,\n } = useNotificationsState({ limit });\n\n const { classes, cx, theme } = useStyles({ zIndex });\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n const positioning = (POSITIONS.includes(position) ? position : 'bottom-right').split(\n '-'\n ) as NotificationsProviderPositioning;\n\n useDidUpdate(() => {\n if (notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = notifications.length;\n }, [notifications]);\n\n useNotificationsEvents({\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean,\n cleanQueue,\n });\n\n const items = notifications.map((notification) => (\n <Transition\n key={notification.id}\n timeout={duration}\n onEnter={() => refs.current[notification.id].offsetHeight}\n nodeRef={{ current: refs.current[notification.id] }}\n >\n {(state) => (\n <NotificationContainer\n innerRef={(node) => {\n refs.current[notification.id] = node;\n }}\n notification={notification}\n onHide={hideNotification}\n className={classes.notification}\n autoClose={autoClose}\n sx={[\n {\n ...getNotificationStateStyles({\n state,\n positioning,\n transitionDuration: duration,\n maxHeight: notificationMaxHeight,\n }),\n },\n ...(Array.isArray(notification.sx) ? notification.sx : [notification.sx]),\n ]}\n />\n )}\n </Transition>\n ));\n\n return (\n <NotificationsContext.Provider value={{ notifications, queue }}>\n <Portal target={target}>\n <Box\n className={cx(classes.notifications, className)}\n style={style}\n sx={{\n maxWidth: containerWidth,\n ...getPositionStyles(positioning, containerWidth, theme.spacing.md),\n }}\n {...others}\n >\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </Portal>\n\n {children}\n </NotificationsContext.Provider>\n );\n}\n\nNotificationsProvider.displayName = '@mantine/notifications/NotificationsProvider';\n"],"names":["getDefaultZIndex","useForceUpdate","useRef","useNotificationsState","useStyles","useReducedMotion","useDidUpdate","useNotificationsEvents","React","Transition","NotificationContainer","getNotificationStateStyles","NotificationsContext","Portal","Box","getPositionStyles","TransitionGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,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AAE;AAC5E,IAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;AACnC,GAAG,kBAAkBJ,cAAK,CAAC,aAAa,CAACK,WAAM,EAAE;AACjD,IAAI,MAAM;AACV,GAAG,kBAAkBL,cAAK,CAAC,aAAa,CAACM,QAAG,EAAE,cAAc,CAAC;AAC7D,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;AACnD,IAAI,KAAK;AACT,IAAI,EAAE,EAAE,cAAc,CAAC;AACvB,MAAM,QAAQ,EAAE,cAAc;AAC9B,KAAK,EAAEC,4BAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACxE,GAAG,EAAE,MAAM,CAAC,kBAAkBP,cAAK,CAAC,aAAa,CAACQ,oCAAe,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC7F,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
@@ -45,7 +45,7 @@ function NotificationContainer(_a) {
45
45
  "onHide",
46
46
  "innerRef"
47
47
  ]);
48
- const _a2 = notification, { autoClose: notificationAutoClose } = _a2, notificationProps = __objRest(_a2, ["autoClose"]);
48
+ const _a2 = notification, { autoClose: notificationAutoClose, message } = _a2, notificationProps = __objRest(_a2, ["autoClose", "message"]);
49
49
  const autoCloseTimeout = getAutoClose(autoClose, notificationAutoClose);
50
50
  const hideTimeout = useRef();
51
51
  const handleHide = () => {
@@ -74,7 +74,7 @@ function NotificationContainer(_a) {
74
74
  onMouseEnter: cancelDelayedHide,
75
75
  onMouseLeave: handleDelayedHide,
76
76
  ref: innerRef
77
- }), notification.message);
77
+ }), message);
78
78
  }
79
79
  NotificationContainer.displayName = "@mantine/notifications/NotificationContainer";
80
80
 
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationContainer.js","sources":["../../src/NotificationContainer/NotificationContainer.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Notification, DefaultProps } from '@mantine/core';\nimport getAutoClose from './get-auto-close/get-auto-close';\nimport { NotificationProps } from '../types';\n\nexport interface NotificationContainerProps extends DefaultProps {\n notification: NotificationProps;\n onHide(id: string): void;\n autoClose: false | number;\n innerRef: React.ForwardedRef<HTMLDivElement>;\n}\n\nexport default function NotificationContainer({\n notification,\n autoClose,\n onHide,\n innerRef,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: notificationAutoClose, ...notificationProps } = notification;\n const autoCloseTimeout = getAutoClose(autoClose, notificationAutoClose);\n const hideTimeout = useRef<number>();\n\n const handleHide = () => {\n onHide(notification.id);\n window.clearTimeout(hideTimeout.current);\n };\n\n const cancelDelayedHide = () => {\n clearTimeout(hideTimeout.current);\n };\n\n const handleDelayedHide = () => {\n if (typeof autoCloseTimeout === 'number') {\n hideTimeout.current = window.setTimeout(handleHide, autoCloseTimeout);\n }\n };\n\n useEffect(() => {\n if (typeof notification.onOpen === 'function') {\n notification.onOpen(notification);\n }\n }, []);\n\n useEffect(() => {\n handleDelayedHide();\n return cancelDelayedHide;\n }, [autoClose, notification.autoClose]);\n\n return (\n <Notification\n {...notificationProps}\n {...others}\n onClose={handleHide}\n onMouseEnter={cancelDelayedHide}\n onMouseLeave={handleDelayedHide}\n ref={innerRef}\n >\n {notification.message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\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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GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,MAAM;AAClC,IAAI,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AACtC,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,MAAM;AAClC,IAAI,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;AAC9C,MAAM,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AAC5E,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,UAAU,EAAE;AACnD,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACxC,KAAK;AACL,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,iBAAiB,EAAE,CAAC;AACxB,IAAI,OAAO,iBAAiB,CAAC;AAC7B,GAAG,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAAE;AACxI,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,GAAG,EAAE,QAAQ;AACjB,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
1
+ {"version":3,"file":"NotificationContainer.js","sources":["../../src/NotificationContainer/NotificationContainer.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Notification, DefaultProps } from '@mantine/core';\nimport getAutoClose from './get-auto-close/get-auto-close';\nimport { NotificationProps } from '../types';\n\nexport interface NotificationContainerProps extends DefaultProps {\n notification: NotificationProps;\n onHide(id: string): void;\n autoClose: false | number;\n innerRef: React.ForwardedRef<HTMLDivElement>;\n}\n\nexport default function NotificationContainer({\n notification,\n autoClose,\n onHide,\n innerRef,\n ...others\n}: NotificationContainerProps) {\n const { autoClose: notificationAutoClose, message, ...notificationProps } = notification;\n const autoCloseTimeout = getAutoClose(autoClose, notificationAutoClose);\n const hideTimeout = useRef<number>();\n\n const handleHide = () => {\n onHide(notification.id);\n window.clearTimeout(hideTimeout.current);\n };\n\n const cancelDelayedHide = () => {\n clearTimeout(hideTimeout.current);\n };\n\n const handleDelayedHide = () => {\n if (typeof autoCloseTimeout === 'number') {\n hideTimeout.current = window.setTimeout(handleHide, autoCloseTimeout);\n }\n };\n\n useEffect(() => {\n if (typeof notification.onOpen === 'function') {\n notification.onOpen(notification);\n }\n }, []);\n\n useEffect(() => {\n handleDelayedHide();\n return cancelDelayedHide;\n }, [autoClose, notification.autoClose]);\n\n return (\n <Notification\n {...notificationProps}\n {...others}\n onClose={handleHide}\n onMouseEnter={cancelDelayedHide}\n onMouseLeave={handleDelayedHide}\n ref={innerRef}\n >\n {message}\n </Notification>\n );\n}\n\nNotificationContainer.displayName = '@mantine/notifications/NotificationContainer';\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,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AAC,WAAW,CAAC,OAAO,CAAC,CAAC;AACtC,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,MAAM;AAClC,IAAI,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;AAC9C,MAAM,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AAC5E,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,UAAU,EAAE;AACnD,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACxC,KAAK;AACL,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,iBAAiB,EAAE,CAAC;AACxB,IAAI,OAAO,iBAAiB,CAAC;AAC7B,GAAG,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAAE;AACxI,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,YAAY,EAAE,iBAAiB;AACnC,IAAI,GAAG,EAAE,QAAQ;AACjB,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACf,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
@@ -57,7 +57,8 @@ function NotificationsProvider(_a) {
57
57
  limit = 5,
58
58
  zIndex = getDefaultZIndex("overlay"),
59
59
  style,
60
- children
60
+ children,
61
+ target
61
62
  } = _b, others = __objRest(_b, [
62
63
  "className",
63
64
  "position",
@@ -68,7 +69,8 @@ function NotificationsProvider(_a) {
68
69
  "limit",
69
70
  "zIndex",
70
71
  "style",
71
- "children"
72
+ "children",
73
+ "target"
72
74
  ]);
73
75
  const forceUpdate = useForceUpdate();
74
76
  const refs = useRef({});
@@ -125,7 +127,9 @@ function NotificationsProvider(_a) {
125
127
  })));
126
128
  return /* @__PURE__ */ React.createElement(NotificationsContext.Provider, {
127
129
  value: { notifications, queue }
128
- }, /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(Box, __spreadValues({
130
+ }, /* @__PURE__ */ React.createElement(Portal, {
131
+ target
132
+ }, /* @__PURE__ */ React.createElement(Box, __spreadValues({
129
133
  className: cx(classes.notifications, className),
130
134
  style,
131
135
  sx: __spreadValues({
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsProvider.js","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\nimport { DefaultProps, Portal, MantineStyleSystemSize, getDefaultZIndex, Box } from '@mantine/core';\nimport { useReducedMotion, useForceUpdate, useDidUpdate } from '@mantine/hooks';\nimport { NotificationsContext } from '../Notifications.context';\nimport { NotificationsProviderPositioning } from '../types';\nimport { useNotificationsEvents } from '../events';\nimport getPositionStyles from './get-position-styles/get-position-styles';\nimport getNotificationStateStyles from './get-notification-state-styles/get-notification-state-styles';\nimport NotificationContainer from '../NotificationContainer/NotificationContainer';\nimport useStyles from './NotificationsProvider.styles';\nimport useNotificationsState from './use-notifications-state/use-notifications-state';\n\nconst POSITIONS = [\n 'top-left',\n 'top-right',\n 'top-center',\n 'bottom-left',\n 'bottom-right',\n 'bottom-center',\n] as const;\n\nexport interface NotificationProviderProps\n extends Omit<DefaultProps, MantineStyleSystemSize>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Notifications position */\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\n /** Auto close timeout for all notifications, false to disable auto close, can be overwritten for individual notifications by showNotification function */\n autoClose?: number | false;\n\n /** Notification transitions duration, 0 to turn transitions off */\n transitionDuration?: number;\n\n /** Notification width in px, cannot exceed 100% */\n containerWidth?: number;\n\n /** Notification max-height in px, used for transitions */\n notificationMaxHeight?: number;\n\n /** Maximum amount of notifications displayed at a time, other new notifications will be added to queue */\n limit?: number;\n\n /** Notifications container z-index */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Your application */\n children?: React.ReactNode;\n}\n\nexport function NotificationsProvider({\n className,\n position = 'bottom-right',\n autoClose = 4000,\n transitionDuration = 250,\n containerWidth = 440,\n notificationMaxHeight = 200,\n limit = 5,\n zIndex = getDefaultZIndex('overlay'),\n style,\n children,\n ...others\n}: NotificationProviderProps) {\n const forceUpdate = useForceUpdate();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n const {\n notifications,\n queue,\n showNotification,\n updateNotification,\n hideNotification,\n clean,\n cleanQueue,\n } = useNotificationsState({ limit });\n\n const { classes, cx, theme } = useStyles({ zIndex });\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n const positioning = (POSITIONS.includes(position) ? position : 'bottom-right').split(\n '-'\n ) as NotificationsProviderPositioning;\n\n useDidUpdate(() => {\n if (notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = notifications.length;\n }, [notifications]);\n\n useNotificationsEvents({\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean,\n cleanQueue,\n });\n\n const items = notifications.map((notification) => (\n <Transition\n key={notification.id}\n timeout={duration}\n onEnter={() => refs.current[notification.id].offsetHeight}\n nodeRef={{ current: refs.current[notification.id] }}\n >\n {(state) => (\n <NotificationContainer\n innerRef={(node) => {\n refs.current[notification.id] = node;\n }}\n notification={notification}\n onHide={hideNotification}\n className={classes.notification}\n autoClose={autoClose}\n sx={[\n {\n ...getNotificationStateStyles({\n state,\n positioning,\n transitionDuration: duration,\n maxHeight: notificationMaxHeight,\n }),\n },\n ...(Array.isArray(notification.sx) ? notification.sx : [notification.sx]),\n ]}\n />\n )}\n </Transition>\n ));\n\n return (\n <NotificationsContext.Provider value={{ notifications, queue }}>\n <Portal>\n <Box\n className={cx(classes.notifications, className)}\n style={style}\n sx={{\n maxWidth: containerWidth,\n ...getPositionStyles(positioning, containerWidth, theme.spacing.md),\n }}\n {...others}\n >\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </Portal>\n\n {children}\n </NotificationsContext.Provider>\n );\n}\n\nNotificationsProvider.displayName = '@mantine/notifications/NotificationsProvider';\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;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,I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S,EAAE,OAAO,CAAC,YAAY;AACnC,IAAI,SAAS;AACb,IAAI,EAAE,EAAE;AACR,MAAM,cAAc,CAAC,EAAE,EAAE,0BAA0B,CAAC;AACpD,QAAQ,KAAK;AACb,QAAQ,WAAW;AACnB,QAAQ,kBAAkB,EAAE,QAAQ;AACpC,QAAQ,SAAS,EAAE,qBAAqB;AACxC,OAAO,CAAC,CAAC;AACT,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;AAC7E,KAAK;AACL,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE;AAC5E,IAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;AACnC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC;AAC/G,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;AACnD,IAAI,KAAK;AACT,IAAI,EAAE,EAAE,cAAc,CAAC;AACvB,MAAM,QAAQ,EAAE,cAAc;AAC9B,KAAK,EAAE,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACxE,GAAG,EAAE,MAAM,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC7F,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
1
+ {"version":3,"file":"NotificationsProvider.js","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\nimport {\n DefaultProps,\n Portal,\n MantineStyleSystemSize,\n getDefaultZIndex,\n Box,\n PortalProps,\n} from '@mantine/core';\nimport { useReducedMotion, useForceUpdate, useDidUpdate } from '@mantine/hooks';\nimport { NotificationsContext } from '../Notifications.context';\nimport { NotificationsProviderPositioning } from '../types';\nimport { useNotificationsEvents } from '../events';\nimport getPositionStyles from './get-position-styles/get-position-styles';\nimport getNotificationStateStyles from './get-notification-state-styles/get-notification-state-styles';\nimport NotificationContainer from '../NotificationContainer/NotificationContainer';\nimport useStyles from './NotificationsProvider.styles';\nimport useNotificationsState from './use-notifications-state/use-notifications-state';\n\nconst POSITIONS = [\n 'top-left',\n 'top-right',\n 'top-center',\n 'bottom-left',\n 'bottom-right',\n 'bottom-center',\n] as const;\n\nexport interface NotificationProviderProps\n extends Omit<DefaultProps, MantineStyleSystemSize>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Notifications position */\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n\n /** Auto close timeout for all notifications, false to disable auto close, can be overwritten for individual notifications by showNotification function */\n autoClose?: number | false;\n\n /** Notification transitions duration, 0 to turn transitions off */\n transitionDuration?: number;\n\n /** Notification width in px, cannot exceed 100% */\n containerWidth?: number;\n\n /** Notification max-height in px, used for transitions */\n notificationMaxHeight?: number;\n\n /** Maximum amount of notifications displayed at a time, other new notifications will be added to queue */\n limit?: number;\n\n /** Notifications container z-index */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Target element of Portal component */\n target?: PortalProps['target'];\n}\n\nexport function NotificationsProvider({\n className,\n position = 'bottom-right',\n autoClose = 4000,\n transitionDuration = 250,\n containerWidth = 440,\n notificationMaxHeight = 200,\n limit = 5,\n zIndex = getDefaultZIndex('overlay'),\n style,\n children,\n target,\n ...others\n}: NotificationProviderProps) {\n const forceUpdate = useForceUpdate();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n const {\n notifications,\n queue,\n showNotification,\n updateNotification,\n hideNotification,\n clean,\n cleanQueue,\n } = useNotificationsState({ limit });\n\n const { classes, cx, theme } = useStyles({ zIndex });\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n const positioning = (POSITIONS.includes(position) ? position : 'bottom-right').split(\n '-'\n ) as NotificationsProviderPositioning;\n\n useDidUpdate(() => {\n if (notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = notifications.length;\n }, [notifications]);\n\n useNotificationsEvents({\n show: showNotification,\n hide: hideNotification,\n update: updateNotification,\n clean,\n cleanQueue,\n });\n\n const items = notifications.map((notification) => (\n <Transition\n key={notification.id}\n timeout={duration}\n onEnter={() => refs.current[notification.id].offsetHeight}\n nodeRef={{ current: refs.current[notification.id] }}\n >\n {(state) => (\n <NotificationContainer\n innerRef={(node) => {\n refs.current[notification.id] = node;\n }}\n notification={notification}\n onHide={hideNotification}\n className={classes.notification}\n autoClose={autoClose}\n sx={[\n {\n ...getNotificationStateStyles({\n state,\n positioning,\n transitionDuration: duration,\n maxHeight: notificationMaxHeight,\n }),\n },\n ...(Array.isArray(notification.sx) ? notification.sx : [notification.sx]),\n ]}\n />\n )}\n </Transition>\n ));\n\n return (\n <NotificationsContext.Provider value={{ notifications, queue }}>\n <Portal target={target}>\n <Box\n className={cx(classes.notifications, className)}\n style={style}\n sx={{\n maxWidth: containerWidth,\n ...getPositionStyles(positioning, containerWidth, theme.spacing.md),\n }}\n {...others}\n >\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </Portal>\n\n {children}\n </NotificationsContext.Provider>\n );\n}\n\nNotificationsProvider.displayName = '@mantine/notifications/NotificationsProvider';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;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C;AACP,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,QAAQ,EAAE;AAC5E,IAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;AACnC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AACjD,IAAI,MAAM;AACV,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC;AAC7D,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;AACnD,IAAI,KAAK;AACT,IAAI,EAAE,EAAE,cAAc,CAAC;AACvB,MAAM,QAAQ,EAAE,cAAc;AAC9B,KAAK,EAAE,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACxE,GAAG,EAAE,MAAM,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC7F,CAAC;AACD,qBAAqB,CAAC,WAAW,GAAG,8CAA8C;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DefaultProps, MantineStyleSystemSize } from '@mantine/core';
2
+ import { DefaultProps, MantineStyleSystemSize, PortalProps } from '@mantine/core';
3
3
  export interface NotificationProviderProps extends Omit<DefaultProps, MantineStyleSystemSize>, React.ComponentPropsWithoutRef<'div'> {
4
4
  /** Notifications position */
5
5
  position?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
@@ -17,8 +17,10 @@ export interface NotificationProviderProps extends Omit<DefaultProps, MantineSty
17
17
  zIndex?: React.CSSProperties['zIndex'];
18
18
  /** Your application */
19
19
  children?: React.ReactNode;
20
+ /** Target element of Portal component */
21
+ target?: PortalProps['target'];
20
22
  }
21
- export declare function NotificationsProvider({ className, position, autoClose, transitionDuration, containerWidth, notificationMaxHeight, limit, zIndex, style, children, ...others }: NotificationProviderProps): JSX.Element;
23
+ export declare function NotificationsProvider({ className, position, autoClose, transitionDuration, containerWidth, notificationMaxHeight, limit, zIndex, style, children, target, ...others }: NotificationProviderProps): JSX.Element;
22
24
  export declare namespace NotificationsProvider {
23
25
  var displayName: string;
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsProvider.d.ts","sourceRoot":"","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAU,sBAAsB,EAAyB,MAAM,eAAe,CAAC;AAoBpG,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,YAAY,EAAE,sBAAsB,CAAC,EAChD,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,0JAA0J;IAC1J,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE3B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,0DAA0D;IAC1D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,0GAA0G;IAC1G,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sCAAsC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEvC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAyB,EACzB,SAAgB,EAChB,kBAAwB,EACxB,cAAoB,EACpB,qBAA2B,EAC3B,KAAS,EACT,MAAoC,EACpC,KAAK,EACL,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,yBAAyB,eAwF3B;yBApGe,qBAAqB"}
1
+ {"version":3,"file":"NotificationsProvider.d.ts","sourceRoot":"","sources":["../../src/NotificationsProvider/NotificationsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EACL,YAAY,EAEZ,sBAAsB,EAGtB,WAAW,EACZ,MAAM,eAAe,CAAC;AAoBvB,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,YAAY,EAAE,sBAAsB,CAAC,EAChD,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,0JAA0J;IAC1J,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE3B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,0DAA0D;IAC1D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,0GAA0G;IAC1G,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sCAAsC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEvC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAChC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAyB,EACzB,SAAgB,EAChB,kBAAwB,EACxB,cAAoB,EACpB,qBAA2B,EAC3B,KAAS,EACT,MAAoC,EACpC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAG,MAAM,EACV,EAAE,yBAAyB,eAwF3B;yBArGe,qBAAqB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mantine/notifications",
3
3
  "description": "Notification system based on Mantine components",
4
- "version": "5.2.5",
4
+ "version": "5.3.0",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -28,14 +28,14 @@
28
28
  "notification-system"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@mantine/core": "5.2.5",
32
- "@mantine/hooks": "5.2.5",
31
+ "@mantine/core": "5.3.0",
32
+ "@mantine/hooks": "5.3.0",
33
33
  "react": ">=16.8.0",
34
34
  "react-dom": ">=16.8.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "react-transition-group": "4.4.2",
38
- "@mantine/utils": "5.2.5"
38
+ "@mantine/utils": "5.3.0"
39
39
  },
40
40
  "devDependencies": {}
41
41
  }