({
copied,
icon: Icon = CopyIcon,
className,
...props
}: IconProps & {
copied: boolean;
/** What the button rests on — a link glyph where the payload is a URL. */
icon?: ComponentType<IconProps>;
})
| 17 | * the transition collapses to an instant swap under `prefers-reduced-motion`. |
| 18 | */ |
| 19 | export const CopyStateIcon = ({ |
| 20 | copied, |
| 21 | icon: Icon = CopyIcon, |
| 22 | className, |
| 23 | ...props |
| 24 | }: IconProps & { |
| 25 | copied: boolean; |
| 26 | /** What the button rests on — a link glyph where the payload is a URL. */ |
| 27 | icon?: ComponentType<IconProps>; |
| 28 | }): ReactElement => { |
| 29 | const layer = classNames( |
| 30 | className, |
| 31 | 'col-start-1 row-start-1 transition-[opacity,transform,filter] duration-200 motion-reduce:transition-none', |
| 32 | EASE_OUT_EXPO, |
| 33 | ); |
| 34 | |
| 35 | return ( |
| 36 | <span className="inline-grid"> |
| 37 | <Icon |
| 38 | {...props} |
| 39 | className={classNames(layer, copied && 'scale-50 opacity-0 blur-[2px]')} |
| 40 | /> |
| 41 | <VIcon |
| 42 | {...props} |
| 43 | secondary |
| 44 | className={classNames( |
| 45 | layer, |
| 46 | 'text-status-success', |
| 47 | !copied && 'scale-50 opacity-0 blur-[2px]', |
| 48 | )} |
| 49 | /> |
| 50 | </span> |
| 51 | ); |
| 52 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected