From 87dda77b05d509afe2b27f4d298342ef41fc0ba8 Mon Sep 17 00:00:00 2001
From: CanisMinor
Date: Wed, 14 Feb 2024 10:16:11 +0000
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20init?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.bunfig.toml | 3 +
.changelogrc.js | 1 +
.commitlintrc.js | 1 +
.dumirc.ts | 67 +++
.editorconfig | 16 +
.eslintignore | 30 ++
.eslintrc.js | 1 +
.fatherrc.ts | 5 +
.github/ISSUE_TEMPLATE/1_bug_report.yml | 45 ++
.github/ISSUE_TEMPLATE/2_feature_request.yml | 21 +
.github/ISSUE_TEMPLATE/3_question.yml | 15 +
.github/ISSUE_TEMPLATE/4_other.md | 7 +
.github/PULL_REQUEST_TEMPLATE.md | 18 +
.github/workflows/issue-auto-comments.yml | 72 +++
.github/workflows/issue-check-inactive.yml | 23 +
.github/workflows/issue-close-require.yml | 52 ++
.github/workflows/release.yml | 36 ++
.github/workflows/test.yml | 27 +
.gitignore | 45 ++
.husky/commit-msg | 4 +
.husky/pre-commit | 5 +
.i18nrc.cjs | 7 +
.npmrc | 11 +
.prettierignore | 61 +++
.prettierrc.js | 1 +
.releaserc.js | 1 +
.remarkrc.js | 1 +
.stylelintrc.js | 10 +
CHANGELOG.md | 487 +++++++++++++++++++
LICENSE | 21 +
README.md | 208 +++++++-
docs/changelog.md | 9 +
docs/index.md | 7 +
docs/index.tsx | 18 +
package.json | 122 +++++
renovate.json | 13 +
src/BarChart/demos/data.ts | 8 +
src/BarChart/demos/index.tsx | 71 +++
src/BarChart/index.md | 8 +
src/BarChart/index.tsx | 185 +++++++
src/BarChart/styles.ts | 18 +
src/components/ColorSwatch/index.tsx | 14 +
src/components/Legend/Content.tsx | 60 +++
src/components/Legend/index.tsx | 27 +
src/components/Legend/styles.ts | 19 +
src/components/Tooltip/Content.tsx | 71 +++
src/components/Tooltip/index.tsx | 48 ++
src/components/Tooltip/styles.ts | 21 +
src/components/XAxis/index.tsx | 27 +
src/components/YAxis/index.tsx | 27 +
src/index.ts | 1 +
src/types.ts | 93 ++++
src/utils/getData.ts | 7 +
src/utils/getFilteredChartLegendPayload.ts | 3 +
src/utils/getFilteredChartTooltipPayload.ts | 10 +
src/utils/getSeriesLabels.ts | 12 +
src/utils/valueToPercent.ts | 3 +
tsconfig-check.json | 7 +
tsconfig.json | 21 +
vitest.config.ts | 14 +
60 files changed, 2245 insertions(+), 1 deletion(-)
create mode 100644 .bunfig.toml
create mode 100644 .changelogrc.js
create mode 100644 .commitlintrc.js
create mode 100644 .dumirc.ts
create mode 100644 .editorconfig
create mode 100644 .eslintignore
create mode 100644 .eslintrc.js
create mode 100644 .fatherrc.ts
create mode 100644 .github/ISSUE_TEMPLATE/1_bug_report.yml
create mode 100644 .github/ISSUE_TEMPLATE/2_feature_request.yml
create mode 100644 .github/ISSUE_TEMPLATE/3_question.yml
create mode 100644 .github/ISSUE_TEMPLATE/4_other.md
create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
create mode 100644 .github/workflows/issue-auto-comments.yml
create mode 100644 .github/workflows/issue-check-inactive.yml
create mode 100644 .github/workflows/issue-close-require.yml
create mode 100644 .github/workflows/release.yml
create mode 100644 .github/workflows/test.yml
create mode 100644 .gitignore
create mode 100755 .husky/commit-msg
create mode 100755 .husky/pre-commit
create mode 100644 .i18nrc.cjs
create mode 100644 .npmrc
create mode 100644 .prettierignore
create mode 100644 .prettierrc.js
create mode 100644 .releaserc.js
create mode 100644 .remarkrc.js
create mode 100644 .stylelintrc.js
create mode 100644 CHANGELOG.md
create mode 100644 LICENSE
create mode 100644 docs/changelog.md
create mode 100644 docs/index.md
create mode 100644 docs/index.tsx
create mode 100644 package.json
create mode 100644 renovate.json
create mode 100644 src/BarChart/demos/data.ts
create mode 100644 src/BarChart/demos/index.tsx
create mode 100644 src/BarChart/index.md
create mode 100644 src/BarChart/index.tsx
create mode 100644 src/BarChart/styles.ts
create mode 100644 src/components/ColorSwatch/index.tsx
create mode 100644 src/components/Legend/Content.tsx
create mode 100644 src/components/Legend/index.tsx
create mode 100644 src/components/Legend/styles.ts
create mode 100644 src/components/Tooltip/Content.tsx
create mode 100644 src/components/Tooltip/index.tsx
create mode 100644 src/components/Tooltip/styles.ts
create mode 100644 src/components/XAxis/index.tsx
create mode 100644 src/components/YAxis/index.tsx
create mode 100644 src/index.ts
create mode 100644 src/types.ts
create mode 100644 src/utils/getData.ts
create mode 100644 src/utils/getFilteredChartLegendPayload.ts
create mode 100644 src/utils/getFilteredChartTooltipPayload.ts
create mode 100644 src/utils/getSeriesLabels.ts
create mode 100644 src/utils/valueToPercent.ts
create mode 100644 tsconfig-check.json
create mode 100644 tsconfig.json
create mode 100644 vitest.config.ts
diff --git a/.bunfig.toml b/.bunfig.toml
new file mode 100644
index 0000000..d6bb75b
--- /dev/null
+++ b/.bunfig.toml
@@ -0,0 +1,3 @@
+[install.lockfile]
+
+save = false
diff --git a/.changelogrc.js b/.changelogrc.js
new file mode 100644
index 0000000..9a2f5f9
--- /dev/null
+++ b/.changelogrc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').changelog;
diff --git a/.commitlintrc.js b/.commitlintrc.js
new file mode 100644
index 0000000..9b8c6ac
--- /dev/null
+++ b/.commitlintrc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').commitlint;
diff --git a/.dumirc.ts b/.dumirc.ts
new file mode 100644
index 0000000..d060c18
--- /dev/null
+++ b/.dumirc.ts
@@ -0,0 +1,67 @@
+import { defineConfig } from 'dumi';
+
+import { homepage, name } from './package.json';
+
+const isProduction = process.env.NODE_ENV === 'production';
+const isWin = process.platform === 'win32';
+
+const themeConfig = {
+ actions: [
+ {
+ link: homepage,
+ openExternal: true,
+ text: 'Github',
+ },
+ {
+ link: '/components/anthropic',
+ text: 'Get Started',
+ type: 'primary',
+ },
+ ],
+ apiHeader: {
+ docUrl: `{github}/tree/master/src/{atomId}/index.md`,
+ match: ['/components'],
+ pkg: name,
+ sourceUrl: `{github}/tree/master/src/{atomId}/index.tsx`,
+ },
+ description: 'React modern charts components built on recharts',
+ footer: 'Made with 🤯 by LobeHub',
+ name: 'Charts',
+ nav: [
+ { link: '/components/anthropic', title: 'Components' },
+ { link: '/changelog', title: 'Changelog' },
+ ],
+ socialLinks: {
+ discord: 'https://discord.gg/AYFPHvv2jT',
+ github: homepage,
+ },
+ title: 'Lobe Charts',
+};
+
+export default defineConfig({
+ apiParser: isProduction ? {} : false,
+ base: '/',
+ define: {
+ 'process.env': process.env,
+ },
+ extraBabelPlugins: ['babel-plugin-antd-style'],
+ favicons: ['https://npm.elemecdn.com/@lobehub/assets-favicons/assets/favicon.ico'],
+ locales: [{ id: 'en-US', name: 'English' }],
+ mfsu: isWin ? undefined : {},
+ npmClient: 'pnpm',
+ publicPath: '/',
+ resolve: isProduction
+ ? {
+ entryFile: './src/index.ts',
+ }
+ : undefined,
+ styles: [
+ `html, body { background: transparent; }
+
+ @media (prefers-color-scheme: dark) {
+ html, body { background: #000; }
+ }`,
+ ],
+ themeConfig,
+ title: 'Lobe Charts',
+});
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..7e3649a
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[Makefile]
+indent_style = tab
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..305d1ef
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,30 @@
+# Eslintignore for LobeHub
+################################################################
+
+# dependencies
+node_modules
+
+# ci
+coverage
+.coverage
+
+# test
+jest*
+_test_
+__test__
+
+# umi
+.umi
+.umi-production
+.umi-test
+.dumi/tmp*
+!.dumirc.ts
+
+# production
+dist
+es
+lib
+logs
+
+# misc
+# add other ignore file below
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..bc75953
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').eslint;
diff --git a/.fatherrc.ts b/.fatherrc.ts
new file mode 100644
index 0000000..8ee4f1b
--- /dev/null
+++ b/.fatherrc.ts
@@ -0,0 +1,5 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ esm: { output: 'es' },
+});
diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yml b/.github/ISSUE_TEMPLATE/1_bug_report.yml
new file mode 100644
index 0000000..d181c38
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1_bug_report.yml
@@ -0,0 +1,45 @@
+name: '🐛 反馈缺陷 Bug Report'
+description: '反馈一个问题缺陷 | Report an bug'
+title: '[Bug] '
+labels: '🐛 Bug'
+body:
+ - type: dropdown
+ attributes:
+ label: '💻 系统环境 | Operating System'
+ options:
+ - Windows
+ - macOS
+ - Ubuntu
+ - Other Linux
+ - Other
+ validations:
+ required: true
+ - type: dropdown
+ attributes:
+ label: '🌐 浏览器 | Browser'
+ options:
+ - Chrome
+ - Edge
+ - Safari
+ - Firefox
+ - Other
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: '🐛 问题描述 | Bug Description'
+ description: A clear and concise description of the bug.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: '🚦 期望结果 | Expected Behavior'
+ description: A clear and concise description of what you expected to happen.
+ - type: textarea
+ attributes:
+ label: '📷 复现步骤 | Recurrence Steps'
+ description: A clear and concise description of how to recurrence.
+ - type: textarea
+ attributes:
+ label: '📝 补充信息 | Additional Information'
+ description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.yml b/.github/ISSUE_TEMPLATE/2_feature_request.yml
new file mode 100644
index 0000000..edcf7d0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2_feature_request.yml
@@ -0,0 +1,21 @@
+name: '🌠 功能需求 Feature Request'
+description: '需求或建议 | Suggest an idea'
+title: '[Request] '
+labels: '🌠 Feature Request'
+body:
+ - type: textarea
+ attributes:
+ label: '🥰 需求描述 | Feature Description'
+ description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: '🧐 解决方案 | Proposed Solution'
+ description: Describe the solution you'd like in a clear and concise manner.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: '📝 补充信息 | Additional Information'
+ description: Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/3_question.yml b/.github/ISSUE_TEMPLATE/3_question.yml
new file mode 100644
index 0000000..f989f7d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/3_question.yml
@@ -0,0 +1,15 @@
+name: '😇 疑问或帮助 Help Wanted'
+description: '疑问或需要帮助 | Need help'
+title: '[Question] '
+labels: '😇 Help Wanted'
+body:
+ - type: textarea
+ attributes:
+ label: '🧐 问题描述 | Proposed Solution'
+ description: A clear and concise description of the proplem.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: '📝 补充信息 | Additional Information'
+ description: Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/4_other.md b/.github/ISSUE_TEMPLATE/4_other.md
new file mode 100644
index 0000000..215dd1f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/4_other.md
@@ -0,0 +1,7 @@
+---
+name: '📝 其他 Other'
+about: '其他问题 | Other issues'
+title: ''
+labels: ''
+assignees: ''
+---
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..ae2208c
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,18 @@
+#### 💻 变更类型 | Change Type
+
+
+
+- [ ] ✨ feat
+- [ ] 🐛 fix
+- [ ] ♻️ refactor
+- [ ] 💄 style
+- [ ] 🔨 chore
+- [ ] 📝 docs
+
+#### 🔀 变更说明 | Description of Change
+
+
+
+#### 📝 补充信息 | Additional Information
+
+
diff --git a/.github/workflows/issue-auto-comments.yml b/.github/workflows/issue-auto-comments.yml
new file mode 100644
index 0000000..65b3c98
--- /dev/null
+++ b/.github/workflows/issue-auto-comments.yml
@@ -0,0 +1,72 @@
+name: Issue Auto Comment
+on:
+ issues:
+ types:
+ - opened
+ - closed
+ - assigned
+ pull_request_target:
+ types:
+ - opened
+ - closed
+
+permissions:
+ contents: read
+
+jobs:
+ run:
+ permissions:
+ issues: write # for actions-cool/issues-helper to update issues
+ pull-requests: write # for actions-cool/issues-helper to update PRs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Auto Comment on Issues Opened
+ uses: wow-actions/auto-comment@v1
+ with:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
+ issuesOpened: |
+ 👀 @{{ author }}
+ Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
+ Please make sure you have given us as much context as possible.\
+ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
+ - name: Auto Comment on Issues Closed
+ uses: wow-actions/auto-comment@v1
+ with:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
+ issuesClosed: |
+ ✅ @{{ author }}
+
+ This issue is closed, If you have any questions, you can comment and reply.\
+ 此问题已经关闭。如果您有任何问题,可以留言并回复。
+ - name: Auto Comment on Pull Request Opened
+ uses: wow-actions/auto-comment@v1
+ with:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN}}
+ pullRequestOpened: |
+ 👍 @{{ author }}
+
+ Thank you for raising your pull request and contributing to our Community
+ Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
+ If you encounter any problems, please feel free to connect with us.\
+ 非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
+ 如果您遇到任何问题,请随时与我们联系。
+ - name: Auto Comment on Pull Request Merged
+ uses: actions-cool/pr-welcome@main
+ if: github.event.pull_request.merged == true
+ with:
+ token: ${{ secrets.GH_TOKEN }}
+ comment: |
+ ❤️ Great PR @${{ github.event.pull_request.user.login }} ❤️
+
+ The growth of project is inseparable from user feedback and contribution, thanks for your contribution!\
+ 项目的成长离不开用户反馈和贡献,感谢您的贡献!
+ emoji: 'hooray'
+ pr-emoji: '+1, heart'
+ - name: Remove inactive
+ if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'remove-labels'
+ token: ${{ secrets.GH_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ labels: 'Inactive'
diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml
new file mode 100644
index 0000000..a5ae1fb
--- /dev/null
+++ b/.github/workflows/issue-check-inactive.yml
@@ -0,0 +1,23 @@
+name: Issue Check Inactive
+
+on:
+ schedule:
+ - cron: '0 0 */15 * *'
+
+permissions:
+ contents: read
+
+jobs:
+ issue-check-inactive:
+ permissions:
+ issues: write # for actions-cool/issues-helper to update issues
+ pull-requests: write # for actions-cool/issues-helper to update PRs
+ runs-on: ubuntu-latest
+ steps:
+ - name: check-inactive
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'check-inactive'
+ token: ${{ secrets.GH_TOKEN }}
+ inactive-label: 'Inactive'
+ inactive-day: 30
diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml
new file mode 100644
index 0000000..e64d0cd
--- /dev/null
+++ b/.github/workflows/issue-close-require.yml
@@ -0,0 +1,52 @@
+name: Issue Close Require
+
+on:
+ schedule:
+ - cron: '0 0 * * *'
+
+permissions:
+ contents: read
+
+jobs:
+ issue-close-require:
+ permissions:
+ issues: write # for actions-cool/issues-helper to update issues
+ pull-requests: write # for actions-cool/issues-helper to update PRs
+ runs-on: ubuntu-latest
+ steps:
+ - name: need reproduce
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'close-issues'
+ token: ${{ secrets.GH_TOKEN }}
+ labels: '✅ Fixed'
+ inactive-day: 3
+ body: |
+ 👋 @{{ github.event.issue.user.login }}
+
+ Since the issue was labeled with `✅ Fixed`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\
+ 由于该 issue 被标记为已修复,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
+ - name: need reproduce
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'close-issues'
+ token: ${{ secrets.GH_TOKEN }}
+ labels: '🤔 Need Reproduce'
+ inactive-day: 3
+ body: |
+ 👋 @{{ github.event.issue.user.login }}
+
+ Since the issue was labeled with `🤔 Need Reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\
+ 由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
+ - name: need reproduce
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'close-issues'
+ token: ${{ secrets.GH_TOKEN }}
+ labels: "🙅🏻♀️ WON'T DO"
+ inactive-day: 3
+ body: |
+ 👋 @{{ github.event.issue.user.login }}
+
+ Since the issue was labeled with `🙅🏻♀️ WON'T DO`, and no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.\
+ 由于该 issue 被标记为暂不处理,同时 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..f7f1a4f
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,36 @@
+name: Release CI
+on:
+ push:
+ branches:
+ - master
+ - alpha
+ - beta
+ - rc
+
+jobs:
+ release:
+ name: Release
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install bun
+ uses: oven-sh/setup-bun@v1
+
+ - name: Install deps
+ run: bun i
+
+ - name: CI
+ run: bun run ci
+
+ - name: Test
+ run: bun run test
+
+ - name: Build
+ run: bun run build
+
+ - name: Release
+ run: bun run release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..9e0238f
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,27 @@
+name: Test CI
+on:
+ pull_request:
+ push:
+ branches:
+ - '!main'
+jobs:
+ test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install bun
+ uses: oven-sh/setup-bun@v1
+
+ - name: Install deps
+ run: bun i
+
+ - name: CI
+ run: bun run ci
+
+ - name: Test and coverage
+ run: bun run test:coverage
+
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1c49d17
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,45 @@
+# Gitignore for LobeHub
+################################################################
+
+# general
+.DS_Store
+.idea
+.vscode
+.history
+.temp
+.env.local
+venv
+temp
+tmp
+
+# dependencies
+node_modules
+*.log
+*.lock
+package-lock.json
+
+# ci
+coverage
+.coverage
+.eslintcache
+.stylelintcache
+
+# production
+dist
+es
+lib
+logs
+test-output
+
+# umi
+.umi
+.umi-production
+.umi-test
+.dumi/tmp*
+
+# husky
+.husky/prepare-commit-msg
+
+# misc
+# add other ignore file below
+bun.lockb
\ No newline at end of file
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100755
index 0000000..c160a77
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npx --no -- commitlint --edit ${1}
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 0000000..8da041a
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npm run type-check
+npx --no-install lint-staged
diff --git a/.i18nrc.cjs b/.i18nrc.cjs
new file mode 100644
index 0000000..df9553a
--- /dev/null
+++ b/.i18nrc.cjs
@@ -0,0 +1,7 @@
+module.exports = {
+ markdown: {
+ entry: ['./README.md'],
+ entryLocale: 'en-US',
+ outputLocales: ['zh-CN']
+ },
+};
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..d9ed3d3
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,11 @@
+lockfile=false
+resolution-mode=highest
+public-hoist-pattern[]=*@umijs/lint*
+public-hoist-pattern[]=*changelog*
+public-hoist-pattern[]=*commitlint*
+public-hoist-pattern[]=*eslint*
+public-hoist-pattern[]=*postcss*
+public-hoist-pattern[]=*prettier*
+public-hoist-pattern[]=*remark*
+public-hoist-pattern[]=*semantic-release*
+public-hoist-pattern[]=*stylelint*
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..51fdf94
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,61 @@
+# Prettierignore for LobeHub
+################################################################
+
+# general
+.DS_Store
+.editorconfig
+.idea
+.vscode
+.history
+.temp
+.env.local
+.husky
+.npmrc
+.gitkeep
+venv
+temp
+tmp
+LICENSE
+
+# dependencies
+node_modules
+*.log
+*.lock
+package-lock.json
+
+# ci
+coverage
+.coverage
+.eslintcache
+.stylelintcache
+test-output
+__snapshots__
+*.snap
+
+# production
+dist
+es
+lib
+logs
+
+# umi
+.umi
+.umi-production
+.umi-test
+.dumi/tmp*
+
+# ignore files
+.*ignore
+
+# docker
+docker
+Dockerfile*
+
+# image
+*.webp
+*.gif
+*.png
+*.jpg
+
+# misc
+# add other ignore file below
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 0000000..f0355a9
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').prettier;
diff --git a/.releaserc.js b/.releaserc.js
new file mode 100644
index 0000000..3793001
--- /dev/null
+++ b/.releaserc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').semanticRelease;
diff --git a/.remarkrc.js b/.remarkrc.js
new file mode 100644
index 0000000..b673c10
--- /dev/null
+++ b/.remarkrc.js
@@ -0,0 +1 @@
+module.exports = require('@lobehub/lint').remarklint;
diff --git a/.stylelintrc.js b/.stylelintrc.js
new file mode 100644
index 0000000..113f184
--- /dev/null
+++ b/.stylelintrc.js
@@ -0,0 +1,10 @@
+const config = require('@lobehub/lint').stylelint;
+
+module.exports = {
+ ...config,
+ rules: {
+ 'custom-property-pattern': null,
+ 'selector-pseudo-element-no-unknown': null,
+ 'no-descending-specificity': null,
+ },
+};
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..72f86ce
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,487 @@
+
+
+# Changelog
+
+### [Version 1.10.2](https://github.com/lobehub/lobe-icons/compare/v1.10.1...v1.10.2)
+
+Released on **2024-02-02**
+
+#### 🐛 Bug Fixes
+
+- **misc**: Fix homepage.
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix homepage ([7021a40](https://github.com/lobehub/lobe-icons/commit/7021a40))
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix dashboard ([1526c46](https://github.com/lobehub/lobe-icons/commit/1526c46))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add more ai brand ([8e63d1b](https://github.com/lobehub/lobe-icons/commit/8e63d1b))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add demos ([8020388](https://github.com/lobehub/lobe-icons/commit/8020388))
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix ollama icon position ([9d614df](https://github.com/lobehub/lobe-icons/commit/9d614df))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add Hunyuan ([d2dc21a](https://github.com/lobehub/lobe-icons/commit/d2dc21a))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add more llm icons ([d1b27da](https://github.com/lobehub/lobe-icons/commit/d1b27da))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add midjourney ([49f2030](https://github.com/lobehub/lobe-icons/commit/49f2030))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add aws bedrock ([43ab6c3](https://github.com/lobehub/lobe-icons/commit/43ab6c3))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add more ai brands ([7c6c843](https://github.com/lobehub/lobe-icons/commit/7c6c843))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add more llm brands ([62ba9c5](https://github.com/lobehub/lobe-icons/commit/62ba9c5))
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix avatar type ([0e3404b](https://github.com/lobehub/lobe-icons/commit/0e3404b))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add Google Gemini ([f4a71e0](https://github.com/lobehub/lobe-icons/commit/f4a71e0))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Add Tongyi Wenxi ChatGLM ([7e9b574](https://github.com/lobehub/lobe-icons/commit/7e9b574))
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix father build ignore ([d18b69c](https://github.com/lobehub/lobe-icons/commit/d18b69c))
+
+
+
+Improvements and Fixes
+
+#### Styles
+
+- **misc**: Update base flow ([5ec6904](https://github.com/lobehub/lobe-icons/commit/5ec6904))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Root ([c8ae543](https://github.com/lobehub/lobe-icons/commit/c8ae543))
+
+#### What's fixed
+
+- **misc**: Fix deps ([385a104](https://github.com/lobehub/lobe-icons/commit/385a104))
+- **misc**: Fix deps ([361faa5](https://github.com/lobehub/lobe-icons/commit/361faa5))
+
+
+
+Improvements and Fixes
+
+#### What's fixed
+
+- **misc**: Fix deps ([361faa5](https://github.com/lobehub/lobe-icons/commit/361faa5))
+
+
+
+Improvements and Fixes
+
+#### What's improved
+
+- **misc**: Root ([c8ae543](https://github.com/lobehub/lobe-icons/commit/c8ae543))
+
+
+
+
+
+
Lobe Icons
+
+React modern charts components built on recharts
+
+[Changelog](./CHANGELOG.md) · [Report Bug][github-issues-link] · [Request Feature][github-issues-link]
+
+
+
+[![][npm-release-shield]][npm-release-link]
+[![][vercel-shield]][vercel-link]
+[![][discord-shield]][discord-link]
+[![][npm-downloads-shield]][npm-downloads-link]
+[![][github-releasedate-shield]][github-releasedate-link]
+[![][github-action-test-shield]][github-action-test-link]
+[![][github-action-release-shield]][github-action-release-link]
+[![][github-contributors-shield]][github-contributors-link]
+[![][github-forks-shield]][github-forks-link]
+[![][github-stars-shield]][github-stars-link]
+[![][github-issues-shield]][github-issues-link]
+[![][github-license-shield]][github-license-link]
+
+Table of contents
+
+#### TOC
+
+- [✨ Features](#-features)
+- [📦 Installation](#-installation)
+ - [Compile with NextJS](#compile-with-nextjs)
+- [⌨️ Local Development](#️-local-development)
+- [🤝 Contributing](#-contributing)
+- [🩷 Sponsor](#-sponsor)
+- [🔗 More Products](#-more-products)
+
+####
+
+
+
+
+[![][fossa-license-shield]][fossa-license-link]
+
+📝 License
+This project is [MIT](./LICENSE) licensed.
+
+
+
+[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
+[bun-link]: https://bun.sh
+[bun-shield]: https://img.shields.io/badge/-speedup%20with%20bun-black?logo=bun&style=for-the-badge
+[codespaces-link]: https://codespaces.new/lobehub/lobe-charts
+[codespaces-shield]: https://github.com/codespaces/badge.svg
+[contributors-contrib]: https://contrib.rocks/image?repo=lobehub/charts
+[contributors-link]: https://github.com/lobehub/lobe-charts/graphs/contributors
+[discord-link]: https://discord.gg/AYFPHvv2jT
+[discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
+[fossa-license-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Flobehub%2Flobe-charts
+[fossa-license-shield]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Flobehub%2Flobe-charts.svg?type=large
+[github-action-release-link]: https://github.com/actions/workflows/lobehub/lobe-charts/release.yml
+[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-charts/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
+[github-action-test-link]: https://github.com/actions/workflows/lobehub/lobe-charts/test.yml
+[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-charts/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
+[github-contributors-link]: https://github.com/lobehub/lobe-charts/graphs/contributors
+[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/lobe-charts?color=c4f042&labelColor=black&style=flat-square
+[github-forks-link]: https://github.com/lobehub/lobe-charts/network/members
+[github-forks-shield]: https://img.shields.io/github/forks/lobehub/lobe-charts?color=8ae8ff&labelColor=black&style=flat-square
+[github-issues-link]: https://github.com/lobehub/lobe-charts/issues
+[github-issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-charts?color=ff80eb&labelColor=black&style=flat-square
+[github-license-link]: https://github.com/lobehub/lobe-charts/blob/master/LICENSE
+[github-license-shield]: https://img.shields.io/github/license/lobehub/lobe-charts?color=white&labelColor=black&style=flat-square
+[github-releasedate-link]: https://github.com/lobehub/lobe-charts/releases
+[github-releasedate-shield]: https://img.shields.io/github/release-date/lobehub/lobe-charts?labelColor=black&style=flat-square
+[github-stars-link]: https://github.com/lobehub/lobe-charts/network/stargazers
+[github-stars-shield]: https://img.shields.io/github/stars/lobehub/lobe-charts?color=ffcb47&labelColor=black&style=flat-square
+[lobe-chat]: https://github.com/lobehub/lobe-chat
+[lobe-commit]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-commit
+[lobe-i18n]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-i18n
+[lobe-theme]: https://github.com/lobehub/sd-webui-lobe-theme
+[npm-downloads-link]: https://www.npmjs.com/package/@lobehub/charts
+[npm-downloads-shield]: https://img.shields.io/npm/dt/@lobehub/charts?labelColor=black&style=flat-square
+[npm-release-link]: https://www.npmjs.com/package/@lobehub/charts
+[npm-release-shield]: https://img.shields.io/npm/v/@lobehub/charts?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square
+[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls
+[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge
+[profile-link]: https://github.com/lobehub
+[vercel-link]: https://icons.lobehub.com
+[vercel-shield]: https://img.shields.io/website?down_message=offline&label=vercel&labelColor=black&logo=vercel&style=flat-square&up_message=online&url=https%3A%2F%2Fui.lobehub.com
diff --git a/docs/changelog.md b/docs/changelog.md
new file mode 100644
index 0000000..6d4759e
--- /dev/null
+++ b/docs/changelog.md
@@ -0,0 +1,9 @@
+---
+title: Changelog
+description: New updates and improvements to @lobehub/icons
+nav:
+ title: Changelog
+ order: 999
+---
+
+
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..2290f97
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,7 @@
+---
+hero:
+ title: LobeHub Charts
+ description: React modern charts components built on recharts
+---
+
+
diff --git a/docs/index.tsx b/docs/index.tsx
new file mode 100644
index 0000000..8d143ab
--- /dev/null
+++ b/docs/index.tsx
@@ -0,0 +1,18 @@
+import { createStyles } from 'antd-style';
+import { Center } from 'react-layout-kit';
+
+const useStyles = createStyles(({ css, token }) => ({
+ container: css`
+ margin-top: -4%;
+ `,
+}));
+
+export default () => {
+ const { styles } = useStyles();
+
+ return (
+
diff --git a/src/BarChart/index.tsx b/src/BarChart/index.tsx
new file mode 100644
index 0000000..8246b7d
--- /dev/null
+++ b/src/BarChart/index.tsx
@@ -0,0 +1,185 @@
+import { ComponentPropsWithoutRef, MouseEvent, forwardRef, useState } from 'react';
+import { Flexbox, FlexboxProps } from 'react-layout-kit';
+import {
+ Bar,
+ CartesianGrid,
+ BarChart as ReChartsBarChart,
+ ReferenceLine,
+ ResponsiveContainer,
+} from 'recharts';
+
+import Legend from '@/components/Legend';
+import Tooltip from '@/components/Tooltip';
+import XAxis from '@/components/XAxis';
+import YAxis from '@/components/YAxis';
+import type { ChartSeries } from '@/types';
+import { GridChartBaseProps } from '@/types';
+import { valueToPercent } from '@/utils/valueToPercent';
+
+import { useStyles } from './styles';
+
+export type BarChartSeries = ChartSeries;
+
+export type BarChartType = 'default' | 'stacked' | 'percent';
+
+export interface BarChartProps extends GridChartBaseProps, FlexboxProps {
+ /** Props passed down to recharts `BarChart` component */
+ barChartProps?: ComponentPropsWithoutRef