Commit cb4bd40 1 parent 87eb883 commit cb4bd40 Copy full SHA for cb4bd40
File tree 6 files changed +49
-29
lines changed
6 files changed +49
-29
lines changed Original file line number Diff line number Diff line change 16
16
"bugs" : {
17
17
"url" : " https://github.com/Codpoe/shadcn-react/issues"
18
18
},
19
- "homepage" : " https://github.com/Codpoe/ shadcn-react#readme " ,
19
+ "homepage" : " https://codpoe. github.io/ shadcn-react" ,
20
20
"author" :
" Codpoe <[email protected] > (https://github.com/codpoe)" ,
21
21
"engines" : {
22
22
"node" : " >=18.18.0" ,
Original file line number Diff line number Diff line change @@ -58,21 +58,27 @@ export function Dialog(props: DialogProps) {
58
58
setOkLoading ( true ) ;
59
59
} , 50 ) ;
60
60
61
- await onOk ?.( ev ) ;
62
- clearTimeout ( timer ) ;
63
- setOkLoading ( false ) ;
64
- closeBtnRef . current ?. click ( ) ;
61
+ try {
62
+ await onOk ?.( ev ) ;
63
+ closeBtnRef . current ?. click ( ) ;
64
+ } finally {
65
+ clearTimeout ( timer ) ;
66
+ setOkLoading ( false ) ;
67
+ }
65
68
} ;
66
69
67
70
const handleCancel = async ( ev : MouseEvent ) => {
68
71
const timer = setTimeout ( ( ) => {
69
72
setCancelLoading ( true ) ;
70
73
} , 50 ) ;
71
74
72
- await onCancel ?.( ev ) ;
73
- clearTimeout ( timer ) ;
74
- setCancelLoading ( false ) ;
75
- closeBtnRef . current ?. click ( ) ;
75
+ try {
76
+ await onCancel ?.( ev ) ;
77
+ closeBtnRef . current ?. click ( ) ;
78
+ } finally {
79
+ clearTimeout ( timer ) ;
80
+ setCancelLoading ( false ) ;
81
+ }
76
82
} ;
77
83
78
84
return (
Original file line number Diff line number Diff line change @@ -63,21 +63,27 @@ export function Drawer(props: DrawerProp) {
63
63
setOkLoading ( true ) ;
64
64
} , 50 ) ;
65
65
66
- await onOk ?.( ev ) ;
67
- clearTimeout ( timer ) ;
68
- setOkLoading ( false ) ;
69
- closeBtnRef . current ?. click ( ) ;
66
+ try {
67
+ await onOk ?.( ev ) ;
68
+ closeBtnRef . current ?. click ( ) ;
69
+ } finally {
70
+ clearTimeout ( timer ) ;
71
+ setOkLoading ( false ) ;
72
+ }
70
73
} ;
71
74
72
75
const handleCancel = async ( ev : MouseEvent ) => {
73
76
const timer = setTimeout ( ( ) => {
74
77
setCancelLoading ( true ) ;
75
78
} , 50 ) ;
76
79
77
- await onCancel ?.( ev ) ;
78
- clearTimeout ( timer ) ;
79
- setCancelLoading ( false ) ;
80
- closeBtnRef . current ?. click ( ) ;
80
+ try {
81
+ await onCancel ?.( ev ) ;
82
+ closeBtnRef . current ?. click ( ) ;
83
+ } finally {
84
+ clearTimeout ( timer ) ;
85
+ setCancelLoading ( false ) ;
86
+ }
81
87
} ;
82
88
83
89
return (
Original file line number Diff line number Diff line change @@ -66,9 +66,10 @@ export interface DropdownItemProps
66
66
}
67
67
68
68
export interface DropdownProps
69
- extends DropdownMenuProps ,
70
- Omit < DropdownMenuContentProps , 'content' > {
69
+ extends Omit < DropdownMenuProps , 'children' > ,
70
+ Omit < DropdownMenuContentProps , 'content' | 'children' > {
71
71
content ?: React . ReactNode ;
72
+ children ?: React . ReactNode ;
72
73
className ?: string ;
73
74
style ?: React . CSSProperties ;
74
75
}
Original file line number Diff line number Diff line change @@ -62,21 +62,27 @@ export function Sheet(props: SheetProps) {
62
62
setOkLoading ( true ) ;
63
63
} , 50 ) ;
64
64
65
- await onOk ?.( ev ) ;
66
- clearTimeout ( timer ) ;
67
- setOkLoading ( false ) ;
68
- closeBtnRef . current ?. click ( ) ;
65
+ try {
66
+ await onOk ?.( ev ) ;
67
+ closeBtnRef . current ?. click ( ) ;
68
+ } finally {
69
+ clearTimeout ( timer ) ;
70
+ setOkLoading ( false ) ;
71
+ }
69
72
} ;
70
73
71
74
const handleCancel = async ( ev : MouseEvent ) => {
72
75
const timer = setTimeout ( ( ) => {
73
76
setCancelLoading ( true ) ;
74
77
} , 50 ) ;
75
78
76
- await onCancel ?.( ev ) ;
77
- clearTimeout ( timer ) ;
78
- setCancelLoading ( false ) ;
79
- closeBtnRef . current ?. click ( ) ;
79
+ try {
80
+ await onCancel ?.( ev ) ;
81
+ closeBtnRef . current ?. click ( ) ;
82
+ } finally {
83
+ clearTimeout ( timer ) ;
84
+ setCancelLoading ( false ) ;
85
+ }
80
86
} ;
81
87
82
88
return (
Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ interface TooltipContentProps
10
10
extends ComponentPropsWithoutRef < typeof TooltipContent > { }
11
11
12
12
export interface TooltipProps
13
- extends ComponentPropsWithoutRef < typeof UiTooltip > ,
14
- Omit < TooltipContentProps , 'content' > {
13
+ extends Omit < ComponentPropsWithoutRef < typeof UiTooltip > , 'children' > ,
14
+ Omit < TooltipContentProps , 'content' | 'children' > {
15
+ children ?: React . ReactNode ;
15
16
content ?: React . ReactNode ;
16
17
className ?: string ;
17
18
style ?: React . CSSProperties ;
You can’t perform that action at this time.
0 commit comments