({size = 'M', brandColor, children, styles, ...otherProps}: AIButtonProps)
| 244 | * An AIButton triggers an AI-powered action with a customizable branded appearance. |
| 245 | */ |
| 246 | export function AIButton({size = 'M', brandColor, children, styles, ...otherProps}: AIButtonProps) { |
| 247 | let ref = useRef<HTMLButtonElement | null>(null); |
| 248 | return ( |
| 249 | <Button |
| 250 | {...otherProps} |
| 251 | ref={ref} |
| 252 | className={renderProps => bg + mergeStyles(button({size, ...renderProps}), styles)} |
| 253 | // eslint-disable-next-line react/react-compiler |
| 254 | style={pressScale(ref, {'--brand': brandColor} as CSSProperties)}> |
| 255 | <IconContext.Provider value={{styles: style({size: fontRelative(16), flexShrink: 0})}}> |
| 256 | <AIIcon /> |
| 257 | </IconContext.Provider> |
| 258 | {children && <span>{children}</span>} |
| 259 | </Button> |
| 260 | ); |
| 261 | } |
| 262 | |
| 263 | const AIIcon = createIcon(props => { |
| 264 | return ( |
nothing calls this directly
no test coverage detected