zpd-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +732 -0
  3. package/dist/components/AudioEffect/index.d.ts +44 -0
  4. package/dist/components/Barrage/index.d.ts +77 -0
  5. package/dist/components/CountDown/CountDown.d.ts +100 -0
  6. package/dist/components/CountDown/CountDownNumbers.d.ts +21 -0
  7. package/dist/components/List/List.d.ts +36 -0
  8. package/dist/components/List/components/Infinite/index.d.ts +18 -0
  9. package/dist/components/List/components/error/index.d.ts +6 -0
  10. package/dist/components/List/components/load-more/index.d.ts +3 -0
  11. package/dist/components/List/components/loading/index.d.ts +3 -0
  12. package/dist/components/List/components/no-data/index.d.ts +3 -0
  13. package/dist/components/List/index.d.ts +77 -0
  14. package/dist/components/MusicPlayer/index.d.ts +23 -0
  15. package/dist/components/NavBar/index.d.ts +60 -0
  16. package/dist/components/NoticeBar/NoticeBar.d.ts +46 -0
  17. package/dist/components/NoticeBar/index.d.ts +23 -0
  18. package/dist/components/Process/index.d.ts +58 -0
  19. package/dist/components/RankList/RankList.d.ts +22 -0
  20. package/dist/components/RankList/index.d.ts +54 -0
  21. package/dist/components/ShadowText/index.d.ts +41 -0
  22. package/dist/components/StrokeText/StrokeText.d.ts +10 -0
  23. package/dist/components/StrokeText/index.d.ts +31 -0
  24. package/dist/components/TabList/index.d.ts +64 -0
  25. package/dist/components/Tabs/index.d.ts +66 -0
  26. package/dist/components/Tabs/story/stories.d.ts +1 -0
  27. package/dist/components/VapPlayer/index.d.ts +43 -0
  28. package/dist/components/index.d.ts +14 -0
  29. package/dist/constants/index.d.ts +4 -0
  30. package/dist/hooks/index.d.ts +8 -0
  31. package/dist/hooks/useAudio.d.ts +93 -0
  32. package/dist/hooks/useBoolean.d.ts +11 -0
  33. package/dist/hooks/useHashLocation.d.ts +2 -0
  34. package/dist/hooks/useLatest.d.ts +6 -0
  35. package/dist/hooks/useThrottle.d.ts +61 -0
  36. package/dist/hooks/useVap.d.ts +72 -0
  37. package/dist/index.d.ts +5 -0
  38. package/dist/types/common.d.ts +13 -0
  39. package/dist/types/global.d.ts +18 -0
  40. package/dist/types/video-animation-player.d.ts +22 -0
  41. package/dist/utils/audioManager.d.ts +63 -0
  42. package/dist/utils/formate.d.ts +39 -0
  43. package/dist/utils/index.d.ts +11 -0
  44. package/dist/utils/px.d.ts +2 -0
  45. package/dist/with-styles.d.ts +8 -0
  46. package/dist/zpd-ui.cjs.js +1 -0
  47. package/dist/zpd-ui.css +2 -0
  48. package/dist/zpd-ui.es.js +14 -0
  49. package/package.json +104 -0
@@ -0,0 +1,44 @@
1
+ import { type FC } from 'react';
2
+ export interface AudioEffectProps {
3
+ /** 音频文件路径 */
4
+ audioUrl: string;
5
+ /** 音量 (0-1),默认 1 */
6
+ volume?: number;
7
+ /** 是否自动播放,默认 true */
8
+ autoPlay?: boolean;
9
+ /** 播放完成回调 */
10
+ onEnded?: () => void;
11
+ /** 播放失败回调 */
12
+ onError?: (error: Error) => void;
13
+ /** 播放开始回调 */
14
+ onPlay?: () => void;
15
+ }
16
+ /**
17
+ * 音效组件
18
+ * - 无 UI,纯逻辑
19
+ * - 基于 AudioManager 实现
20
+ * - 适用于状态音效、提示音等短音频
21
+ * - 支持快速切换和并发播放
22
+ */
23
+ declare const AudioEffect: FC<AudioEffectProps>;
24
+ export default AudioEffect;
25
+ /**
26
+ * 使用示例
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * // 场景1: 根据状态播放不同音效
31
+ * <AudioEffect
32
+ * audioUrl={status === 'success' ? '/sounds/success.mp3' : '/sounds/error.mp3'}
33
+ * volume={0.8}
34
+ * onEnded={() => console.log('播放完成')}
35
+ * />
36
+ *
37
+ * // 场景2: 手动控制播放
38
+ * <AudioEffect
39
+ * audioUrl="/sounds/notification.mp3"
40
+ * autoPlay={false}
41
+ * onPlay={() => console.log('开始播放')}
42
+ * />
43
+ * ```
44
+ */
@@ -0,0 +1,77 @@
1
+ import type { CSSProperties } from 'react';
2
+ import React from 'react';
3
+ import './index.scss';
4
+ export interface BarrageBullet {
5
+ text: string;
6
+ userInfo?: any;
7
+ id?: string;
8
+ line?: number;
9
+ }
10
+ export interface BarrageProps {
11
+ list: BarrageBullet[];
12
+ intervalTime?: number;
13
+ className?: string;
14
+ tabClassName?: string;
15
+ tabClassNameStyle?: CSSProperties;
16
+ renderItem: (item: BarrageBullet, index?: number) => React.ReactNode;
17
+ lines?: number;
18
+ lineHeight?: number;
19
+ }
20
+ export interface BarrageRef {
21
+ showNextBullet: () => void;
22
+ }
23
+ /**
24
+ * 弹幕组件
25
+ * 支持多行弹幕、自定义间隔时间、自定义渲染等功能
26
+ *
27
+ * @example
28
+ * // 基础用法 - 双行弹幕
29
+ * <Barrage
30
+ * list={barrageList}
31
+ * intervalTime={1300}
32
+ * lines={2}
33
+ * lineHeight={25}
34
+ * className="h-200"
35
+ * renderItem={(item) => (
36
+ * <span>{item.text}</span>
37
+ * )}
38
+ * />
39
+ *
40
+ * @example
41
+ * // 自定义样式和内容
42
+ * <Barrage
43
+ * list={messages}
44
+ * intervalTime={1500}
45
+ * lines={3}
46
+ * lineHeight={40}
47
+ * className="h-300 w-full"
48
+ * tabClassName="px-16 py-8 bg-black/50 backdrop-blur-sm rounded-20"
49
+ * tabClassNameStyle={{ fontSize: '28px' }}
50
+ * renderItem={(item) => (
51
+ * <div className="flex items-center gap-10">
52
+ * <img src={item.userInfo?.avatar} className="w-32 h-32 rounded-full" />
53
+ * <span className="text-white">{item.text}</span>
54
+ * </div>
55
+ * )}
56
+ * />
57
+ *
58
+ * @example
59
+ * // 使用 ref 手动控制弹幕
60
+ * const barrageRef = useRef<BarrageRef>(null)
61
+ *
62
+ * <Barrage
63
+ * ref={barrageRef}
64
+ * list={comments}
65
+ * intervalTime={2000}
66
+ * lines={2}
67
+ * lineHeight={30}
68
+ * className="h-150"
69
+ * renderItem={(item) => <span>{item.text}</span>}
70
+ * />
71
+ *
72
+ * <button onClick={() => barrageRef.current?.showNextBullet()}>
73
+ * 发送下一条弹幕
74
+ * </button>
75
+ */
76
+ declare const Barrage: React.ForwardRefExoticComponent<BarrageProps & React.RefAttributes<BarrageRef>>;
77
+ export default Barrage;
@@ -0,0 +1,100 @@
1
+ import { type FC } from 'react';
2
+ type ICountDownProps = {
3
+ /**
4
+ * 目标时间戳(毫秒)
5
+ * 支持: number, string, null, undefined
6
+ * 异常值会自动处理为00:00:00显示
7
+ */
8
+ targetTime: number | string | null | undefined;
9
+ /**
10
+ * 服务器当前时间戳(毫秒)
11
+ * 如果传入此参数,将使用服务器时间作为当前时间进行倒计时计算
12
+ * 用于修正本地时间偏差,防止用户修改本地时间导致倒计时不准确
13
+ * 如果不传入,则使用本地时间
14
+ */
15
+ serverTime?: number;
16
+ /**
17
+ * 格式化字符串
18
+ * dd: 天数(01-99), d: 天数(1-99)
19
+ * HH: 小时(00-23), H: 小时(0-23)
20
+ * mm: 分钟(00-59), m: 分钟(0-59)
21
+ * ss: 秒(00-59), s: 秒(0-59)
22
+ * [text]: 方括号内的文本会被原样显示,不会被解析
23
+ * 'text': 单引号内的文本会被原样显示,不会被解析
24
+ * 示例: "dd:HH:mm:ss" -> "01:03:25:30"
25
+ * 示例: "dd [days] HH:mm:ss" -> "01 days 03:25:30"
26
+ * 示例: "dd 'days' HH:mm:ss" -> "01 days 03:25:30"
27
+ */
28
+ format?: string;
29
+ /**
30
+ * 卡片样式
31
+ */
32
+ className?: string;
33
+ /**
34
+ * 倒计时结束的回调函数
35
+ */
36
+ refreshData?: () => void;
37
+ /**
38
+ * 倒计时结束的回调函数
39
+ */
40
+ onEnd?: () => void;
41
+ /**
42
+ * 卡片样式
43
+ */
44
+ backgroundClassName?: string;
45
+ /**
46
+ * 文本部分的样式(包括分隔符如冒号、空格等)
47
+ * 示例: format="dd:HH:mm:ss" 中的 ":" 会应用此样式
48
+ */
49
+ partClassName?: string;
50
+ /**
51
+ * 转义文本的样式(仅用于 [text] 或 'text' 格式的文本)
52
+ * 示例: format="dd [days] HH:mm:ss" 中的 "days" 会应用此样式,而空格和冒号不会
53
+ */
54
+ escapedTextClassName?: string;
55
+ };
56
+ /**
57
+ * 倒计时组件
58
+ * 使用 dayjs 进行时间计算,提供更精确和可读的时间处理,结束后会触发回调函数
59
+ *
60
+ * @example
61
+ * // 基础用法 - 简单的时分秒倒计时
62
+ * <CountDown
63
+ * targetTime={Date.now() + 3600000}
64
+ * format="HH:mm:ss"
65
+ * onEnd={() => console.log('倒计时结束')}
66
+ * />
67
+ *
68
+ * @example
69
+ * // 带天数的倒计时
70
+ * <CountDown
71
+ * targetTime={newer_end_ts * 1000}
72
+ * format="dd'天'HH:mm:ss"
73
+ * className="text-32 font-bold"
74
+ * backgroundClassName="w-50 h-60 bg-black/50 rounded-8"
75
+ * refreshData={() => handleCountDownEnd()}
76
+ * />
77
+ *
78
+ * @example
79
+ * // 服务器时间修正 - 防止用户修改本地时间
80
+ * <CountDown
81
+ * targetTime={endTime * 1000}
82
+ * serverTime={serverCurrentTime * 1000}
83
+ * format="dd [Days] HH:mm:ss"
84
+ * onEnd={() => refreshActivityData()}
85
+ * />
86
+ *
87
+ * @example
88
+ * // 自定义样式 - 分隔符和转义文本样式
89
+ * <CountDown
90
+ * targetTime={targetTimestamp}
91
+ * format="dd'天'HH:mm:ss"
92
+ * className="flex gap-10"
93
+ * backgroundClassName="w-60 h-60 bg-gradient-to-b from-#FFD700 to-#FFA500 rounded-12"
94
+ * partClassName="text-white text-24"
95
+ * escapedTextClassName="text-yellow-400 text-28 font-bold"
96
+ * onEnd={() => console.log('活动结束')}
97
+ * />
98
+ */
99
+ declare const CountDown: FC<ICountDownProps>;
100
+ export default CountDown;
@@ -0,0 +1,21 @@
1
+ import { type FC } from 'react';
2
+ type ICountDownNumberProps = {
3
+ /**
4
+ * 卡片背景
5
+ */
6
+ background?: string;
7
+ /**
8
+ * 卡片宽度
9
+ */
10
+ width?: number;
11
+ /**
12
+ * 卡片高度
13
+ */
14
+ height?: number;
15
+ /**
16
+ * 时间数字
17
+ */
18
+ time: number;
19
+ };
20
+ declare const CountDownNumbers: FC<ICountDownNumberProps>;
21
+ export default CountDownNumbers;
@@ -0,0 +1,36 @@
1
+ import './index.scss';
2
+ interface ApiResponse {
3
+ data: {
4
+ has_next?: boolean;
5
+ [key: string]: unknown;
6
+ };
7
+ }
8
+ interface ListProps<T = unknown> {
9
+ url: string;
10
+ params?: Record<string, unknown>;
11
+ method?: 'GET' | 'POST';
12
+ pageSize?: number;
13
+ dataKey?: string;
14
+ className?: string;
15
+ height?: number;
16
+ finishRender?: () => React.ReactNode;
17
+ renderItem: (item: T, index: number) => React.ReactNode;
18
+ onDataLoaded?: (data: unknown, list: T[], myRank: T) => void;
19
+ noDataRender?: () => React.ReactNode;
20
+ cursorKey?: string;
21
+ hasNextKey?: string;
22
+ myRankKey?: string;
23
+ children?: React.ReactNode;
24
+ request?: (options: any) => Promise<ApiResponse>;
25
+ enablePadding?: boolean;
26
+ paddingThreshold?: number;
27
+ paddingPlaceholder?: T;
28
+ }
29
+ interface ListRef<T = unknown> {
30
+ refresh: () => void;
31
+ clear: () => void;
32
+ getList: () => T[];
33
+ }
34
+ declare const List: import("react").ForwardRefExoticComponent<ListProps<unknown> & import("react").RefAttributes<ListRef<unknown>>>;
35
+ export default List;
36
+ export type { ListProps, ListRef };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface InfiniteContainerProps {
3
+ height?: number;
4
+ handleMore?: () => void;
5
+ hasMore?: boolean;
6
+ children?: React.ReactNode;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ }
10
+ /**
11
+ * 无限滚动容器
12
+ * @param param0 height 容器高度,只能是固定的数字,默认 400
13
+ * @param param1 handleMore 加载更多的回调函数,返回一个 Promise,可以控制 loading 的状态
14
+ * @param param2 hasMore 是否结束了
15
+ * @returns
16
+ */
17
+ declare const InfiniteContainer: React.FC<InfiniteContainerProps>;
18
+ export default InfiniteContainer;
@@ -0,0 +1,6 @@
1
+ import { type FC } from "react";
2
+ interface ErrorProps {
3
+ onRetry: () => void;
4
+ }
5
+ declare const Error: FC<ErrorProps>;
6
+ export default Error;
@@ -0,0 +1,3 @@
1
+ import { type FC } from "react";
2
+ declare const LoadMore: FC;
3
+ export default LoadMore;
@@ -0,0 +1,3 @@
1
+ import { type FC } from "react";
2
+ declare const Loading: FC;
3
+ export default Loading;
@@ -0,0 +1,3 @@
1
+ import { type FC } from "react";
2
+ declare const NoData: FC;
3
+ export default NoData;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 列表组件
3
+ * 支持分页加载、自动加载更多、游标分页、数据填充等功能
4
+ *
5
+ * @example
6
+ * // 基础用法 - 页码分页
7
+ * <List
8
+ * url="/api/users"
9
+ * dataKey="items"
10
+ * params={{ status: 'active' }}
11
+ * request={request}
12
+ * pageSize={10}
13
+ * renderItem={(item, index) => (
14
+ * <div className="user-item">{item.name}</div>
15
+ * )}
16
+ * onDataLoaded={(data, list) => {
17
+ * console.log('数据加载完成', list.length)
18
+ * }}
19
+ * />
20
+ *
21
+ * @example
22
+ * // 使用 ref 控制和自定义完成提示
23
+ * const listRef = useRef<ListRef>(null)
24
+ *
25
+ * <List
26
+ * ref={listRef}
27
+ * url="/api/products"
28
+ * dataKey="products"
29
+ * request={request}
30
+ * renderItem={(item, index) => <ProductCard data={item} />}
31
+ * finishRender={() => <div className="text-center">没有更多了</div>}
32
+ * noDataRender={() => <div className="empty">暂无数据</div>}
33
+ * />
34
+ *
35
+ * <button onClick={() => listRef.current?.refresh()}>刷新</button>
36
+ *
37
+ * @example
38
+ * // 游标分页 - 高性能场景
39
+ * <List
40
+ * url="/api/messages"
41
+ * dataKey="messages"
42
+ * request={request}
43
+ * cursorKey="last_id"
44
+ * pageSize={20}
45
+ * renderItem={(item, index) => <MessageItem data={item} />}
46
+ * />
47
+ *
48
+ * @example
49
+ * // 数据填充功能 - 不足指定数量时自动填充占位数据
50
+ * <List
51
+ * url="/api/ranks"
52
+ * dataKey="ranks"
53
+ * request={request}
54
+ * pageSize={10}
55
+ * enablePadding={true}
56
+ * paddingThreshold={10}
57
+ * paddingPlaceholder={{ name: '虚位以待', score: 0 }}
58
+ * renderItem={(item, index) => (
59
+ * <div className="rank-item">
60
+ * #{index + 1} {item.name} - {item.score}
61
+ * </div>
62
+ * )}
63
+ * />
64
+ *
65
+ * @example
66
+ * // POST 请求
67
+ * <List
68
+ * url="/api/search"
69
+ * method="POST"
70
+ * params={{ keyword: 'react', filter: 'latest' }}
71
+ * dataKey="results"
72
+ * request={request}
73
+ * renderItem={(item, index) => <SearchResult data={item} />}
74
+ * />
75
+ */
76
+ export { default as List } from './List';
77
+ export type { ListProps, ListRef } from './List';
@@ -0,0 +1,23 @@
1
+ import { type FC } from 'react';
2
+ export interface MusicPlayerProps {
3
+ /** 音乐文件 URL */
4
+ musicUrl: string;
5
+ /** 播放状态的图标 className */
6
+ playIconClass: string;
7
+ /** 暂停状态的图标 className */
8
+ pauseIconClass: string;
9
+ /** 额外的容器 className */
10
+ className?: string;
11
+ /** 是否循环播放,默认 true */
12
+ loop?: boolean;
13
+ /** 是否自动播放,默认 true */
14
+ autoPlay?: boolean;
15
+ /** 动画类名,默认 animate-spin-slow */
16
+ animationClassName?: string;
17
+ }
18
+ /**
19
+ * 音乐播放器组件
20
+ * 支持自动播放(三层策略:直接播放 -> 静音播放 -> 等待用户交互)
21
+ */
22
+ declare const MusicPlayer: FC<MusicPlayerProps>;
23
+ export default MusicPlayer;
@@ -0,0 +1,60 @@
1
+ import { type FC } from 'react';
2
+ /**
3
+ * 导航栏组件
4
+ * 支持标题、左右图标、滚动变色等功能
5
+ *
6
+ * @example
7
+ * // 基础用法 - 返回按钮和标题
8
+ * <NavBar
9
+ * title="页面标题"
10
+ * leftIcon="i-custom-back"
11
+ * type="back"
12
+ * onLeftClick={() => console.log('返回')}
13
+ * />
14
+ *
15
+ * @example
16
+ * // 带右侧按钮
17
+ * <NavBar
18
+ * title="设置"
19
+ * leftIcon="i-custom-close"
20
+ * rightIcon="i-custom-more"
21
+ * type="close"
22
+ * onLeftClick={() => console.log('关闭')}
23
+ * onRightClick={() => console.log('更多操作')}
24
+ * />
25
+ *
26
+ * @example
27
+ * // 滚动变色效果
28
+ * <NavBar
29
+ * title="动态导航栏"
30
+ * leftIcon="i-custom-back"
31
+ * enableScrollBg={true}
32
+ * scrollBgClassName="bg-gradient-to-b from-#000/80 to-#000/60 backdrop-blur-md"
33
+ * />
34
+ *
35
+ * @example
36
+ * // 自定义内容
37
+ * <NavBar
38
+ * leftIcon="i-custom-back"
39
+ * rightIcon="i-custom-share"
40
+ * onRightClick={() => handleShare()}
41
+ * >
42
+ * <div className="flex-1 text-center">
43
+ * <span className="text-28">自定义标题区域</span>
44
+ * </div>
45
+ * </NavBar>
46
+ */
47
+ export interface NavbarProps {
48
+ title?: string;
49
+ leftIcon?: string;
50
+ rightIcon?: string;
51
+ onRightClick?: () => void;
52
+ onLeftClick?: () => void;
53
+ type?: 'back' | 'close';
54
+ className?: string;
55
+ children?: React.ReactNode;
56
+ enableScrollBg?: boolean;
57
+ scrollBgClassName?: string;
58
+ }
59
+ declare const Navbar: FC<NavbarProps>;
60
+ export default Navbar;
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ export interface NoticeBarProps {
4
+ /**
5
+ * 自定义类名
6
+ */
7
+ className?: string;
8
+ /**
9
+ * 自定义样式
10
+ */
11
+ style?: React.CSSProperties;
12
+ /**
13
+ * 子元素内容(优先使用)
14
+ */
15
+ children?: React.ReactNode;
16
+ /**
17
+ * 文本数组(当没有 children 时使用)
18
+ */
19
+ text?: string[] | string;
20
+ /**
21
+ * 文本内容的类名(仅在使用 text 参数时有效)
22
+ */
23
+ textClassName?: string;
24
+ /**
25
+ * 滚动速度(像素/秒),优先级高于 speed
26
+ * @default 80
27
+ */
28
+ pixelsPerSecond?: number;
29
+ /**
30
+ * 动画持续时间(单位:秒),当不使用 pixelsPerSecond 时生效
31
+ * @default 8
32
+ */
33
+ speed?: number;
34
+ /**
35
+ * 是否悬停暂停
36
+ * @default false
37
+ */
38
+ pauseOnHover?: boolean;
39
+ /**
40
+ * 两段滚动内容之间的间距(UnoCSS 类名,如 w-100、w-[50px] 等)
41
+ * 如果不设置,将自动使用隐藏节点方式创建间隔
42
+ */
43
+ gap?: string;
44
+ }
45
+ declare const NoticeBar: React.FC<NoticeBarProps>;
46
+ export default NoticeBar;
@@ -0,0 +1,23 @@
1
+ import type { NoticeBarProps } from './NoticeBar';
2
+ import NoticeBar from './NoticeBar';
3
+ export { NoticeBar };
4
+ export type { NoticeBarProps };
5
+ /**
6
+ * 容器宽度由外层容器决定 使用时需外部套一个div
7
+ * <div className="w-150">
8
+ * <NoticeBar
9
+ * key={item?.name}
10
+ * gap={'w-150'}
11
+ * text={item?.name}
12
+ * textClassName="text-nowrap text-24 text-#E3E3E4 font-bold"
13
+ * />
14
+ * </div>
15
+ *
16
+ * <div className="w-100">
17
+ * <NoticeBar gap={'w-100'}>
18
+ * <span className="text-nowrap text-28 text-#141C2F font-bold">
19
+ * {userInfo?.nickname || ''}
20
+ * </span>
21
+ * </NoticeBar>
22
+ * </div>
23
+ */
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ export type ProgressProps = {
3
+ value: number;
4
+ showPercent?: boolean;
5
+ onChange?: (value: number) => void;
6
+ disabled?: boolean;
7
+ draggable?: boolean;
8
+ innerClassName?: string;
9
+ innerImageClassName?: string;
10
+ outerImageClassName?: string;
11
+ pointClassName?: string;
12
+ pointOffsetPercent?: number;
13
+ maxCount?: number;
14
+ decreaseButtonClassName?: string;
15
+ increaseButtonClassName?: string;
16
+ onDecrease?: () => void;
17
+ onIncrease?: () => void;
18
+ buttonSpacing?: string;
19
+ step?: number;
20
+ minValue?: number;
21
+ } & Common.DefaultProps;
22
+ declare const Progress: React.FC<ProgressProps>;
23
+ export default Progress;
24
+ /**
25
+ * 支持触摸和鼠标拖拽
26
+ * <Progress
27
+ * value={count} //当前数值
28
+ * maxCount={maxExchangeCount} //最大数量
29
+ * innerImageClassName={BackgroundImages.shop_inner_bg_png} //内层进度条背景图片类名
30
+ * outerImageClassName={BackgroundImages.shop_process_out_bg_png} //外层轨道背景图片类名
31
+ * pointClassName={BackgroundImages.shop_point_png} //进度条末端的指示点 没有就不写
32
+ * decreaseButtonClassName={BackgroundImages.shop_reduce_png} //减少按钮的类名
33
+ * increaseButtonClassName={BackgroundImages.shop_add_png} //增加按钮的类名
34
+ * step={1} //步长,默认 1
35
+ * onChange={setCount} //改变回调
36
+ * />
37
+ *
38
+ * 静态普通的进度条
39
+ *
40
+ * <ProcessTouch
41
+ * value={currentLevelInfo?.cumulative_points || 0} //当前数值
42
+ * maxCount={currentLevelInfo?.level_up_points} //最大数量
43
+ * innerImageClassName={clsx(
44
+ * 'rounded-20 bg-[linear-gradient(270deg,#FF499E_0%,#FFA271_100%)] h-40 shadow-[inset_0px_6px_9px_0px_rgba(255,255,255,0.25)]'
45
+ * )} //内层进度条背景图片类名
46
+ * outerImageClassName={clsx('rounded-20 w-500 h-40 bg-[rgba(0,0,0,0.5)] text-#fff')} //外层轨道背景图片类名
47
+ * draggable={false}
48
+ * step={1}
49
+ * // onChange={setCount}
50
+ * showPercent={false}
51
+ * >
52
+ * <div className="absolute left-50% top-50% text-28 text-#fff font-500 -translate-x-50% -translate-y-50%">
53
+ * <span>{currentLevelInfo?.cumulative_points || 0}</span>
54
+ * <span className="mx-4">/</span>
55
+ * <span className="text-#C0C0C1">{currentLevelInfo?.level_up_points}</span>
56
+ * </div>
57
+ * </ProcessTouch>
58
+ */
@@ -0,0 +1,22 @@
1
+ import { type CSSProperties } from 'react';
2
+ import { type ListProps } from '../List';
3
+ interface RankListProps<T = unknown> extends Omit<ListProps<T>, 'renderItem' | 'className'> {
4
+ topRender?: (topList: T[]) => React.ReactNode;
5
+ topCount?: number;
6
+ renderItem: (item: T, index: number) => React.ReactNode;
7
+ className?: string;
8
+ listClassName?: string;
9
+ listStyle?: CSSProperties;
10
+ classNameStyle?: CSSProperties;
11
+ myRankRender?: (myRank: T) => React.ReactNode;
12
+ }
13
+ interface RankListRef<T = unknown> {
14
+ refresh: () => void;
15
+ clear: () => void;
16
+ getList: () => T[];
17
+ getRestList: () => T[];
18
+ getTopList: () => T[];
19
+ }
20
+ declare const RankList: import("react").ForwardRefExoticComponent<RankListProps<unknown> & import("react").RefAttributes<RankListRef<unknown>>>;
21
+ export default RankList;
22
+ export type { RankListProps, RankListRef };