Refactor component props formatting for consistency in extends usage across UI and documentation files
This commit is contained in:
@@ -231,8 +231,7 @@ const componentVariants = cva(
|
||||
);
|
||||
|
||||
interface MyComponentProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof componentVariants> {
|
||||
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof componentVariants> {
|
||||
// Additional props here
|
||||
}
|
||||
|
||||
|
||||
@@ -244,8 +244,7 @@ const componentVariants = cva(
|
||||
);
|
||||
|
||||
interface ComponentProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof componentVariants> {}
|
||||
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof componentVariants> {}
|
||||
|
||||
export function Component({ variant, size, className, ...props }: ComponentProps) {
|
||||
return <div className={cn(componentVariants({ variant, size, className }))} {...props} />;
|
||||
|
||||
@@ -23,8 +23,7 @@ const badgeVariants = cva(
|
||||
);
|
||||
|
||||
export interface BadgeProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof badgeVariants> {}
|
||||
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
||||
|
||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||
|
||||
@@ -32,8 +32,7 @@ const buttonVariants = cva(
|
||||
);
|
||||
|
||||
export interface ButtonProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
VariantProps<typeof buttonVariants> {
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
||||
asChild?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ const sheetVariants = cva(
|
||||
);
|
||||
|
||||
interface SheetContentProps
|
||||
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||
extends
|
||||
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||
VariantProps<typeof sheetVariants> {}
|
||||
|
||||
const SheetContent = React.forwardRef<
|
||||
|
||||
Reference in New Issue
Block a user