@lobehub/ui 1.1.0 → 1.3.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/README.md +6 -3
- package/es/ActionIcon/index.d.ts +28 -10
- package/es/ActionIcon/index.js +29 -50
- package/es/ActionIcon/style.d.ts +6 -0
- package/es/ActionIcon/style.js +12 -0
- package/es/CopyButton/index.d.ts +34 -0
- package/es/CopyButton/index.js +49 -0
- package/es/DraggablePanel/index.d.ts +64 -4
- package/es/DraggablePanel/index.js +4 -4
- package/es/DraggablePanel/style.js +1 -1
- package/es/DraggablePanel/utils.d.ts +1 -1
- package/es/EditableText/ControlInput.d.ts +9 -0
- package/es/EditableText/ControlInput.js +88 -0
- package/es/EditableText/index.d.ts +5 -0
- package/es/EditableText/index.js +35 -0
- package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
- package/es/Highlighter/SyntaxHighlighter/Prism.js +40 -0
- package/es/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
- package/es/Highlighter/SyntaxHighlighter/index.js +58 -0
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
- package/es/Highlighter/SyntaxHighlighter/style.js +15 -0
- package/es/Highlighter/index.d.ts +36 -0
- package/es/Highlighter/index.js +42 -0
- package/es/Highlighter/style.d.ts +5 -0
- package/es/Highlighter/style.js +18 -0
- package/es/Icon/index.d.ts +20 -0
- package/es/Icon/index.js +36 -0
- package/es/Logo/Divider.d.ts +3 -0
- package/es/Logo/Divider.js +22 -0
- package/es/Logo/Logo3D.d.ts +3 -4
- package/es/Logo/Logo3D.js +6 -4
- package/es/Logo/LogoFlat.d.ts +3 -4
- package/es/Logo/LogoFlat.js +6 -5
- package/es/Logo/LogoHighContrast.d.ts +3 -4
- package/es/Logo/LogoHighContrast.js +6 -5
- package/es/Logo/LogoText.d.ts +3 -4
- package/es/Logo/LogoText.js +6 -4
- package/es/Logo/index.d.ts +16 -4
- package/es/Logo/index.js +53 -9
- package/es/Logo/style.d.ts +4 -0
- package/es/Logo/style.js +10 -0
- package/es/Markdown/Code.d.ts +3 -0
- package/es/Markdown/Code.js +12 -0
- package/es/Markdown/CodeBlock.d.ts +3 -0
- package/es/Markdown/CodeBlock.js +27 -0
- package/es/Markdown/index.d.ts +13 -0
- package/es/Markdown/index.js +28 -0
- package/es/Markdown/style.d.ts +4 -0
- package/es/Markdown/style.js +12 -0
- package/es/MessageInput/index.d.ts +35 -0
- package/es/MessageInput/index.js +63 -0
- package/es/SearchBar/index.d.ts +5 -0
- package/es/SearchBar/index.js +27 -0
- package/es/SideNav/index.d.ts +15 -6
- package/es/SideNav/index.js +17 -20
- package/es/SideNav/style.d.ts +1 -0
- package/es/SideNav/style.js +8 -0
- package/es/Snippet/index.d.ts +29 -0
- package/es/Snippet/index.js +39 -0
- package/es/Snippet/style.d.ts +1 -0
- package/es/Snippet/style.js +9 -0
- package/es/StroyBook/index.d.ts +17 -0
- package/es/StroyBook/index.js +47 -0
- package/es/StroyBook/style.d.ts +8 -0
- package/es/StroyBook/style.js +14 -0
- package/es/Swatches/index.d.ts +8 -0
- package/es/Swatches/index.js +44 -0
- package/es/TabsNav/index.d.ts +22 -0
- package/es/{Template → TabsNav}/index.js +14 -9
- package/es/TabsNav/style.d.ts +3 -0
- package/es/TabsNav/style.js +14 -0
- package/es/ThemeProvider/GlobalStyle.js +1 -1
- package/es/ThemeProvider/index.d.ts +15 -0
- package/es/ThemeProvider/index.js +4 -0
- package/es/ThemeSwitch/index.d.ts +27 -0
- package/es/ThemeSwitch/index.js +60 -0
- package/es/Tooltip/index.d.ts +5 -0
- package/es/Tooltip/index.js +20 -0
- package/es/Tooltip/style.d.ts +3 -0
- package/es/Tooltip/style.js +10 -0
- package/es/hooks/useCopied.d.ts +4 -0
- package/es/hooks/useCopied.js +26 -0
- package/es/hooks/useHighlight.d.ts +36 -0
- package/es/hooks/useHighlight.js +63 -0
- package/es/index.d.ts +15 -3
- package/es/index.js +14 -2
- package/es/styles/theme/base.d.ts +2 -0
- package/es/styles/theme/base.js +15 -0
- package/es/styles/theme/dark.js +6 -14
- package/es/styles/theme/light.js +11 -12
- package/es/types/index.d.ts +14 -5
- package/lib/ActionIcon/index.d.ts +28 -10
- package/lib/ActionIcon/index.js +41 -83
- package/lib/ActionIcon/style.d.ts +6 -0
- package/lib/ActionIcon/style.js +64 -0
- package/lib/CopyButton/index.d.ts +34 -0
- package/lib/CopyButton/index.js +70 -0
- package/lib/DraggablePanel/index.d.ts +64 -4
- package/lib/DraggablePanel/index.js +160 -158
- package/lib/DraggablePanel/style.js +0 -1
- package/lib/DraggablePanel/utils.d.ts +1 -1
- package/lib/EditableText/ControlInput.d.ts +9 -0
- package/lib/EditableText/ControlInput.js +101 -0
- package/lib/EditableText/index.d.ts +5 -0
- package/lib/EditableText/index.js +52 -0
- package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
- package/lib/Highlighter/SyntaxHighlighter/Prism.js +41 -0
- package/lib/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
- package/lib/Highlighter/SyntaxHighlighter/index.js +55 -0
- package/lib/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
- package/lib/Highlighter/SyntaxHighlighter/style.js +58 -0
- package/lib/Highlighter/index.d.ts +36 -0
- package/lib/Highlighter/index.js +62 -0
- package/lib/Highlighter/style.d.ts +5 -0
- package/lib/Highlighter/style.js +107 -0
- package/lib/Icon/index.d.ts +20 -0
- package/lib/Icon/index.js +49 -0
- package/lib/Logo/Divider.d.ts +3 -0
- package/lib/Logo/Divider.js +41 -0
- package/lib/Logo/Logo3D.d.ts +3 -4
- package/lib/Logo/Logo3D.js +4 -14
- package/lib/Logo/LogoFlat.d.ts +3 -4
- package/lib/Logo/LogoFlat.js +18 -28
- package/lib/Logo/LogoHighContrast.d.ts +3 -4
- package/lib/Logo/LogoHighContrast.js +8 -31
- package/lib/Logo/LogoText.d.ts +3 -4
- package/lib/Logo/LogoText.js +5 -15
- package/lib/Logo/index.d.ts +16 -4
- package/lib/Logo/index.js +18 -8
- package/lib/Logo/style.d.ts +4 -0
- package/lib/Logo/style.js +41 -0
- package/lib/Markdown/Code.d.ts +3 -0
- package/lib/Markdown/Code.js +33 -0
- package/lib/Markdown/CodeBlock.d.ts +3 -0
- package/lib/Markdown/CodeBlock.js +64 -0
- package/lib/Markdown/index.d.ts +13 -0
- package/lib/Markdown/index.js +48 -0
- package/lib/Markdown/style.d.ts +4 -0
- package/lib/Markdown/style.js +64 -0
- package/lib/MessageInput/index.d.ts +35 -0
- package/lib/MessageInput/index.js +58 -0
- package/lib/SearchBar/index.d.ts +5 -0
- package/lib/SearchBar/index.js +42 -0
- package/lib/SideNav/index.d.ts +15 -6
- package/lib/SideNav/index.js +7 -31
- package/lib/SideNav/style.d.ts +1 -0
- package/lib/SideNav/style.js +46 -0
- package/lib/Snippet/index.d.ts +29 -0
- package/lib/{Template → Snippet}/index.js +16 -10
- package/lib/Snippet/style.d.ts +1 -0
- package/lib/Snippet/style.js +71 -0
- package/lib/StroyBook/index.d.ts +17 -0
- package/lib/StroyBook/index.js +65 -0
- package/lib/StroyBook/style.d.ts +8 -0
- package/lib/StroyBook/style.js +81 -0
- package/lib/Swatches/index.d.ts +8 -0
- package/lib/Swatches/index.js +68 -0
- package/lib/TabsNav/index.d.ts +22 -0
- package/lib/TabsNav/index.js +34 -0
- package/lib/TabsNav/style.d.ts +3 -0
- package/lib/TabsNav/style.js +65 -0
- package/lib/ThemeProvider/GlobalStyle.js +10 -4
- package/lib/ThemeProvider/index.d.ts +15 -0
- package/lib/ThemeProvider/index.js +1 -1
- package/lib/ThemeSwitch/index.d.ts +27 -0
- package/lib/ThemeSwitch/index.js +50 -0
- package/lib/Tooltip/index.d.ts +5 -0
- package/lib/Tooltip/index.js +34 -0
- package/lib/Tooltip/style.d.ts +3 -0
- package/lib/Tooltip/style.js +51 -0
- package/lib/hooks/useCopied.d.ts +4 -0
- package/lib/hooks/useCopied.js +44 -0
- package/lib/hooks/useHighlight.d.ts +36 -0
- package/lib/hooks/useHighlight.js +76 -0
- package/lib/index.d.ts +15 -3
- package/lib/index.js +47 -5
- package/lib/styles/theme/base.d.ts +2 -0
- package/lib/styles/theme/base.js +43 -0
- package/lib/styles/theme/dark.js +5 -12
- package/lib/styles/theme/light.js +10 -10
- package/lib/types/index.d.ts +14 -5
- package/package.json +18 -9
- package/es/Template/index.d.ts +0 -7
- package/es/ThemeProvider/token.d.ts +0 -3
- package/es/ThemeProvider/token.js +0 -45
- package/es/types/index.js +0 -1
- package/lib/Template/index.d.ts +0 -7
- package/lib/ThemeProvider/token.d.ts +0 -3
- package/lib/ThemeProvider/token.js +0 -73
- package/lib/types/index.js +0 -17
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Markdown/style.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
useStyles: () => useStyles
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(style_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode }) => {
|
|
27
|
+
return {
|
|
28
|
+
container: css`
|
|
29
|
+
p {
|
|
30
|
+
margin: 20px auto;
|
|
31
|
+
line-height: 2;
|
|
32
|
+
word-wrap: break-word;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
color: ${token.colorText};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
p:not(:last-child) {
|
|
38
|
+
margin-bottom: 1em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
blockquote p {
|
|
42
|
+
color: ${token.colorTextDescription};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ol,
|
|
46
|
+
ul {
|
|
47
|
+
li {
|
|
48
|
+
line-height: 2;
|
|
49
|
+
display: list-item;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`,
|
|
53
|
+
code: css`
|
|
54
|
+
padding: 2px 4px;
|
|
55
|
+
font-family: ${token.fontFamilyCode} !important;
|
|
56
|
+
color: ${isDarkMode ? token.cyan8 : token.pink7};
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
`
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
useStyles
|
|
64
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from 'antd';
|
|
3
|
+
/**
|
|
4
|
+
* @title MessageInputProps
|
|
5
|
+
* @category Props
|
|
6
|
+
* @description MessageInput 组件的 Props
|
|
7
|
+
*/
|
|
8
|
+
export interface MessageInputProps {
|
|
9
|
+
/**
|
|
10
|
+
* @title 确认回调函数
|
|
11
|
+
* @description 用户点击确认按钮后的回调函数
|
|
12
|
+
* @param text - 用户输入的文本
|
|
13
|
+
*/
|
|
14
|
+
onConfirm?: (text: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* @title 取消回调函数
|
|
17
|
+
* @description 用户点击取消按钮后的回调函数
|
|
18
|
+
*/
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* @title 默认值
|
|
22
|
+
* @description 输入框的默认值
|
|
23
|
+
*/
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
/**
|
|
26
|
+
* @title 渲染按钮
|
|
27
|
+
* @description 自定义渲染底部按钮
|
|
28
|
+
* @param text - 用户输入的文本
|
|
29
|
+
*/
|
|
30
|
+
renderButtons?: (text: string) => ButtonProps[];
|
|
31
|
+
height?: number;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
declare const MessageInput: import("react").NamedExoticComponent<MessageInputProps>;
|
|
35
|
+
export default MessageInput;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/MessageInput/index.tsx
|
|
20
|
+
var MessageInput_exports = {};
|
|
21
|
+
__export(MessageInput_exports, {
|
|
22
|
+
default: () => MessageInput_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(MessageInput_exports);
|
|
25
|
+
var import_antd = require("antd");
|
|
26
|
+
var import_antd_style = require("antd-style");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
var import_react_layout_kit = require("react-layout-kit");
|
|
29
|
+
var MessageInput = (0, import_react.memo)(
|
|
30
|
+
({ onCancel, defaultValue, onConfirm, renderButtons, height, className }) => {
|
|
31
|
+
const [tempSystemRole, setRole] = (0, import_react.useState)(defaultValue || "");
|
|
32
|
+
return /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { gap: 8 }, /* @__PURE__ */ React.createElement(
|
|
33
|
+
import_antd.Input.TextArea,
|
|
34
|
+
{
|
|
35
|
+
value: tempSystemRole,
|
|
36
|
+
allowClear: true,
|
|
37
|
+
placeholder: "例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。",
|
|
38
|
+
style: { height: height ?? 200 },
|
|
39
|
+
onChange: (e) => {
|
|
40
|
+
setRole(e.target.value);
|
|
41
|
+
},
|
|
42
|
+
className: (0, import_antd_style.cx)("nowheel", className)
|
|
43
|
+
}
|
|
44
|
+
), /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { direction: "horizontal-reverse", gap: 8 }, renderButtons ? renderButtons(tempSystemRole).map((buttonProps, index) => /* @__PURE__ */ React.createElement(import_antd.Button, { key: index, ...buttonProps })) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
45
|
+
import_antd.Button,
|
|
46
|
+
{
|
|
47
|
+
type: "primary",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
onConfirm == null ? void 0 : onConfirm(tempSystemRole);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"设定"
|
|
53
|
+
), /* @__PURE__ */ React.createElement(import_antd.Button, { type: "text", onClick: onCancel }, "取消"))));
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
var MessageInput_default = MessageInput;
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
export declare type SearchBarProps = InputProps;
|
|
4
|
+
declare const SearchBar: import("react").MemoExoticComponent<({ value, onChange, style, placeholder, ...props }: SearchBarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
export default SearchBar;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/SearchBar/index.tsx
|
|
20
|
+
var SearchBar_exports = {};
|
|
21
|
+
__export(SearchBar_exports, {
|
|
22
|
+
default: () => SearchBar_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(SearchBar_exports);
|
|
25
|
+
var import_icons = require("@ant-design/icons");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
var SearchBar = (0, import_react.memo)(({ value, onChange, style, placeholder, ...props }) => /* @__PURE__ */ React.createElement(
|
|
29
|
+
import_antd.Input,
|
|
30
|
+
{
|
|
31
|
+
prefix: /* @__PURE__ */ React.createElement(import_icons.SearchOutlined, null),
|
|
32
|
+
allowClear: true,
|
|
33
|
+
value,
|
|
34
|
+
placeholder: placeholder ?? "Search",
|
|
35
|
+
style: { ...style, borderColor: "transparent" },
|
|
36
|
+
onChange,
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
var SearchBar_default = SearchBar;
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {});
|
package/lib/SideNav/index.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { DivProps } from "../types";
|
|
2
|
-
import
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
export interface SideNavProps extends DivProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @description Avatar to be displayed at the top of the sidenav
|
|
6
|
+
*/
|
|
7
|
+
avatar?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* @description Actions to be displayed below the avatar
|
|
10
|
+
*/
|
|
11
|
+
topActions?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* @description Actions to be displayed at the bottom of the sidenav
|
|
14
|
+
*/
|
|
15
|
+
bottomActions: ReactNode;
|
|
7
16
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
17
|
+
declare const SideNav: import("react").NamedExoticComponent<SideNavProps>;
|
|
18
|
+
export default SideNav;
|
package/lib/SideNav/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/SideNav/index.tsx
|
|
@@ -33,26 +23,12 @@ __export(SideNav_exports, {
|
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(SideNav_exports);
|
|
35
25
|
var import_antd = require("antd");
|
|
36
|
-
var import_react =
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
|
|
45
|
-
width: 64px;
|
|
46
|
-
height: 100%;
|
|
47
|
-
min-height: 640px;
|
|
48
|
-
padding: 16px 0;
|
|
49
|
-
|
|
50
|
-
background: ${({ theme }) => theme.colorBgContainer};
|
|
51
|
-
border-right: 1px solid ${({ theme }) => theme.colorBorder};
|
|
52
|
-
`;
|
|
53
|
-
var SideNav = ({ avatar, topActions, bottomActions, ...props }) => {
|
|
54
|
-
return /* @__PURE__ */ import_react.default.createElement(Layout, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 16, direction: "vertical", align: "center" }, avatar, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 8, direction: "vertical", align: "center" }, topActions)), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4, direction: "vertical", align: "center" }, bottomActions));
|
|
55
|
-
};
|
|
56
|
-
var SideNav_default = import_react.default.memo(SideNav);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_style = require("./style");
|
|
28
|
+
var SideNav = (0, import_react.memo)(({ className, avatar, topActions, bottomActions, ...props }) => {
|
|
29
|
+
const { styles, cx } = (0, import_style.useStyles)();
|
|
30
|
+
return /* @__PURE__ */ React.createElement("div", { className: cx(styles, className), ...props }, /* @__PURE__ */ React.createElement(import_antd.Space, { size: 16, direction: "vertical", align: "center" }, avatar, /* @__PURE__ */ React.createElement(import_antd.Space, { size: 8, direction: "vertical", align: "center" }, topActions)), /* @__PURE__ */ React.createElement(import_antd.Space, { size: 4, direction: "vertical", align: "center" }, bottomActions));
|
|
31
|
+
});
|
|
32
|
+
var SideNav_default = SideNav;
|
|
57
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
34
|
0 && (module.exports = {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/SideNav/style.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
useStyles: () => useStyles
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(style_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var useStyles = (0, import_antd_style.createStyles)(
|
|
27
|
+
({ css, token }) => css`
|
|
28
|
+
display: flex;
|
|
29
|
+
flex: none;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
|
|
34
|
+
width: 64px;
|
|
35
|
+
height: 100%;
|
|
36
|
+
min-height: 640px;
|
|
37
|
+
padding: 16px 0;
|
|
38
|
+
|
|
39
|
+
background: ${token.colorBgContainer};
|
|
40
|
+
border-right: 1px solid ${token.colorBorder};
|
|
41
|
+
`
|
|
42
|
+
);
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
useStyles
|
|
46
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
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;
|
|
@@ -26,16 +26,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// src/
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
default: () =>
|
|
29
|
+
// src/Snippet/index.tsx
|
|
30
|
+
var Snippet_exports = {};
|
|
31
|
+
__export(Snippet_exports, {
|
|
32
|
+
default: () => Snippet_default
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var import_react =
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(Snippet_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_CopyButton = __toESM(require("../CopyButton"));
|
|
37
|
+
var import_Highlighter = require("../Highlighter");
|
|
38
|
+
var import_style = require("./style");
|
|
39
|
+
var Snippet = (0, import_react.memo)(
|
|
40
|
+
({ symbol, language = "tsx", children, copyable = true, type = "ghost", ...props }) => {
|
|
41
|
+
const { styles } = (0, import_style.useStyles)(type);
|
|
42
|
+
return /* @__PURE__ */ React.createElement("div", { className: styles, ...props }, /* @__PURE__ */ React.createElement(import_Highlighter.SyntaxHighlighter, { language }, [symbol, children].filter(Boolean).join(" ")), copyable && /* @__PURE__ */ React.createElement(import_CopyButton.default, { size: { fontSize: 14, blockSize: 24 }, content: children }));
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var Snippet_default = Snippet;
|
|
40
46
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
47
|
0 && (module.exports = {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Snippet/style.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
useStyles: () => useStyles
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(style_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var import_polished = require("polished");
|
|
27
|
+
var useStyles = (0, import_antd_style.createStyles)(
|
|
28
|
+
({ css, token }, type) => css`
|
|
29
|
+
display: flex;
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
align-items: center;
|
|
33
|
+
border-radius: ${token.borderRadius}px;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
padding: 0 8px;
|
|
36
|
+
height: 36px;
|
|
37
|
+
transition: background-color 100ms ${token.motionEaseOut};
|
|
38
|
+
|
|
39
|
+
${type === "block" ? css`
|
|
40
|
+
background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)};
|
|
41
|
+
` : css`
|
|
42
|
+
border: 1px solid ${token.colorBorder};
|
|
43
|
+
`}
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: ${token.colorFillTertiary};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ant-highlighter-shiki {
|
|
50
|
+
overflow: auto;
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
.prism-code {
|
|
54
|
+
background: none !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
pre {
|
|
58
|
+
background: none !important;
|
|
59
|
+
padding-top: 6px; !important;
|
|
60
|
+
margin: 0 !important;
|
|
61
|
+
line-height: 1;
|
|
62
|
+
}
|
|
63
|
+
code[class*='language-'] {
|
|
64
|
+
background: none !important;
|
|
65
|
+
}
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
useStyles
|
|
71
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/StroyBook/index.tsx
|
|
30
|
+
var StroyBook_exports = {};
|
|
31
|
+
__export(StroyBook_exports, {
|
|
32
|
+
StroyBook: () => StroyBook,
|
|
33
|
+
default: () => StroyBook_default,
|
|
34
|
+
useControls: () => import_leva.useControls,
|
|
35
|
+
useCreateStore: () => import_leva.useCreateStore
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(StroyBook_exports);
|
|
38
|
+
var import_antd_style = require("antd-style");
|
|
39
|
+
var import_leva = require("leva");
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_DraggablePanel = __toESM(require("../DraggablePanel"));
|
|
42
|
+
var import_style = require("./style");
|
|
43
|
+
var StroyBook = (0, import_react.memo)(
|
|
44
|
+
({ levaStore, noPadding, className, children, ...props }) => {
|
|
45
|
+
const { mobile } = (0, import_antd_style.useResponsive)();
|
|
46
|
+
const { styles, cx } = (0, import_style.useStyles)({ noPadding: Boolean(noPadding), mobile: Boolean(mobile) });
|
|
47
|
+
return /* @__PURE__ */ React.createElement("div", { className: cx(styles.editor, className), ...props }, /* @__PURE__ */ React.createElement("div", { className: styles.left }, children), /* @__PURE__ */ React.createElement(
|
|
48
|
+
import_DraggablePanel.default,
|
|
49
|
+
{
|
|
50
|
+
className: styles.right,
|
|
51
|
+
placement: mobile ? "bottom" : "right",
|
|
52
|
+
minWidth: 280
|
|
53
|
+
},
|
|
54
|
+
/* @__PURE__ */ React.createElement(import_leva.LevaPanel, { fill: true, store: levaStore, titleBar: false, flat: true }),
|
|
55
|
+
" "
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var StroyBook_default = StroyBook;
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
StroyBook,
|
|
63
|
+
useControls,
|
|
64
|
+
useCreateStore
|
|
65
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/StroyBook/style.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
useStyles: () => useStyles
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(style_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var useStyles = (0, import_antd_style.createStyles)(
|
|
27
|
+
({ css, token }, { noPadding, mobile }) => {
|
|
28
|
+
return {
|
|
29
|
+
editor: css`
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: stretch;
|
|
32
|
+
justify-content: stretch;
|
|
33
|
+
width: inherit;
|
|
34
|
+
min-height: inherit;
|
|
35
|
+
${mobile && css`
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
`}
|
|
38
|
+
`,
|
|
39
|
+
left: css`
|
|
40
|
+
flex: 1;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
overflow: auto;
|
|
45
|
+
${!noPadding && css`
|
|
46
|
+
padding: 40px 24px;
|
|
47
|
+
`}
|
|
48
|
+
`,
|
|
49
|
+
right: css`
|
|
50
|
+
--leva-sizes-controlWidth: 66%;
|
|
51
|
+
--leva-colors-elevation1: ${token.colorFillSecondary};
|
|
52
|
+
--leva-colors-elevation2: transparent;
|
|
53
|
+
--leva-colors-elevation3: ${token.colorFillSecondary};
|
|
54
|
+
--leva-colors-accent1: ${token.colorPrimary};
|
|
55
|
+
--leva-colors-accent2: ${token.colorPrimaryHover};
|
|
56
|
+
--leva-colors-accent3: ${token.colorPrimaryActive};
|
|
57
|
+
--leva-colors-highlight1: ${token.colorTextTertiary};
|
|
58
|
+
--leva-colors-highlight2: ${token.colorTextSecondary};
|
|
59
|
+
--leva-colors-highlight3: ${token.colorText};
|
|
60
|
+
--leva-colors-vivid1: ${token.colorWarning};
|
|
61
|
+
--leva-shadows-level1: unset;
|
|
62
|
+
--leva-shadows-level2: unset;
|
|
63
|
+
padding: 6px 0;
|
|
64
|
+
background: ${token.colorBgLayout};
|
|
65
|
+
> div {
|
|
66
|
+
background: transparent;
|
|
67
|
+
> div {
|
|
68
|
+
background: transparent;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
input:checked + label > svg {
|
|
72
|
+
stroke: ${token.colorBorder};
|
|
73
|
+
}
|
|
74
|
+
`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
useStyles
|
|
81
|
+
});
|