-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(design): Add Progress docs and demos
- Loading branch information
1 parent
ef16661
commit 85f065f
Showing
13 changed files
with
156 additions
and
4 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { Flex, Progress } from '@oceanbase/design'; | ||
|
||
const App: React.FC = () => ( | ||
<Flex align="center" gap="small"> | ||
<Progress | ||
type="circle" | ||
trailColor="#e6f4ff" | ||
percent={60} | ||
strokeWidth={20} | ||
size={14} | ||
format={number => `进行中,已完成${number}%`} | ||
/> | ||
<span>应用发布</span> | ||
</Flex> | ||
); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { Flex, Progress, theme } from '@oceanbase/design'; | ||
|
||
const App: React.FC = () => { | ||
const { token } = theme.useToken(); | ||
return ( | ||
<Flex wrap gap="middle" style={{ marginTop: 16 }}> | ||
<Progress | ||
type="dashboard" | ||
steps={8} | ||
percent={50} | ||
trailColor={token.colorFillSecondary} | ||
strokeWidth={20} | ||
/> | ||
<Progress | ||
type="circle" | ||
percent={100} | ||
trailColor={token.colorFillSecondary} | ||
steps={{ count: 5, gap: 7 }} | ||
strokeWidth={20} | ||
/> | ||
</Flex> | ||
); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { useState } from 'react'; | ||
import { Flex, Radio, Space, Progress } from '@oceanbase/design'; | ||
import type { ProgressSize } from '@oceanbase/design/es/progress'; | ||
|
||
const App: React.FC = () => { | ||
const [size, setSize] = useState<ProgressSize>('default'); | ||
return ( | ||
<> | ||
<Space style={{ marginBottom: 16 }}> | ||
Size: | ||
<Radio.Group | ||
value={size} | ||
onChange={e => { | ||
setSize(e.target.value); | ||
}} | ||
> | ||
<Radio value="default">default</Radio> | ||
<Radio value="small">small</Radio> | ||
</Radio.Group> | ||
</Space> | ||
<Flex gap="small"> | ||
<Progress size={size} type="circle" percent={75} /> | ||
<Progress size={size} type="circle" percent={70} status="exception" /> | ||
<Progress size={size} type="circle" percent={100} /> | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useState } from 'react'; | ||
import { Flex, Radio, Progress, Space } from '@oceanbase/design'; | ||
import type { ProgressSize } from '@oceanbase/design/es/progress'; | ||
|
||
const App: React.FC = () => { | ||
const [size, setSize] = useState<ProgressSize>('default'); | ||
return ( | ||
<> | ||
<Space style={{ marginBottom: 16 }}> | ||
Size: | ||
<Radio.Group | ||
value={size} | ||
onChange={e => { | ||
setSize(e.target.value); | ||
}} | ||
> | ||
<Radio value="default">default</Radio> | ||
<Radio value="small">small</Radio> | ||
</Radio.Group> | ||
</Space> | ||
<Flex gap="small" vertical> | ||
<Progress size={size} percent={30} /> | ||
<Progress size={size} percent={50} status="active" /> | ||
<Progress size={size} percent={70} status="exception" /> | ||
<Progress size={size} percent={100} /> | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { Flex, Progress, theme } from '@oceanbase/design'; | ||
|
||
const App: React.FC = () => { | ||
const { token } = theme.useToken(); | ||
return ( | ||
<Flex gap="small" vertical> | ||
<Progress percent={30} steps={3} /> | ||
<Progress percent={50} steps={5} /> | ||
<Progress percent={100} steps={5} size="small" strokeColor={token.colorSuccess} /> | ||
<Progress | ||
percent={60} | ||
steps={5} | ||
strokeColor={[token.colorSuccess, token.colorSuccess, token.colorError]} | ||
/> | ||
</Flex> | ||
); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Progress 进度条 | ||
nav: | ||
title: 基础组件 | ||
path: /components | ||
demo: | ||
cols: 2 | ||
--- | ||
|
||
- 🔥 完全继承 antd [Progress](https://ant.design/components/progress-cn) 的能力和 API,可无缝切换。 | ||
- 💄 定制主题和样式,符合 OceanBase Design 设计规范。 | ||
|
||
## 代码演示 | ||
|
||
<!-- prettier-ignore --> | ||
<code src="./demo/line.tsx" title="进度条"></code> | ||
<code src="./demo/circle.tsx" title="圆形进度条"></code> | ||
<code src="./demo/steps.tsx" title="步骤进度条"></code> | ||
<code src="./demo/circle-steps.tsx" title="圆形步骤进度条"></code> | ||
<code src="./demo/cicle-micro.tsx" title="圆形小型进度条" description="当圆形进度条 `width <= 20` 的时候,进度信息会以 Tooltip 的形式展示。"></code> | ||
|
||
## API | ||
|
||
- 详见 antd Progress 文档: https://ant.design/components/progress-cn |
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 +1,2 @@ | ||
export * from 'antd/es/progress/progress'; | ||
export * from 'antd/es/progress'; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'antd/es/progress/progress'; |
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