@lobehub/ui 1.138.16 → 1.138.18
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/ActionIconGroup/index.js +4 -0
- package/es/ChatInputArea/mobile/ChatInputArea.d.ts +0 -1
- package/es/ChatInputArea/mobile/ChatInputArea.js +56 -62
- package/es/GridBackground/GridShowcase.d.ts +3 -2
- package/es/GridBackground/GridShowcase.js +9 -7
- package/es/MobileTabBar/style.js +3 -3
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { type ChatInputAreaInnerProps } from '../ChatInputAreaInner';
|
|
|
4
4
|
export interface MobileChatInputAreaProps extends ChatInputAreaInnerProps {
|
|
5
5
|
bottomAddons?: ReactNode;
|
|
6
6
|
expand?: boolean;
|
|
7
|
-
safeArea?: boolean;
|
|
8
7
|
setExpand?: (expand: boolean) => void;
|
|
9
8
|
style?: CSSProperties;
|
|
10
9
|
textAreaLeftAddons?: ReactNode;
|
|
@@ -8,7 +8,6 @@ import { rgba } from 'polished';
|
|
|
8
8
|
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
9
9
|
import { Flexbox } from 'react-layout-kit';
|
|
10
10
|
import ActionIcon from "../../ActionIcon";
|
|
11
|
-
import MobileSafeArea from "../../MobileSafeArea";
|
|
12
11
|
import ChatInputAreaInner from "../ChatInputAreaInner";
|
|
13
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +15,7 @@ var useStyles = createStyles(function (_ref) {
|
|
|
16
15
|
var css = _ref.css,
|
|
17
16
|
token = _ref.token;
|
|
18
17
|
return {
|
|
19
|
-
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-block: 12px 12px;\n background: ", ";\n border-block-start: 1px solid ", ";\n "])), token.colorFillQuaternary, rgba(token.colorBorder, 0.25)),
|
|
18
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: none;\n padding-block: 12px 12px;\n background: ", ";\n border-block-start: 1px solid ", ";\n "])), token.colorFillQuaternary, rgba(token.colorBorder, 0.25)),
|
|
20
19
|
expand: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n background: ", ";\n "])), token.colorBgLayout),
|
|
21
20
|
expandButton: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n inset-inline-start: 14px;\n "]))),
|
|
22
21
|
expandTextArea: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1;\n "]))),
|
|
@@ -36,8 +35,7 @@ var MobileChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
36
35
|
onSend = _ref2.onSend,
|
|
37
36
|
onInput = _ref2.onInput,
|
|
38
37
|
loading = _ref2.loading,
|
|
39
|
-
value = _ref2.value
|
|
40
|
-
safeArea = _ref2.safeArea;
|
|
38
|
+
value = _ref2.value;
|
|
41
39
|
var containerRef = useRef(null);
|
|
42
40
|
var _useStyles = useStyles(),
|
|
43
41
|
cx = _useStyles.cx,
|
|
@@ -76,69 +74,65 @@ var MobileChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
76
74
|
}, [expand, loading]);
|
|
77
75
|
var showAddons = !expand && !isFocused;
|
|
78
76
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
className: cx(styles.container, expand && styles.expand, className),
|
|
78
|
+
gap: 12,
|
|
79
|
+
style: style,
|
|
80
|
+
children: [topAddons && /*#__PURE__*/_jsx(Flexbox, {
|
|
81
|
+
style: showAddons ? {} : {
|
|
82
|
+
display: 'none'
|
|
83
|
+
},
|
|
84
|
+
children: topAddons
|
|
85
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
86
|
+
className: cx(expand && styles.expand),
|
|
87
|
+
ref: containerRef,
|
|
88
|
+
style: {
|
|
89
|
+
position: 'relative'
|
|
90
|
+
},
|
|
91
|
+
children: [showFullscreen && /*#__PURE__*/_jsx(ActionIcon, {
|
|
92
|
+
active: true,
|
|
93
|
+
className: styles.expandButton,
|
|
94
|
+
icon: expand ? ChevronDown : ChevronUp,
|
|
95
|
+
onClick: function onClick() {
|
|
96
|
+
return setExpand === null || setExpand === void 0 ? void 0 : setExpand(!expand);
|
|
86
97
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
style: {
|
|
92
|
-
position: 'relative'
|
|
98
|
+
size: {
|
|
99
|
+
blockSize: 24,
|
|
100
|
+
borderRadius: '50%',
|
|
101
|
+
fontSize: 14
|
|
93
102
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
style: expand ? {
|
|
104
|
+
top: 6
|
|
105
|
+
} : {}
|
|
106
|
+
}), /*#__PURE__*/_jsx(InnerContainer, {
|
|
107
|
+
children: /*#__PURE__*/_jsx(ChatInputAreaInner, {
|
|
108
|
+
autoSize: expand ? false : {
|
|
109
|
+
maxRows: 6,
|
|
110
|
+
minRows: 0
|
|
100
111
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
className: cx(expand && styles.expandTextArea),
|
|
113
|
+
loading: loading,
|
|
114
|
+
onBlur: function onBlur() {
|
|
115
|
+
return setIsFocused(false);
|
|
105
116
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
onFocus: function onFocus() {
|
|
121
|
-
return setIsFocused(true);
|
|
122
|
-
},
|
|
123
|
-
onInput: onInput,
|
|
124
|
-
onSend: onSend,
|
|
125
|
-
ref: ref,
|
|
126
|
-
style: {
|
|
127
|
-
height: 36,
|
|
128
|
-
paddingBlock: 6
|
|
129
|
-
},
|
|
130
|
-
type: expand ? 'pure' : 'block',
|
|
131
|
-
value: value
|
|
132
|
-
})
|
|
133
|
-
})]
|
|
134
|
-
}), bottomAddons && /*#__PURE__*/_jsx(Flexbox, {
|
|
135
|
-
style: showAddons ? {} : {
|
|
136
|
-
display: 'none'
|
|
137
|
-
},
|
|
138
|
-
children: bottomAddons
|
|
117
|
+
onFocus: function onFocus() {
|
|
118
|
+
return setIsFocused(true);
|
|
119
|
+
},
|
|
120
|
+
onInput: onInput,
|
|
121
|
+
onSend: onSend,
|
|
122
|
+
ref: ref,
|
|
123
|
+
style: {
|
|
124
|
+
height: 36,
|
|
125
|
+
paddingBlock: 6
|
|
126
|
+
},
|
|
127
|
+
type: expand ? 'pure' : 'block',
|
|
128
|
+
value: value
|
|
129
|
+
})
|
|
139
130
|
})]
|
|
140
|
-
}),
|
|
141
|
-
|
|
131
|
+
}), bottomAddons && /*#__PURE__*/_jsx(Flexbox, {
|
|
132
|
+
style: showAddons ? {} : {
|
|
133
|
+
display: 'none'
|
|
134
|
+
},
|
|
135
|
+
children: bottomAddons
|
|
142
136
|
})]
|
|
143
137
|
});
|
|
144
138
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { FlexboxProps } from 'react-layout-kit';
|
|
3
3
|
import { type GridBackgroundProps } from './index';
|
|
4
|
-
export interface GridShowcaseProps extends
|
|
4
|
+
export interface GridShowcaseProps extends FlexboxProps {
|
|
5
5
|
backgroundColor?: GridBackgroundProps['backgroundColor'];
|
|
6
|
+
innerProps?: FlexboxProps;
|
|
6
7
|
}
|
|
7
8
|
declare const GridShowcase: import("react").NamedExoticComponent<GridShowcaseProps>;
|
|
8
9
|
export default GridShowcase;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["style", "children", "backgroundColor"];
|
|
5
|
+
var _excluded = ["style", "children", "backgroundColor", "innerProps"];
|
|
6
6
|
import { useTheme } from 'antd-style';
|
|
7
7
|
import { rgba } from 'polished';
|
|
8
8
|
import { memo } from 'react';
|
|
@@ -15,9 +15,10 @@ var GridShowcase = /*#__PURE__*/memo(function (_ref) {
|
|
|
15
15
|
children = _ref.children,
|
|
16
16
|
_ref$backgroundColor = _ref.backgroundColor,
|
|
17
17
|
backgroundColor = _ref$backgroundColor === void 0 ? '#001dff' : _ref$backgroundColor,
|
|
18
|
+
innerProps = _ref.innerProps,
|
|
18
19
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
var theme = useTheme();
|
|
20
|
-
return /*#__PURE__*/_jsxs(
|
|
21
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
21
22
|
style: _objectSpread({
|
|
22
23
|
position: 'relative'
|
|
23
24
|
}, style)
|
|
@@ -27,13 +28,14 @@ var GridShowcase = /*#__PURE__*/memo(function (_ref) {
|
|
|
27
28
|
colorBack: rgba(theme.colorText, 0.12),
|
|
28
29
|
colorFront: rgba(theme.colorText, 0.6),
|
|
29
30
|
flip: true
|
|
30
|
-
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
31
|
-
align: 'center'
|
|
32
|
-
|
|
31
|
+
}), /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
32
|
+
align: 'center'
|
|
33
|
+
}, innerProps), {}, {
|
|
34
|
+
style: _objectSpread({
|
|
33
35
|
zIndex: 4
|
|
34
|
-
},
|
|
36
|
+
}, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style),
|
|
35
37
|
children: children
|
|
36
|
-
}), /*#__PURE__*/_jsx(GridBackground, {
|
|
38
|
+
})), /*#__PURE__*/_jsx(GridBackground, {
|
|
37
39
|
animation: true,
|
|
38
40
|
backgroundColor: backgroundColor,
|
|
39
41
|
colorBack: rgba(theme.colorText, 0.24),
|
package/es/MobileTabBar/style.js
CHANGED
|
@@ -7,10 +7,10 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
7
7
|
token = _ref.token;
|
|
8
8
|
return {
|
|
9
9
|
active: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorPrimary),
|
|
10
|
-
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
10
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n user-select: none;\n\n overflow: hidden;\n flex: none;\n\n width: 100vw;\n\n background: ", ";\n border-block-start: 1px solid ", ";\n "])), token.colorBgLayout, rgba(token.colorBorder, 0.25)),
|
|
11
11
|
icon: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 24px;\n height: 24px;\n font-size: 24px;\n "]))),
|
|
12
12
|
inner: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 48px;\n "]))),
|
|
13
|
-
tab: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 48px;\n height: 48px;\n color: ", ";\n "])), token.
|
|
14
|
-
title: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n width: 100%;\n\n font-size: 12px;\n line-height: 1.125em;\n
|
|
13
|
+
tab: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 48px;\n height: 48px;\n color: ", ";\n "])), token.colorTextDescription),
|
|
14
|
+
title: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n width: 100%;\n margin-block-start: -0.125em;\n\n font-size: 12px;\n line-height: 1.125em;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n "])))
|
|
15
15
|
};
|
|
16
16
|
});
|