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

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;
};