1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks } from '../../theme/internal';\nconst genAlertTypeStyle = (bgColor, borderColor, iconColor, token, alertCls) => ({\n background: bgColor,\n border: `${unit(token.lineWidth)} ${token.lineType} ${borderColor}`,\n [`${alertCls}-icon`]: {\n color: iconColor\n }\n});\nexport const genBaseStyle = token => {\n const {\n componentCls,\n motionDurationSlow: duration,\n marginXS,\n marginSM,\n fontSize,\n fontSizeLG,\n lineHeight,\n borderRadiusLG: borderRadius,\n motionEaseInOutCirc,\n withDescriptionIconSize,\n colorText,\n colorTextHeading,\n withDescriptionPadding,\n defaultPadding\n } = token;\n return {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n padding: defaultPadding,\n wordWrap: 'break-word',\n borderRadius,\n [`&${componentCls}-rtl`]: {\n direction: 'rtl'\n },\n [`${componentCls}-content`]: {\n flex: 1,\n minWidth: 0\n },\n [`${componentCls}-icon`]: {\n marginInlineEnd: marginXS,\n lineHeight: 0\n },\n '&-description': {\n display: 'none',\n fontSize,\n lineHeight\n },\n '&-message': {\n color: colorTextHeading\n },\n [`&${componentCls}-motion-leave`]: {\n overflow: 'hidden',\n opacity: 1,\n transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc},\n padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc},\n margin-bottom ${duration} ${motionEaseInOutCirc}`\n },\n [`&${componentCls}-motion-leave-active`]: {\n maxHeight: 0,\n marginBottom: '0 !important',\n paddingTop: 0,\n paddingBottom: 0,\n opacity: 0\n }\n }),\n [`${componentCls}-with-description`]: {\n alignItems: 'flex-start',\n padding: withDescriptionPadding,\n [`${componentCls}-icon`]: {\n marginInlineEnd: marginSM,\n fontSize: withDescriptionIconSize,\n lineHeight: 0\n },\n [`${componentCls}-message`]: {\n display: 'block',\n marginBottom: marginXS,\n color: colorTextHeading,\n fontSize: fontSizeLG\n },\n [`${componentCls}-description`]: {\n display: 'block',\n color: colorText\n }\n },\n [`${componentCls}-banner`]: {\n marginBottom: 0,\n border: '0 !important',\n borderRadius: 0\n }\n };\n};\nexport const genTypeStyle = token => {\n const {\n componentCls,\n colorSuccess,\n colorSuccessBorder,\n colorSuccessBg,\n colorWarning,\n colorWarningBorder,\n colorWarningBg,\n colorError,\n colorErrorBorder,\n colorErrorBg,\n colorInfo,\n colorInfoBorder,\n colorInfoBg\n } = token;\n return {\n [componentCls]: {\n '&-success': genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token, componentCls),\n '&-info': genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token, componentCls),\n '&-warning': genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token, componentCls),\n '&-error': Object.assign(Object.assign({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token, componentCls)), {\n [`${componentCls}-description > pre`]: {\n margin: 0,\n padding: 0\n }\n })\n }\n };\n};\nexport const genActionStyle = token => {\n const {\n componentCls,\n iconCls,\n motionDurationMid,\n marginXS,\n fontSizeIcon,\n colorIcon,\n colorIconHover\n } = token;\n return {\n [componentCls]: {\n '&-action': {\n marginInlineStart: marginXS\n },\n [`${componentCls}-close-icon`]: {\n marginInlineStart: marginXS,\n padding: 0,\n overflow: 'hidden',\n fontSize: fontSizeIcon,\n lineHeight: unit(fontSizeIcon),\n backgroundColor: 'transparent',\n border: 'none',\n outline: 'none',\n cursor: 'pointer',\n [`${iconCls}-close`]: {\n color: colorIcon,\n transition: `color ${motionDurationMid}`,\n '&:hover': {\n color: colorIconHover\n }\n }\n },\n '&-close-text': {\n color: colorIcon,\n transition: `color ${motionDurationMid}`,\n '&:hover': {\n color: colorIconHover\n }\n }\n }\n };\n};\nexport const prepareComponentToken = token => {\n const paddingHorizontal = 12; // Fixed value here.\n return {\n withDescriptionIconSize: token.fontSizeHeading3,\n defaultPadding: `${token.paddingContentVerticalSM}px ${paddingHorizontal}px`,\n withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`\n };\n};\nexport default genStyleHooks('Alert', token => [genBaseStyle(token), genTypeStyle(token), genActionStyle(token)], prepareComponentToken);","map":{"version":3,"names":["unit","resetComponent","genStyleHooks","genAlertTypeStyle","bgColor","borderColor","iconColor","token","alertCls","background","border","lineWidth","lineType","color","genBaseStyle","componentCls","motionDurationSlow","duration","marginXS","marginSM","fontSize","fontSizeLG","lineHeight","borderRadiusLG","borderRadius","motionEaseInOutCirc","withDescriptionIconSize","colorText","colorTextHeading","withDescriptionPadding","defaultPadding","Object","assign","position","display","alignItems","padding","wordWrap","direction","flex","minWidth","marginInlineEnd","overflow","opacity","transition","maxHeight","marginBottom","paddingTop","paddingBottom","genTypeStyle","colorSuccess","colorSuccessBorder","colorSuccessBg","colorWarning","colorWarningBorder","colorWarningBg","colorError","colorErrorBorder","colorErrorBg","colorInfo","colorInfoBorder","colorInfoBg","margin","genActionStyle","iconCls","motionDurationMid","fontSizeIcon","colorIcon","colorIconHover","marginInlineStart","backgroundColor","outline","cursor","prepareComponentToken","paddingHorizontal","fontSizeHeading3","paddingContentVerticalSM","paddingMD","paddingContentHorizontalLG"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/alert/style/index.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks } from '../../theme/internal';\nconst genAlertTypeStyle = (bgColor, borderColor, iconColor, token, alertCls) => ({\n background: bgColor,\n border: `${unit(token.lineWidth)} ${token.lineType} ${borderColor}`,\n [`${alertCls}-icon`]: {\n color: iconColor\n }\n});\nexport const genBaseStyle = token => {\n const {\n componentCls,\n motionDurationSlow: duration,\n marginXS,\n marginSM,\n fontSize,\n fontSizeLG,\n lineHeight,\n borderRadiusLG: borderRadius,\n motionEaseInOutCirc,\n withDescriptionIconSize,\n colorText,\n colorTextHeading,\n withDescriptionPadding,\n defaultPadding\n } = token;\n return {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n padding: defaultPadding,\n wordWrap: 'break-word',\n borderRadius,\n [`&${componentCls}-rtl`]: {\n direction: 'rtl'\n },\n [`${componentCls}-content`]: {\n flex: 1,\n minWidth: 0\n },\n [`${componentCls}-icon`]: {\n marginInlineEnd: marginXS,\n lineHeight: 0\n },\n '&-description': {\n display: 'none',\n fontSize,\n lineHeight\n },\n '&-message': {\n color: colorTextHeading\n },\n [`&${componentCls}-motion-leave`]: {\n overflow: 'hidden',\n opacity: 1,\n transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc},\n padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc},\n margin-bottom ${duration} ${motionEaseInOutCirc}`\n },\n [`&${componentCls}-motion-leave-active`]: {\n maxHeight: 0,\n marginBottom: '0 !important',\n paddingTop: 0,\n paddingBottom: 0,\n opacity: 0\n }\n }),\n [`${componentCls}-with-description`]: {\n alignItems: 'flex-start',\n padding: withDescriptionPadding,\n [`${componentCls}-icon`]: {\n marginInlineEnd: marginSM,\n fontSize: withDescriptionIconSize,\n lineHeight: 0\n },\n [`${componentCls}-message`]: {\n display: 'block',\n marginBottom: marginXS,\n color: colorTextHeading,\n fontSize: fontSizeLG\n },\n [`${componentCls}-description`]: {\n display: 'block',\n color: colorText\n }\n },\n [`${componentCls}-banner`]: {\n marginBottom: 0,\n border: '0 !important',\n borderRadius: 0\n }\n };\n};\nexport const genTypeStyle = token => {\n const {\n componentCls,\n colorSuccess,\n colorSuccessBorder,\n colorSuccessBg,\n colorWarning,\n colorWarningBorder,\n colorWarningBg,\n colorError,\n colorErrorBorder,\n colorErrorBg,\n colorInfo,\n colorInfoBorder,\n colorInfoBg\n } = token;\n return {\n [componentCls]: {\n '&-success': genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token, componentCls),\n '&-info': genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token, componentCls),\n '&-warning': genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token, componentCls),\n '&-error': Object.assign(Object.assign({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token, componentCls)), {\n [`${componentCls}-description > pre`]: {\n margin: 0,\n padding: 0\n }\n })\n }\n };\n};\nexport const genActionStyle = token => {\n const {\n componentCls,\n iconCls,\n motionDurationMid,\n marginXS,\n fontSizeIcon,\n colorIcon,\n colorIconHover\n } = token;\n return {\n [componentCls]: {\n '&-action': {\n marginInlineStart: marginXS\n },\n [`${componentCls}-close-icon`]: {\n marginInlineStart: marginXS,\n padding: 0,\n overflow: 'hidden',\n fontSize: fontSizeIcon,\n lineHeight: unit(fontSizeIcon),\n backgroundColor: 'transparent',\n border: 'none',\n outline: 'none',\n cursor: 'pointer',\n [`${iconCls}-close`]: {\n color: colorIcon,\n transition: `color ${motionDurationMid}`,\n '&:hover': {\n color: colorIconHover\n }\n }\n },\n '&-close-text': {\n color: colorIcon,\n transition: `color ${motionDurationMid}`,\n '&:hover': {\n color: colorIconHover\n }\n }\n }\n };\n};\nexport const prepareComponentToken = token => {\n const paddingHorizontal = 12; // Fixed value here.\n return {\n withDescriptionIconSize: token.fontSizeHeading3,\n defaultPadding: `${token.paddingContentVerticalSM}px ${paddingHorizontal}px`,\n withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`\n };\n};\nexport default genStyleHooks('Alert', token => [genBaseStyle(token), genTypeStyle(token), genActionStyle(token)], prepareComponentToken);"],"mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,aAAa,QAAQ,sBAAsB;AACpD,MAAMC,iBAAiB,GAAGA,CAACC,OAAO,EAAEC,WAAW,EAAEC,SAAS,E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