@lobehub/ui 1.133.0 → 1.133.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/es/mdx/Callout.js +5 -3
- package/es/mdx/Cards.d.ts +8 -2
- package/es/mdx/Cards.js +11 -8
- package/es/mdx/Tabs.js +6 -4
- package/es/mdx/index.d.ts +1 -1
- package/es/mdx/index.js +1 -1
- package/es/mdx/mdxComponents.js +1 -8
- package/package.json +1 -1
package/es/mdx/Callout.js
CHANGED
|
@@ -47,6 +47,10 @@ var Callout = function Callout(_ref2) {
|
|
|
47
47
|
var selectedType = (typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig[type]) || typeConfig.info;
|
|
48
48
|
var icon = selectedType.icon,
|
|
49
49
|
color = selectedType.color;
|
|
50
|
+
var content = children;
|
|
51
|
+
if (isString(children)) content = /*#__PURE__*/_jsx("p", {
|
|
52
|
+
children: children
|
|
53
|
+
});
|
|
50
54
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
51
55
|
align: 'flex-start',
|
|
52
56
|
className: styles.container,
|
|
@@ -66,9 +70,7 @@ var Callout = function Callout(_ref2) {
|
|
|
66
70
|
}
|
|
67
71
|
}), /*#__PURE__*/_jsx("div", {
|
|
68
72
|
className: styles.content,
|
|
69
|
-
children:
|
|
70
|
-
children: children
|
|
71
|
-
}) : children
|
|
73
|
+
children: content
|
|
72
74
|
})]
|
|
73
75
|
});
|
|
74
76
|
};
|
package/es/mdx/Cards.d.ts
CHANGED
|
@@ -10,6 +10,12 @@ export interface CardProps extends Omit<FlexboxProps, 'children'> {
|
|
|
10
10
|
title: string;
|
|
11
11
|
}
|
|
12
12
|
declare const Card: FC<CardProps>;
|
|
13
|
-
|
|
13
|
+
interface _CardsProps extends PropsWithChildren {
|
|
14
|
+
rows?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const _Cards: FC<_CardsProps>;
|
|
17
|
+
export type CardsProps = typeof _Cards & {
|
|
18
|
+
Card: typeof Card;
|
|
19
|
+
};
|
|
20
|
+
declare const Cards: CardsProps;
|
|
14
21
|
export default Cards;
|
|
15
|
-
export { Card };
|
package/es/mdx/Cards.js
CHANGED
|
@@ -12,14 +12,14 @@ import Icon from "../Icon";
|
|
|
12
12
|
import Img from "../Img";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
var useStyles = createStyles(function (_ref) {
|
|
15
|
+
var useStyles = createStyles(function (_ref, rows) {
|
|
16
16
|
var css = _ref.css,
|
|
17
17
|
cx = _ref.cx,
|
|
18
18
|
token = _ref.token;
|
|
19
19
|
var icon = cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-block: 0.1em;\n opacity: 0.5;\n transition: opacity 0.2s ", ";\n "])), token.motionEaseInOut));
|
|
20
20
|
return {
|
|
21
|
-
card: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0;\n --lobe-markdown-margin-multiple: 1;\n\n overflow: hidden;\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\n transition: all 0.2s ", ";\n\n h3,\n p {\n margin-block: 0;\n }\n\n p {\n color: ", ";\n transition: color 0.2s ", ";\n }\n\n &:hover {\n background: ", ";\n box-shadow: 0 0 0 1px ", ";\n\n p {\n color: ", ";\n }\n\n .", " {\n opacity: 1;\n }\n }\n "])), token.colorText, token.motionEaseInOut, token.colorTextDescription, token.motionEaseInOut, token.colorFillQuaternary, token.colorBorder, token.colorTextSecondary, icon),
|
|
22
|
-
container: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n --rows:
|
|
21
|
+
card: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0;\n --lobe-markdown-margin-multiple: 1;\n\n overflow: hidden;\n\n height: 100%;\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\n transition: all 0.2s ", ";\n\n h3,\n p {\n margin-block: 0;\n }\n\n p {\n color: ", ";\n transition: color 0.2s ", ";\n }\n\n &:hover {\n background: ", ";\n box-shadow: 0 0 0 1px ", ";\n\n p {\n color: ", ";\n }\n\n .", " {\n opacity: 1;\n }\n }\n "])), token.colorText, token.motionEaseInOut, token.colorTextDescription, token.motionEaseInOut, token.colorFillQuaternary, token.colorBorder, token.colorTextSecondary, icon),
|
|
22
|
+
container: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n --rows: ", ";\n\n display: grid;\n grid-template-columns: repeat(\n auto-fill,\n minmax(max(250px, calc((100% - 1rem * 2) / var(--rows))), 1fr)\n );\n gap: 1em;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 1em);\n\n > div {\n margin: 0 !important;\n }\n "])), rows),
|
|
23
23
|
content: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n gap: 0.75em;\n padding: 1em;\n "]))),
|
|
24
24
|
icon: icon
|
|
25
25
|
};
|
|
@@ -71,14 +71,17 @@ var Card = function Card(_ref2) {
|
|
|
71
71
|
}))
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
var
|
|
75
|
-
var children = _ref3.children
|
|
76
|
-
|
|
74
|
+
var _Cards = function _Cards(_ref3) {
|
|
75
|
+
var children = _ref3.children,
|
|
76
|
+
_ref3$rows = _ref3.rows,
|
|
77
|
+
rows = _ref3$rows === void 0 ? 3 : _ref3$rows;
|
|
78
|
+
var _useStyles2 = useStyles(rows),
|
|
77
79
|
styles = _useStyles2.styles;
|
|
78
80
|
return /*#__PURE__*/_jsx("div", {
|
|
79
81
|
className: styles.container,
|
|
80
82
|
children: children
|
|
81
83
|
});
|
|
82
84
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
var Cards = _Cards;
|
|
86
|
+
Cards.Card = Card;
|
|
87
|
+
export default Cards;
|
package/es/mdx/Tabs.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3;
|
|
4
4
|
import { createStyles } from 'antd-style';
|
|
5
|
-
import { isString } from 'lodash-es';
|
|
5
|
+
import { isArray, isString } from 'lodash-es';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
import TabsNav from "../TabsNav";
|
|
@@ -22,11 +22,13 @@ var _TabItem = function _TabItem(_ref2) {
|
|
|
22
22
|
var children = _ref2.children;
|
|
23
23
|
var _useStyles = useStyles(),
|
|
24
24
|
styles = _useStyles.styles;
|
|
25
|
+
var content = children;
|
|
26
|
+
if (isString(children) || isArray(children)) content = /*#__PURE__*/_jsx("p", {
|
|
27
|
+
children: children
|
|
28
|
+
});
|
|
25
29
|
return /*#__PURE__*/_jsx("div", {
|
|
26
30
|
className: styles.body,
|
|
27
|
-
children:
|
|
28
|
-
children: children
|
|
29
|
-
}) : children
|
|
31
|
+
children: content
|
|
30
32
|
});
|
|
31
33
|
};
|
|
32
34
|
var _Tabs = function _Tabs(_ref3) {
|
package/es/mdx/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Callout, type CalloutProps } from './Callout';
|
|
2
|
-
export {
|
|
2
|
+
export { default as Cards, type CardsProps } from './Cards';
|
|
3
3
|
export { default as FileTree, type FileTreeProps } from './FileTree';
|
|
4
4
|
export { default as Image, type ImageProps } from './Image';
|
|
5
5
|
export { default as mdxComponents } from './mdxComponents';
|
package/es/mdx/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Callout } from "./Callout";
|
|
2
|
-
export {
|
|
2
|
+
export { default as Cards } from "./Cards";
|
|
3
3
|
export { default as FileTree } from "./FileTree";
|
|
4
4
|
export { default as Image } from "./Image";
|
|
5
5
|
export { default as mdxComponents } from "./mdxComponents";
|
package/es/mdx/mdxComponents.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Callout from "./Callout";
|
|
2
|
-
import Cards
|
|
2
|
+
import Cards from "./Cards";
|
|
3
3
|
import FileTree from "./FileTree";
|
|
4
4
|
import Image from "./Image";
|
|
5
5
|
import Steps from "./Steps";
|
|
@@ -7,16 +7,9 @@ import Tabs from "./Tabs";
|
|
|
7
7
|
import Video from "./Video";
|
|
8
8
|
var mdxComponents = {
|
|
9
9
|
Callout: Callout,
|
|
10
|
-
Card: Card,
|
|
11
10
|
Cards: Cards,
|
|
12
11
|
FileTree: FileTree,
|
|
13
12
|
Image: Image,
|
|
14
|
-
LobeCallout: Callout,
|
|
15
|
-
LobeCard: Card,
|
|
16
|
-
LobeCards: Cards,
|
|
17
|
-
LobeFileTree: FileTree,
|
|
18
|
-
LobeSteps: Steps,
|
|
19
|
-
LobeTabs: Tabs,
|
|
20
13
|
Steps: Steps,
|
|
21
14
|
Tabs: Tabs,
|
|
22
15
|
Video: Video
|