PromoCursed/node_modules/.cache/babel-loader/08e6095050436e5048a2af96ad87639cfeba99f9a4fd7883891a06e23ff1dc58.json

1 line
22 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { TinyColor } from '@ctrl/tinycolor';\nimport seedToken from '../themes/seed';\nimport getAlphaColor from './getAlphaColor';\n/**\n * Seed (designer) > Derivative (designer) > Alias (developer).\n *\n * Merge seed & derivative & override token and generate alias token for developer.\n */\nexport default function formatToken(derivativeToken) {\n const {\n override\n } = derivativeToken,\n restToken = __rest(derivativeToken, [\"override\"]);\n const overrideTokens = Object.assign({}, override);\n Object.keys(seedToken).forEach(token => {\n delete overrideTokens[token];\n });\n const mergedToken = Object.assign(Object.assign({}, restToken), overrideTokens);\n const screenXS = 480;\n const screenSM = 576;\n const screenMD = 768;\n const screenLG = 992;\n const screenXL = 1200;\n const screenXXL = 1600;\n // Motion\n if (mergedToken.motion === false) {\n const fastDuration = '0s';\n mergedToken.motionDurationFast = fastDuration;\n mergedToken.motionDurationMid = fastDuration;\n mergedToken.motionDurationSlow = fastDuration;\n }\n // Generate alias token\n const aliasToken = Object.assign(Object.assign(Object.assign({}, mergedToken), {\n // ============== Background ============== //\n colorFillContent: mergedToken.colorFillSecondary,\n colorFillContentHover: mergedToken.colorFill,\n colorFillAlter: mergedToken.colorFillQuaternary,\n colorBgContainerDisabled: mergedToken.colorFillTertiary,\n // ============== Split ============== //\n colorBorderBg: mergedToken.colorBgContainer,\n colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),\n // ============== Text ============== //\n colorTextPlaceholder: mergedToken.colorTextQuaternary,\n colorTextDisabled: mergedToken.colorTextQuaternary,\n colorTextHeading: mergedToken.colorText,\n colorTextLabel: mergedToken.colorTextSecondary,\n colorTextDescription: mergedToken.colorTextTertiary,\n colorTextLightSolid: mergedToken.colorWhite,\n colorHighlight: mergedToken.colorError,\n colorBgTextHover: mergedToken.colorFillSecondary,\n colorBgTextActive: mergedToken.colorFill,\n colorIcon: mergedToken.colorTextTertiary,\n colorIconHover: mergedToken.colorText,\n colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer),\n colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer),\n // Font\n fontSizeIcon: mergedToken.fontSizeSM,\n // Line\n lineWidthFocus: mergedToken.lineWidth * 4,\n // Control\n lineWidth: mergedToken.lineWidth,\n controlOutlineWidth: mergedToken.lineWidth * 2,\n // Checkbox size and expand icon size\n controlInteractiveSize: mergedToken.controlHeight / 2,\n controlItemBgHover: mergedToken.colorFillTertiary,\n controlItemBgActive: mergedToken.colorPrimaryBg,\n controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,\n controlItemBgActiveDisabled: mergedToken.colorFill,\n controlTmpOutline: mergedToken.colorFillQuaternary,\n controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),\n lineType: mergedToken.lineType,\n borderRadius: mergedToken.borderRadius,\n borderRadiusXS: mergedToken.borderRadiusXS,\n borderRadiusSM: mergedToken.borderRadiusSM,\n borderRadiusLG: mergedToken.borderRadiusLG,\n fontWeightStrong: 600,\n opacityLoading: 0.65,\n linkDecoration: 'none',\n linkHoverDecoration: 'none',\n linkFocusDecoration: 'none',\n controlPaddingHorizontal: 12,\n controlPaddingHorizontalSM: 8,\n