@lobehub/ui 1.72.8 → 1.74.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/ChatHeader/ChatHeaderTitle.d.ts +8 -0
- package/es/ChatHeader/ChatHeaderTitle.js +65 -0
- package/es/ChatItem/style.js +1 -1
- package/es/Form/components/FormTitle.js +1 -1
- package/es/Icon/icons/DiscordIcon.d.ts +3 -0
- package/es/Icon/icons/DiscordIcon.js +17 -0
- package/es/Icon/icons/index.d.ts +1 -0
- package/es/Icon/icons/index.js +1 -0
- package/es/Markdown/index.js +8 -1
- package/es/SliderWithInput/index.d.ts +9 -0
- package/es/SliderWithInput/index.js +69 -0
- package/es/Tag/index.d.ts +7 -0
- package/es/Tag/index.js +41 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -0
- package/es/styles/algorithms/generateCustomStylish.js +3 -1
- 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
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ChatHeaderTitleProps {
|
|
3
|
+
desc?: string | ReactNode;
|
|
4
|
+
tag?: ReactNode;
|
|
5
|
+
title: string | ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const ChatHeaderTitle: import("react").NamedExoticComponent<ChatHeaderTitleProps>;
|
|
8
|
+
export default ChatHeaderTitle;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
var useStyles = createStyles(function (_ref) {
|
|
9
|
+
var css = _ref.css,
|
|
10
|
+
token = _ref.token;
|
|
11
|
+
return {
|
|
12
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n flex: 1;\n max-width: 100%;\n "]))),
|
|
13
|
+
desc: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n width: 100%;\n\n font-size: 12px;\n color: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n "])), token.colorTextTertiary),
|
|
14
|
+
tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: none;\n "]))),
|
|
15
|
+
title: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n font-size: 16px;\n font-weight: bold;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
|
|
16
|
+
titleContainer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: 1;\n "]))),
|
|
17
|
+
titleWithDesc: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n font-weight: bold;\n text-overflow: ellipsis;\n white-space: nowrap;\n "])))
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
var ChatHeaderTitle = /*#__PURE__*/memo(function (_ref2) {
|
|
21
|
+
var title = _ref2.title,
|
|
22
|
+
desc = _ref2.desc,
|
|
23
|
+
tag = _ref2.tag;
|
|
24
|
+
var _useStyles = useStyles(),
|
|
25
|
+
styles = _useStyles.styles;
|
|
26
|
+
if (desc) return /*#__PURE__*/_jsxs(Flexbox, {
|
|
27
|
+
className: styles.container,
|
|
28
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
29
|
+
align: 'center',
|
|
30
|
+
className: styles.titleContainer,
|
|
31
|
+
gap: 8,
|
|
32
|
+
horizontal: true,
|
|
33
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: styles.titleWithDesc,
|
|
35
|
+
children: title
|
|
36
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
37
|
+
className: styles.tag,
|
|
38
|
+
horizontal: true,
|
|
39
|
+
children: tag
|
|
40
|
+
})]
|
|
41
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
42
|
+
align: 'center',
|
|
43
|
+
horizontal: true,
|
|
44
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
45
|
+
className: styles.desc,
|
|
46
|
+
children: desc
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
51
|
+
align: 'center',
|
|
52
|
+
className: styles.container,
|
|
53
|
+
gap: 8,
|
|
54
|
+
horizontal: true,
|
|
55
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
56
|
+
className: styles.title,
|
|
57
|
+
children: title
|
|
58
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
59
|
+
className: styles.tag,
|
|
60
|
+
horizontal: true,
|
|
61
|
+
children: tag
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
export default ChatHeaderTitle;
|
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),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Tag } from 'antd';
|
|
2
1
|
import { memo } from 'react';
|
|
3
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
|
+
import Tag from "../../Tag";
|
|
4
4
|
import { useStyles } from "./style";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { createLucideIcon } from 'lucide-react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
var Discord = createLucideIcon('Discord', [['path', {
|
|
7
|
+
d: 'M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z',
|
|
8
|
+
key: '18tl5t'
|
|
9
|
+
}]]);
|
|
10
|
+
var DiscordIcon = function DiscordIcon(props) {
|
|
11
|
+
return /*#__PURE__*/_jsx(Discord, _objectSpread({
|
|
12
|
+
style: {
|
|
13
|
+
overflow: 'visible'
|
|
14
|
+
}
|
|
15
|
+
}, props));
|
|
16
|
+
};
|
|
17
|
+
export default DiscordIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DiscordIcon } from './DiscordIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DiscordIcon } from "./DiscordIcon";
|
package/es/Markdown/index.js
CHANGED
|
@@ -22,7 +22,14 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
22
22
|
a: Typography.Link,
|
|
23
23
|
code: Code,
|
|
24
24
|
details: Collapse,
|
|
25
|
-
hr:
|
|
25
|
+
hr: function hr() {
|
|
26
|
+
return /*#__PURE__*/_jsx(Divider, {
|
|
27
|
+
style: {
|
|
28
|
+
marginBottom: '1em',
|
|
29
|
+
marginTop: 0
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
26
33
|
pre: CodeBlock
|
|
27
34
|
};
|
|
28
35
|
return /*#__PURE__*/_jsx(Typography, {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type InputNumberProps } from 'antd';
|
|
3
|
+
import { SliderSingleProps } from 'antd/es/slider';
|
|
4
|
+
export interface SliderWithInputProps extends SliderSingleProps {
|
|
5
|
+
controls?: InputNumberProps['controls'];
|
|
6
|
+
size?: InputNumberProps['size'];
|
|
7
|
+
}
|
|
8
|
+
declare const SliderWithInput: import("react").NamedExoticComponent<SliderWithInputProps>;
|
|
9
|
+
export default SliderWithInput;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["step", "value", "onChange", "max", "min", "defaultValue", "size", "controls", "style", "className", "disabled"];
|
|
4
|
+
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; }
|
|
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
|
+
import { InputNumber, Slider } from 'antd';
|
|
7
|
+
import { isNull } from 'lodash-es';
|
|
8
|
+
import { memo, useCallback } from 'react';
|
|
9
|
+
import { Flexbox } from 'react-layout-kit';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var SliderWithInput = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var step = _ref.step,
|
|
14
|
+
value = _ref.value,
|
|
15
|
+
onChange = _ref.onChange,
|
|
16
|
+
max = _ref.max,
|
|
17
|
+
min = _ref.min,
|
|
18
|
+
defaultValue = _ref.defaultValue,
|
|
19
|
+
size = _ref.size,
|
|
20
|
+
controls = _ref.controls,
|
|
21
|
+
style = _ref.style,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
disabled = _ref.disabled,
|
|
24
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var handleOnchange = useCallback(function (value) {
|
|
26
|
+
if (Number.isNaN(value) || isNull(value)) return;
|
|
27
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
28
|
+
}, []);
|
|
29
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
30
|
+
align: 'center',
|
|
31
|
+
className: className,
|
|
32
|
+
direction: 'horizontal',
|
|
33
|
+
gap: 8,
|
|
34
|
+
style: style,
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Slider, _objectSpread({
|
|
36
|
+
defaultValue: defaultValue,
|
|
37
|
+
disabled: disabled,
|
|
38
|
+
max: max,
|
|
39
|
+
min: min,
|
|
40
|
+
onChange: handleOnchange,
|
|
41
|
+
step: step,
|
|
42
|
+
style: size === 'small' ? {
|
|
43
|
+
flex: 1,
|
|
44
|
+
margin: 0
|
|
45
|
+
} : {
|
|
46
|
+
flex: 1
|
|
47
|
+
},
|
|
48
|
+
tooltip: {
|
|
49
|
+
open: false
|
|
50
|
+
},
|
|
51
|
+
value: typeof value === 'number' ? value : 0
|
|
52
|
+
}, props)), /*#__PURE__*/_jsx(InputNumber, {
|
|
53
|
+
controls: size !== 'small' || controls,
|
|
54
|
+
defaultValue: defaultValue,
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
max: max,
|
|
57
|
+
min: min,
|
|
58
|
+
onChange: handleOnchange,
|
|
59
|
+
size: size,
|
|
60
|
+
step: Number.isNaN(step) || isNull(step) ? undefined : step,
|
|
61
|
+
style: {
|
|
62
|
+
flex: 1,
|
|
63
|
+
maxWidth: size === 'small' ? 40 : 64
|
|
64
|
+
},
|
|
65
|
+
value: typeof value === 'number' ? value : 0
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
export default SliderWithInput;
|
package/es/Tag/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["icon", "children"];
|
|
5
|
+
var _templateObject, _templateObject2;
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import { Tag as AntTag } from 'antd';
|
|
9
|
+
import { createStyles } from 'antd-style';
|
|
10
|
+
import { memo } from 'react';
|
|
11
|
+
import { Flexbox } from 'react-layout-kit';
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var useStyles = createStyles(function (_ref) {
|
|
15
|
+
var cx = _ref.cx,
|
|
16
|
+
css = _ref.css,
|
|
17
|
+
token = _ref.token;
|
|
18
|
+
return {
|
|
19
|
+
count: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n height: 20px;\n padding: 0 8px;\n\n font-size: 12px;\n line-height: 1;\n\n background: ", ";\n border: ", "px;\n "])), token.colorFillTertiary, token.borderRadius),
|
|
20
|
+
tag: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", " !important;\n background: ", ";\n border: ", "px;\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorTextSecondary, token.colorFillSecondary, token.borderRadius, token.colorText, token.colorFill))
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
var Tag = /*#__PURE__*/memo(function (_ref2) {
|
|
24
|
+
var icon = _ref2.icon,
|
|
25
|
+
children = _ref2.children,
|
|
26
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
27
|
+
var _useStyles = useStyles(),
|
|
28
|
+
styles = _useStyles.styles;
|
|
29
|
+
return /*#__PURE__*/_jsx(AntTag, _objectSpread(_objectSpread({
|
|
30
|
+
bordered: false,
|
|
31
|
+
className: styles.tag
|
|
32
|
+
}, props), {}, {
|
|
33
|
+
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
34
|
+
align: 'center',
|
|
35
|
+
gap: 4,
|
|
36
|
+
horizontal: true,
|
|
37
|
+
children: [icon, children]
|
|
38
|
+
})
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
export default Tag;
|
package/es/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
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';
|
|
7
|
+
export { default as ChatHeaderTitle, type ChatHeaderTitleProps, } from './ChatHeader/ChatHeaderTitle';
|
|
6
8
|
export { default as ChatInputArea, type ChatInputAreaProps } from './ChatInputArea';
|
|
7
9
|
export { default as ChatItem, type ChatItemProps } from './ChatItem';
|
|
8
10
|
export type { ChatListProps, OnActionClick, OnMessageChange, RenderErrorMessage, RenderMessage, } from './ChatList';
|
|
@@ -37,6 +39,7 @@ export { default as Header, type HeaderProps } from './Header';
|
|
|
37
39
|
export { default as Hero, type HeroAction, type HeroProps } from './Hero';
|
|
38
40
|
export { default as Highlighter, type HighlighterProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from './Highlighter';
|
|
39
41
|
export { default as Icon, type IconProps, type IconSize } from './Icon';
|
|
42
|
+
export * from './Icon/icons';
|
|
40
43
|
export { Input, type InputProps, TextArea, type TextAreaProps } from './Input';
|
|
41
44
|
export { default as Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, } from './Layout';
|
|
42
45
|
export { default as List } from './List';
|
|
@@ -47,12 +50,14 @@ export { default as MessageInput, type MessageInputProps } from './MessageInput'
|
|
|
47
50
|
export { default as MessageModal, type MessageModalProps } from './MessageModal';
|
|
48
51
|
export { default as SearchBar, type SearchBarProps } from './SearchBar';
|
|
49
52
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
53
|
+
export { default as SliderWithInput, type SliderWithInputProps } from './SliderWithInput';
|
|
50
54
|
export { default as Snippet, type SnippetProps } from './Snippet';
|
|
51
55
|
export { default as Spotlight, type SpotlightProps } from './Spotlight';
|
|
52
56
|
export { default as StroyBook, type StroyBookProps, useControls, useCreateStore, } from './StroyBook';
|
|
53
57
|
export * from './styles';
|
|
54
58
|
export { default as Swatches, type SwatchesProps } from './Swatches';
|
|
55
59
|
export { default as TabsNav, type TabsNavProps } from './TabsNav';
|
|
60
|
+
export { default as Tag, type TagProps } from './Tag';
|
|
56
61
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
57
62
|
export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
|
|
58
63
|
export { default as Toc, type TocProps } from './Toc';
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
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";
|
|
7
|
+
export { default as ChatHeaderTitle } from "./ChatHeader/ChatHeaderTitle";
|
|
6
8
|
export { default as ChatInputArea } from "./ChatInputArea";
|
|
7
9
|
export { default as ChatItem } from "./ChatItem";
|
|
8
10
|
export { default as ChatList } from "./ChatList";
|
|
@@ -36,6 +38,7 @@ export { default as Header } from "./Header";
|
|
|
36
38
|
export { default as Hero } from "./Hero";
|
|
37
39
|
export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
|
|
38
40
|
export { default as Icon } from "./Icon";
|
|
41
|
+
export * from "./Icon/icons";
|
|
39
42
|
export { Input, TextArea } from "./Input";
|
|
40
43
|
export { default as Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc } from "./Layout";
|
|
41
44
|
export { default as List } from "./List";
|
|
@@ -46,12 +49,14 @@ export { default as MessageInput } from "./MessageInput";
|
|
|
46
49
|
export { default as MessageModal } from "./MessageModal";
|
|
47
50
|
export { default as SearchBar } from "./SearchBar";
|
|
48
51
|
export { default as SideNav } from "./SideNav";
|
|
52
|
+
export { default as SliderWithInput } from "./SliderWithInput";
|
|
49
53
|
export { default as Snippet } from "./Snippet";
|
|
50
54
|
export { default as Spotlight } from "./Spotlight";
|
|
51
55
|
export { default as StroyBook, useControls, useCreateStore } from "./StroyBook";
|
|
52
56
|
export * from "./styles";
|
|
53
57
|
export { default as Swatches } from "./Swatches";
|
|
54
58
|
export { default as TabsNav } from "./TabsNav";
|
|
59
|
+
export { default as Tag } from "./Tag";
|
|
55
60
|
export { default as ThemeProvider } from "./ThemeProvider";
|
|
56
61
|
export { default as ThemeSwitch } from "./ThemeSwitch";
|
|
57
62
|
export { default as Toc } from "./Toc";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
3
|
import { keyframes } from 'antd-style';
|
|
4
|
+
import { readableColor } from 'polished';
|
|
4
5
|
export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
5
6
|
var css = _ref.css,
|
|
6
7
|
token = _ref.token,
|
|
7
8
|
isDarkMode = _ref.isDarkMode;
|
|
9
|
+
var cyan = isDarkMode ? token.cyan9A : token.cyan10A;
|
|
8
10
|
var gradient = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n "])));
|
|
9
11
|
return {
|
|
10
12
|
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
|
|
11
13
|
blurStrong: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n backdrop-filter: blur(36px);\n "]))),
|
|
12
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),
|
|
13
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),
|
|
14
|
-
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-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.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 p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border: none;\n border-radius: ", "px;\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-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\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 li {\n line-height: 1.8;\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-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n > *:last-child {\n margin-bottom: 0 !important;\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 p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\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-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\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 {\n margin-left: 0;\n }\n\n ol {\n counter-reset: steps;\n margin-left: 0;\n list-style: none;\n\n li {\n counter-increment: steps;\n\n &::before {\n content: counter(steps);\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n width: 1.1rem;\n height: 1.1rem;\n margin-right: 0.5em;\n\n font-size: 0.8em;\n font-weight: 500;\n line-height: 1;\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n }\n }\n\n ol li::before {\n color: ", ";\n background: ", ";\n }\n }\n\n > ul {\n > li {\n line-height: 1.8;\n list-style-type: disc;\n\n &::marker {\n color: ", ";\n }\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 "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, readableColor(cyan), cyan, token.colorTextSecondary, token.colorFill, cyan, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
|
|
15
17
|
noScrollbar: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
|
|
16
18
|
resetLinkColor: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText)
|
|
17
19
|
};
|