@lobehub/ui 1.11.1 → 1.11.2
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/package.json +1 -1
- package/lib/ActionIcon/index.d.ts +0 -49
- package/lib/ActionIcon/index.js +0 -80
- package/lib/ActionIcon/style.d.ts +0 -6
- package/lib/ActionIcon/style.js +0 -20
- package/lib/Avatar/index.d.ts +0 -10
- package/lib/Avatar/index.js +0 -69
- package/lib/Chat/const.d.ts +0 -1
- package/lib/Chat/const.js +0 -8
- package/lib/Chat/index.d.ts +0 -2
- package/lib/Chat/index.js +0 -27
- package/lib/Chat/store/index.d.ts +0 -20
- package/lib/Chat/store/index.js +0 -50
- package/lib/Chat/store/initialState.d.ts +0 -28
- package/lib/Chat/store/initialState.js +0 -16
- package/lib/Chat/store/messageReducer.d.ts +0 -37
- package/lib/Chat/store/messageReducer.js +0 -75
- package/lib/Chat/store/selectors.d.ts +0 -9
- package/lib/Chat/store/selectors.js +0 -51
- package/lib/Chat/store/store.d.ts +0 -34
- package/lib/Chat/store/store.js +0 -246
- package/lib/Chat/types.d.ts +0 -77
- package/lib/Chat/types.js +0 -5
- package/lib/Chat/utils/fetch.d.ts +0 -11
- package/lib/Chat/utils/fetch.js +0 -108
- package/lib/ContextMenu/MenuItem/icons.d.ts +0 -4
- package/lib/ContextMenu/MenuItem/icons.js +0 -82
- package/lib/ContextMenu/MenuItem/index.d.ts +0 -12
- package/lib/ContextMenu/MenuItem/index.js +0 -79
- package/lib/ContextMenu/MenuItem/style.d.ts +0 -7
- package/lib/ContextMenu/MenuItem/style.js +0 -24
- package/lib/ContextMenu/index.d.ts +0 -9
- package/lib/ContextMenu/index.js +0 -270
- package/lib/ContextMenu/style.d.ts +0 -4
- package/lib/ContextMenu/style.js +0 -20
- package/lib/ContextMenu/types/index.d.ts +0 -5
- package/lib/ContextMenu/types/index.js +0 -16
- package/lib/ContextMenu/types/menuItem.d.ts +0 -21
- package/lib/ContextMenu/types/menuItem.js +0 -5
- package/lib/Conversation/App.d.ts +0 -13
- package/lib/Conversation/App.js +0 -50
- package/lib/Conversation/ChatList/MessageItem/Content.d.ts +0 -8
- package/lib/Conversation/ChatList/MessageItem/Content.js +0 -109
- package/lib/Conversation/ChatList/MessageItem/Toolbar.d.ts +0 -10
- package/lib/Conversation/ChatList/MessageItem/Toolbar.js +0 -100
- package/lib/Conversation/ChatList/MessageItem/index.d.ts +0 -9
- package/lib/Conversation/ChatList/MessageItem/index.js +0 -132
- package/lib/Conversation/ChatList/index.d.ts +0 -14
- package/lib/Conversation/ChatList/index.js +0 -67
- package/lib/Conversation/InputArea/ActionBar.d.ts +0 -4
- package/lib/Conversation/InputArea/ActionBar.js +0 -79
- package/lib/Conversation/InputArea/index.d.ts +0 -4
- package/lib/Conversation/InputArea/index.js +0 -109
- package/lib/Conversation/StoreUpdater.d.ts +0 -7
- package/lib/Conversation/StoreUpdater.js +0 -32
- package/lib/Conversation/index.d.ts +0 -8
- package/lib/Conversation/index.js +0 -33
- package/lib/CopyButton/index.d.ts +0 -26
- package/lib/CopyButton/index.js +0 -41
- package/lib/DraggablePanel/index.d.ts +0 -92
- package/lib/DraggablePanel/index.js +0 -202
- package/lib/DraggablePanel/style.d.ts +0 -18
- package/lib/DraggablePanel/style.js +0 -38
- package/lib/DraggablePanel/utils.d.ts +0 -2
- package/lib/DraggablePanel/utils.js +0 -19
- package/lib/EditableMessage/index.d.ts +0 -43
- package/lib/EditableMessage/index.js +0 -73
- package/lib/EditableMessageList/index.d.ts +0 -9
- package/lib/EditableMessageList/index.js +0 -109
- package/lib/EditableText/index.d.ts +0 -5
- package/lib/EditableText/index.js +0 -43
- package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +0 -7
- package/lib/Highlighter/SyntaxHighlighter/Prism.js +0 -46
- package/lib/Highlighter/SyntaxHighlighter/index.d.ts +0 -5
- package/lib/Highlighter/SyntaxHighlighter/index.js +0 -64
- package/lib/Highlighter/SyntaxHighlighter/style.d.ts +0 -5
- package/lib/Highlighter/SyntaxHighlighter/style.js +0 -23
- package/lib/Highlighter/index.d.ts +0 -36
- package/lib/Highlighter/index.js +0 -56
- package/lib/Highlighter/style.d.ts +0 -5
- package/lib/Highlighter/style.js +0 -25
- package/lib/Icon/index.d.ts +0 -21
- package/lib/Icon/index.js +0 -45
- package/lib/Input/index.d.ts +0 -13
- package/lib/Input/index.js +0 -47
- package/lib/Input/style.d.ts +0 -6
- package/lib/Input/style.js +0 -20
- package/lib/List/ListItem/index.d.ts +0 -64
- package/lib/List/ListItem/index.js +0 -115
- package/lib/List/ListItem/time.d.ts +0 -2
- package/lib/List/ListItem/time.js +0 -18
- package/lib/List/index.d.ts +0 -5
- package/lib/List/index.js +0 -13
- package/lib/Logo/Divider.d.ts +0 -3
- package/lib/Logo/Divider.js +0 -28
- package/lib/Logo/Logo3D.d.ts +0 -3
- package/lib/Logo/Logo3D.js +0 -19
- package/lib/Logo/LogoFlat.d.ts +0 -3
- package/lib/Logo/LogoFlat.js +0 -110
- package/lib/Logo/LogoHighContrast.d.ts +0 -3
- package/lib/Logo/LogoHighContrast.js +0 -32
- package/lib/Logo/LogoText.d.ts +0 -3
- package/lib/Logo/LogoText.js +0 -26
- package/lib/Logo/index.d.ts +0 -20
- package/lib/Logo/index.js +0 -102
- package/lib/Logo/style.d.ts +0 -4
- package/lib/Logo/style.js +0 -18
- package/lib/Markdown/Code.d.ts +0 -3
- package/lib/Markdown/Code.js +0 -19
- package/lib/Markdown/CodeBlock.d.ts +0 -3
- package/lib/Markdown/CodeBlock.js +0 -36
- package/lib/Markdown/index.d.ts +0 -13
- package/lib/Markdown/index.js +0 -39
- package/lib/Markdown/style.d.ts +0 -4
- package/lib/Markdown/style.js +0 -20
- package/lib/MessageInput/index.d.ts +0 -37
- package/lib/MessageInput/index.js +0 -63
- package/lib/MessageModal/index.d.ts +0 -11
- package/lib/MessageModal/index.js +0 -87
- package/lib/SearchBar/index.d.ts +0 -8
- package/lib/SearchBar/index.js +0 -90
- package/lib/SearchBar/style.d.ts +0 -6
- package/lib/SearchBar/style.js +0 -21
- package/lib/SideNav/index.d.ts +0 -18
- package/lib/SideNav/index.js +0 -46
- package/lib/SideNav/style.d.ts +0 -1
- package/lib/SideNav/style.js +0 -16
- package/lib/Snippet/index.d.ts +0 -29
- package/lib/Snippet/index.js +0 -44
- package/lib/Snippet/style.d.ts +0 -1
- package/lib/Snippet/style.js +0 -16
- package/lib/StroyBook/index.d.ts +0 -17
- package/lib/StroyBook/index.js +0 -64
- package/lib/StroyBook/style.d.ts +0 -8
- package/lib/StroyBook/style.js +0 -22
- package/lib/Swatches/index.d.ts +0 -8
- package/lib/Swatches/index.js +0 -50
- package/lib/TabsNav/index.d.ts +0 -22
- package/lib/TabsNav/index.js +0 -26
- package/lib/TabsNav/style.d.ts +0 -3
- package/lib/TabsNav/style.js +0 -22
- package/lib/ThemeProvider/GlobalStyle.d.ts +0 -3
- package/lib/ThemeProvider/GlobalStyle.js +0 -31
- package/lib/ThemeProvider/index.d.ts +0 -22
- package/lib/ThemeProvider/index.js +0 -46
- package/lib/ThemeSwitch/index.d.ts +0 -27
- package/lib/ThemeSwitch/index.js +0 -66
- package/lib/Tooltip/index.d.ts +0 -5
- package/lib/Tooltip/index.js +0 -29
- package/lib/Tooltip/style.d.ts +0 -3
- package/lib/Tooltip/style.js +0 -18
- package/lib/components/ControlInput.d.ts +0 -9
- package/lib/components/ControlInput.js +0 -90
- package/lib/hooks/useCopied.d.ts +0 -4
- package/lib/hooks/useCopied.js +0 -34
- package/lib/hooks/useHighlight.d.ts +0 -36
- package/lib/hooks/useHighlight.js +0 -71
- package/lib/index.d.ts +0 -27
- package/lib/index.js +0 -213
- package/lib/styles/algorithms/generateColorPalette.d.ts +0 -11
- package/lib/styles/algorithms/generateColorPalette.js +0 -40
- package/lib/styles/algorithms/generateCustomStylish.d.ts +0 -17
- package/lib/styles/algorithms/generateCustomStylish.js +0 -27
- package/lib/styles/algorithms/generateCustomToken.d.ts +0 -3
- package/lib/styles/algorithms/generateCustomToken.js +0 -65
- package/lib/styles/algorithms/generateTheme.d.ts +0 -5
- package/lib/styles/algorithms/generateTheme.js +0 -28
- package/lib/styles/colors.d.ts +0 -38
- package/lib/styles/colors.js +0 -183
- package/lib/styles/index.d.ts +0 -3
- package/lib/styles/index.js +0 -26
- package/lib/styles/theme/base.d.ts +0 -2
- package/lib/styles/theme/base.js +0 -20
- package/lib/styles/theme/dark.d.ts +0 -3
- package/lib/styles/theme/dark.js +0 -50
- package/lib/styles/theme/light.d.ts +0 -3
- package/lib/styles/theme/light.js +0 -50
- package/lib/types/customToken.d.ts +0 -1027
- package/lib/types/global.d.ts +0 -12
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.js +0 -5
- package/lib/utils/colorUtils.d.ts +0 -1
- package/lib/utils/colorUtils.js +0 -18
package/lib/SideNav/index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _react = require("react");
|
|
12
|
-
var _style = require("./style");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["className", "avatar", "topActions", "bottomActions"];
|
|
15
|
-
var SideNav = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
16
|
-
var className = _ref.className,
|
|
17
|
-
avatar = _ref.avatar,
|
|
18
|
-
topActions = _ref.topActions,
|
|
19
|
-
bottomActions = _ref.bottomActions,
|
|
20
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
21
|
-
var _useStyles = (0, _style.useStyles)(),
|
|
22
|
-
styles = _useStyles.styles,
|
|
23
|
-
cx = _useStyles.cx;
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
25
|
-
className: cx(styles, className)
|
|
26
|
-
}, props), {}, {
|
|
27
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
28
|
-
size: 16,
|
|
29
|
-
direction: "vertical",
|
|
30
|
-
align: "center",
|
|
31
|
-
children: [avatar, /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
32
|
-
size: 8,
|
|
33
|
-
direction: "vertical",
|
|
34
|
-
align: "center",
|
|
35
|
-
children: topActions
|
|
36
|
-
})]
|
|
37
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
38
|
-
size: 4,
|
|
39
|
-
direction: "vertical",
|
|
40
|
-
align: "center",
|
|
41
|
-
children: bottomActions
|
|
42
|
-
})]
|
|
43
|
-
}));
|
|
44
|
-
});
|
|
45
|
-
var _default = SideNav;
|
|
46
|
-
exports.default = _default;
|
package/lib/SideNav/style.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
|
package/lib/SideNav/style.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _antdStyle = require("antd-style");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var useStyles = (0, _antdStyle.createStyles)(function (_ref) {
|
|
12
|
-
var css = _ref.css,
|
|
13
|
-
token = _ref.token;
|
|
14
|
-
return css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: none;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n\n width: 64px;\n height: 100%;\n min-height: 640px;\n padding: 16px 0;\n\n background: ", ";\n border-right: 1px solid ", ";\n "])), token.colorBgContainer, token.colorBorder);
|
|
15
|
-
});
|
|
16
|
-
exports.useStyles = useStyles;
|
package/lib/Snippet/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DivProps } from "../types";
|
|
3
|
-
export interface SnippetProps extends DivProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description The content to be displayed inside the Snippet component
|
|
6
|
-
*/
|
|
7
|
-
children: string;
|
|
8
|
-
/**
|
|
9
|
-
* @description The symbol to be displayed before the content inside the Snippet component
|
|
10
|
-
*/
|
|
11
|
-
symbol?: string;
|
|
12
|
-
/**
|
|
13
|
-
* @description The language of the content inside the Snippet component
|
|
14
|
-
* @default 'tsx'
|
|
15
|
-
*/
|
|
16
|
-
language?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @description Whether the Snippet component is copyable or not
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
copyable?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @description The type of the Snippet component
|
|
24
|
-
* @default 'ghost'
|
|
25
|
-
*/
|
|
26
|
-
type?: 'ghost' | 'block';
|
|
27
|
-
}
|
|
28
|
-
declare const Snippet: import("react").NamedExoticComponent<SnippetProps>;
|
|
29
|
-
export default Snippet;
|
package/lib/Snippet/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
var _CopyButton = _interopRequireDefault(require("../CopyButton"));
|
|
12
|
-
var _Highlighter = require("../Highlighter");
|
|
13
|
-
var _style = require("./style");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["symbol", "language", "children", "copyable", "type"];
|
|
16
|
-
var Snippet = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
17
|
-
var symbol = _ref.symbol,
|
|
18
|
-
_ref$language = _ref.language,
|
|
19
|
-
language = _ref$language === void 0 ? 'tsx' : _ref$language,
|
|
20
|
-
children = _ref.children,
|
|
21
|
-
_ref$copyable = _ref.copyable,
|
|
22
|
-
copyable = _ref$copyable === void 0 ? true : _ref$copyable,
|
|
23
|
-
_ref$type = _ref.type,
|
|
24
|
-
type = _ref$type === void 0 ? 'ghost' : _ref$type,
|
|
25
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
|
-
var _useStyles = (0, _style.useStyles)(type),
|
|
27
|
-
styles = _useStyles.styles;
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
29
|
-
className: styles
|
|
30
|
-
}, props), {}, {
|
|
31
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Highlighter.SyntaxHighlighter, {
|
|
32
|
-
language: language,
|
|
33
|
-
children: [symbol, children].filter(Boolean).join(' ')
|
|
34
|
-
}), copyable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CopyButton.default, {
|
|
35
|
-
size: {
|
|
36
|
-
fontSize: 14,
|
|
37
|
-
blockSize: 24
|
|
38
|
-
},
|
|
39
|
-
content: children
|
|
40
|
-
})]
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
var _default = Snippet;
|
|
44
|
-
exports.default = _default;
|
package/lib/Snippet/style.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
|
package/lib/Snippet/style.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _antdStyle = require("antd-style");
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
11
|
-
var useStyles = (0, _antdStyle.createStyles)(function (_ref, type) {
|
|
12
|
-
var css = _ref.css,
|
|
13
|
-
token = _ref.token;
|
|
14
|
-
return css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\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, type === 'block' ? css(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n "])), token.colorFillTertiary) : css(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n "])), token.colorBorder), token.colorFillTertiary);
|
|
15
|
-
});
|
|
16
|
-
exports.useStyles = useStyles;
|
package/lib/StroyBook/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DivProps } from "../types";
|
|
3
|
-
import { useControls, useCreateStore } from 'leva';
|
|
4
|
-
export { useCreateStore, useControls };
|
|
5
|
-
export interface StroyBookProps extends DivProps {
|
|
6
|
-
/**
|
|
7
|
-
* @description The Leva store instance to be used by the component
|
|
8
|
-
* @type levaStore
|
|
9
|
-
*/
|
|
10
|
-
levaStore: any;
|
|
11
|
-
/**
|
|
12
|
-
* @description If use padding around component
|
|
13
|
-
*/
|
|
14
|
-
noPadding?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare const StroyBook: import("react").NamedExoticComponent<StroyBookProps>;
|
|
17
|
-
export default StroyBook;
|
package/lib/StroyBook/index.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.StroyBook = void 0;
|
|
8
|
-
Object.defineProperty(exports, "useControls", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _leva.useControls;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "useCreateStore", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _leva.useCreateStore;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
21
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
22
|
-
var _antdStyle = require("antd-style");
|
|
23
|
-
var _leva = require("leva");
|
|
24
|
-
var _react = require("react");
|
|
25
|
-
var _DraggablePanel = _interopRequireDefault(require("../DraggablePanel"));
|
|
26
|
-
var _style = require("./style");
|
|
27
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
var _excluded = ["levaStore", "noPadding", "className", "children"];
|
|
29
|
-
var StroyBook = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
30
|
-
var levaStore = _ref.levaStore,
|
|
31
|
-
noPadding = _ref.noPadding,
|
|
32
|
-
className = _ref.className,
|
|
33
|
-
children = _ref.children,
|
|
34
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
|
-
var _useResponsive = (0, _antdStyle.useResponsive)(),
|
|
36
|
-
mobile = _useResponsive.mobile;
|
|
37
|
-
var _useStyles = (0, _style.useStyles)({
|
|
38
|
-
noPadding: Boolean(noPadding),
|
|
39
|
-
mobile: Boolean(mobile)
|
|
40
|
-
}),
|
|
41
|
-
styles = _useStyles.styles,
|
|
42
|
-
cx = _useStyles.cx;
|
|
43
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
44
|
-
className: cx(styles.editor, className)
|
|
45
|
-
}, props), {}, {
|
|
46
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
-
className: styles.left,
|
|
48
|
-
children: children
|
|
49
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DraggablePanel.default, {
|
|
50
|
-
className: styles.right,
|
|
51
|
-
placement: mobile ? 'bottom' : 'right',
|
|
52
|
-
minWidth: 280,
|
|
53
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_leva.LevaPanel, {
|
|
54
|
-
fill: true,
|
|
55
|
-
store: levaStore,
|
|
56
|
-
titleBar: false,
|
|
57
|
-
flat: true
|
|
58
|
-
}), ' ']
|
|
59
|
-
})]
|
|
60
|
-
}));
|
|
61
|
-
});
|
|
62
|
-
exports.StroyBook = StroyBook;
|
|
63
|
-
var _default = StroyBook;
|
|
64
|
-
exports.default = _default;
|
package/lib/StroyBook/style.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: {
|
|
2
|
-
noPadding: boolean;
|
|
3
|
-
mobile: boolean;
|
|
4
|
-
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
-
editor: import("antd-style").SerializedStyles;
|
|
6
|
-
left: import("antd-style").SerializedStyles;
|
|
7
|
-
right: import("antd-style").SerializedStyles;
|
|
8
|
-
}>;
|
package/lib/StroyBook/style.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _antdStyle = require("antd-style");
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
11
|
-
var useStyles = (0, _antdStyle.createStyles)(function (_ref, _ref2) {
|
|
12
|
-
var css = _ref.css,
|
|
13
|
-
token = _ref.token;
|
|
14
|
-
var noPadding = _ref2.noPadding,
|
|
15
|
-
mobile = _ref2.mobile;
|
|
16
|
-
return {
|
|
17
|
-
editor: css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 = (0, _taggedTemplateLiteral2.default)(["\n flex-direction: column;\n "])))),
|
|
18
|
-
left: css(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 40px 24px;\n "])))),
|
|
19
|
-
right: css(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\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 padding: 6px 0;\n background: ", ";\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.colorBgLayout, token.colorFillSecondary)
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
exports.useStyles = useStyles;
|
package/lib/Swatches/index.d.ts
DELETED
package/lib/Swatches/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _antdStyle = require("antd-style");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _reactLayoutKit = require("react-layout-kit");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var Swatches = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
12
|
-
var colors = _ref.colors,
|
|
13
|
-
activeColor = _ref.activeColor,
|
|
14
|
-
onSelect = _ref.onSelect;
|
|
15
|
-
var theme = (0, _antdStyle.useTheme)();
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactLayoutKit.Flexbox, {
|
|
17
|
-
horizontal: true,
|
|
18
|
-
gap: 8,
|
|
19
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
|
|
20
|
-
style: {
|
|
21
|
-
width: 24,
|
|
22
|
-
height: 24,
|
|
23
|
-
background: theme.colorBgContainer,
|
|
24
|
-
boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
|
|
25
|
-
borderRadius: '50%',
|
|
26
|
-
cursor: 'pointer'
|
|
27
|
-
},
|
|
28
|
-
onClick: function onClick() {
|
|
29
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
|
|
30
|
-
}
|
|
31
|
-
}), colors.map(function (c) {
|
|
32
|
-
var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
|
|
33
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
|
|
34
|
-
style: {
|
|
35
|
-
width: 24,
|
|
36
|
-
height: 24,
|
|
37
|
-
background: c,
|
|
38
|
-
boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
|
|
39
|
-
borderRadius: '50%',
|
|
40
|
-
cursor: 'pointer'
|
|
41
|
-
},
|
|
42
|
-
onClick: function onClick() {
|
|
43
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
|
|
44
|
-
}
|
|
45
|
-
}, c);
|
|
46
|
-
})]
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
var _default = Swatches;
|
|
50
|
-
exports.default = _default;
|
package/lib/TabsNav/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TabsProps } from 'antd';
|
|
3
|
-
export interface TabsNavProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description Additional className to apply to the component
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* @description Callback function that is triggered when a tab is changed
|
|
10
|
-
*/
|
|
11
|
-
onChange?: (activeKey: string) => void;
|
|
12
|
-
/**
|
|
13
|
-
* @description An array of objects representing the tabs to be rendered
|
|
14
|
-
*/
|
|
15
|
-
items?: TabsProps['items'];
|
|
16
|
-
/**
|
|
17
|
-
* @description The key of the active tab
|
|
18
|
-
*/
|
|
19
|
-
activeKey?: TabsProps['activeKey'];
|
|
20
|
-
}
|
|
21
|
-
declare const TabsNav: import("react").NamedExoticComponent<TabsNavProps>;
|
|
22
|
-
export default TabsNav;
|
package/lib/TabsNav/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _react = require("react");
|
|
12
|
-
var _style = require("./style");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["className"];
|
|
15
|
-
var TabsNav = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
16
|
-
var className = _ref.className,
|
|
17
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
18
|
-
var _useStyles = (0, _style.useStyles)(),
|
|
19
|
-
styles = _useStyles.styles,
|
|
20
|
-
cx = _useStyles.cx;
|
|
21
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, (0, _objectSpread2.default)({
|
|
22
|
-
className: cx(styles.tabs, className)
|
|
23
|
-
}, props));
|
|
24
|
-
});
|
|
25
|
-
var _default = TabsNav;
|
|
26
|
-
exports.default = _default;
|
package/lib/TabsNav/style.d.ts
DELETED
package/lib/TabsNav/style.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _antdStyle = require("antd-style");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var useStyles = (0, _antdStyle.createStyles)(function (_ref) {
|
|
12
|
-
var css = _ref.css,
|
|
13
|
-
token = _ref.token,
|
|
14
|
-
prefixCls = _ref.prefixCls;
|
|
15
|
-
var prefix = ".".concat(prefixCls, "-tabs");
|
|
16
|
-
var marginHoriz = 16;
|
|
17
|
-
var paddingVertical = 6;
|
|
18
|
-
return {
|
|
19
|
-
tabs: css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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)
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
exports.useStyles = useStyles;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _antdStyle = require("antd-style");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var GlobalStyle = (0, _antdStyle.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 box-sizing: border-box;\n vertical-align: baseline;\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n }\n\n &-corner {\n display: none;\n }\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"])), function (_ref) {
|
|
12
|
-
var theme = _ref.theme;
|
|
13
|
-
return theme.fontFamily;
|
|
14
|
-
}, function (_ref2) {
|
|
15
|
-
var theme = _ref2.theme;
|
|
16
|
-
return theme.fontSize;
|
|
17
|
-
}, function (_ref3) {
|
|
18
|
-
var theme = _ref3.theme;
|
|
19
|
-
return theme.colorTextBase;
|
|
20
|
-
}, function (_ref4) {
|
|
21
|
-
var theme = _ref4.theme;
|
|
22
|
-
return theme.colorBgLayout;
|
|
23
|
-
}, function (_ref5) {
|
|
24
|
-
var theme = _ref5.theme;
|
|
25
|
-
return theme.colorFill;
|
|
26
|
-
}, function (_ref6) {
|
|
27
|
-
var theme = _ref6.theme;
|
|
28
|
-
return theme.fontFamilyCode;
|
|
29
|
-
});
|
|
30
|
-
var _default = GlobalStyle;
|
|
31
|
-
exports.default = _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { extractStaticStyle, type ThemeMode } from 'antd-style';
|
|
3
|
-
export interface ThemeProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description The children of the ThemeProvider component
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* @description The mode of the theme (light or dark)
|
|
10
|
-
*/
|
|
11
|
-
themeMode?: ThemeMode;
|
|
12
|
-
/**
|
|
13
|
-
* @description Whether to inline the styles on server-side rendering or not
|
|
14
|
-
*/
|
|
15
|
-
ssrInline?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @description Cache for the extracted static styles
|
|
18
|
-
*/
|
|
19
|
-
cache?: typeof extractStaticStyle.cache;
|
|
20
|
-
}
|
|
21
|
-
declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
|
|
22
|
-
export default ThemeProvider;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _styles = require("../styles");
|
|
9
|
-
var _antd = require("antd");
|
|
10
|
-
var _antdStyle = require("antd-style");
|
|
11
|
-
var _react = require("react");
|
|
12
|
-
var _reactFontLoader = _interopRequireDefault(require("react-font-loader"));
|
|
13
|
-
var _styledComponents = require("styled-components");
|
|
14
|
-
var _GlobalStyle = _interopRequireDefault(require("./GlobalStyle"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
|
|
18
|
-
var ThemeProvider = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
19
|
-
var children = _ref.children,
|
|
20
|
-
themeMode = _ref.themeMode;
|
|
21
|
-
(0, _antdStyle.setupStyled)({
|
|
22
|
-
ThemeContext: _styledComponents.ThemeContext
|
|
23
|
-
});
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdStyle.StyleProvider, {
|
|
25
|
-
speedy: process.env.NODE_ENV === 'production',
|
|
26
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antdStyle.ThemeProvider, {
|
|
27
|
-
themeMode: themeMode,
|
|
28
|
-
theme: _styles.lobeTheme,
|
|
29
|
-
customStylish: _styles.lobeCustomStylish,
|
|
30
|
-
customToken: _styles.lobeCustomToken,
|
|
31
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
|
|
32
|
-
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
|
|
33
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
|
|
34
|
-
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
|
|
35
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyle.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.App, {
|
|
36
|
-
style: {
|
|
37
|
-
minHeight: 'inherit',
|
|
38
|
-
width: 'inherit'
|
|
39
|
-
},
|
|
40
|
-
children: children
|
|
41
|
-
})]
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
var _default = ThemeProvider;
|
|
46
|
-
exports.default = _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type ActionIconSize } from "..";
|
|
3
|
-
import { ThemeMode } from 'antd-style';
|
|
4
|
-
import { DivProps } from "../types";
|
|
5
|
-
export interface ThemeSwitchProps extends DivProps {
|
|
6
|
-
/**
|
|
7
|
-
* @description Size of the action icon
|
|
8
|
-
* @default {
|
|
9
|
-
* blockSize: 34,
|
|
10
|
-
* fontSize: 20,
|
|
11
|
-
* strokeWidth: 1.5,
|
|
12
|
-
* }
|
|
13
|
-
*/
|
|
14
|
-
size?: ActionIconSize;
|
|
15
|
-
/**
|
|
16
|
-
* @description The theme mode of the component
|
|
17
|
-
* @type ThemeMode
|
|
18
|
-
*/
|
|
19
|
-
themeMode: ThemeMode;
|
|
20
|
-
/**
|
|
21
|
-
* @description Callback function when the theme mode is switched
|
|
22
|
-
* @type {(themeMode: ThemeMode) => void}
|
|
23
|
-
*/
|
|
24
|
-
onThemeSwitch: (themeMode: ThemeMode) => void;
|
|
25
|
-
}
|
|
26
|
-
declare const ThemeSwitch: import("react").NamedExoticComponent<ThemeSwitchProps>;
|
|
27
|
-
export default ThemeSwitch;
|
package/lib/ThemeSwitch/index.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _ = require("./..");
|
|
11
|
-
var _antd = require("antd");
|
|
12
|
-
var _lucideReact = require("lucide-react");
|
|
13
|
-
var _react = require("react");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["size", "themeMode", "onThemeSwitch"];
|
|
16
|
-
var icons = {
|
|
17
|
-
auto: _lucideReact.Monitor,
|
|
18
|
-
light: _lucideReact.Sun,
|
|
19
|
-
dark: _lucideReact.Moon
|
|
20
|
-
};
|
|
21
|
-
var items = [{
|
|
22
|
-
label: 'System',
|
|
23
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
24
|
-
size: "small",
|
|
25
|
-
icon: icons.auto
|
|
26
|
-
}),
|
|
27
|
-
key: 'auto'
|
|
28
|
-
}, {
|
|
29
|
-
label: 'Light',
|
|
30
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
31
|
-
size: "small",
|
|
32
|
-
icon: icons.light
|
|
33
|
-
}),
|
|
34
|
-
key: 'light'
|
|
35
|
-
}, {
|
|
36
|
-
label: 'Dark',
|
|
37
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
38
|
-
size: "small",
|
|
39
|
-
icon: icons.dark
|
|
40
|
-
}),
|
|
41
|
-
key: 'dark'
|
|
42
|
-
}];
|
|
43
|
-
var ThemeSwitch = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
44
|
-
var _ref$size = _ref.size,
|
|
45
|
-
size = _ref$size === void 0 ? 'site' : _ref$size,
|
|
46
|
-
themeMode = _ref.themeMode,
|
|
47
|
-
onThemeSwitch = _ref.onThemeSwitch,
|
|
48
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
49
|
-
var menuProps = {
|
|
50
|
-
items: items,
|
|
51
|
-
onClick: function onClick(e) {
|
|
52
|
-
return onThemeSwitch(e.key);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
56
|
-
menu: menuProps,
|
|
57
|
-
trigger: ['click']
|
|
58
|
-
}, props), {}, {
|
|
59
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionIcon, {
|
|
60
|
-
size: size,
|
|
61
|
-
icon: icons[themeMode]
|
|
62
|
-
})
|
|
63
|
-
}));
|
|
64
|
-
});
|
|
65
|
-
var _default = ThemeSwitch;
|
|
66
|
-
exports.default = _default;
|
package/lib/Tooltip/index.d.ts
DELETED