Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-16 02:20:32 +00:00
parent a4605e311a
commit 71de1506ca
28603 changed files with 2179459 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import type { StatisticProps as AntdStatisticProps, BadgeProps } from 'antd';
import React from 'react';
export interface StatisticProps extends AntdStatisticProps {
/**
* 样式
*
* @ignore
*/
style?: React.CSSProperties;
/**
* ClassName
*
* @ignore
*/
className?: string;
/** 描述性标签 */
description?: React.ReactNode;
/** 标题提示 */
tip?: React.ReactNode;
/** 当前项显示的状态 */
status?: BadgeProps['status'];
/** Icon 图标 */
icon?: React.ReactNode;
/** Layout 布局 */
layout?: 'horizontal' | 'vertical' | 'inline';
/** 趋势 */
trend?: 'up' | 'down';
children?: any;
}
declare const Statistic: React.FC<StatisticProps>;
export default Statistic;

View File

@@ -0,0 +1,83 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["className", "layout", "style", "description", "children", "title", "tip", "status", "trend", "prefix", "icon"];
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Statistic as AntdStatistic, Badge, ConfigProvider, Tooltip } from 'antd';
import classNames from 'classnames';
import React, { useContext } from 'react';
import { useStyle } from "./style";
import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var Statistic = function Statistic(props) {
var className = props.className,
_props$layout = props.layout,
layout = _props$layout === void 0 ? 'inline' : _props$layout,
style = props.style,
description = props.description,
children = props.children,
title = props.title,
tip = props.tip,
status = props.status,
trend = props.trend,
prefix = props.prefix,
icon = props.icon,
others = _objectWithoutProperties(props, _excluded);
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls;
var prefixCls = getPrefixCls('pro-card-statistic');
var _useStyle = useStyle(prefixCls),
wrapSSR = _useStyle.wrapSSR,
hashId = _useStyle.hashId;
var classString = classNames(prefixCls, className, hashId);
var statusClass = classNames("".concat(prefixCls, "-status"), hashId);
var iconClass = classNames("".concat(prefixCls, "-icon"), hashId);
var wrapperClass = classNames("".concat(prefixCls, "-wrapper"), hashId);
var contentClass = classNames("".concat(prefixCls, "-content"), hashId);
var statisticClassName = classNames(hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-layout-").concat(layout), layout), "".concat(prefixCls, "-trend-").concat(trend), trend));
var tipDom = tip && /*#__PURE__*/_jsx(Tooltip, {
title: tip,
children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {
className: "".concat(prefixCls, "-tip ").concat(hashId).trim()
})
});
var trendIconClassName = classNames("".concat(prefixCls, "-trend-icon"), hashId, _defineProperty({}, "".concat(prefixCls, "-trend-icon-").concat(trend), trend));
var trendDom = trend && /*#__PURE__*/_jsx("div", {
className: trendIconClassName
});
var statusDom = status && /*#__PURE__*/_jsx("div", {
className: statusClass,
children: /*#__PURE__*/_jsx(Badge, {
status: status,
text: null
})
});
var iconDom = icon && /*#__PURE__*/_jsx("div", {
className: iconClass,
children: icon
});
return wrapSSR( /*#__PURE__*/_jsxs("div", {
className: classString,
style: style,
children: [iconDom, /*#__PURE__*/_jsxs("div", {
className: wrapperClass,
children: [statusDom, /*#__PURE__*/_jsxs("div", {
className: contentClass,
children: [/*#__PURE__*/_jsx(AntdStatistic, _objectSpread({
title: (title || tipDom) && /*#__PURE__*/_jsxs(_Fragment, {
children: [title, tipDom]
}),
prefix: (trendDom || prefix) && /*#__PURE__*/_jsxs(_Fragment, {
children: [trendDom, prefix]
}),
className: statisticClassName
}, others)), description && /*#__PURE__*/_jsx("div", {
className: "".concat(prefixCls, "-description ").concat(hashId).trim(),
children: description
})]
})]
})]
}));
};
export default Statistic;

View File

@@ -0,0 +1,9 @@
/// <reference types="react" />
import type { ProAliasToken } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
componentCls: string;
}
export declare function useStyle(prefixCls: string): {
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
hashId: string;
};

View File

@@ -0,0 +1,84 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
var genProStyle = function genProStyle(token) {
return _defineProperty({}, token.componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
display: 'flex',
fontSize: token.fontSize,
'& + &': {
marginBlockStart: 4
},
'&-tip': {
marginInlineStart: 4
},
'&-wrapper': _defineProperty({
display: 'flex',
width: '100%'
}, "".concat(token.componentCls, "-status"), {
width: '14px'
}),
'&-icon': {
marginInlineEnd: 16
},
'&-trend-icon': {
width: 0,
height: 0,
borderInlineEnd: '3.5px solid transparent',
borderBlockEnd: '9px solid #000',
borderInlineStart: '3.5px solid transparent',
'&-up': {
transform: 'rotate(0deg)'
},
'&-down': {
transform: 'rotate(180deg)'
}
},
'&-content': _defineProperty({
width: '100%'
}, "".concat(token.antCls, "-statistic-content"), {
'&-value-int': {
fontSize: token.fontSizeHeading3
}
}),
'&-description': {
width: '100%'
}
}, "".concat(token.antCls, "-statistic-title"), {
color: token.colorText
}), '&-trend-up', _defineProperty({}, "".concat(token.antCls, "-statistic-content"), _defineProperty({
color: '#f5222d'
}, "".concat(token.componentCls, "-trend-icon"), {
borderBlockEndColor: '#f5222d'
}))), '&-trend-down', _defineProperty({}, "".concat(token.antCls, "-statistic-content"), _defineProperty({
color: '#389e0d'
}, "".concat(token.componentCls, "-trend-icon"), {
borderBlockEndColor: '#52c41a'
}))), '& &-layout-horizontal', _defineProperty(_defineProperty(_defineProperty({
display: 'flex',
justifyContent: 'space-between'
}, "".concat(token.antCls, "-statistic-title"), {
marginBlockEnd: 0
}), "".concat(token.antCls, "-statistic-content-value"), {
fontWeight: 500
}), "".concat(token.antCls, "-statistic-title,").concat(token.antCls, "-statistic-content,").concat(token.antCls, "-statistic-content-suffix,").concat(token.antCls, "-statistic-content-prefix,").concat(token.antCls, "-statistic-content-value-decimal"), {
fontSize: token.fontSize
})), '& &-layout-inline', _defineProperty(_defineProperty(_defineProperty({
display: 'inline-flex',
color: token.colorTextSecondary
}, "".concat(token.antCls, "-statistic-title"), {
marginInlineEnd: '6px',
marginBlockEnd: 0
}), "".concat(token.antCls, "-statistic-content"), {
color: token.colorTextSecondary
}), "".concat(token.antCls, "-statistic-title,").concat(token.antCls, "-statistic-content,").concat(token.antCls, "-statistic-content-suffix,").concat(token.antCls, "-statistic-content-prefix,").concat(token.antCls, "-statistic-content-value-decimal"), {
fontSize: token.fontSizeSM
})));
};
export function useStyle(prefixCls) {
return useAntdStyle('Statistic', function (token) {
var proListToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
return [genProStyle(proListToken)];
});
}