diff --git a/src/components/HeroSection/index.tsx b/src/components/HeroSection/index.tsx index d313b59c..ece3163b 100644 --- a/src/components/HeroSection/index.tsx +++ b/src/components/HeroSection/index.tsx @@ -36,4 +36,10 @@ export type { HeroStatsProps, StatCardProps, SearchDropdownProps, + // 新增趋势和进度条类型 + TrendDirection, + TrendInfo, + ProgressBarConfig, + // 水印图标类型 + WatermarkIconConfig, } from './types'; diff --git a/src/components/HeroSection/types.ts b/src/components/HeroSection/types.ts index be5b45dd..61f04c1f 100644 --- a/src/components/HeroSection/types.ts +++ b/src/components/HeroSection/types.ts @@ -100,6 +100,49 @@ export interface HeroSearchConfig // ==================== 统计配置 ==================== +/** 趋势变化类型 */ +export type TrendDirection = 'up' | 'down' | 'flat'; + +/** 趋势信息配置 */ +export interface TrendInfo { + /** 变化方向 */ + direction: TrendDirection; + /** 变化百分比 */ + percent: number; + /** 自定义描述文字(如:放量、缩量) */ + label?: string; + /** 对比时间描述(如:较昨日、同比) */ + compareText?: string; +} + +/** 进度条配置(用于涨跌家数等多空对比场景) */ +export interface ProgressBarConfig { + /** 当前值 */ + value: number; + /** 总值(或对比的另一个值) */ + total: number; + /** 正向颜色(默认红色) */ + positiveColor?: string; + /** 负向颜色(默认绿色) */ + negativeColor?: string; + /** 对比项的标签 */ + compareLabel?: string; + /** 对比项的值 */ + compareValue?: number; +} + +/** 水印图标配置 */ +export interface WatermarkIconConfig { + /** 图标组件 */ + icon: LucideIcon | ComponentType<{ size?: number; color?: string }>; + /** 图标颜色 */ + color?: string; + /** 透明度(默认 0.08) */ + opacity?: number; + /** 图标大小(默认 48) */ + size?: number; +} + /** 统计项配置 */ export interface HeroStatItem { key: string; @@ -111,6 +154,12 @@ export interface HeroStatItem { suffix?: string; helpText?: string; isLoading?: boolean; + /** 趋势信息(显示环比/同比变化) */ + trend?: TrendInfo; + /** 进度条配置(显示多空对比) */ + progressBar?: ProgressBarConfig; + /** 水印背景图标配置 */ + watermark?: WatermarkIconConfig; } /** 统计区域配置 */