Skip to content

Commit

Permalink
Merge pull request #144 from oceanbase/dengfuping-design-theme
Browse files Browse the repository at this point in the history
chore: Format code by prettier
  • Loading branch information
dengfuping authored Sep 24, 2023
2 parents 330bee5 + 370b972 commit 5b199c1
Show file tree
Hide file tree
Showing 47 changed files with 2,787 additions and 744 deletions.
5 changes: 4 additions & 1 deletion .dumi/theme/builtins/ComponentOverview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const useStyle = () => {
cursor: pointer;
transition: all 0.5s;
&:hover {
box-shadow: 0 6px 16px -8px #00000014, 0 9px 28px #0000000d, 0 12px 48px 16px #00000008;
box-shadow:
0 6px 16px -8px #00000014,
0 9px 28px #0000000d,
0 12px 48px 16px #00000008;
}
`,
componentsOverviewAffix: css`
Expand Down
39 changes: 21 additions & 18 deletions .dumi/theme/builtins/DemoWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,29 @@ const DemoWrapper: typeof DumiDemoGrid = ({ items }) => {

const demos = React.useMemo(
() =>
items.reduce((acc, item) => {
const { previewerProps } = item;
const { debug } = previewerProps;
items.reduce(
(acc, item) => {
const { previewerProps } = item;
const { debug } = previewerProps;

if (debug && !showDebug) return acc;
if (debug && !showDebug) return acc;

return acc.concat({
...item,
previewerProps: {
...previewerProps,
expand: expandAll,
// always override debug property, because dumi will hide debug demo in production
debug: false,
/**
* extra marker for the original debug
*/
originDebug: debug,
},
});
}, [] as typeof items),
return acc.concat({
...item,
previewerProps: {
...previewerProps,
expand: expandAll,
// always override debug property, because dumi will hide debug demo in production
debug: false,
/**
* extra marker for the original debug
*/
originDebug: debug,
},
});
},
[] as typeof items
),
[expandAll, showDebug]
);

Expand Down
4 changes: 3 additions & 1 deletion .dumi/theme/common/styles/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default () => {
background-color: inherit;
border-radius: 4px;
cursor: pointer;
transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out;
transition:
color 0.3s ease-in-out,
background-color 0.3s ease-in-out;
.rtl & {
margin: 3px 0;
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/common/styles/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const GlobalStyle: React.FC = () => {
max-width: unset;
}
}
td {
&:nth-child(3) {
color: ${token.magenta7};
Expand Down
4 changes: 3 additions & 1 deletion .dumi/theme/common/styles/NProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default () => {
}
.peg {
box-shadow: 0 0 10px ${token.colorPrimary}, 0 0 5px ${token.colorPrimary};
box-shadow:
0 0 10px ${token.colorPrimary},
0 0 5px ${token.colorPrimary};
}
.spinner-icon {
Expand Down
8 changes: 6 additions & 2 deletions .dumi/theme/common/styles/PreviewImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ export default () => {
.preview-image-boxes.preview-image-boxes-with-carousel img {
padding: 0;
box-shadow: 0 1px 0 0 #ddd, 0 3px 0 0 ${token.colorBgContainer}, 0 4px 0 0 #ddd,
0 6px 0 0 ${token.colorBgContainer}, 0 7px 0 0 #ddd;
box-shadow:
0 1px 0 0 #ddd,
0 3px 0 0 ${token.colorBgContainer},
0 4px 0 0 #ddd,
0 6px 0 0 ${token.colorBgContainer},
0 7px 0 0 #ddd;
}
.preview-image-box img:hover {
Expand Down
9 changes: 6 additions & 3 deletions .dumi/theme/common/styles/Reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default () => {
@font-face {
font-weight: normal;
font-family: AlibabaPuHuiTi;
src: url('//at.alicdn.com/t/webfont_6e11e43nfj.woff2') format('woff2'),
src:
url('//at.alicdn.com/t/webfont_6e11e43nfj.woff2') format('woff2'),
url('//at.alicdn.com/t/webfont_6e11e43nfj.woff') format('woff'),
/* chrome、firefox */ url('//at.alicdn.com/t/webfont_6e11e43nfj.ttf') format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
font-display: swap;
Expand All @@ -20,7 +21,8 @@ export default () => {
@font-face {
font-weight: bold;
font-family: AlibabaPuHuiTi;
src: url('//at.alicdn.com/t/webfont_exesdog9toj.woff2') format('woff2'),
src:
url('//at.alicdn.com/t/webfont_exesdog9toj.woff2') format('woff2'),
url('//at.alicdn.com/t/webfont_exesdog9toj.woff') format('woff'),
/* chrome、firefox */ url('//at.alicdn.com/t/webfont_exesdog9toj.ttf')
format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
Expand All @@ -32,7 +34,8 @@ export default () => {
@font-face {
font-weight: 900;
font-family: 'AliPuHui';
src: url('//at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2')
src:
url('//at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2')
format('woff2'),
url('//at.alicdn.com/wf/webfont/exMpJIukiCms/vtu73by4O2gEBcvBuLgeu.woff') format('woff');
font-display: swap;
Expand Down
2 changes: 0 additions & 2 deletions .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ export default defineConfig({
{ title: 'Notification 通知提醒框', link: '/components/notification' },
{ title: 'Spin 加载中', link: '/components/spin' },
{ title: 'Badge 徽标数', link: '/components/badge' },


],
},
{
Expand Down
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ packages/design/src/theme/style/*.less
packages/icons/src
.secignore
LICENSE
es
lib
dist
/site
/server
/public
__testfixtures__

4 changes: 2 additions & 2 deletions packages/charts/src/DualAxes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ nav:

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| :---------- | :------------- | :-------- | :----- | :--- |
| geometry | 图形类型 | string | line | - |
| geometry | 图形类型 | string | line | - |
| seriesField | 分类字段名 | string | - | - |
| smooth | 是否平滑 | boolean | false | - |
| lineStyle | 折线样式 | LineStyle | - | - |
Expand All @@ -44,7 +44,7 @@ nav:

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| :---------- | :------------- | :---------- | :----- | :--- |
| geometry | 图形类型 | string | line | - |
| geometry | 图形类型 | string | line | - |
| seriesField | 分类字段名 | string | - | - |
| groupField | 分组字段名 | string | - | - |
| isStack | 是否堆叠柱状图 | boolean | false | - |
Expand Down
36 changes: 11 additions & 25 deletions packages/charts/src/Score/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,28 @@ export default () => {

return (
<div>
<Form
style={{ marginBottom: '30px' }}
>
<Form style={{ marginBottom: '30px' }}>
<Form.Item label="Size">
<Radio.Group value={size} onChange={e => setSize(e.target.value)}>
<Radio.Button value='large'>Large</Radio.Button>
<Radio.Button value='middle'>Default</Radio.Button>
<Radio.Button value='small'>Small</Radio.Button>
<Radio.Button value="large">Large</Radio.Button>
<Radio.Button value="middle">Default</Radio.Button>
<Radio.Button value="small">Small</Radio.Button>
<Radio.Button value={300}>300px</Radio.Button>
</Radio.Group>
</Form.Item>
</Form>
<Row>
<Col span={6}>
<Score
size={size}
value={50}
/>
<Score size={size} value={50} />
</Col>
<Col span={6} >
<Score
size={size}
value={60}
/>
<Col span={6}>
<Score size={size} value={60} />
</Col>
<Col span={6} >
<Score
size={size}
value={70}
/>
<Col span={6}>
<Score size={size} value={70} />
</Col>
<Col span={6} >
<Score
size={size}
value={85}
/>
<Col span={6}>
<Score size={size} value={85} />
</Col>
</Row>
</div>
Expand Down
9 changes: 1 addition & 8 deletions packages/charts/src/Score/demo/customColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@ import React from 'react';
import { Score } from '@oceanbase/charts';

export default () => {
return (
<Score
value={100}
color="#A084E8"
unit=""
valueStyle={{ color: '#D0BFFF' }}
/>
);
return <Score value={100} color="#A084E8" unit="" valueStyle={{ color: '#D0BFFF' }} />;
};
5 changes: 1 addition & 4 deletions packages/charts/src/Score/demo/customThreshold.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ export default () => {
<Row gutter={[8, 8]}>
{range(0, 6).map(index => (
<Col span={8} key={index}>
<Score
value={index * 20}
thresholds={thresholds}
/>
<Score value={index * 20} thresholds={thresholds} />
</Col>
))}
</Row>
Expand Down
1,032 changes: 1,031 additions & 1 deletion packages/design/src/spin/assets/spin-gray.json

Large diffs are not rendered by default.

1,032 changes: 1,031 additions & 1 deletion packages/design/src/spin/assets/spin.json

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions packages/design/src/tooltip/demo/close-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,38 @@ import { CloseCircleOutlined } from '@oceanbase/icons';
import React, { useState } from 'react';

const App: React.FC = () => {
const [open, setOpen] = useState(true)
const [open, setOpen] = useState(true);
const log = (e: React.MouseEvent<HTMLElement>) => {
console.log(e);
};

return (
<Space>
<Tooltip title="This is prompt text"
closeIcon={true}
>
<Tooltip title="This is prompt text" closeIcon={true}>
<Button>Default Close Tooltip</Button>
</Tooltip>

<Tooltip title="This is prompt text"
<Tooltip
title="This is prompt text"
open={open}
closeIcon={true}
onClose={() => {
setOpen(false)
setOpen(false);
}}
onOpenChange={(v) => {
setOpen(v)
onOpenChange={v => {
setOpen(v);
}}
>
<Button>Set open</Button>
</Tooltip>
<Tooltip title="This is prompt text This is prompt text This is prompt text This is prompt text" closeIcon={<CloseCircleOutlined />} onClose={log}>
<Tooltip
title="This is prompt text This is prompt text This is prompt text This is prompt text"
closeIcon={<CloseCircleOutlined />}
onClose={log}
>
<Button>Customize closeIcon</Button>
</Tooltip>
</Space>
);
}
};
export default App;
2 changes: 1 addition & 1 deletion packages/design/src/tooltip/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ nav:
| type | 类型 | default \| light \| info \| success \| warning \| error | default | - |
| mouseFollow | 是否跟随鼠标移动,开启后会去掉箭头,并且 `placement``open``closeIcon``trigger` 等属性也将失效 | boolean | false | - |
| closeIcon | 自定义关闭按钮 | boolean \| ReactNode | false | - |
| closeTitle | 自定义关闭标题 | ReactNode | - | - |
| closeTitle | 自定义关闭标题 | ReactNode | - | - |
| onClose | 关闭时的回调(可通过 e.preventDefault() 来阻止默认行为) | (e) => void | - | - |

- 更多 API 详见 antd Tooltip 文档: https://ant.design/components/tooltip-cn
Loading

0 comments on commit 5b199c1

Please sign in to comment.