@delightui/components 0.1.129 → 0.1.131

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.
@@ -1,5 +1,5 @@
1
1
  import NotificationContainer from './NotificationContainer';
2
- import { NotificationContainerProps } from './types';
2
+ import { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset } from './types';
3
3
  export * from './NotificationContext';
4
- export type { NotificationContainerProps };
4
+ export type { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset };
5
5
  export default NotificationContainer;
@@ -1,25 +1,42 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ToastNotificationStyleEnum } from '../../components/atoms/ToastNotification/ToastNotification.types';
3
+ /**
4
+ * Position options for notification container.
5
+ */
6
+ export type NotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
7
+ /**
8
+ * Offset configuration for notification positioning.
9
+ */
10
+ export type NotificationOffset = {
11
+ x?: number;
12
+ y?: number;
13
+ };
3
14
  /**
4
15
  * Represents a single notification.
5
16
  */
6
17
  export type Notification = {
7
18
  id?: number;
8
- message?: ReactNode;
19
+ message: ReactNode;
9
20
  duration?: number;
21
+ style?: ToastNotificationStyleEnum;
22
+ isDismissable?: boolean;
10
23
  };
11
24
  /**
12
25
  * Payload for triggering a new notification.
13
26
  */
14
27
  export type TriggerNotificationPayload = Notification & {
15
- style?: ToastNotificationStyleEnum;
28
+ style: ToastNotificationStyleEnum;
29
+ isDismissable?: boolean;
16
30
  };
17
31
  /**
18
32
  * Props for the NotificationContainer component.
19
33
  */
20
34
  export type NotificationContainerProps = {
21
35
  className?: string;
36
+ position?: NotificationPosition;
37
+ offset?: NotificationOffset;
22
38
  };
39
+ export type NotificationTrigger = (payload: TriggerNotificationPayload) => void;
23
40
  /**
24
41
  * Context value for notifications.
25
42
  */
@@ -27,11 +44,13 @@ export type NotificationContextValue = {
27
44
  notifications: Notification[];
28
45
  clear: VoidFunction;
29
46
  removeNotification: (id: number) => void;
30
- trigger: (payload: TriggerNotificationPayload) => void;
47
+ trigger: NotificationTrigger;
31
48
  };
32
49
  /**
33
50
  * Props for the NotificationProvider component.
34
51
  */
35
52
  export type NotificationProviderProps = {
36
53
  children: ReactNode;
54
+ position?: NotificationPosition;
55
+ offset?: NotificationOffset;
37
56
  };
@@ -35318,6 +35318,21 @@ span.flatpickr-weekday {
35318
35318
  display: flex;
35319
35319
  flex-direction: column;
35320
35320
  z-index: 1000;
35321
+ gap: 8px;
35322
+ min-width: 300px;
35323
+ max-width: 500px;
35324
+ }
35325
+
35326
+ .NotificationContainer-module_top-left__DSEaN,
35327
+ .NotificationContainer-module_top-center__uNAv8,
35328
+ .NotificationContainer-module_top-right__8CJ57 {
35329
+ flex-direction: column;
35330
+ }
35331
+
35332
+ .NotificationContainer-module_bottom-left__qg8Oo,
35333
+ .NotificationContainer-module_bottom-center__fd5iv,
35334
+ .NotificationContainer-module_bottom-right__lSCdh {
35335
+ flex-direction: column-reverse;
35321
35336
  }
35322
35337
  .ToastNotification-module_toastNotification__LCpoq {
35323
35338
  display: flex;