Skip to content

Commit ad2de6e

Browse files
✨ feat: Update antd
1 parent 1440683 commit ad2de6e

File tree

3 files changed

+46
-39
lines changed

3 files changed

+46
-39
lines changed

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
]
8888
},
8989
"dependencies": {
90+
"@ant-design/cssinjs": "^1.22.0",
9091
"@babel/runtime": "^7.26.0",
9192
"@dnd-kit/core": "^6.3.1",
9293
"@dnd-kit/modifiers": "^8.0.0",
@@ -96,19 +97,32 @@
9697
"@emoji-mart/react": "^1.1.1",
9798
"@floating-ui/react": "^0.26.28",
9899
"@giscus/react": "^3.1.0",
100+
"@lobehub/fluent-emoji": "^1.0.0",
99101
"@mdx-js/mdx": "^2.3.0",
100102
"@mdx-js/react": "^2.3.0",
101103
"@radix-ui/react-slot": "^1.1.1",
102104
"@shikijs/transformers": "^1.26.1",
105+
"@splinetool/runtime": "^0.9.0",
106+
"ahooks": "^3.8.0",
107+
"antd-style": "^3.7.0",
108+
"chroma-js": "^3.0.0",
109+
"class-variance-authority": "^0.7.0",
110+
"dayjs": "^1.11.0",
103111
"emoji-mart": "^5.6.0",
112+
"fast-deep-equal": "^3.0.0",
104113
"immer": "^10.1.1",
105114
"leva": "^0.9.35",
115+
"lodash-es": "^4.0.0",
116+
"lucide-react": "^0.469.0",
106117
"mermaid": "^11.4.1",
107118
"numeral": "^2.0.6",
119+
"polished": "^4.0.0",
120+
"query-string": "^9.0.0",
108121
"rc-footer": "^0.6.8",
109122
"re-resizable": "^6.10.3",
110123
"react-avatar-editor": "^13.0.2",
111124
"react-error-boundary": "^4.1.2",
125+
"react-layout-kit": "^1.0.0",
112126
"react-markdown": "^8.0.7",
113127
"react-merge-refs": "^2.1.1",
114128
"react-rnd": "^10.4.14",
@@ -118,10 +132,16 @@
118132
"remark-gfm": "^3.0.1",
119133
"remark-math": "^5.1.1",
120134
"shiki": "^1.26.1",
121-
"unified": "^10.1.2"
135+
"swr": "^2.3.0",
136+
"ts-md5": "^1.0.0",
137+
"unified": "^10.1.2",
138+
"url-join": "^5.0.0",
139+
"use-merge-value": "^1.2.0",
140+
"uuid": "^11.0.0"
122141
},
123142
"devDependencies": {
124143
"@ant-design/icons": "^5.5.2",
144+
"@babel/runtime": "^7.0.0",
125145
"@commitlint/cli": "^19.6.1",
126146
"@lobehub/lint": "^1.24.4",
127147
"@testing-library/react": "^14.3.1",
@@ -131,7 +151,7 @@
131151
"@types/numeral": "^2.0.5",
132152
"@types/pangu": "^4.0.2",
133153
"@types/query-string": "^6.3.0",
134-
"@types/react": "^19.0.2",
154+
"@types/react": "^19.0.3",
135155
"@types/react-avatar-editor": "^13.0.3",
136156
"@types/react-dom": "^19.0.2",
137157
"@types/unist": "^3.0.3",
@@ -161,29 +181,9 @@
161181
"vitest": "~1.2.2"
162182
},
163183
"peerDependencies": {
164-
"@ant-design/cssinjs": "^1.22.0",
165-
"@babel/runtime": "^7.0.0",
166-
"@lobehub/fluent-emoji": "^1.0.0",
167-
"@splinetool/runtime": "^0.9.0",
168-
"ahooks": "^3.8.0",
169-
"antd": "^5.22.0",
170-
"antd-style": "^3.7.0",
171-
"chroma-js": "^3.0.0",
172-
"class-variance-authority": "^0.7.0",
173-
"dayjs": "^1.11.0",
174-
"fast-deep-equal": "^3.0.0",
175-
"lodash-es": "^4.0.0",
176-
"lucide-react": "^0.469.0",
177-
"polished": "^4.0.0",
178-
"query-string": "^9.0.0",
184+
"antd": "^5.23.0",
179185
"react": "^18.0.0 || ^19.0.0",
180-
"react-dom": "^18.0.0 || ^19.0.0",
181-
"react-layout-kit": "^1.0.0",
182-
"swr": "^2.3.0",
183-
"ts-md5": "^1.0.0",
184-
"url-join": "^5.0.0",
185-
"use-merge-value": "^1.2.0",
186-
"uuid": "^11.0.0"
186+
"react-dom": "^18.0.0 || ^19.0.0"
187187
},
188188
"publishConfig": {
189189
"access": "public",

src/ActionIcon/index.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
'use client';
22

33
import { Loader2 } from 'lucide-react';
4-
import {
5-
type CSSProperties,
6-
MouseEventHandler,
7-
forwardRef,
8-
useCallback,
9-
useMemo,
10-
useState,
11-
} from 'react';
4+
import { MouseEventHandler, forwardRef, useCallback, useMemo, useState } from 'react';
125
import { Flexbox, type FlexboxProps } from 'react-layout-kit';
136

147
import Icon, {
@@ -43,6 +36,7 @@ export interface ActionIconProps extends LucideIconProps, FlexboxProps {
4336
* @default false
4437
*/
4538
arrow?: boolean;
39+
classNames?: TooltipProps['classNames'];
4640
disable?: boolean;
4741
/**
4842
* @description Glass blur style
@@ -54,7 +48,8 @@ export interface ActionIconProps extends LucideIconProps, FlexboxProps {
5448
* @description Set the loading status of ActionIcon
5549
*/
5650
loading?: boolean;
57-
overlayStyle?: CSSProperties;
51+
overlayClassName?: TooltipProps['overlayClassName'];
52+
overlayStyle?: TooltipProps['overlayStyle'];
5853
/**
5954
* @description The position of the tooltip relative to the target
6055
* @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
@@ -72,6 +67,7 @@ export interface ActionIconProps extends LucideIconProps, FlexboxProps {
7267
* @default false
7368
*/
7469
spotlight?: boolean;
70+
styles?: TooltipProps['styles'];
7571
/**
7672
* @description The text shown in the tooltip
7773
*/
@@ -101,18 +97,18 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
10197
onClick,
10298
children,
10399
loading,
104-
overlayStyle,
105100
tooltipDelay = 0.5,
106101
fillOpacity,
107102
fillRule,
108103
focusable,
109104
disable,
110105
spin: iconSpinning,
106+
styles,
111107
...rest
112108
},
113109
ref,
114110
) => {
115-
const { styles, cx } = useStyles({ active: Boolean(active), glass: Boolean(glass) });
111+
const { styles: s, cx } = useStyles({ active: Boolean(active), glass: Boolean(glass) });
116112
const { blockSize, borderRadius } = useMemo(() => calcSize(size), [size]);
117113

118114
const iconProps = {
@@ -125,7 +121,7 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
125121
};
126122

127123
const content = icon && (
128-
<Icon className={styles.icon} icon={icon} {...iconProps} spin={iconSpinning} />
124+
<Icon className={s.icon} icon={icon} {...iconProps} spin={iconSpinning} />
129125
);
130126

131127
const spin = <Icon icon={Loader2} {...iconProps} spin />;
@@ -144,7 +140,7 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
144140
const actionIconBlock = (
145141
<Flexbox
146142
align={'center'}
147-
className={cx(styles.block, disable ? styles.disabled : styles.normal, className)}
143+
className={cx(s.block, disable ? s.disabled : s.normal, className)}
148144
horizontal
149145
justify={'center'}
150146
onClick={handleClick}
@@ -166,8 +162,11 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
166162
mouseEnterDelay={tooltipDelay}
167163
onOpenChange={setTooltipOpen}
168164
open={tooltipOpen}
169-
overlayStyle={{ pointerEvents: 'none', ...overlayStyle }}
170165
placement={placement}
166+
styles={{
167+
...styles,
168+
root: { pointerEvents: 'none', ...styles?.root },
169+
}}
171170
title={title}
172171
>
173172
{actionIconBlock}

src/Tooltip/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ export type TooltipProps = AntdTooltipProps;
1010
const Tooltip = memo<TooltipProps>(({ className, arrow = false, ...rest }) => {
1111
const { styles, cx } = useStyles();
1212

13-
return <AntdTooltip arrow={arrow} overlayClassName={cx(styles.tooltip, className)} {...rest} />;
13+
return (
14+
<AntdTooltip
15+
arrow={arrow}
16+
classNames={{
17+
root: cx(styles.tooltip, className),
18+
}}
19+
{...rest}
20+
/>
21+
);
1422
});
1523

1624
export default Tooltip;

0 commit comments

Comments
 (0)