@luoluoyu/fluentui-plus 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,49 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 FluentUI Plus
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.
22
+
23
+ ---
24
+
25
+ 本项目基于 Fluent UI (MIT License) 进行二次开发,原始版权及 License 如下:
26
+
27
+ --- Fluent UI License Start ---
28
+ MIT License
29
+
30
+ Copyright (c) Microsoft Corporation
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE.
49
+ --- Fluent UI License End
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ # FluentUI Plus
2
+
3
+ [![npm version](https://badge.fury.io/js/fluentui-plus.svg)](https://badge.fury.io/js/fluentui-plus)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ 基于 Fluent UI 的企业级组件库,专为中后台项目设计
7
+ **(不要使用在项目中!!!我闲的做来玩的!!!)**。
8
+
9
+ ## ✨ 特性
10
+
11
+ - 🎨 **设计语言**: 基于 Fluent UI 设计语言,提供现代化的用户界面
12
+ - 📦 **开箱即用**: 高质量的 React 组件,满足企业级产品需求
13
+ - 🛡 **TypeScript**: 使用 TypeScript 开发,提供完整的类型定义
14
+ - 🎯 **按需加载**: 支持 tree-shaking,优化包体积
15
+ - � **样式系统**: 使用 Less 预处理器,支持主题定制和变量覆盖
16
+ - 📱 **现代浏览器**: 支持现代浏览器及 IE11+
17
+
18
+ ## 📦 安装
19
+
20
+ ```bash
21
+ npm install fluentui-plus @fluentui/react-components
22
+ ```
23
+
24
+ 或者使用 yarn:
25
+
26
+ ```bash
27
+ yarn add fluentui-plus @fluentui/react-components
28
+ ```
29
+
30
+ ## 🔨 使用
31
+
32
+ ```jsx
33
+ import React from 'react';
34
+ import { Button, Tag } from 'fluentui-plus';
35
+ // 样式会自动导入,无需手动引入
36
+
37
+ function App() {
38
+ return (
39
+ <div>
40
+ <Button variant='primary'>主要按钮</Button>
41
+ <Tag color='primary'>标签</Tag>
42
+ </div>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ### 样式定制
48
+
49
+ 如果需要定制主题,可以覆盖 Less 变量:
50
+
51
+ ```less
52
+ // your-theme.less
53
+ @import '~fluentui-plus/lib/styles/variables.less';
54
+
55
+ // 覆盖品牌色
56
+ @brand-primary: #your-brand-color;
57
+ @neutral-background-1: #your-background-color;
58
+ ```
59
+
60
+ ## 🌍 按需加载
61
+
62
+ 你可以直接从主包按需引入组件(推荐方式,支持 tree-shaking):
63
+
64
+ ```jsx
65
+ import { Button, Input } from 'fluentui-plus';
66
+ ```
67
+
68
+ 如果需要兼容某些工具链或自定义打包方式,也可以使用子路径导入:
69
+
70
+ ```jsx
71
+ import Button from 'fluentui-plus/lib/Button';
72
+ import Input from 'fluentui-plus/lib/Input';
73
+ ```
74
+
75
+ ## 👥 开发指南
76
+
77
+ 如果你是团队成员或想要为项目贡献代码,请参考以下文档:
78
+
79
+ - **[开发规范与工作流指南](./docs/DEVELOPMENT_GUIDE.md)** - 详细的开发规范、提交规范和工作流说明
80
+ - **[快速参考](./docs/QUICK_REFERENCE.md)** - 常用命令和规范的快速参考卡片
81
+ - **[贡献指南](./docs/CONTRIBUTING.md)** - 如何参与项目贡献
82
+
83
+ ### 快速开始开发
84
+
85
+ ```bash
86
+ # 安装依赖
87
+ yarn install
88
+
89
+ # 启动开发服务器
90
+ yarn dev
91
+
92
+ # 启动 Storybook
93
+ yarn storybook
94
+ ```
95
+
96
+ ### 提交规范
97
+
98
+ 本项目使用 [Conventional Commits](https://www.conventionalcommits.org/) 规范:
99
+
100
+ ```bash
101
+ # 示例
102
+ git commit -m "feat(Tag): add CheckableTag component"
103
+ git commit -m "fix(Button): resolve click event issue"
104
+ ```
105
+
106
+ 详细信息请查看 [开发指南](./docs/DEVELOPMENT_GUIDE.md)。
107
+
108
+ ## 🔗 链接
109
+
110
+ - [📖 文档地址](https://your-docs-site.com)
111
+ - [🐛 问题反馈](https://github.com/HuiruDong/fluentui-plus/issues)
112
+ - [📦 NPM 包](https://www.npmjs.com/package/fluentui-plus)
113
+
114
+ ## 🤝 参与贡献
115
+
116
+ 我们欢迎所有的贡献,请参考 [贡献指南](./docs/CONTRIBUTING.md)。
117
+
118
+ ## 📄 开源协议
119
+
120
+ 本项目遵循 [MIT](./LICENSE) 开源协议。
121
+
122
+ ## 🏗️ 本地开发
123
+
124
+ ```bash
125
+ # 克隆项目
126
+ git clone https://github.com/HuiruDong/fluentui-plus.git
127
+
128
+ # 安装依赖
129
+ npm install
130
+
131
+ # 启动开发服务器
132
+ npm run dev
133
+
134
+ # 运行测试
135
+ npm run test
136
+
137
+ # 构建组件库
138
+ npm run build
139
+
140
+ # 开发环境构建(包含详细 source map)
141
+ npm run build:lib:dev
142
+
143
+ # 生产环境构建(包含优化 source map)
144
+ npm run build:lib:prod
145
+
146
+ # 启动文档站点
147
+ npm run docs:dev
148
+ ```
149
+
150
+ ## 📋 项目结构
151
+
152
+ ```
153
+ fluentui-plus/
154
+ ├── src/ # 源代码
155
+ │ ├── components/ # 组件源码
156
+ │ ├── styles/ # 样式和主题
157
+ │ └── utils/ # 工具函数
158
+ ├── docs/ # 文档源码
159
+ ├── dist/ # 构建产物(包含 source map)
160
+ ├── BUILD.md # 构建配置说明
161
+ └── tests/ # 测试文件
162
+ ```
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { TagProps } from '..';
3
+ export interface CheckableTagProps extends Omit<TagProps, 'onClick'> {
4
+ checked?: boolean;
5
+ onChange?: (checked: boolean) => void;
6
+ }
7
+ declare const CheckableTag: React.FC<CheckableTagProps>;
8
+ export default CheckableTag;
9
+ //# sourceMappingURL=CheckableTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckableTag.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/CheckableTag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,cAAc,CAAC;AAItB,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAW7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { default as React, PropsWithChildren } from 'react';
2
+ import { CheckableTagProps } from './CheckableTag';
3
+ export interface TagProps extends PropsWithChildren {
4
+ closeIcon?: boolean | React.ReactNode;
5
+ color?: string;
6
+ bordered?: boolean;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ onClose?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
10
+ onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
11
+ }
12
+ interface TagComponentType extends React.FC<TagProps> {
13
+ CheckableTag: React.FC<CheckableTagProps>;
14
+ }
15
+ declare const TagComponent: TagComponentType;
16
+ export default TagComponent;
17
+ //# sourceMappingURL=Tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAGvE,OAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,cAAc,CAAC;AAItB,MAAM,WAAW,QAAS,SAAQ,iBAAiB;IACjD,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACjE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAClE;AAgDD,UAAU,gBAAiB,SAAQ,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC;IACnD,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED,QAAA,MAAM,YAAY,EAAE,gBAA0C,CAAC;AAG/D,eAAe,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as Tag } from './Tag';
2
+ export type { TagProps } from './Tag';
3
+ export type { CheckableTagProps } from './CheckableTag';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvC,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Tag } from './Tag';
2
+ export type { TagProps, CheckableTagProps } from './Tag';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAG7B,cAAc,cAAc,CAAC"}