@lobehub/ui 1.1.0
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 +21 -0
- package/README.md +144 -0
- package/es/ActionIcon/index.d.ts +15 -0
- package/es/ActionIcon/index.js +84 -0
- package/es/DraggablePanel/index.d.ts +26 -0
- package/es/DraggablePanel/index.js +197 -0
- package/es/DraggablePanel/style.d.ts +18 -0
- package/es/DraggablePanel/style.js +30 -0
- package/es/DraggablePanel/utils.d.ts +2 -0
- package/es/DraggablePanel/utils.js +12 -0
- package/es/Logo/Logo3D.d.ts +4 -0
- package/es/Logo/Logo3D.js +11 -0
- package/es/Logo/LogoFlat.d.ts +4 -0
- package/es/Logo/LogoFlat.js +104 -0
- package/es/Logo/LogoHighContrast.d.ts +4 -0
- package/es/Logo/LogoHighContrast.js +26 -0
- package/es/Logo/LogoText.d.ts +4 -0
- package/es/Logo/LogoText.js +18 -0
- package/es/Logo/index.d.ts +8 -0
- package/es/Logo/index.js +54 -0
- package/es/SideNav/index.d.ts +9 -0
- package/es/SideNav/index.js +44 -0
- package/es/Template/index.d.ts +7 -0
- package/es/Template/index.js +15 -0
- package/es/ThemeProvider/GlobalStyle.d.ts +3 -0
- package/es/ThemeProvider/GlobalStyle.js +19 -0
- package/es/ThemeProvider/index.d.ts +11 -0
- package/es/ThemeProvider/index.js +40 -0
- package/es/ThemeProvider/token.d.ts +3 -0
- package/es/ThemeProvider/token.js +45 -0
- package/es/index.d.ts +6 -0
- package/es/index.js +6 -0
- package/es/styles/algorithms/colorRelationship.d.ts +6 -0
- package/es/styles/algorithms/colorRelationship.js +88 -0
- package/es/styles/algorithms/index.d.ts +15 -0
- package/es/styles/algorithms/index.js +67 -0
- package/es/styles/algorithms/paletteGenerator.d.ts +51 -0
- package/es/styles/algorithms/paletteGenerator.js +74 -0
- package/es/styles/antdTheme.d.ts +2 -0
- package/es/styles/antdTheme.js +4 -0
- package/es/styles/customStylish.d.ts +17 -0
- package/es/styles/customStylish.js +19 -0
- package/es/styles/customToken.d.ts +65 -0
- package/es/styles/customToken.js +24 -0
- package/es/styles/index.d.ts +3 -0
- package/es/styles/index.js +3 -0
- package/es/styles/theme/dark.d.ts +4 -0
- package/es/styles/theme/dark.js +82 -0
- package/es/styles/theme/index.d.ts +2 -0
- package/es/styles/theme/index.js +2 -0
- package/es/styles/theme/light.d.ts +4 -0
- package/es/styles/theme/light.js +36 -0
- package/es/types/index.d.ts +9 -0
- package/es/types/index.js +1 -0
- package/es/utils/colorUtils.d.ts +1 -0
- package/es/utils/colorUtils.js +10 -0
- package/lib/ActionIcon/index.d.ts +15 -0
- package/lib/ActionIcon/index.js +110 -0
- package/lib/DraggablePanel/index.d.ts +26 -0
- package/lib/DraggablePanel/index.js +217 -0
- package/lib/DraggablePanel/style.d.ts +18 -0
- package/lib/DraggablePanel/style.js +287 -0
- package/lib/DraggablePanel/utils.d.ts +2 -0
- package/lib/DraggablePanel/utils.js +40 -0
- package/lib/Logo/Logo3D.d.ts +4 -0
- package/lib/Logo/Logo3D.js +45 -0
- package/lib/Logo/LogoFlat.d.ts +4 -0
- package/lib/Logo/LogoFlat.js +130 -0
- package/lib/Logo/LogoHighContrast.d.ts +4 -0
- package/lib/Logo/LogoHighContrast.js +58 -0
- package/lib/Logo/LogoText.d.ts +4 -0
- package/lib/Logo/LogoText.js +49 -0
- package/lib/Logo/index.d.ts +8 -0
- package/lib/Logo/index.js +54 -0
- package/lib/SideNav/index.d.ts +9 -0
- package/lib/SideNav/index.js +58 -0
- package/lib/Template/index.d.ts +7 -0
- package/lib/Template/index.js +41 -0
- package/lib/ThemeProvider/GlobalStyle.d.ts +3 -0
- package/lib/ThemeProvider/GlobalStyle.js +80 -0
- package/lib/ThemeProvider/index.d.ts +11 -0
- package/lib/ThemeProvider/index.js +68 -0
- package/lib/ThemeProvider/token.d.ts +3 -0
- package/lib/ThemeProvider/token.js +73 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +54 -0
- package/lib/styles/algorithms/colorRelationship.d.ts +6 -0
- package/lib/styles/algorithms/colorRelationship.js +87 -0
- package/lib/styles/algorithms/index.d.ts +15 -0
- package/lib/styles/algorithms/index.js +81 -0
- package/lib/styles/algorithms/paletteGenerator.d.ts +51 -0
- package/lib/styles/algorithms/paletteGenerator.js +91 -0
- package/lib/styles/antdTheme.d.ts +2 -0
- package/lib/styles/antdTheme.js +30 -0
- package/lib/styles/customStylish.d.ts +17 -0
- package/lib/styles/customStylish.js +117 -0
- package/lib/styles/customToken.d.ts +65 -0
- package/lib/styles/customToken.js +54 -0
- package/lib/styles/index.d.ts +3 -0
- package/lib/styles/index.js +21 -0
- package/lib/styles/theme/dark.d.ts +4 -0
- package/lib/styles/theme/dark.js +131 -0
- package/lib/styles/theme/index.d.ts +2 -0
- package/lib/styles/theme/index.js +32 -0
- package/lib/styles/theme/light.d.ts +4 -0
- package/lib/styles/theme/light.js +64 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/index.js +17 -0
- package/lib/utils/colorUtils.d.ts +1 -0
- package/lib/utils/colorUtils.js +52 -0
- package/package.json +122 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/SideNav/index.tsx
|
|
30
|
+
var SideNav_exports = {};
|
|
31
|
+
__export(SideNav_exports, {
|
|
32
|
+
default: () => SideNav_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SideNav_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
38
|
+
var Layout = import_styled_components.default.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
flex: none;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
|
|
45
|
+
width: 64px;
|
|
46
|
+
height: 100%;
|
|
47
|
+
min-height: 640px;
|
|
48
|
+
padding: 16px 0;
|
|
49
|
+
|
|
50
|
+
background: ${({ theme }) => theme.colorBgContainer};
|
|
51
|
+
border-right: 1px solid ${({ theme }) => theme.colorBorder};
|
|
52
|
+
`;
|
|
53
|
+
var SideNav = ({ avatar, topActions, bottomActions, ...props }) => {
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(Layout, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 16, direction: "vertical", align: "center" }, avatar, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 8, direction: "vertical", align: "center" }, topActions)), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4, direction: "vertical", align: "center" }, bottomActions));
|
|
55
|
+
};
|
|
56
|
+
var SideNav_default = import_react.default.memo(SideNav);
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Template/index.tsx
|
|
30
|
+
var Template_exports = {};
|
|
31
|
+
__export(Template_exports, {
|
|
32
|
+
default: () => Template_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Template_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var Template = ({ children, ...props }) => {
|
|
37
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ...props }, children);
|
|
38
|
+
};
|
|
39
|
+
var Template_default = import_react.default.memo(Template);
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/ThemeProvider/GlobalStyle.ts
|
|
20
|
+
var GlobalStyle_exports = {};
|
|
21
|
+
__export(GlobalStyle_exports, {
|
|
22
|
+
default: () => GlobalStyle_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(GlobalStyle_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var GlobalStyle = import_antd_style.createGlobalStyle`
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
font-family: "AliPuHui", ${({ theme }) => theme.fontFamily};
|
|
30
|
+
font-size: ${({ theme }) => theme.fontSize};
|
|
31
|
+
line-height: 1;
|
|
32
|
+
color: ${({ theme }) => theme.colorTextBase};
|
|
33
|
+
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
background-color: ${(p) => p.theme.colorBgLayout};
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
* {
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: AliPuHui;
|
|
46
|
+
font-weight: normal;
|
|
47
|
+
src: url('//at.alicdn.com/t/webfont_exesdog9toj.woff2') format('woff2'),
|
|
48
|
+
url('//at.alicdn.com/t/webfont_exesdog9toj.woff') format('woff'),
|
|
49
|
+
url('//at.alicdn.com/t/webfont_exesdog9toj.ttf') format('truetype');
|
|
50
|
+
font-display: swap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@font-face {
|
|
54
|
+
font-family: AliPuHui;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
src: url('https://at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2') format('woff2'),
|
|
57
|
+
url('https://at.alicdn.com/wf/webfont/exMpJIukiCms/vtu73by4O2gEBcvBuLgeu.woff') format('woff');
|
|
58
|
+
font-display: swap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 定义滚动槽的样式 */
|
|
62
|
+
::-webkit-scrollbar {
|
|
63
|
+
width: 6px;
|
|
64
|
+
height: 6px;
|
|
65
|
+
margin-right: 4px;
|
|
66
|
+
background-color: transparent; // 定义滚动槽的背景色
|
|
67
|
+
|
|
68
|
+
&-thumb {
|
|
69
|
+
background-color: ${({ theme }) => theme.colorFill}; // 定义滚动块的背景色
|
|
70
|
+
border-radius: 4px; // 定义滚动块的圆角半径
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-corner {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
var GlobalStyle_default = GlobalStyle;
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { extractStaticStyle, type ThemeMode } from 'antd-style';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ThemeProviderProps {
|
|
4
|
+
token?: any;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
themeMode?: ThemeMode;
|
|
7
|
+
ssrInline?: boolean;
|
|
8
|
+
cache?: typeof extractStaticStyle.cache;
|
|
9
|
+
}
|
|
10
|
+
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
11
|
+
export default ThemeProvider;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/ThemeProvider/index.tsx
|
|
30
|
+
var ThemeProvider_exports = {};
|
|
31
|
+
__export(ThemeProvider_exports, {
|
|
32
|
+
default: () => ThemeProvider_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ThemeProvider_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_antd_style = require("antd-style");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_styled_components = require("styled-components");
|
|
39
|
+
var import_styles = require("../styles");
|
|
40
|
+
var import_GlobalStyle = __toESM(require("./GlobalStyle"));
|
|
41
|
+
var ThemeProvider = ({ token, children, themeMode }) => {
|
|
42
|
+
(0, import_antd_style.setupStyled)({ ThemeContext: import_styled_components.ThemeContext });
|
|
43
|
+
const getCustomToken = (0, import_react.useCallback)(
|
|
44
|
+
(params) => {
|
|
45
|
+
const base = (0, import_styles.createCustomToken)(params);
|
|
46
|
+
if (token) {
|
|
47
|
+
return { ...base, ...token };
|
|
48
|
+
} else {
|
|
49
|
+
return base;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
[token]
|
|
53
|
+
);
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd_style.StyleProvider, { speedy: process.env.NODE_ENV === "production" }, /* @__PURE__ */ import_react.default.createElement(
|
|
55
|
+
import_antd_style.ThemeProvider,
|
|
56
|
+
{
|
|
57
|
+
themeMode,
|
|
58
|
+
theme: import_styles.getAntdTheme,
|
|
59
|
+
customStylish: import_styles.getCustomStylish,
|
|
60
|
+
customToken: getCustomToken
|
|
61
|
+
},
|
|
62
|
+
/* @__PURE__ */ import_react.default.createElement(import_GlobalStyle.default, null),
|
|
63
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.App, null, children)
|
|
64
|
+
));
|
|
65
|
+
};
|
|
66
|
+
var ThemeProvider_default = ThemeProvider;
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/ThemeProvider/token.ts
|
|
20
|
+
var token_exports = {};
|
|
21
|
+
__export(token_exports, {
|
|
22
|
+
darkToken: () => darkToken,
|
|
23
|
+
lightToken: () => lightToken
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(token_exports);
|
|
26
|
+
var darkToken = {
|
|
27
|
+
colorTextLightSolid: "#000000",
|
|
28
|
+
colorBgLayout: "#000000",
|
|
29
|
+
colorBgContainer: "#111111",
|
|
30
|
+
colorBgElevated: "#222222",
|
|
31
|
+
colorBgSpotlight: "#444444",
|
|
32
|
+
colorBorder: "#333333",
|
|
33
|
+
colorBorderSecondary: "#333333",
|
|
34
|
+
colorText: "#ffffff",
|
|
35
|
+
colorTextSecondary: "#999999",
|
|
36
|
+
colorTextTertiary: "#888888",
|
|
37
|
+
colorTextQuaternary: "#666666",
|
|
38
|
+
colorPrimary: "#ffffff",
|
|
39
|
+
colorInfo: "#0070f3",
|
|
40
|
+
colorSuccess: "#50e3c2",
|
|
41
|
+
colorWarning: "#f5a623",
|
|
42
|
+
colorError: "#ee0000",
|
|
43
|
+
colorFillQuaternary: "rgba(0,0,0,0)",
|
|
44
|
+
borderRadius: 5,
|
|
45
|
+
borderRadiusXS: 3,
|
|
46
|
+
borderRadiusSM: 3,
|
|
47
|
+
borderRadiusLG: 8,
|
|
48
|
+
controlHeight: 36,
|
|
49
|
+
boxShadow: "0 12px 20px 6px rgb(0 0 0 / 0.08)",
|
|
50
|
+
boxShadowSecondary: "0 2px 8px 2px rgb(0 0 0 / 0.07), 0 2px 4px -1px rgb(0 0 0 / 0.04)"
|
|
51
|
+
};
|
|
52
|
+
var lightToken = {
|
|
53
|
+
...darkToken,
|
|
54
|
+
colorTextLightSolid: "#ffffff",
|
|
55
|
+
colorBgLayout: "#ffffff",
|
|
56
|
+
colorBgContainer: "#fafafa",
|
|
57
|
+
colorBgElevated: "#f2f2f2",
|
|
58
|
+
colorBgSpotlight: "#999999",
|
|
59
|
+
colorBorder: "#eaeaea",
|
|
60
|
+
colorBorderSecondary: "#eaeaea",
|
|
61
|
+
colorText: "#000000",
|
|
62
|
+
colorTextSecondary: "#444444",
|
|
63
|
+
colorTextTertiary: "#666666",
|
|
64
|
+
colorTextQuaternary: "#888888",
|
|
65
|
+
colorPrimary: "#000000",
|
|
66
|
+
boxShadow: "0 12px 20px 6px rgb(104 112 118 / 0.08)",
|
|
67
|
+
boxShadowSecondary: "0 2px 8px 2px rgb(104 112 118 / 0.07), 0 2px 4px -1px rgb(104 112 118 / 0.04)"
|
|
68
|
+
};
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
darkToken,
|
|
72
|
+
lightToken
|
|
73
|
+
});
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ActionIcon, type ActionIconProps } from './ActionIcon';
|
|
2
|
+
export { default as DraggablePanel, type DraggablePanelProps } from './DraggablePanel';
|
|
3
|
+
export { default as Logo } from './Logo';
|
|
4
|
+
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
5
|
+
export { default as Template, type TemplateProps } from './Template';
|
|
6
|
+
export { default as ThemeProvider } from './ThemeProvider';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
ActionIcon: () => import_ActionIcon.default,
|
|
33
|
+
DraggablePanel: () => import_DraggablePanel.default,
|
|
34
|
+
Logo: () => import_Logo.default,
|
|
35
|
+
SideNav: () => import_SideNav.default,
|
|
36
|
+
Template: () => import_Template.default,
|
|
37
|
+
ThemeProvider: () => import_ThemeProvider.default
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(src_exports);
|
|
40
|
+
var import_ActionIcon = __toESM(require("./ActionIcon"));
|
|
41
|
+
var import_DraggablePanel = __toESM(require("./DraggablePanel"));
|
|
42
|
+
var import_Logo = __toESM(require("./Logo"));
|
|
43
|
+
var import_SideNav = __toESM(require("./SideNav"));
|
|
44
|
+
var import_Template = __toESM(require("./Template"));
|
|
45
|
+
var import_ThemeProvider = __toESM(require("./ThemeProvider"));
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
ActionIcon,
|
|
49
|
+
DraggablePanel,
|
|
50
|
+
Logo,
|
|
51
|
+
SideNav,
|
|
52
|
+
Template,
|
|
53
|
+
ThemeProvider
|
|
54
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/styles/algorithms/colorRelationship.ts
|
|
30
|
+
var colorRelationship_exports = {};
|
|
31
|
+
__export(colorRelationship_exports, {
|
|
32
|
+
generateAssociatedColors: () => generateAssociatedColors
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(colorRelationship_exports);
|
|
35
|
+
var import_chroma_js = __toESM(require("chroma-js"));
|
|
36
|
+
var baseColors = [
|
|
37
|
+
{ name: "red", hue: 0 },
|
|
38
|
+
{ name: "orange", hue: 30 },
|
|
39
|
+
{ name: "yellow", hue: 60 },
|
|
40
|
+
{ name: "yellow-green", hue: 90 },
|
|
41
|
+
{ name: "green", hue: 120 },
|
|
42
|
+
{ name: "cyan-green", hue: 150 },
|
|
43
|
+
{ name: "cyan", hue: 180 },
|
|
44
|
+
{ name: "cyan-blue", hue: 210 },
|
|
45
|
+
{ name: "blue", hue: 240 },
|
|
46
|
+
{ name: "blue-violet", hue: 270 },
|
|
47
|
+
{ name: "violet", hue: 300 },
|
|
48
|
+
{ name: "red-violet", hue: 330 }
|
|
49
|
+
];
|
|
50
|
+
var findClosestColorBase = (hue) => {
|
|
51
|
+
let minDifference = 360;
|
|
52
|
+
let closestColorBase = { name: "", hue: 0 };
|
|
53
|
+
baseColors.forEach((colorBase) => {
|
|
54
|
+
const hueDifference = Math.abs(hue - colorBase.hue);
|
|
55
|
+
const adjustedDifference = Math.min(hueDifference, 360 - hueDifference);
|
|
56
|
+
if (adjustedDifference < minDifference) {
|
|
57
|
+
minDifference = adjustedDifference;
|
|
58
|
+
closestColorBase = colorBase;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return closestColorBase.hue;
|
|
62
|
+
};
|
|
63
|
+
var generateAssociatedColors = (baseColor, adjustWarning = true) => {
|
|
64
|
+
const color = (0, import_chroma_js.default)(baseColor);
|
|
65
|
+
const [baseLightness, baseChroma, baseHue] = color.oklch();
|
|
66
|
+
const closestColorHue = findClosestColorBase(baseHue);
|
|
67
|
+
const hueOffset = baseHue - closestColorHue;
|
|
68
|
+
const successBaseHue = 150;
|
|
69
|
+
const errorBaseHue = 30;
|
|
70
|
+
const warningBaseHue = 90;
|
|
71
|
+
const infoBaseHue = 255;
|
|
72
|
+
const successHue = (successBaseHue + hueOffset) % 360;
|
|
73
|
+
const errorHue = (errorBaseHue + hueOffset) % 360;
|
|
74
|
+
const warningHue = (warningBaseHue + hueOffset) % 360;
|
|
75
|
+
const infoHue = (infoBaseHue + hueOffset) % 360;
|
|
76
|
+
const warningLightness = adjustWarning ? 0.8 + baseLightness * 0.2 : baseLightness;
|
|
77
|
+
return {
|
|
78
|
+
success: import_chroma_js.default.oklch(baseLightness, baseChroma, successHue).hex(),
|
|
79
|
+
error: import_chroma_js.default.oklch(baseLightness, baseChroma, errorHue).hex(),
|
|
80
|
+
warning: import_chroma_js.default.oklch(warningLightness, baseChroma, warningHue).hex(),
|
|
81
|
+
info: import_chroma_js.default.oklch(baseLightness, baseChroma, infoHue).hex()
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
generateAssociatedColors
|
|
87
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ColorMapToken } from 'antd/es/theme/interface/maps/colors';
|
|
2
|
+
import { ColorPalettes, NeutralPaletteOptions, SeedColors, TokenType } from './paletteGenerator';
|
|
3
|
+
export declare type TokenRelationship = (type: TokenType) => Partial<Record<keyof ColorMapToken, number>>;
|
|
4
|
+
interface MapTokenAlgorithm extends NeutralPaletteOptions {
|
|
5
|
+
relationship?: TokenRelationship;
|
|
6
|
+
seedColors?: Partial<SeedColors>;
|
|
7
|
+
infoColorFollowPrimary?: boolean;
|
|
8
|
+
adjustWarning?: boolean;
|
|
9
|
+
brandColor?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const genMapTokenAlgorithm: (mode: 'dark' | 'light', params?: MapTokenAlgorithm) => {
|
|
12
|
+
palettes: ColorPalettes;
|
|
13
|
+
tokens: Partial<Record<keyof ColorMapToken, string>>;
|
|
14
|
+
};
|
|
15
|
+
export type { ColorPalettes } from './paletteGenerator';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/styles/algorithms/index.ts
|
|
20
|
+
var algorithms_exports = {};
|
|
21
|
+
__export(algorithms_exports, {
|
|
22
|
+
genMapTokenAlgorithm: () => genMapTokenAlgorithm
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(algorithms_exports);
|
|
25
|
+
var import_colorRelationship = require("./colorRelationship");
|
|
26
|
+
var import_paletteGenerator = require("./paletteGenerator");
|
|
27
|
+
var defaultRelationship = (type) => {
|
|
28
|
+
const key = type.toUpperCase()[0] + type.slice(1);
|
|
29
|
+
return {
|
|
30
|
+
[`color${key}Bg`]: 1,
|
|
31
|
+
[`color${key}BgHover`]: 2,
|
|
32
|
+
[`color${key}Border`]: 3,
|
|
33
|
+
[`color${key}BorderHover`]: 4,
|
|
34
|
+
[`color${key}Hover`]: 5,
|
|
35
|
+
[`color${key}`]: 6,
|
|
36
|
+
[`color${key}Active`]: 7,
|
|
37
|
+
[`color${key}TextHover`]: 8,
|
|
38
|
+
[`color${key}Text`]: 9,
|
|
39
|
+
[`color${key}TextActive`]: 10
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
var genMapTokenAlgorithm = (mode, params) => {
|
|
43
|
+
const {
|
|
44
|
+
relationship = defaultRelationship,
|
|
45
|
+
infoColorFollowPrimary = false,
|
|
46
|
+
adjustWarning,
|
|
47
|
+
brandColor = mode === "dark" ? "#fff" : "#000"
|
|
48
|
+
} = params || {};
|
|
49
|
+
const funcColors = (0, import_colorRelationship.generateAssociatedColors)(brandColor, adjustWarning);
|
|
50
|
+
const seedColors = {
|
|
51
|
+
primary: brandColor,
|
|
52
|
+
...funcColors,
|
|
53
|
+
...params == null ? void 0 : params.seedColors
|
|
54
|
+
};
|
|
55
|
+
if (infoColorFollowPrimary) {
|
|
56
|
+
seedColors.info = brandColor;
|
|
57
|
+
}
|
|
58
|
+
const palettes = {
|
|
59
|
+
primary: (0, import_paletteGenerator.generateColorPalette)(seedColors.primary, params).map((color) => color.hex),
|
|
60
|
+
error: (0, import_paletteGenerator.generateColorPalette)(seedColors.error, params).map((c) => c.hex),
|
|
61
|
+
warning: (0, import_paletteGenerator.generateColorPalette)(seedColors.warning, params).map((c) => c.hex),
|
|
62
|
+
success: (0, import_paletteGenerator.generateColorPalette)(seedColors.success, params).map((c) => c.hex),
|
|
63
|
+
info: (0, import_paletteGenerator.generateColorPalette)(seedColors.info, params).map((color) => color.hex),
|
|
64
|
+
neutral: (0, import_paletteGenerator.generateNeutralPalette)(seedColors.primary, { ...params, neutral: true }).map(
|
|
65
|
+
(c) => c.hex
|
|
66
|
+
),
|
|
67
|
+
grey: (0, import_paletteGenerator.generateNeutralPalette)(seedColors.primary, params).map((c) => c.hex)
|
|
68
|
+
};
|
|
69
|
+
let tokens = {};
|
|
70
|
+
const types = ["primary", "error", "warning", "success", "info"];
|
|
71
|
+
types.forEach((type) => {
|
|
72
|
+
Object.entries(relationship(type)).forEach(([key, value]) => {
|
|
73
|
+
tokens[key] = palettes[type][value];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return { palettes, tokens };
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
genMapTokenAlgorithm
|
|
81
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface Color {
|
|
2
|
+
hex: string;
|
|
3
|
+
oklch: [number, number, number];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @title 阴影参数
|
|
7
|
+
*/
|
|
8
|
+
interface AdjustParams {
|
|
9
|
+
/**
|
|
10
|
+
* @title 步骤
|
|
11
|
+
* @description 阴影的层数,即需要生成几个阴影层,默认为 5。
|
|
12
|
+
*/
|
|
13
|
+
steps: number;
|
|
14
|
+
/**
|
|
15
|
+
* @title 目标亮度
|
|
16
|
+
* @description 阴影的最终亮度值,取值范围为 0~255,默认为 0。
|
|
17
|
+
*/
|
|
18
|
+
targetBrightness: number;
|
|
19
|
+
/**
|
|
20
|
+
* @title 色相调整
|
|
21
|
+
* @description 调整阴影颜色的色相值,取值范围为 -180~180,默认为 0。
|
|
22
|
+
*/
|
|
23
|
+
hueAdjustment: number;
|
|
24
|
+
/**
|
|
25
|
+
* @title 饱和度调整
|
|
26
|
+
* @description 调整阴影颜色的饱和度值,取值范围为 -100~100,默认为 0。
|
|
27
|
+
*/
|
|
28
|
+
saturationAdjustment: number;
|
|
29
|
+
/**
|
|
30
|
+
* @title 饱和度缩放
|
|
31
|
+
* @description 缩放阴影颜色的饱和度值,取值范围为 0~1,默认为 1。
|
|
32
|
+
*/
|
|
33
|
+
saturationScale: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ColorPaletteOptions {
|
|
36
|
+
lighter?: Partial<AdjustParams>;
|
|
37
|
+
darker?: Partial<AdjustParams>;
|
|
38
|
+
reverse?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare type TokenType = 'primary' | 'success' | 'warning' | 'error' | 'info' | 'grey' | 'neutral';
|
|
41
|
+
export declare type ColorPalettes = Record<TokenType, string[]>;
|
|
42
|
+
export declare type SeedColors = Record<TokenType, string>;
|
|
43
|
+
export declare const generateColorPalette: (baseColorHex: string, options?: ColorPaletteOptions) => Color[];
|
|
44
|
+
export interface NeutralPaletteOptions {
|
|
45
|
+
lighter?: Partial<AdjustParams>;
|
|
46
|
+
darker?: Partial<AdjustParams>;
|
|
47
|
+
reverse?: boolean;
|
|
48
|
+
neutral?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const generateNeutralPalette: (baseColorHex: string, options?: NeutralPaletteOptions) => Color[];
|
|
51
|
+
export {};
|