@yamada-ui/notice 0.3.4 → 0.3.5
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/index.d.mts +5 -0
- package/dist/notice.d.mts +49 -0
- package/package.json +5 -6
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AlertProps } from '@yamada-ui/alert';
|
|
2
|
+
import { NoticeConfigOptions, NoticePlacement, NoticeComponentProps, CSSUIObject, StyledTheme } from '@yamada-ui/core';
|
|
3
|
+
import { Dict } from '@yamada-ui/utils';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
type UseNoticeOptions = NoticeConfigOptions;
|
|
7
|
+
type NoticeOptions = {
|
|
8
|
+
id: string | number;
|
|
9
|
+
placement: NoticePlacement;
|
|
10
|
+
duration: UseNoticeOptions['duration'];
|
|
11
|
+
status: UseNoticeOptions['status'];
|
|
12
|
+
message: (props: NoticeComponentProps) => ReactNode;
|
|
13
|
+
isDelete?: boolean;
|
|
14
|
+
onDelete: () => void;
|
|
15
|
+
onCloseComplete?: () => void;
|
|
16
|
+
style?: CSSUIObject;
|
|
17
|
+
};
|
|
18
|
+
declare const createNoticeFunc: (defaultOptions: UseNoticeOptions, theme: StyledTheme<Dict<any>>) => {
|
|
19
|
+
(options?: UseNoticeOptions): string | number;
|
|
20
|
+
update(id: string | number, options: Omit<UseNoticeOptions, 'id'>): void;
|
|
21
|
+
closeAll: (options?: {
|
|
22
|
+
placement?: NoticePlacement[];
|
|
23
|
+
}) => void;
|
|
24
|
+
close: (id: string | number) => void;
|
|
25
|
+
isActive: (id: string | number) => boolean;
|
|
26
|
+
};
|
|
27
|
+
type CreateNoticeReturn = ReturnType<typeof createNoticeFunc>;
|
|
28
|
+
declare const useNotice: (defaultOptions?: UseNoticeOptions) => CreateNoticeReturn;
|
|
29
|
+
type State = {
|
|
30
|
+
[K in NoticePlacement]: NoticeOptions[];
|
|
31
|
+
};
|
|
32
|
+
type Store = {
|
|
33
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
34
|
+
getSnapshot: () => State;
|
|
35
|
+
create: (message: (props: NoticeComponentProps) => ReactNode, options: UseNoticeOptions) => string | number;
|
|
36
|
+
close: (id: string | number) => void;
|
|
37
|
+
closeAll: (options?: {
|
|
38
|
+
placement?: NoticePlacement[];
|
|
39
|
+
}) => void;
|
|
40
|
+
update: (id: string | number, options: Omit<UseNoticeOptions, 'id'>) => void;
|
|
41
|
+
remove: (id: string | number, placement: NoticePlacement) => void;
|
|
42
|
+
isActive: (id: string | number) => boolean;
|
|
43
|
+
};
|
|
44
|
+
declare const noticeStore: Store;
|
|
45
|
+
type NoticeProps = Omit<AlertProps, keyof UseNoticeOptions> & UseNoticeOptions & {
|
|
46
|
+
onClose?: () => void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { NoticeOptions, NoticeProps, UseNoticeOptions, noticeStore, useNotice };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/notice",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Yamada UI notice component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,11 +35,10 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"
|
|
39
|
-
"@yamada-ui/
|
|
40
|
-
"@yamada-ui/
|
|
41
|
-
"@yamada-ui/
|
|
42
|
-
"@yamada-ui/utils": "0.1.2"
|
|
38
|
+
"@yamada-ui/core": "0.5.0",
|
|
39
|
+
"@yamada-ui/close-button": "0.2.5",
|
|
40
|
+
"@yamada-ui/alert": "0.3.5",
|
|
41
|
+
"@yamada-ui/utils": "0.1.3"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"react": "^18.0.0",
|