1 line
10 KiB
JSON
1 line
10 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\n// ============================== Styles ==============================\nconst genBaseStyle = token => {\n const {\n componentCls,\n lineHeightHeading3,\n iconCls,\n padding,\n paddingXL,\n paddingXS,\n paddingLG,\n marginXS,\n lineHeight\n } = token;\n return {\n // Result\n [componentCls]: {\n padding: `${unit(token.calc(paddingLG).mul(2).equal())} ${unit(paddingXL)}`,\n // RTL\n '&-rtl': {\n direction: 'rtl'\n }\n },\n // Exception Status image\n [`${componentCls} ${componentCls}-image`]: {\n width: token.imageWidth,\n height: token.imageHeight,\n margin: 'auto'\n },\n [`${componentCls} ${componentCls}-icon`]: {\n marginBottom: paddingLG,\n textAlign: 'center',\n [`& > ${iconCls}`]: {\n fontSize: token.iconFontSize\n }\n },\n [`${componentCls} ${componentCls}-title`]: {\n color: token.colorTextHeading,\n fontSize: token.titleFontSize,\n lineHeight: lineHeightHeading3,\n marginBlock: marginXS,\n textAlign: 'center'\n },\n [`${componentCls} ${componentCls}-subtitle`]: {\n color: token.colorTextDescription,\n fontSize: token.subtitleFontSize,\n lineHeight,\n textAlign: 'center'\n },\n [`${componentCls} ${componentCls}-content`]: {\n marginTop: paddingLG,\n padding: `${unit(paddingLG)} ${unit(token.calc(padding).mul(2.5).equal())}`,\n backgroundColor: token.colorFillAlter\n },\n [`${componentCls} ${componentCls}-extra`]: {\n margin: token.extraMargin,\n textAlign: 'center',\n '& > *': {\n marginInlineEnd: paddingXS,\n '&:last-child': {\n marginInlineEnd: 0\n }\n }\n }\n };\n};\nconst genStatusIconStyle = token => {\n const {\n componentCls,\n iconCls\n } = token;\n return {\n [`${componentCls}-success ${componentCls}-icon > ${iconCls}`]: {\n color: token.resultSuccessIconColor\n },\n [`${componentCls}-error ${componentCls}-icon > ${iconCls}`]: {\n color: token.resultErrorIconColor\n },\n [`${componentCls}-info ${componentCls}-icon > ${iconCls}`]: {\n color: token.resultInfoIconColor\n },\n [`${componentCls}-warning ${componentCls}-icon > ${iconCls}`]: {\n color: token.resultWarningIconColor\n }\n };\n};\nconst genResultStyle = token => [genBaseStyle(token), genStatusIconStyle(token)];\nconst getStyle = token => genResultStyle(token);\n// ============================== Export ==============================\nexport const prepareComponentToken = token => ({\n titleFontSize: token.fontSizeHeading3,\n subtitleFontSize: token.fontSize,\n iconFontSize: token.fontSizeHeading3 * 3,\n extraMargin: `${token.paddingLG}px 0 0 0`\n});\nexport default genStyleHooks('Result', token => {\n const resultInfoIconColor = token.colorInfo;\n const resultErrorIconColor = token.colorError;\n const resultSuccessIconColor = token.colorSuccess;\n const resultWarningIconColor = token.colorWarning;\n const resultToken = mergeToken(token, {\n resultInfoIconColor,\n resultErrorIconColor,\n resultSuccessIconColor,\n resultWarningIconColor,\n imageWidth: 250,\n imageHeight: 295\n });\n return [getStyle(resultToken)];\n}, prepareComponentToken);","map":{"version":3,"names":["unit","genStyleHooks","mergeToken","genBaseStyle","token","componentCls","lineHeightHeading3","iconCls","padding","paddingXL","paddingXS","paddingLG","marginXS","lineHeight","calc","mul","equal","direction","width","imageWidth","height","imageHeight","margin","marginBottom","textAlign","fontSize","iconFontSize","color","colorTextHeading","titleFontSize","marginBlock","colorTextDescription","subtitleFontSize","marginTop","backgroundColor","colorFillAlter","extraMargin","marginInlineEnd","genStatusIconStyle","resultSuccessIconColor","resultErrorIconColor","resultInfoIconColor","resultWarningIconColor","genResultStyle","get
|