Skip to content

Commit 8fbdf59

Browse files
committed
feat: update IconButton to use class-variance-authority for variant props
1 parent 26ce34b commit 8fbdf59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/shadcn/src/IconButton/IconButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
22
import { ChevronDown, ChevronUp, Copy, Trash2 } from 'lucide-react';
3+
import type { VariantProps } from 'class-variance-authority';
34

4-
import { Button, ButtonProps } from '../components/ui/button';
5+
import { Button, buttonVariants } from '../components/ui/button';
56

67
/** Base button component that renders a Shadcn button with an icon for RJSF form actions.
78
* This component serves as the foundation for other specialized buttons used in array operations.
@@ -11,7 +12,7 @@ import { Button, ButtonProps } from '../components/ui/button';
1112
* @param props - The combined props from RJSF IconButtonProps and Shadcn ButtonProps, including icon and event handlers
1213
*/
1314
export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
14-
props: IconButtonProps<T, S, F> & ButtonProps,
15+
props: IconButtonProps<T, S, F> & VariantProps<typeof buttonVariants>,
1516
) {
1617
const { icon, iconType, className, uiSchema, registry, ...otherProps } = props;
1718
return (

0 commit comments

Comments
 (0)