first commit
This commit is contained in:
42
frontend/node_modules/antd/lib/alert/Alert.d.ts
generated
vendored
Normal file
42
frontend/node_modules/antd/lib/alert/Alert.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import * as React from 'react';
|
||||
import type { ClosableType } from '../_util/hooks';
|
||||
export interface AlertRef {
|
||||
nativeElement: HTMLDivElement;
|
||||
}
|
||||
export interface AlertProps {
|
||||
/** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
|
||||
type?: 'success' | 'info' | 'warning' | 'error';
|
||||
/** Whether Alert can be closed */
|
||||
closable?: ClosableType;
|
||||
/**
|
||||
* @deprecated please use `closable.closeIcon` instead.
|
||||
* Close text to show
|
||||
*/
|
||||
closeText?: React.ReactNode;
|
||||
/** Content of Alert */
|
||||
message?: React.ReactNode;
|
||||
/** Additional content of Alert */
|
||||
description?: React.ReactNode;
|
||||
/** Callback when close Alert */
|
||||
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
/** Trigger when animation ending of Alert */
|
||||
afterClose?: () => void;
|
||||
/** Whether to show icon */
|
||||
showIcon?: boolean;
|
||||
/** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
|
||||
role?: string;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
banner?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
closeIcon?: React.ReactNode;
|
||||
action?: React.ReactNode;
|
||||
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
||||
id?: string;
|
||||
}
|
||||
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<AlertRef>>;
|
||||
export default Alert;
|
||||
225
frontend/node_modules/antd/lib/alert/Alert.js
generated
vendored
Normal file
225
frontend/node_modules/antd/lib/alert/Alert.js
generated
vendored
Normal file
@@ -0,0 +1,225 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _CheckCircleFilled = _interopRequireDefault(require("@ant-design/icons/CheckCircleFilled"));
|
||||
var _CloseCircleFilled = _interopRequireDefault(require("@ant-design/icons/CloseCircleFilled"));
|
||||
var _CloseOutlined = _interopRequireDefault(require("@ant-design/icons/CloseOutlined"));
|
||||
var _ExclamationCircleFilled = _interopRequireDefault(require("@ant-design/icons/ExclamationCircleFilled"));
|
||||
var _InfoCircleFilled = _interopRequireDefault(require("@ant-design/icons/InfoCircleFilled"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcMotion = _interopRequireDefault(require("rc-motion"));
|
||||
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _reactNode = require("../_util/reactNode");
|
||||
var _warning = require("../_util/warning");
|
||||
var _context = require("../config-provider/context");
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const iconMapFilled = {
|
||||
success: _CheckCircleFilled.default,
|
||||
info: _InfoCircleFilled.default,
|
||||
error: _CloseCircleFilled.default,
|
||||
warning: _ExclamationCircleFilled.default
|
||||
};
|
||||
const IconNode = props => {
|
||||
const {
|
||||
icon,
|
||||
prefixCls,
|
||||
type
|
||||
} = props;
|
||||
const iconType = iconMapFilled[type] || null;
|
||||
if (icon) {
|
||||
return (0, _reactNode.replaceElement)(icon, /*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-icon`
|
||||
}, icon), () => ({
|
||||
className: (0, _classnames.default)(`${prefixCls}-icon`, icon.props.className)
|
||||
}));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(iconType, {
|
||||
className: `${prefixCls}-icon`
|
||||
});
|
||||
};
|
||||
const CloseIconNode = props => {
|
||||
const {
|
||||
isClosable,
|
||||
prefixCls,
|
||||
closeIcon,
|
||||
handleClose,
|
||||
ariaProps
|
||||
} = props;
|
||||
const mergedCloseIcon = closeIcon === true || closeIcon === undefined ? /*#__PURE__*/React.createElement(_CloseOutlined.default, null) : closeIcon;
|
||||
return isClosable ? (/*#__PURE__*/React.createElement("button", Object.assign({
|
||||
type: "button",
|
||||
onClick: handleClose,
|
||||
className: `${prefixCls}-close-icon`,
|
||||
tabIndex: 0
|
||||
}, ariaProps), mergedCloseIcon)) : null;
|
||||
};
|
||||
const Alert = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
description,
|
||||
prefixCls: customizePrefixCls,
|
||||
message,
|
||||
banner,
|
||||
className,
|
||||
rootClassName,
|
||||
style,
|
||||
onMouseEnter,
|
||||
onMouseLeave,
|
||||
onClick,
|
||||
afterClose,
|
||||
showIcon,
|
||||
closable,
|
||||
closeText,
|
||||
closeIcon,
|
||||
action,
|
||||
id
|
||||
} = props,
|
||||
otherProps = __rest(props, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]);
|
||||
const [closed, setClosed] = React.useState(false);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Alert');
|
||||
warning.deprecated(!closeText, 'closeText', 'closable.closeIcon');
|
||||
}
|
||||
const internalRef = React.useRef(null);
|
||||
React.useImperativeHandle(ref, () => ({
|
||||
nativeElement: internalRef.current
|
||||
}));
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
closable: contextClosable,
|
||||
closeIcon: contextCloseIcon,
|
||||
className: contextClassName,
|
||||
style: contextStyle
|
||||
} = (0, _context.useComponentConfig)('alert');
|
||||
const prefixCls = getPrefixCls('alert', customizePrefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
const handleClose = e => {
|
||||
var _a;
|
||||
setClosed(true);
|
||||
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
||||
};
|
||||
const type = React.useMemo(() => {
|
||||
if (props.type !== undefined) {
|
||||
return props.type;
|
||||
}
|
||||
// banner mode defaults to 'warning'
|
||||
return banner ? 'warning' : 'info';
|
||||
}, [props.type, banner]);
|
||||
// closeable when closeText or closeIcon is assigned
|
||||
const isClosable = React.useMemo(() => {
|
||||
if (typeof closable === 'object' && closable.closeIcon) {
|
||||
return true;
|
||||
}
|
||||
if (closeText) {
|
||||
return true;
|
||||
}
|
||||
if (typeof closable === 'boolean') {
|
||||
return closable;
|
||||
}
|
||||
// should be true when closeIcon is 0 or ''
|
||||
if (closeIcon !== false && closeIcon !== null && closeIcon !== undefined) {
|
||||
return true;
|
||||
}
|
||||
return !!contextClosable;
|
||||
}, [closeText, closeIcon, closable, contextClosable]);
|
||||
// banner mode defaults to Icon
|
||||
const isShowIcon = banner && showIcon === undefined ? true : showIcon;
|
||||
const alertCls = (0, _classnames.default)(prefixCls, `${prefixCls}-${type}`, {
|
||||
[`${prefixCls}-with-description`]: !!description,
|
||||
[`${prefixCls}-no-icon`]: !isShowIcon,
|
||||
[`${prefixCls}-banner`]: !!banner,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, contextClassName, className, rootClassName, cssVarCls, hashId);
|
||||
const restProps = (0, _pickAttrs.default)(otherProps, {
|
||||
aria: true,
|
||||
data: true
|
||||
});
|
||||
const mergedCloseIcon = React.useMemo(() => {
|
||||
if (typeof closable === 'object' && closable.closeIcon) {
|
||||
return closable.closeIcon;
|
||||
}
|
||||
if (closeText) {
|
||||
return closeText;
|
||||
}
|
||||
if (closeIcon !== undefined) {
|
||||
return closeIcon;
|
||||
}
|
||||
if (typeof contextClosable === 'object' && contextClosable.closeIcon) {
|
||||
return contextClosable.closeIcon;
|
||||
}
|
||||
return contextCloseIcon;
|
||||
}, [closeIcon, closable, contextClosable, closeText, contextCloseIcon]);
|
||||
const mergedAriaProps = React.useMemo(() => {
|
||||
const merged = closable !== null && closable !== void 0 ? closable : contextClosable;
|
||||
if (typeof merged === 'object') {
|
||||
const {
|
||||
closeIcon: _
|
||||
} = merged,
|
||||
ariaProps = __rest(merged, ["closeIcon"]);
|
||||
return ariaProps;
|
||||
}
|
||||
return {};
|
||||
}, [closable, contextClosable]);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(_rcMotion.default, {
|
||||
visible: !closed,
|
||||
motionName: `${prefixCls}-motion`,
|
||||
motionAppear: false,
|
||||
motionEnter: false,
|
||||
onLeaveStart: node => ({
|
||||
maxHeight: node.offsetHeight
|
||||
}),
|
||||
onLeaveEnd: afterClose
|
||||
}, ({
|
||||
className: motionClassName,
|
||||
style: motionStyle
|
||||
}, setRef) => (/*#__PURE__*/React.createElement("div", Object.assign({
|
||||
id: id,
|
||||
ref: (0, _ref.composeRef)(internalRef, setRef),
|
||||
"data-show": !closed,
|
||||
className: (0, _classnames.default)(alertCls, motionClassName),
|
||||
style: Object.assign(Object.assign(Object.assign({}, contextStyle), style), motionStyle),
|
||||
onMouseEnter: onMouseEnter,
|
||||
onMouseLeave: onMouseLeave,
|
||||
onClick: onClick,
|
||||
role: "alert"
|
||||
}, restProps), isShowIcon ? (/*#__PURE__*/React.createElement(IconNode, {
|
||||
description: description,
|
||||
icon: props.icon,
|
||||
prefixCls: prefixCls,
|
||||
type: type
|
||||
})) : null, /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-content`
|
||||
}, message ? /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-message`
|
||||
}, message) : null, description ? /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-description`
|
||||
}, description) : null), action ? /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-action`
|
||||
}, action) : null, /*#__PURE__*/React.createElement(CloseIconNode, {
|
||||
isClosable: isClosable,
|
||||
prefixCls: prefixCls,
|
||||
closeIcon: mergedCloseIcon,
|
||||
handleClose: handleClose,
|
||||
ariaProps: mergedAriaProps
|
||||
})))));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Alert.displayName = 'Alert';
|
||||
}
|
||||
var _default = exports.default = Alert;
|
||||
24
frontend/node_modules/antd/lib/alert/ErrorBoundary.d.ts
generated
vendored
Normal file
24
frontend/node_modules/antd/lib/alert/ErrorBoundary.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as React from 'react';
|
||||
interface ErrorBoundaryProps {
|
||||
message?: React.ReactNode;
|
||||
description?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
id?: string;
|
||||
}
|
||||
interface ErrorBoundaryStates {
|
||||
error?: Error | null;
|
||||
info?: {
|
||||
componentStack?: string;
|
||||
};
|
||||
}
|
||||
declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryStates> {
|
||||
state: {
|
||||
error: undefined;
|
||||
info: {
|
||||
componentStack: string;
|
||||
};
|
||||
};
|
||||
componentDidCatch(error: Error | null, info: object): void;
|
||||
render(): React.ReactNode;
|
||||
}
|
||||
export default ErrorBoundary;
|
||||
71
frontend/node_modules/antd/lib/alert/ErrorBoundary.js
generated
vendored
Normal file
71
frontend/node_modules/antd/lib/alert/ErrorBoundary.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
||||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
||||
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
||||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _Alert = _interopRequireDefault(require("./Alert"));
|
||||
let ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
||||
function ErrorBoundary() {
|
||||
var _this;
|
||||
(0, _classCallCheck2.default)(this, ErrorBoundary);
|
||||
_this = (0, _callSuper2.default)(this, ErrorBoundary, arguments);
|
||||
_this.state = {
|
||||
error: undefined,
|
||||
info: {
|
||||
componentStack: ''
|
||||
}
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
(0, _inherits2.default)(ErrorBoundary, _React$Component);
|
||||
return (0, _createClass2.default)(ErrorBoundary, [{
|
||||
key: "componentDidCatch",
|
||||
value: function componentDidCatch(error, info) {
|
||||
this.setState({
|
||||
error,
|
||||
info
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
const {
|
||||
message,
|
||||
description,
|
||||
id,
|
||||
children
|
||||
} = this.props;
|
||||
const {
|
||||
error,
|
||||
info
|
||||
} = this.state;
|
||||
const componentStack = (info === null || info === void 0 ? void 0 : info.componentStack) || null;
|
||||
const errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;
|
||||
const errorDescription = typeof description === 'undefined' ? componentStack : description;
|
||||
if (error) {
|
||||
return /*#__PURE__*/React.createElement(_Alert.default, {
|
||||
id: id,
|
||||
type: "error",
|
||||
message: errorMessage,
|
||||
description: /*#__PURE__*/React.createElement("pre", {
|
||||
style: {
|
||||
fontSize: '0.9em',
|
||||
overflowX: 'auto'
|
||||
}
|
||||
}, errorDescription)
|
||||
});
|
||||
}
|
||||
return children;
|
||||
}
|
||||
}]);
|
||||
}(React.Component);
|
||||
var _default = exports.default = ErrorBoundary;
|
||||
8
frontend/node_modules/antd/lib/alert/index.d.ts
generated
vendored
Normal file
8
frontend/node_modules/antd/lib/alert/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import InternalAlert from './Alert';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
export type { AlertProps } from './Alert';
|
||||
type CompoundedComponent = typeof InternalAlert & {
|
||||
ErrorBoundary: typeof ErrorBoundary;
|
||||
};
|
||||
declare const Alert: CompoundedComponent;
|
||||
export default Alert;
|
||||
13
frontend/node_modules/antd/lib/alert/index.js
generated
vendored
Normal file
13
frontend/node_modules/antd/lib/alert/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _Alert = _interopRequireDefault(require("./Alert"));
|
||||
var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
|
||||
const Alert = _Alert.default;
|
||||
Alert.ErrorBoundary = _ErrorBoundary.default;
|
||||
var _default = exports.default = Alert;
|
||||
26
frontend/node_modules/antd/lib/alert/style/index.d.ts
generated
vendored
Normal file
26
frontend/node_modules/antd/lib/alert/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 默认内间距
|
||||
* @descEN Default padding
|
||||
*/
|
||||
defaultPadding: CSSProperties['padding'];
|
||||
/**
|
||||
* @desc 带有描述的内间距
|
||||
* @descEN Padding with description
|
||||
*/
|
||||
withDescriptionPadding: CSSProperties['padding'];
|
||||
/**
|
||||
* @desc 带有描述时的图标尺寸
|
||||
* @descEN Icon size with description
|
||||
*/
|
||||
withDescriptionIconSize: number;
|
||||
}
|
||||
type AlertToken = FullToken<'Alert'> & {};
|
||||
export declare const genBaseStyle: GenerateStyle<AlertToken>;
|
||||
export declare const genTypeStyle: GenerateStyle<AlertToken>;
|
||||
export declare const genActionStyle: GenerateStyle<AlertToken>;
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Alert'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
187
frontend/node_modules/antd/lib/alert/style/index.js
generated
vendored
Normal file
187
frontend/node_modules/antd/lib/alert/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.genTypeStyle = exports.genBaseStyle = exports.genActionStyle = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
const genAlertTypeStyle = (bgColor, borderColor, iconColor, token, alertCls) => ({
|
||||
background: bgColor,
|
||||
border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${borderColor}`,
|
||||
[`${alertCls}-icon`]: {
|
||||
color: iconColor
|
||||
}
|
||||
});
|
||||
const genBaseStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
motionDurationSlow: duration,
|
||||
marginXS,
|
||||
marginSM,
|
||||
fontSize,
|
||||
fontSizeLG,
|
||||
lineHeight,
|
||||
borderRadiusLG: borderRadius,
|
||||
motionEaseInOutCirc,
|
||||
withDescriptionIconSize,
|
||||
colorText,
|
||||
colorTextHeading,
|
||||
withDescriptionPadding,
|
||||
defaultPadding
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
padding: defaultPadding,
|
||||
wordWrap: 'break-word',
|
||||
borderRadius,
|
||||
[`&${componentCls}-rtl`]: {
|
||||
direction: 'rtl'
|
||||
},
|
||||
[`${componentCls}-content`]: {
|
||||
flex: 1,
|
||||
minWidth: 0
|
||||
},
|
||||
[`${componentCls}-icon`]: {
|
||||
marginInlineEnd: marginXS,
|
||||
lineHeight: 0
|
||||
},
|
||||
'&-description': {
|
||||
display: 'none',
|
||||
fontSize,
|
||||
lineHeight
|
||||
},
|
||||
'&-message': {
|
||||
color: colorTextHeading
|
||||
},
|
||||
[`&${componentCls}-motion-leave`]: {
|
||||
overflow: 'hidden',
|
||||
opacity: 1,
|
||||
transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc},
|
||||
padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc},
|
||||
margin-bottom ${duration} ${motionEaseInOutCirc}`
|
||||
},
|
||||
[`&${componentCls}-motion-leave-active`]: {
|
||||
maxHeight: 0,
|
||||
marginBottom: '0 !important',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
opacity: 0
|
||||
}
|
||||
}),
|
||||
[`${componentCls}-with-description`]: {
|
||||
alignItems: 'flex-start',
|
||||
padding: withDescriptionPadding,
|
||||
[`${componentCls}-icon`]: {
|
||||
marginInlineEnd: marginSM,
|
||||
fontSize: withDescriptionIconSize,
|
||||
lineHeight: 0
|
||||
},
|
||||
[`${componentCls}-message`]: {
|
||||
display: 'block',
|
||||
marginBottom: marginXS,
|
||||
color: colorTextHeading,
|
||||
fontSize: fontSizeLG
|
||||
},
|
||||
[`${componentCls}-description`]: {
|
||||
display: 'block',
|
||||
color: colorText
|
||||
}
|
||||
},
|
||||
[`${componentCls}-banner`]: {
|
||||
marginBottom: 0,
|
||||
border: '0 !important',
|
||||
borderRadius: 0
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.genBaseStyle = genBaseStyle;
|
||||
const genTypeStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
colorSuccess,
|
||||
colorSuccessBorder,
|
||||
colorSuccessBg,
|
||||
colorWarning,
|
||||
colorWarningBorder,
|
||||
colorWarningBg,
|
||||
colorError,
|
||||
colorErrorBorder,
|
||||
colorErrorBg,
|
||||
colorInfo,
|
||||
colorInfoBorder,
|
||||
colorInfoBg
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
'&-success': genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token, componentCls),
|
||||
'&-info': genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token, componentCls),
|
||||
'&-warning': genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token, componentCls),
|
||||
'&-error': Object.assign(Object.assign({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token, componentCls)), {
|
||||
[`${componentCls}-description > pre`]: {
|
||||
margin: 0,
|
||||
padding: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.genTypeStyle = genTypeStyle;
|
||||
const genActionStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
iconCls,
|
||||
motionDurationMid,
|
||||
marginXS,
|
||||
fontSizeIcon,
|
||||
colorIcon,
|
||||
colorIconHover
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
'&-action': {
|
||||
marginInlineStart: marginXS
|
||||
},
|
||||
[`${componentCls}-close-icon`]: {
|
||||
marginInlineStart: marginXS,
|
||||
padding: 0,
|
||||
overflow: 'hidden',
|
||||
fontSize: fontSizeIcon,
|
||||
lineHeight: (0, _cssinjs.unit)(fontSizeIcon),
|
||||
backgroundColor: 'transparent',
|
||||
border: 'none',
|
||||
outline: 'none',
|
||||
cursor: 'pointer',
|
||||
[`${iconCls}-close`]: {
|
||||
color: colorIcon,
|
||||
transition: `color ${motionDurationMid}`,
|
||||
'&:hover': {
|
||||
color: colorIconHover
|
||||
}
|
||||
}
|
||||
},
|
||||
'&-close-text': {
|
||||
color: colorIcon,
|
||||
transition: `color ${motionDurationMid}`,
|
||||
'&:hover': {
|
||||
color: colorIconHover
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.genActionStyle = genActionStyle;
|
||||
const prepareComponentToken = token => {
|
||||
const paddingHorizontal = 12; // Fixed value here.
|
||||
return {
|
||||
withDescriptionIconSize: token.fontSizeHeading3,
|
||||
defaultPadding: `${token.paddingContentVerticalSM}px ${paddingHorizontal}px`,
|
||||
withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`
|
||||
};
|
||||
};
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Alert', token => [genBaseStyle(token), genTypeStyle(token), genActionStyle(token)], prepareComponentToken);
|
||||
Reference in New Issue
Block a user