@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
package/es/ActionIcon/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
36
|
borderRadius = 5;
|
|
37
37
|
break;
|
|
38
38
|
case 'small':
|
|
39
|
-
blockSize =
|
|
39
|
+
blockSize = 24;
|
|
40
40
|
borderRadius = 5;
|
|
41
41
|
break;
|
|
42
42
|
case 'site':
|
|
@@ -57,7 +57,7 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
57
57
|
}, style)
|
|
58
58
|
}, props), {}, {
|
|
59
59
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
60
|
-
size: size === 'site' ? '
|
|
60
|
+
size: size === 'site' ? 'normal' : size,
|
|
61
61
|
icon: icon
|
|
62
62
|
})
|
|
63
63
|
}));
|
package/es/ActionIcon/style.js
CHANGED
|
@@ -7,6 +7,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
7
7
|
var active = _ref2.active,
|
|
8
8
|
glass = _ref2.glass;
|
|
9
9
|
return {
|
|
10
|
-
block: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n ", "\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.
|
|
10
|
+
block: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n ", "\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, glass && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))), token.colorText, token.colorFillSecondary, token.colorText, token.colorFill)
|
|
11
11
|
};
|
|
12
12
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import IconAction from "../ActionIcon";
|
|
3
|
+
import { messagesReducer } from "../Chat";
|
|
4
|
+
import { ControlInput } from "../components/ControlInput";
|
|
2
5
|
import { PlusOutlined } from '@ant-design/icons';
|
|
3
6
|
import { Button, Select } from 'antd';
|
|
4
7
|
import isEqual from 'fast-deep-equal';
|
|
8
|
+
import { TrashIcon } from 'lucide-react';
|
|
5
9
|
import { memo, useEffect, useReducer } from 'react';
|
|
6
10
|
import { Flexbox } from 'react-layout-kit';
|
|
7
|
-
import IconAction from "../ActionIcon";
|
|
8
|
-
import { messagesReducer } from "../Chat";
|
|
9
|
-
import { ControlInput } from "../components/ControlInput";
|
|
10
|
-
import { TrashIcon } from 'lucide-react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
@@ -70,8 +70,8 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
70
70
|
placeholder: item.role === 'user' ? '请填入输入的样例内容' : '请填入输出的样例'
|
|
71
71
|
}), /*#__PURE__*/_jsx(IconAction, {
|
|
72
72
|
icon: TrashIcon,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
placement: "right",
|
|
74
|
+
title: "Delete",
|
|
75
75
|
onClick: function onClick() {
|
|
76
76
|
dispatch({
|
|
77
77
|
type: 'deleteMessage',
|
package/es/EditableText/index.js
CHANGED
package/es/Highlighter/style.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
|
-
import { rgba } from 'polished';
|
|
5
4
|
export var useStyles = createStyles(function (_ref, type) {
|
|
6
5
|
var token = _ref.token,
|
|
7
6
|
css = _ref.css,
|
|
@@ -11,7 +10,7 @@ export var useStyles = createStyles(function (_ref, type) {
|
|
|
11
10
|
var buttonHoverCls = "".concat(prefix, "-hover-btn");
|
|
12
11
|
var langHoverCls = "".concat(prefix, "-hover-lang");
|
|
13
12
|
return {
|
|
14
|
-
container: cx(prefix, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: auto;\n\n background-color: ", ";\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n ", "\n &:hover {\n background-color: ", ";\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), type === 'block' ?
|
|
13
|
+
container: cx(prefix, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: auto;\n\n background-color: ", ";\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n ", "\n &:hover {\n background-color: ", ";\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', token.borderRadius, token.motionEaseOut, type === 'ghost' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), type === 'prue' ? 'transparent' : token.colorFillTertiary, buttonHoverCls, langHoverCls, type === 'prue' ? 0 : "16px 24px")),
|
|
15
14
|
button: cx(buttonHoverCls, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 51;\n top: 8px;\n right: 8px;\n\n opacity: 0;\n "])))),
|
|
16
15
|
lang: cx(langHoverCls, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 50;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n\n opacity: 0;\n\n transition: opacity 0.1s;\n "])), token.colorTextPlaceholder))
|
|
17
16
|
};
|
package/es/Icon/index.d.ts
CHANGED
package/es/Icon/index.js
CHANGED
|
@@ -13,12 +13,15 @@ var Icon = function Icon(_ref) {
|
|
|
13
13
|
var SvgIcon = icon;
|
|
14
14
|
switch (size) {
|
|
15
15
|
case 'large':
|
|
16
|
-
case 'normal':
|
|
17
16
|
fontSize = 24;
|
|
18
17
|
strokeWidth = 2;
|
|
19
18
|
break;
|
|
20
|
-
case '
|
|
19
|
+
case 'normal':
|
|
21
20
|
fontSize = 20;
|
|
21
|
+
strokeWidth = 2;
|
|
22
|
+
break;
|
|
23
|
+
case 'small':
|
|
24
|
+
fontSize = 14;
|
|
22
25
|
strokeWidth = 1.5;
|
|
23
26
|
break;
|
|
24
27
|
default:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps as AntdInputProps } from 'antd';
|
|
3
|
+
import { TextAreaProps as AntdTextAreaProps } from 'antd/es/input/TextArea';
|
|
4
|
+
export interface InputProps extends AntdInputProps {
|
|
5
|
+
ref?: any;
|
|
6
|
+
type?: 'ghost' | 'block';
|
|
7
|
+
}
|
|
8
|
+
export declare const Input: import("react").NamedExoticComponent<InputProps>;
|
|
9
|
+
export interface TextAreaProps extends AntdTextAreaProps {
|
|
10
|
+
ref?: any;
|
|
11
|
+
type?: 'ghost' | 'block';
|
|
12
|
+
}
|
|
13
|
+
export declare const TextArea: import("react").NamedExoticComponent<TextAreaProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "type"],
|
|
4
|
+
_excluded2 = ["className", "type"];
|
|
5
|
+
import { Input as AntInput } from 'antd';
|
|
6
|
+
import { forwardRef, memo } from 'react';
|
|
7
|
+
import { useStyles } from "./style";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export var Input = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
|
+
var className = _ref.className,
|
|
11
|
+
_ref$type = _ref.type,
|
|
12
|
+
type = _ref$type === void 0 ? 'ghost' : _ref$type,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
var _useStyles = useStyles({
|
|
15
|
+
type: type
|
|
16
|
+
}),
|
|
17
|
+
styles = _useStyles.styles,
|
|
18
|
+
cx = _useStyles.cx;
|
|
19
|
+
return /*#__PURE__*/_jsx(AntInput, _objectSpread({
|
|
20
|
+
ref: ref,
|
|
21
|
+
className: cx(styles.input, className)
|
|
22
|
+
}, props));
|
|
23
|
+
}));
|
|
24
|
+
export var TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
25
|
+
var className = _ref2.className,
|
|
26
|
+
_ref2$type = _ref2.type,
|
|
27
|
+
type = _ref2$type === void 0 ? 'ghost' : _ref2$type,
|
|
28
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
29
|
+
var _useStyles2 = useStyles({
|
|
30
|
+
type: type
|
|
31
|
+
}),
|
|
32
|
+
styles = _useStyles2.styles,
|
|
33
|
+
cx = _useStyles2.cx;
|
|
34
|
+
return /*#__PURE__*/_jsx(AntInput.TextArea, _objectSpread({
|
|
35
|
+
ref: ref,
|
|
36
|
+
className: cx(styles.textarea, className)
|
|
37
|
+
}, props));
|
|
38
|
+
}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token;
|
|
7
|
+
var type = _ref2.type;
|
|
8
|
+
return {
|
|
9
|
+
input: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n height: 36px;\n padding: 0 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n\n transition: background-color 100ms ", ";\n\n input {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, token.motionEaseOut, token.colorFillTertiary),
|
|
10
|
+
textarea: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n padding: 8px 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n\n transition: background-color 100ms ", ";\n\n textarea {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, token.motionEaseOut, token.colorFillTertiary)
|
|
11
|
+
};
|
|
12
|
+
});
|
package/es/Markdown/style.js
CHANGED
|
@@ -6,7 +6,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
6
6
|
token = _ref.token,
|
|
7
7
|
isDarkMode = _ref.isDarkMode;
|
|
8
8
|
return {
|
|
9
|
-
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n color: ", ";\n background: ", ";\n border-radius: 4px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, isDarkMode ? token['cyan-7'] : token.colorPrimaryText, isDarkMode ? token['cyan-1'] : token.colorPrimaryBg, token.
|
|
9
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n color: ", ";\n background: ", ";\n border-radius: 4px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n\n pre {\n border-radius: ", "px;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, isDarkMode ? token['cyan-7'] : token.colorPrimaryText, isDarkMode ? token['cyan-1'] : token.colorPrimaryBg, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius),
|
|
10
10
|
code: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 2px 4px;\n font-family: ", " !important;\n color: ", ";\n border-radius: 4px;\n "])), token.fontFamilyCode, isDarkMode ? token.cyan8 : token.pink7)
|
|
11
11
|
};
|
|
12
12
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type TextAreaProps } from "../index";
|
|
2
3
|
import { ButtonProps } from 'antd';
|
|
3
4
|
/**
|
|
4
5
|
* @title MessageInputProps
|
|
@@ -30,6 +31,7 @@ export interface MessageInputProps {
|
|
|
30
31
|
renderButtons?: (text: string) => ButtonProps[];
|
|
31
32
|
height?: number;
|
|
32
33
|
className?: string;
|
|
34
|
+
type?: TextAreaProps['type'];
|
|
33
35
|
}
|
|
34
36
|
declare const MessageInput: import("react").NamedExoticComponent<MessageInputProps>;
|
|
35
37
|
export default MessageInput;
|
package/es/MessageInput/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import {
|
|
3
|
+
import { TextArea } from "./..";
|
|
4
|
+
import { Button } from 'antd';
|
|
4
5
|
import { cx } from 'antd-style';
|
|
5
6
|
import { memo, useState } from 'react';
|
|
6
7
|
import { Flexbox } from 'react-layout-kit';
|
|
@@ -14,7 +15,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
17
|
-
var
|
|
18
|
+
var type = _ref.type,
|
|
19
|
+
onCancel = _ref.onCancel,
|
|
18
20
|
defaultValue = _ref.defaultValue,
|
|
19
21
|
onConfirm = _ref.onConfirm,
|
|
20
22
|
renderButtons = _ref.renderButtons,
|
|
@@ -26,9 +28,9 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
28
|
setRole = _useState2[1];
|
|
27
29
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
28
30
|
gap: 8,
|
|
29
|
-
children: [/*#__PURE__*/_jsx(
|
|
31
|
+
children: [/*#__PURE__*/_jsx(TextArea, {
|
|
32
|
+
type: type,
|
|
30
33
|
value: tempSystemRole,
|
|
31
|
-
allowClear: true,
|
|
32
34
|
placeholder: '例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。',
|
|
33
35
|
style: {
|
|
34
36
|
height: height !== null && height !== void 0 ? height : 200
|
|
@@ -44,15 +46,15 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
44
46
|
return /*#__PURE__*/_jsx(Button, _objectSpread({}, buttonProps), index);
|
|
45
47
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
48
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
47
|
-
type:
|
|
49
|
+
type: "primary",
|
|
48
50
|
onClick: function onClick() {
|
|
49
51
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(tempSystemRole);
|
|
50
52
|
},
|
|
51
|
-
children: "
|
|
53
|
+
children: "Confirm"
|
|
52
54
|
}), /*#__PURE__*/_jsx(Button, {
|
|
53
|
-
type:
|
|
55
|
+
type: "text",
|
|
54
56
|
onClick: onCancel,
|
|
55
|
-
children: "
|
|
57
|
+
children: "Cancel"
|
|
56
58
|
})]
|
|
57
59
|
})
|
|
58
60
|
})]
|
package/es/SearchBar/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InputProps } from
|
|
2
|
+
import { InputProps } from "../index";
|
|
3
3
|
export interface SearchBarProps extends InputProps {
|
|
4
4
|
shortKey?: string;
|
|
5
5
|
enableShortKey?: boolean;
|
|
6
|
-
type?: 'ghost' | 'block';
|
|
7
6
|
}
|
|
8
7
|
declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
|
|
9
8
|
export default SearchBar;
|
package/es/SearchBar/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["className", "value", "onChange", "
|
|
4
|
+
var _excluded = ["className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
|
|
5
5
|
var _navigator;
|
|
6
|
-
import { Icon } from "./..";
|
|
7
|
-
import {
|
|
6
|
+
import { Icon, Input } from "./..";
|
|
7
|
+
import { Tag } from 'antd';
|
|
8
8
|
import { Search } from 'lucide-react';
|
|
9
9
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import { useStyles } from "./style";
|
|
@@ -16,10 +16,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
16
16
|
var className = _ref.className,
|
|
17
17
|
value = _ref.value,
|
|
18
18
|
_onChange = _ref.onChange,
|
|
19
|
-
style = _ref.style,
|
|
20
19
|
placeholder = _ref.placeholder,
|
|
21
|
-
_ref$type = _ref.type,
|
|
22
|
-
type = _ref$type === void 0 ? 'ghost' : _ref$type,
|
|
23
20
|
enableShortKey = _ref.enableShortKey,
|
|
24
21
|
_ref$shortKey = _ref.shortKey,
|
|
25
22
|
shortKey = _ref$shortKey === void 0 ? 'f' : _ref$shortKey,
|
|
@@ -32,9 +29,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
32
29
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
30
|
inputValue = _useState4[0],
|
|
34
31
|
setInputValue = _useState4[1];
|
|
35
|
-
var _useStyles = useStyles(
|
|
36
|
-
type: type
|
|
37
|
-
}),
|
|
32
|
+
var _useStyles = useStyles(),
|
|
38
33
|
styles = _useStyles.styles,
|
|
39
34
|
cx = _useStyles.cx;
|
|
40
35
|
var inputRef = useRef(null);
|
|
@@ -42,8 +37,9 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
42
37
|
if (!enableShortKey) return;
|
|
43
38
|
var handler = function handler(ev) {
|
|
44
39
|
if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === shortKey) {
|
|
40
|
+
var _inputRef$current;
|
|
45
41
|
ev.preventDefault();
|
|
46
|
-
inputRef.current.focus();
|
|
42
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
45
|
document.addEventListener('keydown', handler);
|
|
@@ -52,16 +48,14 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
52
48
|
};
|
|
53
49
|
}, []);
|
|
54
50
|
return /*#__PURE__*/_jsxs("div", {
|
|
55
|
-
className:
|
|
51
|
+
className: styles.search,
|
|
56
52
|
children: [/*#__PURE__*/_jsx(Input, _objectSpread({
|
|
57
53
|
ref: inputRef,
|
|
58
|
-
className: styles.input,
|
|
54
|
+
className: cx(styles.input, className),
|
|
59
55
|
prefix: /*#__PURE__*/_jsx(Icon, {
|
|
60
56
|
className: styles.icon,
|
|
61
57
|
icon: Search,
|
|
62
|
-
size:
|
|
63
|
-
fontSize: 14
|
|
64
|
-
},
|
|
58
|
+
size: "small",
|
|
65
59
|
style: {
|
|
66
60
|
marginRight: 4
|
|
67
61
|
}
|
|
@@ -69,9 +63,6 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
69
63
|
allowClear: true,
|
|
70
64
|
value: value,
|
|
71
65
|
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
|
|
72
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
73
|
-
borderColor: 'transparent'
|
|
74
|
-
}),
|
|
75
66
|
onChange: function onChange(e) {
|
|
76
67
|
setInputValue(e.target.value);
|
|
77
68
|
setShowTag(e.target.value ? false : true);
|
package/es/SearchBar/style.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export declare const useStyles: (props?: {
|
|
2
|
-
type: 'ghost' | 'block';
|
|
3
|
-
} | undefined) => import("antd-style").ReturnStyles<{
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
4
2
|
search: import("antd-style").SerializedStyles;
|
|
5
3
|
input: import("antd-style").SerializedStyles;
|
|
6
4
|
tag: import("antd-style").SerializedStyles;
|
package/es/SearchBar/style.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
|
-
|
|
5
|
-
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
6
5
|
var css = _ref.css,
|
|
7
6
|
token = _ref.token;
|
|
8
|
-
var type = _ref2.type;
|
|
9
7
|
return {
|
|
10
|
-
search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n
|
|
11
|
-
input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n
|
|
12
|
-
tag: css(
|
|
13
|
-
icon: css(
|
|
8
|
+
search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
|
|
9
|
+
input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 8px 0 12px;\n "]))),
|
|
10
|
+
tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n "]))),
|
|
11
|
+
icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
|
|
14
12
|
};
|
|
15
13
|
});
|
package/es/Snippet/style.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
|
-
import { rgba } from 'polished';
|
|
5
4
|
export var useStyles = createStyles(function (_ref, type) {
|
|
6
5
|
var css = _ref.css,
|
|
7
6
|
token = _ref.token;
|
|
8
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n max-width: 100%;\n height: 36px;\n padding: 0 8px 0 12px;\n\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n ", "\n\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\n }\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding-top: 6px !important;\n line-height: 1;\n background: none !important;\n }\n\n code[class*='language-'] {\n background: none !important;\n }\n "])), token.borderRadius, token.motionEaseOut, type === 'block' ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])),
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n max-width: 100%;\n height: 36px;\n padding: 0 8px 0 12px;\n\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n ", "\n\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\n }\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding-top: 6px !important;\n line-height: 1;\n background: none !important;\n }\n\n code[class*='language-'] {\n background: none !important;\n }\n "])), token.borderRadius, token.motionEaseOut, type === 'block' ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), token.colorFillTertiary) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), token.colorFillTertiary);
|
|
9
8
|
});
|
package/es/StroyBook/style.js
CHANGED
|
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
9
9
|
return {
|
|
10
10
|
editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
|
|
11
11
|
left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
|
|
12
|
-
right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n input:checked + label > svg {\n stroke: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.
|
|
12
|
+
right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorBgLayout, token.colorFillSecondary)
|
|
13
13
|
};
|
|
14
14
|
});
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { extractStaticStyle, type ThemeMode } from 'antd-style';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
export interface ThemeProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description Custom tokens to be used in the theme
|
|
6
|
-
*/
|
|
7
|
-
token?: any;
|
|
8
4
|
/**
|
|
9
5
|
* @description The children of the ThemeProvider component
|
|
10
6
|
*/
|
|
@@ -22,5 +18,5 @@ export interface ThemeProviderProps {
|
|
|
22
18
|
*/
|
|
23
19
|
cache?: typeof extractStaticStyle.cache;
|
|
24
20
|
}
|
|
25
|
-
declare const ThemeProvider:
|
|
21
|
+
declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
|
|
26
22
|
export default ThemeProvider;
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
|
|
2
2
|
import { App } from 'antd';
|
|
3
3
|
import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
|
|
4
|
-
import
|
|
4
|
+
import { memo } from 'react';
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import ReactFontLoader from 'react-font-loader';
|
|
7
7
|
import { ThemeContext } from 'styled-components';
|
|
8
|
-
import { createCustomToken, getAntdTheme, getCustomStylish } from "../styles";
|
|
9
8
|
import GlobalStyle from "./GlobalStyle";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var ThemeProvider = function
|
|
13
|
-
var
|
|
14
|
-
children = _ref.children,
|
|
11
|
+
var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
15
13
|
themeMode = _ref.themeMode;
|
|
16
14
|
setupStyled({
|
|
17
15
|
ThemeContext: ThemeContext
|
|
18
16
|
});
|
|
19
|
-
var getCustomToken = useCallback(function (params) {
|
|
20
|
-
var base = createCustomToken(params);
|
|
21
|
-
if (token) {
|
|
22
|
-
return _objectSpread(_objectSpread({}, base), token);
|
|
23
|
-
} else {
|
|
24
|
-
return base;
|
|
25
|
-
}
|
|
26
|
-
}, [token]);
|
|
27
17
|
return /*#__PURE__*/_jsx(StyleProvider, {
|
|
28
18
|
speedy: process.env.NODE_ENV === 'production',
|
|
29
19
|
children: /*#__PURE__*/_jsxs(AntdThemeProvider, {
|
|
30
20
|
themeMode: themeMode,
|
|
31
|
-
theme:
|
|
32
|
-
customStylish:
|
|
33
|
-
customToken:
|
|
21
|
+
theme: lobeTheme,
|
|
22
|
+
customStylish: lobeCustomStylish,
|
|
23
|
+
customToken: lobeCustomToken,
|
|
34
24
|
children: [/*#__PURE__*/_jsx(ReactFontLoader, {
|
|
35
25
|
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
|
|
36
26
|
}), /*#__PURE__*/_jsx(ReactFontLoader, {
|
|
@@ -44,5 +34,5 @@ var ThemeProvider = function ThemeProvider(_ref) {
|
|
|
44
34
|
})]
|
|
45
35
|
})
|
|
46
36
|
});
|
|
47
|
-
};
|
|
37
|
+
});
|
|
48
38
|
export default ThemeProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InputProps } from
|
|
2
|
+
import { InputProps } from "../index";
|
|
3
3
|
export interface ControlInputProps extends Omit<InputProps, 'onChange' | 'value' | 'onAbort'> {
|
|
4
4
|
onChange?: (value: string) => void;
|
|
5
5
|
onValueChanging?: (value: string) => void;
|
|
@@ -2,7 +2,9 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["value", "onChange", "onValueChanging", "onChangeEnd"];
|
|
5
|
-
import {
|
|
5
|
+
import { ActionIcon, Input } from "./..";
|
|
6
|
+
import { ConfigProvider, Space } from 'antd';
|
|
7
|
+
import { RotateCcw, Save } from 'lucide-react';
|
|
6
8
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -54,33 +56,28 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
54
56
|
onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(input);
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
|
-
suffix: value === input ? /*#__PURE__*/_jsx("span", {}) : /*#__PURE__*/
|
|
59
|
+
suffix: value === input ? /*#__PURE__*/_jsx("span", {}) : /*#__PURE__*/_jsx(ConfigProvider, {
|
|
58
60
|
theme: {
|
|
59
61
|
token: {
|
|
60
62
|
fontSize: 14
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
|
-
children:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onClick: function onClick() {
|
|
80
|
-
updateValue();
|
|
81
|
-
},
|
|
82
|
-
children: "\u4FDD\u5B58 \u21B5"
|
|
83
|
-
})]
|
|
65
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
66
|
+
size: 2,
|
|
67
|
+
children: [/*#__PURE__*/_jsx(ActionIcon, {
|
|
68
|
+
title: "Reset",
|
|
69
|
+
icon: RotateCcw,
|
|
70
|
+
size: "small",
|
|
71
|
+
onClick: function onClick() {
|
|
72
|
+
setInput(value);
|
|
73
|
+
}
|
|
74
|
+
}), /*#__PURE__*/_jsx(ActionIcon, {
|
|
75
|
+
title: "\u2705 Save",
|
|
76
|
+
icon: Save,
|
|
77
|
+
size: "small",
|
|
78
|
+
onClick: updateValue
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
84
81
|
})
|
|
85
82
|
}));
|
|
86
83
|
});
|
package/es/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/es/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as EditableMessageList } from "./EditableMessageList";
|
|
|
9
9
|
export { default as EditableText } from "./EditableText";
|
|
10
10
|
export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
|
|
11
11
|
export { default as Icon } from "./Icon";
|
|
12
|
+
export { Input, TextArea } from "./Input";
|
|
12
13
|
export { default as List } from "./List";
|
|
13
14
|
export { default as Logo } from "./Logo";
|
|
14
15
|
export { default as Markdown } from "./Markdown";
|
|
@@ -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>;
|