PromoCursed/node_modules/.cache/babel-loader/60feafd7d13e179bb2b98896b28157cf3cf592e0d17fd4999c761259ad060836.json

1 line
12 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { initZoomMotion } from '../../style/motion';\nimport getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS } from '../../style/placementArrow';\nimport { getArrowToken } from '../../style/roundedArrow';\nimport { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal';\nconst genTooltipStyle = token => {\n const {\n componentCls,\n // ant-tooltip\n tooltipMaxWidth,\n tooltipColor,\n tooltipBg,\n tooltipBorderRadius,\n zIndexPopup,\n controlHeight,\n boxShadowSecondary,\n paddingSM,\n paddingXS\n } = token;\n return [{\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'absolute',\n zIndex: zIndexPopup,\n display: 'block',\n width: 'max-content',\n maxWidth: tooltipMaxWidth,\n visibility: 'visible',\n // When use `autoArrow`, origin will follow the arrow position\n '--valid-offset-x': 'var(--arrow-offset-horizontal, var(--arrow-x))',\n transformOrigin: [`var(--valid-offset-x, 50%)`, `var(--arrow-y, 50%)`].join(' '),\n '&-hidden': {\n display: 'none'\n },\n '--antd-arrow-background-color': tooltipBg,\n // Wrapper for the tooltip content\n [`${componentCls}-inner`]: {\n minWidth: '1em',\n minHeight: controlHeight,\n padding: `${unit(token.calc(paddingSM).div(2).equal())} ${unit(paddingXS)}`,\n color: tooltipColor,\n textAlign: 'start',\n textDecoration: 'none',\n wordWrap: 'break-word',\n backgroundColor: tooltipBg,\n borderRadius: tooltipBorderRadius,\n boxShadow: boxShadowSecondary,\n boxSizing: 'border-box'\n },\n // Limit left and right placement radius\n [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(',')]: {\n [`${componentCls}-inner`]: {\n borderRadius: token.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)\n }\n },\n [`${componentCls}-content`]: {\n position: 'relative'\n }\n }), genPresetColor(token, (colorKey, _ref) => {\n let {\n darkColor\n } = _ref;\n return {\n [`&${componentCls}-${colorKey}`]: {\n [`${componentCls}-inner`]: {\n backgroundColor: darkColor\n },\n [`${componentCls}-arrow`]: {\n '--antd-arrow-background-color': darkColor\n }\n }\n };\n })), {\n // RTL\n '&-rtl': {\n direction: 'rtl'\n }\n })\n },\n // Arrow Style\n getArrowStyle(token, 'var(--antd-arrow-background-color)'),\n // Pure Render\n {\n [`${componentCls}-pure`]: {\n position: 'relative',\n maxWidth: 'none',\n margin: token.sizePopupArrow\n }\n }];\n};\n// ============================== Export ==============================\nexport const prepareComponentToken = token => Object.assign(Object.assign({\n zIndexPopup: token.zIndexPopupBase + 70\n}, getArrowOffsetToken({\n contentRadius: token.borderRadius,\n limitVerticalRadius: true\n})), getArrowToken(mergeToken(token, {\n borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)\n})));\nexport default (function (prefixCls) {\n let injectStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n const useStyle = genStyleHooks('Tooltip', token => {\n const {\n borderRadius,\n colorTextLightSolid,\n colorBgSpotlight\n } = token;\n const TooltipToken = mergeToken(token, {\n // default variables\n tooltipMaxWidth: 250,\n tooltipColor: colorTextLightSolid,\n tooltipBorderRadius: borderRadius,\n tooltipBg: colorBgSpotlight\n });\n return [genTooltipStyle(TooltipToken), initZoomMotion(token, 'zoom-big-fast')];\n }, prepareComponentToken, {\n resetStyle: false,\n // Popover use Tooltip as int