index.js 1.8 KB

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