@lobehub/ui 1.18.2 → 1.20.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/index.d.ts +14 -1
- package/es/ActionIcon/index.js +23 -7
- package/es/ActionIcon/style.js +1 -1
- package/es/Chat/store/index.d.ts +1 -1
- package/es/ColorScales/ScaleRow.js +1 -1
- package/es/ColorScales/style.js +1 -1
- package/es/ContextMenu/MenuItem/style.js +2 -2
- package/es/ContextMenu/index.js +1 -1
- package/es/Conversation/InputArea/index.js +1 -1
- package/es/Conversation/index.js +1 -1
- package/es/DraggablePanel/style.js +3 -3
- package/es/Highlighter/SyntaxHighlighter/style.js +1 -1
- package/es/Highlighter/index.js +1 -1
- package/es/Highlighter/style.js +2 -1
- package/es/Icon/index.d.ts +9 -4
- package/es/Icon/index.js +24 -9
- package/es/Icon/style.d.ts +3 -0
- package/es/Icon/style.js +10 -0
- package/es/Input/style.d.ts +2 -2
- package/es/Input/style.js +6 -4
- package/es/List/ListItem/time.js +1 -1
- package/es/Markdown/CodeBlock.js +1 -1
- package/es/SearchBar/index.d.ts +5 -0
- package/es/SearchBar/index.js +5 -4
- package/es/SearchBar/style.js +2 -2
- package/es/Snippet/index.d.ts +5 -0
- package/es/Snippet/index.js +4 -4
- package/es/Snippet/style.d.ts +1 -1
- package/es/Snippet/style.js +4 -2
- package/es/Spotlight/index.d.ts +11 -0
- package/es/Spotlight/index.js +68 -0
- package/es/Spotlight/style.d.ts +8 -0
- package/es/Spotlight/style.js +17 -0
- package/es/StroyBook/style.js +1 -1
- package/es/TabsNav/style.js +1 -1
- package/es/ThemeProvider/GlobalStyle.js +1 -1
- package/es/ThemeProvider/index.d.ts +1 -1
- package/es/ThemeProvider/index.js +1 -1
- package/es/Tooltip/style.js +1 -1
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +1 -0
- package/es/styles/algorithms/generateCustomStylish.js +1 -1
- package/es/types/global.d.ts +0 -1
- package/es/types/index.d.ts +6 -6
- package/package.json +4 -19
package/es/ActionIcon/index.d.ts
CHANGED
|
@@ -28,7 +28,15 @@ export interface ActionIconProps extends DivProps {
|
|
|
28
28
|
* @description The icon element to be rendered
|
|
29
29
|
* @type LucideIcon
|
|
30
30
|
*/
|
|
31
|
-
icon
|
|
31
|
+
icon?: LucideIcon;
|
|
32
|
+
/**
|
|
33
|
+
* @description Set the loading status of ActionIcon
|
|
34
|
+
*/
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @description Handle click action
|
|
38
|
+
*/
|
|
39
|
+
onClick?: () => void;
|
|
32
40
|
/**
|
|
33
41
|
* @description The position of the tooltip relative to the target
|
|
34
42
|
* @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
|
|
@@ -40,6 +48,11 @@ export interface ActionIconProps extends DivProps {
|
|
|
40
48
|
* @default 'normal'
|
|
41
49
|
*/
|
|
42
50
|
size?: ActionIconSize;
|
|
51
|
+
/**
|
|
52
|
+
* @description Whether add spotlight background
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
spotlight?: boolean;
|
|
43
56
|
/**
|
|
44
57
|
* @description The text shown in the tooltip
|
|
45
58
|
*/
|
package/es/ActionIcon/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow"];
|
|
3
|
+
var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading"];
|
|
4
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
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 { Loader2 } from 'lucide-react';
|
|
6
7
|
import { memo } from 'react';
|
|
7
|
-
import { Icon, Tooltip } from "./..";
|
|
8
|
+
import { Icon, Spotlight, Tooltip } from "./..";
|
|
8
9
|
import { useStyles } from "./style";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
13
|
var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
11
14
|
var className = _ref.className,
|
|
12
15
|
active = _ref.active,
|
|
@@ -19,6 +22,10 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
22
|
placement = _ref.placement,
|
|
20
23
|
_ref$arrow = _ref.arrow,
|
|
21
24
|
arrow = _ref$arrow === void 0 ? false : _ref$arrow,
|
|
25
|
+
spotlight = _ref.spotlight,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
loading = _ref.loading,
|
|
22
29
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
30
|
var _useStyles = useStyles({
|
|
24
31
|
active: Boolean(active),
|
|
@@ -50,18 +57,27 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
57
|
borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
|
|
51
58
|
break;
|
|
52
59
|
}
|
|
53
|
-
var
|
|
60
|
+
var content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
61
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
62
|
+
icon: icon,
|
|
63
|
+
size: size === 'site' ? 'normal' : size
|
|
64
|
+
}), children]
|
|
65
|
+
});
|
|
66
|
+
var spin = /*#__PURE__*/_jsx(Icon, {
|
|
67
|
+
icon: Loader2,
|
|
68
|
+
size: size === 'site' ? 'normal' : size,
|
|
69
|
+
spin: true
|
|
70
|
+
});
|
|
71
|
+
var actionIconBlock = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
54
72
|
className: cx(styles.block, className),
|
|
73
|
+
onClick: loading ? undefined : onClick,
|
|
55
74
|
style: _objectSpread({
|
|
56
75
|
width: blockSize,
|
|
57
76
|
height: blockSize,
|
|
58
77
|
borderRadius: borderRadius
|
|
59
78
|
}, style)
|
|
60
79
|
}, props), {}, {
|
|
61
|
-
children: /*#__PURE__*/_jsx(
|
|
62
|
-
icon: icon,
|
|
63
|
-
size: size === 'site' ? 'normal' : size
|
|
64
|
-
})
|
|
80
|
+
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), loading ? spin : content]
|
|
65
81
|
}));
|
|
66
82
|
if (!title) return actionIconBlock;
|
|
67
83
|
return /*#__PURE__*/_jsx(Tooltip, {
|
package/es/ActionIcon/style.js
CHANGED
|
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
9
9
|
var active = _ref2.active,
|
|
10
10
|
glass = _ref2.glass;
|
|
11
11
|
return {
|
|
12
|
-
block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
|
|
12
|
+
block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ", transform 400ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n transform: scale(0.8);\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
|
|
13
13
|
};
|
|
14
14
|
});
|
package/es/Chat/store/index.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export declare const Provider: ({ createStore, children }: {
|
|
|
15
15
|
subscribe: (listener: (state: ChatStore, prevState: ChatStore) => void) => () => void;
|
|
16
16
|
destroy: () => void;
|
|
17
17
|
};
|
|
18
|
-
export {
|
|
18
|
+
export { type MessageDispatch, messagesReducer } from './messageReducer';
|
|
19
19
|
export * from './selectors';
|
|
20
20
|
export type { ChatStore } from './store';
|
package/es/ColorScales/style.js
CHANGED
|
@@ -9,7 +9,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
9
9
|
var css = _ref.css;
|
|
10
10
|
return {
|
|
11
11
|
view: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n "]))),
|
|
12
|
-
scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n &:active {\n transform: scale(0.95);\n }\n "]))),
|
|
12
|
+
scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n &:active {\n transform: scale(0.95);\n }\n "]))),
|
|
13
13
|
scaleItem: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
|
|
14
14
|
scaleRowTitle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
|
|
15
15
|
text: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "])))
|
|
@@ -5,9 +5,9 @@ export var useStyles = createStyles(function (_ref, prefixCls) {
|
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
cx = _ref.cx,
|
|
7
7
|
token = _ref.token;
|
|
8
|
-
var selected = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n background: ", ";\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorPrimaryText, token.colorPrimaryBg, token.colorPrimaryTextHover, token.colorPrimaryBgHover);
|
|
8
|
+
var selected = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n background: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorPrimaryText, token.colorPrimaryBg, token.colorPrimaryTextHover, token.colorPrimaryBgHover);
|
|
9
9
|
return {
|
|
10
|
-
item: cx("".concat(prefixCls, "-item"), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n all: unset;\n\n user-select: none;\n scroll-margin: 50px;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n box-sizing: inherit;\n width: 100%;\n padding: 12px 10px;\n\n font-family: ", ";\n font-weight: normal;\n line-height: 1;\n color: ", ";\n\n background: transparent;\n border-radius: 5px;\n &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, token.colorFillTertiary)),
|
|
10
|
+
item: cx("".concat(prefixCls, "-item"), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n all: unset;\n\n user-select: none;\n scroll-margin: 50px;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n box-sizing: inherit;\n width: 100%;\n padding: 12px 10px;\n\n font-family: ", ";\n font-weight: normal;\n line-height: 1;\n color: ", ";\n\n background: transparent;\n border-radius: 5px;\n\n &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, token.colorFillTertiary)),
|
|
11
11
|
selected: cx("".concat(prefixCls, "-item-selected"), selected),
|
|
12
12
|
active: cx("".concat(prefixCls, "-item-active"), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorFillTertiary)),
|
|
13
13
|
arrow: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary),
|
package/es/ContextMenu/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
var _excluded = ["items", "label", "container"];
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
|
-
import {
|
|
7
|
+
import { FloatingFocusManager, FloatingNode, FloatingPortal, FloatingTree, autoUpdate, flip, offset, safePolygon, shift, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListNavigation, useMergeRefs, useRole, useTypeahead } from '@floating-ui/react';
|
|
8
8
|
import { Divider } from 'antd';
|
|
9
9
|
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import MenuItem from "./MenuItem";
|
|
@@ -20,7 +20,7 @@ var useStyles = createStyles(function (_ref) {
|
|
|
20
20
|
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: sticky;\n z-index: ", ";\n bottom: 0;\n\n padding-top: 12px;\n padding-bottom: 24px;\n\n background-image: linear-gradient(to top, ", " 88%, transparent 100%);\n\n ", " {\n width: 100%;\n }\n "])), token.zIndexPopupBase, token.colorBgLayout, responsive.mobile),
|
|
21
21
|
boxShadow: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n border-radius: 8px;\n box-shadow: ", ";\n "])), token.boxShadowSecondary),
|
|
22
22
|
input: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n border-radius: 8px;\n "]))),
|
|
23
|
-
btn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n &:hover {\n color: ", ";\n }\n "])), token.colorTextTertiary, token.colorTextSecondary),
|
|
23
|
+
btn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextTertiary, token.colorTextSecondary),
|
|
24
24
|
extra: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary)
|
|
25
25
|
};
|
|
26
26
|
});
|
package/es/Conversation/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var _excluded = ["readonly", "devtools", "includeSystem"];
|
|
|
4
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
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { memo, useRef } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { Provider, createChatStore } from "../Chat/store";
|
|
8
8
|
import ChatContainer from "./App";
|
|
9
9
|
import StoreUpdater from "./StoreUpdater";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -6,7 +6,7 @@ var toggleLength = 40;
|
|
|
6
6
|
var toggleShort = 16;
|
|
7
7
|
export var useStyle = createStyles(function (_ref, prefix) {
|
|
8
8
|
var token = _ref.token;
|
|
9
|
-
var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
9
|
+
var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
10
10
|
var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1001;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
|
|
11
11
|
var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 2000;\n "])));
|
|
12
12
|
return {
|
|
@@ -16,8 +16,8 @@ export var useStyle = createStyles(function (_ref, prefix) {
|
|
|
16
16
|
rightFloat: cx(float, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n "])))),
|
|
17
17
|
topFloat: cx(float, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n "])))),
|
|
18
18
|
bottomFloat: cx(float, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n "])))),
|
|
19
|
-
toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
20
|
-
toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
19
|
+
toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
20
|
+
toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
21
21
|
toggleTop: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-top"), commonToggle, css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n top: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-left: -20px;\n\n border-radius: 4px 4px 0 0;\n }\n "])), offset, toggleShort, toggleLength, toggleShort)),
|
|
22
22
|
toggleBottom: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-bottom"), commonToggle, css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n bottom: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: 16px;\n margin-left: -20px;\n\n border-radius: 0 0 4px 4px;\n }\n "])), offset, toggleShort, toggleLength)),
|
|
23
23
|
panel: cx("".concat(prefix, "-fixed"), css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
|
|
@@ -11,6 +11,6 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
11
11
|
return {
|
|
12
12
|
shiki: cx("".concat(prefix, "-shiki"), css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .shiki {\n overflow-x: scroll;\n background: none !important;\n }\n "])))),
|
|
13
13
|
prism: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pre {\n overflow-x: scroll;\n font-family: ", " !important;\n }\n "])), token.fontFamilyCode),
|
|
14
|
-
loading: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n\n padding:
|
|
14
|
+
loading: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n top: 0;\n right: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n height: 34px;\n padding: 0 8px;\n\n font-family: ", ";\n color: ", ";\n\n border-radius: ", ";\n "])), token.fontFamilyCode, token.colorTextTertiary, token.borderRadius))
|
|
15
15
|
};
|
|
16
16
|
});
|
package/es/Highlighter/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
import CopyButton from "../CopyButton";
|
|
3
|
-
import { useStyles } from "./style";
|
|
4
3
|
import SyntaxHighlighter from "./SyntaxHighlighter";
|
|
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";
|
|
7
7
|
export { SyntaxHighlighter };
|
package/es/Highlighter/style.js
CHANGED
|
@@ -9,8 +9,9 @@ export var useStyles = createStyles(function (_ref, type) {
|
|
|
9
9
|
var prefix = "".concat(prefixCls, "-highlighter");
|
|
10
10
|
var buttonHoverCls = "".concat(prefix, "-hover-btn");
|
|
11
11
|
var langHoverCls = "".concat(prefix, "-hover-lang");
|
|
12
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, type === 'prue' ? 'transparent' : token.colorFillTertiary);
|
|
12
13
|
return {
|
|
13
|
-
container: cx(prefix, css(
|
|
14
|
+
container: cx(prefix, typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: auto;\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n\n &:hover {\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), token.borderRadius, token.motionEaseOut, buttonHoverCls, langHoverCls, type === 'prue' ? 0 : "16px 24px")),
|
|
14
15
|
button: cx(buttonHoverCls, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 51;\n top: 8px;\n right: 8px;\n\n opacity: 0;\n "])))),
|
|
15
16
|
lang: cx(langHoverCls, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 50;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n\n opacity: 0;\n\n transition: opacity 0.1s;\n "])), token.colorTextPlaceholder))
|
|
16
17
|
};
|
package/es/Icon/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LucideIcon } from 'lucide-react';
|
|
3
|
-
import {
|
|
3
|
+
import { DivProps } from "../types";
|
|
4
4
|
export declare type IconSize = 'large' | 'normal' | 'small' | {
|
|
5
5
|
fontSize?: number;
|
|
6
6
|
strokeWidth?: number;
|
|
7
7
|
};
|
|
8
|
-
export interface IconProps extends
|
|
8
|
+
export interface IconProps extends DivProps {
|
|
9
9
|
/**
|
|
10
10
|
* @description The icon element to be rendered
|
|
11
11
|
* @type LucideIcon
|
|
@@ -16,6 +16,11 @@ export interface IconProps extends SvgProps {
|
|
|
16
16
|
* @default 'normal'
|
|
17
17
|
*/
|
|
18
18
|
size?: IconSize;
|
|
19
|
+
/**
|
|
20
|
+
* @description Rotate icon with animation
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
spin?: boolean;
|
|
19
24
|
}
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
25
|
+
declare const Icon: import("react").NamedExoticComponent<IconProps>;
|
|
26
|
+
export default Icon;
|
package/es/Icon/index.js
CHANGED
|
@@ -1,17 +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"];
|
|
3
|
+
var _excluded = ["icon", "size", "style", "className", "spin"];
|
|
4
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
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
+
import { useStyles } from "./style";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
var Icon = function
|
|
9
|
+
var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
9
10
|
var icon = _ref.icon,
|
|
10
11
|
size = _ref.size,
|
|
12
|
+
style = _ref.style,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
spin = _ref.spin,
|
|
11
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var _useStyles = useStyles(),
|
|
17
|
+
styles = _useStyles.styles,
|
|
18
|
+
cx = _useStyles.cx;
|
|
19
|
+
var SvgIcon = icon;
|
|
12
20
|
var fontSize;
|
|
13
21
|
var strokeWidth;
|
|
14
|
-
var SvgIcon = icon;
|
|
15
22
|
switch (size) {
|
|
16
23
|
case 'large':
|
|
17
24
|
fontSize = 24;
|
|
@@ -35,9 +42,17 @@ var Icon = function Icon(_ref) {
|
|
|
35
42
|
}
|
|
36
43
|
break;
|
|
37
44
|
}
|
|
38
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
46
|
+
className: cx(spin && styles.spin, className),
|
|
47
|
+
style: _objectSpread({
|
|
48
|
+
width: fontSize,
|
|
49
|
+
height: fontSize
|
|
50
|
+
}, style)
|
|
51
|
+
}, props), {}, {
|
|
52
|
+
children: /*#__PURE__*/_jsx(SvgIcon, {
|
|
53
|
+
size: fontSize,
|
|
54
|
+
strokeWidth: strokeWidth
|
|
55
|
+
})
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
export default Icon;
|
package/es/Icon/style.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
import { createStyles, keyframes } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css;
|
|
6
|
+
var spin = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "])));
|
|
7
|
+
return {
|
|
8
|
+
spin: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n animation: ", " 1s linear infinite;\n "])), spin)
|
|
9
|
+
};
|
|
10
|
+
});
|
package/es/Input/style.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useStyles: (props?: {
|
|
2
2
|
type: 'ghost' | 'block';
|
|
3
3
|
} | undefined) => import("antd-style").ReturnStyles<{
|
|
4
|
-
input:
|
|
5
|
-
textarea:
|
|
4
|
+
input: string;
|
|
5
|
+
textarea: string;
|
|
6
6
|
}>;
|
package/es/Input/style.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
-
var
|
|
5
|
+
var cx = _ref.cx,
|
|
6
|
+
css = _ref.css,
|
|
6
7
|
token = _ref.token;
|
|
7
8
|
var type = _ref2.type;
|
|
9
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
|
|
8
10
|
return {
|
|
9
|
-
input: css(
|
|
10
|
-
textarea: css(
|
|
11
|
+
input: cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n height: 36px;\n padding: 0 12px;\n\n transition: background-color 100ms ", ";\n\n input {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n "])), token.motionEaseOut, token.colorFillTertiary, token.colorBorder, token.colorTextQuaternary)),
|
|
12
|
+
textarea: cx(typeStylish, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n padding: 8px 12px;\n transition: background-color 100ms ", ";\n\n textarea {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n "])), token.motionEaseOut, token.colorFillTertiary, token.colorBorder, token.colorTextQuaternary))
|
|
11
13
|
};
|
|
12
14
|
});
|
package/es/List/ListItem/time.js
CHANGED
package/es/Markdown/CodeBlock.js
CHANGED
|
@@ -6,7 +6,7 @@ import Highlighter from "../Highlighter";
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
var useStyles = createStyles(function (_ref) {
|
|
8
8
|
var css = _ref.css;
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start:
|
|
9
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n }\n "])));
|
|
10
10
|
});
|
|
11
11
|
var Code = /*#__PURE__*/memo(function (props) {
|
|
12
12
|
var _useStyles = useStyles(),
|
package/es/SearchBar/index.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export interface SearchBarProps extends InputProps {
|
|
|
11
11
|
* @default 'f'
|
|
12
12
|
*/
|
|
13
13
|
shortKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description Whether add spotlight background
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
spotlight?: boolean;
|
|
14
19
|
}
|
|
15
20
|
declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
|
|
16
21
|
export default SearchBar;
|
package/es/SearchBar/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
|
|
4
|
+
var _excluded = ["spotlight", "className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
|
|
5
5
|
var _navigator;
|
|
6
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
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
8
|
import { Tag } from 'antd';
|
|
9
9
|
import { Search } from 'lucide-react';
|
|
10
10
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
11
|
-
import { Icon, Input } from "./..";
|
|
11
|
+
import { Icon, Input, Spotlight } from "./..";
|
|
12
12
|
import { useStyles } from "./style";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform : '');
|
|
16
16
|
var symbol = isAppleDevice ? '⌘' : 'Ctrl';
|
|
17
17
|
var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
18
|
-
var
|
|
18
|
+
var spotlight = _ref.spotlight,
|
|
19
|
+
className = _ref.className,
|
|
19
20
|
value = _ref.value,
|
|
20
21
|
_onChange = _ref.onChange,
|
|
21
22
|
placeholder = _ref.placeholder,
|
|
@@ -51,7 +52,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
51
52
|
}, []);
|
|
52
53
|
return /*#__PURE__*/_jsxs("div", {
|
|
53
54
|
className: styles.search,
|
|
54
|
-
children: [/*#__PURE__*/_jsx(Input, _objectSpread({
|
|
55
|
+
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
55
56
|
allowClear: true,
|
|
56
57
|
className: cx(styles.input, className),
|
|
57
58
|
onBlur: function onBlur() {
|
package/es/SearchBar/style.js
CHANGED
|
@@ -5,9 +5,9 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
token = _ref.token;
|
|
7
7
|
return {
|
|
8
|
-
search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
|
|
8
|
+
search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n\n .ant-input-affix-wrapper {\n &:hover {\n border-color: ", ";\n }\n }\n\n .ant-input-affix-wrapper-focused {\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n }\n "])), token.colorBorder, token.colorTextQuaternary, token.colorTextQuaternary),
|
|
9
9
|
input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 8px 0 12px;\n "]))),
|
|
10
|
-
tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n "]))),
|
|
10
|
+
tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n "]))),
|
|
11
11
|
icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
|
|
12
12
|
};
|
|
13
13
|
});
|
package/es/Snippet/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export interface SnippetProps extends DivProps {
|
|
|
15
15
|
* @default 'tsx'
|
|
16
16
|
*/
|
|
17
17
|
language?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @description Whether add spotlight background
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
spotlight?: boolean;
|
|
18
23
|
/**
|
|
19
24
|
* @description The symbol to be displayed before the content inside the Snippet component
|
|
20
25
|
*/
|
package/es/Snippet/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["symbol", "language", "children", "copyable", "type"];
|
|
3
|
+
var _excluded = ["symbol", "language", "children", "copyable", "type", "spotlight"];
|
|
4
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
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
-
import CopyButton from "
|
|
8
|
-
import { SyntaxHighlighter } from "../Highlighter";
|
|
7
|
+
import { CopyButton, Spotlight, SyntaxHighlighter } from "./..";
|
|
9
8
|
import { useStyles } from "./style";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -18,13 +17,14 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
|
|
|
18
17
|
copyable = _ref$copyable === void 0 ? true : _ref$copyable,
|
|
19
18
|
_ref$type = _ref.type,
|
|
20
19
|
type = _ref$type === void 0 ? 'ghost' : _ref$type,
|
|
20
|
+
spotlight = _ref.spotlight,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
var _useStyles = useStyles(type),
|
|
23
23
|
styles = _useStyles.styles;
|
|
24
24
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
25
25
|
className: styles
|
|
26
26
|
}, props), {}, {
|
|
27
|
-
children: [/*#__PURE__*/_jsx(SyntaxHighlighter, {
|
|
27
|
+
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(SyntaxHighlighter, {
|
|
28
28
|
language: language,
|
|
29
29
|
children: [symbol, children].filter(Boolean).join(' ')
|
|
30
30
|
}), copyable && /*#__PURE__*/_jsx(CopyButton, {
|
package/es/Snippet/style.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<
|
|
1
|
+
export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<string>;
|
package/es/Snippet/style.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref, type) {
|
|
5
5
|
var css = _ref.css,
|
|
6
|
+
cx = _ref.cx,
|
|
6
7
|
token = _ref.token;
|
|
7
|
-
|
|
8
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
|
|
9
|
+
return cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n max-width: 100%;\n height: 36px;\n padding: 0 8px 0 12px;\n\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding-top: 6px !important;\n line-height: 1;\n background: none !important;\n }\n\n code[class*='language-'] {\n background: none !important;\n }\n "])), token.borderRadius, token.motionEaseOut, token.colorFillTertiary));
|
|
8
10
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
export interface SpotlightProps extends DivProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description The size of the spotlight circle
|
|
6
|
+
* @default 64
|
|
7
|
+
*/
|
|
8
|
+
size?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const Spotlight: import("react").NamedExoticComponent<SpotlightProps>;
|
|
11
|
+
export default Spotlight;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
var _excluded = ["className", "size"];
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
var useMouseOffset = function useMouseOffset() {
|
|
11
|
+
var _useState = useState(),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
offset = _useState2[0],
|
|
14
|
+
setOffset = _useState2[1];
|
|
15
|
+
var _useState3 = useState(true),
|
|
16
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17
|
+
outside = _useState4[0],
|
|
18
|
+
setOutside = _useState4[1];
|
|
19
|
+
var ref = useRef(null);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
if (ref.current && ref.current.parentElement) {
|
|
22
|
+
var el = ref.current.parentElement;
|
|
23
|
+
|
|
24
|
+
// debounce?
|
|
25
|
+
var onMouseMove = function onMouseMove(e) {
|
|
26
|
+
var bound = el.getBoundingClientRect();
|
|
27
|
+
setOffset({
|
|
28
|
+
x: e.clientX - bound.x,
|
|
29
|
+
y: e.clientY - bound.y
|
|
30
|
+
});
|
|
31
|
+
setOutside(false);
|
|
32
|
+
};
|
|
33
|
+
var onMouseLeave = function onMouseLeave() {
|
|
34
|
+
setOutside(true);
|
|
35
|
+
};
|
|
36
|
+
el.addEventListener('mousemove', onMouseMove);
|
|
37
|
+
el.addEventListener('mouseleave', onMouseLeave);
|
|
38
|
+
return function () {
|
|
39
|
+
el.removeEventListener('mousemove', onMouseMove);
|
|
40
|
+
el.removeEventListener('mouseleave', onMouseLeave);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
return [offset, outside, ref];
|
|
45
|
+
};
|
|
46
|
+
var Spotlight = /*#__PURE__*/memo(function (_ref) {
|
|
47
|
+
var className = _ref.className,
|
|
48
|
+
_ref$size = _ref.size,
|
|
49
|
+
size = _ref$size === void 0 ? 64 : _ref$size,
|
|
50
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
var _useMouseOffset = useMouseOffset(),
|
|
52
|
+
_useMouseOffset2 = _slicedToArray(_useMouseOffset, 3),
|
|
53
|
+
offset = _useMouseOffset2[0],
|
|
54
|
+
outside = _useMouseOffset2[1],
|
|
55
|
+
ref = _useMouseOffset2[2];
|
|
56
|
+
var _useStyles = useStyles({
|
|
57
|
+
offset: offset,
|
|
58
|
+
outside: outside,
|
|
59
|
+
size: size
|
|
60
|
+
}),
|
|
61
|
+
styles = _useStyles.styles,
|
|
62
|
+
cx = _useStyles.cx;
|
|
63
|
+
return /*#__PURE__*/_jsx("div", _objectSpread({
|
|
64
|
+
className: cx(styles, className),
|
|
65
|
+
ref: ref
|
|
66
|
+
}, props));
|
|
67
|
+
});
|
|
68
|
+
export default Spotlight;
|
|
@@ -0,0 +1,17 @@
|
|
|
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, _ref2) {
|
|
5
|
+
var _offset$x, _offset$y;
|
|
6
|
+
var css = _ref.css,
|
|
7
|
+
token = _ref.token,
|
|
8
|
+
isDarkMode = _ref.isDarkMode;
|
|
9
|
+
var offset = _ref2.offset,
|
|
10
|
+
outside = _ref2.outside,
|
|
11
|
+
size = _ref2.size;
|
|
12
|
+
var spotlightX = ((_offset$x = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _offset$x !== void 0 ? _offset$x : 0) + 'px';
|
|
13
|
+
var spotlightY = ((_offset$y = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _offset$y !== void 0 ? _offset$y : 0) + 'px';
|
|
14
|
+
var spotlightOpacity = outside ? '0' : isDarkMode ? '.1' : '0.07';
|
|
15
|
+
var spotlightSize = size + 'px';
|
|
16
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 1;\n inset: 0;\n\n opacity: ", ";\n background: radial-gradient(\n ", " circle at ", " ", ",\n ", ",\n transparent\n );\n border-radius: inherit;\n\n transition: all 0.2s;\n "])), spotlightOpacity, spotlightSize, spotlightX, spotlightY, token.colorText);
|
|
17
|
+
});
|
package/es/StroyBook/style.js
CHANGED
|
@@ -10,6 +10,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
10
10
|
editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
|
|
11
11
|
left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
|
|
12
12
|
right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorBgLayout),
|
|
13
|
-
leva: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
|
|
13
|
+
leva: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
|
|
14
14
|
};
|
|
15
15
|
});
|
package/es/TabsNav/style.js
CHANGED
|
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
9
9
|
var marginHoriz = 16;
|
|
10
10
|
var paddingVertical = 6;
|
|
11
11
|
return {
|
|
12
|
-
tabs: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "-tab + ", "-tab {\n margin: ", "px 4px !important;\n padding: 0 12px !important;\n }\n\n ", "-tab {\n color: ", ";\n transition: background-color 100ms ease-out;\n\n &:first-child {\n margin: ", "px 4px ", "px 0;\n padding: ", "px 12px !important;\n }\n\n &:hover {\n color: ", " !important;\n background: ", ";\n border-radius: ", "px;\n }\n }\n\n ", "-nav {\n margin-bottom: 0;\n &::before {\n display: none;\n }\n }\n "])), prefix, prefix, marginHoriz, prefix, token.colorTextSecondary, marginHoriz, marginHoriz, paddingVertical, token.colorText, token.colorFillTertiary, token.borderRadius, prefix)
|
|
12
|
+
tabs: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "-tab + ", "-tab {\n margin: ", "px 4px !important;\n padding: 0 12px !important;\n }\n\n ", "-tab {\n color: ", ";\n transition: background-color 100ms ease-out;\n\n &:first-child {\n margin: ", "px 4px ", "px 0;\n padding: ", "px 12px !important;\n }\n\n &:hover {\n color: ", " !important;\n background: ", ";\n border-radius: ", "px;\n }\n }\n\n ", "-nav {\n margin-bottom: 0;\n\n &::before {\n display: none;\n }\n }\n "])), prefix, prefix, marginHoriz, prefix, token.colorTextSecondary, marginHoriz, marginHoriz, paddingVertical, token.colorText, token.colorFillTertiary, token.borderRadius, prefix)
|
|
13
13
|
};
|
|
14
14
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { createGlobalStyle } from 'antd-style';
|
|
4
|
-
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n \n\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::-webkit-scrollbar {\n\t width: 0;\n\t height: 4px;\n\t background-color: transparent;\n\n\t &-thumb {\n\t\t background-color: transparent;\n\t\t border-radius: 4px;\n\t\t transition: background-color 500ms ", ";\n\t }\n\n\t &-corner {\n\t\t display: none;\n\t }\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n \n code {\n\t font-family: ", " !important;\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n\n *:hover, *:focus {\n\t ::-webkit-scrollbar {\n\t\t &-thumb {\n\t\t\t background-color: ", ";\n\t\t }\n\t }\n }\n"])), function (_ref) {
|
|
4
|
+
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n \n\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::-webkit-scrollbar {\n\t width: 0;\n\t height: 4px;\n\t background-color: transparent;\n\n\t &-thumb {\n\t\t background-color: transparent;\n\t\t border-radius: 4px;\n\t\t transition: background-color 500ms ", ";\n\t }\n\n\t &-corner {\n\t\t display: none;\n\t }\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n \n code {\n\t font-family: ", " !important;\n\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n\n *:hover, *:focus {\n\t ::-webkit-scrollbar {\n\t\t &-thumb {\n\t\t\t background-color: ", ";\n\t\t }\n\t }\n }\n"])), function (_ref) {
|
|
5
5
|
var theme = _ref.theme;
|
|
6
6
|
return theme.fontFamily;
|
|
7
7
|
}, function (_ref2) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { type ThemeMode, extractStaticStyle } from 'antd-style';
|
|
3
3
|
import type { CustomStylishParams, CustomTokenParams } from 'antd-style/lib/types/function';
|
|
4
4
|
export interface ThemeProviderProps {
|
|
5
5
|
/**
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
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
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
4
|
import { App } from 'antd';
|
|
5
|
-
import {
|
|
5
|
+
import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import ReactFontLoader from 'react-font-loader';
|
package/es/Tooltip/style.js
CHANGED
|
@@ -5,6 +5,6 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
token = _ref.token;
|
|
7
7
|
return {
|
|
8
|
-
tooltip: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-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: ", ";\n\n background-color: ", ";\n border-radius: ", "px;\n }\n .ant-tooltip-arrow {\n
|
|
8
|
+
tooltip: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-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: ", ";\n\n background-color: ", ";\n border-radius: ", "px;\n }\n\n .ant-tooltip-arrow {\n &::before,\n &::after {\n background: ", ";\n }\n }\n "])), token.colorBgLayout, token.colorText, token.borderRadiusSM, token.colorText)
|
|
9
9
|
};
|
|
10
10
|
});
|
package/es/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { default as MessageModal, type MessageModalProps } from './MessageModal'
|
|
|
20
20
|
export { default as SearchBar, type SearchBarProps } from './SearchBar';
|
|
21
21
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
22
22
|
export { default as Snippet, type SnippetProps } from './Snippet';
|
|
23
|
+
export { default as Spotlight, type SpotlightProps } from './Spotlight';
|
|
23
24
|
export { default as StroyBook, type StroyBookProps, useControls, useCreateStore, } from './StroyBook';
|
|
24
25
|
export { colorScales as colors } from './styles/colors';
|
|
25
26
|
export { default as Swatches, type SwatchesProps } from './Swatches';
|
|
@@ -27,3 +28,5 @@ export { default as TabsNav, type TabsNavProps } from './TabsNav';
|
|
|
27
28
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
28
29
|
export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
|
|
29
30
|
export { default as Tooltip, type TooltipProps } from './Tooltip';
|
|
31
|
+
export { type LobeCustomStylish } from './types/customStylish';
|
|
32
|
+
export { type LobeCustomToken } from './types/customToken';
|
package/es/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { default as MessageModal } from "./MessageModal";
|
|
|
19
19
|
export { default as SearchBar } from "./SearchBar";
|
|
20
20
|
export { default as SideNav } from "./SideNav";
|
|
21
21
|
export { default as Snippet } from "./Snippet";
|
|
22
|
+
export { default as Spotlight } from "./Spotlight";
|
|
22
23
|
export { default as StroyBook, useControls, useCreateStore } from "./StroyBook";
|
|
23
24
|
export { colorScales as colors } from "./styles/colors";
|
|
24
25
|
export { default as Swatches } from "./Swatches";
|
|
@@ -6,6 +6,6 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
6
6
|
isDarkMode = _ref.isDarkMode;
|
|
7
7
|
return {
|
|
8
8
|
blur: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
|
|
9
|
-
markdown: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\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-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:
|
|
9
|
+
markdown: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\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-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 ul li {\n line-height: 1.8;\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)
|
|
10
10
|
};
|
|
11
11
|
};
|
package/es/types/global.d.ts
CHANGED
package/es/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type DivProps =
|
|
3
|
-
export declare type SvgProps =
|
|
4
|
-
export declare type ImgProps =
|
|
5
|
-
export declare type InputProps =
|
|
6
|
-
export declare type TextAreaProps =
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export declare type DivProps = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
export declare type SvgProps = HTMLAttributes<SVGSVGElement>;
|
|
4
|
+
export declare type ImgProps = HTMLAttributes<HTMLImageElement>;
|
|
5
|
+
export declare type InputProps = HTMLAttributes<HTMLInputElement>;
|
|
6
|
+
export declare type TextAreaProps = HTMLAttributes<HTMLTextAreaElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"lint:style": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
42
42
|
"prepare": "husky install && npm run setup",
|
|
43
43
|
"prepublishOnly": "father doctor && npm run build",
|
|
44
|
-
"prettier": "prettier -c --write \"**/**\"",
|
|
44
|
+
"prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
|
|
45
45
|
"release": "semantic-release",
|
|
46
46
|
"setup": "dumi setup",
|
|
47
47
|
"start": "dumi dev",
|
|
@@ -102,13 +102,14 @@
|
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@ant-design/colors": "^7",
|
|
104
104
|
"@commitlint/cli": "^17",
|
|
105
|
+
"@lobehub/lint": "latest",
|
|
106
|
+
"@react-spring/web": "^9",
|
|
105
107
|
"@testing-library/react": "^14",
|
|
106
108
|
"@types/chroma-js": "^2",
|
|
107
109
|
"@types/lodash-es": "^4",
|
|
108
110
|
"@types/pangu": "^4",
|
|
109
111
|
"@types/react": "^18",
|
|
110
112
|
"@types/react-dom": "^18",
|
|
111
|
-
"@umijs/lint": "^4",
|
|
112
113
|
"@vitest/coverage-c8": "latest",
|
|
113
114
|
"antd": "^5",
|
|
114
115
|
"antd-style": "^3",
|
|
@@ -120,33 +121,17 @@
|
|
|
120
121
|
"dumi-assets-types": "^1",
|
|
121
122
|
"dumi-theme-lobehub": "workspace:latest",
|
|
122
123
|
"eslint": "^8",
|
|
123
|
-
"eslint-import-resolver-alias": "^1",
|
|
124
|
-
"eslint-import-resolver-typescript": "^3",
|
|
125
|
-
"eslint-plugin-import": "^2",
|
|
126
|
-
"eslint-plugin-simple-import-sort": "^10",
|
|
127
|
-
"eslint-plugin-typescript-sort-keys": "^2",
|
|
128
124
|
"father": "^4",
|
|
129
125
|
"husky": "^8",
|
|
130
126
|
"jsdom": "^22",
|
|
131
127
|
"lint-staged": "^13",
|
|
132
|
-
"postcss-styled-syntax": "^0",
|
|
133
128
|
"prettier": "^2",
|
|
134
|
-
"prettier-plugin-organize-imports": "^3",
|
|
135
|
-
"prettier-plugin-packagejson": "^2",
|
|
136
129
|
"react": "^18",
|
|
137
130
|
"react-dom": "^18",
|
|
138
131
|
"remark": "^14",
|
|
139
132
|
"remark-cli": "^11",
|
|
140
|
-
"remark-lint": "^9",
|
|
141
|
-
"remark-lint-list-item-indent": "^3",
|
|
142
|
-
"remark-preset-lint-recommended": "^6",
|
|
143
|
-
"remark-toc": "^8",
|
|
144
133
|
"semantic-release": "^21",
|
|
145
|
-
"semantic-release-config-gitmoji": "^1",
|
|
146
134
|
"stylelint": "^15",
|
|
147
|
-
"stylelint-config-clean-order": "^5",
|
|
148
|
-
"stylelint-config-recommended": "^12",
|
|
149
|
-
"stylelint-order": "^6",
|
|
150
135
|
"typescript": "^5",
|
|
151
136
|
"vitest": "latest"
|
|
152
137
|
},
|