index.js 1.6 KB

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