2022-06-11 21:39:58 +08:00
|
|
|
import type React from 'react';
|
2023-08-31 22:21:32 +08:00
|
|
|
|
|
|
|
import { genFocusStyle, resetComponent } from '../../style';
|
2022-06-21 00:34:51 +08:00
|
|
|
import { initFadeMotion, initZoomMotion } from '../../style/motion';
|
2023-08-31 22:21:32 +08:00
|
|
|
import type { GlobalToken } from '../../theme';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal';
|
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
|
2023-08-31 22:21:32 +08:00
|
|
|
import type { GenStyleFn, TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
2023-11-13 15:31:49 +08:00
|
|
|
import { unit } from '@ant-design/cssinjs';
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2022-04-26 22:45:39 +08:00
|
|
|
/** Component only token. Which will handle additional calculation of alias token */
|
|
|
|
export interface ComponentToken {
|
|
|
|
// Component token here
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 顶部背景色
|
|
|
|
* @descEN Background color of header
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
headerBg: string;
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 标题行高
|
|
|
|
* @descEN Line height of title
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
titleLineHeight: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 标题字体大小
|
|
|
|
* @descEN Font size of title
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
titleFontSize: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 标题字体颜色
|
|
|
|
* @descEN Font color of title
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
titleColor: string;
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 内容区域背景色
|
|
|
|
* @descEN Background color of content
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
contentBg: string;
|
2023-07-05 17:49:59 +08:00
|
|
|
/**
|
|
|
|
* @desc 底部区域背景色
|
|
|
|
* @descEN Background color of footer
|
|
|
|
*/
|
2023-05-09 19:24:50 +08:00
|
|
|
footerBg: string;
|
2023-11-15 21:19:50 +08:00
|
|
|
|
|
|
|
/** @internal */
|
|
|
|
closeBtnHoverBg: string;
|
|
|
|
/** @internal */
|
|
|
|
closeBtnActiveBg: string;
|
|
|
|
/** @internal */
|
|
|
|
contentPadding: number | string;
|
|
|
|
/** @internal */
|
|
|
|
headerPadding: string | number;
|
|
|
|
/** @internal */
|
|
|
|
headerBorderBottom: string;
|
|
|
|
/** @internal */
|
|
|
|
headerMarginBottom: number;
|
|
|
|
/** @internal */
|
|
|
|
bodyPadding: number;
|
|
|
|
/** @internal */
|
|
|
|
footerPadding: string | number;
|
|
|
|
/** @internal */
|
|
|
|
footerBorderTop: string;
|
|
|
|
/** @internal */
|
|
|
|
footerBorderRadius: string | number;
|
|
|
|
/** @internal */
|
|
|
|
footerMarginTop: string | number;
|
|
|
|
/** @internal */
|
|
|
|
confirmBodyPadding: string | number;
|
|
|
|
/** @internal */
|
|
|
|
confirmIconMarginInlineEnd: string | number;
|
|
|
|
/** @internal */
|
|
|
|
confirmBtnsMarginTop: string | number;
|
2022-04-26 22:45:39 +08:00
|
|
|
}
|
|
|
|
|
2022-05-10 17:30:01 +08:00
|
|
|
export interface ModalToken extends FullToken<'Modal'> {
|
2022-04-26 22:45:39 +08:00
|
|
|
// Custom token here
|
2023-11-13 15:31:49 +08:00
|
|
|
modalHeaderHeight: number | string;
|
2022-04-26 22:45:39 +08:00
|
|
|
modalFooterBorderColorSplit: string;
|
|
|
|
modalFooterBorderStyle: string;
|
|
|
|
modalFooterBorderWidth: number;
|
|
|
|
modalIconHoverColor: string;
|
2023-05-09 19:24:50 +08:00
|
|
|
modalCloseIconColor: string;
|
2023-11-13 15:31:49 +08:00
|
|
|
modalCloseBtnSize: number | string;
|
|
|
|
modalConfirmIconSize: number | string;
|
|
|
|
modalTitleHeight: number | string;
|
2022-04-26 22:45:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function box(position: React.CSSProperties['position']): React.CSSProperties {
|
|
|
|
return {
|
|
|
|
position,
|
2023-08-14 16:31:57 +08:00
|
|
|
inset: 0,
|
2022-04-26 22:45:39 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-11-17 23:31:41 +08:00
|
|
|
export const genModalMaskStyle: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => {
|
2023-03-08 17:20:17 +08:00
|
|
|
const { componentCls, antCls } = token;
|
2022-04-26 22:45:39 +08:00
|
|
|
|
2022-06-21 00:34:51 +08:00
|
|
|
return [
|
|
|
|
{
|
|
|
|
[`${componentCls}-root`]: {
|
2023-03-08 17:20:17 +08:00
|
|
|
[`${componentCls}${antCls}-zoom-enter, ${componentCls}${antCls}-zoom-appear`]: {
|
2022-06-21 00:34:51 +08:00
|
|
|
// reset scale avoid mousePosition bug
|
|
|
|
transform: 'none',
|
|
|
|
opacity: 0,
|
|
|
|
animationDuration: token.motionDurationSlow,
|
|
|
|
// https://github.com/ant-design/ant-design/issues/11777
|
|
|
|
userSelect: 'none',
|
|
|
|
},
|
2022-04-26 22:45:39 +08:00
|
|
|
|
2023-03-08 17:20:17 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/37329
|
|
|
|
// https://github.com/ant-design/ant-design/issues/40272
|
|
|
|
[`${componentCls}${antCls}-zoom-leave ${componentCls}-content`]: {
|
|
|
|
pointerEvents: 'none',
|
|
|
|
},
|
|
|
|
|
2022-06-21 00:34:51 +08:00
|
|
|
[`${componentCls}-mask`]: {
|
|
|
|
...box('fixed'),
|
|
|
|
zIndex: token.zIndexPopupBase,
|
|
|
|
height: '100%',
|
2022-06-29 21:24:29 +08:00
|
|
|
backgroundColor: token.colorBgMask,
|
2023-08-14 16:31:57 +08:00
|
|
|
pointerEvents: 'none',
|
2022-06-21 00:34:51 +08:00
|
|
|
|
|
|
|
[`${componentCls}-hidden`]: {
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
2022-04-26 22:45:39 +08:00
|
|
|
|
2022-06-21 00:34:51 +08:00
|
|
|
[`${componentCls}-wrap`]: {
|
|
|
|
...box('fixed'),
|
2023-08-14 16:31:57 +08:00
|
|
|
zIndex: token.zIndexPopupBase,
|
2022-06-21 00:34:51 +08:00
|
|
|
overflow: 'auto',
|
|
|
|
outline: 0,
|
|
|
|
WebkitOverflowScrolling: 'touch',
|
2023-08-14 16:31:57 +08:00
|
|
|
|
|
|
|
// Note: Firefox not support `:has` yet
|
|
|
|
[`&:has(${componentCls}${antCls}-zoom-enter), &:has(${componentCls}${antCls}-zoom-appear)`]:
|
|
|
|
{
|
|
|
|
pointerEvents: 'none',
|
|
|
|
},
|
2022-06-21 00:34:51 +08:00
|
|
|
},
|
|
|
|
},
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
2022-06-21 00:34:51 +08:00
|
|
|
{ [`${componentCls}-root`]: initFadeMotion(token) },
|
|
|
|
];
|
|
|
|
};
|
2022-04-26 22:45:39 +08:00
|
|
|
|
2022-11-17 23:31:41 +08:00
|
|
|
const genModalStyle: GenerateStyle<ModalToken> = (token) => {
|
2022-04-26 22:45:39 +08:00
|
|
|
const { componentCls } = token;
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
return [
|
|
|
|
// ======================== Root =========================
|
|
|
|
{
|
|
|
|
[`${componentCls}-root`]: {
|
|
|
|
[`${componentCls}-wrap-rtl`]: {
|
|
|
|
direction: 'rtl',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-centered`]: {
|
|
|
|
textAlign: 'center',
|
|
|
|
|
|
|
|
'&::before': {
|
|
|
|
display: 'inline-block',
|
|
|
|
width: 0,
|
|
|
|
height: '100%',
|
|
|
|
verticalAlign: 'middle',
|
|
|
|
content: '""',
|
|
|
|
},
|
|
|
|
[componentCls]: {
|
|
|
|
top: 0,
|
|
|
|
display: 'inline-block',
|
|
|
|
paddingBottom: 0,
|
|
|
|
textAlign: 'start',
|
|
|
|
verticalAlign: 'middle',
|
|
|
|
},
|
|
|
|
},
|
2022-04-28 09:45:53 +08:00
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`@media (max-width: ${token.screenSMMax})`]: {
|
|
|
|
[componentCls]: {
|
|
|
|
maxWidth: 'calc(100vw - 16px)',
|
2023-11-13 15:31:49 +08:00
|
|
|
margin: `${unit(token.marginXS)} auto`,
|
2022-06-11 21:39:58 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-centered`]: {
|
|
|
|
[componentCls]: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ======================== Modal ========================
|
|
|
|
{
|
2022-04-26 22:45:39 +08:00
|
|
|
[componentCls]: {
|
|
|
|
...resetComponent(token),
|
|
|
|
pointerEvents: 'none',
|
|
|
|
position: 'relative',
|
|
|
|
top: 100,
|
|
|
|
width: 'auto',
|
2023-11-13 15:31:49 +08:00
|
|
|
maxWidth: `calc(100vw - ${unit(token.calc(token.margin).mul(2).equal())})`,
|
2022-04-26 22:45:39 +08:00
|
|
|
margin: '0 auto',
|
|
|
|
paddingBottom: token.paddingLG,
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-title`]: {
|
2022-04-26 22:45:39 +08:00
|
|
|
margin: 0,
|
2023-05-09 19:24:50 +08:00
|
|
|
color: token.titleColor,
|
2022-05-13 14:33:50 +08:00
|
|
|
fontWeight: token.fontWeightStrong,
|
2023-05-09 19:24:50 +08:00
|
|
|
fontSize: token.titleFontSize,
|
|
|
|
lineHeight: token.titleLineHeight,
|
2022-04-26 22:45:39 +08:00
|
|
|
wordWrap: 'break-word',
|
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-content`]: {
|
2022-04-26 22:45:39 +08:00
|
|
|
position: 'relative',
|
2023-05-09 19:24:50 +08:00
|
|
|
backgroundColor: token.contentBg,
|
2022-04-26 22:45:39 +08:00
|
|
|
backgroundClip: 'padding-box',
|
|
|
|
border: 0,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: token.borderRadiusLG,
|
2023-02-03 11:20:21 +08:00
|
|
|
boxShadow: token.boxShadow,
|
2022-04-26 22:45:39 +08:00
|
|
|
pointerEvents: 'auto',
|
2023-11-15 21:19:50 +08:00
|
|
|
padding: token.contentPadding,
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-close`]: {
|
2022-04-26 22:45:39 +08:00
|
|
|
position: 'absolute',
|
2023-11-13 15:31:49 +08:00
|
|
|
top: token.calc(token.modalHeaderHeight).sub(token.modalCloseBtnSize).div(2).equal(),
|
|
|
|
insetInlineEnd: token
|
|
|
|
.calc(token.modalHeaderHeight)
|
|
|
|
.sub(token.modalCloseBtnSize)
|
|
|
|
.div(2)
|
|
|
|
.equal(),
|
|
|
|
zIndex: token.calc(token.zIndexPopupBase).add(10).equal(),
|
2022-04-26 22:45:39 +08:00
|
|
|
padding: 0,
|
2023-04-26 21:55:58 +08:00
|
|
|
color: token.modalCloseIconColor,
|
2022-05-13 14:33:50 +08:00
|
|
|
fontWeight: token.fontWeightStrong,
|
2022-04-26 22:45:39 +08:00
|
|
|
lineHeight: 1,
|
|
|
|
textDecoration: 'none',
|
|
|
|
background: 'transparent',
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: token.borderRadiusSM,
|
2023-05-09 19:24:50 +08:00
|
|
|
width: token.modalCloseBtnSize,
|
|
|
|
height: token.modalCloseBtnSize,
|
2022-04-26 22:45:39 +08:00
|
|
|
border: 0,
|
|
|
|
outline: 0,
|
|
|
|
cursor: 'pointer',
|
2022-11-17 23:31:41 +08:00
|
|
|
transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
|
2022-04-26 22:45:39 +08:00
|
|
|
|
|
|
|
'&-x': {
|
2023-05-09 19:24:50 +08:00
|
|
|
display: 'flex',
|
2022-04-26 22:45:39 +08:00
|
|
|
fontSize: token.fontSizeLG,
|
|
|
|
fontStyle: 'normal',
|
2023-11-13 15:31:49 +08:00
|
|
|
lineHeight: `${unit(token.modalCloseBtnSize)}`,
|
2023-05-09 19:24:50 +08:00
|
|
|
justifyContent: 'center',
|
2022-04-26 22:45:39 +08:00
|
|
|
textTransform: 'none',
|
|
|
|
textRendering: 'auto',
|
|
|
|
},
|
|
|
|
|
2022-09-20 21:50:36 +08:00
|
|
|
'&:hover': {
|
2022-04-26 22:45:39 +08:00
|
|
|
color: token.modalIconHoverColor,
|
2023-11-15 21:19:50 +08:00
|
|
|
backgroundColor: token.closeBtnHoverBg,
|
2022-04-26 22:45:39 +08:00
|
|
|
textDecoration: 'none',
|
|
|
|
},
|
2022-09-20 21:50:36 +08:00
|
|
|
|
|
|
|
'&:active': {
|
2023-11-15 21:19:50 +08:00
|
|
|
backgroundColor: token.closeBtnActiveBg,
|
2022-09-20 21:50:36 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
...genFocusStyle(token),
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-header`]: {
|
2022-04-26 22:45:39 +08:00
|
|
|
color: token.colorText,
|
2023-05-09 19:24:50 +08:00
|
|
|
background: token.headerBg,
|
2023-11-13 15:31:49 +08:00
|
|
|
borderRadius: `${unit(token.borderRadiusLG)} ${unit(token.borderRadiusLG)} 0 0`,
|
2023-11-15 21:19:50 +08:00
|
|
|
marginBottom: token.headerMarginBottom,
|
|
|
|
padding: token.headerPadding,
|
|
|
|
borderBottom: token.headerBorderBottom,
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-body`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
fontSize: token.fontSize,
|
2022-04-26 22:45:39 +08:00
|
|
|
lineHeight: token.lineHeight,
|
|
|
|
wordWrap: 'break-word',
|
2023-11-15 21:19:50 +08:00
|
|
|
padding: token.bodyPadding,
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-footer`]: {
|
2022-04-27 21:04:09 +08:00
|
|
|
textAlign: 'end',
|
2023-05-09 19:24:50 +08:00
|
|
|
background: token.footerBg,
|
2023-11-15 21:19:50 +08:00
|
|
|
marginTop: token.footerMarginTop,
|
|
|
|
padding: token.footerPadding,
|
|
|
|
borderTop: token.footerBorderTop,
|
|
|
|
borderRadius: token.footerBorderRadius,
|
2022-04-26 22:45:39 +08:00
|
|
|
|
|
|
|
[`${token.antCls}-btn + ${token.antCls}-btn:not(${token.antCls}-dropdown-trigger)`]: {
|
|
|
|
marginBottom: 0,
|
2022-04-27 21:04:09 +08:00
|
|
|
marginInlineStart: token.marginXS,
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
[`${componentCls}-open`]: {
|
2022-04-26 22:45:39 +08:00
|
|
|
overflow: 'hidden',
|
|
|
|
},
|
|
|
|
},
|
2022-06-11 21:39:58 +08:00
|
|
|
},
|
2022-04-26 22:45:39 +08:00
|
|
|
|
2022-06-11 21:39:58 +08:00
|
|
|
// ======================== Pure =========================
|
|
|
|
{
|
|
|
|
[`${componentCls}-pure-panel`]: {
|
|
|
|
top: 'auto',
|
|
|
|
padding: 0,
|
2022-09-22 15:14:53 +08:00
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
|
|
|
[`${componentCls}-content,
|
|
|
|
${componentCls}-body,
|
|
|
|
${componentCls}-confirm-body-wrapper`]: {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
flex: 'auto',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-confirm-body`]: {
|
|
|
|
marginBottom: 'auto',
|
|
|
|
},
|
2022-04-26 22:45:39 +08:00
|
|
|
},
|
|
|
|
},
|
2022-06-11 21:39:58 +08:00
|
|
|
];
|
2022-04-26 22:45:39 +08:00
|
|
|
};
|
|
|
|
|
2023-08-31 22:21:32 +08:00
|
|
|
const genRTLStyle: GenerateStyle<ModalToken> = (token) => {
|
|
|
|
const { componentCls } = token;
|
|
|
|
return {
|
|
|
|
[`${componentCls}-root`]: {
|
|
|
|
[`${componentCls}-wrap-rtl`]: {
|
|
|
|
direction: 'rtl',
|
|
|
|
|
|
|
|
[`${componentCls}-confirm-body`]: {
|
|
|
|
direction: 'rtl',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-04-26 22:45:39 +08:00
|
|
|
// ============================== Export ==============================
|
2023-08-31 22:21:32 +08:00
|
|
|
export const prepareToken: (token: Parameters<GenStyleFn<'Modal'>>[0]) => ModalToken = (token) => {
|
|
|
|
const headerPaddingVertical = token.padding;
|
|
|
|
const headerFontSize = token.fontSizeHeading5;
|
|
|
|
const headerLineHeight = token.lineHeightHeading5;
|
|
|
|
|
|
|
|
const modalToken = mergeToken<ModalToken>(token, {
|
2023-11-13 15:31:49 +08:00
|
|
|
modalHeaderHeight: token
|
|
|
|
.calc(token.calc(headerLineHeight).mul(headerFontSize).equal())
|
|
|
|
.add(token.calc(headerPaddingVertical).mul(2).equal())
|
|
|
|
.equal(),
|
2023-08-31 22:21:32 +08:00
|
|
|
modalFooterBorderColorSplit: token.colorSplit,
|
|
|
|
modalFooterBorderStyle: token.lineType,
|
|
|
|
modalFooterBorderWidth: token.lineWidth,
|
|
|
|
modalIconHoverColor: token.colorIconHover,
|
|
|
|
modalCloseIconColor: token.colorIcon,
|
2023-11-13 15:31:49 +08:00
|
|
|
modalCloseBtnSize: token.fontHeight,
|
|
|
|
modalConfirmIconSize: token.fontHeight,
|
|
|
|
modalTitleHeight: token.calc(token.titleFontSize).mul(token.titleLineHeight).equal(),
|
2023-08-31 22:21:32 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
return modalToken;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const prepareComponentToken = (token: GlobalToken) => ({
|
|
|
|
footerBg: 'transparent',
|
|
|
|
headerBg: token.colorBgElevated,
|
|
|
|
titleLineHeight: token.lineHeightHeading5,
|
|
|
|
titleFontSize: token.fontSizeHeading5,
|
|
|
|
contentBg: token.colorBgElevated,
|
|
|
|
titleColor: token.colorTextHeading,
|
2023-11-15 21:19:50 +08:00
|
|
|
|
|
|
|
// internal
|
|
|
|
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
|
|
|
|
closeBtnActiveBg: token.wireframe ? 'transparent' : token.colorFillContentHover,
|
|
|
|
contentPadding: token.wireframe
|
|
|
|
? 0
|
|
|
|
: `${unit(token.paddingMD)} ${unit(token.paddingContentHorizontalLG)}`,
|
|
|
|
headerPadding: token.wireframe ? `${unit(token.padding)} ${unit(token.paddingLG)}` : 0,
|
|
|
|
headerBorderBottom: token.wireframe
|
|
|
|
? `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
|
|
|
|
: 'none',
|
|
|
|
headerMarginBottom: token.wireframe ? 0 : token.marginXS,
|
|
|
|
bodyPadding: token.wireframe ? token.paddingLG : 0,
|
|
|
|
footerPadding: token.wireframe ? `${unit(token.paddingXS)} ${unit(token.padding)}` : 0,
|
|
|
|
footerBorderTop: token.wireframe
|
|
|
|
? `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
|
|
|
|
: 'none',
|
|
|
|
footerBorderRadius: token.wireframe
|
|
|
|
? `0 0 ${unit(token.borderRadiusLG)} ${unit(token.borderRadiusLG)}`
|
|
|
|
: 0,
|
|
|
|
footerMarginTop: token.wireframe ? 0 : token.marginSM,
|
|
|
|
confirmBodyPadding: token.wireframe
|
|
|
|
? `${unit(token.padding * 2)} ${unit(token.padding * 2)} ${unit(token.paddingLG)}`
|
|
|
|
: 0,
|
|
|
|
confirmIconMarginInlineEnd: token.wireframe ? token.margin : token.marginSM,
|
|
|
|
confirmBtnsMarginTop: token.wireframe ? token.marginLG : token.marginSM,
|
2023-08-31 22:21:32 +08:00
|
|
|
});
|
|
|
|
|
2023-04-26 21:55:58 +08:00
|
|
|
export default genComponentStyleHook(
|
|
|
|
'Modal',
|
|
|
|
(token) => {
|
2023-08-31 22:21:32 +08:00
|
|
|
const modalToken = prepareToken(token);
|
|
|
|
|
2023-04-26 21:55:58 +08:00
|
|
|
return [
|
|
|
|
genModalStyle(modalToken),
|
|
|
|
genRTLStyle(modalToken),
|
|
|
|
genModalMaskStyle(modalToken),
|
|
|
|
initZoomMotion(modalToken, 'zoom'),
|
|
|
|
];
|
|
|
|
},
|
2023-08-31 22:21:32 +08:00
|
|
|
prepareComponentToken,
|
2023-04-26 21:55:58 +08:00
|
|
|
);
|