@lobehub/ui 1.132.7 → 1.133.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/mdx/FileTree.d.ts +24 -0
- package/es/mdx/FileTree.js +79 -0
- package/es/mdx/Steps.d.ts +3 -0
- package/es/mdx/Steps.js +21 -0
- package/es/mdx/index.d.ts +2 -0
- package/es/mdx/index.js +2 -0
- package/es/mdx/mdxComponents.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { type IconProps } from '../Icon';
|
|
3
|
+
export interface _FileTreeProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const _FileTree: FC<_FileTreeProps>;
|
|
7
|
+
export interface FolderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
icon?: IconProps['icon'];
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Folder: FC<FolderProps>;
|
|
14
|
+
export interface FileProps {
|
|
15
|
+
icon?: IconProps['icon'];
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
declare const File: FC<FileProps>;
|
|
19
|
+
export type FileTreeProps = typeof _FileTree & {
|
|
20
|
+
File: typeof File;
|
|
21
|
+
Folder: typeof Folder;
|
|
22
|
+
};
|
|
23
|
+
declare const FileTree: FileTreeProps;
|
|
24
|
+
export default FileTree;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
import { FileIcon, FolderIcon, FolderOpen } from 'lucide-react';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
|
+
import Icon from "../Icon";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
var useStyles = createStyles(function (_ref) {
|
|
12
|
+
var css = _ref.css,
|
|
13
|
+
token = _ref.token;
|
|
14
|
+
return {
|
|
15
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 1em);\n padding-block: 0.75em;\n padding-inline: 1em;\n\n color: ", ";\n\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color);\n "])), token.colorTextSecondary),
|
|
16
|
+
folder: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n &:hover {\n color: ", ";\n }\n "])), token.colorText),
|
|
17
|
+
folderChildren: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-inline-start: 1em;\n "])))
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
var _FileTree = function _FileTree(_ref2) {
|
|
21
|
+
var children = _ref2.children;
|
|
22
|
+
var _useStyles = useStyles(),
|
|
23
|
+
styles = _useStyles.styles;
|
|
24
|
+
return /*#__PURE__*/_jsx("div", {
|
|
25
|
+
className: styles.container,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var Folder = function Folder(_ref3) {
|
|
30
|
+
var name = _ref3.name,
|
|
31
|
+
defaultOpen = _ref3.defaultOpen,
|
|
32
|
+
_ref3$icon = _ref3.icon,
|
|
33
|
+
icon = _ref3$icon === void 0 ? FolderIcon : _ref3$icon,
|
|
34
|
+
children = _ref3.children;
|
|
35
|
+
var _useState = useState(defaultOpen),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
open = _useState2[0],
|
|
38
|
+
setOpen = _useState2[1];
|
|
39
|
+
var _useStyles2 = useStyles(),
|
|
40
|
+
styles = _useStyles2.styles;
|
|
41
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
42
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
43
|
+
align: 'center',
|
|
44
|
+
className: styles.folder,
|
|
45
|
+
gap: 4,
|
|
46
|
+
horizontal: true,
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return setOpen(!open);
|
|
49
|
+
},
|
|
50
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
51
|
+
icon: open ? FolderOpen : icon
|
|
52
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
53
|
+
children: name
|
|
54
|
+
})]
|
|
55
|
+
}), open && /*#__PURE__*/_jsx(Flexbox, {
|
|
56
|
+
className: styles.folderChildren,
|
|
57
|
+
children: children
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var File = function File(_ref4) {
|
|
62
|
+
var name = _ref4.name,
|
|
63
|
+
_ref4$icon = _ref4.icon,
|
|
64
|
+
icon = _ref4$icon === void 0 ? FileIcon : _ref4$icon;
|
|
65
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
66
|
+
align: 'center',
|
|
67
|
+
gap: 4,
|
|
68
|
+
horizontal: true,
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
icon: icon
|
|
71
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
72
|
+
children: name
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
var FileTree = _FileTree;
|
|
77
|
+
FileTree.Folder = Folder;
|
|
78
|
+
FileTree.File = File;
|
|
79
|
+
export default FileTree;
|
package/es/mdx/Steps.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
var useStyles = createStyles(function (_ref) {
|
|
6
|
+
var css = _ref.css,
|
|
7
|
+
token = _ref.token;
|
|
8
|
+
return {
|
|
9
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0.5;\n --lobe-markdown-margin-multiple: 1;\n\n position: relative;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 1em);\n padding-inline-start: 2.5em;\n\n &::before {\n content: '';\n\n position: absolute;\n inset-block-start: 0.25em;\n inset-inline-start: 0.9em;\n\n display: block;\n\n width: 1px;\n height: calc(100% - 0.5em);\n\n background: ", ";\n }\n\n h3 {\n counter-increment: step;\n\n &:not(:first-child) {\n margin-block-start: 2em;\n }\n\n &::before {\n content: counter(step);\n\n position: absolute;\n z-index: 1;\n inset-inline-start: 0;\n\n display: inline-block;\n\n width: 1.8em;\n height: 1.8em;\n margin-block-start: 0.3em;\n\n font-size: 0.8em;\n font-weight: 500;\n line-height: 1.8em;\n color: ", ";\n text-align: center;\n\n background: ", ";\n border-radius: 9999px;\n box-shadow: 0 0 0 2px ", ";\n }\n }\n "])), token.colorBorderSecondary, token.colorTextSecondary, token.colorBgElevated, token.colorBgLayout)
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
var Steps = function Steps(_ref2) {
|
|
13
|
+
var children = _ref2.children;
|
|
14
|
+
var _useStyles = useStyles(),
|
|
15
|
+
styles = _useStyles.styles;
|
|
16
|
+
return /*#__PURE__*/_jsx("div", {
|
|
17
|
+
className: styles.container,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default Steps;
|
package/es/mdx/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as Callout, type CalloutProps } from './Callout';
|
|
2
2
|
export { Card, type CardProps, default as Cards } from './Cards';
|
|
3
|
+
export { default as FileTree, type FileTreeProps } from './FileTree';
|
|
3
4
|
export { default as Image, type ImageProps } from './Image';
|
|
4
5
|
export { default as mdxComponents } from './mdxComponents';
|
|
5
6
|
export { default as Pre, type PreProps, PreSingleLine } from './Pre';
|
|
7
|
+
export { default as Steps } from './Steps';
|
|
6
8
|
export { default as Tabs, type TabsProps } from './Tabs';
|
|
7
9
|
export { default as Video, type VideoProps } from './Video';
|
package/es/mdx/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as Callout } from "./Callout";
|
|
2
2
|
export { Card, default as Cards } from "./Cards";
|
|
3
|
+
export { default as FileTree } from "./FileTree";
|
|
3
4
|
export { default as Image } from "./Image";
|
|
4
5
|
export { default as mdxComponents } from "./mdxComponents";
|
|
5
6
|
export { default as Pre, PreSingleLine } from "./Pre";
|
|
7
|
+
export { default as Steps } from "./Steps";
|
|
6
8
|
export { default as Tabs } from "./Tabs";
|
|
7
9
|
export { default as Video } from "./Video";
|
package/es/mdx/mdxComponents.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import Callout from "./Callout";
|
|
2
2
|
import Cards, { Card } from "./Cards";
|
|
3
|
+
import FileTree from "./FileTree";
|
|
3
4
|
import Image from "./Image";
|
|
5
|
+
import Steps from "./Steps";
|
|
4
6
|
import Tabs from "./Tabs";
|
|
5
7
|
import Video from "./Video";
|
|
6
8
|
var mdxComponents = {
|
|
7
9
|
Callout: Callout,
|
|
8
10
|
Card: Card,
|
|
9
11
|
Cards: Cards,
|
|
12
|
+
FileTree: FileTree,
|
|
10
13
|
Image: Image,
|
|
11
14
|
LobeCallout: Callout,
|
|
12
15
|
LobeCard: Card,
|
|
13
16
|
LobeCards: Cards,
|
|
17
|
+
LobeFileTree: FileTree,
|
|
18
|
+
LobeSteps: Steps,
|
|
14
19
|
LobeTabs: Tabs,
|
|
20
|
+
Steps: Steps,
|
|
15
21
|
Tabs: Tabs,
|
|
16
22
|
Video: Video
|
|
17
23
|
};
|