@mantine/notifications 7.1.2 → 7.1.3
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.
- package/cjs/Notifications.js +30 -27
- package/cjs/Notifications.js.map +1 -1
- package/esm/Notifications.mjs +31 -28
- package/esm/Notifications.mjs.map +1 -1
- package/lib/Notifications.d.ts.map +1 -1
- package/package.json +4 -4
package/cjs/Notifications.js
CHANGED
|
@@ -138,33 +138,36 @@ const Notifications = core.factory((_props, ref) => {
|
|
|
138
138
|
}
|
|
139
139
|
previousLength.current = data.notifications.length;
|
|
140
140
|
}, [data.notifications]);
|
|
141
|
-
const items = data.notifications.map((
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
141
|
+
const items = data.notifications.map((_b) => {
|
|
142
|
+
var _c = _b, { style: notificationStyle } = _c, notification = __objRest(_c, ["style"]);
|
|
143
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
144
|
+
Transition,
|
|
145
|
+
{
|
|
146
|
+
key: notification.id,
|
|
147
|
+
timeout: duration,
|
|
148
|
+
onEnter: () => refs.current[notification.id].offsetHeight,
|
|
149
|
+
nodeRef: { current: refs.current[notification.id] }
|
|
150
|
+
},
|
|
151
|
+
(state) => /* @__PURE__ */ React__default.createElement(
|
|
152
|
+
NotificationContainer.NotificationContainer,
|
|
153
|
+
__spreadValues({
|
|
154
|
+
ref: (node) => {
|
|
155
|
+
refs.current[notification.id] = node;
|
|
156
|
+
},
|
|
157
|
+
data: notification,
|
|
158
|
+
onHide: (id) => notifications_store.hideNotification(id, store),
|
|
159
|
+
autoClose
|
|
160
|
+
}, getStyles("notification", {
|
|
161
|
+
style: __spreadValues(__spreadValues({}, getNotificationStateStyles.getNotificationStateStyles({
|
|
162
|
+
state,
|
|
163
|
+
position,
|
|
164
|
+
transitionDuration: duration,
|
|
165
|
+
maxHeight: notificationMaxHeight
|
|
166
|
+
})), notificationStyle)
|
|
167
|
+
}))
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
});
|
|
168
171
|
return /* @__PURE__ */ React__default.createElement(core.OptionalPortal, __spreadValues({ withinPortal }, portalProps), /* @__PURE__ */ React__default.createElement(core.Box, __spreadValues(__spreadProps(__spreadValues({}, getStyles("root")), { ref }), others), /* @__PURE__ */ React__default.createElement(reactTransitionGroup.TransitionGroup, null, items)));
|
|
169
172
|
});
|
|
170
173
|
Notifications.classes = Notifications_module['default'];
|
package/cjs/Notifications.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sources":["../src/Notifications.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {\n Transition as _Transition,\n TransitionGroup,\n TransitionStatus,\n} from 'react-transition-group';\nimport { useForceUpdate, useDidUpdate, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n PortalProps,\n getDefaultZIndex,\n useMantineTheme,\n OptionalPortal,\n rem,\n} from '@mantine/core';\nimport {\n useNotifications,\n NotificationsStore,\n notificationsStore,\n hideNotification,\n notifications,\n} from './notifications.store';\nimport { NotificationContainer } from './NotificationContainer';\nimport { getNotificationStateStyles } from './get-notification-state-styles';\nimport classes from './Notifications.module.css';\n\nconst Transition: any = _Transition;\n\nexport type NotificationsStylesNames = 'root' | 'notification';\nexport type NotificationsCssVariables = {\n root:\n | '--notifications-z-index'\n | '--notifications-top'\n | '--notifications-right'\n | '--notifications-left'\n | '--notifications-left'\n | '--notifications-transform'\n | '--notifications-container-width';\n};\n\nexport interface NotificationsProps\n extends BoxProps,\n StylesApiProps<NotificationsFactory>,\n ElementProps<'div'> {\n /** Notifications position, `'bottom-right'` by default */\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 in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function, `4000` by defualt */\n autoClose?: number | false;\n\n /** Notification transition duration in ms, `250` by default */\n transitionDuration?: number;\n\n /** Notification width, cannot exceed 100%, `440` by default */\n containerWidth?: number | string;\n\n /** Notification `max-height`, used for transitions, `200` by default */\n notificationMaxHeight?: number | string;\n\n /** Maximum number of notifications displayed at a time, other new notifications will be added to queue, `5` by default */\n limit?: number;\n\n /** Notifications container z-index, `400` by default */\n zIndex?: string | number;\n\n /** Props passed down to the `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Store for notifications state, can be used to create multiple instances of notifications system in your application */\n store?: NotificationsStore;\n\n /** Determines whether notifications container should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n}\n\nexport type NotificationsFactory = Factory<{\n props: NotificationsProps;\n ref: HTMLDivElement;\n stylesNames: NotificationsStylesNames;\n vars: NotificationsCssVariables;\n staticComponents: {\n show: typeof notifications.show;\n hide: typeof notifications.hide;\n update: typeof notifications.update;\n clean: typeof notifications.clean;\n cleanQueue: typeof notifications.cleanQueue;\n updateState: typeof notifications.updateState;\n };\n}>;\n\nconst defaultProps: Partial<NotificationsProps> = {\n position: 'bottom-right',\n autoClose: 4000,\n transitionDuration: 250,\n containerWidth: 440,\n notificationMaxHeight: 200,\n limit: 5,\n zIndex: getDefaultZIndex('overlay'),\n store: notificationsStore,\n withinPortal: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationsFactory>(\n (_, { zIndex, position, containerWidth }) => {\n const [vertical, horizontal] = position!.split('-');\n\n return {\n root: {\n '--notifications-z-index': zIndex?.toString(),\n '--notifications-top': vertical === 'top' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-bottom': vertical === 'bottom' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-left':\n horizontal === 'left'\n ? 'var(--mantine-spacing-md)'\n : horizontal === 'center'\n ? '50%'\n : undefined,\n '--notifications-right': horizontal === 'right' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-transform': horizontal === 'center' ? 'translateX(-50%)' : undefined,\n '--notifications-container-width': rem(containerWidth),\n },\n };\n }\n);\n\nexport const Notifications = factory<NotificationsFactory>((_props, ref) => {\n const props = useProps('Notifications', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n position,\n autoClose,\n transitionDuration,\n containerWidth,\n notificationMaxHeight,\n limit,\n zIndex,\n store,\n portalProps,\n withinPortal,\n ...others\n } = props;\n\n const theme = useMantineTheme();\n const data = useNotifications(store);\n const forceUpdate = useForceUpdate();\n const shouldReduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n\n const getStyles = useStyles<NotificationsFactory>({\n name: 'Notifications',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n useDidUpdate(() => {\n if (data.notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = data.notifications.length;\n }, [data.notifications]);\n\n const items = data.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: TransitionStatus) => (\n <NotificationContainer\n {...getStyles('notification', {\n style: getNotificationStateStyles({\n state,\n position,\n transitionDuration: duration!,\n maxHeight: notificationMaxHeight!,\n }),\n })}\n ref={(node) => {\n refs.current[notification.id!] = node!;\n }}\n data={notification}\n onHide={(id) => hideNotification(id, store)}\n autoClose={autoClose!}\n />\n )}\n </Transition>\n ));\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Box {...getStyles('root')} ref={ref} {...others}>\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </OptionalPortal>\n );\n});\n\nNotifications.classes = classes;\nNotifications.displayName = '@mantine/notifications/Notifications';\nNotifications.show = notifications.show;\nNotifications.hide = notifications.hide;\nNotifications.update = notifications.update;\nNotifications.clean = notifications.clean;\nNotifications.cleanQueue = notifications.cleanQueue;\nNotifications.updateState = notifications.updateState;\n"],"names":["_Transition","getDefaultZIndex","notificationsStore","createVarsResolver","rem","factory","useProps","useMantineTheme","useNotifications","useForceUpdate","useReducedMotion","useRef","useStyles","classes","useDidUpdate","React","NotificationContainer","getNotificationStateStyles","hideNotification","OptionalPortal","Box","TransitionGroup","notifications"],"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,C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AC,IAAI,CAAC;AACxC,aAAa,CAAC,IAAI,GAAGA,iCAAa,CAAC,IAAI,CAAC;AACxC,aAAa,CAAC,MAAM,GAAGA,iCAAa,CAAC,MAAM,CAAC;AAC5C,aAAa,CAAC,KAAK,GAAGA,iCAAa,CAAC,KAAK,CAAC;AAC1C,aAAa,CAAC,UAAU,GAAGA,iCAAa,CAAC,UAAU,CAAC;AACpD,aAAa,CAAC,WAAW,GAAGA,iCAAa,CAAC,WAAW;;"}
|
|
1
|
+
{"version":3,"file":"Notifications.js","sources":["../src/Notifications.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {\n Transition as _Transition,\n TransitionGroup,\n TransitionStatus,\n} from 'react-transition-group';\nimport { useForceUpdate, useDidUpdate, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n PortalProps,\n getDefaultZIndex,\n useMantineTheme,\n OptionalPortal,\n rem,\n} from '@mantine/core';\nimport {\n useNotifications,\n NotificationsStore,\n notificationsStore,\n hideNotification,\n notifications,\n} from './notifications.store';\nimport { NotificationContainer } from './NotificationContainer';\nimport { getNotificationStateStyles } from './get-notification-state-styles';\nimport classes from './Notifications.module.css';\n\nconst Transition: any = _Transition;\n\nexport type NotificationsStylesNames = 'root' | 'notification';\nexport type NotificationsCssVariables = {\n root:\n | '--notifications-z-index'\n | '--notifications-top'\n | '--notifications-right'\n | '--notifications-left'\n | '--notifications-left'\n | '--notifications-transform'\n | '--notifications-container-width';\n};\n\nexport interface NotificationsProps\n extends BoxProps,\n StylesApiProps<NotificationsFactory>,\n ElementProps<'div'> {\n /** Notifications position, `'bottom-right'` by default */\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 in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function, `4000` by defualt */\n autoClose?: number | false;\n\n /** Notification transition duration in ms, `250` by default */\n transitionDuration?: number;\n\n /** Notification width, cannot exceed 100%, `440` by default */\n containerWidth?: number | string;\n\n /** Notification `max-height`, used for transitions, `200` by default */\n notificationMaxHeight?: number | string;\n\n /** Maximum number of notifications displayed at a time, other new notifications will be added to queue, `5` by default */\n limit?: number;\n\n /** Notifications container z-index, `400` by default */\n zIndex?: string | number;\n\n /** Props passed down to the `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Store for notifications state, can be used to create multiple instances of notifications system in your application */\n store?: NotificationsStore;\n\n /** Determines whether notifications container should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n}\n\nexport type NotificationsFactory = Factory<{\n props: NotificationsProps;\n ref: HTMLDivElement;\n stylesNames: NotificationsStylesNames;\n vars: NotificationsCssVariables;\n staticComponents: {\n show: typeof notifications.show;\n hide: typeof notifications.hide;\n update: typeof notifications.update;\n clean: typeof notifications.clean;\n cleanQueue: typeof notifications.cleanQueue;\n updateState: typeof notifications.updateState;\n };\n}>;\n\nconst defaultProps: Partial<NotificationsProps> = {\n position: 'bottom-right',\n autoClose: 4000,\n transitionDuration: 250,\n containerWidth: 440,\n notificationMaxHeight: 200,\n limit: 5,\n zIndex: getDefaultZIndex('overlay'),\n store: notificationsStore,\n withinPortal: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationsFactory>(\n (_, { zIndex, position, containerWidth }) => {\n const [vertical, horizontal] = position!.split('-');\n\n return {\n root: {\n '--notifications-z-index': zIndex?.toString(),\n '--notifications-top': vertical === 'top' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-bottom': vertical === 'bottom' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-left':\n horizontal === 'left'\n ? 'var(--mantine-spacing-md)'\n : horizontal === 'center'\n ? '50%'\n : undefined,\n '--notifications-right': horizontal === 'right' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-transform': horizontal === 'center' ? 'translateX(-50%)' : undefined,\n '--notifications-container-width': rem(containerWidth),\n },\n };\n }\n);\n\nexport const Notifications = factory<NotificationsFactory>((_props, ref) => {\n const props = useProps('Notifications', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n position,\n autoClose,\n transitionDuration,\n containerWidth,\n notificationMaxHeight,\n limit,\n zIndex,\n store,\n portalProps,\n withinPortal,\n ...others\n } = props;\n\n const theme = useMantineTheme();\n const data = useNotifications(store);\n const forceUpdate = useForceUpdate();\n const shouldReduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n\n const getStyles = useStyles<NotificationsFactory>({\n name: 'Notifications',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n useDidUpdate(() => {\n if (data.notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = data.notifications.length;\n }, [data.notifications]);\n\n const items = data.notifications.map(({ style: notificationStyle, ...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: TransitionStatus) => (\n <NotificationContainer\n ref={(node) => {\n refs.current[notification.id!] = node!;\n }}\n data={notification}\n onHide={(id) => hideNotification(id, store)}\n autoClose={autoClose!}\n {...getStyles('notification', {\n style: {\n ...getNotificationStateStyles({\n state,\n position,\n transitionDuration: duration!,\n maxHeight: notificationMaxHeight!,\n }),\n ...notificationStyle,\n },\n })}\n />\n )}\n </Transition>\n ));\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Box {...getStyles('root')} ref={ref} {...others}>\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </OptionalPortal>\n );\n});\n\nNotifications.classes = classes;\nNotifications.displayName = '@mantine/notifications/Notifications';\nNotifications.show = notifications.show;\nNotifications.hide = notifications.hide;\nNotifications.update = notifications.update;\nNotifications.clean = notifications.clean;\nNotifications.cleanQueue = notifications.cleanQueue;\nNotifications.updateState = notifications.updateState;\n"],"names":["_Transition","getDefaultZIndex","notificationsStore","createVarsResolver","rem","factory","useProps","useMantineTheme","useNotifications","useForceUpdate","useReducedMotion","useRef","useStyles","classes","useDidUpdate","React","NotificationContainer","hideNotification","getNotificationStateStyles","OptionalPortal","Box","TransitionGroup","notifications"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,m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AAa,CAAC,IAAI,GAAGA,iCAAa,CAAC,IAAI,CAAC;AACxC,aAAa,CAAC,MAAM,GAAGA,iCAAa,CAAC,MAAM,CAAC;AAC5C,aAAa,CAAC,KAAK,GAAGA,iCAAa,CAAC,KAAK,CAAC;AAC1C,aAAa,CAAC,UAAU,GAAGA,iCAAa,CAAC,UAAU,CAAC;AACpD,aAAa,CAAC,WAAW,GAAGA,iCAAa,CAAC,WAAW;;"}
|
package/esm/Notifications.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useRef } from 'react';
|
|
|
3
3
|
import { TransitionGroup, Transition as Transition$1 } from 'react-transition-group';
|
|
4
4
|
import { useForceUpdate, useReducedMotion, useDidUpdate } from '@mantine/hooks';
|
|
5
5
|
import { getDefaultZIndex, createVarsResolver, rem, factory, useProps, useMantineTheme, useStyles, OptionalPortal, Box } from '@mantine/core';
|
|
6
|
-
import { notificationsStore, useNotifications,
|
|
6
|
+
import { notificationsStore, useNotifications, hideNotification, notifications } from './notifications.store.mjs';
|
|
7
7
|
import { NotificationContainer } from './NotificationContainer.mjs';
|
|
8
8
|
import { getNotificationStateStyles } from './get-notification-state-styles.mjs';
|
|
9
9
|
import classes from './Notifications.module.mjs';
|
|
@@ -130,33 +130,36 @@ const Notifications = factory((_props, ref) => {
|
|
|
130
130
|
}
|
|
131
131
|
previousLength.current = data.notifications.length;
|
|
132
132
|
}, [data.notifications]);
|
|
133
|
-
const items = data.notifications.map((
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
133
|
+
const items = data.notifications.map((_b) => {
|
|
134
|
+
var _c = _b, { style: notificationStyle } = _c, notification = __objRest(_c, ["style"]);
|
|
135
|
+
return /* @__PURE__ */ React.createElement(
|
|
136
|
+
Transition,
|
|
137
|
+
{
|
|
138
|
+
key: notification.id,
|
|
139
|
+
timeout: duration,
|
|
140
|
+
onEnter: () => refs.current[notification.id].offsetHeight,
|
|
141
|
+
nodeRef: { current: refs.current[notification.id] }
|
|
142
|
+
},
|
|
143
|
+
(state) => /* @__PURE__ */ React.createElement(
|
|
144
|
+
NotificationContainer,
|
|
145
|
+
__spreadValues({
|
|
146
|
+
ref: (node) => {
|
|
147
|
+
refs.current[notification.id] = node;
|
|
148
|
+
},
|
|
149
|
+
data: notification,
|
|
150
|
+
onHide: (id) => hideNotification(id, store),
|
|
151
|
+
autoClose
|
|
152
|
+
}, getStyles("notification", {
|
|
153
|
+
style: __spreadValues(__spreadValues({}, getNotificationStateStyles({
|
|
154
|
+
state,
|
|
155
|
+
position,
|
|
156
|
+
transitionDuration: duration,
|
|
157
|
+
maxHeight: notificationMaxHeight
|
|
158
|
+
})), notificationStyle)
|
|
159
|
+
}))
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
});
|
|
160
163
|
return /* @__PURE__ */ React.createElement(OptionalPortal, __spreadValues({ withinPortal }, portalProps), /* @__PURE__ */ React.createElement(Box, __spreadValues(__spreadProps(__spreadValues({}, getStyles("root")), { ref }), others), /* @__PURE__ */ React.createElement(TransitionGroup, null, items)));
|
|
161
164
|
});
|
|
162
165
|
Notifications.classes = classes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.mjs","sources":["../src/Notifications.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {\n Transition as _Transition,\n TransitionGroup,\n TransitionStatus,\n} from 'react-transition-group';\nimport { useForceUpdate, useDidUpdate, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n PortalProps,\n getDefaultZIndex,\n useMantineTheme,\n OptionalPortal,\n rem,\n} from '@mantine/core';\nimport {\n useNotifications,\n NotificationsStore,\n notificationsStore,\n hideNotification,\n notifications,\n} from './notifications.store';\nimport { NotificationContainer } from './NotificationContainer';\nimport { getNotificationStateStyles } from './get-notification-state-styles';\nimport classes from './Notifications.module.css';\n\nconst Transition: any = _Transition;\n\nexport type NotificationsStylesNames = 'root' | 'notification';\nexport type NotificationsCssVariables = {\n root:\n | '--notifications-z-index'\n | '--notifications-top'\n | '--notifications-right'\n | '--notifications-left'\n | '--notifications-left'\n | '--notifications-transform'\n | '--notifications-container-width';\n};\n\nexport interface NotificationsProps\n extends BoxProps,\n StylesApiProps<NotificationsFactory>,\n ElementProps<'div'> {\n /** Notifications position, `'bottom-right'` by default */\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 in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function, `4000` by defualt */\n autoClose?: number | false;\n\n /** Notification transition duration in ms, `250` by default */\n transitionDuration?: number;\n\n /** Notification width, cannot exceed 100%, `440` by default */\n containerWidth?: number | string;\n\n /** Notification `max-height`, used for transitions, `200` by default */\n notificationMaxHeight?: number | string;\n\n /** Maximum number of notifications displayed at a time, other new notifications will be added to queue, `5` by default */\n limit?: number;\n\n /** Notifications container z-index, `400` by default */\n zIndex?: string | number;\n\n /** Props passed down to the `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Store for notifications state, can be used to create multiple instances of notifications system in your application */\n store?: NotificationsStore;\n\n /** Determines whether notifications container should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n}\n\nexport type NotificationsFactory = Factory<{\n props: NotificationsProps;\n ref: HTMLDivElement;\n stylesNames: NotificationsStylesNames;\n vars: NotificationsCssVariables;\n staticComponents: {\n show: typeof notifications.show;\n hide: typeof notifications.hide;\n update: typeof notifications.update;\n clean: typeof notifications.clean;\n cleanQueue: typeof notifications.cleanQueue;\n updateState: typeof notifications.updateState;\n };\n}>;\n\nconst defaultProps: Partial<NotificationsProps> = {\n position: 'bottom-right',\n autoClose: 4000,\n transitionDuration: 250,\n containerWidth: 440,\n notificationMaxHeight: 200,\n limit: 5,\n zIndex: getDefaultZIndex('overlay'),\n store: notificationsStore,\n withinPortal: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationsFactory>(\n (_, { zIndex, position, containerWidth }) => {\n const [vertical, horizontal] = position!.split('-');\n\n return {\n root: {\n '--notifications-z-index': zIndex?.toString(),\n '--notifications-top': vertical === 'top' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-bottom': vertical === 'bottom' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-left':\n horizontal === 'left'\n ? 'var(--mantine-spacing-md)'\n : horizontal === 'center'\n ? '50%'\n : undefined,\n '--notifications-right': horizontal === 'right' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-transform': horizontal === 'center' ? 'translateX(-50%)' : undefined,\n '--notifications-container-width': rem(containerWidth),\n },\n };\n }\n);\n\nexport const Notifications = factory<NotificationsFactory>((_props, ref) => {\n const props = useProps('Notifications', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n position,\n autoClose,\n transitionDuration,\n containerWidth,\n notificationMaxHeight,\n limit,\n zIndex,\n store,\n portalProps,\n withinPortal,\n ...others\n } = props;\n\n const theme = useMantineTheme();\n const data = useNotifications(store);\n const forceUpdate = useForceUpdate();\n const shouldReduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n\n const getStyles = useStyles<NotificationsFactory>({\n name: 'Notifications',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n useDidUpdate(() => {\n if (data.notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = data.notifications.length;\n }, [data.notifications]);\n\n const items = data.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: TransitionStatus) => (\n <NotificationContainer\n {...getStyles('notification', {\n style: getNotificationStateStyles({\n state,\n position,\n transitionDuration: duration!,\n maxHeight: notificationMaxHeight!,\n }),\n })}\n ref={(node) => {\n refs.current[notification.id!] = node!;\n }}\n data={notification}\n onHide={(id) => hideNotification(id, store)}\n autoClose={autoClose!}\n />\n )}\n </Transition>\n ));\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Box {...getStyles('root')} ref={ref} {...others}>\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </OptionalPortal>\n );\n});\n\nNotifications.classes = classes;\nNotifications.displayName = '@mantine/notifications/Notifications';\nNotifications.show = notifications.show;\nNotifications.hide = notifications.hide;\nNotifications.update = notifications.update;\nNotifications.clean = notifications.clean;\nNotifications.cleanQueue = notifications.cleanQueue;\nNotifications.updateState = notifications.updateState;\n"],"names":["_Transition"],"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,CA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E,KAAK,CAAC,CAAC,CAAC,CAAC;AAChT,CAAC,EAAE;AACH,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;AAChC,aAAa,CAAC,WAAW,GAAG,sCAAsC,CAAC;AACnE,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AACxC,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AACxC,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;AAC5C,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;AAC1C,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;AACpD,aAAa,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW;;"}
|
|
1
|
+
{"version":3,"file":"Notifications.mjs","sources":["../src/Notifications.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {\n Transition as _Transition,\n TransitionGroup,\n TransitionStatus,\n} from 'react-transition-group';\nimport { useForceUpdate, useDidUpdate, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n PortalProps,\n getDefaultZIndex,\n useMantineTheme,\n OptionalPortal,\n rem,\n} from '@mantine/core';\nimport {\n useNotifications,\n NotificationsStore,\n notificationsStore,\n hideNotification,\n notifications,\n} from './notifications.store';\nimport { NotificationContainer } from './NotificationContainer';\nimport { getNotificationStateStyles } from './get-notification-state-styles';\nimport classes from './Notifications.module.css';\n\nconst Transition: any = _Transition;\n\nexport type NotificationsStylesNames = 'root' | 'notification';\nexport type NotificationsCssVariables = {\n root:\n | '--notifications-z-index'\n | '--notifications-top'\n | '--notifications-right'\n | '--notifications-left'\n | '--notifications-left'\n | '--notifications-transform'\n | '--notifications-container-width';\n};\n\nexport interface NotificationsProps\n extends BoxProps,\n StylesApiProps<NotificationsFactory>,\n ElementProps<'div'> {\n /** Notifications position, `'bottom-right'` by default */\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 in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function, `4000` by defualt */\n autoClose?: number | false;\n\n /** Notification transition duration in ms, `250` by default */\n transitionDuration?: number;\n\n /** Notification width, cannot exceed 100%, `440` by default */\n containerWidth?: number | string;\n\n /** Notification `max-height`, used for transitions, `200` by default */\n notificationMaxHeight?: number | string;\n\n /** Maximum number of notifications displayed at a time, other new notifications will be added to queue, `5` by default */\n limit?: number;\n\n /** Notifications container z-index, `400` by default */\n zIndex?: string | number;\n\n /** Props passed down to the `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Store for notifications state, can be used to create multiple instances of notifications system in your application */\n store?: NotificationsStore;\n\n /** Determines whether notifications container should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n}\n\nexport type NotificationsFactory = Factory<{\n props: NotificationsProps;\n ref: HTMLDivElement;\n stylesNames: NotificationsStylesNames;\n vars: NotificationsCssVariables;\n staticComponents: {\n show: typeof notifications.show;\n hide: typeof notifications.hide;\n update: typeof notifications.update;\n clean: typeof notifications.clean;\n cleanQueue: typeof notifications.cleanQueue;\n updateState: typeof notifications.updateState;\n };\n}>;\n\nconst defaultProps: Partial<NotificationsProps> = {\n position: 'bottom-right',\n autoClose: 4000,\n transitionDuration: 250,\n containerWidth: 440,\n notificationMaxHeight: 200,\n limit: 5,\n zIndex: getDefaultZIndex('overlay'),\n store: notificationsStore,\n withinPortal: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationsFactory>(\n (_, { zIndex, position, containerWidth }) => {\n const [vertical, horizontal] = position!.split('-');\n\n return {\n root: {\n '--notifications-z-index': zIndex?.toString(),\n '--notifications-top': vertical === 'top' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-bottom': vertical === 'bottom' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-left':\n horizontal === 'left'\n ? 'var(--mantine-spacing-md)'\n : horizontal === 'center'\n ? '50%'\n : undefined,\n '--notifications-right': horizontal === 'right' ? 'var(--mantine-spacing-md)' : undefined,\n '--notifications-transform': horizontal === 'center' ? 'translateX(-50%)' : undefined,\n '--notifications-container-width': rem(containerWidth),\n },\n };\n }\n);\n\nexport const Notifications = factory<NotificationsFactory>((_props, ref) => {\n const props = useProps('Notifications', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n position,\n autoClose,\n transitionDuration,\n containerWidth,\n notificationMaxHeight,\n limit,\n zIndex,\n store,\n portalProps,\n withinPortal,\n ...others\n } = props;\n\n const theme = useMantineTheme();\n const data = useNotifications(store);\n const forceUpdate = useForceUpdate();\n const shouldReduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLDivElement>>({});\n const previousLength = useRef<number>(0);\n\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 1 : transitionDuration;\n\n const getStyles = useStyles<NotificationsFactory>({\n name: 'Notifications',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n useDidUpdate(() => {\n if (data.notifications.length > previousLength.current) {\n setTimeout(() => forceUpdate(), 0);\n }\n previousLength.current = data.notifications.length;\n }, [data.notifications]);\n\n const items = data.notifications.map(({ style: notificationStyle, ...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: TransitionStatus) => (\n <NotificationContainer\n ref={(node) => {\n refs.current[notification.id!] = node!;\n }}\n data={notification}\n onHide={(id) => hideNotification(id, store)}\n autoClose={autoClose!}\n {...getStyles('notification', {\n style: {\n ...getNotificationStateStyles({\n state,\n position,\n transitionDuration: duration!,\n maxHeight: notificationMaxHeight!,\n }),\n ...notificationStyle,\n },\n })}\n />\n )}\n </Transition>\n ));\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Box {...getStyles('root')} ref={ref} {...others}>\n <TransitionGroup>{items}</TransitionGroup>\n </Box>\n </OptionalPortal>\n );\n});\n\nNotifications.classes = classes;\nNotifications.displayName = '@mantine/notifications/Notifications';\nNotifications.show = notifications.show;\nNotifications.hide = notifications.hide;\nNotifications.update = notifications.update;\nNotifications.clean = notifications.clean;\nNotifications.cleanQueue = notifications.cleanQueue;\nNotifications.updateState = notifications.updateState;\n"],"names":["_Transition"],"mappings":";;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;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AwB,CAAC;IACtC,IAAI,EAAE,yBAAyB,CAAC;IAChC,gBAAgB,EAAE;QAChB,IAAI,EAAE,OAAO,aAAa,CAAC,IAAI,CAAC;QAChC,IAAI,EAAE,OAAO,aAAa,CAAC,IAAI,CAAC;QAChC,MAAM,EAAE,OAAO,aAAa,CAAC,MAAM,CAAC;QACpC,KAAK,EAAE,OAAO,aAAa,CAAC,KAAK,CAAC;QAClC,UAAU,EAAE,OAAO,aAAa,CAAC,UAAU,CAAC;QAC5C,WAAW,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC;KAC/C,CAAC;CACH,CAAC,CAAC;AAqCH,eAAO,MAAM,aAAa;WAjDjB,kBAAkB;SACpB,cAAc;iBACN,wBAAwB;UAC/B,yBAAyB;sBACb;QAChB,IAAI,EAAE,OAAO,cAAc,IAAI,CAAC;QAChC,IAAI,EAAE,OAAO,cAAc,IAAI,CAAC;QAChC,MAAM,EAAE,OAAO,cAAc,MAAM,CAAC;QACpC,KAAK,EAAE,OAAO,cAAc,KAAK,CAAC;QAClC,UAAU,EAAE,OAAO,cAAc,UAAU,CAAC;QAC5C,WAAW,EAAE,OAAO,cAAc,WAAW,CAAC;KAC/C;EAgID,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/notifications",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"main": "./cjs/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"module": "./esm/index.mjs",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"notification-system"
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@mantine/core": "7.1.
|
|
47
|
-
"@mantine/hooks": "7.1.
|
|
46
|
+
"@mantine/core": "7.1.3",
|
|
47
|
+
"@mantine/hooks": "7.1.3",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@mantine/store": "7.1.
|
|
52
|
+
"@mantine/store": "7.1.3",
|
|
53
53
|
"react-transition-group": "4.4.5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {}
|