Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

21
node_modules/@mantine/notifications/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Vitaly Rtishchev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
node_modules/@mantine/notifications/README.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
# Mantine notifications system
[![npm](https://img.shields.io/npm/dm/@mantine/notifications)](https://www.npmjs.com/package/@mantine/notifications)
Notifications system
[View documentation](https://mantine.dev/)
## Installation
```bash
# With yarn
yarn add @mantine/hooks @mantine/core @mantine/notifications
# With npm
npm install @mantine/hooks @mantine/core @mantine/notifications
```
## License
MIT

View File

@@ -0,0 +1,48 @@
'use client';
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var core = require('@mantine/core');
var getAutoClose = require('./get-auto-close/get-auto-close.cjs');
const NotificationContainer = react.forwardRef(
({ data, onHide, autoClose, ...others }, ref) => {
const { autoClose: _autoClose, message, ...notificationProps } = data;
const autoCloseDuration = getAutoClose.getAutoClose(autoClose, data.autoClose);
const autoCloseTimeout = react.useRef(-1);
const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);
const handleHide = () => {
onHide(data.id);
cancelAutoClose();
};
const handleAutoClose = () => {
if (typeof autoCloseDuration === "number") {
autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);
}
};
react.useEffect(() => {
data.onOpen?.(data);
}, []);
react.useEffect(() => {
handleAutoClose();
return cancelAutoClose;
}, [autoCloseDuration]);
return /* @__PURE__ */ jsxRuntime.jsx(
core.Notification,
{
...others,
...notificationProps,
onClose: handleHide,
ref,
onMouseEnter: cancelAutoClose,
onMouseLeave: handleAutoClose,
children: message
}
);
}
);
NotificationContainer.displayName = "@mantine/notifications/NotificationContainer";
exports.NotificationContainer = NotificationContainer;
//# sourceMappingURL=NotificationContainer.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,162 @@
'use client';
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var reactTransitionGroup = require('react-transition-group');
var core = require('@mantine/core');
var hooks = require('@mantine/hooks');
var getGroupedNotifications = require('./get-grouped-notifications/get-grouped-notifications.cjs');
var getNotificationStateStyles = require('./get-notification-state-styles.cjs');
var NotificationContainer = require('./NotificationContainer.cjs');
var Notifications_module = require('./Notifications.module.css.cjs');
var notifications_store = require('./notifications.store.cjs');
const Transition = reactTransitionGroup.Transition;
const defaultProps = {
position: "bottom-right",
autoClose: 4e3,
transitionDuration: 250,
containerWidth: 440,
notificationMaxHeight: 200,
limit: 5,
zIndex: core.getDefaultZIndex("overlay"),
store: notifications_store.notificationsStore,
withinPortal: true
};
const varsResolver = core.createVarsResolver((_, { zIndex, containerWidth }) => ({
root: {
"--notifications-z-index": zIndex?.toString(),
"--notifications-container-width": core.rem(containerWidth)
}
}));
const Notifications = core.factory((_props, ref) => {
const props = core.useProps("Notifications", defaultProps, _props);
const {
classNames,
className,
style,
styles,
unstyled,
vars,
position,
autoClose,
transitionDuration,
containerWidth,
notificationMaxHeight,
limit,
zIndex,
store,
portalProps,
withinPortal,
...others
} = props;
const theme = core.useMantineTheme();
const data = notifications_store.useNotifications(store);
const forceUpdate = hooks.useForceUpdate();
const shouldReduceMotion = hooks.useReducedMotion();
const refs = react.useRef({});
const previousLength = react.useRef(0);
const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;
const duration = reduceMotion ? 1 : transitionDuration;
const getStyles = core.useStyles({
name: "Notifications",
classes: Notifications_module,
props,
className,
style,
classNames,
styles,
unstyled,
vars,
varsResolver
});
react.useEffect(() => {
store?.updateState((current) => ({
...current,
limit: limit || 5,
defaultPosition: position
}));
}, [limit, position]);
hooks.useDidUpdate(() => {
if (data.notifications.length > previousLength.current) {
setTimeout(() => forceUpdate(), 0);
}
previousLength.current = data.notifications.length;
}, [data.notifications]);
const grouped = getGroupedNotifications.getGroupedNotifications(data.notifications, position);
const groupedComponents = getGroupedNotifications.positions.reduce(
(acc, pos) => {
acc[pos] = grouped[pos].map(({ style: notificationStyle, ...notification }) => /* @__PURE__ */ jsxRuntime.jsx(
Transition,
{
timeout: duration,
onEnter: () => refs.current[notification.id].offsetHeight,
nodeRef: { current: refs.current[notification.id] },
children: (state) => /* @__PURE__ */ jsxRuntime.jsx(
NotificationContainer.NotificationContainer,
{
ref: (node) => {
if (node) {
refs.current[notification.id] = node;
}
},
data: notification,
onHide: (id) => notifications_store.hideNotification(id, store),
autoClose,
...getStyles("notification", {
style: {
...getNotificationStateStyles.getNotificationStateStyles({
state,
position: pos,
transitionDuration: duration,
maxHeight: notificationMaxHeight
}),
...notificationStyle
}
})
}
)
},
notification.id
));
return acc;
},
{}
);
return /* @__PURE__ */ jsxRuntime.jsxs(core.OptionalPortal, { withinPortal, ...portalProps, children: [
/* @__PURE__ */ jsxRuntime.jsx(core.Box, { ...getStyles("root"), "data-position": "top-center", ref, ...others, children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["top-center"] }) }),
/* @__PURE__ */ jsxRuntime.jsx(core.Box, { ...getStyles("root"), "data-position": "top-left", ...others, children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["top-left"] }) }),
/* @__PURE__ */ jsxRuntime.jsx(
core.Box,
{
...getStyles("root", { className: core.RemoveScroll.classNames.fullWidth }),
"data-position": "top-right",
...others,
children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["top-right"] })
}
),
/* @__PURE__ */ jsxRuntime.jsx(
core.Box,
{
...getStyles("root", { className: core.RemoveScroll.classNames.fullWidth }),
"data-position": "bottom-right",
...others,
children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["bottom-right"] })
}
),
/* @__PURE__ */ jsxRuntime.jsx(core.Box, { ...getStyles("root"), "data-position": "bottom-left", ...others, children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["bottom-left"] }) }),
/* @__PURE__ */ jsxRuntime.jsx(core.Box, { ...getStyles("root"), "data-position": "bottom-center", ...others, children: /* @__PURE__ */ jsxRuntime.jsx(reactTransitionGroup.TransitionGroup, { children: groupedComponents["bottom-center"] }) })
] });
});
Notifications.classes = Notifications_module;
Notifications.displayName = "@mantine/notifications/Notifications";
Notifications.show = notifications_store.notifications.show;
Notifications.hide = notifications_store.notifications.hide;
Notifications.update = notifications_store.notifications.update;
Notifications.clean = notifications_store.notifications.clean;
Notifications.cleanQueue = notifications_store.notifications.cleanQueue;
Notifications.updateState = notifications_store.notifications.updateState;
exports.Notifications = Notifications;
//# sourceMappingURL=Notifications.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
'use client';
'use strict';
var classes = {"root":"m_b37d9ac7","notification":"m_5ed0edd0"};
module.exports = classes;
//# sourceMappingURL=Notifications.module.css.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Notifications.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}

View File

@@ -0,0 +1,15 @@
'use client';
'use strict';
function getAutoClose(autoClose, notificationAutoClose) {
if (typeof notificationAutoClose === "number") {
return notificationAutoClose;
}
if (notificationAutoClose === false || autoClose === false) {
return false;
}
return autoClose;
}
exports.getAutoClose = getAutoClose;
//# sourceMappingURL=get-auto-close.cjs.map

View File

@@ -0,0 +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;;"}

View File

@@ -0,0 +1,27 @@
'use client';
'use strict';
const positions = [
"bottom-center",
"bottom-left",
"bottom-right",
"top-center",
"top-left",
"top-right"
];
function getGroupedNotifications(notifications, defaultPosition) {
return notifications.reduce(
(acc, notification) => {
acc[notification.position || defaultPosition].push(notification);
return acc;
},
positions.reduce((acc, item) => {
acc[item] = [];
return acc;
}, {})
);
}
exports.getGroupedNotifications = getGroupedNotifications;
exports.positions = positions;
//# sourceMappingURL=get-grouped-notifications.cjs.map

View File

@@ -0,0 +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;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACF,CAAA,CAAA;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GACA,eAAA,CAAA,CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACnB,CAAC,CAAA,CAAA,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA;AACrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAE,CAAA,CAAA,CAAA,EAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA;AAC/D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,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;;;"}

View File

@@ -0,0 +1,51 @@
'use client';
'use strict';
const transforms = {
left: "translateX(-100%)",
right: "translateX(100%)",
"top-center": "translateY(-100%)",
"bottom-center": "translateY(100%)"
};
const noTransform = {
left: "translateX(0)",
right: "translateX(0)",
"top-center": "translateY(0)",
"bottom-center": "translateY(0)"
};
function getNotificationStateStyles({
state,
maxHeight,
position,
transitionDuration
}) {
const [vertical, horizontal] = position.split("-");
const property = horizontal === "center" ? `${vertical}-center` : horizontal;
const commonStyles = {
opacity: 0,
maxHeight,
transform: transforms[property],
transitionDuration: `${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,
transitionTimingFunction: "cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",
transitionProperty: "opacity, transform, max-height"
};
const inState = {
opacity: 1,
transform: noTransform[property]
};
const outState = {
opacity: 0,
maxHeight: 0,
transform: transforms[property]
};
const transitionStyles = {
entering: inState,
entered: inState,
exiting: outState,
exited: outState
};
return { ...commonStyles, ...transitionStyles[state] };
}
exports.getNotificationStateStyles = getNotificationStateStyles;
//# sourceMappingURL=get-notification-state-styles.cjs.map

File diff suppressed because one or more lines are too long

19
node_modules/@mantine/notifications/cjs/index.cjs generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
var notifications_store = require('./notifications.store.cjs');
var Notifications = require('./Notifications.cjs');
exports.cleanNotifications = notifications_store.cleanNotifications;
exports.cleanNotificationsQueue = notifications_store.cleanNotificationsQueue;
exports.createNotificationsStore = notifications_store.createNotificationsStore;
exports.hideNotification = notifications_store.hideNotification;
exports.notifications = notifications_store.notifications;
exports.notificationsStore = notifications_store.notificationsStore;
exports.showNotification = notifications_store.showNotification;
exports.updateNotification = notifications_store.updateNotification;
exports.updateNotificationsState = notifications_store.updateNotificationsState;
exports.useNotifications = notifications_store.useNotifications;
exports.Notifications = Notifications.Notifications;
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,105 @@
'use client';
'use strict';
var hooks = require('@mantine/hooks');
var store = require('@mantine/store');
function getDistributedNotifications(data, defaultPosition, limit) {
const queue = [];
const notifications2 = [];
const count = {};
for (const item of data) {
const position = item.position || defaultPosition;
count[position] = count[position] || 0;
count[position] += 1;
if (count[position] <= limit) {
notifications2.push(item);
} else {
queue.push(item);
}
}
return { notifications: notifications2, queue };
}
const createNotificationsStore = () => store.createStore({
notifications: [],
queue: [],
defaultPosition: "bottom-right",
limit: 5
});
const notificationsStore = createNotificationsStore();
const useNotifications = (store$1 = notificationsStore) => store.useStore(store$1);
function updateNotificationsState(store, update) {
const state = store.getState();
const notifications2 = update([...state.notifications, ...state.queue]);
const updated = getDistributedNotifications(notifications2, state.defaultPosition, state.limit);
store.setState({
notifications: updated.notifications,
queue: updated.queue,
limit: state.limit,
defaultPosition: state.defaultPosition
});
}
function showNotification(notification, store = notificationsStore) {
const id = notification.id || hooks.randomId();
updateNotificationsState(store, (notifications2) => {
if (notification.id && notifications2.some((n) => n.id === notification.id)) {
return notifications2;
}
return [...notifications2, { ...notification, id }];
});
return id;
}
function hideNotification(id, store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.filter((notification) => {
if (notification.id === id) {
notification.onClose?.(notification);
return false;
}
return true;
})
);
return id;
}
function updateNotification(notification, store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.map((item) => {
if (item.id === notification.id) {
return { ...item, ...notification };
}
return item;
})
);
return notification.id;
}
function cleanNotifications(store = notificationsStore) {
updateNotificationsState(store, () => []);
}
function cleanNotificationsQueue(store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.slice(0, store.getState().limit)
);
}
const notifications = {
show: showNotification,
hide: hideNotification,
update: updateNotification,
clean: cleanNotifications,
cleanQueue: cleanNotificationsQueue,
updateState: updateNotificationsState
};
exports.cleanNotifications = cleanNotifications;
exports.cleanNotificationsQueue = cleanNotificationsQueue;
exports.createNotificationsStore = createNotificationsStore;
exports.hideNotification = hideNotification;
exports.notifications = notifications;
exports.notificationsStore = notificationsStore;
exports.showNotification = showNotification;
exports.updateNotification = updateNotification;
exports.updateNotificationsState = updateNotificationsState;
exports.useNotifications = useNotifications;
//# sourceMappingURL=notifications.store.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
'use client';
import { jsx } from 'react/jsx-runtime';
import { forwardRef, useRef, useEffect } from 'react';
import { Notification } from '@mantine/core';
import { getAutoClose } from './get-auto-close/get-auto-close.mjs';
const NotificationContainer = forwardRef(
({ data, onHide, autoClose, ...others }, ref) => {
const { autoClose: _autoClose, message, ...notificationProps } = data;
const autoCloseDuration = getAutoClose(autoClose, data.autoClose);
const autoCloseTimeout = useRef(-1);
const cancelAutoClose = () => window.clearTimeout(autoCloseTimeout.current);
const handleHide = () => {
onHide(data.id);
cancelAutoClose();
};
const handleAutoClose = () => {
if (typeof autoCloseDuration === "number") {
autoCloseTimeout.current = window.setTimeout(handleHide, autoCloseDuration);
}
};
useEffect(() => {
data.onOpen?.(data);
}, []);
useEffect(() => {
handleAutoClose();
return cancelAutoClose;
}, [autoCloseDuration]);
return /* @__PURE__ */ jsx(
Notification,
{
...others,
...notificationProps,
onClose: handleHide,
ref,
onMouseEnter: cancelAutoClose,
onMouseLeave: handleAutoClose,
children: message
}
);
}
);
NotificationContainer.displayName = "@mantine/notifications/NotificationContainer";
export { NotificationContainer };
//# sourceMappingURL=NotificationContainer.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,160 @@
'use client';
import { jsx, jsxs } from 'react/jsx-runtime';
import { useRef, useEffect } from 'react';
import { Transition as Transition$1, TransitionGroup } from 'react-transition-group';
import { getDefaultZIndex, createVarsResolver, rem, factory, useProps, useMantineTheme, useStyles, OptionalPortal, Box, RemoveScroll } from '@mantine/core';
import { useForceUpdate, useReducedMotion, useDidUpdate } from '@mantine/hooks';
import { getGroupedNotifications, positions } from './get-grouped-notifications/get-grouped-notifications.mjs';
import { getNotificationStateStyles } from './get-notification-state-styles.mjs';
import { NotificationContainer } from './NotificationContainer.mjs';
import classes from './Notifications.module.css.mjs';
import { notificationsStore, useNotifications, hideNotification, notifications } from './notifications.store.mjs';
const Transition = Transition$1;
const defaultProps = {
position: "bottom-right",
autoClose: 4e3,
transitionDuration: 250,
containerWidth: 440,
notificationMaxHeight: 200,
limit: 5,
zIndex: getDefaultZIndex("overlay"),
store: notificationsStore,
withinPortal: true
};
const varsResolver = createVarsResolver((_, { zIndex, containerWidth }) => ({
root: {
"--notifications-z-index": zIndex?.toString(),
"--notifications-container-width": rem(containerWidth)
}
}));
const Notifications = factory((_props, ref) => {
const props = useProps("Notifications", defaultProps, _props);
const {
classNames,
className,
style,
styles,
unstyled,
vars,
position,
autoClose,
transitionDuration,
containerWidth,
notificationMaxHeight,
limit,
zIndex,
store,
portalProps,
withinPortal,
...others
} = props;
const theme = useMantineTheme();
const data = useNotifications(store);
const forceUpdate = useForceUpdate();
const shouldReduceMotion = useReducedMotion();
const refs = useRef({});
const previousLength = useRef(0);
const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;
const duration = reduceMotion ? 1 : transitionDuration;
const getStyles = useStyles({
name: "Notifications",
classes,
props,
className,
style,
classNames,
styles,
unstyled,
vars,
varsResolver
});
useEffect(() => {
store?.updateState((current) => ({
...current,
limit: limit || 5,
defaultPosition: position
}));
}, [limit, position]);
useDidUpdate(() => {
if (data.notifications.length > previousLength.current) {
setTimeout(() => forceUpdate(), 0);
}
previousLength.current = data.notifications.length;
}, [data.notifications]);
const grouped = getGroupedNotifications(data.notifications, position);
const groupedComponents = positions.reduce(
(acc, pos) => {
acc[pos] = grouped[pos].map(({ style: notificationStyle, ...notification }) => /* @__PURE__ */ jsx(
Transition,
{
timeout: duration,
onEnter: () => refs.current[notification.id].offsetHeight,
nodeRef: { current: refs.current[notification.id] },
children: (state) => /* @__PURE__ */ jsx(
NotificationContainer,
{
ref: (node) => {
if (node) {
refs.current[notification.id] = node;
}
},
data: notification,
onHide: (id) => hideNotification(id, store),
autoClose,
...getStyles("notification", {
style: {
...getNotificationStateStyles({
state,
position: pos,
transitionDuration: duration,
maxHeight: notificationMaxHeight
}),
...notificationStyle
}
})
}
)
},
notification.id
));
return acc;
},
{}
);
return /* @__PURE__ */ jsxs(OptionalPortal, { withinPortal, ...portalProps, children: [
/* @__PURE__ */ jsx(Box, { ...getStyles("root"), "data-position": "top-center", ref, ...others, children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["top-center"] }) }),
/* @__PURE__ */ jsx(Box, { ...getStyles("root"), "data-position": "top-left", ...others, children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["top-left"] }) }),
/* @__PURE__ */ jsx(
Box,
{
...getStyles("root", { className: RemoveScroll.classNames.fullWidth }),
"data-position": "top-right",
...others,
children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["top-right"] })
}
),
/* @__PURE__ */ jsx(
Box,
{
...getStyles("root", { className: RemoveScroll.classNames.fullWidth }),
"data-position": "bottom-right",
...others,
children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["bottom-right"] })
}
),
/* @__PURE__ */ jsx(Box, { ...getStyles("root"), "data-position": "bottom-left", ...others, children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["bottom-left"] }) }),
/* @__PURE__ */ jsx(Box, { ...getStyles("root"), "data-position": "bottom-center", ...others, children: /* @__PURE__ */ jsx(TransitionGroup, { children: groupedComponents["bottom-center"] }) })
] });
});
Notifications.classes = classes;
Notifications.displayName = "@mantine/notifications/Notifications";
Notifications.show = notifications.show;
Notifications.hide = notifications.hide;
Notifications.update = notifications.update;
Notifications.clean = notifications.clean;
Notifications.cleanQueue = notifications.cleanQueue;
Notifications.updateState = notifications.updateState;
export { Notifications };
//# sourceMappingURL=Notifications.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
'use client';
var classes = {"root":"m_b37d9ac7","notification":"m_5ed0edd0"};
export { classes as default };
//# sourceMappingURL=Notifications.module.css.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Notifications.module.css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}

View File

@@ -0,0 +1,13 @@
'use client';
function getAutoClose(autoClose, notificationAutoClose) {
if (typeof notificationAutoClose === "number") {
return notificationAutoClose;
}
if (notificationAutoClose === false || autoClose === false) {
return false;
}
return autoClose;
}
export { getAutoClose };
//# sourceMappingURL=get-auto-close.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-auto-close.mjs","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;;"}

View File

@@ -0,0 +1,24 @@
'use client';
const positions = [
"bottom-center",
"bottom-left",
"bottom-right",
"top-center",
"top-left",
"top-right"
];
function getGroupedNotifications(notifications, defaultPosition) {
return notifications.reduce(
(acc, notification) => {
acc[notification.position || defaultPosition].push(notification);
return acc;
},
positions.reduce((acc, item) => {
acc[item] = [];
return acc;
}, {})
);
}
export { getGroupedNotifications, positions };
//# sourceMappingURL=get-grouped-notifications.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-grouped-notifications.mjs","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;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACF,CAAA,CAAA;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GACA,eAAA,CAAA,CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACnB,CAAC,CAAA,CAAA,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA;AACrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAE,CAAA,CAAA,CAAA,EAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA;AAC/D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,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;;"}

View File

@@ -0,0 +1,49 @@
'use client';
const transforms = {
left: "translateX(-100%)",
right: "translateX(100%)",
"top-center": "translateY(-100%)",
"bottom-center": "translateY(100%)"
};
const noTransform = {
left: "translateX(0)",
right: "translateX(0)",
"top-center": "translateY(0)",
"bottom-center": "translateY(0)"
};
function getNotificationStateStyles({
state,
maxHeight,
position,
transitionDuration
}) {
const [vertical, horizontal] = position.split("-");
const property = horizontal === "center" ? `${vertical}-center` : horizontal;
const commonStyles = {
opacity: 0,
maxHeight,
transform: transforms[property],
transitionDuration: `${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,
transitionTimingFunction: "cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",
transitionProperty: "opacity, transform, max-height"
};
const inState = {
opacity: 1,
transform: noTransform[property]
};
const outState = {
opacity: 0,
maxHeight: 0,
transform: transforms[property]
};
const transitionStyles = {
entering: inState,
entered: inState,
exiting: outState,
exited: outState
};
return { ...commonStyles, ...transitionStyles[state] };
}
export { getNotificationStateStyles };
//# sourceMappingURL=get-notification-state-styles.mjs.map

File diff suppressed because one or more lines are too long

3
node_modules/@mantine/notifications/esm/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export { cleanNotifications, cleanNotificationsQueue, createNotificationsStore, hideNotification, notifications, notificationsStore, showNotification, updateNotification, updateNotificationsState, useNotifications } from './notifications.store.mjs';
export { Notifications } from './Notifications.mjs';
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}

View File

@@ -0,0 +1,94 @@
'use client';
import { randomId } from '@mantine/hooks';
import { createStore, useStore } from '@mantine/store';
function getDistributedNotifications(data, defaultPosition, limit) {
const queue = [];
const notifications2 = [];
const count = {};
for (const item of data) {
const position = item.position || defaultPosition;
count[position] = count[position] || 0;
count[position] += 1;
if (count[position] <= limit) {
notifications2.push(item);
} else {
queue.push(item);
}
}
return { notifications: notifications2, queue };
}
const createNotificationsStore = () => createStore({
notifications: [],
queue: [],
defaultPosition: "bottom-right",
limit: 5
});
const notificationsStore = createNotificationsStore();
const useNotifications = (store = notificationsStore) => useStore(store);
function updateNotificationsState(store, update) {
const state = store.getState();
const notifications2 = update([...state.notifications, ...state.queue]);
const updated = getDistributedNotifications(notifications2, state.defaultPosition, state.limit);
store.setState({
notifications: updated.notifications,
queue: updated.queue,
limit: state.limit,
defaultPosition: state.defaultPosition
});
}
function showNotification(notification, store = notificationsStore) {
const id = notification.id || randomId();
updateNotificationsState(store, (notifications2) => {
if (notification.id && notifications2.some((n) => n.id === notification.id)) {
return notifications2;
}
return [...notifications2, { ...notification, id }];
});
return id;
}
function hideNotification(id, store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.filter((notification) => {
if (notification.id === id) {
notification.onClose?.(notification);
return false;
}
return true;
})
);
return id;
}
function updateNotification(notification, store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.map((item) => {
if (item.id === notification.id) {
return { ...item, ...notification };
}
return item;
})
);
return notification.id;
}
function cleanNotifications(store = notificationsStore) {
updateNotificationsState(store, () => []);
}
function cleanNotificationsQueue(store = notificationsStore) {
updateNotificationsState(
store,
(notifications2) => notifications2.slice(0, store.getState().limit)
);
}
const notifications = {
show: showNotification,
hide: hideNotification,
update: updateNotification,
clean: cleanNotifications,
cleanQueue: cleanNotificationsQueue,
updateState: updateNotificationsState
};
export { cleanNotifications, cleanNotificationsQueue, createNotificationsStore, hideNotification, notifications, notificationsStore, showNotification, updateNotification, updateNotificationsState, useNotifications };
//# sourceMappingURL=notifications.store.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
import { NotificationProps } from '@mantine/core';
import { NotificationData } from './notifications.store';
interface NotificationContainerProps extends NotificationProps {
data: NotificationData;
onHide: (id: string) => void;
autoClose: number | false;
}
export declare const NotificationContainer: import("react").ForwardRefExoticComponent<NotificationContainerProps & import("react").RefAttributes<HTMLDivElement>>;
export {};

View File

@@ -0,0 +1,56 @@
import { BasePortalProps, BoxProps, ElementProps, Factory, StylesApiProps } from '@mantine/core';
import { NotificationPosition, notifications, NotificationsStore } from './notifications.store';
export type NotificationsStylesNames = 'root' | 'notification';
export type NotificationsCssVariables = {
root: '--notifications-z-index' | '--notifications-container-width';
};
export interface NotificationsProps extends BoxProps, StylesApiProps<NotificationsFactory>, ElementProps<'div'> {
/** Notifications default position @default `'bottom-right'` */
position?: NotificationPosition;
/** Auto close timeout for all notifications in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function @default `4000` */
autoClose?: number | false;
/** Notification transition duration in ms @default `250` */
transitionDuration?: number;
/** Notification width, cannot exceed 100% @default `440` */
containerWidth?: number | string;
/** Notification `max-height`, used for transitions @default `200` */
notificationMaxHeight?: number | string;
/** Maximum number of notifications displayed at a time, other new notifications will be added to queue @default `5` */
limit?: number;
/** Notifications container z-index @default `400` */
zIndex?: string | number;
/** Props passed down to the `Portal` component */
portalProps?: BasePortalProps;
/** Store for notifications state, can be used to create multiple instances of notifications system in your application */
store?: NotificationsStore;
/** Determines whether notifications container should be rendered inside `Portal` @default `true` */
withinPortal?: boolean;
}
export type NotificationsFactory = Factory<{
props: NotificationsProps;
ref: HTMLDivElement;
stylesNames: NotificationsStylesNames;
vars: NotificationsCssVariables;
staticComponents: {
show: typeof notifications.show;
hide: typeof notifications.hide;
update: typeof notifications.update;
clean: typeof notifications.clean;
cleanQueue: typeof notifications.cleanQueue;
updateState: typeof notifications.updateState;
};
}>;
export declare const Notifications: import("@mantine/core").MantineComponent<{
props: NotificationsProps;
ref: HTMLDivElement;
stylesNames: NotificationsStylesNames;
vars: NotificationsCssVariables;
staticComponents: {
show: typeof notifications.show;
hide: typeof notifications.hide;
update: typeof notifications.update;
clean: typeof notifications.clean;
cleanQueue: typeof notifications.cleanQueue;
updateState: typeof notifications.updateState;
};
}>;

View File

@@ -0,0 +1 @@
export declare function getAutoClose(autoClose: boolean | number | undefined, notificationAutoClose: boolean | number | undefined): number | boolean | undefined;

View File

@@ -0,0 +1,4 @@
import { NotificationData, NotificationPosition } from '../notifications.store';
export type GroupedNotifications = Record<NotificationPosition, NotificationData[]>;
export declare const positions: NotificationPosition[];
export declare function getGroupedNotifications(notifications: NotificationData[], defaultPosition: NotificationPosition): GroupedNotifications;

View File

@@ -0,0 +1,10 @@
import { TransitionStatus } from 'react-transition-group';
import type { NotificationsProps } from './Notifications';
interface NotificationStateStylesProps {
state: TransitionStatus;
maxHeight: number | string;
position: NotificationsProps['position'];
transitionDuration: number;
}
export declare function getNotificationStateStyles({ state, maxHeight, position, transitionDuration, }: NotificationStateStylesProps): React.CSSProperties;
export {};

4
node_modules/@mantine/notifications/lib/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export { notifications, showNotification, hideNotification, cleanNotifications, cleanNotificationsQueue, updateNotification, updateNotificationsState, createNotificationsStore, notificationsStore, useNotifications, } from './notifications.store.js';
export { Notifications } from './Notifications.js';
export type { NotificationData, NotificationsState, NotificationsStore, } from './notifications.store';
export type { NotificationsCssVariables, NotificationsFactory, NotificationsProps, NotificationsStylesNames, } from './Notifications';

4
node_modules/@mantine/notifications/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export { notifications, showNotification, hideNotification, cleanNotifications, cleanNotificationsQueue, updateNotification, updateNotificationsState, createNotificationsStore, notificationsStore, useNotifications, } from './notifications.store.js';
export { Notifications } from './Notifications.js';
export type { NotificationData, NotificationsState, NotificationsStore, } from './notifications.store';
export type { NotificationsCssVariables, NotificationsFactory, NotificationsProps, NotificationsStylesNames, } from './Notifications';

View File

@@ -0,0 +1,43 @@
import { NotificationProps } from '@mantine/core';
import { MantineStore } from '@mantine/store';
export type NotificationPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
export interface NotificationData extends Omit<NotificationProps, 'onClose'>, Record<`data-${string}`, any> {
/** Notification id, can be used to close or update notification */
id?: string;
/** Position of the notification, if not set, the position is determined based on `position` prop on Notifications component */
position?: NotificationPosition;
/** Notification message, required for all notifications */
message: React.ReactNode;
/** Determines whether notification should be closed automatically,
* number is auto close timeout in ms, overrides `autoClose` from `Notifications`
* */
autoClose?: boolean | number;
/** Called when notification closes */
onClose?: (props: NotificationData) => void;
/** Called when notification opens */
onOpen?: (props: NotificationData) => void;
}
export interface NotificationsState {
notifications: NotificationData[];
queue: NotificationData[];
defaultPosition: NotificationPosition;
limit: number;
}
export type NotificationsStore = MantineStore<NotificationsState>;
export declare const createNotificationsStore: () => MantineStore<NotificationsState>;
export declare const notificationsStore: MantineStore<NotificationsState>;
export declare const useNotifications: (store?: NotificationsStore) => NotificationsState;
export declare function updateNotificationsState(store: NotificationsStore, update: (notifications: NotificationData[]) => NotificationData[]): void;
export declare function showNotification(notification: NotificationData, store?: NotificationsStore): string;
export declare function hideNotification(id: string, store?: NotificationsStore): string;
export declare function updateNotification(notification: NotificationData, store?: NotificationsStore): string | undefined;
export declare function cleanNotifications(store?: NotificationsStore): void;
export declare function cleanNotificationsQueue(store?: NotificationsStore): void;
export declare const notifications: {
readonly show: typeof showNotification;
readonly hide: typeof hideNotification;
readonly update: typeof updateNotification;
readonly clean: typeof cleanNotifications;
readonly cleanQueue: typeof cleanNotificationsQueue;
readonly updateState: typeof updateNotificationsState;
};

63
node_modules/@mantine/notifications/package.json generated vendored Normal file
View File

@@ -0,0 +1,63 @@
{
"name": "@mantine/notifications",
"version": "8.3.18",
"description": "Mantine notifications system",
"homepage": "https://mantine.dev",
"license": "MIT",
"author": "Vitaly Rtishchev <rtivital@gmail.com>",
"keywords": [
"components",
"frontend",
"library",
"next",
"nextjs",
"notification",
"notification-manager",
"notification-system",
"react",
"ui",
"ui-kit"
],
"sideEffects": [
"*.css"
],
"main": "./cjs/index.cjs",
"module": "./esm/index.mjs",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./esm/index.mjs"
},
"require": {
"types": "./lib/index.d.ts",
"default": "./cjs/index.cjs"
}
},
"./styles.css": "./styles.css",
"./styles.layer.css": "./styles.layer.css"
},
"repository": {
"url": "https://github.com/mantinedev/mantine.git",
"type": "git",
"directory": "packages/@mantine/notifications"
},
"peerDependencies": {
"@mantine/core": "8.3.18",
"@mantine/hooks": "8.3.18",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
},
"dependencies": {
"@mantine/store": "8.3.18",
"react-transition-group": "4.4.5"
},
"devDependencies": {
"@mantine-tests/core": "workspace:*",
"@mantine/core": "workspace:*",
"@mantine/hooks": "workspace:*",
"react": "19.1.1",
"react-dom": "19.1.1"
}
}

42
node_modules/@mantine/notifications/styles.css generated vendored Normal file
View File

@@ -0,0 +1,42 @@
.m_b37d9ac7 {
width: calc(100% - var(--mantine-spacing-md) * 2);
position: fixed;
z-index: var(--notifications-z-index);
max-width: var(--notifications-container-width);
}
.m_b37d9ac7:where([data-position='top-center']) {
top: var(--mantine-spacing-md);
left: 50%;
transform: translateX(-50%);
}
.m_b37d9ac7:where([data-position='top-left']) {
top: var(--mantine-spacing-md);
left: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='top-right']) {
top: var(--mantine-spacing-md);
right: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='bottom-center']) {
bottom: var(--mantine-spacing-md);
left: 50%;
transform: translateX(-50%);
}
.m_b37d9ac7:where([data-position='bottom-left']) {
bottom: var(--mantine-spacing-md);
left: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='bottom-right']) {
bottom: var(--mantine-spacing-md);
right: var(--mantine-spacing-md);
}
.m_5ed0edd0 + .m_5ed0edd0 {
margin-top: var(--mantine-spacing-md);
}

43
node_modules/@mantine/notifications/styles.layer.css generated vendored Normal file
View File

@@ -0,0 +1,43 @@
@layer mantine {.m_b37d9ac7 {
width: calc(100% - var(--mantine-spacing-md) * 2);
position: fixed;
z-index: var(--notifications-z-index);
max-width: var(--notifications-container-width);
}
.m_b37d9ac7:where([data-position='top-center']) {
top: var(--mantine-spacing-md);
left: 50%;
transform: translateX(-50%);
}
.m_b37d9ac7:where([data-position='top-left']) {
top: var(--mantine-spacing-md);
left: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='top-right']) {
top: var(--mantine-spacing-md);
right: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='bottom-center']) {
bottom: var(--mantine-spacing-md);
left: 50%;
transform: translateX(-50%);
}
.m_b37d9ac7:where([data-position='bottom-left']) {
bottom: var(--mantine-spacing-md);
left: var(--mantine-spacing-md);
}
.m_b37d9ac7:where([data-position='bottom-right']) {
bottom: var(--mantine-spacing-md);
right: var(--mantine-spacing-md);
}
.m_5ed0edd0 + .m_5ed0edd0 {
margin-top: var(--mantine-spacing-md);
}
}