mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 19:42:54 +08:00
Merge 9dfeda75b0
into 8abb52fc92
This commit is contained in:
commit
66f6f2feda
@ -61,7 +61,13 @@ export const PureContent: React.FC<PureContentProps> = (props) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={classNames({ [`${prefixCls}-with-icon`]: iconNode })} role={role}>
|
<div
|
||||||
|
className={classNames({
|
||||||
|
[`${prefixCls}-with-icon`]: iconNode,
|
||||||
|
[`${prefixCls}-${type}-bg`]: !!type,
|
||||||
|
})}
|
||||||
|
role={role}
|
||||||
|
>
|
||||||
{iconNode}
|
{iconNode}
|
||||||
<div className={`${prefixCls}-message`}>{message}</div>
|
<div className={`${prefixCls}-message`}>{message}</div>
|
||||||
<div className={`${prefixCls}-description`}>{description}</div>
|
<div className={`${prefixCls}-description`}>{description}</div>
|
||||||
|
@ -459,7 +459,7 @@ exports[`renders components/notification/demo/render-panel.tsx extend context co
|
|||||||
class="ant-notification-notice-content"
|
class="ant-notification-notice-content"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ant-notification-notice-with-icon"
|
class="ant-notification-notice-with-icon ant-notification-notice-success-bg"
|
||||||
role="alert"
|
role="alert"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -447,7 +447,7 @@ exports[`renders components/notification/demo/render-panel.tsx correctly 1`] = `
|
|||||||
class="ant-notification-notice-content"
|
class="ant-notification-notice-content"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ant-notification-notice-with-icon"
|
class="ant-notification-notice-with-icon ant-notification-notice-success-bg"
|
||||||
role="alert"
|
role="alert"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -20,6 +20,26 @@ export interface ComponentToken {
|
|||||||
* @descEN Width of Notification
|
* @descEN Width of Notification
|
||||||
*/
|
*/
|
||||||
width: number | string;
|
width: number | string;
|
||||||
|
/**
|
||||||
|
* @desc 提醒框success背景色
|
||||||
|
* @descEN Background color of Notification success
|
||||||
|
*/
|
||||||
|
colorSuccessBgElevated: string;
|
||||||
|
/**
|
||||||
|
* @desc 提醒框error背景色
|
||||||
|
* @descEN Background color of Notification error
|
||||||
|
*/
|
||||||
|
colorErrorBgElevated: string;
|
||||||
|
/**
|
||||||
|
* @desc 提醒框info背景色
|
||||||
|
* @descEN Background color of Notification info
|
||||||
|
*/
|
||||||
|
colorInfoBgElevated: string;
|
||||||
|
/**
|
||||||
|
* @desc 提醒框warning背景色
|
||||||
|
* @descEN Background color of Notification warning
|
||||||
|
*/
|
||||||
|
colorWarningBgElevated: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,6 +131,10 @@ export const genNoticeStyle = (token: NotificationToken): CSSObject => {
|
|||||||
lineHeight,
|
lineHeight,
|
||||||
width,
|
width,
|
||||||
notificationIconSize,
|
notificationIconSize,
|
||||||
|
colorSuccessBgElevated,
|
||||||
|
colorErrorBgElevated,
|
||||||
|
colorInfoBgElevated,
|
||||||
|
colorWarningBgElevated,
|
||||||
colorText,
|
colorText,
|
||||||
} = token;
|
} = token;
|
||||||
|
|
||||||
@ -133,6 +157,22 @@ export const genNoticeStyle = (token: NotificationToken): CSSObject => {
|
|||||||
wordWrap: 'break-word',
|
wordWrap: 'break-word',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
[`${noticeCls}-success-bg`]: {
|
||||||
|
background: colorSuccessBgElevated,
|
||||||
|
},
|
||||||
|
|
||||||
|
[`${noticeCls}-info-bg`]: {
|
||||||
|
background: colorInfoBgElevated,
|
||||||
|
},
|
||||||
|
|
||||||
|
[`${noticeCls}-warning-bg`]: {
|
||||||
|
background: colorWarningBgElevated,
|
||||||
|
},
|
||||||
|
|
||||||
|
[`${noticeCls}-error-bg`]: {
|
||||||
|
background: colorErrorBgElevated,
|
||||||
|
},
|
||||||
|
|
||||||
[`${noticeCls}-message`]: {
|
[`${noticeCls}-message`]: {
|
||||||
marginBottom: token.marginXS,
|
marginBottom: token.marginXS,
|
||||||
color: colorTextHeading,
|
color: colorTextHeading,
|
||||||
@ -350,6 +390,10 @@ const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
|
|||||||
export const prepareComponentToken = (token: AliasToken) => ({
|
export const prepareComponentToken = (token: AliasToken) => ({
|
||||||
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
|
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
|
||||||
width: 384,
|
width: 384,
|
||||||
|
colorSuccessBgElevated: token.colorBgElevated,
|
||||||
|
colorErrorBgElevated: token.colorBgElevated,
|
||||||
|
colorInfoBgElevated: token.colorBgElevated,
|
||||||
|
colorWarningBgElevated: token.colorBgElevated,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const prepareNotificationToken: (
|
export const prepareNotificationToken: (
|
||||||
|
Loading…
Reference in New Issue
Block a user