PromoCursed/node_modules/.cache/babel-loader/c13f37cc9b8cd8d6e67aa9a3989654a50295334d7d0688475c86ec929370db30.json

1 line
8.9 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { prepareComponentToken, prepareToken } from '.';\nimport { resetComponent } from '../../style';\nimport { genPresetColor, genStyleHooks } from '../../theme/internal';\n// ============================== Ribbon ==============================\nconst genRibbonStyle = token => {\n const {\n antCls,\n badgeFontHeight,\n marginXS,\n badgeRibbonOffset,\n calc\n } = token;\n const ribbonPrefixCls = `${antCls}-ribbon`;\n const ribbonWrapperPrefixCls = `${antCls}-ribbon-wrapper`;\n const statusRibbonPreset = genPresetColor(token, (colorKey, _ref) => {\n let {\n darkColor\n } = _ref;\n return {\n [`&${ribbonPrefixCls}-color-${colorKey}`]: {\n background: darkColor,\n color: darkColor\n }\n };\n });\n return {\n [ribbonWrapperPrefixCls]: {\n position: 'relative'\n },\n [ribbonPrefixCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'absolute',\n top: marginXS,\n padding: `0 ${unit(token.paddingXS)}`,\n color: token.colorPrimary,\n lineHeight: unit(badgeFontHeight),\n whiteSpace: 'nowrap',\n backgroundColor: token.colorPrimary,\n borderRadius: token.borderRadiusSM,\n [`${ribbonPrefixCls}-text`]: {\n color: token.colorTextLightSolid\n },\n [`${ribbonPrefixCls}-corner`]: {\n position: 'absolute',\n top: '100%',\n width: badgeRibbonOffset,\n height: badgeRibbonOffset,\n color: 'currentcolor',\n border: `${unit(calc(badgeRibbonOffset).div(2).equal())} solid`,\n transform: token.badgeRibbonCornerTransform,\n transformOrigin: 'top',\n filter: token.badgeRibbonCornerFilter\n }\n }), statusRibbonPreset), {\n [`&${ribbonPrefixCls}-placement-end`]: {\n insetInlineEnd: calc(badgeRibbonOffset).mul(-1).equal(),\n borderEndEndRadius: 0,\n [`${ribbonPrefixCls}-corner`]: {\n insetInlineEnd: 0,\n borderInlineEndColor: 'transparent',\n borderBlockEndColor: 'transparent'\n }\n },\n [`&${ribbonPrefixCls}-placement-start`]: {\n insetInlineStart: calc(badgeRibbonOffset).mul(-1).equal(),\n borderEndStartRadius: 0,\n [`${ribbonPrefixCls}-corner`]: {\n insetInlineStart: 0,\n borderBlockEndColor: 'transparent',\n borderInlineStartColor: 'transparent'\n }\n },\n // ====================== RTL =======================\n '&-rtl': {\n direction: 'rtl'\n }\n })\n };\n};\n// ============================== Export ==============================\nexport default genStyleHooks(['Badge', 'Ribbon'], token => {\n const badgeToken = prepareToken(token);\n return genRibbonStyle(badgeToken);\n}, prepareComponentToken);","map":{"version":3,"names":["unit","prepareComponentToken","prepareToken","resetComponent","genPresetColor","genStyleHooks","genRibbonStyle","token","antCls","badgeFontHeight","marginXS","badgeRibbonOffset","calc","ribbonPrefixCls","ribbonWrapperPrefixCls","statusRibbonPreset","colorKey","_ref","darkColor","background","color","position","Object","assign","top","padding","paddingXS","colorPrimary","lineHeight","whiteSpace","backgroundColor","borderRadius","borderRadiusSM","colorTextLightSolid","width","height","border","div","equal","transform","badgeRibbonCornerTransform","transformOrigin","filter","badgeRibbonCornerFilter","insetInlineEnd","mul","borderEndEndRadius","borderInlineEndColor","borderBlockEndColor","insetInlineStart","borderEndStartRadius","borderInlineStartColor","direction","badgeToken"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/badge/style/ribbon.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { prepareComponentToken, prepareToken } from '.';\nimport { resetComponent } from '../../style';\nimport { genPresetColor, genStyleHooks } from '../../theme/internal';\n// ============================== Ribbon ====