mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
41 lines
1.5 KiB
JavaScript
41 lines
1.5 KiB
JavaScript
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
||
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
||
|
var _excluded = ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "popper", "show"];
|
||
|
import classNames from 'classnames';
|
||
|
import React from 'react';
|
||
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
||
|
import { useBootstrapPrefix } from './ThemeProvider';
|
||
|
var defaultProps = {
|
||
|
placement: 'right'
|
||
|
};
|
||
|
var Tooltip = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
||
|
var bsPrefix = _ref.bsPrefix,
|
||
|
placement = _ref.placement,
|
||
|
className = _ref.className,
|
||
|
style = _ref.style,
|
||
|
children = _ref.children,
|
||
|
arrowProps = _ref.arrowProps,
|
||
|
_ = _ref.popper,
|
||
|
_2 = _ref.show,
|
||
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
||
|
|
||
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
|
||
|
|
||
|
var _ref2 = (placement == null ? void 0 : placement.split('-')) || [],
|
||
|
primaryPlacement = _ref2[0];
|
||
|
|
||
|
return /*#__PURE__*/React.createElement("div", _extends({
|
||
|
ref: ref,
|
||
|
style: style,
|
||
|
role: "tooltip",
|
||
|
"x-placement": primaryPlacement,
|
||
|
className: classNames(className, bsPrefix, "bs-tooltip-" + primaryPlacement)
|
||
|
}, props), /*#__PURE__*/React.createElement("div", _extends({
|
||
|
className: "arrow"
|
||
|
}, arrowProps)), /*#__PURE__*/React.createElement("div", {
|
||
|
className: bsPrefix + "-inner"
|
||
|
}, children));
|
||
|
});
|
||
|
Tooltip.defaultProps = defaultProps;
|
||
|
Tooltip.displayName = 'Tooltip';
|
||
|
export default Tooltip;
|