@lobehub/ui 1.11.4 → 1.12.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/ColorScales/ScaleRow.d.ts +7 -0
- package/es/ColorScales/ScaleRow.js +56 -0
- package/es/ColorScales/index.d.ts +8 -0
- package/es/ColorScales/index.js +59 -0
- package/es/ColorScales/style.d.ts +11 -0
- package/es/ColorScales/style.js +17 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/styles/algorithms/generateColorPalette.js +3 -3
- package/es/styles/algorithms/generateCustomStylish.d.ts +2 -16
- package/es/styles/algorithms/generateCustomStylish.js +5 -7
- package/es/styles/algorithms/generateCustomToken.js +30 -29
- package/es/types/customStylish.d.ts +13 -0
- package/es/types/customToken.d.ts +68 -1015
- package/es/types/global.d.ts +5 -2
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Space, message } from 'antd';
|
|
2
|
+
import copy from 'copy-to-clipboard';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { alphaBg, useStyles } from "./style";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
var ScaleRow = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
+
var title = _ref.title,
|
|
9
|
+
scale = _ref.scale;
|
|
10
|
+
var _useStyles = useStyles(),
|
|
11
|
+
styles = _useStyles.styles;
|
|
12
|
+
var style = {};
|
|
13
|
+
switch (title) {
|
|
14
|
+
case 'lightA':
|
|
15
|
+
style = {
|
|
16
|
+
backgroundColor: '#fff',
|
|
17
|
+
background: alphaBg.light
|
|
18
|
+
};
|
|
19
|
+
break;
|
|
20
|
+
case 'darkA':
|
|
21
|
+
style = {
|
|
22
|
+
backgroundColor: '#000',
|
|
23
|
+
background: alphaBg.dark
|
|
24
|
+
};
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
30
|
+
size: 2,
|
|
31
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
32
|
+
className: styles.scaleRowTitle,
|
|
33
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: styles.text,
|
|
35
|
+
children: title
|
|
36
|
+
})
|
|
37
|
+
}, title), scale.map(function (color, index) {
|
|
38
|
+
return /*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: styles.scaleBox,
|
|
40
|
+
title: color,
|
|
41
|
+
style: style,
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
copy(color);
|
|
44
|
+
message.success(color);
|
|
45
|
+
},
|
|
46
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
47
|
+
className: styles.scaleItem,
|
|
48
|
+
style: {
|
|
49
|
+
backgroundColor: color
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
}, index);
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export default ScaleRow;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorScaleItem } from "../styles/colors";
|
|
3
|
+
export interface ColorScalesProps {
|
|
4
|
+
scale: ColorScaleItem;
|
|
5
|
+
midHighLight: number;
|
|
6
|
+
}
|
|
7
|
+
declare const ColorScales: import("react").NamedExoticComponent<ColorScalesProps>;
|
|
8
|
+
export default ColorScales;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Space } from 'antd';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import ScaleRow from "./ScaleRow";
|
|
4
|
+
import { useStyles } from "./style";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
var ColorScales = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
+
var scale = _ref.scale,
|
|
9
|
+
midHighLight = _ref.midHighLight;
|
|
10
|
+
var _useStyles = useStyles(),
|
|
11
|
+
styles = _useStyles.styles;
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: styles.view,
|
|
14
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
15
|
+
style: {
|
|
16
|
+
padding: '8px 16px 32px 0'
|
|
17
|
+
},
|
|
18
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
19
|
+
direction: 'vertical',
|
|
20
|
+
size: 2,
|
|
21
|
+
children: [/*#__PURE__*/_jsxs(Space, {
|
|
22
|
+
size: 2,
|
|
23
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
24
|
+
className: styles.scaleRowTitle
|
|
25
|
+
}, "scale-num"), new Array(scale.light.length).fill('').map(function (_, index) {
|
|
26
|
+
var isMidHighlight = midHighLight === index;
|
|
27
|
+
return /*#__PURE__*/_jsx("div", {
|
|
28
|
+
className: styles.scaleBox,
|
|
29
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
30
|
+
className: styles.scaleBox,
|
|
31
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
32
|
+
className: styles.scaleItem,
|
|
33
|
+
style: {
|
|
34
|
+
opacity: 0.5,
|
|
35
|
+
fontWeight: isMidHighlight ? 700 : 400
|
|
36
|
+
},
|
|
37
|
+
children: index + 1
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
}, 'num' + index);
|
|
41
|
+
})]
|
|
42
|
+
}, "scale-title"), /*#__PURE__*/_jsx(ScaleRow, {
|
|
43
|
+
title: "light",
|
|
44
|
+
scale: scale.light
|
|
45
|
+
}, "light"), /*#__PURE__*/_jsx(ScaleRow, {
|
|
46
|
+
title: "lightA",
|
|
47
|
+
scale: scale.lightA
|
|
48
|
+
}, "lightA"), /*#__PURE__*/_jsx(ScaleRow, {
|
|
49
|
+
title: "dark",
|
|
50
|
+
scale: scale.dark
|
|
51
|
+
}, "dark"), /*#__PURE__*/_jsx(ScaleRow, {
|
|
52
|
+
title: "darkA",
|
|
53
|
+
scale: scale.darkA
|
|
54
|
+
}, "darkA")]
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
export default ColorScales;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const alphaBg: {
|
|
2
|
+
light: string;
|
|
3
|
+
dark: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
6
|
+
view: import("antd-style").SerializedStyles;
|
|
7
|
+
scaleBox: import("antd-style").SerializedStyles;
|
|
8
|
+
scaleItem: import("antd-style").SerializedStyles;
|
|
9
|
+
scaleRowTitle: import("antd-style").SerializedStyles;
|
|
10
|
+
text: import("antd-style").SerializedStyles;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var alphaBg = {
|
|
5
|
+
light: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAFpJREFUWAntljEKADAIA23p6v//qQ+wfUEcCu1yriEgp0FHRJSJcnehmmWm1Dv/lO4HIg1AAAKjTqm03ea88zMCCEDgO4HV5bS757f+7wRoAAIQ4B9gByAAgQ3pfiDmXmAeEwAAAABJRU5ErkJggg==) 0% 0% / 26px',
|
|
6
|
+
dark: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACPTkDJAAAAZUlEQVRIDe2VMQoAMAgDa9/g/1/oIzrpZBCh2dLFkkoDF0Fz99OdiOjks+2/7S8fRRmMMIVoRGSoYzvvqF8ZIMKlC1GhQBc6IkPzq32QmdAzkEGihpWOSPsAss8HegYySNSw0hE9WQ4StafZFqkAAAAASUVORK5CYII=) 0% 0% / 26px'
|
|
7
|
+
};
|
|
8
|
+
export var useStyles = createStyles(function (_ref) {
|
|
9
|
+
var css = _ref.css;
|
|
10
|
+
return {
|
|
11
|
+
view: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n "]))),
|
|
12
|
+
scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n &:active {\n transform: scale(0.95);\n }\n "]))),
|
|
13
|
+
scaleItem: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
|
|
14
|
+
scaleRowTitle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
|
|
15
|
+
text: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "])))
|
|
16
|
+
};
|
|
17
|
+
});
|
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
|
|
2
2
|
export { default as Avatar, type AvatarProps } from './Avatar';
|
|
3
3
|
export type { ChatMessage } from './Chat';
|
|
4
|
+
export { default as ColorScales, type ColorScalesProps } from './ColorScales';
|
|
4
5
|
export { default as ContextMenu, type ContextMenuProps } from './ContextMenu';
|
|
5
6
|
export { default as Conversation, type ConversationProps } from './Conversation';
|
|
6
7
|
export { default as CopyButton, type CopyButtonProps } from './CopyButton';
|
|
@@ -25,3 +26,4 @@ export { default as TabsNav, type TabsNavProps } from './TabsNav';
|
|
|
25
26
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
26
27
|
export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
|
|
27
28
|
export { default as Tooltip, type TooltipProps } from './Tooltip';
|
|
29
|
+
export { colorScales as colors } from './styles/colors';
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ActionIcon } from "./ActionIcon";
|
|
2
2
|
export { default as Avatar } from "./Avatar";
|
|
3
|
+
export { default as ColorScales } from "./ColorScales";
|
|
3
4
|
export { default as ContextMenu } from "./ContextMenu";
|
|
4
5
|
export { default as Conversation } from "./Conversation";
|
|
5
6
|
export { default as CopyButton } from "./CopyButton";
|
|
@@ -23,4 +24,5 @@ export { default as Swatches } from "./Swatches";
|
|
|
23
24
|
export { default as TabsNav } from "./TabsNav";
|
|
24
25
|
export { default as ThemeProvider } from "./ThemeProvider";
|
|
25
26
|
export { default as ThemeSwitch } from "./ThemeSwitch";
|
|
26
|
-
export { default as Tooltip } from "./Tooltip";
|
|
27
|
+
export { default as Tooltip } from "./Tooltip";
|
|
28
|
+
export { colorScales as colors } from "./styles/colors";
|
|
@@ -6,7 +6,7 @@ export var generateColorPalette = function generateColorPalette(_ref) {
|
|
|
6
6
|
scale = _ref.scale,
|
|
7
7
|
appearance = _ref.appearance;
|
|
8
8
|
var name = capitalize(type);
|
|
9
|
-
return _ref2 = {}, _defineProperty(_ref2, "color".concat(name, "Bg"), scale[appearance][1]), _defineProperty(_ref2, "color".concat(name, "BgHover"), scale[appearance][2]), _defineProperty(_ref2, "color".concat(name, "Border"), scale[appearance][4]), _defineProperty(_ref2, "color".concat(name, "BorderHover"), scale[appearance][5]), _defineProperty(_ref2, "color".concat(name, "Hover"), scale[appearance][10]), _defineProperty(_ref2, "color".concat(name), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "Active"), scale[appearance][7]), _defineProperty(_ref2, "color".concat(name, "TextHover"), scale[appearance][10]), _defineProperty(_ref2, "color".concat(name, "Text"), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "
|
|
9
|
+
return _ref2 = {}, _defineProperty(_ref2, "color".concat(name, "Bg"), scale[appearance][1]), _defineProperty(_ref2, "color".concat(name, "BgHover"), scale[appearance][2]), _defineProperty(_ref2, "color".concat(name, "Border"), scale[appearance][4]), _defineProperty(_ref2, "color".concat(name, "BorderHover"), scale[appearance][5]), _defineProperty(_ref2, "color".concat(name, "Hover"), scale[appearance][10]), _defineProperty(_ref2, "color".concat(name), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "Active"), scale[appearance][7]), _defineProperty(_ref2, "color".concat(name, "TextHover"), scale[appearance][10]), _defineProperty(_ref2, "color".concat(name, "Text"), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "TextActive"), scale[appearance][7]), _ref2;
|
|
10
10
|
};
|
|
11
11
|
export var generateColorNeutralPalette = function generateColorNeutralPalette(_ref3) {
|
|
12
12
|
var scale = _ref3.scale,
|
|
@@ -16,8 +16,8 @@ export var generateColorNeutralPalette = function generateColorNeutralPalette(_r
|
|
|
16
16
|
colorTextSecondary: scale[appearance][10],
|
|
17
17
|
colorTextTertiary: scale[appearance][8],
|
|
18
18
|
colorTextQuaternary: scale[appearance][6],
|
|
19
|
-
colorBorder: scale[
|
|
20
|
-
colorBorderSecondary: scale[
|
|
19
|
+
colorBorder: scale[appearance][4],
|
|
20
|
+
colorBorderSecondary: scale[appearance][3],
|
|
21
21
|
colorFill: scale["".concat(appearance, "A")][3],
|
|
22
22
|
colorFillSecondary: scale["".concat(appearance, "A")][2],
|
|
23
23
|
colorFillTertiary: scale["".concat(appearance, "A")][1],
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
+
import { LobeCustomStylish } from "../../types/customStylish";
|
|
1
2
|
import { GetCustomStylish } from 'antd-style';
|
|
2
|
-
declare
|
|
3
|
-
interface CustomStylish extends SiteStylish {
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
export interface SiteStylish {
|
|
7
|
-
clickableText: string;
|
|
8
|
-
resetLinkColor: string;
|
|
9
|
-
heroButtonGradient: string;
|
|
10
|
-
heroGradient: string;
|
|
11
|
-
heroTextShadow: string;
|
|
12
|
-
heroGradientFlow: string;
|
|
13
|
-
heroBlurBall: string;
|
|
14
|
-
iconGradientDefault: string;
|
|
15
|
-
blur: string;
|
|
16
|
-
}
|
|
17
|
-
export declare const generateCustomStylish: GetCustomStylish<SiteStylish>;
|
|
3
|
+
export declare const generateCustomStylish: GetCustomStylish<LobeCustomStylish>;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
3
|
import { rgba } from 'polished';
|
|
4
4
|
export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
|
-
token = _ref.token
|
|
7
|
-
isDarkMode = _ref.isDarkMode;
|
|
6
|
+
token = _ref.token;
|
|
8
7
|
return {
|
|
9
8
|
clickableText: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText),
|
|
10
9
|
resetLinkColor: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: inherit;\n\n &:hover,\n &:active {\n color: inherit;\n }\n "]))),
|
|
11
10
|
heroButtonGradient: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: linear-gradient(90deg, ", " 0%, ", " 100%);\n "])), token.gradientColor1, token.gradientColor2),
|
|
12
11
|
heroGradient: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-image: ", ";\n background-size: 300% 300%;\n "])), token.gradientHeroBgG),
|
|
13
12
|
heroGradientFlow: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n animation: flow 5s ease infinite;\n\n @keyframes flow {\n 0% {\n background-position: 0 0;\n }\n\n 50% {\n background-position: 100% 100%;\n }\n\n 100% {\n background-position: 0 0;\n }\n }\n "]))),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
blur: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n backdrop-filter: blur(7px);\n "])))
|
|
13
|
+
heroBlurBall: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n will-change: transform;\n\n background: linear-gradient(\n 135deg,\n ", " 0%,\n ", " 30%,\n ", " 70%,\n ", " 100%\n );\n background-size: 200% 200%;\n filter: blur(69px);\n\n animation: glow 10s ease infinite;\n\n @keyframes glow {\n 0% {\n background-position: 0 -100%;\n }\n\n 50% {\n background-position: 200% 50%;\n }\n\n 100% {\n background-position: 0 -100%;\n }\n }\n "])), token.gradientColor3, token.gradientColor1, token.red, token.cyan),
|
|
14
|
+
iconGradientDefault: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-image: radial-gradient(\n 100% 100% at 50% 0,\n ", " 0,\n ", " 100%\n );\n "])), rgba(token.colorSolid, 0.2), rgba(token.colorSolid, 0.1)),
|
|
15
|
+
blur: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n backdrop-filter: blur(7px);\n "])))
|
|
18
16
|
};
|
|
19
17
|
};
|
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
4
|
import { colorScales } from "../colors";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
scale = _ref.scale,
|
|
5
|
+
import { camelCase } from 'lodash';
|
|
6
|
+
var generateColorPalette = function generateColorPalette(_ref) {
|
|
7
|
+
var _ref2;
|
|
8
|
+
var scale = _ref.scale,
|
|
9
9
|
appearance = _ref.appearance;
|
|
10
|
-
|
|
10
|
+
return _ref2 = {}, _defineProperty(_ref2, "colorBg", scale[appearance][1]), _defineProperty(_ref2, "colorBgHover", scale[appearance][2]), _defineProperty(_ref2, "colorBorder", scale[appearance][4]), _defineProperty(_ref2, "colorBorderHover", scale[appearance][5]), _defineProperty(_ref2, "colorHover", scale[appearance][10]), _defineProperty(_ref2, "color", scale[appearance][9]), _defineProperty(_ref2, "colorActive", scale[appearance][7]), _defineProperty(_ref2, "colorTextHover", scale[appearance][10]), _defineProperty(_ref2, "colorText", scale[appearance][9]), _defineProperty(_ref2, "colorTextActive", scale[appearance][7]), _ref2;
|
|
11
|
+
};
|
|
12
|
+
var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
|
|
13
|
+
var scale = _ref3.scale,
|
|
14
|
+
appearance = _ref3.appearance;
|
|
11
15
|
var colorStepPalette = {};
|
|
12
16
|
scale[appearance].forEach(function (color, index) {
|
|
13
|
-
colorStepPalette["color".concat(
|
|
17
|
+
colorStepPalette["color".concat(index + 1)] = color;
|
|
14
18
|
});
|
|
15
19
|
scale["".concat(appearance, "A")].forEach(function (color, index) {
|
|
16
|
-
colorStepPalette["color".concat(
|
|
20
|
+
colorStepPalette["color".concat(index + 1, "A")] = color;
|
|
17
21
|
});
|
|
18
22
|
return _objectSpread(_objectSpread({}, colorStepPalette), generateColorPalette({
|
|
19
|
-
type: type,
|
|
20
23
|
scale: scale,
|
|
21
24
|
appearance: appearance
|
|
22
25
|
}));
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
// @ts-ignore
|
|
26
|
-
export var generateCustomToken = function generateCustomToken(
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
30
|
+
var token = _ref4.token,
|
|
31
|
+
isDarkMode = _ref4.isDarkMode;
|
|
32
|
+
var colorCustomToken = {};
|
|
33
|
+
Object.entries(colorScales).forEach(function (_ref5) {
|
|
34
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
35
|
+
type = _ref6[0],
|
|
36
|
+
scale = _ref6[1];
|
|
37
|
+
colorCustomToken[camelCase(type)] = generateCustomColorPalette({
|
|
38
|
+
scale: scale,
|
|
39
|
+
appearance: isDarkMode ? 'dark' : 'light'
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
var gradientColor1 = colorScales.blue.darkA[8];
|
|
43
|
+
var gradientColor2 = isDarkMode ? colorScales.pink.darkA[8] : colorScales.cyan.darkA[8];
|
|
44
|
+
var gradientColor3 = colorScales.purple.darkA[8];
|
|
45
|
+
var colorSolid = isDarkMode ? '#fff' : '#000';
|
|
46
|
+
return _objectSpread(_objectSpread(_objectSpread({}, token), colorCustomToken), {}, {
|
|
35
47
|
headerHeight: 64,
|
|
36
48
|
footerHeight: 300,
|
|
37
49
|
sidebarWidth: 240,
|
|
@@ -42,16 +54,5 @@ export var generateCustomToken = function generateCustomToken(_ref2) {
|
|
|
42
54
|
gradientColor2: gradientColor2,
|
|
43
55
|
gradientColor3: gradientColor3,
|
|
44
56
|
gradientHeroBgG: "radial-gradient(at 80% 20%, ".concat(gradientColor1, " 0%, ").concat(gradientColor2, " 80%, ").concat(gradientColor3, " 130%)")
|
|
45
|
-
};
|
|
46
|
-
Object.entries(colorScales).forEach(function (_ref3) {
|
|
47
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
48
|
-
type = _ref4[0],
|
|
49
|
-
scale = _ref4[1];
|
|
50
|
-
colorCustomToken = _objectSpread(_objectSpread({}, colorCustomToken), generateCustomColorPalette({
|
|
51
|
-
type: type,
|
|
52
|
-
scale: scale,
|
|
53
|
-
appearance: appearance
|
|
54
|
-
}));
|
|
55
57
|
});
|
|
56
|
-
return colorCustomToken;
|
|
57
58
|
};
|