@@ -21,9 +21,9 @@ import {
21
21
import type { VariantProps } from 'class-variance-authority' ;
22
22
import { cva } from 'class-variance-authority' ;
23
23
import * as React from 'react' ;
24
+ import type { ButtonVariantsProps } from '@/server/button-variants' ;
24
25
import { buttonVariants } from '@/server/button-variants' ;
25
26
import { cn } from '@/server/cn' ;
26
- import type { ButtonProps } from '@/react/button' ;
27
27
28
28
/* -----------------------------------------------------------------------------
29
29
* Classes
@@ -46,6 +46,10 @@ const alertDialogContentVariants = cva(
46
46
} ,
47
47
) ;
48
48
49
+ type AlertDialogContentVariantsProps = VariantProps <
50
+ typeof alertDialogContentVariants
51
+ > ;
52
+
49
53
/* -----------------------------------------------------------------------------
50
54
* Provider: AlertDialogContext
51
55
* -------------------------------------------------------------------------- */
@@ -78,7 +82,7 @@ export function AlertDialog({
78
82
* -------------------------------------------------------------------------- */
79
83
80
84
export interface AlertDialogContentProps
81
- extends Omit < VariantProps < typeof alertDialogContentVariants > , 'scrollable' > ,
85
+ extends Omit < AlertDialogContentVariantsProps , 'scrollable' > ,
82
86
ContentProps {
83
87
classNames ?: {
84
88
content ?: string ;
@@ -127,23 +131,20 @@ AlertDialogContent.displayName = Content.displayName;
127
131
* Component: AlertDialogAction
128
132
* -------------------------------------------------------------------------- */
129
133
130
- export interface AlertDialogActionProps extends ActionProps {
131
- variant ?: ButtonProps [ 'variant' ] ;
132
- size ?: ButtonProps [ 'size' ] ;
133
- shape ?: ButtonProps [ 'shape' ] ;
134
- block ?: ButtonProps [ 'block' ] ;
135
- }
134
+ export interface AlertDialogActionProps
135
+ extends ActionProps ,
136
+ ButtonVariantsProps { }
136
137
137
138
export const AlertDialogAction = React . forwardRef <
138
139
React . ElementRef < typeof Action > ,
139
140
AlertDialogActionProps
140
141
> (
141
142
(
142
- { className, variant = 'destructive' , size, shape , block , ...props } ,
143
+ { className, variant = 'destructive' , size, block , icon , ...props } ,
143
144
forwardedRef ,
144
145
) => (
145
146
< Action
146
- className = { cn ( buttonVariants ( { variant, size, shape , block } ) , className ) }
147
+ className = { cn ( buttonVariants ( { variant, size, block , icon } ) , className ) }
147
148
ref = { forwardedRef }
148
149
{ ...props }
149
150
/>
@@ -156,23 +157,20 @@ AlertDialogAction.displayName = Action.displayName;
156
157
* Component: AlertDialogCancel
157
158
* -------------------------------------------------------------------------- */
158
159
159
- export interface AlertDialogCancelProps extends CancelProps {
160
- variant ?: ButtonProps [ 'variant' ] ;
161
- size ?: ButtonProps [ 'size' ] ;
162
- shape ?: ButtonProps [ 'shape' ] ;
163
- block ?: ButtonProps [ 'block' ] ;
164
- }
160
+ export interface AlertDialogCancelProps
161
+ extends CancelProps ,
162
+ ButtonVariantsProps { }
165
163
166
164
export const AlertDialogCancel = React . forwardRef <
167
165
React . ElementRef < typeof Cancel > ,
168
166
AlertDialogCancelProps
169
167
> (
170
168
(
171
- { className, variant = 'outline' , size, shape , block , ...props } ,
169
+ { className, variant = 'outline' , size, block , icon , ...props } ,
172
170
forwardedRef ,
173
171
) => (
174
172
< Cancel
175
- className = { cn ( buttonVariants ( { variant, size, shape , block } ) , className ) }
173
+ className = { cn ( buttonVariants ( { variant, size, icon , block } ) , className ) }
176
174
ref = { forwardedRef }
177
175
{ ...props }
178
176
/>
0 commit comments