Skip to content

Commit 5bb114d

Browse files
Merge pull request #47 from alibaba/releases/1108
Releases/1108 Add new components, support theme customization, responsive layout and internationalization
2 parents 6f542e8 + 29feddf commit 5bb114d

File tree

278 files changed

+25431
-1461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+25431
-1461
lines changed

.dumi/pages/index-en/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Homepage from '../index';
2+
3+
export default Homepage;

docs/components/home-page.less renamed to .dumi/pages/index/index.less

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import (reference) '../../.dumi/theme/styles/variables.less';
1+
@import (reference) '../../theme/styles/variables.less';
22

33
.main-container {
44
background: #fff;
@@ -214,3 +214,19 @@
214214
}
215215
}
216216
}
217+
218+
.dumi-default-doc-layout-content.home-page {
219+
.side {
220+
display: none;
221+
}
222+
223+
.left {
224+
display: none;
225+
}
226+
227+
.right {
228+
.dumi-default-content {
229+
padding: 0;
230+
}
231+
}
232+
}

docs/components/home-page.tsx renamed to .dumi/pages/index/index.tsx

+43-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
1+
/* eslint-disable react/display-name */
12
import React from 'react';
2-
import Dm from './user-icon/dm';
3-
import Tpp from './user-icon/tpp';
43
import { Button } from '@bifrostui/react';
5-
import { usePrefersColor, useNavigate } from 'dumi';
4+
import { usePrefersColor, useNavigate, useIntl, useLocale } from 'dumi';
65
import { ToTopOutlinedIcon } from '@bifrostui/icons';
7-
import './home-page.less';
6+
import Tpp from './user-icon/tpp';
7+
import Dm from './user-icon/dm';
8+
import './index.less';
9+
import locales from './locales';
810

911
export default () => {
1012
const [color] = usePrefersColor();
13+
const { locale } = useIntl();
14+
const current = locale === 'zh-CN' ? 'zhCN' : 'enUS';
1115
const navigate = useNavigate();
1216
return (
13-
<div className="main-container">
17+
<div className="main-container home-page">
1418
<div className="main-head">
1519
<div>
1620
<img
1721
className="main-logo"
1822
src="https://gw.alicdn.com/imgextra/i2/O1CN01Bqi4MA1USNSLdER5C_!!6000000002516-55-tps-190-90.svg"
1923
/>
20-
<div className="main-desc">一款简洁灵活的跨端组件库</div>
24+
<div className="main-desc">{locales[current].description}</div>
2125
<Button
2226
size="large"
2327
variant="contained"
2428
className="start-btn"
2529
endIcon={<ToTopOutlinedIcon />}
2630
onClick={() => {
27-
navigate("/guide/introduce", { replace: true });
31+
navigate('/guide/introduce', { replace: true });
2832
}}
2933
>
30-
开始体验
34+
{locales[current].start}
3135
</Button>
3236
</div>
3337
<img
@@ -41,51 +45,61 @@ export default () => {
4145
className="introduce-icon"
4246
src="https://gw.alicdn.com/imgextra/i1/O1CN01y4iaZr1aLP2g7R9xm_!!6000000003313-2-tps-160-160.png"
4347
/>
44-
<div className="introduce-title">一码多端</div>
48+
<div className="introduce-title">
49+
{locales[current].features[0].title}
50+
</div>
4551
<div className="introduce-desc">
46-
同时支持H5和小程序
52+
{locales[current].features[0].desc}
4753
</div>
4854
</div>
4955
<div className="introduce-item">
5056
<img
5157
className="introduce-icon"
5258
src="https://gw.alicdn.com/imgextra/i4/O1CN01fvzf101QVLTsWkcrR_!!6000000001981-2-tps-160-160.png"
5359
/>
54-
<div className="introduce-title">高定制</div>
60+
<div className="introduce-title">
61+
{locales[current].features[1].title}
62+
</div>
5563
<div className="introduce-desc">
56-
一致优雅的API帮助您快速创造新主题
64+
{locales[current].features[1].desc}
5765
</div>
5866
</div>
5967
<div className="introduce-item">
6068
<img
6169
className="introduce-icon"
6270
src="https://gw.alicdn.com/imgextra/i4/O1CN01CCqAR028qGfPoYba0_!!6000000007983-2-tps-160-160.png"
6371
/>
64-
<div className="introduce-title">高可用</div>
72+
<div className="introduce-title">
73+
{locales[current].features[2].title}
74+
</div>
6575
<div className="introduce-desc">
66-
完善的配套,丰富的组件,开箱即用
76+
{locales[current].features[2].desc}
6777
</div>
6878
</div>
6979
</div>
7080
<div className="main-resource">
7181
<div className="resource-item">
72-
<div className="resource-title">设计语言</div>
82+
<div className="resource-title">
83+
{locales[current].subTitle[0].title}
84+
</div>
7385
<div className="resource-content">
7486
<div>
75-
<div className="content-title">设计语言</div>
87+
<div className="content-title">
88+
{locales[current].subTitle[0].title}
89+
</div>
7690
<div className="content-desc">
77-
基于阿里影业的众多业务实践沉淀的设计语言和设计系统
91+
{locales[current].subTitle[0].desc}
7892
</div>
7993
<Button
8094
size="large"
8195
variant="contained"
8296
style={{ '--bg-color': '#2356df', '--text-color': '#fff' }}
8397
endIcon={<ToTopOutlinedIcon />}
8498
onClick={() => {
85-
navigate("/design/colors", { replace: true });
99+
navigate('/design/colors', { replace: true });
86100
}}
87101
>
88-
查看详情
102+
{locales[current].subTitle[0].btn}
89103
</Button>
90104
</div>
91105
<img
@@ -95,23 +109,27 @@ export default () => {
95109
</div>
96110
</div>
97111
<div className="resource-item">
98-
<div className="resource-title">组件列表</div>
112+
<div className="resource-title">
113+
{locales[current].subTitle[1].title}
114+
</div>
99115
<div className="resource-content">
100116
<div>
101-
<div className="content-title">组件列表</div>
117+
<div className="content-title">
118+
{locales[current].subTitle[1].title}
119+
</div>
102120
<div className="content-desc">
103-
一致的API、丰富的组件帮助您快速构建前端应用
121+
{locales[current].subTitle[1].desc}
104122
</div>
105123
<Button
106124
size="large"
107125
variant="contained"
108126
style={{ '--bg-color': '#2356df', '--text-color': '#fff' }}
109127
endIcon={<ToTopOutlinedIcon />}
110128
onClick={() => {
111-
navigate("/cores/button", { replace: true });
129+
navigate('/cores/button', { replace: true });
112130
}}
113131
>
114-
查看详情
132+
{locales[current].subTitle[1].btn}
115133
</Button>
116134
</div>
117135
<img
@@ -123,7 +141,7 @@ export default () => {
123141
</div>
124142

125143
<div className="main-users">
126-
<div className="users-title">谁在使用</div>
144+
<div className="users-title">{locales[current].subTitle[2].title}</div>
127145
<div className="user-list">
128146
<Tpp color={color === 'light' ? '#eee' : '#5F6672'} />
129147
<Dm color={color === 'light' ? '#eee' : '#5F6672'} />

.dumi/pages/index/locales.ts

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
export default {
2+
zhCN: {
3+
description: '一款简洁灵活的跨端组件库',
4+
start: '开始体验',
5+
features: [
6+
{
7+
title: '一码多端',
8+
desc: '同时支持H5和小程序',
9+
},
10+
{
11+
title: '高定制',
12+
desc: '一致优雅的API帮助您快速创造新主题',
13+
},
14+
{
15+
title: '高可用',
16+
desc: '完善的配套,丰富的组件,开箱即用',
17+
},
18+
],
19+
subTitle: [
20+
{
21+
title: '设计语言',
22+
desc: '基于阿里影业的众多业务实践沉淀的设计语言和设计系统',
23+
btn: '查看详情',
24+
},
25+
{
26+
title: '组件列表',
27+
desc: '一致的API、丰富的组件帮助您快速构建前端应用',
28+
btn: '查看详情',
29+
},
30+
{
31+
title: '谁在使用',
32+
},
33+
],
34+
},
35+
enUS: {
36+
description: 'A concise and flexible cross-end component library',
37+
start: 'Start to experience',
38+
features: [
39+
{
40+
title: 'One code for multiple terminals',
41+
desc: 'Supports both H5 and mini programs',
42+
},
43+
{
44+
title: 'High customization',
45+
desc: 'Consistent and elegant API helps you quickly create new themes',
46+
},
47+
{
48+
title: 'High availability',
49+
desc: 'Complete supporting facilities, rich components, ready to use',
50+
},
51+
],
52+
subTitle: [
53+
{
54+
title: 'Design language',
55+
desc: 'Design language and design system based on the numerous business practices of Alibaba Pictures',
56+
btn: 'View details',
57+
},
58+
{
59+
title: 'Component list',
60+
desc: 'Consistent API and rich components help you quickly build front-end applications',
61+
btn: 'View details',
62+
},
63+
{
64+
title: 'Who is using it',
65+
},
66+
],
67+
},
68+
};

.dumi/pages/index/user-icon/dm.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default ({ color = '#eee' }) => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
viewBox="0 0 171 54"
6+
width="100%"
7+
height="100%"
8+
>
9+
<path
10+
d="M.084 24.05a4.263 4.263 0 0 1 5.828-3.101l19.375 8.114-21.006.081A4.263 4.263 0 0 1 .084 24.05Zm4.554-10.997a4.263 4.263 0 0 1 6.571-.634L26.005 27.33 6.567 19.367a4.264 4.264 0 0 1-1.93-6.314Zm8.416-8.415a4.263 4.263 0 0 1 6.313 1.928l7.963 19.439-14.91-14.796a4.263 4.263 0 0 1 .634-6.571ZM24.05.083a4.264 4.264 0 0 1 5.094 4.198l-.081 21.006-8.114-19.375a4.264 4.264 0 0 1 3.1-5.829Zm7.85 36.314 8.205 14.306C40.948 52.17 39.89 54 38.196 54h-16.41c-1.692 0-2.752-1.83-1.91-3.297l8.205-14.306c.847-1.476 2.974-1.476 3.82 0ZM30 31.302c-11.386 6.569-6.726 15.835-22.57 18.907.408-3.58-2.182-5.491-3.845-6.222 8.913.08 11.98-3.14 15.298-6.423l.4-.394c2.477-2.43 5.226-4.823 10.717-5.868Zm3.995 1.368 19.439 7.963a4.264 4.264 0 1 1-4.643 6.948L33.995 32.67Zm21.724-1.814a4.263 4.263 0 0 1 4.198 5.095 4.263 4.263 0 0 1-5.828 3.1l-19.377-8.113 21.007-.082Zm-51.438 0 21.006.081-19.375 8.114a4.263 4.263 0 1 1-1.63-8.195Zm49.808-9.908a4.264 4.264 0 1 1 1.63 8.196l-21.006-.081ZM48.79 12.42a4.263 4.263 0 0 1 6.57.635 4.263 4.263 0 0 1-1.927 6.313l-19.44 7.964Zm-8.158-5.852a4.263 4.263 0 1 1 6.948 4.642L32.67 26.005ZM30.856 4.28A4.263 4.263 0 0 1 35.95.084a4.263 4.263 0 0 1 3.1 5.828l-8.113 19.375ZM96.496 6v7.714h19.766v5.944H97.498c2.182 8.276 8.443 16.763 18.117 21.18v7.029c-13.974-5.384-20.3-15.698-22.984-22.695-2.685 6.997-9.011 17.311-22.985 22.695v-7.03c9.674-4.416 15.936-12.903 18.117-21.179H69v-5.943l19.765-.001V6h7.732Zm27.243 31.232v-5.741c3.893-.756 6.347-2.978 7.65-4.558h-7.65v-4.889h20.096V19.74h-18.73v-4.098l18.73-.001v-2.306h-20.096V8.448l20.096-.001V6h7.069l-.001 2.446H171v4.89l-20.097-.001v2.306h18.732v4.1l-18.732-.001v2.305H171v4.89l-32.732-.001c-.071.122-.571.958-1.5 2.114h28.002a3.564 3.564 0 0 1 3.563 3.564c0 .934-.36 1.833-1.018 2.496-1.832 1.846-5.305 4.41-10.264 6.765 3.923.57 8.52.768 13.95.426v5.57c-9.092.523-16.658-.698-22.762-2.652-6.703 1.971-14.928 3.202-24.5 2.651v-5.57c6.34.43 11.737.224 16.394-.457-3.7-1.938-6.495-4.019-8.419-5.734h9.656a32.97 32.97 0 0 0 7.338 3.724 40.764 40.764 0 0 0 11.347-5.894h-28.538c-2.102 1.441-4.695 2.7-7.778 3.296Z"
11+
fill={color}
12+
fill-rule="evenodd"
13+
/>
14+
</svg>
15+
);
16+
};

.dumi/pages/index/user-icon/tpp.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default ({ color = '#eee' }) => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
viewBox="0 0 190 54"
6+
width="100%"
7+
height="100%"
8+
>
9+
<path
10+
d="M144.848 33.778v3.604h-16.292v7.327c0 2.925-1.458 3.29-10.51 3.29-.146-.203-1.351-4.5-1.351-4.5h.621c3.02-.003 4.688-.037 4.688-.694v-5.423h-18.079v-3.604h40.923Zm-35.679 4.793 6.845 2.288c-1.753 2.442-4.551 5.243-6.493 7.14l-5.596-1.882c1.589-1.676 3.814-4.763 5.244-7.546Zm29.657.091c1.939 2.147 4.288 4.702 6.022 7.22l-7.005 2.117c-1.029-2.49-2.454-5.648-4.366-7.557Zm-32.422-6.79h35.961v-3.604h-35.96v3.604Zm15.779-17.859h4.664v-2.471h-4.664v2.471Zm10.598 8.592h4.77V17.77h-4.77v4.834Zm-10.598 0h4.664V17.77h-4.664v4.834Zm-10.917 0h4.77V17.77h-4.77v4.834Zm4.77-8.592h-10.6v12.35h37.944v-12.35h-10.6v-2.471h11.978v-4.08h-40.7v4.08h11.978v2.471ZM190 33.778v3.604h-16.293v7.327c0 2.925-1.458 3.29-10.509 3.29-.147-.203-1.352-4.5-1.352-4.5h.622c3.019-.003 4.687-.037 4.687-.694v-5.423h-18.079v-3.604H190Zm-35.68 4.793 6.845 2.288c-1.752 2.442-4.551 5.243-6.493 7.14l-5.596-1.882c1.589-1.676 3.814-4.763 5.244-7.546Zm29.657.091c1.94 2.147 4.288 4.702 6.022 7.22l-7.005 2.117c-1.029-2.49-2.454-5.648-4.366-7.557Zm-32.421-6.79h35.96v-3.604h-35.96v3.604Zm15.778-17.859h4.664v-2.471h-4.664v2.471Zm10.598 8.592h4.77V17.77h-4.77v4.834Zm-10.599 0h4.664V17.77h-4.664v4.834Zm-10.916 0h4.77V17.77h-4.77v4.834Zm4.77-8.592h-10.599v12.35h37.943v-12.35h-10.599v-2.471h11.977v-4.08H149.21v4.08h11.977v2.471ZM65.36 29.99l4.693 2.034c-1.352 5.11-4.151 11.898-6.718 15.976L58 42.282c3.62-3.89 5.926-8.035 7.36-12.292ZM80.278 6c-.187.903-.657 2.014-1.316 3.18h20.47v36.052c0 2.454-5.953 2.768-15.624 2.768-.145-.208-1.332-4.606-1.332-4.606 1.039 0 2.47.058 3.95.074l.525.004c3.151.01 6.349-.221 6.349-1.65V13.905H75.395c-1.341 1.364-2.792 2.447-4.134 2.887l-2.379-3.422C71.728 10.92 72.96 9.32 73.13 6Zm-.953 9.806c-.095.453-.293.977-.57 1.536h11.314v3.652h-5.898v4.778h7.056v4.017H84.17v7.013h2.276v-4.25h4.286v8.678l-18.61-.155v-8.523h4.048v4.25h2.513v-7.013H71.63v-4.017h7.054v-4.778h-2.485c-1.275 1.41-2.742 2.597-4.019 3.016l-1.52-2.492c2.165-1.863 3.101-3.188 3.231-5.712Zm-17.521 2.348c1.957.793 5.744 2.32 7.854 3.806l-3.606 5.856c-2.621-2.42-4.927-3.948-7.656-5.764Zm.411-10.837c1.855.752 5.444 2.199 7.443 3.607l-3.417 5.55c-2.484-2.294-4.669-3.74-7.256-5.462ZM48.308 25.128c-.004.064-.065.398-.39.481-.015.003-.029.012-.044.018-.419.19-1.057.728-1.283 2.246-.083.684-.219 1.4-.366 2.17l-.002.01c-.418 2.186-1.087 4.003-1.989 5.398-1.263 1.95-2.978 3.037-4.963 3.143-1.448.076-2.666.082-3.722.014-3.06-.196-4.813-1-6.055-2.78-1.67-2.393-2.435-6.744-3.426-6.744-.991 0-1.755 4.35-3.426 6.744-1.241 1.78-2.996 2.584-6.055 2.78-1.056.068-2.273.062-3.722-.014-1.985-.106-3.7-1.193-4.962-3.143-.903-1.395-1.572-3.212-1.99-5.399l-.001-.01c-.147-.769-.284-1.485-.367-2.17-.226-1.517-.863-2.055-1.282-2.245-.015-.006-.03-.015-.045-.018-.324-.083-.386-.417-.39-.48-.037-.615-.188-1.982-.24-2.837-.04-.636.476-.719.574-.725 3.611-.232 11.99-.688 15.797.321 1.138.303 4.392.93 6.11.93 1.716 0 4.97-.627 6.108-.93 3.81-1.01 12.187-.553 15.797-.321.098.006.615.09.576.725-.054.855-.204 2.222-.242 2.836M33.001 7.042C28.626 5.863 27.281 0 19.101 0c2.961 3.452 1.595 6.482-.626 7.178C7.636 10.116-.492 19.388.023 32.203.552 45.396 11.653 54 26 54c14.346 0 25.447-8.604 25.977-21.797C52.5 19.183 44.1 9.82 33 7.042M19.037 24.876a13.584 13.584 0 0 0-.27-.054c-1.356-.257-4.122-.612-6.26-.476-.943.06-1.764.216-2.29.517-1.301.749-1.407 1.925-1.187 3.505.063.459.155.951.252 1.477.52 2.818 1.75 5.818 4.312 5.968 1.15.068 2.093.073 2.874.023 2.404-.153 3.27-.819 3.868-1.72 3.415-5.15 2.064-8.533-1.299-9.24m14.062 0 .27-.054c1.357-.257 4.122-.612 6.26-.476.943.06 1.764.216 2.289.517 1.303.749 1.408 1.925 1.189 3.505-.064.459-.156.951-.252 1.477-.522 2.818-1.751 5.818-4.313 5.968-1.15.068-2.093.073-2.874.023-2.404-.153-3.27-.819-3.867-1.72-3.416-5.15-2.065-8.533 1.298-9.24"
11+
fill={color}
12+
fill-rule="evenodd"
13+
/>
14+
</svg>
15+
);
16+
};

0 commit comments

Comments
 (0)