Wrap delegated Button/Image in DOM element, remove data-slot attributes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,11 @@ export interface ButtonProps
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Button({ variant = "default", size = "default", ...props }: ButtonProps) {
|
function Button({ variant = "default", size = "default", ...props }: ButtonProps) {
|
||||||
return <ShadcnButton variant={variant} size={size} {...props} />
|
return (
|
||||||
|
<span className="inline-block">
|
||||||
|
<ShadcnButton variant={variant} size={size} {...props} />
|
||||||
|
</span>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Button }
|
export { Button }
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ function Card({
|
|||||||
}: CardProps) {
|
}: CardProps) {
|
||||||
return (
|
return (
|
||||||
<ShadcnCard
|
<ShadcnCard
|
||||||
data-slot="element-card"
|
|
||||||
className={cn("overflow-hidden pt-0", className)}
|
className={cn("overflow-hidden pt-0", className)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
|
import NextImage from "next/image"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
@@ -37,18 +38,19 @@ function Image({
|
|||||||
className,
|
className,
|
||||||
}: ImageProps) {
|
}: ImageProps) {
|
||||||
return (
|
return (
|
||||||
<img
|
<span className="inline-block">
|
||||||
data-slot="image"
|
<NextImage
|
||||||
src={src}
|
src={src}
|
||||||
alt={alt}
|
alt={alt}
|
||||||
height={height}
|
height={height}
|
||||||
width={width}
|
width={width}
|
||||||
className={cn(
|
className={cn(
|
||||||
objectFitStyles[objectFit],
|
objectFitStyles[objectFit],
|
||||||
circle ? "rounded-full" : "rounded-md",
|
circle ? "rounded-full" : "rounded-md",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ function Typography({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Comp
|
<Comp
|
||||||
data-slot="typography"
|
|
||||||
data-variant={variant}
|
data-variant={variant}
|
||||||
className={cn(
|
className={cn(
|
||||||
variantStyles[variant],
|
variantStyles[variant],
|
||||||
|
|||||||
Reference in New Issue
Block a user