Skip to content

Commit 91db8b2

Browse files
committed
feat: use dtinsight/react-icons replace ant-design/icons
fix #562
1 parent f8f005d commit 91db8b2

File tree

19 files changed

+15256
-9404
lines changed

19 files changed

+15256
-9404
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,16 @@
103103
"react": "^18.0.0",
104104
"react-dom": "^18.0.0",
105105
"react-test-renderer": "^18.2.0",
106-
"standard-version": "^9.5.0",
107106
"resize-observer-polyfill": "^1.5.1",
107+
"standard-version": "^9.5.0",
108108
"stylelint": "^14.9.1",
109109
"ts-jest": "^29.0.3",
110110
"typescript": "~4.5.2"
111111
},
112112
"dependencies": {
113113
"@ant-design/icons": "^4.7.0",
114114
"@dtinsight/dt-utils": "^1.3.1",
115+
"@dtinsight/react-icons": "^1.0.0",
115116
"@handsontable/react": "2.1.0",
116117
"antd": "4.22.5",
117118
"classnames": "^2.2.6",

pnpm-lock.yaml

Lines changed: 15205 additions & 9372 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blockHeader/demos/addonBefore.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
2-
import { PauseCircleOutlined, PieChartOutlined } from '@ant-design/icons';
2+
import { PauseOutlined, PieChartFilled } from '@dtinsight/react-icons';
33
import { BlockHeader } from 'dt-react-component';
44

55
export default () => {
66
return (
77
<>
88
<BlockHeader title="分类标题" />
99
<BlockHeader title="分类标题" addonBefore={''} />
10-
<BlockHeader title="分类标题" addonBefore={<PieChartOutlined />} />
11-
<BlockHeader title="分类标题" addonBefore={<PauseCircleOutlined />} />
10+
<BlockHeader title="分类标题" addonBefore={<PieChartFilled />} />
11+
<BlockHeader title="分类标题" addonBefore={<PauseOutlined />} />
1212
</>
1313
);
1414
};

src/blockHeader/demos/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { PieChartOutlined } from '@ant-design/icons';
2+
import { PieChartOutlined } from '@dtinsight/react-icons';
33
import { Radio, Space, Switch } from 'antd';
44
import { BlockHeader } from 'dt-react-component';
55
import { SizeType } from 'dt-react-component/blockHeader';

src/blockHeader/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { ReactNode, useState } from 'react';
2-
import { QuestionCircleOutlined, UpOutlined } from '@ant-design/icons';
2+
import { QuestionOutlined, UpOutlined } from '@dtinsight/react-icons';
33
import { Tooltip } from 'antd';
44
import classNames from 'classnames';
55

@@ -115,7 +115,7 @@ const BlockHeader: React.FC<IBlockHeaderProps> = function (props) {
115115
{tooltipProps?.title ? (
116116
<div className={`title__tooltip`}>
117117
<Tooltip {...tooltipProps}>
118-
<QuestionCircleOutlined />
118+
<QuestionOutlined />
119119
</Tooltip>
120120
</div>
121121
) : null}

src/chat/demos/basic.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { LikeOutlined } from '@ant-design/icons';
2+
import { ThumbsUpOutlined } from '@dtinsight/react-icons';
33
import { Button } from 'antd';
44
import { Chat, Flex } from 'dt-react-component';
55

@@ -44,7 +44,7 @@ export default function () {
4444
codeBlock={{
4545
convert,
4646
}}
47-
messageIcons={() => <LikeOutlined className="dtc__message__icon" />}
47+
messageIcons={() => <ThumbsUpOutlined className="dtc__message__icon" />}
4848
components={{
4949
a: ({ children }) => (
5050
<Button

src/chat/demos/codeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* background: '#f6f7f9'
33
*/
44
import React from 'react';
5-
import { PlusCircleOutlined } from '@ant-design/icons';
5+
import { PlusCircleOutlined } from '@dtinsight/react-icons';
66
import { Chat } from 'dt-react-component';
77

88
const children = `

src/chat/pagination/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
2+
import { LeftOutlined, RightOutlined } from '@dtinsight/react-icons';
33

44
import './index.scss';
55

src/collapsibleActionItems/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default () => {
101101
import React, { useState } from 'react';
102102
import { CollapsibleActionItems } from 'dt-react-component';
103103
import { Table, message, Popconfirm } from 'antd';
104-
import { DownOutlined } from '@ant-design/icons';
104+
import { DownOutlined } from '@dtinsight/react-icons';
105105

106106
export default () => {
107107
const [dataSource, setDataSource] = useState([

src/collapsibleActionItems/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { ReactNode } from 'react';
2-
import { EllipsisOutlined } from '@ant-design/icons';
2+
import { EllipsisTableOutlined } from '@dtinsight/react-icons';
33
import { Button, ButtonProps, Divider, Dropdown, DropDownProps, Menu } from 'antd';
44
import classNames from 'classnames';
55

@@ -30,7 +30,7 @@ const CollapsibleActionItems: React.FC<ICollapsibleActionItems> = (props) => {
3030
maxCount = 3,
3131
className,
3232
divider = <Divider type="vertical" />,
33-
collapseIcon = <EllipsisOutlined />,
33+
collapseIcon = <EllipsisTableOutlined />,
3434
dropdownProps,
3535
buttonProps,
3636
style,

src/drawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { CSSProperties, useEffect, useState } from 'react';
2-
import { CloseOutlined } from '@ant-design/icons';
2+
import { CloseOutlined } from '@dtinsight/react-icons';
33
import { Alert, AlertProps, Spin, Tabs } from 'antd';
44
import classNames from 'classnames';
55
import { omit } from 'lodash-es';

src/filterRules/ruleController/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
2+
import { MinusCircleOutlined, PlusCircleOutlined } from '@dtinsight/react-icons';
33
import { InternalNamePath } from 'antd/lib/form/interface';
44
import classnames from 'classnames';
55

src/fullscreen/__tests__/index.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { ArrowsAltOutlined, ShrinkOutlined } from '@ant-design/icons';
2+
import { FullscreenExitOutlined, FullscreenOutlined } from '@dtinsight/react-icons';
33
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
44
import '@testing-library/jest-dom/extend-expect';
55

@@ -18,13 +18,13 @@ describe('test Fullscreen', () => {
1818
const customIcon = {
1919
fullIcon: (
2020
<>
21-
<ArrowsAltOutlined />
21+
<FullscreenOutlined />
2222
全屏
2323
</>
2424
),
2525
exitFullIcon: (
2626
<>
27-
<ShrinkOutlined />
27+
<FullscreenExitOutlined />
2828
退出全屏
2929
</>
3030
),

src/fullscreen/demos/custom.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { ArrowsAltOutlined, ShrinkOutlined } from '@ant-design/icons';
2+
import { FullscreenExitOutlined, FullscreenOutlined } from '@dtinsight/react-icons';
33
import { Fullscreen } from 'dt-react-component';
44

55
export default () => {
@@ -14,13 +14,13 @@ export default () => {
1414
iconStyle={iconStyle}
1515
fullIcon={
1616
<div style={{ cursor: 'pointer' }}>
17-
<ArrowsAltOutlined />
17+
<FullscreenOutlined />
1818
全屏
1919
</div>
2020
}
2121
exitFullIcon={
2222
<div style={{ cursor: 'pointer' }}>
23-
<ShrinkOutlined />
23+
<FullscreenExitOutlined />
2424
退出全屏
2525
</div>
2626
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '@dtinsight/react-icons/dist/index.css';
2+
13
export { default as BlockHeader } from './blockHeader';
24
export { default as Catalogue } from './catalogue';
35
export { default as Chat } from './chat';

src/statusTag/demos/icon.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import React from 'react';
2-
import { SketchOutlined } from '@ant-design/icons';
2+
import { TargetFilled } from '@dtinsight/react-icons';
33
import { Space } from 'antd';
44
import { StatusTag } from 'dt-react-component';
55

66
export default () => {
77
return (
88
<Space direction="vertical">
9-
<StatusTag color="green" type="outline" icon={<SketchOutlined />}>
9+
<StatusTag color="green" type="outline" icon={<TargetFilled />}>
1010
成功
1111
</StatusTag>
12-
<StatusTag color="blue" icon={<SketchOutlined />}>
12+
<StatusTag color="blue" icon={<TargetFilled />}>
1313
运行中
1414
</StatusTag>
15-
<StatusTag color="yellow" type="fill" icon={<SketchOutlined />}>
15+
<StatusTag color="yellow" type="fill" icon={<TargetFilled />}>
1616
运行中
1717
</StatusTag>
18-
<StatusTag color="#2f10fb" type="fill" icon={<SketchOutlined />}>
18+
<StatusTag color="#2f10fb" type="fill" icon={<TargetFilled />}>
1919
运行中
2020
</StatusTag>
2121
</Space>

src/statusTag/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2-
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
2+
import { SpinOutlined } from '@dtinsight/react-icons';
33
import { Spin } from 'antd';
44
import classNames from 'classnames';
55

@@ -107,7 +107,11 @@ const StatusTag: React.FC<IStatusTagProps> = function StatusTag(props) {
107107
{loading ? (
108108
<Spin
109109
spinning
110-
indicator={<LoadingOutlined className={`${prefixCls}__icon`} />}
110+
indicator={
111+
<SpinOutlined
112+
className={`${prefixCls}__icon ${prefixCls}__icon--loading`}
113+
/>
114+
}
111115
size="small"
112116
/>
113117
) : (

src/statusTag/style.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $colors: (
1313
bg: #E7FBF7,
1414
),
1515
"gray": (
16-
color: #B1B4C5,
16+
color: #B1B4C5,
1717
bg: #F5F5F8,
1818
),
1919
"red": (
@@ -34,6 +34,15 @@ $colors: (
3434
),
3535
);
3636

37+
@keyframes spin {
38+
from {
39+
transform: rotate(0deg);
40+
}
41+
to {
42+
transform: rotate(360deg);
43+
}
44+
}
45+
3746
.#{$card_prefix} {
3847
display: flex;
3948
align-items: center;
@@ -65,6 +74,9 @@ $colors: (
6574
height: 6px;
6675
border-radius: 50%;
6776
}
77+
&--loading {
78+
animation: spin 1s linear infinite;
79+
}
6880
}
6981
&__text {
7082
font-size: 12px;

src/table/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { forwardRef, useMemo } from 'react';
2-
import { QuestionCircleOutlined } from '@ant-design/icons';
2+
import { QuestionOutlined } from '@dtinsight/react-icons';
33
import { Table as InternalTable, Tooltip } from 'antd';
44
import type { LabelTooltipType, WrapperTooltipProps } from 'antd/lib/form/FormItemLabel';
55
import type { ColumnType as PrimitiveColumnType, TableProps } from 'antd/lib/table';
@@ -51,7 +51,7 @@ function convertColumns(columns?: ColumnType[]): PrimitiveColumnType<any>[] {
5151
const tooltipProps = toTooltipProps(tooltip);
5252
let tooltipNode: React.ReactNode | null = null;
5353
if (tooltipProps) {
54-
const { icon = <QuestionCircleOutlined />, ...restTooltipProps } = tooltipProps;
54+
const { icon = <QuestionOutlined />, ...restTooltipProps } = tooltipProps;
5555
tooltipNode = (
5656
<Tooltip {...restTooltipProps}>
5757
{React.cloneElement(icon, {

0 commit comments

Comments
 (0)