index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = void 0;
  7. var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  8. var _internal = require("../../theme/internal");
  9. var _style = require("../../style");
  10. const genStatisticStyle = token => {
  11. const {
  12. componentCls,
  13. marginXXS,
  14. padding,
  15. colorTextDescription,
  16. statisticTitleFontSize,
  17. colorTextHeading,
  18. statisticContentFontSize,
  19. statisticFontFamily
  20. } = token;
  21. return {
  22. [`${componentCls}`]: (0, _extends2.default)((0, _extends2.default)({}, (0, _style.resetComponent)(token)), {
  23. [`${componentCls}-title`]: {
  24. marginBottom: marginXXS,
  25. color: colorTextDescription,
  26. fontSize: statisticTitleFontSize
  27. },
  28. [`${componentCls}-skeleton`]: {
  29. paddingTop: padding
  30. },
  31. [`${componentCls}-content`]: {
  32. color: colorTextHeading,
  33. fontSize: statisticContentFontSize,
  34. fontFamily: statisticFontFamily,
  35. [`${componentCls}-content-value`]: {
  36. display: 'inline-block',
  37. direction: 'ltr'
  38. },
  39. [`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
  40. display: 'inline-block'
  41. },
  42. [`${componentCls}-content-prefix`]: {
  43. marginInlineEnd: marginXXS
  44. },
  45. [`${componentCls}-content-suffix`]: {
  46. marginInlineStart: marginXXS
  47. }
  48. }
  49. })
  50. };
  51. };
  52. // ============================== Export ==============================
  53. var _default = exports.default = (0, _internal.genComponentStyleHook)('Statistic', token => {
  54. const {
  55. fontSizeHeading3,
  56. fontSize,
  57. fontFamily
  58. } = token;
  59. const statisticToken = (0, _internal.mergeToken)(token, {
  60. statisticTitleFontSize: fontSize,
  61. statisticContentFontSize: fontSizeHeading3,
  62. statisticFontFamily: fontFamily
  63. });
  64. return [genStatisticStyle(statisticToken)];
  65. });