@lobehub/ui 1.116.3 → 1.118.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 +16 -0
- package/es/Alert/index.js +120 -0
- package/es/Alert/style.d.ts +16 -0
- package/es/Alert/style.js +26 -0
- package/es/ChatItem/components/ErrorContent.js +7 -7
- package/es/ChatItem/style.d.ts +1 -1
- package/es/ChatItem/style.js +5 -5
- 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/es/styles/theme/customStylish.js +2 -2
- 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,16 @@
|
|
|
1
|
+
import { type AlertProps as AntAlertProps } from 'antd';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface AlertProps extends AntAlertProps {
|
|
4
|
+
classNames?: {
|
|
5
|
+
alert?: string;
|
|
6
|
+
container?: string;
|
|
7
|
+
};
|
|
8
|
+
colorfulText?: boolean;
|
|
9
|
+
extra?: ReactNode;
|
|
10
|
+
text?: {
|
|
11
|
+
detail?: string;
|
|
12
|
+
};
|
|
13
|
+
variant?: 'default' | 'block' | 'ghost' | 'pure';
|
|
14
|
+
}
|
|
15
|
+
declare const Alert: import("react").NamedExoticComponent<AlertProps>;
|
|
16
|
+
export default Alert;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["closeIcon", "closable", "description", "showIcon", "type", "variant", "icon", "colorfulText", "style", "extra", "classNames", "text"];
|
|
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; }
|
|
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; }
|
|
7
|
+
import { Alert as AntdAlert, message } from 'antd';
|
|
8
|
+
import { camelCase } from 'lodash-es';
|
|
9
|
+
import { AlertTriangle, CheckCircle, ChevronDown, ChevronRight, Info, X, XCircle } from 'lucide-react';
|
|
10
|
+
import { memo, useState } from 'react';
|
|
11
|
+
import { Flexbox } from 'react-layout-kit';
|
|
12
|
+
import ActionIcon from "../ActionIcon";
|
|
13
|
+
import Icon from "../Icon";
|
|
14
|
+
import { useStyles } from "./style";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
var typeIcons = {
|
|
18
|
+
error: XCircle,
|
|
19
|
+
info: Info,
|
|
20
|
+
success: CheckCircle,
|
|
21
|
+
warning: AlertTriangle
|
|
22
|
+
};
|
|
23
|
+
var colors = function colors(theme) {
|
|
24
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';
|
|
25
|
+
for (var _len = arguments.length, keys = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
26
|
+
keys[_key - 2] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
return theme[camelCase(['color', type].concat(keys).join('-'))];
|
|
29
|
+
};
|
|
30
|
+
var Alert = /*#__PURE__*/memo(function (_ref) {
|
|
31
|
+
var closeIcon = _ref.closeIcon,
|
|
32
|
+
_ref$closable = _ref.closable,
|
|
33
|
+
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
34
|
+
description = _ref.description,
|
|
35
|
+
_ref$showIcon = _ref.showIcon,
|
|
36
|
+
showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
|
|
37
|
+
_ref$type = _ref.type,
|
|
38
|
+
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
39
|
+
variant = _ref.variant,
|
|
40
|
+
icon = _ref.icon,
|
|
41
|
+
_ref$colorfulText = _ref.colorfulText,
|
|
42
|
+
colorfulText = _ref$colorfulText === void 0 ? true : _ref$colorfulText,
|
|
43
|
+
style = _ref.style,
|
|
44
|
+
extra = _ref.extra,
|
|
45
|
+
classNames = _ref.classNames,
|
|
46
|
+
text = _ref.text,
|
|
47
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
+
var _useState = useState(true),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
expand = _useState2[0],
|
|
51
|
+
setExpand = _useState2[1];
|
|
52
|
+
var _useStyles = useStyles({
|
|
53
|
+
closable: !!closable,
|
|
54
|
+
hasTitle: !!description,
|
|
55
|
+
showIcon: !!showIcon
|
|
56
|
+
}),
|
|
57
|
+
theme = _useStyles.theme,
|
|
58
|
+
styles = _useStyles.styles,
|
|
59
|
+
cx = _useStyles.cx;
|
|
60
|
+
var alert = /*#__PURE__*/_jsx(AntdAlert, _objectSpread({
|
|
61
|
+
className: cx(styles.container, colorfulText && styles.colorfulText, !!extra && styles.hasExtra, variant === 'block' && styles.variantBlock, variant === 'ghost' && styles.variantGhost, variant === 'pure' && styles.variantPure, classNames === null || classNames === void 0 ? void 0 : classNames.alert, !extra && styles.container),
|
|
62
|
+
closable: closable,
|
|
63
|
+
closeIcon: closeIcon || /*#__PURE__*/_jsx(ActionIcon, {
|
|
64
|
+
color: colors(theme, type),
|
|
65
|
+
icon: X,
|
|
66
|
+
size: 'small'
|
|
67
|
+
}),
|
|
68
|
+
description: description,
|
|
69
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
icon: typeIcons[type] || icon,
|
|
71
|
+
size: {
|
|
72
|
+
fontSize: description ? 24 : 18
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
showIcon: showIcon,
|
|
76
|
+
style: _objectSpread({
|
|
77
|
+
color: colorfulText ? colors(theme, type) : undefined
|
|
78
|
+
}, style),
|
|
79
|
+
type: type
|
|
80
|
+
}, rest));
|
|
81
|
+
if (!extra) return alert;
|
|
82
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
83
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.container,
|
|
84
|
+
children: [alert, /*#__PURE__*/_jsxs(Flexbox, {
|
|
85
|
+
className: cx(styles.extra, variant === 'block' && styles.variantBlock, variant === 'ghost' && styles.variantGhost, variant === 'pure' && styles.variantPure),
|
|
86
|
+
style: {
|
|
87
|
+
background: colors(theme, type, 'bg'),
|
|
88
|
+
borderColor: colors(theme, type, 'border'),
|
|
89
|
+
color: colors(theme, type),
|
|
90
|
+
fontSize: description ? 14 : 12
|
|
91
|
+
},
|
|
92
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
93
|
+
align: 'center',
|
|
94
|
+
className: cx(styles.extraHeader, variant === 'pure' && styles.variantPureExtraHeader),
|
|
95
|
+
gap: message ? 6 : 10,
|
|
96
|
+
horizontal: true,
|
|
97
|
+
style: {
|
|
98
|
+
borderColor: colors(theme, type, 'border')
|
|
99
|
+
},
|
|
100
|
+
children: [/*#__PURE__*/_jsx(ActionIcon, {
|
|
101
|
+
color: colorfulText ? colors(theme, type) : undefined,
|
|
102
|
+
icon: expand ? ChevronDown : ChevronRight,
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return setExpand(!expand);
|
|
105
|
+
},
|
|
106
|
+
size: {
|
|
107
|
+
blockSize: 24,
|
|
108
|
+
fontSize: 18
|
|
109
|
+
}
|
|
110
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
111
|
+
children: (text === null || text === void 0 ? void 0 : text.detail) || 'Show Details'
|
|
112
|
+
})]
|
|
113
|
+
}), expand && /*#__PURE__*/_jsx("div", {
|
|
114
|
+
className: cx(styles.extraBody, variant === 'pure' && styles.variantPure),
|
|
115
|
+
children: extra
|
|
116
|
+
})]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
export default Alert;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
extra: import("antd-style").SerializedStyles;
|
|
9
|
+
extraBody: import("antd-style").SerializedStyles;
|
|
10
|
+
extraHeader: import("antd-style").SerializedStyles;
|
|
11
|
+
hasExtra: import("antd-style").SerializedStyles;
|
|
12
|
+
variantBlock: import("antd-style").SerializedStyles;
|
|
13
|
+
variantGhost: import("antd-style").SerializedStyles;
|
|
14
|
+
variantPure: import("antd-style").SerializedStyles;
|
|
15
|
+
variantPureExtraHeader: import("antd-style").SerializedStyles;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
+
var cx = _ref.cx,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
css = _ref.css,
|
|
8
|
+
prefixCls = _ref.prefixCls;
|
|
9
|
+
var closable = _ref2.closable,
|
|
10
|
+
hasTitle = _ref2.hasTitle,
|
|
11
|
+
showIcon = _ref2.showIcon;
|
|
12
|
+
var baseBlockPadding = hasTitle ? 16 : 8;
|
|
13
|
+
var baseInlinePadding = hasTitle ? 16 : 12;
|
|
14
|
+
return {
|
|
15
|
+
colorfulText: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-alert-message,.", "-alert-description {\n color: inherit;\n }\n "])), prefixCls, prefixCls),
|
|
16
|
+
container: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: row;\n gap: ", "px;\n align-items: flex-start;\n\n max-width: 100%;\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)),
|
|
17
|
+
extra: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: hidden;\n\n max-width: 100%;\n\n border: 1px solid;\n border-top: none;\n border-bottom-right-radius: ", "px;\n border-bottom-left-radius: ", "px;\n "])), token.borderRadiusLG, token.borderRadiusLG),
|
|
18
|
+
extraBody: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow-x: auto;\n width: 100%;\n padding-block: ", "px;\n padding-inline: ", "px;\n "])), baseBlockPadding, baseInlinePadding),
|
|
19
|
+
extraHeader: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding-block: ", "px;\n padding-inline: ", "px;\n border-top: 1px dashed;\n "])), baseBlockPadding * 0.75, baseInlinePadding * 0.75),
|
|
20
|
+
hasExtra: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n "]))),
|
|
21
|
+
variantBlock: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n border: none;\n "]))),
|
|
22
|
+
variantGhost: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background: transparent !important;\n "]))),
|
|
23
|
+
variantPure: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 0 !important;\n background: transparent !important;\n border: none;\n "]))),
|
|
24
|
+
variantPureExtraHeader: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n margin-left: ", "px;\n padding-inline: 0;\n "])), baseBlockPadding, -baseInlinePadding * 0.25)
|
|
25
|
+
};
|
|
26
|
+
});
|
|
@@ -1,12 +1,11 @@
|
|
|
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
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
var ErrorContent = /*#__PURE__*/memo(function (_ref) {
|
|
11
10
|
var message = _ref.message,
|
|
12
11
|
error = _ref.error,
|
|
@@ -15,13 +14,14 @@ var ErrorContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
15
14
|
placement: placement
|
|
16
15
|
}),
|
|
17
16
|
styles = _useStyles.styles;
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
className: styles.
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
18
|
+
className: styles.errorContainer,
|
|
19
|
+
children: /*#__PURE__*/_jsx(Alert, _objectSpread({
|
|
20
|
+
closable: false,
|
|
21
|
+
extra: message,
|
|
22
22
|
showIcon: true,
|
|
23
23
|
type: 'error'
|
|
24
|
-
}, error))
|
|
24
|
+
}, error))
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
export default ErrorContent;
|
package/es/ChatItem/style.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const useStyles: (props?: {
|
|
|
13
13
|
container: string;
|
|
14
14
|
editingContainer: string;
|
|
15
15
|
editingInput: import("antd-style").SerializedStyles;
|
|
16
|
-
|
|
16
|
+
errorContainer: import("antd-style").SerializedStyles;
|
|
17
17
|
loading: import("antd-style").SerializedStyles;
|
|
18
18
|
message: string;
|
|
19
19
|
messageContainer: string;
|
package/es/ChatItem/style.js
CHANGED
|
@@ -20,17 +20,17 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
20
20
|
var typeStylish = type === 'block' ? blockStylish : pureStylish;
|
|
21
21
|
var editingStylish = editing && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
22
22
|
return {
|
|
23
|
-
actions: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n align-self: ", ";\n justify-content: ", ";\n "])), type === 'block' ? 'flex-end' : placement === 'left' ? 'flex-start' : 'flex-end', placement === 'left' ? 'flex-end' : 'flex-start'), editing && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none !important;\n opacity: 0 !important;\n "])))),
|
|
23
|
+
actions: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: none;\n align-self: ", ";\n justify-content: ", ";\n "])), type === 'block' ? 'flex-end' : placement === 'left' ? 'flex-start' : 'flex-end', placement === 'left' ? 'flex-end' : 'flex-start'), editing && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none !important;\n opacity: 0 !important;\n "])))),
|
|
24
24
|
avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
25
25
|
avatarGroupContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
|
|
26
|
-
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding:
|
|
26
|
+
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: hidden;\n\n width: 100%;\n max-width: 100vw;\n padding: 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='menubar'] {\n display: flex;\n }\n\n time,\n div[role='menubar'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='menubar'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding: 4px 8px;\n }\n "])), token.motionEaseOut, responsive.mobile)),
|
|
27
27
|
editingContainer: cx(editingStylish, css(_templateObject10 || (_templateObject10 = _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(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
|
|
28
28
|
editingInput: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
|
|
29
|
-
|
|
29
|
+
errorContainer: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n "]))),
|
|
30
30
|
loading: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\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),
|
|
31
31
|
message: cx(typeStylish, css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
|
|
32
|
-
messageContainer: cx(editingStylish, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n\n ", " {\n overflow-x: auto;\n
|
|
33
|
-
messageContent: cx(editingStylish, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n overflow-x: hidden;\n\n ", " {\n flex-direction: column !important;\n
|
|
32
|
+
messageContainer: cx(editingStylish, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n max-width: 100%;\n\n ", " {\n overflow-x: auto;\n }\n "])), responsive.mobile)),
|
|
33
|
+
messageContent: cx(editingStylish, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n overflow-x: hidden;\n max-width: 100%;\n\n ", " {\n flex-direction: column !important;\n }\n "])), responsive.mobile)),
|
|
34
34
|
messageExtra: cx('message-extra'),
|
|
35
35
|
name: css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', token.colorTextDescription, placement === 'left' ? 'left' : 'right')
|
|
36
36
|
};
|
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";
|
|
@@ -13,8 +13,8 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
13
13
|
blurStrong: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n backdrop-filter: blur(36px);\n "]))),
|
|
14
14
|
bottomScrollbar: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n transition: background-color 500ms ", ";\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n "])), token.colorFill, token.motionEaseOut),
|
|
15
15
|
gradientAnimation: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n -45deg,\n ", ",\n ", ",\n ", ",\n ", "\n );\n background-size: 400% 400%;\n border-radius: inherit;\n animation: 5s ", " 5s ease infinite;\n "])), token.gold, token.magenta, token.geekblue, token.cyan, gradient),
|
|
16
|
-
markdown: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block: 0 0;\n\n font-size: 14px;\n line-height:
|
|
17
|
-
markdownInChat: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n h1 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.6em;\n }\n\n h2 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.4em;\n }\n\n h3 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.2em;\n }\n\n h4 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.1em;\n }\n\n h5 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1em;\n }\n "]))),
|
|
16
|
+
markdown: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block: 0 0;\n\n font-size: 14px;\n line-height: 2;\n color: ", ";\n word-break: break-all;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 1em;\n }\n\n &:not(:last-child) {\n margin-bottom: 1.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\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 pre,\n [data-code-type='highlighter'] {\n border: none;\n border-radius: ", "px;\n\n > code {\n padding: 0 !important;\n border: none !important;\n }\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block: 1em 1em;\n margin-inline: 0 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n code {\n display: inline-flex;\n }\n }\n\n th,\n td {\n padding-block: 10px 10px;\n padding-inline: 16px 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n > ol > li::marker {\n color: ", " !important;\n }\n\n > ul > li {\n line-height: 1.8;\n list-style-type: disc;\n\n &::marker {\n color: ", " !important;\n }\n }\n\n ol,\n ul {\n > li::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, cyanColor, cyanBackground, isDarkMode ? token.cyan1A : token.cyan6A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan9A : token.cyan10A, token.colorTextDescription, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
|
|
17
|
+
markdownInChat: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n h1 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.6em;\n }\n\n h2 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.4em;\n }\n\n h3 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.2em;\n }\n\n h4 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.1em;\n }\n\n h5 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1em;\n }\n\n > *:last-child {\n margin-bottom: 0 !important;\n }\n\n p {\n line-height: 1.8;\n\n + * {\n margin-block-end: 0.5em;\n }\n\n &:not(:last-child) {\n margin-bottom: 1em;\n }\n }\n "]))),
|
|
18
18
|
noScrollbar: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
|
|
19
19
|
resetLinkColor: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText)
|
|
20
20
|
};
|