@delightui/components 0.1.163 → 0.1.165
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/dist/cjs/components/atoms/ToastNotification/ToastNotification.types.d.ts +8 -0
- package/dist/cjs/components/molecules/DatePicker/DateInput/DateInput.types.d.ts +8 -0
- package/dist/cjs/components/molecules/ProgressBar/ProgressBar.types.d.ts +4 -0
- package/dist/cjs/library.css +1 -1
- package/dist/cjs/library.js +1 -1
- package/dist/cjs/library.js.map +1 -1
- package/dist/cjs/modules/notification/index.d.ts +2 -2
- package/dist/cjs/modules/notification/types.d.ts +13 -2
- package/dist/esm/components/atoms/ToastNotification/ToastNotification.types.d.ts +8 -0
- package/dist/esm/components/molecules/DatePicker/DateInput/DateInput.types.d.ts +8 -0
- package/dist/esm/components/molecules/ProgressBar/ProgressBar.types.d.ts +4 -0
- package/dist/esm/library.css +1 -1
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/esm/modules/notification/index.d.ts +2 -2
- package/dist/esm/modules/notification/types.d.ts +13 -2
- package/dist/index.d.ts +26 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import NotificationContainer from './NotificationContainer';
|
|
2
|
-
import { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset } from './types';
|
|
2
|
+
import { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset, NotificationRenderContent } from './types';
|
|
3
3
|
export * from './NotificationContext';
|
|
4
|
-
export type { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset };
|
|
4
|
+
export type { NotificationContainerProps, TriggerNotificationPayload, Notification, NotificationTrigger, NotificationPosition, NotificationOffset, NotificationRenderContent };
|
|
5
5
|
export default NotificationContainer;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ToastNotificationStyleEnum } from '../../components/atoms/ToastNotification/ToastNotification.types';
|
|
3
|
+
/** Custom inner content; receives close (required) so your component can dismiss the toast. */
|
|
4
|
+
export type NotificationRenderContent = (helpers: {
|
|
5
|
+
closeToast: () => void;
|
|
6
|
+
}) => ReactNode;
|
|
3
7
|
/**
|
|
4
8
|
* Position options for notification container.
|
|
5
9
|
*/
|
|
@@ -16,7 +20,10 @@ export type NotificationOffset = {
|
|
|
16
20
|
*/
|
|
17
21
|
export type Notification = {
|
|
18
22
|
id?: number;
|
|
19
|
-
|
|
23
|
+
/** Shown inside default toast (ignored when renderContent is set). */
|
|
24
|
+
message?: ReactNode;
|
|
25
|
+
/** Custom inner content; receives removeToast so your component can close the toast. */
|
|
26
|
+
renderContent?: NotificationRenderContent;
|
|
20
27
|
duration?: number;
|
|
21
28
|
style?: ToastNotificationStyleEnum;
|
|
22
29
|
isDismissable?: boolean;
|
|
@@ -24,12 +31,14 @@ export type Notification = {
|
|
|
24
31
|
closeIcon?: ReactNode;
|
|
25
32
|
leadingIcon?: ReactNode;
|
|
26
33
|
trailingIcon?: ReactNode;
|
|
34
|
+
/** Position for this toast; defaults to provider position when not set. */
|
|
35
|
+
position?: NotificationPosition;
|
|
27
36
|
};
|
|
28
37
|
/**
|
|
29
38
|
* Payload for triggering a new notification.
|
|
30
39
|
*/
|
|
31
40
|
export type TriggerNotificationPayload = Notification & {
|
|
32
|
-
style
|
|
41
|
+
style?: ToastNotificationStyleEnum;
|
|
33
42
|
isDismissable?: boolean;
|
|
34
43
|
};
|
|
35
44
|
/**
|
|
@@ -49,6 +58,8 @@ export type NotificationContextValue = {
|
|
|
49
58
|
clear: VoidFunction;
|
|
50
59
|
removeNotification: (id: number) => void;
|
|
51
60
|
trigger: NotificationTrigger;
|
|
61
|
+
position: NotificationPosition;
|
|
62
|
+
offset: NotificationOffset;
|
|
52
63
|
};
|
|
53
64
|
/**
|
|
54
65
|
* Props for the NotificationProvider component.
|
|
@@ -36,6 +36,14 @@ export type ToastNotificationProps = Omit<HTMLAttributes<HTMLDivElement>, 'style
|
|
|
36
36
|
* Duration before the toast auto-closes (in milliseconds).
|
|
37
37
|
*/
|
|
38
38
|
duration?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Custom renderer for the inner content area inside the toast wrapper.
|
|
41
|
+
* When provided, it replaces the default layout (leading icon + text + trailing icon).
|
|
42
|
+
* It receives `removeToast` (always defined) so your custom component can close the toast.
|
|
43
|
+
*/
|
|
44
|
+
renderContent?: (helpers: {
|
|
45
|
+
removeToast: () => void;
|
|
46
|
+
}) => ReactNode;
|
|
39
47
|
/**
|
|
40
48
|
* Additional class for styling.
|
|
41
49
|
*/
|
|
@@ -12,4 +12,12 @@ export type DateInputProps = DatePickerBaseSharedProps & {
|
|
|
12
12
|
* Icon to be displayed after the input.
|
|
13
13
|
*/
|
|
14
14
|
trailingIcon?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Accessible label (used as base for input and child suffixes e.g. --open-calendar).
|
|
17
|
+
*/
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* ID(s) of element(s) that label this component (used as base for child suffixes).
|
|
21
|
+
*/
|
|
22
|
+
ariaLabelledBy?: string;
|
|
15
23
|
};
|
package/dist/esm/library.css
CHANGED
|
@@ -35777,7 +35777,7 @@ span.flatpickr-weekday {
|
|
|
35777
35777
|
}
|
|
35778
35778
|
.ToastNotification-module_toastNotification__LCpoq {
|
|
35779
35779
|
display: flex;
|
|
35780
|
-
position:
|
|
35780
|
+
position: relative;
|
|
35781
35781
|
flex-direction: row;
|
|
35782
35782
|
align-items: center;
|
|
35783
35783
|
justify-content: center;
|