@elastic/eui
Version:
Elastic UI Component Library
38 lines (37 loc) • 1.56 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"];
/*
* 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.
*/
/* eslint-disable @elastic/eui/prefer-eui-icon-tip */
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 ? 'question' : _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,
rest = _objectWithoutProperties(_ref, _excluded);
var defaultAriaLabel = useEuiI18n('euiIconTip.defaultAriaLabel', 'Info');
return ___EmotionJSX(EuiToolTip, _extends({
position: position
}, rest), ___EmotionJSX(EuiIcon, _extends({
tabIndex: 0,
type: type,
color: color,
size: size,
"aria-label": ariaLabel || defaultAriaLabel
}, iconProps)));
};