Skip to content

Commit 43f4033

Browse files
committed
init project
1 parent 86f65b9 commit 43f4033

447 files changed

Lines changed: 29938 additions & 1 deletion

File tree

Some content is hidden

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

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules/
2+
.DS_Store
3+
dist
4+
build
5+
yarn.lock
6+
package-lock.json
7+
*.log
8+
*.log.*
9+
/coverage
10+
/.history
11+
*.tmp
12+
/.vscode/

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"proseWrap": "never",
6+
"arrowParens": "avoid",
7+
"overrides": [
8+
{
9+
"files": ".prettierrc",
10+
"options": {
11+
"parser": "json"
12+
}
13+
}
14+
]
15+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 张东
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
1-
# Easemob-UIKit-web
1+
# Chat-UI
2+
3+
## 安装依赖使用 pnpm
4+
5+
```bash
6+
pnpm install
7+
```
8+
9+
## 运行
10+
11+
```bash
12+
pnpm run dev
13+
```
14+
15+
在浏览器可以加上路径 /demo/自己的 demo 路径, 如:http://localhost:5173/demo/button/
16+
17+
## 打包
18+
19+
```bash
20+
pnpm run build
21+
```
22+
23+
## 单元测试
24+
25+
使用 vitest https://cn.vitest.dev/guide/
26+
27+
```bash
28+
pnpm run test
29+
```
30+
31+
## 文件命名规范
32+
33+
```
34+
├── src # 组件代码
35+
└── button # 组件包名
36+
├── index.ts # 组件入口
37+
├── Button.tsx # 组件代码
38+
├── Button.stories.tsx # storybook
39+
├── style.scss # 组件样式
40+
└── **tests** # 测试用例
41+
└── Button.spec.ts
42+
```
43+
44+
- 包名:小写 + 中划线;
45+
- 统一入口文件: index.ts;
46+
- 组件代码: 大驼峰;
47+
- 测试用例代码 : 测试对象名+ .spec.ts。
48+
49+
文档在 docs

babel.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/env',
5+
{
6+
modules: false,
7+
useBuiltIns: 'usage'
8+
}
9+
],
10+
'@babel/react'
11+
]
12+
}

demo/ react-app-env.d.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/// <reference types="node" />
2+
/// <reference types="react" />
3+
/// <reference types="react-dom" />
4+
5+
declare namespace NodeJS {
6+
interface ProcessEnv {
7+
readonly NODE_ENV: 'development' | 'production' | 'test';
8+
readonly PUBLIC_URL: string;
9+
}
10+
}
11+
12+
declare module '*.avif' {
13+
const src: string;
14+
export default src;
15+
}
16+
17+
declare module '*.bmp' {
18+
const src: string;
19+
export default src;
20+
}
21+
22+
declare module '*.gif' {
23+
const src: string;
24+
export default src;
25+
}
26+
27+
declare module '*.jpg' {
28+
const src: string;
29+
export default src;
30+
}
31+
32+
declare module '*.jpeg' {
33+
const src: string;
34+
export default src;
35+
}
36+
37+
declare module '*.png' {
38+
const src: string;
39+
export default src;
40+
}
41+
42+
declare module '*.webp' {
43+
const src: string;
44+
export default src;
45+
}
46+
47+
declare module '*.mp4' {
48+
const src: string;
49+
export default src;
50+
}
51+
52+
declare module '*.svg' {
53+
import * as React from 'react';
54+
55+
export const ReactComponent: React.FunctionComponent<
56+
React.SVGProps<SVGSVGElement> & { title?: string }
57+
>;
58+
59+
const src: string;
60+
export default src;
61+
}
62+
63+
declare module '*.module.css' {
64+
const classes: { readonly [key: string]: string };
65+
export default classes;
66+
}
67+
68+
declare module '*.module.scss' {
69+
const classes: { readonly [key: string]: string };
70+
export default classes;
71+
}
72+
73+
declare module '*.module.sass' {
74+
const classes: { readonly [key: string]: string };
75+
export default classes;
76+
}

demo/avatar/avatar.png

8.3 KB
Loading

demo/avatar/index.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Document</title>
9+
</head>
10+
11+
<body>
12+
<div id="avatarRoot"></div>
13+
<script type="module">
14+
import './index'
15+
</script>
16+
17+
</body>
18+
19+
</html>

demo/avatar/index.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React, { useState } from 'react';
2+
import ReactDOM from 'react-dom/client';
3+
import Avatar from '../../src/avatar/index';
4+
import image from './avatar.png';
5+
ReactDOM.createRoot(document.getElementById('avatarRoot') as Element).render(
6+
<div className="container">
7+
{/* <ConfigProvider
8+
value={{
9+
getPrefixCls: () => {
10+
return 'qqq';
11+
},
12+
iconPrefixCls: 'bamboo',
13+
}}
14+
> */}
15+
<Avatar src={image}>12</Avatar>
16+
<Avatar shape="square" size={40}>
17+
12
18+
</Avatar>
19+
<Avatar.Group size={80}>
20+
<Avatar src={image}>群1</Avatar>
21+
<Avatar>群2</Avatar>
22+
</Avatar.Group>
23+
24+
<Avatar.Group shape="square">
25+
<Avatar shape="square" src={image}>
26+
群1
27+
</Avatar>
28+
<Avatar shape="square">群2</Avatar>
29+
</Avatar.Group>
30+
{/* </ConfigProvider> */}
31+
</div>
32+
);

demo/badge/badge.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)