demio-ui 2.5.59 → 2.5.60
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/index.css +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/types/src/components/Button/Button.d.ts +2 -1
- package/dist/cjs/types/src/components/Toast/Toast.d.ts +5 -30
- package/dist/cjs/types/src/components/ToastList/ToastList.d.ts +3 -0
- package/dist/cjs/types/src/components/ToastList/index.d.ts +1 -0
- package/dist/cjs/types/src/utils/toast/toast.d.ts +15 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/types/src/components/Button/Button.d.ts +2 -1
- package/dist/esm/types/src/components/Toast/Toast.d.ts +5 -30
- package/dist/esm/types/src/components/ToastList/ToastList.d.ts +3 -0
- package/dist/esm/types/src/components/ToastList/index.d.ts +1 -0
- package/dist/esm/types/src/utils/toast/toast.d.ts +15 -1
- package/dist/types.d.ts +19 -31
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { MouseEventHandler, ReactNode } from 'react';
|
|
1
|
+
import React, { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
type Props = {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
children?: ReactNode;
|
|
@@ -11,6 +11,7 @@ type Props = {
|
|
|
11
11
|
suffix?: string | React.ReactNode;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
showLoader?: boolean;
|
|
14
|
+
style?: CSSProperties;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* Button component documentation.
|
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
showToast: (options?: IToast) => void;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
7
2
|
export interface IToast {
|
|
8
|
-
attempts?: number;
|
|
9
3
|
className?: string;
|
|
10
4
|
duration?: number;
|
|
5
|
+
icon?: ReactNode;
|
|
11
6
|
id?: number;
|
|
12
7
|
isClosable?: boolean;
|
|
13
|
-
isInfo?: boolean;
|
|
14
|
-
isError?: boolean;
|
|
15
|
-
isSuccess?: boolean;
|
|
16
8
|
message?: ReactNode;
|
|
17
9
|
onClose?: (id: number) => void;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
### Example of usage
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
import { toast } from 'demio-ui';
|
|
25
|
-
...
|
|
26
|
-
try {
|
|
27
|
-
...
|
|
28
|
-
} catch(error) {
|
|
29
|
-
toast({
|
|
30
|
-
message: error?.message || 'Some custom message',
|
|
31
|
-
isError: true,
|
|
32
|
-
onClose: (id) => console.log(`Close toast[${id}]`),
|
|
33
|
-
});
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
type?: 'error' | 'info' | 'success';
|
|
34
12
|
}
|
|
35
|
-
|
|
36
|
-
##### PS: Toast disappears on pressing the "Escape" button
|
|
37
|
-
**/
|
|
38
|
-
declare const Toast: FC;
|
|
13
|
+
declare const Toast: FC<IToast>;
|
|
39
14
|
export default Toast;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ToastList';
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IToast } from '../../components/Toast/Toast';
|
|
2
|
-
|
|
3
|
+
declare class ToastManager {
|
|
4
|
+
private setToastList;
|
|
5
|
+
constructor();
|
|
6
|
+
render: () => void;
|
|
7
|
+
updateSetter(setToastList: React.Dispatch<React.SetStateAction<IToast[]>>): void;
|
|
8
|
+
remove: (id: number) => void;
|
|
9
|
+
private getUIToastListAmount;
|
|
10
|
+
private add;
|
|
11
|
+
info: (options: IToast) => void;
|
|
12
|
+
success: (options: IToast) => void;
|
|
13
|
+
error: (options: IToast) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const toast: ToastManager;
|
|
16
|
+
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { MouseEventHandler, FC, ReactNode, SetStateAction, DragEvent, ReactEventHandler, PropsWithChildren } from 'react';
|
|
2
|
+
import React__default, { MouseEventHandler, FC, ReactNode, CSSProperties, SetStateAction, DragEvent, ReactEventHandler, PropsWithChildren } from 'react';
|
|
3
3
|
import { CheckedState } from '@radix-ui/react-checkbox';
|
|
4
4
|
import { Point, Area } from 'react-easy-crop';
|
|
5
5
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
@@ -59,6 +59,7 @@ type Props$i = {
|
|
|
59
59
|
suffix?: string | React__default.ReactNode;
|
|
60
60
|
fullWidth?: boolean;
|
|
61
61
|
showLoader?: boolean;
|
|
62
|
+
style?: CSSProperties;
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
65
|
* Button component documentation.
|
|
@@ -454,43 +455,18 @@ interface TagProps extends PropsWithChildren {
|
|
|
454
455
|
}
|
|
455
456
|
declare function Tag({ children, onDelete, className }: TagProps): React__default.JSX.Element;
|
|
456
457
|
|
|
457
|
-
declare global {
|
|
458
|
-
interface Window {
|
|
459
|
-
showToast: (options?: IToast) => void;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
458
|
interface IToast {
|
|
463
|
-
attempts?: number;
|
|
464
459
|
className?: string;
|
|
465
460
|
duration?: number;
|
|
461
|
+
icon?: ReactNode;
|
|
466
462
|
id?: number;
|
|
467
463
|
isClosable?: boolean;
|
|
468
|
-
isInfo?: boolean;
|
|
469
|
-
isError?: boolean;
|
|
470
|
-
isSuccess?: boolean;
|
|
471
464
|
message?: ReactNode;
|
|
472
465
|
onClose?: (id: number) => void;
|
|
473
|
-
|
|
466
|
+
style?: CSSProperties;
|
|
467
|
+
type?: 'error' | 'info' | 'success';
|
|
474
468
|
}
|
|
475
|
-
|
|
476
|
-
### Example of usage
|
|
477
|
-
|
|
478
|
-
```
|
|
479
|
-
import { toast } from 'demio-ui';
|
|
480
|
-
...
|
|
481
|
-
try {
|
|
482
|
-
...
|
|
483
|
-
} catch(error) {
|
|
484
|
-
toast({
|
|
485
|
-
message: error?.message || 'Some custom message',
|
|
486
|
-
isError: true,
|
|
487
|
-
onClose: (id) => console.log(`Close toast[${id}]`),
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
```
|
|
491
|
-
##### PS: Toast disappears on pressing the "Escape" button
|
|
492
|
-
**/
|
|
493
|
-
declare const Toast: FC;
|
|
469
|
+
declare const Toast: FC<IToast>;
|
|
494
470
|
|
|
495
471
|
type Props = {
|
|
496
472
|
align?: 'start' | 'center' | 'end';
|
|
@@ -2442,6 +2418,18 @@ declare const getCroppedImageURL: (imageSrc: string, pixelCrop: Area, rotation?:
|
|
|
2442
2418
|
vertical: boolean;
|
|
2443
2419
|
}) => Promise<string | null>;
|
|
2444
2420
|
|
|
2445
|
-
declare
|
|
2421
|
+
declare class ToastManager {
|
|
2422
|
+
private setToastList;
|
|
2423
|
+
constructor();
|
|
2424
|
+
render: () => void;
|
|
2425
|
+
updateSetter(setToastList: React__default.Dispatch<React__default.SetStateAction<IToast[]>>): void;
|
|
2426
|
+
remove: (id: number) => void;
|
|
2427
|
+
private getUIToastListAmount;
|
|
2428
|
+
private add;
|
|
2429
|
+
info: (options: IToast) => void;
|
|
2430
|
+
success: (options: IToast) => void;
|
|
2431
|
+
error: (options: IToast) => void;
|
|
2432
|
+
}
|
|
2433
|
+
declare const toast: ToastManager;
|
|
2446
2434
|
|
|
2447
2435
|
export { Alert, Avatar, Badge, Button$1 as Button, Button as ButtonNew, Card, Checkbox, Crop, DnDArea, Drawer, DropdownItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuTrigger, FormGroup, InfoBanner, Input, InputHint, Label, Loader, Modal, ModalWindow, MultiSelect, Pagination, Popover, PopoverTooltip, Progress, RadioGroup, Select, SelectItem, SelectItemText, SliderDemo as Slider, Switch, Tab, TabsContent, TabsList, TabsRoot, Tag, Toast, Tooltip, Typography, Upload, UploadError, UploadMenu, UploadProgressPreview, createImage, getCroppedImageURL, getFileExtension, getFileMimeType, getRadianAngle, index as icons, isExtensionMatchingMimeType, isImage, isValidFileDimension, isValidFileSize, isValidFileType, isVideo, mimeTypeMap, rotateSize, toast, useCroppedImage, useFileValidation };
|