@lobehub/ui 1.151.1 → 1.151.3

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/Card.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { TagProps } from 'antd';
1
2
  import { FC } from 'react';
2
3
  import { type FlexboxProps } from 'react-layout-kit';
3
4
  import { type IconProps } from "../Icon";
@@ -7,6 +8,8 @@ export interface CardProps extends Omit<FlexboxProps, 'children'> {
7
8
  icon?: IconProps['icon'];
8
9
  iconProps?: Omit<IconProps, 'icon'>;
9
10
  image?: string;
11
+ tag?: string;
12
+ tagColor?: TagProps['color'];
10
13
  title: string;
11
14
  }
12
15
  declare const Card: FC<CardProps>;
package/es/mdx/Card.js CHANGED
@@ -3,8 +3,9 @@
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
6
- var _excluded = ["icon", "title", "desc", "href", "iconProps", "className", "image"];
6
+ var _excluded = ["tag", "tagColor", "icon", "title", "desc", "href", "iconProps", "className", "image"];
7
7
  var _templateObject, _templateObject2, _templateObject3;
8
+ import { Tag } from 'antd';
8
9
  import { createStyles } from 'antd-style';
9
10
  import { Flexbox } from 'react-layout-kit';
10
11
  import A from "../A";
@@ -18,13 +19,16 @@ var useStyles = createStyles(function (_ref) {
18
19
  token = _ref.token;
19
20
  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
21
  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 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
- content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: 0.75em;\n width: 100%;\n padding: 1em;\n "]))),
22
+ card: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0.2;\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),
23
+ content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 1.4em;\n "]))),
23
24
  icon: icon
24
25
  };
25
26
  });
26
27
  var Card = function Card(_ref2) {
27
- var icon = _ref2.icon,
28
+ var tag = _ref2.tag,
29
+ _ref2$tagColor = _ref2.tagColor,
30
+ tagColor = _ref2$tagColor === void 0 ? 'blue' : _ref2$tagColor,
31
+ icon = _ref2.icon,
28
32
  title = _ref2.title,
29
33
  desc = _ref2.desc,
30
34
  href = _ref2.href,
@@ -50,25 +54,45 @@ var Card = function Card(_ref2) {
50
54
  width: '100%'
51
55
  },
52
56
  width: 250
53
- }), /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
57
+ }), tag && /*#__PURE__*/_jsx(Flexbox, {
58
+ align: 'flex-start',
59
+ className: styles.content,
60
+ style: {
61
+ paddingBottom: '0.2em',
62
+ paddingTop: '1.8em'
63
+ },
64
+ children: /*#__PURE__*/_jsx(Tag, {
65
+ bordered: false,
66
+ color: tagColor,
67
+ style: {
68
+ borderRadius: '1em',
69
+ fontSize: '0.8em',
70
+ fontWeight: 500,
71
+ paddingBlock: '0.1em',
72
+ paddingInline: '0.6em'
73
+ },
74
+ children: tag
75
+ })
76
+ }), /*#__PURE__*/_jsxs(Flexbox, {
54
77
  align: desc ? 'flex-start' : 'center',
55
78
  className: styles.content,
56
- horizontal: true
57
- }, rest), {}, {
79
+ gap: '0.75em',
80
+ horizontal: true,
58
81
  children: [!image && icon && /*#__PURE__*/_jsx(Icon, _objectSpread({
59
82
  className: styles.icon,
60
83
  icon: icon,
61
84
  size: {
62
85
  fontSize: '1.5em'
63
86
  }
64
- }, iconProps)), /*#__PURE__*/_jsxs("div", {
87
+ }, iconProps)), /*#__PURE__*/_jsxs(Flexbox, {
88
+ gap: '0.2em',
65
89
  children: [/*#__PURE__*/_jsx("h3", {
66
90
  children: title
67
91
  }), desc && /*#__PURE__*/_jsx("p", {
68
92
  children: desc
69
93
  })]
70
94
  })]
71
- }))]
95
+ })]
72
96
  }))
73
97
  });
74
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.151.1",
3
+ "version": "1.151.3",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",