forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Progress.Circle support conic (ant-design#44404)
* feat: support conic * test: update snapshot * docs: update doc * chore: clean up * docs: update doc * test: update snapshot * test: update snapshot * test: update snapshot
- Loading branch information
Showing
11 changed files
with
1,592 additions
and
913 deletions.
There are no files selected for viewing
1,044 changes: 689 additions & 355 deletions
1,044
components/progress/__tests__/__snapshots__/demo-extend.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
1,040 changes: 687 additions & 353 deletions
1,040
components/progress/__tests__/__snapshots__/demo.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
140 changes: 70 additions & 70 deletions
140
components/progress/__tests__/__snapshots__/index.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## zh-CN | ||
|
||
`linear-gradient` 的封装。推荐只传两种颜色。 | ||
渐变色封装,`circle` 与 `dashboard` 设置渐变时 `strokeLinecap` 会被忽略。 | ||
|
||
## en-US | ||
|
||
A package of `linear-gradient`. It is recommended to only pass two colors. | ||
Gradient encapsulation, `circle` and `dashboard` will ignore `strokeLinecap` when setting gradient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import React from 'react'; | ||
import { Progress, Space } from 'antd'; | ||
|
||
const twoColors = { '0%': '#108ee9', '100%': '#87d068' }; | ||
const conicColors = { '0%': '#87d068', '50%': '#ffe58f', '100%': '#ffccc7' }; | ||
|
||
const App: React.FC = () => ( | ||
<> | ||
<Progress percent={99.9} strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }} /> | ||
<div style={{ display: 'flex', flexDirection: 'column', rowGap: 16 }}> | ||
<Progress percent={99.9} strokeColor={twoColors} /> | ||
<Progress percent={99.9} status="active" strokeColor={{ from: '#108ee9', to: '#87d068' }} /> | ||
<Space wrap> | ||
<Progress type="circle" percent={90} strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }} /> | ||
<Progress type="circle" percent={100} strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }} /> | ||
<Progress type="circle" percent={90} strokeColor={twoColors} /> | ||
<Progress type="circle" percent={100} strokeColor={twoColors} /> | ||
<Progress type="circle" percent={93} strokeColor={conicColors} /> | ||
</Space> | ||
<Space wrap> | ||
<Progress type="dashboard" percent={90} strokeColor={twoColors} /> | ||
<Progress type="dashboard" percent={100} strokeColor={twoColors} /> | ||
<Progress type="dashboard" percent={93} strokeColor={conicColors} /> | ||
</Space> | ||
</> | ||
</div> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 60 additions & 60 deletions
120
components/steps/__tests__/__snapshots__/demo-extend.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.