@@ -5,53 +5,43 @@ import { Button, type ButtonProps } from '../button/button'
55
66/** Transparent, bordered icon action over code or preview content. */
77export const overlayActionButtonVariants = cva (
8- 'cursor-pointer border border-[var(--border)] bg-transparent p-0 backdrop-blur-xs' ,
8+ 'cursor-pointer border border-[var(--border)] bg-transparent p-0 backdrop-blur-xs hover-hover:bg-[var(--surface-3)] dark:hover-hover:bg-[var(--surface-5)] hover-hover:border-[var(--border)] ' ,
99 {
1010 variants : {
1111 size : {
1212 sm : 'size-[20px]' ,
1313 md : 'size-[28px]' ,
1414 } ,
15- surface : {
16- adaptive :
17- 'hover-hover:bg-[var(--surface-3)] dark:hover-hover:bg-[var(--surface-5)] hover-hover:border-[var(--border)]' ,
18- uniform : 'hover-hover:bg-[var(--surface-4)]' ,
19- } ,
2015 } ,
21- defaultVariants : { size : 'sm' , surface : 'adaptive' } ,
16+ defaultVariants : { size : 'sm' } ,
2217 }
2318)
2419
2520export interface OverlayActionButtonProps
26- extends Omit < ButtonProps , 'variant' | 'size' | 'iconPadding' > {
21+ extends Omit < ButtonProps , 'variant' | 'size' | 'iconPadding' | 'iconSize' > {
2722 /** Accessible name for the icon action; tooltip content is supplied separately. */
2823 'aria-label' : string
2924 /** 20px by default; `md` provides the 28px preview action. */
3025 size ?: NonNullable < VariantProps < typeof overlayActionButtonVariants > [ 'size' ] >
31- /**
32- * `adaptive` uses surface-3 on hover in light mode and surface-5 in dark mode.
33- * `uniform` uses surface-4 on hover in both themes.
34- * @default 'adaptive'
35- */
36- surface ?: NonNullable < VariantProps < typeof overlayActionButtonVariants > [ 'surface' ] >
3726}
3827
3928/**
4029 * Icon action floating over content. Owns geometry, border, blur and hover treatment;
4130 * callers supply positioning, icons, labels and command behavior.
31+ * Hover uses surface-3 in light mode and surface-5 in dark mode.
4232 * Forwards the native button ref and props for tooltip `asChild` composition.
4333 * Native form behavior is inherited from Button; pass `type` when it must be explicit.
4434 *
4535 * @example <OverlayActionButton aria-label='Copy' type='button' onClick={onCopy}><Clipboard className='size-[10px]' /></OverlayActionButton>
4636 */
4737export const OverlayActionButton = forwardRef < HTMLButtonElement , OverlayActionButtonProps > (
48- ( { size, surface , className, ...props } , ref ) => (
38+ ( { size, className, ...props } , ref ) => (
4939 < Button
5040 { ...props }
5141 ref = { ref }
5242 variant = 'ghost'
5343 size = 'md'
54- className = { cn ( overlayActionButtonVariants ( { size, surface } ) , className ) }
44+ className = { cn ( overlayActionButtonVariants ( { size } ) , className ) }
5545 />
5646 )
5747)
0 commit comments