@elastic/eui
Version:
Elastic UI Component Library
40 lines (39 loc) • 1.63 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position", "delay"];
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React from 'react';
import { useEuiI18n } from '../i18n';
import { EuiIcon } from '../icon';
import { EuiToolTip } from './tool_tip';
import { jsx as ___EmotionJSX } from "@emotion/react";
export var EuiIconTip = function EuiIconTip(_ref) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
ariaLabel = _ref['aria-label'],
color = _ref.color,
size = _ref.size,
iconProps = _ref.iconProps,
_ref$position = _ref.position,
position = _ref$position === void 0 ? 'top' : _ref$position,
_ref$delay = _ref.delay,
delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
rest = _objectWithoutProperties(_ref, _excluded);
var defaultAriaLabel = useEuiI18n('euiIconTip.defaultAriaLabel', 'Info');
return ___EmotionJSX(EuiToolTip, _extends({
position: position,
delay: delay
}, rest), ___EmotionJSX(EuiIcon, _extends({
tabIndex: 0,
type: type,
color: color,
size: size,
"aria-label": ariaLabel || defaultAriaLabel
}, iconProps)));
};