1 | import classNames from 'classnames';
|
2 | import * as React from 'react';
|
3 | import { useBootstrapPrefix, useIsRTL } from './ThemeProvider';
|
4 | import { getOverlayDirection } from './helpers';
|
5 | import { jsx as _jsx } from "react/jsx-runtime";
|
6 | import { jsxs as _jsxs } from "react/jsx-runtime";
|
7 | const defaultProps = {
|
8 | placement: 'right'
|
9 | };
|
10 | const Tooltip = React.forwardRef(({
|
11 | bsPrefix,
|
12 | placement,
|
13 | className,
|
14 | style,
|
15 | children,
|
16 | arrowProps,
|
17 | popper: _,
|
18 | show: _2,
|
19 | ...props
|
20 | }, ref) => {
|
21 | bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
|
22 | const isRTL = useIsRTL();
|
23 | const [primaryPlacement] = (placement == null ? void 0 : placement.split('-')) || [];
|
24 | const bsDirection = getOverlayDirection(primaryPlacement, isRTL);
|
25 | return _jsxs("div", {
|
26 | ref: ref,
|
27 | style: style,
|
28 | role: "tooltip",
|
29 | "x-placement": primaryPlacement,
|
30 | className: classNames(className, bsPrefix, `bs-tooltip-${bsDirection}`),
|
31 | ...props,
|
32 | children: [_jsx("div", {
|
33 | className: "tooltip-arrow",
|
34 | ...arrowProps
|
35 | }), _jsx("div", {
|
36 | className: `${bsPrefix}-inner`,
|
37 | children: children
|
38 | })]
|
39 | });
|
40 | });
|
41 | Tooltip.defaultProps = defaultProps;
|
42 | Tooltip.displayName = 'Tooltip';
|
43 | export default Tooltip; |
\ | No newline at end of file |