inline.js 3.8 KB

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