@delightui/components 0.1.164 → 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/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/library.css +1 -1
- package/dist/esm/library.js +1 -1
- 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 +14 -3
- package/package.json +1 -1
|
@@ -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.
|
package/dist/index.d.ts
CHANGED
|
@@ -2805,6 +2805,10 @@ declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
|
2805
2805
|
|
|
2806
2806
|
type ToastNotificationStyleEnum = 'Neutral' | 'Error' | 'Success';
|
|
2807
2807
|
|
|
2808
|
+
/** Custom inner content; receives close (required) so your component can dismiss the toast. */
|
|
2809
|
+
type NotificationRenderContent = (helpers: {
|
|
2810
|
+
closeToast: () => void;
|
|
2811
|
+
}) => ReactNode;
|
|
2808
2812
|
/**
|
|
2809
2813
|
* Position options for notification container.
|
|
2810
2814
|
*/
|
|
@@ -2821,7 +2825,10 @@ type NotificationOffset = {
|
|
|
2821
2825
|
*/
|
|
2822
2826
|
type Notification = {
|
|
2823
2827
|
id?: number;
|
|
2824
|
-
|
|
2828
|
+
/** Shown inside default toast (ignored when renderContent is set). */
|
|
2829
|
+
message?: ReactNode;
|
|
2830
|
+
/** Custom inner content; receives removeToast so your component can close the toast. */
|
|
2831
|
+
renderContent?: NotificationRenderContent;
|
|
2825
2832
|
duration?: number;
|
|
2826
2833
|
style?: ToastNotificationStyleEnum;
|
|
2827
2834
|
isDismissable?: boolean;
|
|
@@ -2829,12 +2836,14 @@ type Notification = {
|
|
|
2829
2836
|
closeIcon?: ReactNode;
|
|
2830
2837
|
leadingIcon?: ReactNode;
|
|
2831
2838
|
trailingIcon?: ReactNode;
|
|
2839
|
+
/** Position for this toast; defaults to provider position when not set. */
|
|
2840
|
+
position?: NotificationPosition;
|
|
2832
2841
|
};
|
|
2833
2842
|
/**
|
|
2834
2843
|
* Payload for triggering a new notification.
|
|
2835
2844
|
*/
|
|
2836
2845
|
type TriggerNotificationPayload = Notification & {
|
|
2837
|
-
style
|
|
2846
|
+
style?: ToastNotificationStyleEnum;
|
|
2838
2847
|
isDismissable?: boolean;
|
|
2839
2848
|
};
|
|
2840
2849
|
/**
|
|
@@ -2854,6 +2863,8 @@ type NotificationContextValue = {
|
|
|
2854
2863
|
clear: VoidFunction;
|
|
2855
2864
|
removeNotification: (id: number) => void;
|
|
2856
2865
|
trigger: NotificationTrigger;
|
|
2866
|
+
position: NotificationPosition;
|
|
2867
|
+
offset: NotificationOffset;
|
|
2857
2868
|
};
|
|
2858
2869
|
/**
|
|
2859
2870
|
* Props for the NotificationProvider component.
|
|
@@ -2868,4 +2879,4 @@ declare const NotificationContext: React__default.Context<NotificationContextVal
|
|
|
2868
2879
|
declare const NotificationProvider: React__default.FC<NotificationProviderProps>;
|
|
2869
2880
|
declare const useNotification: () => NotificationContextValue;
|
|
2870
2881
|
|
|
2871
|
-
export { type AccessibilityActions, type AccessibilityProps, Accordion, AccordionDetails, AccordionGroup, AccordionSummary, ActionCard, type ActionCardProps, ActionImage, type ActionImageProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Breakpoint, type BreakpointProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, CheckboxItem, type CheckboxItemProps, type CheckboxLabelAlignmentEnum, type CheckboxProps, type CheckboxSizeEnum, type CheckboxTypeEnum, Chip, ChipInput, type ChipInputProps, type ChipProps, ConditionalView, type ConditionalViewProps, ContextMenu, type ContextMenuProps, type CustomTimePickerConfig, CustomToggle, type CustomToggleProps, DateInput, type DateInputProps, DatePicker, type DatePickerProps, SortableItem as DraggableItem, SortableTrigger as DraggableItemTrigger, Dropzone, DropzoneClear, DropzoneContent, type DropzoneContentProps, type DropzoneContentTypeEnum, DropzoneFilename, DropzoneFilename as DropzonePreview, type DropzoneProps, DropzoneSupportedFormats as DropzoneReject, DropzoneTrigger as DropzoneRoot, DropzoneSupportedFormats, DropzoneTrigger, type FieldValidationFunction, type FieldValidators, type FieldValue, Form, type FormContextValues, type FormErrors, FormField, type FormFieldProps, type FormProps, type FormProviderProps, type FormState, type FormStateChangeHandler, type FormSubmitHandler, type FormValidator, Grid, GridItem, type GridItemProps, GridList, type GridListProps, type GridProps, Icon, IconButton, type IconButtonProps, type IconButtonStyleEnum, type IconProps, type IconSizeEnum, type IconStyleEnum, Image, type ImageFitEnum, type ImageProps, Input, type InputProps, type InputTypeEnum, List, ListItem, type ListItemProps$1 as ListItemProps, type ListProps, Modal, type ModalComponentProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, ModalProvider, type ModalProviderProps, Nav, NavItem, type NavItemProps, NavLink, type NavLinkProps, type NavProps, type Notification, type NotificationContainerProps, NotificationContext, type NotificationOffset, type NotificationPosition, NotificationProvider, type NotificationTrigger, Option, type OptionLike, type OptionLikeKey, type OptionProps, type OverlayDirectionEnum, Pagination, PaginationNumberField, type PaginationNumberFieldProps, type PaginationProps, Password, Popover, type PopoverHandle, type PopoverProps, ProgressBar, type ProgressBarProps, RadioButton, RadioButtonItem, type RadioButtonItemProps, type RadioButtonLabelAlignmentEnum, type RadioButtonProps, type RadioButtonSizeEnum, RadioGroup, type RadioGroupProps, RenderStateView, type RenderStateViewProps, RepeaterList, type RepeaterListProps, type RequiredFields, ResponsiveComponent, type ResponsiveComponentProps, Search, type SearchCallback, type SearchStyleEnum as SearchModeEnum, type SearchProps, Select, SelectListItem, type SelectListItemProps, type SelectProps, SelectProvider, SlideOutPanel, type SlideOutPanelDirectionEnum, type SlideOutPanelProps, type SlideOutPanelSizeEnum, Slider, type SliderProps, Spinner, type SpinnerProps, TabContent, type TabContentProps, TabItem, type TabItemProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextDecorationEnum, type TextProps, type TextTypeEnum, type TextWeightEnum, ThemeContext, type ThemeContextType, ThemeProvider, type ThemeProviderProps, Toggle, ToggleButton, type ToggleButtonProps, type ToggleLabelAlignmentEnum, type ToggleProps, Tooltip, type TooltipProps, type TriggerNotificationPayload, type UploadedFileMetadata, type UseModalReturn, WrapTextNodes, type WrapTextNodesProps, applyPropsToChildren, getClickAccessibilityProps, mergeRefs, useDebounce, useDropzoneContext, useForm, useFormTyped, useInflateView, useModal, useNotification, useSelectContext, useTab };
|
|
2882
|
+
export { type AccessibilityActions, type AccessibilityProps, Accordion, AccordionDetails, AccordionGroup, AccordionSummary, ActionCard, type ActionCardProps, ActionImage, type ActionImageProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Breakpoint, type BreakpointProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, CheckboxItem, type CheckboxItemProps, type CheckboxLabelAlignmentEnum, type CheckboxProps, type CheckboxSizeEnum, type CheckboxTypeEnum, Chip, ChipInput, type ChipInputProps, type ChipProps, ConditionalView, type ConditionalViewProps, ContextMenu, type ContextMenuProps, type CustomTimePickerConfig, CustomToggle, type CustomToggleProps, DateInput, type DateInputProps, DatePicker, type DatePickerProps, SortableItem as DraggableItem, SortableTrigger as DraggableItemTrigger, Dropzone, DropzoneClear, DropzoneContent, type DropzoneContentProps, type DropzoneContentTypeEnum, DropzoneFilename, DropzoneFilename as DropzonePreview, type DropzoneProps, DropzoneSupportedFormats as DropzoneReject, DropzoneTrigger as DropzoneRoot, DropzoneSupportedFormats, DropzoneTrigger, type FieldValidationFunction, type FieldValidators, type FieldValue, Form, type FormContextValues, type FormErrors, FormField, type FormFieldProps, type FormProps, type FormProviderProps, type FormState, type FormStateChangeHandler, type FormSubmitHandler, type FormValidator, Grid, GridItem, type GridItemProps, GridList, type GridListProps, type GridProps, Icon, IconButton, type IconButtonProps, type IconButtonStyleEnum, type IconProps, type IconSizeEnum, type IconStyleEnum, Image, type ImageFitEnum, type ImageProps, Input, type InputProps, type InputTypeEnum, List, ListItem, type ListItemProps$1 as ListItemProps, type ListProps, Modal, type ModalComponentProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, ModalProvider, type ModalProviderProps, Nav, NavItem, type NavItemProps, NavLink, type NavLinkProps, type NavProps, type Notification, type NotificationContainerProps, NotificationContext, type NotificationOffset, type NotificationPosition, NotificationProvider, type NotificationRenderContent, type NotificationTrigger, Option, type OptionLike, type OptionLikeKey, type OptionProps, type OverlayDirectionEnum, Pagination, PaginationNumberField, type PaginationNumberFieldProps, type PaginationProps, Password, Popover, type PopoverHandle, type PopoverProps, ProgressBar, type ProgressBarProps, RadioButton, RadioButtonItem, type RadioButtonItemProps, type RadioButtonLabelAlignmentEnum, type RadioButtonProps, type RadioButtonSizeEnum, RadioGroup, type RadioGroupProps, RenderStateView, type RenderStateViewProps, RepeaterList, type RepeaterListProps, type RequiredFields, ResponsiveComponent, type ResponsiveComponentProps, Search, type SearchCallback, type SearchStyleEnum as SearchModeEnum, type SearchProps, Select, SelectListItem, type SelectListItemProps, type SelectProps, SelectProvider, SlideOutPanel, type SlideOutPanelDirectionEnum, type SlideOutPanelProps, type SlideOutPanelSizeEnum, Slider, type SliderProps, Spinner, type SpinnerProps, TabContent, type TabContentProps, TabItem, type TabItemProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextDecorationEnum, type TextProps, type TextTypeEnum, type TextWeightEnum, ThemeContext, type ThemeContextType, ThemeProvider, type ThemeProviderProps, Toggle, ToggleButton, type ToggleButtonProps, type ToggleLabelAlignmentEnum, type ToggleProps, Tooltip, type TooltipProps, type TriggerNotificationPayload, type UploadedFileMetadata, type UseModalReturn, WrapTextNodes, type WrapTextNodesProps, applyPropsToChildren, getClickAccessibilityProps, mergeRefs, useDebounce, useDropzoneContext, useForm, useFormTyped, useInflateView, useModal, useNotification, useSelectContext, useTab };
|