@razorpay/blade
Version:
The Design System that powers Razorpay
48 lines (45 loc) • 1.55 kB
JavaScript
import React__default from 'react';
import { TooltipContentWrapper } from './TooltipContentWrapper.web.js';
import '../Typography/index.js';
import '../../utils/index.js';
import '../../tokens/global/index.js';
import { jsxs, jsx } from 'react/jsx-runtime';
import { isReactNative } from '../../utils/platform/isReactNative.js';
import { makeSize } from '../../utils/makeSize/makeSize.js';
import { size } from '../../tokens/global/size.js';
import { Text } from '../Typography/Text/Text.js';
var TooltipContent = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
var children = _ref.children,
title = _ref.title,
arrow = _ref.arrow,
side = _ref.side,
style = _ref.style,
isVisible = _ref.isVisible;
return /*#__PURE__*/jsxs(TooltipContentWrapper, {
position: isReactNative() ? 'absolute' : 'relative',
paddingTop: "spacing.3",
paddingBottom: "spacing.3",
paddingLeft: "spacing.4",
paddingRight: "spacing.4",
maxWidth: makeSize(size[200]),
ref: ref,
styles: style,
side: side,
isVisible: isVisible,
children: [title ? /*#__PURE__*/jsx(Text, {
weight: "semibold",
size: "medium",
color: "surface.text.staticWhite.normal",
children: title
}) : null, /*#__PURE__*/jsx(Text, {
variant: "body",
size: "small",
weight: "regular",
color: "surface.text.staticWhite.subtle",
wordBreak: "break-word",
children: children
}), arrow]
});
});
export { TooltipContent };
//# sourceMappingURL=TooltipContent.js.map