@lobehub/ui 1.116.3 → 1.117.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/calcSize.d.ts +5 -0
- package/es/ActionIcon/calcSize.js +40 -0
- package/es/ActionIcon/index.d.ts +7 -14
- package/es/ActionIcon/index.js +43 -68
- package/es/Alert/index.d.ts +8 -0
- package/es/Alert/index.js +70 -0
- package/es/Alert/style.d.ts +11 -0
- package/es/Alert/style.js +20 -0
- package/es/ChatItem/components/ErrorContent.js +2 -1
- package/es/ChatItem/type.d.ts +1 -1
- package/es/Icon/calcSize.d.ts +5 -0
- package/es/Icon/calcSize.js +39 -0
- package/es/Icon/index.d.ts +7 -8
- package/es/Icon/index.js +18 -49
- package/es/List/ListItem/index.js +6 -3
- package/es/ThemeProvider/GlobalStyle/antdOverride.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export var calcSize = function calcSize(size) {
|
|
2
|
+
var blockSize;
|
|
3
|
+
var borderRadius;
|
|
4
|
+
switch (size) {
|
|
5
|
+
case 'large':
|
|
6
|
+
{
|
|
7
|
+
blockSize = 44;
|
|
8
|
+
borderRadius = 8;
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
case 'normal':
|
|
12
|
+
{
|
|
13
|
+
blockSize = 36;
|
|
14
|
+
borderRadius = 5;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
case 'small':
|
|
18
|
+
{
|
|
19
|
+
blockSize = 24;
|
|
20
|
+
borderRadius = 5;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case 'site':
|
|
24
|
+
{
|
|
25
|
+
blockSize = 34;
|
|
26
|
+
borderRadius = 5;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
default:
|
|
30
|
+
{
|
|
31
|
+
blockSize = (size === null || size === void 0 ? void 0 : size.blockSize) || 36;
|
|
32
|
+
borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
blockSize: blockSize,
|
|
38
|
+
borderRadius: borderRadius
|
|
39
|
+
};
|
|
40
|
+
};
|
package/es/ActionIcon/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type IconProps } from "../Icon";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type ActionIconSize = 'large' | 'normal' | 'small' | 'site' | {
|
|
2
|
+
import { type IconProps, type IconSizeConfig, type IconSizeType } from "../Icon";
|
|
3
|
+
import type { TooltipProps } from "../Tooltip";
|
|
4
|
+
interface ActionIconSizeConfig extends IconSizeConfig {
|
|
6
5
|
blockSize?: number;
|
|
7
6
|
borderRadius?: number;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface ActionIconProps extends
|
|
7
|
+
}
|
|
8
|
+
type ActionIconSizeType = 'site' | IconSizeType;
|
|
9
|
+
export type ActionIconSize = ActionIconSizeType | ActionIconSizeConfig;
|
|
10
|
+
export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'> {
|
|
12
11
|
/**
|
|
13
12
|
* @description Whether the icon is active or not
|
|
14
13
|
* @default false
|
|
@@ -19,17 +18,11 @@ export interface ActionIconProps extends DivProps {
|
|
|
19
18
|
* @default false
|
|
20
19
|
*/
|
|
21
20
|
arrow?: boolean;
|
|
22
|
-
color?: IconProps['color'];
|
|
23
|
-
fill?: IconProps['fill'];
|
|
24
21
|
/**
|
|
25
22
|
* @description Glass blur style
|
|
26
23
|
* @default 'false'
|
|
27
24
|
*/
|
|
28
25
|
glass?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @description The icon element to be rendered
|
|
31
|
-
* @type LucideIcon
|
|
32
|
-
*/
|
|
33
26
|
icon?: IconProps['icon'];
|
|
34
27
|
/**
|
|
35
28
|
* @description Set the loading status of ActionIcon
|
package/es/ActionIcon/index.js
CHANGED
|
@@ -1,57 +1,21 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay"];
|
|
3
|
+
var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay", "fillOpacity", "fillRule", "focusable"];
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import { Loader2 } from 'lucide-react';
|
|
7
|
-
import { forwardRef, useMemo } from 'react';
|
|
7
|
+
import { Suspense, forwardRef, lazy, useMemo } from 'react';
|
|
8
8
|
import Icon from "../Icon";
|
|
9
|
-
import
|
|
10
|
-
import Tooltip from "../Tooltip";
|
|
9
|
+
import { calcSize } from "./calcSize";
|
|
11
10
|
import { useStyles } from "./style";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
blockSize = 44;
|
|
22
|
-
borderRadius = 8;
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
case 'normal':
|
|
26
|
-
{
|
|
27
|
-
blockSize = 36;
|
|
28
|
-
borderRadius = 5;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
case 'small':
|
|
32
|
-
{
|
|
33
|
-
blockSize = 24;
|
|
34
|
-
borderRadius = 5;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
case 'site':
|
|
38
|
-
{
|
|
39
|
-
blockSize = 34;
|
|
40
|
-
borderRadius = 5;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
default:
|
|
44
|
-
{
|
|
45
|
-
blockSize = (size === null || size === void 0 ? void 0 : size.blockSize) || 36;
|
|
46
|
-
borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
blockSize: blockSize,
|
|
52
|
-
borderRadius: borderRadius
|
|
53
|
-
};
|
|
54
|
-
};
|
|
13
|
+
var Tooltip = /*#__PURE__*/lazy(function () {
|
|
14
|
+
return import("../Tooltip");
|
|
15
|
+
});
|
|
16
|
+
var Spotlight = /*#__PURE__*/lazy(function () {
|
|
17
|
+
return import("../Spotlight");
|
|
18
|
+
});
|
|
55
19
|
var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
56
20
|
var color = _ref.color,
|
|
57
21
|
fill = _ref.fill,
|
|
@@ -72,6 +36,9 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
72
36
|
loading = _ref.loading,
|
|
73
37
|
_ref$tooltipDelay = _ref.tooltipDelay,
|
|
74
38
|
tooltipDelay = _ref$tooltipDelay === void 0 ? 0.5 : _ref$tooltipDelay,
|
|
39
|
+
fillOpacity = _ref.fillOpacity,
|
|
40
|
+
fillRule = _ref.fillRule,
|
|
41
|
+
focusable = _ref.focusable,
|
|
75
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
43
|
var _useStyles = useStyles({
|
|
77
44
|
active: Boolean(active),
|
|
@@ -84,21 +51,23 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
84
51
|
}, [size]),
|
|
85
52
|
blockSize = _useMemo.blockSize,
|
|
86
53
|
borderRadius = _useMemo.borderRadius;
|
|
87
|
-
var
|
|
88
|
-
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
89
|
-
className: styles.icon,
|
|
90
|
-
color: color,
|
|
91
|
-
fill: fill,
|
|
92
|
-
icon: icon,
|
|
93
|
-
size: size === 'site' ? 'normal' : size
|
|
94
|
-
}), children]
|
|
95
|
-
});
|
|
96
|
-
var spin = /*#__PURE__*/_jsx(Icon, {
|
|
54
|
+
var iconProps = {
|
|
97
55
|
color: color,
|
|
98
|
-
|
|
99
|
-
|
|
56
|
+
fill: fill,
|
|
57
|
+
fillOpacity: fillOpacity,
|
|
58
|
+
fillRule: fillRule,
|
|
59
|
+
focusable: focusable,
|
|
60
|
+
size: size === 'site' ? 'normal' : size
|
|
61
|
+
};
|
|
62
|
+
var content = icon && /*#__PURE__*/_jsx(Icon, _objectSpread({
|
|
63
|
+
className: styles.icon,
|
|
64
|
+
icon: icon
|
|
65
|
+
}, iconProps));
|
|
66
|
+
var spin = /*#__PURE__*/_jsx(Icon, _objectSpread(_objectSpread({
|
|
67
|
+
icon: Loader2
|
|
68
|
+
}, iconProps), {}, {
|
|
100
69
|
spin: true
|
|
101
|
-
});
|
|
70
|
+
}));
|
|
102
71
|
var actionIconBlock = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
103
72
|
className: cx(styles.block, className),
|
|
104
73
|
onClick: loading ? undefined : onClick,
|
|
@@ -109,18 +78,24 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
109
78
|
width: blockSize
|
|
110
79
|
}, style)
|
|
111
80
|
}, rest), {}, {
|
|
112
|
-
children: [
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Suspense, {
|
|
82
|
+
fallback: null,
|
|
83
|
+
children: spotlight && /*#__PURE__*/_jsx(Spotlight, {})
|
|
84
|
+
}), loading ? spin : content, children]
|
|
113
85
|
}));
|
|
114
86
|
if (!title) return actionIconBlock;
|
|
115
|
-
return /*#__PURE__*/_jsx(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
87
|
+
return /*#__PURE__*/_jsx(Suspense, {
|
|
88
|
+
fallback: actionIconBlock,
|
|
89
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
90
|
+
arrow: arrow,
|
|
91
|
+
mouseEnterDelay: tooltipDelay,
|
|
92
|
+
overlayStyle: {
|
|
93
|
+
pointerEvents: 'none'
|
|
94
|
+
},
|
|
95
|
+
placement: placement,
|
|
96
|
+
title: title,
|
|
97
|
+
children: actionIconBlock
|
|
98
|
+
})
|
|
124
99
|
});
|
|
125
100
|
});
|
|
126
101
|
export default ActionIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type AlertProps as AntAlertProps } from 'antd';
|
|
3
|
+
export interface AlertProps extends AntAlertProps {
|
|
4
|
+
colorfulText?: boolean;
|
|
5
|
+
styleType?: 'block' | 'ghost' | 'pure';
|
|
6
|
+
}
|
|
7
|
+
declare const Alert: import("react").NamedExoticComponent<AlertProps>;
|
|
8
|
+
export default Alert;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["closeIcon", "closable", "description", "showIcon", "type", "styleType", "icon", "colorfulText", "style"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { Alert as AntdAlert } from 'antd';
|
|
7
|
+
import { camelCase } from 'lodash-es';
|
|
8
|
+
import { AlertTriangle, CheckCircle, Info, X, XCircle } from 'lucide-react';
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import ActionIcon from "../ActionIcon";
|
|
11
|
+
import Icon from "../Icon";
|
|
12
|
+
import { useStyles } from "./style";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var typeIcons = {
|
|
15
|
+
error: XCircle,
|
|
16
|
+
info: Info,
|
|
17
|
+
success: CheckCircle,
|
|
18
|
+
warning: AlertTriangle
|
|
19
|
+
};
|
|
20
|
+
var colors = function colors(theme) {
|
|
21
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';
|
|
22
|
+
for (var _len = arguments.length, keys = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
23
|
+
keys[_key - 2] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
return theme[camelCase(['color', type].concat(keys).join('-'))];
|
|
26
|
+
};
|
|
27
|
+
var Alert = /*#__PURE__*/memo(function (_ref) {
|
|
28
|
+
var closeIcon = _ref.closeIcon,
|
|
29
|
+
closable = _ref.closable,
|
|
30
|
+
description = _ref.description,
|
|
31
|
+
showIcon = _ref.showIcon,
|
|
32
|
+
_ref$type = _ref.type,
|
|
33
|
+
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
34
|
+
styleType = _ref.styleType,
|
|
35
|
+
icon = _ref.icon,
|
|
36
|
+
_ref$colorfulText = _ref.colorfulText,
|
|
37
|
+
colorfulText = _ref$colorfulText === void 0 ? true : _ref$colorfulText,
|
|
38
|
+
style = _ref.style,
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
var _useStyles = useStyles({
|
|
41
|
+
closable: !!closable,
|
|
42
|
+
hasTitle: !!description,
|
|
43
|
+
showIcon: !!showIcon
|
|
44
|
+
}),
|
|
45
|
+
theme = _useStyles.theme,
|
|
46
|
+
styles = _useStyles.styles,
|
|
47
|
+
cx = _useStyles.cx;
|
|
48
|
+
return /*#__PURE__*/_jsx(AntdAlert, _objectSpread({
|
|
49
|
+
className: cx(styles.container, colorfulText && styles.colorfulText, styleType === 'block' && styles.styleBlock, styleType === 'ghost' && styles.styleGhost, styleType === 'pure' && styles.stylePure),
|
|
50
|
+
closable: closable,
|
|
51
|
+
closeIcon: closeIcon || /*#__PURE__*/_jsx(ActionIcon, {
|
|
52
|
+
color: colors(theme, type),
|
|
53
|
+
icon: X,
|
|
54
|
+
size: 'small'
|
|
55
|
+
}),
|
|
56
|
+
description: description,
|
|
57
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
58
|
+
icon: typeIcons[type] || icon,
|
|
59
|
+
size: {
|
|
60
|
+
fontSize: description ? 24 : 18
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
showIcon: showIcon,
|
|
64
|
+
style: _objectSpread({
|
|
65
|
+
color: colorfulText ? colors(theme, type) : undefined
|
|
66
|
+
}, style),
|
|
67
|
+
type: type
|
|
68
|
+
}, rest));
|
|
69
|
+
});
|
|
70
|
+
export default Alert;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useStyles: (props?: {
|
|
2
|
+
closable?: boolean | undefined;
|
|
3
|
+
hasTitle?: boolean | undefined;
|
|
4
|
+
showIcon?: boolean | undefined;
|
|
5
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
6
|
+
colorfulText: import("antd-style").SerializedStyles;
|
|
7
|
+
container: string;
|
|
8
|
+
styleBlock: import("antd-style").SerializedStyles;
|
|
9
|
+
styleGhost: import("antd-style").SerializedStyles;
|
|
10
|
+
stylePure: import("antd-style").SerializedStyles;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
+
var cx = _ref.cx,
|
|
6
|
+
css = _ref.css,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
var closable = _ref2.closable,
|
|
9
|
+
hasTitle = _ref2.hasTitle,
|
|
10
|
+
showIcon = _ref2.showIcon;
|
|
11
|
+
var baseBlockPadding = hasTitle ? 16 : 8;
|
|
12
|
+
var baseInlinePadding = hasTitle ? 16 : 12;
|
|
13
|
+
return {
|
|
14
|
+
colorfulText: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-alert-message,.", "-alert-description {\n color: inherit;\n }\n "])), prefixCls, prefixCls),
|
|
15
|
+
container: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n align-items: flex-start;\n\n padding-right: ", "px;\n padding-left: ", "px;\n padding-block: ", "px;\n\n .", "-alert-message {\n font-weight: ", ";\n line-height: 24px;\n word-break: break-all;\n }\n .", "-alert-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n .", "-alert-close-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n "])), hasTitle ? 12 : 8, closable ? baseInlinePadding : baseInlinePadding * 1.5, showIcon ? baseInlinePadding : baseInlinePadding * 1.5, baseBlockPadding, prefixCls, hasTitle ? 600 : 400, prefixCls, prefixCls), hasTitle && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", "-alert-description {\n line-height: 1.5;\n word-break: break-all;\n opacity: 0.75;\n }\n "])), prefixCls)),
|
|
16
|
+
styleBlock: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border: none;\n "]))),
|
|
17
|
+
styleGhost: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: transparent;\n "]))),
|
|
18
|
+
stylePure: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: 0 !important;\n background: transparent;\n border: none;\n "])))
|
|
19
|
+
};
|
|
20
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { Alert } from 'antd';
|
|
5
4
|
import { memo } from 'react';
|
|
6
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
import Alert from "../../Alert";
|
|
7
7
|
import { useStyles } from "../style";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -19,6 +19,7 @@ var ErrorContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
19
|
className: styles.errorContent,
|
|
20
20
|
gap: 8,
|
|
21
21
|
children: [/*#__PURE__*/_jsx(Alert, _objectSpread({
|
|
22
|
+
closable: false,
|
|
22
23
|
showIcon: true,
|
|
23
24
|
type: 'error'
|
|
24
25
|
}, error)), message]
|
package/es/ChatItem/type.d.ts
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export var calcSize = function calcSize(size) {
|
|
2
|
+
var fontSize;
|
|
3
|
+
var strokeWidth;
|
|
4
|
+
switch (size) {
|
|
5
|
+
case 'large':
|
|
6
|
+
{
|
|
7
|
+
fontSize = 24;
|
|
8
|
+
strokeWidth = 2;
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
case 'normal':
|
|
12
|
+
{
|
|
13
|
+
fontSize = 20;
|
|
14
|
+
strokeWidth = 2;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
case 'small':
|
|
18
|
+
{
|
|
19
|
+
fontSize = 14;
|
|
20
|
+
strokeWidth = 1.5;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
{
|
|
25
|
+
if (size) {
|
|
26
|
+
fontSize = (size === null || size === void 0 ? void 0 : size.fontSize) || 24;
|
|
27
|
+
strokeWidth = (size === null || size === void 0 ? void 0 : size.strokeWidth) || 2;
|
|
28
|
+
} else {
|
|
29
|
+
fontSize = '1em';
|
|
30
|
+
strokeWidth = 2;
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
fontSize: fontSize,
|
|
37
|
+
strokeWidth: strokeWidth
|
|
38
|
+
};
|
|
39
|
+
};
|
package/es/Icon/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { LucideIcon, LucideProps } from 'lucide-react';
|
|
3
3
|
import { DivProps } from "../types";
|
|
4
|
-
export
|
|
4
|
+
export interface IconSizeConfig extends Pick<LucideProps, 'strokeWidth' | 'absoluteStrokeWidth'> {
|
|
5
5
|
fontSize?: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
fill?: string;
|
|
6
|
+
}
|
|
7
|
+
export type IconSizeType = 'large' | 'normal' | 'small';
|
|
8
|
+
export type IconSize = IconSizeType | IconSizeConfig;
|
|
9
|
+
export interface IconProps extends DivProps, Pick<LucideProps, 'fill' | 'fillRule' | 'fillOpacity' | 'color' | 'focusable'> {
|
|
11
10
|
/**
|
|
12
11
|
* @description The icon element to be rendered
|
|
13
12
|
* @type LucideIcon
|
|
@@ -24,5 +23,5 @@ export interface IconProps extends DivProps {
|
|
|
24
23
|
*/
|
|
25
24
|
spin?: boolean;
|
|
26
25
|
}
|
|
27
|
-
declare const Icon: import("react").
|
|
26
|
+
declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
28
27
|
export default Icon;
|
package/es/Icon/index.js
CHANGED
|
@@ -1,57 +1,24 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["icon", "size", "color", "fill", "className", "spin"]
|
|
3
|
+
var _excluded = ["icon", "size", "color", "fill", "className", "focusable", "spin", "fillRule", "fillOpacity"],
|
|
4
|
+
_excluded2 = ["fontSize"];
|
|
4
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import {
|
|
7
|
+
import { forwardRef, useMemo } from 'react';
|
|
8
|
+
import { calcSize } from "./calcSize";
|
|
7
9
|
import { useStyles } from "./style";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
var fontSize;
|
|
11
|
-
var strokeWidth;
|
|
12
|
-
switch (size) {
|
|
13
|
-
case 'large':
|
|
14
|
-
{
|
|
15
|
-
fontSize = 24;
|
|
16
|
-
strokeWidth = 2;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
case 'normal':
|
|
20
|
-
{
|
|
21
|
-
fontSize = 20;
|
|
22
|
-
strokeWidth = 2;
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
case 'small':
|
|
26
|
-
{
|
|
27
|
-
fontSize = 14;
|
|
28
|
-
strokeWidth = 1.5;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
default:
|
|
32
|
-
{
|
|
33
|
-
if (size) {
|
|
34
|
-
fontSize = (size === null || size === void 0 ? void 0 : size.fontSize) || 24;
|
|
35
|
-
strokeWidth = (size === null || size === void 0 ? void 0 : size.strokeWidth) || 2;
|
|
36
|
-
} else {
|
|
37
|
-
fontSize = '1em';
|
|
38
|
-
strokeWidth = 2;
|
|
39
|
-
}
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
fontSize: fontSize,
|
|
45
|
-
strokeWidth: strokeWidth
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
49
12
|
var icon = _ref.icon,
|
|
50
13
|
size = _ref.size,
|
|
51
14
|
color = _ref.color,
|
|
52
|
-
fill = _ref.fill,
|
|
15
|
+
_ref$fill = _ref.fill,
|
|
16
|
+
fill = _ref$fill === void 0 ? 'transparent' : _ref$fill,
|
|
53
17
|
className = _ref.className,
|
|
18
|
+
focusable = _ref.focusable,
|
|
54
19
|
spin = _ref.spin,
|
|
20
|
+
fillRule = _ref.fillRule,
|
|
21
|
+
fillOpacity = _ref.fillOpacity,
|
|
55
22
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
56
23
|
var _useStyles = useStyles(),
|
|
57
24
|
styles = _useStyles.styles,
|
|
@@ -61,20 +28,22 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
|
61
28
|
return calcSize(size);
|
|
62
29
|
}, [size]),
|
|
63
30
|
fontSize = _useMemo.fontSize,
|
|
64
|
-
|
|
31
|
+
restSize = _objectWithoutProperties(_useMemo, _excluded2);
|
|
65
32
|
return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
|
|
66
33
|
className: cx('anticon', spin && styles.spin, className),
|
|
67
34
|
role: "img"
|
|
68
35
|
}, rest), {}, {
|
|
69
|
-
children: /*#__PURE__*/_jsx(SvgIcon, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(SvgIcon, _objectSpread({
|
|
70
37
|
color: color,
|
|
71
|
-
fill: fill
|
|
72
|
-
|
|
38
|
+
fill: fill,
|
|
39
|
+
fillOpacity: fillOpacity,
|
|
40
|
+
fillRule: fillRule,
|
|
41
|
+
focusable: focusable,
|
|
73
42
|
height: fontSize,
|
|
43
|
+
ref: ref,
|
|
74
44
|
size: fontSize,
|
|
75
|
-
strokeWidth: strokeWidth,
|
|
76
45
|
width: fontSize
|
|
77
|
-
})
|
|
46
|
+
}, restSize))
|
|
78
47
|
}));
|
|
79
48
|
});
|
|
80
49
|
export default Icon;
|
|
@@ -3,9 +3,10 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["active", "avatar", "loading", "description", "date", "title", "onHoverChange", "actions", "className", "style", "showAction", "children", "classNames", "addon", "pin"];
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import {
|
|
6
|
+
import { Loader2, MessageSquare } from 'lucide-react';
|
|
7
7
|
import { forwardRef } from 'react';
|
|
8
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
|
+
import Icon from "../../Icon";
|
|
9
10
|
import { useStyles } from "./style";
|
|
10
11
|
import { getChatItemTime } from "./time";
|
|
11
12
|
|
|
@@ -56,7 +57,8 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
56
57
|
children: /*#__PURE__*/_jsx("div", {
|
|
57
58
|
className: styles.triangle
|
|
58
59
|
})
|
|
59
|
-
}), avatar !== null && avatar !== void 0 ? avatar : /*#__PURE__*/_jsx(
|
|
60
|
+
}), avatar !== null && avatar !== void 0 ? avatar : /*#__PURE__*/_jsx(Icon, {
|
|
61
|
+
icon: MessageSquare,
|
|
60
62
|
style: {
|
|
61
63
|
marginTop: 4
|
|
62
64
|
}
|
|
@@ -74,7 +76,8 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
74
76
|
className: styles.desc,
|
|
75
77
|
children: description
|
|
76
78
|
}), addon]
|
|
77
|
-
}), loading ? /*#__PURE__*/_jsx(
|
|
79
|
+
}), loading ? /*#__PURE__*/_jsx(Icon, {
|
|
80
|
+
icon: Loader2,
|
|
78
81
|
spin: true
|
|
79
82
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
80
83
|
children: [showAction && /*#__PURE__*/_jsx(Flexbox, {
|
|
@@ -3,5 +3,5 @@ var _templateObject;
|
|
|
3
3
|
import { css } from 'antd-style';
|
|
4
4
|
import { readableColor } from 'polished';
|
|
5
5
|
export default (function (token) {
|
|
6
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-btn {\n box-shadow: none;\n }\n\n .", "-btn-primary {\n color: ", " !important;\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n }\n\n .", "-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", " !important;\n\n background-color: ", " !important;\n border-radius: ", "px !important;\n }\n\n .", "-tooltip-arrow {\n &::before,\n &::after {\n background: ", " !important;\n }\n }\n\n .", "-switch-handle::before {\n background: ", " !important;\n }\n\n
|
|
6
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-btn {\n box-shadow: none;\n }\n\n .", "-btn-primary {\n color: ", " !important;\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n }\n\n .", "-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", " !important;\n\n background-color: ", " !important;\n border-radius: ", "px !important;\n }\n\n .", "-tooltip-arrow {\n &::before,\n &::after {\n background: ", " !important;\n }\n }\n\n .", "-switch-handle::before {\n background: ", " !important;\n }\n\n @media (max-width: 575px) {\n .", "-tooltip {\n display: none !important;\n }\n }\n"])), token.prefixCls, token.prefixCls, readableColor(token.colorPrimary), readableColor(token.colorPrimary), readableColor(token.colorPrimaryActive), token.prefixCls, token.colorBgLayout, token.colorText, token.borderRadiusSM, token.prefixCls, token.colorText, token.prefixCls, token.colorBgContainer, token.prefixCls);
|
|
7
7
|
});
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
|
|
2
2
|
export { default as ActionIconGroup, type ActionIconGroupProps } from './ActionIconGroup';
|
|
3
|
+
export { default as Alert, type AlertProps } from './Alert';
|
|
3
4
|
export { default as Avatar, type AvatarProps } from './Avatar';
|
|
4
5
|
export { default as BackBottom, type BackBottomProps } from './BackBottom';
|
|
5
6
|
export { default as Burger, type BurgerProps } from './Burger';
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ActionIcon } from "./ActionIcon";
|
|
2
2
|
export { default as ActionIconGroup } from "./ActionIconGroup";
|
|
3
|
+
export { default as Alert } from "./Alert";
|
|
3
4
|
export { default as Avatar } from "./Avatar";
|
|
4
5
|
export { default as BackBottom } from "./BackBottom";
|
|
5
6
|
export { default as Burger } from "./Burger";
|