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
|
interface MyComponentProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof componentVariants> {
|
||||||
VariantProps<typeof componentVariants> {
|
|
||||||
// Additional props here
|
// Additional props here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,8 +244,7 @@ const componentVariants = cva(
|
|||||||
);
|
);
|
||||||
|
|
||||||
interface ComponentProps
|
interface ComponentProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof componentVariants> {}
|
||||||
VariantProps<typeof componentVariants> {}
|
|
||||||
|
|
||||||
export function Component({ variant, size, className, ...props }: ComponentProps) {
|
export function Component({ variant, size, className, ...props }: ComponentProps) {
|
||||||
return <div className={cn(componentVariants({ variant, size, className }))} {...props} />;
|
return <div className={cn(componentVariants({ variant, size, className }))} {...props} />;
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ const badgeVariants = cva(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export interface BadgeProps
|
export interface BadgeProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
||||||
VariantProps<typeof badgeVariants> {}
|
|
||||||
|
|
||||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ const buttonVariants = cva(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export interface ButtonProps
|
export interface ButtonProps
|
||||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
||||||
VariantProps<typeof buttonVariants> {
|
|
||||||
asChild?: boolean;
|
asChild?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ const sheetVariants = cva(
|
|||||||
);
|
);
|
||||||
|
|
||||||
interface SheetContentProps
|
interface SheetContentProps
|
||||||
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
extends
|
||||||
|
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||||
VariantProps<typeof sheetVariants> {}
|
VariantProps<typeof sheetVariants> {}
|
||||||
|
|
||||||
const SheetContent = React.forwardRef<
|
const SheetContent = React.forwardRef<
|
||||||
|
|||||||
Reference in New Issue
Block a user