UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

16 lines (15 loc) 836 B
import { __assign } from "tslib"; import React, { useCallback } from 'react'; import styles from './styles.css.js'; import { AnnotationIcon } from './annotation-icon'; import useFocusVisible from '../../internal/hooks/focus-visible/index.js'; export default React.forwardRef(function AnnotationTrigger(_a, ref) { var open = _a.open, onClickHandler = _a.onClick, i18nStrings = _a.i18nStrings; var focusVisible = useFocusVisible(); var onClick = useCallback(function (event) { event.preventDefault(); onClickHandler(); }, [onClickHandler]); return (React.createElement("button", __assign({ ref: ref, className: styles.hotspot, "aria-haspopup": "dialog", "aria-label": i18nStrings.labelHotspot(open), onClick: onClick }, focusVisible), React.createElement(AnnotationIcon, { open: open }))); });