@lobehub/ui 1.9.0 → 1.11.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/es/ActionIcon/index.js +2 -2
- package/es/ActionIcon/style.js +1 -1
- package/es/EditableMessageList/index.js +6 -6
- package/es/EditableText/index.js +1 -4
- package/es/Highlighter/style.js +1 -2
- package/es/Icon/index.d.ts +1 -0
- package/es/Icon/index.js +5 -2
- package/es/Input/index.d.ts +13 -0
- package/es/Input/index.js +38 -0
- package/es/Input/style.d.ts +6 -0
- package/es/Input/style.js +12 -0
- package/es/Markdown/style.js +1 -1
- package/es/MessageInput/index.d.ts +2 -0
- package/es/MessageInput/index.js +10 -8
- package/es/SearchBar/index.d.ts +1 -2
- package/es/SearchBar/index.js +9 -18
- package/es/SearchBar/style.d.ts +1 -3
- package/es/SearchBar/style.js +6 -8
- package/es/Snippet/style.js +1 -2
- package/es/StroyBook/style.js +1 -1
- package/es/ThemeProvider/index.d.ts +2 -6
- package/es/ThemeProvider/index.js +8 -18
- package/es/components/ControlInput.d.ts +1 -1
- package/es/components/ControlInput.js +20 -23
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/styles/algorithms/generateColorPalette.d.ts +11 -0
- package/es/styles/algorithms/generateColorPalette.js +31 -0
- package/es/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
- package/es/styles/{customStylish.js → algorithms/generateCustomStylish.js} +1 -1
- package/es/styles/algorithms/generateCustomToken.d.ts +3 -0
- package/es/styles/algorithms/generateCustomToken.js +57 -0
- package/es/styles/algorithms/generateTheme.d.ts +5 -0
- package/es/styles/algorithms/generateTheme.js +18 -0
- package/es/styles/colors.d.ts +38 -0
- package/es/styles/colors.js +176 -0
- package/es/styles/index.d.ts +3 -3
- package/es/styles/index.js +3 -3
- package/es/styles/theme/base.d.ts +2 -2
- package/es/styles/theme/base.js +8 -14
- package/es/styles/theme/dark.d.ts +3 -4
- package/es/styles/theme/dark.js +40 -71
- package/es/styles/theme/light.d.ts +3 -4
- package/es/styles/theme/light.js +41 -32
- package/es/types/customToken.d.ts +1027 -0
- package/es/types/global.d.ts +12 -0
- package/es/types/index.d.ts +5 -17
- package/es/types/index.js +1 -0
- package/lib/ActionIcon/index.js +2 -2
- package/lib/ActionIcon/style.js +2 -2
- package/lib/EditableMessageList/index.js +6 -6
- package/lib/EditableText/index.js +1 -1
- package/lib/Highlighter/style.js +1 -2
- package/lib/Icon/index.d.ts +1 -0
- package/lib/Icon/index.js +5 -2
- package/lib/Input/index.d.ts +13 -0
- package/lib/Input/index.js +45 -0
- package/lib/Input/style.d.ts +6 -0
- package/lib/Input/style.js +70 -0
- package/lib/Markdown/style.js +5 -1
- package/lib/MessageInput/index.d.ts +2 -0
- package/lib/MessageInput/index.js +6 -5
- package/lib/SearchBar/index.d.ts +1 -2
- package/lib/SearchBar/index.js +8 -26
- package/lib/SearchBar/style.d.ts +1 -3
- package/lib/SearchBar/style.js +1 -20
- package/lib/Snippet/style.js +1 -2
- package/lib/StroyBook/style.js +6 -1
- package/lib/ThemeProvider/index.d.ts +2 -6
- package/lib/ThemeProvider/index.js +12 -23
- package/lib/components/ControlInput.d.ts +1 -1
- package/lib/components/ControlInput.js +9 -19
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -0
- package/lib/styles/algorithms/generateColorPalette.d.ts +11 -0
- package/lib/styles/algorithms/generateColorPalette.js +72 -0
- package/lib/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
- package/lib/styles/{customStylish.js → algorithms/generateCustomStylish.js} +11 -7
- package/lib/styles/algorithms/generateCustomToken.d.ts +3 -0
- package/lib/styles/{customToken.js → algorithms/generateCustomToken.js} +42 -17
- package/lib/styles/algorithms/generateTheme.d.ts +5 -0
- package/lib/styles/algorithms/generateTheme.js +59 -0
- package/lib/styles/colors.d.ts +38 -0
- package/lib/styles/colors.js +1828 -0
- package/lib/styles/index.d.ts +3 -3
- package/lib/styles/index.js +18 -4
- package/lib/styles/theme/base.d.ts +2 -2
- package/lib/styles/theme/base.js +10 -16
- package/lib/styles/theme/dark.d.ts +3 -4
- package/lib/styles/theme/dark.js +46 -96
- package/lib/styles/theme/light.d.ts +3 -4
- package/lib/styles/theme/light.js +48 -38
- package/lib/types/customToken.d.ts +1027 -0
- package/lib/types/global.d.ts +12 -0
- package/lib/types/index.d.ts +5 -17
- package/lib/{styles/theme → types}/index.js +3 -18
- package/package.json +1 -1
- package/es/styles/algorithms/colorRelationship.d.ts +0 -6
- package/es/styles/algorithms/colorRelationship.js +0 -88
- package/es/styles/algorithms/index.d.ts +0 -15
- package/es/styles/algorithms/index.js +0 -66
- package/es/styles/algorithms/paletteGenerator.d.ts +0 -51
- package/es/styles/algorithms/paletteGenerator.js +0 -74
- package/es/styles/antdTheme.d.ts +0 -2
- package/es/styles/antdTheme.js +0 -4
- package/es/styles/customToken.d.ts +0 -65
- package/es/styles/customToken.js +0 -24
- package/es/styles/theme/index.d.ts +0 -2
- package/es/styles/theme/index.js +0 -2
- package/lib/styles/algorithms/colorRelationship.d.ts +0 -6
- package/lib/styles/algorithms/colorRelationship.js +0 -87
- package/lib/styles/algorithms/index.d.ts +0 -15
- package/lib/styles/algorithms/index.js +0 -81
- package/lib/styles/algorithms/paletteGenerator.d.ts +0 -51
- package/lib/styles/algorithms/paletteGenerator.js +0 -91
- package/lib/styles/antdTheme.d.ts +0 -2
- package/lib/styles/antdTheme.js +0 -30
- package/lib/styles/customToken.d.ts +0 -65
- package/lib/styles/theme/index.d.ts +0 -2
|
@@ -22,7 +22,9 @@ __export(ControlInput_exports, {
|
|
|
22
22
|
ControlInput: () => ControlInput
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(ControlInput_exports);
|
|
25
|
+
var import__ = require("../index");
|
|
25
26
|
var import_antd = require("antd");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
26
28
|
var import_react = require("react");
|
|
27
29
|
var ControlInput = (0, import_react.memo)(
|
|
28
30
|
({ value, onChange, onValueChanging, onChangeEnd, ...props }) => {
|
|
@@ -38,7 +40,7 @@ var ControlInput = (0, import_react.memo)(
|
|
|
38
40
|
setInput(value);
|
|
39
41
|
}, [value]);
|
|
40
42
|
return /* @__PURE__ */ React.createElement(
|
|
41
|
-
|
|
43
|
+
import__.Input,
|
|
42
44
|
{
|
|
43
45
|
ref: inputRef,
|
|
44
46
|
...props,
|
|
@@ -68,29 +70,17 @@ var ControlInput = (0, import_react.memo)(
|
|
|
68
70
|
onChangeEnd == null ? void 0 : onChangeEnd(input);
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
|
-
suffix: value === input ? /* @__PURE__ */ React.createElement("span", null) : /* @__PURE__ */ React.createElement(import_antd.ConfigProvider, { theme: { token: { fontSize: 14 } } }, /* @__PURE__ */ React.createElement(
|
|
72
|
-
|
|
73
|
+
suffix: value === input ? /* @__PURE__ */ React.createElement("span", null) : /* @__PURE__ */ React.createElement(import_antd.ConfigProvider, { theme: { token: { fontSize: 14 } } }, /* @__PURE__ */ React.createElement(import_antd.Space, { size: 2 }, /* @__PURE__ */ React.createElement(
|
|
74
|
+
import__.ActionIcon,
|
|
73
75
|
{
|
|
74
|
-
|
|
76
|
+
title: "Reset",
|
|
77
|
+
icon: import_lucide_react.RotateCcw,
|
|
75
78
|
size: "small",
|
|
76
79
|
onClick: () => {
|
|
77
80
|
setInput(value);
|
|
78
|
-
},
|
|
79
|
-
style: { padding: 0 }
|
|
80
|
-
},
|
|
81
|
-
"重置"
|
|
82
|
-
), /* @__PURE__ */ React.createElement(
|
|
83
|
-
import_antd.Button,
|
|
84
|
-
{
|
|
85
|
-
type: "link",
|
|
86
|
-
size: "small",
|
|
87
|
-
style: { padding: 0 },
|
|
88
|
-
onClick: () => {
|
|
89
|
-
updateValue();
|
|
90
81
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
))
|
|
82
|
+
}
|
|
83
|
+
), /* @__PURE__ */ React.createElement(import__.ActionIcon, { title: "✅ Save", icon: import_lucide_react.Save, size: "small", onClick: updateValue })))
|
|
94
84
|
}
|
|
95
85
|
);
|
|
96
86
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { default as EditableMessageList, type EditableMessageListProps, } from '
|
|
|
10
10
|
export { default as EditableText, type EditableTextProps } from './EditableText';
|
|
11
11
|
export { default as Highlighter, SyntaxHighlighter, type HighlighterProps, type SyntaxHighlighterProps, } from './Highlighter';
|
|
12
12
|
export { default as Icon, type IconProps, type IconSize } from './Icon';
|
|
13
|
+
export { Input, TextArea, type InputProps, type TextAreaProps } from './Input';
|
|
13
14
|
export { default as List } from './List';
|
|
14
15
|
export { default as Logo, type LogoProps } from './Logo';
|
|
15
16
|
export { default as Markdown, type MarkdownProps } from './Markdown';
|
package/lib/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
EditableText: () => import_EditableText.default,
|
|
41
41
|
Highlighter: () => import_Highlighter.default,
|
|
42
42
|
Icon: () => import_Icon.default,
|
|
43
|
+
Input: () => import_Input.Input,
|
|
43
44
|
List: () => import_List.default,
|
|
44
45
|
Logo: () => import_Logo.default,
|
|
45
46
|
Markdown: () => import_Markdown.default,
|
|
@@ -52,6 +53,7 @@ __export(src_exports, {
|
|
|
52
53
|
Swatches: () => import_Swatches.default,
|
|
53
54
|
SyntaxHighlighter: () => import_Highlighter.SyntaxHighlighter,
|
|
54
55
|
TabsNav: () => import_TabsNav.default,
|
|
56
|
+
TextArea: () => import_Input.TextArea,
|
|
55
57
|
ThemeProvider: () => import_ThemeProvider.default,
|
|
56
58
|
ThemeSwitch: () => import_ThemeSwitch.default,
|
|
57
59
|
Tooltip: () => import_Tooltip.default,
|
|
@@ -70,6 +72,7 @@ var import_EditableMessageList = __toESM(require("./EditableMessageList"));
|
|
|
70
72
|
var import_EditableText = __toESM(require("./EditableText"));
|
|
71
73
|
var import_Highlighter = __toESM(require("./Highlighter"));
|
|
72
74
|
var import_Icon = __toESM(require("./Icon"));
|
|
75
|
+
var import_Input = require("./Input");
|
|
73
76
|
var import_List = __toESM(require("./List"));
|
|
74
77
|
var import_Logo = __toESM(require("./Logo"));
|
|
75
78
|
var import_Markdown = __toESM(require("./Markdown"));
|
|
@@ -97,6 +100,7 @@ var import_Tooltip = __toESM(require("./Tooltip"));
|
|
|
97
100
|
EditableText,
|
|
98
101
|
Highlighter,
|
|
99
102
|
Icon,
|
|
103
|
+
Input,
|
|
100
104
|
List,
|
|
101
105
|
Logo,
|
|
102
106
|
Markdown,
|
|
@@ -109,6 +113,7 @@ var import_Tooltip = __toESM(require("./Tooltip"));
|
|
|
109
113
|
Swatches,
|
|
110
114
|
SyntaxHighlighter,
|
|
111
115
|
TabsNav,
|
|
116
|
+
TextArea,
|
|
112
117
|
ThemeProvider,
|
|
113
118
|
ThemeSwitch,
|
|
114
119
|
Tooltip,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColorScaleItem } from "../colors";
|
|
2
|
+
import { AliasToken } from 'antd/es/theme/interface';
|
|
3
|
+
export declare const generateColorPalette: ({ type, scale, appearance, }: {
|
|
4
|
+
type: 'Primary' | 'Success' | 'Warning' | 'Error' | 'Info' | string;
|
|
5
|
+
scale: ColorScaleItem;
|
|
6
|
+
appearance: 'light' | 'dark';
|
|
7
|
+
}) => Partial<AliasToken>;
|
|
8
|
+
export declare const generateColorNeutralPalette: ({ scale, appearance, }: {
|
|
9
|
+
scale: ColorScaleItem;
|
|
10
|
+
appearance: 'light' | 'dark';
|
|
11
|
+
}) => Partial<AliasToken>;
|
|
@@ -0,0 +1,72 @@
|
|
|
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/generateColorPalette.ts
|
|
20
|
+
var generateColorPalette_exports = {};
|
|
21
|
+
__export(generateColorPalette_exports, {
|
|
22
|
+
generateColorNeutralPalette: () => generateColorNeutralPalette,
|
|
23
|
+
generateColorPalette: () => generateColorPalette
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(generateColorPalette_exports);
|
|
26
|
+
var import_lodash = require("lodash");
|
|
27
|
+
var generateColorPalette = ({
|
|
28
|
+
type,
|
|
29
|
+
scale,
|
|
30
|
+
appearance
|
|
31
|
+
}) => {
|
|
32
|
+
const name = (0, import_lodash.capitalize)(type);
|
|
33
|
+
return {
|
|
34
|
+
[`color${name}Bg`]: scale[appearance][1],
|
|
35
|
+
[`color${name}BgHover`]: scale[appearance][2],
|
|
36
|
+
[`color${name}Border`]: scale[appearance][4],
|
|
37
|
+
[`color${name}BorderHover`]: scale[appearance][5],
|
|
38
|
+
[`color${name}Hover`]: scale[appearance][10],
|
|
39
|
+
[`color${name}`]: scale[appearance][9],
|
|
40
|
+
[`color${name}Active`]: scale[appearance][7],
|
|
41
|
+
[`color${name}TextHover`]: scale[appearance][10],
|
|
42
|
+
[`color${name}Text`]: scale[appearance][9],
|
|
43
|
+
[`color${name}Active`]: scale[appearance][7]
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
var generateColorNeutralPalette = ({
|
|
47
|
+
scale,
|
|
48
|
+
appearance
|
|
49
|
+
}) => {
|
|
50
|
+
return {
|
|
51
|
+
colorText: scale[appearance][12],
|
|
52
|
+
colorTextSecondary: scale[appearance][10],
|
|
53
|
+
colorTextTertiary: scale[appearance][8],
|
|
54
|
+
colorTextQuaternary: scale[appearance][6],
|
|
55
|
+
colorBorder: scale[`${appearance}A`][4],
|
|
56
|
+
colorBorderSecondary: scale[`${appearance}A`][3],
|
|
57
|
+
colorFill: scale[`${appearance}A`][3],
|
|
58
|
+
colorFillSecondary: scale[`${appearance}A`][2],
|
|
59
|
+
colorFillTertiary: scale[`${appearance}A`][1],
|
|
60
|
+
colorFillQuaternary: scale[`${appearance}A`][0],
|
|
61
|
+
colorBgContainer: appearance === "dark" ? scale[appearance][1] : scale[appearance][0],
|
|
62
|
+
colorBgElevated: appearance === "dark" ? scale[appearance][2] : scale[appearance][0],
|
|
63
|
+
colorBgLayout: appearance === "dark" ? scale[appearance][0] : scale[appearance][1],
|
|
64
|
+
colorBgSpotlight: scale[appearance][5],
|
|
65
|
+
colorBgMask: scale.lightA[8]
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
generateColorNeutralPalette,
|
|
71
|
+
generateColorPalette
|
|
72
|
+
});
|
|
@@ -16,14 +16,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// src/styles/
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
|
|
19
|
+
// src/styles/algorithms/generateCustomStylish.ts
|
|
20
|
+
var generateCustomStylish_exports = {};
|
|
21
|
+
__export(generateCustomStylish_exports, {
|
|
22
|
+
generateCustomStylish: () => generateCustomStylish
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(generateCustomStylish_exports);
|
|
25
25
|
var import_polished = require("polished");
|
|
26
|
-
var
|
|
26
|
+
var generateCustomStylish = ({
|
|
27
|
+
css,
|
|
28
|
+
token,
|
|
29
|
+
isDarkMode
|
|
30
|
+
}) => {
|
|
27
31
|
return {
|
|
28
32
|
clickableText: css`
|
|
29
33
|
cursor: pointer;
|
|
@@ -114,5 +118,5 @@ var getCustomStylish = ({ css, token, isDarkMode }) => {
|
|
|
114
118
|
};
|
|
115
119
|
// Annotate the CommonJS export names for ESM import in node:
|
|
116
120
|
0 && (module.exports = {
|
|
117
|
-
|
|
121
|
+
generateCustomStylish
|
|
118
122
|
});
|
|
@@ -16,39 +16,64 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// src/styles/
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
|
|
19
|
+
// src/styles/algorithms/generateCustomToken.ts
|
|
20
|
+
var generateCustomToken_exports = {};
|
|
21
|
+
__export(generateCustomToken_exports, {
|
|
22
|
+
generateCustomToken: () => generateCustomToken
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
module.exports = __toCommonJS(generateCustomToken_exports);
|
|
25
|
+
var import_colors = require("../colors");
|
|
26
|
+
var import_lodash = require("lodash");
|
|
27
|
+
var import_generateColorPalette = require("./generateColorPalette");
|
|
28
|
+
var generateCustomColorPalette = ({
|
|
29
|
+
type,
|
|
30
|
+
scale,
|
|
31
|
+
appearance
|
|
32
|
+
}) => {
|
|
33
|
+
const name = (0, import_lodash.capitalize)(type);
|
|
34
|
+
const colorStepPalette = {};
|
|
35
|
+
scale[appearance].forEach((color, index) => {
|
|
36
|
+
colorStepPalette[`color${name}${index + 1}`] = color;
|
|
37
|
+
});
|
|
38
|
+
scale[`${appearance}A`].forEach((color, index) => {
|
|
39
|
+
colorStepPalette[`color${name}${index + 1}A`] = color;
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
...colorStepPalette,
|
|
43
|
+
...(0, import_generateColorPalette.generateColorPalette)({ type, scale, appearance })
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
var generateCustomToken = ({
|
|
47
|
+
appearance,
|
|
48
|
+
token,
|
|
49
|
+
isDarkMode
|
|
50
|
+
}) => {
|
|
27
51
|
const gradientColor1 = token.blue;
|
|
28
52
|
const gradientColor2 = isDarkMode ? token.pink : token.cyan;
|
|
29
53
|
const gradientColor3 = token.purple;
|
|
30
54
|
const colorSolid = isDarkMode ? token.colorWhite : "#000";
|
|
31
|
-
|
|
55
|
+
let colorCustomToken = {
|
|
32
56
|
headerHeight: 64,
|
|
33
57
|
footerHeight: 300,
|
|
34
58
|
sidebarWidth: 240,
|
|
35
59
|
tocWidth: 176,
|
|
36
60
|
contentMaxWidth: 1152,
|
|
37
|
-
fontFamilyHighlighter: "'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace",
|
|
38
61
|
colorSolid,
|
|
39
62
|
gradientColor1,
|
|
40
63
|
gradientColor2,
|
|
41
64
|
gradientColor3,
|
|
42
|
-
gradientHeroBgG: `radial-gradient(at 80% 20%, ${gradientColor1} 0%, ${gradientColor2} 80%, ${gradientColor3} 130%)
|
|
43
|
-
gradientIconDefault: `radial-gradient(
|
|
44
|
-
100% 100% at 50% 0,
|
|
45
|
-
${(0, import_polished.rgba)(colorSolid, isDarkMode ? 0.2 : 0.2)} 0,
|
|
46
|
-
${(0, import_polished.rgba)(colorSolid, isDarkMode ? 0.1 : 0.4)} 100%
|
|
47
|
-
)`,
|
|
48
|
-
demoInheritSiteTheme: false
|
|
65
|
+
gradientHeroBgG: `radial-gradient(at 80% 20%, ${gradientColor1} 0%, ${gradientColor2} 80%, ${gradientColor3} 130%)`
|
|
49
66
|
};
|
|
67
|
+
Object.entries(import_colors.colorScales).forEach(([type, scale]) => {
|
|
68
|
+
colorCustomToken = {
|
|
69
|
+
...colorCustomToken,
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
...generateCustomColorPalette({ type, scale, appearance })
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
return colorCustomToken;
|
|
50
75
|
};
|
|
51
76
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
77
|
0 && (module.exports = {
|
|
53
|
-
|
|
78
|
+
generateCustomToken
|
|
54
79
|
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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/generateTheme.ts
|
|
30
|
+
var generateTheme_exports = {};
|
|
31
|
+
__export(generateTheme_exports, {
|
|
32
|
+
darkTheme: () => darkTheme,
|
|
33
|
+
generateTheme: () => generateTheme,
|
|
34
|
+
lightTheme: () => lightTheme
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(generateTheme_exports);
|
|
37
|
+
var import_dark = __toESM(require("../theme/dark"));
|
|
38
|
+
var import_light = __toESM(require("../theme/light"));
|
|
39
|
+
var lightTheme = {
|
|
40
|
+
token: import_light.default,
|
|
41
|
+
algorithm: (seedToken, mapToken) => ({
|
|
42
|
+
...mapToken,
|
|
43
|
+
...import_light.default
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
var darkTheme = {
|
|
47
|
+
token: import_dark.default,
|
|
48
|
+
algorithm: (seedToken, mapToken) => ({
|
|
49
|
+
...mapToken,
|
|
50
|
+
...import_dark.default
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
var generateTheme = (appearance) => appearance === "dark" ? darkTheme : lightTheme;
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
darkTheme,
|
|
57
|
+
generateTheme,
|
|
58
|
+
lightTheme
|
|
59
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ColorScaleItem {
|
|
2
|
+
light: string[];
|
|
3
|
+
lightA: string[];
|
|
4
|
+
dark: string[];
|
|
5
|
+
darkA: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ColorScales {
|
|
8
|
+
tomato: ColorScaleItem;
|
|
9
|
+
red: ColorScaleItem;
|
|
10
|
+
crimson: ColorScaleItem;
|
|
11
|
+
pink: ColorScaleItem;
|
|
12
|
+
plum: ColorScaleItem;
|
|
13
|
+
purple: ColorScaleItem;
|
|
14
|
+
violet: ColorScaleItem;
|
|
15
|
+
indigo: ColorScaleItem;
|
|
16
|
+
blue: ColorScaleItem;
|
|
17
|
+
cyan: ColorScaleItem;
|
|
18
|
+
teal: ColorScaleItem;
|
|
19
|
+
green: ColorScaleItem;
|
|
20
|
+
grass: ColorScaleItem;
|
|
21
|
+
orange: ColorScaleItem;
|
|
22
|
+
brown: ColorScaleItem;
|
|
23
|
+
sky: ColorScaleItem;
|
|
24
|
+
mint: ColorScaleItem;
|
|
25
|
+
lime: ColorScaleItem;
|
|
26
|
+
yellow: ColorScaleItem;
|
|
27
|
+
amber: ColorScaleItem;
|
|
28
|
+
bronze: ColorScaleItem;
|
|
29
|
+
gold: ColorScaleItem;
|
|
30
|
+
gray: ColorScaleItem;
|
|
31
|
+
mauve: ColorScaleItem;
|
|
32
|
+
slate: ColorScaleItem;
|
|
33
|
+
sage: ColorScaleItem;
|
|
34
|
+
olive: ColorScaleItem;
|
|
35
|
+
sand: ColorScaleItem;
|
|
36
|
+
bnw: ColorScaleItem;
|
|
37
|
+
}
|
|
38
|
+
export declare const colorScales: ColorScales;
|