Skip to content

Commit a7f7329

Browse files
author
xuanxuan
committed
chore: setup entire project
1 parent 62f5790 commit a7f7329

File tree

221 files changed

+35260
-0
lines changed

Some content is hidden

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

221 files changed

+35260
-0
lines changed

.dumirc.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
outputPath: 'docs-dist',
5+
themeConfig: {
6+
name: '',
7+
logo: "https://pic.rmb.bdstatic.com/activity/2023-12/1703081616671/a7932a0d0448.png",
8+
},
9+
favicons: ['https://pic.rmb.bdstatic.com/activity/2023-12/1703672356517/7177d38d1e41.ico'],
10+
apiParser: {},
11+
plugins: ['@umijs/plugins/dist/tailwindcss'],
12+
tailwindcss: {},
13+
resolve: {
14+
entryFile: './src/index.ts',
15+
},
16+
publicPath: '/loki-ui/',
17+
cssPublicPath: '/loki-ui/',
18+
base: '/loki-ui/',
19+
});

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
extends: [
3+
require.resolve('@reskript/config-lint/config/eslint'),
4+
],
5+
rules: {
6+
'comma-dangle': 'off',
7+
'no-trailing-spaces': 'off',
8+
'@typescript-eslint/no-unused-vars': 'warn',
9+
'@typescript-eslint/no-useless-constructor': 'warn',
10+
'no-console': 'warn',
11+
'@babel/object-curly-spacing': ['error', 'never']
12+
},
13+
};

.fatherrc.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {defineConfig} from 'father';
2+
3+
export default defineConfig({
4+
esm: {
5+
output: 'dist',
6+
transformer: 'swc',
7+
},
8+
});

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Node.js CI Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '16'
20+
21+
- name: Install pnpm
22+
run: npm install -g pnpm
23+
24+
- name: Install dependencies with pnpm
25+
run: pnpm install --frozen-lockfile
26+
27+
- name: Build docs with pnpm
28+
run: pnpm docs:build
29+
30+
- name: Archive built docs into tarball
31+
run: cat docs-dist/index.html && tar -cvf output2.tar --touch docs-dist
32+
33+
- name: Upload archived output as artifact
34+
if: success() # Only run this step if the previous steps were successful
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: output2
38+
path: output2.tar

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Loki-ui NPM Publish
2+
3+
on:
4+
workflow_dispatch: # 允许手动触发工作流
5+
6+
jobs:
7+
npm_publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Set up Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: '16'
16+
registry-url: 'https://registry.npmjs.org/'
17+
18+
- name: Install pnpm
19+
run: npm install -g pnpm
20+
21+
- name: Install dependencies with pnpm
22+
run: pnpm install --frozen-lockfile
23+
24+
- name: Publish to NPM
25+
run: npm publish --access public
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release_doc.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Doc CI Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Download Artifact
14+
uses: dawidd6/action-download-artifact@v3
15+
with:
16+
name: output2
17+
check_artifacts: true
18+
search_artifacts: true
19+
workflow: build.yml
20+
21+
- name: Extract the archived output
22+
run: tar -xvf output2.tar && pwd && ls -l ./docs-dist && cat ./docs-dist/index.html
23+
24+
- name: Deploy 🚀
25+
uses: peaceiris/actions-gh-pages@v3
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: ./docs-dist

.gitignore

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Referenced from https://github.com/github/gitignore/blob/master/Node.gitignore
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# Typescript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
/.dumi
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
# next.js build output
64+
.next
65+
66+
# other stuff
67+
.DS_Store
68+
Thumbs.db
69+
70+
# IDE configurations
71+
.idea
72+
.vscode
73+
74+
# build assets
75+
/output
76+
/dist
77+
/dll
78+
/docs-dist

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
*.yaml

.prettierrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
pluginSearchDirs: false,
3+
plugins: [
4+
require.resolve('prettier-plugin-organize-imports'),
5+
require.resolve('prettier-plugin-packagejson'),
6+
],
7+
printWidth: 120,
8+
proseWrap: 'never',
9+
semi: true,
10+
singleQuote: true,
11+
trailingComma: 'all',
12+
tabWidth: 4,
13+
useTabs: false,
14+
insertPragma: false,
15+
bracketSpacing: false,
16+
overrides: [
17+
{
18+
files: '*.md',
19+
options: {
20+
proseWrap: 'preserve',
21+
},
22+
},
23+
],
24+
};

.stylelintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@umijs/lint/dist/config/stylelint"
3+
}

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)
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.

demo/Modal/active.tsx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import {Button, Modal} from 'loki-ui';
2+
import React, {useState} from 'react';
3+
4+
const App: React.FC = () => {
5+
const [open, setOpen] = useState(false);
6+
7+
const onOk = () => {
8+
setOpen(false);
9+
};
10+
11+
const showModal = () => {
12+
setOpen(true);
13+
};
14+
15+
const handleCancel = () => {
16+
setOpen(false);
17+
};
18+
19+
20+
const [open2, setOpen2] = useState(false);
21+
22+
const onOk2 = () => {
23+
setOpen2(false);
24+
};
25+
26+
const showModal2 = () => {
27+
setOpen2(true);
28+
};
29+
30+
const handleCancel2 = () => {
31+
setOpen2(false);
32+
};
33+
34+
return (
35+
<>
36+
<Button type="primary" onClick={showModal}>
37+
Open Modal
38+
</Button>
39+
40+
<Modal pure title="Basic Modal" open={open} onOk={() => onOk()} onCancel={() => handleCancel()}>
41+
<div className="bg-white rounded-[10px] p-10 text-[--black]">
42+
<p>Some contents...</p>
43+
<p>Some contents...</p>
44+
<p>Some contents...</p>
45+
<p>Some contents...</p>
46+
<p>Some contents...</p>
47+
<p>Some contents...</p>
48+
<p>Some contents...</p>
49+
</div>
50+
</Modal>
51+
52+
53+
<Button type="primary" className="ml-10" onClick={showModal2}>
54+
Open Modal
55+
</Button>
56+
57+
<Modal pure title="Basic Modal" size="xl" centered open={open2} onOk={() => onOk2()} onCancel={() => handleCancel2()}>
58+
<div className="bg-white rounded-[10px] p-10 text-[--black]">
59+
<p>Some contents...</p>
60+
<p>Some contents...</p>
61+
<p>Some contents...</p>
62+
<p>Some contents...</p>
63+
<p>Some contents...</p>
64+
<p>Some contents...</p>
65+
<p>Some contents...</p>
66+
</div>
67+
</Modal>
68+
</>
69+
);
70+
};
71+
72+
export default App;

demo/Modal/basic.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {Button, Modal} from 'loki-ui';
2+
import React, {useState} from 'react';
3+
4+
const App: React.FC = () => {
5+
const [open, setOpen] = useState(false);
6+
7+
const onOk = () => {
8+
setOpen(false);
9+
};
10+
11+
const showModal = () => {
12+
setOpen(true);
13+
};
14+
15+
const handleCancel = () => {
16+
setOpen(false);
17+
console.log('handle cancel');
18+
};
19+
20+
return (
21+
<>
22+
<Button type="primary" onClick={showModal}>
23+
Open Modal
24+
</Button>
25+
26+
<Modal mask={false} title="Basic Modal" open={open} onOk={() => onOk()} onCancel={() => handleCancel()}>
27+
<p>Some contents...</p>
28+
<p>Some contents...</p>
29+
<p>Some contents...</p>
30+
</Modal>
31+
</>
32+
);
33+
};
34+
35+
export default App;

0 commit comments

Comments
 (0)