{"version":3,"file":"index.cjs","sources":["../../../../../../packages/components/result/style/index.tsx"],"sourcesContent":["import type { CSSObject, FullToken, GenerateStyle } from '@antdv/theme';\nimport { genComponentStyleHook, mergeToken } from '@antdv/theme';\n\nexport interface ComponentToken {\n  imageWidth: number\n  imageHeight: number\n}\n\ninterface ResultToken extends FullToken<'Result'> {\n  resultTitleFontSize: number\n  resultSubtitleFontSize: number\n  resultIconFontSize: number\n\n  resultExtraMargin: string\n\n  resultInfoIconColor: string\n  resultSuccessIconColor: string\n  resultWarningIconColor: string\n  resultErrorIconColor: string\n}\n\n// ============================== Styles ==============================\nconst genBaseStyle: GenerateStyle<ResultToken> = (token): CSSObject => {\n  const {\n    componentCls,\n    lineHeightHeading3,\n    iconCls,\n    padding,\n    paddingXL,\n    paddingXS,\n    paddingLG,\n    marginXS,\n    lineHeight,\n  } = token;\n\n  return {\n    // Result\n    [componentCls]: {\n      'padding': `${paddingLG * 2}px ${paddingXL}px`,\n\n      // RTL\n      '&-rtl': {\n        direction: 'rtl',\n      },\n    },\n\n    // Exception Status image\n    [`${componentCls} ${componentCls}-image`]: {\n      width: token.imageWidth,\n      height: token.imageHeight,\n      margin: 'auto',\n    },\n\n    [`${componentCls} ${componentCls}-icon`]: {\n      marginBottom: paddingLG,\n      textAlign: 'center',\n\n      [`& > ${iconCls}`]: {\n        fontSize: token.resultIconFontSize,\n      },\n    },\n\n    [`${componentCls} ${componentCls}-title`]: {\n      color: token.colorTextHeading,\n      fontSize: token.resultTitleFontSize,\n      lineHeight: lineHeightHeading3,\n      marginBlock: marginXS,\n      textAlign: 'center',\n    },\n\n    [`${componentCls} ${componentCls}-subtitle`]: {\n      color: token.colorTextDescription,\n      fontSize: token.resultSubtitleFontSize,\n      lineHeight,\n      textAlign: 'center',\n    },\n\n    [`${componentCls} ${componentCls}-content`]: {\n      marginTop: paddingLG,\n      padding: `${paddingLG}px ${padding * 2.5}px`,\n      backgroundColor: token.colorFillAlter,\n    },\n\n    [`${componentCls} ${componentCls}-extra`]: {\n      'margin': token.resultExtraMargin,\n      'textAlign': 'center',\n\n      '& > *': {\n        'marginInlineEnd': paddingXS,\n\n        '&:last-child': {\n          marginInlineEnd: 0,\n        },\n      },\n    },\n  };\n};\n\nconst genStatusIconStyle: GenerateStyle<ResultToken> = (token) => {\n  const { componentCls, iconCls } = token;\n\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};\n\nconst genResultStyle: GenerateStyle<ResultToken> = token => [\n  genBaseStyle(token),\n  genStatusIconStyle(token),\n];\n\n// ============================== Export ==============================\nconst getStyle: GenerateStyle<ResultToken> = token => genResultStyle(token);\n\nexport default genComponentStyleHook(\n  'Result',\n  (token) => {\n    const { paddingLG, fontSizeHeading3 } = token;\n\n    const resultSubtitleFontSize = token.fontSize;\n    const resultExtraMargin = `${paddingLG}px 0 0 0`;\n\n    const resultInfoIconColor = token.colorInfo;\n    const resultErrorIconColor = token.colorError;\n    const resultSuccessIconColor = token.colorSuccess;\n    const resultWarningIconColor = token.colorWarning;\n\n    const resultToken = mergeToken<ResultToken>(token, {\n      resultTitleFontSize: fontSizeHeading3,\n      resultSubtitleFontSize,\n      resultIconFontSize: fontSizeHeading3 * 3,\n      resultExtraMargin,\n      resultInfoIconColor,\n      resultErrorIconColor,\n      resultSuccessIconColor,\n      resultWarningIconColor,\n    });\n\n    return [getStyle(resultToken)];\n  },\n  {\n    imageWidth: 250,\n    imageHeight: 295,\n  },\n);\n"],"names":["genBaseStyle","token","componentCls","lineHeightHeading3","iconCls","padding","paddingXL","paddingXS","paddingLG","marginXS","lineHeight","direction","width","imageWidth","height","imageHeight","margin","marginBottom","textAlign","fontSize","resultIconFontSize","color","colorTextHeading","resultTitleFontSize","marginBlock","colorTextDescription","resultSubtitleFontSize","marginTop","backgroundColor","colorFillAlter","resultExtraMargin","marginInlineEnd","genStatusIconStyle","resultSuccessIconColor","resultErrorIconColor","resultInfoIconColor","resultWarningIconColor","genResultStyle","getStyle","genComponentStyleHook","fontSizeHeading3","colorInfo","colorError","colorSuccess","colorWarning","resultToken","mergeToken"],"mappings":";;;;;;;;AAsBA,MAAMA,eAA4CC,CAAqB,KAAA,KAAA;AACrE,EAAM,MAAA;AAAA,IACJC,YAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,GACET,GAAAA,KAAAA,CAAAA;AAEJ,EAAO,OAAA;AAAA;AAAA,IAEL,CAACC,YAAY,GAAG;AAAA,MACd,SAAY,EAAA,CAAA,EAAEM,SAAY,GAAA,CAAE,MAAKF,SAAU,CAAA,EAAA,CAAA;AAAA;AAAA,MAG3C,OAAS,EAAA;AAAA,QACPK,SAAW,EAAA,KAAA;AAAA,OACb;AAAA,KACF;AAAA;AAAA,IAGA,CAAE,CAAET,EAAAA,YAAa,CAAGA,CAAAA,EAAAA,YAAa,QAAO,GAAG;AAAA,MACzCU,OAAOX,KAAMY,CAAAA,UAAAA;AAAAA,MACbC,QAAQb,KAAMc,CAAAA,WAAAA;AAAAA,MACdC,MAAQ,EAAA,MAAA;AAAA,KACV;AAAA,IAEA,CAAE,CAAEd,EAAAA,YAAa,CAAGA,CAAAA,EAAAA,YAAa,OAAM,GAAG;AAAA,MACxCe,YAAcT,EAAAA,SAAAA;AAAAA,MACdU,SAAW,EAAA,QAAA;AAAA,MAEX,CAAE,CAAA,IAAA,EAAMd,OAAQ,CAAA,CAAC,GAAG;AAAA,QAClBe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