|
|
|
@ -9,18 +9,18 @@ import genNotificationPlacementStyle from './placement';
|
|
|
|
|
export interface ComponentToken {
|
|
|
|
|
zIndexPopup: number;
|
|
|
|
|
width: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface NotificationToken extends FullToken<'Notification'> {
|
|
|
|
|
notificationBg: string;
|
|
|
|
|
notificationPadding: string;
|
|
|
|
|
notificationPaddingVertical: number;
|
|
|
|
|
notificationPaddingHorizontal: number;
|
|
|
|
|
notificationPadding: string;
|
|
|
|
|
notificationIconSize: number;
|
|
|
|
|
notificationCloseButtonSize: number;
|
|
|
|
|
notificationMarginBottom: number;
|
|
|
|
|
notificationMarginEdge: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface NotificationToken extends FullToken<'Notification'> {
|
|
|
|
|
animationMaxHeight: number;
|
|
|
|
|
notificationIconSize: number;
|
|
|
|
|
notificationCloseButtonSize: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
|
|
|
|
@ -268,28 +268,28 @@ const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
|
|
|
|
|
// ============================== Export ==============================
|
|
|
|
|
export default genComponentStyleHook(
|
|
|
|
|
'Notification',
|
|
|
|
|
(token) => {
|
|
|
|
|
const notificationToken = mergeToken<NotificationToken>(token, {
|
|
|
|
|
// index.less variables
|
|
|
|
|
animationMaxHeight: 150,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return [genNotificationStyle(notificationToken)];
|
|
|
|
|
},
|
|
|
|
|
(token) => {
|
|
|
|
|
const notificationPaddingVertical = token.paddingMD;
|
|
|
|
|
const notificationPaddingHorizontal = token.paddingLG;
|
|
|
|
|
|
|
|
|
|
const notificationToken = mergeToken<NotificationToken>(token, {
|
|
|
|
|
// default.less variables
|
|
|
|
|
return {
|
|
|
|
|
zIndexPopup: token.zIndexPopupBase + 50,
|
|
|
|
|
width: 384,
|
|
|
|
|
notificationBg: token.colorBgElevated,
|
|
|
|
|
notificationPaddingVertical,
|
|
|
|
|
notificationPaddingHorizontal,
|
|
|
|
|
// index.less variables
|
|
|
|
|
notificationPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`,
|
|
|
|
|
notificationMarginBottom: token.margin,
|
|
|
|
|
notificationMarginEdge: token.marginLG,
|
|
|
|
|
animationMaxHeight: 150,
|
|
|
|
|
notificationIconSize: token.fontSizeLG * token.lineHeightLG,
|
|
|
|
|
notificationCloseButtonSize: token.controlHeightLG * 0.55,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return [genNotificationStyle(notificationToken)];
|
|
|
|
|
notificationMarginBottom: token.margin,
|
|
|
|
|
notificationPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`,
|
|
|
|
|
notificationMarginEdge: token.marginLG,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
(token) => ({
|
|
|
|
|
zIndexPopup: token.zIndexPopupBase + 50,
|
|
|
|
|
width: 384,
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|