inline.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _cssinjs = require("@ant-design/cssinjs");
  7. const genStepsInlineStyle = token => {
  8. const {
  9. componentCls,
  10. inlineDotSize,
  11. inlineTitleColor,
  12. inlineTailColor
  13. } = token;
  14. const containerPaddingTop = token.calc(token.paddingXS).add(token.lineWidth).equal();
  15. const titleStyle = {
  16. [`${componentCls}-item-container ${componentCls}-item-content ${componentCls}-item-title`]: {
  17. color: inlineTitleColor
  18. }
  19. };
  20. return {
  21. [`&${componentCls}-inline`]: {
  22. width: 'auto',
  23. display: 'inline-flex',
  24. [`${componentCls}-item`]: {
  25. flex: 'none',
  26. '&-container': {
  27. padding: `${(0, _cssinjs.unit)(containerPaddingTop)} ${(0, _cssinjs.unit)(token.paddingXXS)} 0`,
  28. margin: `0 ${(0, _cssinjs.unit)(token.calc(token.marginXXS).div(2).equal())}`,
  29. borderRadius: token.borderRadiusSM,
  30. cursor: 'pointer',
  31. transition: `background-color ${token.motionDurationMid}`,
  32. '&:hover': {
  33. background: token.controlItemBgHover
  34. },
  35. "&[role='button']:hover": {
  36. opacity: 1
  37. }
  38. },
  39. '&-icon': {
  40. width: inlineDotSize,
  41. height: inlineDotSize,
  42. marginInlineStart: `calc(50% - ${(0, _cssinjs.unit)(token.calc(inlineDotSize).div(2).equal())})`,
  43. [`> ${componentCls}-icon`]: {
  44. top: 0
  45. },
  46. [`${componentCls}-icon-dot`]: {
  47. borderRadius: token.calc(token.fontSizeSM).div(4).equal(),
  48. '&::after': {
  49. display: 'none'
  50. }
  51. }
  52. },
  53. '&-content': {
  54. width: 'auto',
  55. marginTop: token.calc(token.marginXS).sub(token.lineWidth).equal()
  56. },
  57. '&-title': {
  58. color: inlineTitleColor,
  59. fontSize: token.fontSizeSM,
  60. lineHeight: token.lineHeightSM,
  61. fontWeight: 'normal',
  62. marginBottom: token.calc(token.marginXXS).div(2).equal()
  63. },
  64. '&-description': {
  65. display: 'none'
  66. },
  67. '&-tail': {
  68. marginInlineStart: 0,
  69. top: token.calc(inlineDotSize).div(2).add(containerPaddingTop).equal(),
  70. transform: `translateY(-50%)`,
  71. '&:after': {
  72. width: '100%',
  73. height: token.lineWidth,
  74. borderRadius: 0,
  75. marginInlineStart: 0,
  76. background: inlineTailColor
  77. }
  78. },
  79. [`&:first-child ${componentCls}-item-tail`]: {
  80. width: '50%',
  81. marginInlineStart: '50%'
  82. },
  83. [`&:last-child ${componentCls}-item-tail`]: {
  84. display: 'block',
  85. width: '50%'
  86. },
  87. '&-wait': Object.assign({
  88. [`${componentCls}-item-icon ${componentCls}-icon ${componentCls}-icon-dot`]: {
  89. backgroundColor: token.colorBorderBg,
  90. border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${inlineTailColor}`
  91. }
  92. }, titleStyle),
  93. '&-finish': Object.assign({
  94. [`${componentCls}-item-tail::after`]: {
  95. backgroundColor: inlineTailColor
  96. },
  97. [`${componentCls}-item-icon ${componentCls}-icon ${componentCls}-icon-dot`]: {
  98. backgroundColor: inlineTailColor,
  99. border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${inlineTailColor}`
  100. }
  101. }, titleStyle),
  102. '&-error': titleStyle,
  103. '&-active, &-process': Object.assign({
  104. [`${componentCls}-item-icon`]: {
  105. width: inlineDotSize,
  106. height: inlineDotSize,
  107. marginInlineStart: `calc(50% - ${(0, _cssinjs.unit)(token.calc(inlineDotSize).div(2).equal())})`,
  108. top: 0
  109. }
  110. }, titleStyle),
  111. [`&:not(${componentCls}-item-active) > ${componentCls}-item-container[role='button']:hover`]: {
  112. [`${componentCls}-item-title`]: {
  113. color: inlineTitleColor
  114. }
  115. }
  116. }
  117. }
  118. };
  119. };
  120. var _default = exports.default = genStepsInlineStyle;