index.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  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. require("../../_util/cssinjs");
  9. var _internal = require("../../theme/internal");
  10. var _style = require("../../style");
  11. var _motion = _interopRequireDefault(require("./motion"));
  12. const genCardStyle = token => {
  13. const {
  14. componentCls,
  15. tabsCardHorizontalPadding,
  16. tabsCardHeadBackground,
  17. tabsCardGutter,
  18. colorSplit
  19. } = token;
  20. return {
  21. [`${componentCls}-card`]: {
  22. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  23. [`${componentCls}-tab`]: {
  24. margin: 0,
  25. padding: tabsCardHorizontalPadding,
  26. background: tabsCardHeadBackground,
  27. border: `${token.lineWidth}px ${token.lineType} ${colorSplit}`,
  28. transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`
  29. },
  30. [`${componentCls}-tab-active`]: {
  31. color: token.colorPrimary,
  32. background: token.colorBgContainer
  33. },
  34. [`${componentCls}-ink-bar`]: {
  35. visibility: 'hidden'
  36. }
  37. },
  38. // ========================== Top & Bottom ==========================
  39. [`&${componentCls}-top, &${componentCls}-bottom`]: {
  40. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  41. [`${componentCls}-tab + ${componentCls}-tab`]: {
  42. marginLeft: {
  43. _skip_check_: true,
  44. value: `${tabsCardGutter}px`
  45. }
  46. }
  47. }
  48. },
  49. [`&${componentCls}-top`]: {
  50. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  51. [`${componentCls}-tab`]: {
  52. borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`
  53. },
  54. [`${componentCls}-tab-active`]: {
  55. borderBottomColor: token.colorBgContainer
  56. }
  57. }
  58. },
  59. [`&${componentCls}-bottom`]: {
  60. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  61. [`${componentCls}-tab`]: {
  62. borderRadius: `0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
  63. },
  64. [`${componentCls}-tab-active`]: {
  65. borderTopColor: token.colorBgContainer
  66. }
  67. }
  68. },
  69. // ========================== Left & Right ==========================
  70. [`&${componentCls}-left, &${componentCls}-right`]: {
  71. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  72. [`${componentCls}-tab + ${componentCls}-tab`]: {
  73. marginTop: `${tabsCardGutter}px`
  74. }
  75. }
  76. },
  77. [`&${componentCls}-left`]: {
  78. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  79. [`${componentCls}-tab`]: {
  80. borderRadius: {
  81. _skip_check_: true,
  82. value: `${token.borderRadiusLG}px 0 0 ${token.borderRadiusLG}px`
  83. }
  84. },
  85. [`${componentCls}-tab-active`]: {
  86. borderRightColor: {
  87. _skip_check_: true,
  88. value: token.colorBgContainer
  89. }
  90. }
  91. }
  92. },
  93. [`&${componentCls}-right`]: {
  94. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  95. [`${componentCls}-tab`]: {
  96. borderRadius: {
  97. _skip_check_: true,
  98. value: `0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px 0`
  99. }
  100. },
  101. [`${componentCls}-tab-active`]: {
  102. borderLeftColor: {
  103. _skip_check_: true,
  104. value: token.colorBgContainer
  105. }
  106. }
  107. }
  108. }
  109. }
  110. };
  111. };
  112. const genDropdownStyle = token => {
  113. const {
  114. componentCls,
  115. tabsHoverColor,
  116. dropdownEdgeChildVerticalPadding
  117. } = token;
  118. return {
  119. [`${componentCls}-dropdown`]: (0, _extends2.default)((0, _extends2.default)({}, (0, _style.resetComponent)(token)), {
  120. position: 'absolute',
  121. top: -9999,
  122. left: {
  123. _skip_check_: true,
  124. value: -9999
  125. },
  126. zIndex: token.zIndexPopup,
  127. display: 'block',
  128. '&-hidden': {
  129. display: 'none'
  130. },
  131. [`${componentCls}-dropdown-menu`]: {
  132. maxHeight: token.tabsDropdownHeight,
  133. margin: 0,
  134. padding: `${dropdownEdgeChildVerticalPadding}px 0`,
  135. overflowX: 'hidden',
  136. overflowY: 'auto',
  137. textAlign: {
  138. _skip_check_: true,
  139. value: 'left'
  140. },
  141. listStyleType: 'none',
  142. backgroundColor: token.colorBgContainer,
  143. backgroundClip: 'padding-box',
  144. borderRadius: token.borderRadiusLG,
  145. outline: 'none',
  146. boxShadow: token.boxShadowSecondary,
  147. '&-item': (0, _extends2.default)((0, _extends2.default)({}, _style.textEllipsis), {
  148. display: 'flex',
  149. alignItems: 'center',
  150. minWidth: token.tabsDropdownWidth,
  151. margin: 0,
  152. padding: `${token.paddingXXS}px ${token.paddingSM}px`,
  153. color: token.colorText,
  154. fontWeight: 'normal',
  155. fontSize: token.fontSize,
  156. lineHeight: token.lineHeight,
  157. cursor: 'pointer',
  158. transition: `all ${token.motionDurationSlow}`,
  159. '> span': {
  160. flex: 1,
  161. whiteSpace: 'nowrap'
  162. },
  163. '&-remove': {
  164. flex: 'none',
  165. marginLeft: {
  166. _skip_check_: true,
  167. value: token.marginSM
  168. },
  169. color: token.colorTextDescription,
  170. fontSize: token.fontSizeSM,
  171. background: 'transparent',
  172. border: 0,
  173. cursor: 'pointer',
  174. '&:hover': {
  175. color: tabsHoverColor
  176. }
  177. },
  178. '&:hover': {
  179. background: token.controlItemBgHover
  180. },
  181. '&-disabled': {
  182. '&, &:hover': {
  183. color: token.colorTextDisabled,
  184. background: 'transparent',
  185. cursor: 'not-allowed'
  186. }
  187. }
  188. })
  189. }
  190. })
  191. };
  192. };
  193. const genPositionStyle = token => {
  194. const {
  195. componentCls,
  196. margin,
  197. colorSplit
  198. } = token;
  199. return {
  200. // ========================== Top & Bottom ==========================
  201. [`${componentCls}-top, ${componentCls}-bottom`]: {
  202. flexDirection: 'column',
  203. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  204. margin: `0 0 ${margin}px 0`,
  205. '&::before': {
  206. position: 'absolute',
  207. right: {
  208. _skip_check_: true,
  209. value: 0
  210. },
  211. left: {
  212. _skip_check_: true,
  213. value: 0
  214. },
  215. borderBottom: `${token.lineWidth}px ${token.lineType} ${colorSplit}`,
  216. content: "''"
  217. },
  218. [`${componentCls}-ink-bar`]: {
  219. height: token.lineWidthBold,
  220. '&-animated': {
  221. transition: `width ${token.motionDurationSlow}, left ${token.motionDurationSlow},
  222. right ${token.motionDurationSlow}`
  223. }
  224. },
  225. [`${componentCls}-nav-wrap`]: {
  226. '&::before, &::after': {
  227. top: 0,
  228. bottom: 0,
  229. width: token.controlHeight
  230. },
  231. '&::before': {
  232. left: {
  233. _skip_check_: true,
  234. value: 0
  235. },
  236. boxShadow: token.boxShadowTabsOverflowLeft
  237. },
  238. '&::after': {
  239. right: {
  240. _skip_check_: true,
  241. value: 0
  242. },
  243. boxShadow: token.boxShadowTabsOverflowRight
  244. },
  245. [`&${componentCls}-nav-wrap-ping-left::before`]: {
  246. opacity: 1
  247. },
  248. [`&${componentCls}-nav-wrap-ping-right::after`]: {
  249. opacity: 1
  250. }
  251. }
  252. }
  253. },
  254. [`${componentCls}-top`]: {
  255. [`> ${componentCls}-nav,
  256. > div > ${componentCls}-nav`]: {
  257. '&::before': {
  258. bottom: 0
  259. },
  260. [`${componentCls}-ink-bar`]: {
  261. bottom: 0
  262. }
  263. }
  264. },
  265. [`${componentCls}-bottom`]: {
  266. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  267. order: 1,
  268. marginTop: `${margin}px`,
  269. marginBottom: 0,
  270. '&::before': {
  271. top: 0
  272. },
  273. [`${componentCls}-ink-bar`]: {
  274. top: 0
  275. }
  276. },
  277. [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
  278. order: 0
  279. }
  280. },
  281. // ========================== Left & Right ==========================
  282. [`${componentCls}-left, ${componentCls}-right`]: {
  283. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  284. flexDirection: 'column',
  285. minWidth: token.controlHeight * 1.25,
  286. // >>>>>>>>>>> Tab
  287. [`${componentCls}-tab`]: {
  288. padding: `${token.paddingXS}px ${token.paddingLG}px`,
  289. textAlign: 'center'
  290. },
  291. [`${componentCls}-tab + ${componentCls}-tab`]: {
  292. margin: `${token.margin}px 0 0 0`
  293. },
  294. // >>>>>>>>>>> Nav
  295. [`${componentCls}-nav-wrap`]: {
  296. flexDirection: 'column',
  297. '&::before, &::after': {
  298. right: {
  299. _skip_check_: true,
  300. value: 0
  301. },
  302. left: {
  303. _skip_check_: true,
  304. value: 0
  305. },
  306. height: token.controlHeight
  307. },
  308. '&::before': {
  309. top: 0,
  310. boxShadow: token.boxShadowTabsOverflowTop
  311. },
  312. '&::after': {
  313. bottom: 0,
  314. boxShadow: token.boxShadowTabsOverflowBottom
  315. },
  316. [`&${componentCls}-nav-wrap-ping-top::before`]: {
  317. opacity: 1
  318. },
  319. [`&${componentCls}-nav-wrap-ping-bottom::after`]: {
  320. opacity: 1
  321. }
  322. },
  323. // >>>>>>>>>>> Ink Bar
  324. [`${componentCls}-ink-bar`]: {
  325. width: token.lineWidthBold,
  326. '&-animated': {
  327. transition: `height ${token.motionDurationSlow}, top ${token.motionDurationSlow}`
  328. }
  329. },
  330. [`${componentCls}-nav-list, ${componentCls}-nav-operations`]: {
  331. flex: '1 0 auto',
  332. flexDirection: 'column'
  333. }
  334. }
  335. },
  336. [`${componentCls}-left`]: {
  337. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  338. [`${componentCls}-ink-bar`]: {
  339. right: {
  340. _skip_check_: true,
  341. value: 0
  342. }
  343. }
  344. },
  345. [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
  346. marginLeft: {
  347. _skip_check_: true,
  348. value: `-${token.lineWidth}px`
  349. },
  350. borderLeft: {
  351. _skip_check_: true,
  352. value: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`
  353. },
  354. [`> ${componentCls}-content > ${componentCls}-tabpane`]: {
  355. paddingLeft: {
  356. _skip_check_: true,
  357. value: token.paddingLG
  358. }
  359. }
  360. }
  361. },
  362. [`${componentCls}-right`]: {
  363. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  364. order: 1,
  365. [`${componentCls}-ink-bar`]: {
  366. left: {
  367. _skip_check_: true,
  368. value: 0
  369. }
  370. }
  371. },
  372. [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
  373. order: 0,
  374. marginRight: {
  375. _skip_check_: true,
  376. value: -token.lineWidth
  377. },
  378. borderRight: {
  379. _skip_check_: true,
  380. value: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`
  381. },
  382. [`> ${componentCls}-content > ${componentCls}-tabpane`]: {
  383. paddingRight: {
  384. _skip_check_: true,
  385. value: token.paddingLG
  386. }
  387. }
  388. }
  389. }
  390. };
  391. };
  392. const genSizeStyle = token => {
  393. const {
  394. componentCls,
  395. padding
  396. } = token;
  397. return {
  398. [componentCls]: {
  399. '&-small': {
  400. [`> ${componentCls}-nav`]: {
  401. [`${componentCls}-tab`]: {
  402. padding: `${token.paddingXS}px 0`,
  403. fontSize: token.fontSize
  404. }
  405. }
  406. },
  407. '&-large': {
  408. [`> ${componentCls}-nav`]: {
  409. [`${componentCls}-tab`]: {
  410. padding: `${padding}px 0`,
  411. fontSize: token.fontSizeLG
  412. }
  413. }
  414. }
  415. },
  416. [`${componentCls}-card`]: {
  417. [`&${componentCls}-small`]: {
  418. [`> ${componentCls}-nav`]: {
  419. [`${componentCls}-tab`]: {
  420. padding: `${token.paddingXXS * 1.5}px ${padding}px`
  421. }
  422. },
  423. [`&${componentCls}-bottom`]: {
  424. [`> ${componentCls}-nav ${componentCls}-tab`]: {
  425. borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
  426. }
  427. },
  428. [`&${componentCls}-top`]: {
  429. [`> ${componentCls}-nav ${componentCls}-tab`]: {
  430. borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
  431. }
  432. },
  433. [`&${componentCls}-right`]: {
  434. [`> ${componentCls}-nav ${componentCls}-tab`]: {
  435. borderRadius: {
  436. _skip_check_: true,
  437. value: `0 ${token.borderRadius}px ${token.borderRadius}px 0`
  438. }
  439. }
  440. },
  441. [`&${componentCls}-left`]: {
  442. [`> ${componentCls}-nav ${componentCls}-tab`]: {
  443. borderRadius: {
  444. _skip_check_: true,
  445. value: `${token.borderRadius}px 0 0 ${token.borderRadius}px`
  446. }
  447. }
  448. }
  449. },
  450. [`&${componentCls}-large`]: {
  451. [`> ${componentCls}-nav`]: {
  452. [`${componentCls}-tab`]: {
  453. padding: `${token.paddingXS}px ${padding}px ${token.paddingXXS * 1.5}px`
  454. }
  455. }
  456. }
  457. }
  458. };
  459. };
  460. const genTabStyle = token => {
  461. const {
  462. componentCls,
  463. tabsActiveColor,
  464. tabsHoverColor,
  465. iconCls,
  466. tabsHorizontalGutter
  467. } = token;
  468. const tabCls = `${componentCls}-tab`;
  469. return {
  470. [tabCls]: {
  471. position: 'relative',
  472. display: 'inline-flex',
  473. alignItems: 'center',
  474. padding: `${token.paddingSM}px 0`,
  475. fontSize: `${token.fontSize}px`,
  476. background: 'transparent',
  477. border: 0,
  478. outline: 'none',
  479. cursor: 'pointer',
  480. '&-btn, &-remove': (0, _extends2.default)({
  481. '&:focus:not(:focus-visible), &:active': {
  482. color: tabsActiveColor
  483. }
  484. }, (0, _style.genFocusStyle)(token)),
  485. '&-btn': {
  486. outline: 'none',
  487. transition: 'all 0.3s'
  488. },
  489. '&-remove': {
  490. flex: 'none',
  491. marginRight: {
  492. _skip_check_: true,
  493. value: -token.marginXXS
  494. },
  495. marginLeft: {
  496. _skip_check_: true,
  497. value: token.marginXS
  498. },
  499. color: token.colorTextDescription,
  500. fontSize: token.fontSizeSM,
  501. background: 'transparent',
  502. border: 'none',
  503. outline: 'none',
  504. cursor: 'pointer',
  505. transition: `all ${token.motionDurationSlow}`,
  506. '&:hover': {
  507. color: token.colorTextHeading
  508. }
  509. },
  510. '&:hover': {
  511. color: tabsHoverColor
  512. },
  513. [`&${tabCls}-active ${tabCls}-btn`]: {
  514. color: token.colorPrimary,
  515. textShadow: token.tabsActiveTextShadow
  516. },
  517. [`&${tabCls}-disabled`]: {
  518. color: token.colorTextDisabled,
  519. cursor: 'not-allowed'
  520. },
  521. [`&${tabCls}-disabled ${tabCls}-btn, &${tabCls}-disabled ${componentCls}-remove`]: {
  522. '&:focus, &:active': {
  523. color: token.colorTextDisabled
  524. }
  525. },
  526. [`& ${tabCls}-remove ${iconCls}`]: {
  527. margin: 0
  528. },
  529. [iconCls]: {
  530. marginRight: {
  531. _skip_check_: true,
  532. value: token.marginSM
  533. }
  534. }
  535. },
  536. [`${tabCls} + ${tabCls}`]: {
  537. margin: {
  538. _skip_check_: true,
  539. value: `0 0 0 ${tabsHorizontalGutter}px`
  540. }
  541. }
  542. };
  543. };
  544. const genRtlStyle = token => {
  545. const {
  546. componentCls,
  547. tabsHorizontalGutter,
  548. iconCls,
  549. tabsCardGutter
  550. } = token;
  551. const rtlCls = `${componentCls}-rtl`;
  552. return {
  553. [rtlCls]: {
  554. direction: 'rtl',
  555. [`${componentCls}-nav`]: {
  556. [`${componentCls}-tab`]: {
  557. margin: {
  558. _skip_check_: true,
  559. value: `0 0 0 ${tabsHorizontalGutter}px`
  560. },
  561. [`${componentCls}-tab:last-of-type`]: {
  562. marginLeft: {
  563. _skip_check_: true,
  564. value: 0
  565. }
  566. },
  567. [iconCls]: {
  568. marginRight: {
  569. _skip_check_: true,
  570. value: 0
  571. },
  572. marginLeft: {
  573. _skip_check_: true,
  574. value: `${token.marginSM}px`
  575. }
  576. },
  577. [`${componentCls}-tab-remove`]: {
  578. marginRight: {
  579. _skip_check_: true,
  580. value: `${token.marginXS}px`
  581. },
  582. marginLeft: {
  583. _skip_check_: true,
  584. value: `-${token.marginXXS}px`
  585. },
  586. [iconCls]: {
  587. margin: 0
  588. }
  589. }
  590. }
  591. },
  592. [`&${componentCls}-left`]: {
  593. [`> ${componentCls}-nav`]: {
  594. order: 1
  595. },
  596. [`> ${componentCls}-content-holder`]: {
  597. order: 0
  598. }
  599. },
  600. [`&${componentCls}-right`]: {
  601. [`> ${componentCls}-nav`]: {
  602. order: 0
  603. },
  604. [`> ${componentCls}-content-holder`]: {
  605. order: 1
  606. }
  607. },
  608. // ====================== Card ======================
  609. [`&${componentCls}-card${componentCls}-top, &${componentCls}-card${componentCls}-bottom`]: {
  610. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  611. [`${componentCls}-tab + ${componentCls}-tab`]: {
  612. marginRight: {
  613. _skip_check_: true,
  614. value: `${tabsCardGutter}px`
  615. },
  616. marginLeft: {
  617. _skip_check_: true,
  618. value: 0
  619. }
  620. }
  621. }
  622. }
  623. },
  624. [`${componentCls}-dropdown-rtl`]: {
  625. direction: 'rtl'
  626. },
  627. [`${componentCls}-menu-item`]: {
  628. [`${componentCls}-dropdown-rtl`]: {
  629. textAlign: {
  630. _skip_check_: true,
  631. value: 'right'
  632. }
  633. }
  634. }
  635. };
  636. };
  637. const genTabsStyle = token => {
  638. const {
  639. componentCls,
  640. tabsCardHorizontalPadding,
  641. tabsCardHeight,
  642. tabsCardGutter,
  643. tabsHoverColor,
  644. tabsActiveColor,
  645. colorSplit
  646. } = token;
  647. return {
  648. [componentCls]: (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, (0, _style.resetComponent)(token)), {
  649. display: 'flex',
  650. // ========================== Navigation ==========================
  651. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  652. position: 'relative',
  653. display: 'flex',
  654. flex: 'none',
  655. alignItems: 'center',
  656. [`${componentCls}-nav-wrap`]: {
  657. position: 'relative',
  658. display: 'flex',
  659. flex: 'auto',
  660. alignSelf: 'stretch',
  661. overflow: 'hidden',
  662. whiteSpace: 'nowrap',
  663. transform: 'translate(0)',
  664. // >>>>> Ping shadow
  665. '&::before, &::after': {
  666. position: 'absolute',
  667. zIndex: 1,
  668. opacity: 0,
  669. transition: `opacity ${token.motionDurationSlow}`,
  670. content: "''",
  671. pointerEvents: 'none'
  672. }
  673. },
  674. [`${componentCls}-nav-list`]: {
  675. position: 'relative',
  676. display: 'flex',
  677. transition: `opacity ${token.motionDurationSlow}`
  678. },
  679. // >>>>>>>> Operations
  680. [`${componentCls}-nav-operations`]: {
  681. display: 'flex',
  682. alignSelf: 'stretch'
  683. },
  684. [`${componentCls}-nav-operations-hidden`]: {
  685. position: 'absolute',
  686. visibility: 'hidden',
  687. pointerEvents: 'none'
  688. },
  689. [`${componentCls}-nav-more`]: {
  690. position: 'relative',
  691. padding: tabsCardHorizontalPadding,
  692. background: 'transparent',
  693. border: 0,
  694. '&::after': {
  695. position: 'absolute',
  696. right: {
  697. _skip_check_: true,
  698. value: 0
  699. },
  700. bottom: 0,
  701. left: {
  702. _skip_check_: true,
  703. value: 0
  704. },
  705. height: token.controlHeightLG / 8,
  706. transform: 'translateY(100%)',
  707. content: "''"
  708. }
  709. },
  710. [`${componentCls}-nav-add`]: (0, _extends2.default)({
  711. minWidth: `${tabsCardHeight}px`,
  712. marginLeft: {
  713. _skip_check_: true,
  714. value: `${tabsCardGutter}px`
  715. },
  716. padding: `0 ${token.paddingXS}px`,
  717. background: 'transparent',
  718. border: `${token.lineWidth}px ${token.lineType} ${colorSplit}`,
  719. borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`,
  720. outline: 'none',
  721. cursor: 'pointer',
  722. color: token.colorText,
  723. transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`,
  724. '&:hover': {
  725. color: tabsHoverColor
  726. },
  727. '&:active, &:focus:not(:focus-visible)': {
  728. color: tabsActiveColor
  729. }
  730. }, (0, _style.genFocusStyle)(token))
  731. },
  732. [`${componentCls}-extra-content`]: {
  733. flex: 'none'
  734. },
  735. // ============================ InkBar ============================
  736. [`${componentCls}-ink-bar`]: {
  737. position: 'absolute',
  738. background: token.colorPrimary,
  739. pointerEvents: 'none'
  740. }
  741. }), genTabStyle(token)), {
  742. // =========================== TabPanes ===========================
  743. [`${componentCls}-content`]: {
  744. position: 'relative',
  745. display: 'flex',
  746. width: '100%',
  747. ['&-animated']: {
  748. transition: 'margin 0.3s'
  749. }
  750. },
  751. [`${componentCls}-content-holder`]: {
  752. flex: 'auto',
  753. minWidth: 0,
  754. minHeight: 0
  755. },
  756. [`${componentCls}-tabpane`]: {
  757. outline: 'none',
  758. flex: 'none',
  759. width: '100%'
  760. }
  761. }),
  762. [`${componentCls}-centered`]: {
  763. [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
  764. [`${componentCls}-nav-wrap`]: {
  765. [`&:not([class*='${componentCls}-nav-wrap-ping'])`]: {
  766. justifyContent: 'center'
  767. }
  768. }
  769. }
  770. }
  771. };
  772. };
  773. // ============================== Export ==============================
  774. var _default = exports.default = (0, _internal.genComponentStyleHook)('Tabs', token => {
  775. const tabsCardHeight = token.controlHeightLG;
  776. const tabsToken = (0, _internal.mergeToken)(token, {
  777. tabsHoverColor: token.colorPrimaryHover,
  778. tabsActiveColor: token.colorPrimaryActive,
  779. tabsCardHorizontalPadding: `${(tabsCardHeight - Math.round(token.fontSize * token.lineHeight)) / 2 - token.lineWidth}px ${token.padding}px`,
  780. tabsCardHeight,
  781. tabsCardGutter: token.marginXXS / 2,
  782. tabsHorizontalGutter: 32,
  783. tabsCardHeadBackground: token.colorFillAlter,
  784. dropdownEdgeChildVerticalPadding: token.paddingXXS,
  785. tabsActiveTextShadow: '0 0 0.25px currentcolor',
  786. tabsDropdownHeight: 200,
  787. tabsDropdownWidth: 120
  788. });
  789. return [genSizeStyle(tabsToken), genRtlStyle(tabsToken), genPositionStyle(tabsToken), genDropdownStyle(tabsToken), genCardStyle(tabsToken), genTabsStyle(tabsToken), (0, _motion.default)(tabsToken)];
  790. }, token => ({
  791. zIndexPopup: token.zIndexPopupBase + 50
  792. }));