@lobehub/ui 1.133.1 → 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 +4 -1
- package/es/mdx/Cards.js +7 -5
- package/es/mdx/Tabs.js +6 -4
- 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,7 +10,10 @@ 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>;
|
|
14
17
|
export type CardsProps = typeof _Cards & {
|
|
15
18
|
Card: typeof Card;
|
|
16
19
|
};
|
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
|
};
|
|
@@ -72,8 +72,10 @@ var Card = function Card(_ref2) {
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
var _Cards = function _Cards(_ref3) {
|
|
75
|
-
var children = _ref3.children
|
|
76
|
-
|
|
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,
|
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) {
|