index.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.prepareComponentToken = exports.default = void 0;
  6. var _internal = require("../../theme/internal");
  7. // =============================== Base ===============================
  8. const genBaseStyle = token => {
  9. const {
  10. componentCls,
  11. iconCls,
  12. antCls,
  13. zIndexPopup,
  14. colorText,
  15. colorWarning,
  16. marginXXS,
  17. marginXS,
  18. fontSize,
  19. fontWeightStrong,
  20. colorTextHeading
  21. } = token;
  22. return {
  23. [componentCls]: {
  24. zIndex: zIndexPopup,
  25. [`&${antCls}-popover`]: {
  26. fontSize
  27. },
  28. [`${componentCls}-message`]: {
  29. marginBottom: marginXS,
  30. display: 'flex',
  31. flexWrap: 'nowrap',
  32. alignItems: 'start',
  33. [`> ${componentCls}-message-icon ${iconCls}`]: {
  34. color: colorWarning,
  35. fontSize,
  36. lineHeight: 1,
  37. marginInlineEnd: marginXS
  38. },
  39. [`${componentCls}-title`]: {
  40. fontWeight: fontWeightStrong,
  41. color: colorTextHeading,
  42. '&:only-child': {
  43. fontWeight: 'normal'
  44. }
  45. },
  46. [`${componentCls}-description`]: {
  47. marginTop: marginXXS,
  48. color: colorText
  49. }
  50. },
  51. [`${componentCls}-buttons`]: {
  52. textAlign: 'end',
  53. whiteSpace: 'nowrap',
  54. button: {
  55. marginInlineStart: marginXS
  56. }
  57. }
  58. }
  59. };
  60. };
  61. // ============================== Export ==============================
  62. const prepareComponentToken = token => {
  63. const {
  64. zIndexPopupBase
  65. } = token;
  66. return {
  67. zIndexPopup: zIndexPopupBase + 60
  68. };
  69. };
  70. exports.prepareComponentToken = prepareComponentToken;
  71. var _default = exports.default = (0, _internal.genStyleHooks)('Popconfirm', token => genBaseStyle(token), prepareComponentToken, {
  72. resetStyle: false
  73. });