1 line
30 KiB
JSON
1 line
30 KiB
JSON
|
{"ast":null,"code":"import { Keyframes, unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal';\nconst antStatusProcessing = new Keyframes('antStatusProcessing', {\n '0%': {\n transform: 'scale(0.8)',\n opacity: 0.5\n },\n '100%': {\n transform: 'scale(2.4)',\n opacity: 0\n }\n});\nconst antZoomBadgeIn = new Keyframes('antZoomBadgeIn', {\n '0%': {\n transform: 'scale(0) translate(50%, -50%)',\n opacity: 0\n },\n '100%': {\n transform: 'scale(1) translate(50%, -50%)'\n }\n});\nconst antZoomBadgeOut = new Keyframes('antZoomBadgeOut', {\n '0%': {\n transform: 'scale(1) translate(50%, -50%)'\n },\n '100%': {\n transform: 'scale(0) translate(50%, -50%)',\n opacity: 0\n }\n});\nconst antNoWrapperZoomBadgeIn = new Keyframes('antNoWrapperZoomBadgeIn', {\n '0%': {\n transform: 'scale(0)',\n opacity: 0\n },\n '100%': {\n transform: 'scale(1)'\n }\n});\nconst antNoWrapperZoomBadgeOut = new Keyframes('antNoWrapperZoomBadgeOut', {\n '0%': {\n transform: 'scale(1)'\n },\n '100%': {\n transform: 'scale(0)',\n opacity: 0\n }\n});\nconst antBadgeLoadingCircle = new Keyframes('antBadgeLoadingCircle', {\n '0%': {\n transformOrigin: '50%'\n },\n '100%': {\n transform: 'translate(50%, -50%) rotate(360deg)',\n transformOrigin: '50%'\n }\n});\nconst genSharedBadgeStyle = token => {\n const {\n componentCls,\n iconCls,\n antCls,\n badgeShadowSize,\n motionDurationSlow,\n textFontSize,\n textFontSizeSM,\n statusSize,\n dotSize,\n textFontWeight,\n indicatorHeight,\n indicatorHeightSM,\n marginXS,\n calc\n } = token;\n const numberPrefixCls = `${antCls}-scroll-number`;\n const colorPreset = genPresetColor(token, (colorKey, _ref) => {\n let {\n darkColor\n } = _ref;\n return {\n [`&${componentCls} ${componentCls}-color-${colorKey}`]: {\n background: darkColor,\n [`&:not(${componentCls}-count)`]: {\n color: darkColor\n },\n 'a:hover &': {\n background: darkColor\n }\n }\n };\n });\n return {\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n display: 'inline-block',\n width: 'fit-content',\n lineHeight: 1,\n [`${componentCls}-count`]: {\n display: 'inline-flex',\n justifyContent: 'center',\n zIndex: token.indicatorZIndex,\n minWidth: indicatorHeight,\n height: indicatorHeight,\n color: token.badgeTextColor,\n fontWeight: textFontWeight,\n fontSize: textFontSize,\n lineHeight: unit(indicatorHeight),\n whiteSpace: 'nowrap',\n textAlign: 'center',\n background: token.badgeColor,\n borderRadius: calc(indicatorHeight).div(2).equal(),\n boxShadow: `0 0 0 ${unit(badgeShadowSize)} ${token.badgeShadowColor}`,\n transition: `background ${token.motionDurationMid}`,\n a: {\n color: token.badgeTextColor\n },\n 'a:hover': {\n color: token.badgeTextColor\n },\n 'a:hover &': {\n background: token.badgeColorHover\n }\n },\n [`${componentCls}-count-sm`]: {\n minWidth: indicatorHeightSM,\n height: indicatorHeightSM,\n fontSize: textFontSizeSM,\n lineHeight: unit(indicatorHeightSM),\n borderRadius: calc(indicatorHeightSM).div(2).equal()\n },\n [`${componentCls}-multiple-words`]: {\n padding: `0 ${unit(token.paddingXS)}`,\n bdi: {\n unicodeBidi: 'plaintext'\n }\n },\n [`${componentCls}-dot`]: {\n zIndex: token.indicatorZIndex,\n width: dotSize,\n minWidth: dotSize,\n height: dotSize,\n background: token.badgeColor,\n borderRadius: '100%',\n boxShadow: `0 0 0 ${unit(badgeShadowSize)} ${token.badgeShadowColor}`\n },\n [`${component
|