@lobehub/ui 1.73.0 → 1.75.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/BackBottom/index.d.ts +13 -0
- package/es/BackBottom/index.js +62 -0
- package/es/BackBottom/style.d.ts +1 -0
- package/es/BackBottom/style.js +10 -0
- package/es/ChatItem/style.js +1 -1
- package/es/Form/components/FormGroup.js +14 -0
- package/es/Form/components/style.d.ts +1 -0
- package/es/Form/components/style.js +5 -4
- package/es/TokenTag/style.js +3 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Target } from 'ahooks/lib/useScroll';
|
|
2
|
+
import { type BackTopProps } from 'antd';
|
|
3
|
+
import { type CSSProperties } from 'react';
|
|
4
|
+
export interface BackBottomProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: BackTopProps['onClick'];
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
target: Target;
|
|
9
|
+
text?: string;
|
|
10
|
+
visibilityHeight?: BackTopProps['visibilityHeight'];
|
|
11
|
+
}
|
|
12
|
+
declare const BackBottom: import("react").NamedExoticComponent<BackBottomProps>;
|
|
13
|
+
export default BackBottom;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
import { useScroll } from 'ahooks';
|
|
6
|
+
import { Button } from 'antd';
|
|
7
|
+
import { ListEnd } from 'lucide-react';
|
|
8
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
|
9
|
+
import Icon from "../Icon";
|
|
10
|
+
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
var BackBottom = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var _ref$visibilityHeight = _ref.visibilityHeight,
|
|
14
|
+
visibilityHeight = _ref$visibilityHeight === void 0 ? 240 : _ref$visibilityHeight,
|
|
15
|
+
target = _ref.target,
|
|
16
|
+
onClick = _ref.onClick,
|
|
17
|
+
style = _ref.style,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
text = _ref.text;
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
visible = _useState2[0],
|
|
23
|
+
setVisible = _useState2[1];
|
|
24
|
+
var _useStyles = useStyles(visible),
|
|
25
|
+
styles = _useStyles.styles,
|
|
26
|
+
cx = _useStyles.cx;
|
|
27
|
+
var ref = useRef(null);
|
|
28
|
+
var current = target === null || target === void 0 ? void 0 : target.current;
|
|
29
|
+
var scrollHeight = (current === null || current === void 0 ? void 0 : current.scrollHeight) || 0;
|
|
30
|
+
var clientHeight = (current === null || current === void 0 ? void 0 : current.clientHeight) || 0;
|
|
31
|
+
var scroll = useScroll(target);
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
if (scroll !== null && scroll !== void 0 && scroll.top) {
|
|
34
|
+
setVisible((scroll === null || scroll === void 0 ? void 0 : scroll.top) + clientHeight + visibilityHeight < scrollHeight);
|
|
35
|
+
}
|
|
36
|
+
}, [scrollHeight, scroll, visibilityHeight]);
|
|
37
|
+
var scrollToBottom = function scrollToBottom(e) {
|
|
38
|
+
var _current;
|
|
39
|
+
target === null || target === void 0 ? void 0 : (_current = target.current) === null || _current === void 0 ? void 0 : _current.scrollTo({
|
|
40
|
+
behavior: 'smooth',
|
|
41
|
+
left: 0,
|
|
42
|
+
top: scrollHeight
|
|
43
|
+
});
|
|
44
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
47
|
+
className: cx(styles, className),
|
|
48
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
49
|
+
icon: ListEnd
|
|
50
|
+
}),
|
|
51
|
+
onClick: scrollToBottom,
|
|
52
|
+
ref: ref,
|
|
53
|
+
size: 'small',
|
|
54
|
+
style: _objectSpread({
|
|
55
|
+
bottom: 16,
|
|
56
|
+
position: 'absolute',
|
|
57
|
+
right: 16
|
|
58
|
+
}, style),
|
|
59
|
+
children: text || 'Back to bottom'
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
export default BackBottom;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: boolean | undefined) => import("antd-style").ReturnStyles<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, visible) {
|
|
5
|
+
var token = _ref.token,
|
|
6
|
+
css = _ref.css,
|
|
7
|
+
stylish = _ref.stylish,
|
|
8
|
+
cx = _ref.cx;
|
|
9
|
+
return cx(stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: ", ";\n\n transform: translateY(", ");\n\n padding-inline: 12px !important;\n\n opacity: ", ";\n background: ", ";\n border-radius: 16px !important;\n "])), visible ? 'all' : 'none', visible ? 0 : '16px', visible ? 1 : 0, token.colorFillSecondary));
|
|
10
|
+
});
|
package/es/ChatItem/style.js
CHANGED
|
@@ -22,7 +22,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
22
22
|
alert: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n span[role='img'] {\n align-self: flex-start;\n width: 16px;\n height: 16px;\n margin-top: 3px;\n }\n\n .ant-alert-description {\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n }\n\n &.ant-alert-with-description {\n padding-block: 12px;\n padding-inline: 12px;\n\n .ant-alert-message {\n font-size: 14px;\n font-weight: 600;\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n }\n }\n "]))),
|
|
23
23
|
avatarContainer: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
24
24
|
avatarGroupContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
|
|
25
|
-
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='chat-item-actions'] {\n display: flex;\n }\n\n time,\n div[role='chat-item-actions'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='chat-item-actions'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse', token.motionEaseOut)),
|
|
25
|
+
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='chat-item-actions'] {\n display: flex;\n }\n\n time,\n div[role='chat-item-actions'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='chat-item-actions'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse', token.motionEaseOut)),
|
|
26
26
|
editingContainer: cx(css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding: 8px 12px 12px;\n border: 1px solid ", ";\n\n &:active,\n &:hover {\n border-color: ", ";\n }\n "])), token.colorBorderSecondary, token.colorBorder), type === 'pure' && css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
|
|
27
27
|
editingInput: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n min-width: 800px !important;\n "]))),
|
|
28
28
|
loading: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
|
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { Icon } from "../..";
|
|
7
7
|
import { Collapse } from 'antd';
|
|
8
|
+
import { ChevronDown } from 'lucide-react';
|
|
8
9
|
import { memo } from 'react';
|
|
9
10
|
import { useStyles } from "./style";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,6 +23,19 @@ var FormGroup = /*#__PURE__*/memo(function (_ref) {
|
|
|
22
23
|
return /*#__PURE__*/_jsx(Collapse, _objectSpread({
|
|
23
24
|
className: cx(styles.group, className),
|
|
24
25
|
defaultActiveKey: [1],
|
|
26
|
+
expandIcon: function expandIcon(_ref2) {
|
|
27
|
+
var isActive = _ref2.isActive;
|
|
28
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
29
|
+
className: styles.icon,
|
|
30
|
+
icon: ChevronDown,
|
|
31
|
+
size: {
|
|
32
|
+
fontSize: 16
|
|
33
|
+
},
|
|
34
|
+
style: isActive ? {} : {
|
|
35
|
+
rotate: '-90deg'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
25
39
|
items: [{
|
|
26
40
|
children: children,
|
|
27
41
|
extra: extra,
|
|
@@ -2,6 +2,7 @@ export declare const useStyles: (props?: string | number | undefined) => import(
|
|
|
2
2
|
footer: import("antd-style").SerializedStyles;
|
|
3
3
|
formTitle: import("antd-style").SerializedStyles;
|
|
4
4
|
group: string;
|
|
5
|
+
icon: import("antd-style").SerializedStyles;
|
|
5
6
|
item: import("antd-style").SerializedStyles;
|
|
6
7
|
title: import("antd-style").SerializedStyles;
|
|
7
8
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { isNumber } from 'lodash-es';
|
|
5
5
|
export var useStyles = createStyles(function (_ref, itemMinWidth) {
|
|
@@ -10,8 +10,9 @@ export var useStyles = createStyles(function (_ref, itemMinWidth) {
|
|
|
10
10
|
return {
|
|
11
11
|
footer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n "]))),
|
|
12
12
|
formTitle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 6px;\n\n text-align: left;\n\n > div {\n font-weight: 500;\n line-height: 1;\n }\n\n > small {\n display: block;\n\n line-height: 1;\n color: ", ";\n word-wrap: break-word;\n white-space: pre-wrap;\n }\n\n .ant-tag {\n font-family: ", ";\n }\n "])), token.colorTextDescription, token.fontFamilyCode),
|
|
13
|
-
group: cx(isDarkMode && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-collapse-content {\n background: transparent;\n }\n\n .ant-collapse-header {\n background: ", ";\n }\n "])), token.colorFillTertiary), css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ant-collapse-header {\n border-radius: 0 !important;\n }\n\n .ant-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .ant-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])))),
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
group: cx(isDarkMode && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-collapse-content {\n background: transparent;\n }\n\n .ant-collapse-header {\n background: ", ";\n }\n "])), token.colorFillTertiary), css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ant-collapse-header {\n align-items: center !important;\n border-radius: 0 !important;\n }\n\n .ant-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .ant-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])))),
|
|
14
|
+
icon: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n transition: all 100ms ", ";\n "])), token.motionEaseOut),
|
|
15
|
+
item: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: 8px 0;\n\n .ant-row {\n justify-content: space-between;\n\n > div {\n flex: unset !important;\n flex-grow: unset !important;\n }\n }\n\n ", "\n "])), itemMinWidth && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .ant-form-item-control {\n width: ", ";\n }\n "])), isNumber(itemMinWidth) ? "".concat(itemMinWidth, "px") : itemMinWidth)),
|
|
16
|
+
title: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n gap: 8px;\n align-items: center;\n\n font-size: 16px;\n font-weight: 600;\n\n .anticon {\n color: ", ";\n }\n "])), token.colorPrimary)
|
|
16
17
|
};
|
|
17
18
|
});
|
package/es/TokenTag/style.js
CHANGED
|
@@ -6,7 +6,8 @@ export var ICON_SIZE = 20;
|
|
|
6
6
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
7
7
|
var cx = _ref.cx,
|
|
8
8
|
css = _ref.css,
|
|
9
|
-
token = _ref.token
|
|
9
|
+
token = _ref.token,
|
|
10
|
+
isDarkMode = _ref.isDarkMode;
|
|
10
11
|
var type = _ref2.type,
|
|
11
12
|
shape = _ref2.shape;
|
|
12
13
|
var percentStyle;
|
|
@@ -27,7 +28,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
27
28
|
break;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
var roundStylish = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px 0 ", "px;\n background: ", ";\n border-radius: ", "px;\n "])), (HEIGHT - ICON_SIZE) * 1.2, (HEIGHT - ICON_SIZE) / 2, token.colorFillSecondary, HEIGHT / 2);
|
|
31
|
+
var roundStylish = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px 0 ", "px;\n background: ", ";\n border-radius: ", "px;\n "])), (HEIGHT - ICON_SIZE) * 1.2, (HEIGHT - ICON_SIZE) / 2, isDarkMode ? token.colorFillSecondary : token.colorFillTertiary, HEIGHT / 2);
|
|
31
32
|
var squareStylish = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), token.borderRadiusSM);
|
|
32
33
|
return {
|
|
33
34
|
container: cx(percentStyle, shape === 'round' ? roundStylish : squareStylish, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n user-select: none;\n\n overflow: hidden;\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n\n min-width: fit-content;\n height: ", "px;\n\n font-family: ", ";\n font-size: 13px;\n line-height: 1;\n "])), HEIGHT, token.fontFamilyCode))
|
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 ActionIconGroup, type ActionIconGroupProps } from './ActionIconGroup';
|
|
3
3
|
export { default as Avatar, type AvatarProps } from './Avatar';
|
|
4
|
+
export { default as BackBottom, type BackBottomProps } from './BackBottom';
|
|
4
5
|
export { default as Burger, type BurgerProps } from './Burger';
|
|
5
6
|
export { default as ChatHeader, type ChatHeaderProps } from './ChatHeader';
|
|
6
7
|
export { default as ChatHeaderTitle, type ChatHeaderTitleProps, } from './ChatHeader/ChatHeaderTitle';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ActionIcon } from "./ActionIcon";
|
|
2
2
|
export { default as ActionIconGroup } from "./ActionIconGroup";
|
|
3
3
|
export { default as Avatar } from "./Avatar";
|
|
4
|
+
export { default as BackBottom } from "./BackBottom";
|
|
4
5
|
export { default as Burger } from "./Burger";
|
|
5
6
|
export { default as ChatHeader } from "./ChatHeader";
|
|
6
7
|
export { default as ChatHeaderTitle } from "./ChatHeader/ChatHeaderTitle";
|