@lobehub/ui 2.5.0 → 2.5.1
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/Text/Text.js +13 -2
- package/es/Text/styles.d.ts +5 -0
- package/es/Text/styles.js +16 -10
- package/es/Text/type.d.ts +1 -0
- package/package.json +1 -1
package/es/Text/Text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
var _excluded = ["as", "className", "children", "style", "type", "disabled", "strong", "italic", "underline", "delete", "mark", "code", "color", "weight", "ellipsis"];
|
|
3
|
+
var _excluded = ["as", "className", "children", "style", "type", "disabled", "strong", "italic", "underline", "delete", "fontSize", "mark", "code", "color", "weight", "ellipsis"];
|
|
4
4
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -26,6 +26,7 @@ var Text = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
26
|
italic = _ref.italic,
|
|
27
27
|
underline = _ref.underline,
|
|
28
28
|
deleteStyle = _ref.delete,
|
|
29
|
+
fontSize = _ref.fontSize,
|
|
29
30
|
mark = _ref.mark,
|
|
30
31
|
code = _ref.code,
|
|
31
32
|
color = _ref.color,
|
|
@@ -39,6 +40,13 @@ var Text = /*#__PURE__*/memo(function (_ref) {
|
|
|
39
40
|
return cva(styles.text, {
|
|
40
41
|
defaultVariants: {},
|
|
41
42
|
variants: {
|
|
43
|
+
as: {
|
|
44
|
+
h1: styles.h1,
|
|
45
|
+
h2: styles.h2,
|
|
46
|
+
h3: styles.h3,
|
|
47
|
+
h4: styles.h4,
|
|
48
|
+
h5: styles.h5
|
|
49
|
+
},
|
|
42
50
|
code: {
|
|
43
51
|
true: styles.code
|
|
44
52
|
},
|
|
@@ -74,15 +82,18 @@ var Text = /*#__PURE__*/memo(function (_ref) {
|
|
|
74
82
|
}
|
|
75
83
|
});
|
|
76
84
|
}, [styles]);
|
|
77
|
-
var textStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), color && {
|
|
85
|
+
var textStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), color && {
|
|
78
86
|
color: color
|
|
79
87
|
}), weight && {
|
|
80
88
|
fontWeight: weight
|
|
81
89
|
}), _typeof(ellipsis) === 'object' && ellipsis.rows && {
|
|
82
90
|
WebkitLineClamp: ellipsis.rows
|
|
91
|
+
}), {}, {
|
|
92
|
+
fontSize: fontSize
|
|
83
93
|
});
|
|
84
94
|
var content = /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({
|
|
85
95
|
className: cx(variants({
|
|
96
|
+
as: ['h1', 'h2', 'h3', 'h4', 'h5'].includes(Container) ? Container : undefined,
|
|
86
97
|
code: code,
|
|
87
98
|
delete: deleteStyle,
|
|
88
99
|
disabled: disabled,
|
package/es/Text/styles.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export declare const useStyles: (props?: unknown) => import("antd-style").Return
|
|
|
5
5
|
disabled: import("antd-style").SerializedStyles;
|
|
6
6
|
ellipsis: import("antd-style").SerializedStyles;
|
|
7
7
|
ellipsisMulti: import("antd-style").SerializedStyles;
|
|
8
|
+
h1: import("antd-style").SerializedStyles;
|
|
9
|
+
h2: import("antd-style").SerializedStyles;
|
|
10
|
+
h3: import("antd-style").SerializedStyles;
|
|
11
|
+
h4: import("antd-style").SerializedStyles;
|
|
12
|
+
h5: import("antd-style").SerializedStyles;
|
|
8
13
|
info: import("antd-style").SerializedStyles;
|
|
9
14
|
italic: import("antd-style").SerializedStyles;
|
|
10
15
|
mark: import("antd-style").SerializedStyles;
|
package/es/Text/styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
@@ -11,14 +11,20 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
11
11
|
disabled: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n color: ", ";\n "])), token.colorTextDisabled),
|
|
12
12
|
ellipsis: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
|
|
13
13
|
ellipsisMulti: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n "]))),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
// Heading styles
|
|
15
|
+
h1: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n font-size: calc(", "px * 2.5);\n font-weight: bold;\n line-height: 1.25;\n "])), token.fontSize),
|
|
16
|
+
h2: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-size: calc(", "px * 2);\n font-weight: bold;\n line-height: 1.25;\n "])), token.fontSize),
|
|
17
|
+
h3: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: calc(", "px * 1.5);\n font-weight: bold;\n line-height: 1.25;\n "])), token.fontSize),
|
|
18
|
+
h4: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n font-size: calc(", "px * 1.25);\n font-weight: bold;\n line-height: 1.25;\n "])), token.fontSize),
|
|
19
|
+
h5: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n font-size: ", "px;\n font-weight: bold;\n line-height: 1.25;\n "])), token.fontSize),
|
|
20
|
+
info: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorInfo),
|
|
21
|
+
italic: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n font-style: italic;\n "]))),
|
|
22
|
+
mark: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n color: #000;\n background-color: ", ";\n "])), token.yellow),
|
|
23
|
+
secondary: css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextSecondary),
|
|
24
|
+
strong: css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n font-weight: bold;\n "]))),
|
|
25
|
+
success: css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorSuccess),
|
|
26
|
+
text: css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", ";\n "])), token.fontSize, token.lineHeight),
|
|
27
|
+
underline: css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n text-decoration: underline;\n "]))),
|
|
28
|
+
warning: css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorWarning)
|
|
23
29
|
};
|
|
24
30
|
});
|
package/es/Text/type.d.ts
CHANGED