( props: FocusRingProps )
| 42 | * not with a mouse, touch, or other input methods. |
| 43 | */ |
| 44 | export function FocusRing( |
| 45 | props: FocusRingProps |
| 46 | ): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> { |
| 47 | let {children, focusClass, focusRingClass} = props; |
| 48 | let {isFocused, isFocusVisible, focusProps} = useFocusRing(props); |
| 49 | let child = React.Children.only(children); |
| 50 | |
| 51 | return React.cloneElement( |
| 52 | child, |
| 53 | mergeProps(child.props as any, { |
| 54 | ...focusProps, |
| 55 | className: clsx({ |
| 56 | [focusClass || '']: isFocused, |
| 57 | [focusRingClass || '']: isFocusVisible |
| 58 | }) |
| 59 | }) |
| 60 | ); |
| 61 | } |
nothing calls this directly
no test coverage detected