@lobehub/ui 1.78.0 → 1.79.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/Logo/index.js +28 -22
- package/es/Logo/style.d.ts +0 -1
- package/es/Logo/style.js +2 -3
- package/package.json +1 -1
package/es/Logo/index.js
CHANGED
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { useTheme } from 'antd-style';
|
|
7
7
|
import { memo } from 'react';
|
|
8
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
9
|
import Divider from "./Divider";
|
|
9
10
|
import LogoHighContrast from "./LogoHighContrast";
|
|
10
11
|
import LogoText from "./LogoText";
|
|
@@ -23,13 +24,12 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
|
23
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
25
|
var theme = useTheme();
|
|
25
26
|
var _useStyles = useStyles(),
|
|
26
|
-
styles = _useStyles.styles
|
|
27
|
-
cx = _useStyles.cx;
|
|
27
|
+
styles = _useStyles.styles;
|
|
28
28
|
var logoComponent;
|
|
29
29
|
switch (type) {
|
|
30
30
|
case '3d':
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
logoComponent = /*#__PURE__*/_jsx("img", _objectSpread({
|
|
33
33
|
alt: "lobehub",
|
|
34
34
|
src: LOGO_3D,
|
|
35
35
|
style: _objectSpread({
|
|
@@ -37,10 +37,11 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
|
37
37
|
width: size
|
|
38
38
|
}, style)
|
|
39
39
|
}, props));
|
|
40
|
+
break;
|
|
40
41
|
}
|
|
41
42
|
case 'flat':
|
|
42
43
|
{
|
|
43
|
-
|
|
44
|
+
logoComponent = /*#__PURE__*/_jsx("img", {
|
|
44
45
|
alt: "lobehub",
|
|
45
46
|
src: LOGO_FLAT,
|
|
46
47
|
style: _objectSpread({
|
|
@@ -48,25 +49,28 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
|
48
49
|
width: size
|
|
49
50
|
}, style)
|
|
50
51
|
});
|
|
52
|
+
break;
|
|
51
53
|
}
|
|
52
54
|
case 'high-contrast':
|
|
53
55
|
{
|
|
54
|
-
|
|
56
|
+
logoComponent = /*#__PURE__*/_jsx(LogoHighContrast, _objectSpread({
|
|
55
57
|
style: _objectSpread({
|
|
56
58
|
height: size,
|
|
57
59
|
width: size
|
|
58
60
|
}, style)
|
|
59
61
|
}, props));
|
|
62
|
+
break;
|
|
60
63
|
}
|
|
61
64
|
case 'text':
|
|
62
65
|
{
|
|
63
|
-
|
|
66
|
+
logoComponent = /*#__PURE__*/_jsx(LogoText, _objectSpread({
|
|
64
67
|
className: className,
|
|
65
68
|
style: _objectSpread({
|
|
66
69
|
height: size,
|
|
67
70
|
width: 'auto'
|
|
68
71
|
}, style)
|
|
69
72
|
}, props));
|
|
73
|
+
break;
|
|
70
74
|
}
|
|
71
75
|
case 'combine':
|
|
72
76
|
{
|
|
@@ -86,27 +90,29 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
|
86
90
|
}
|
|
87
91
|
})]
|
|
88
92
|
});
|
|
93
|
+
break;
|
|
89
94
|
}
|
|
90
95
|
}
|
|
96
|
+
if (!extra) return logoComponent;
|
|
91
97
|
var extraSize = Math.round(size / 3 * 1.9);
|
|
92
|
-
return /*#__PURE__*/_jsxs(
|
|
93
|
-
|
|
98
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
99
|
+
align: 'center',
|
|
100
|
+
className: className,
|
|
101
|
+
horizontal: true,
|
|
94
102
|
style: style
|
|
95
103
|
}, props), {}, {
|
|
96
|
-
children: [logoComponent,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children: extra
|
|
109
|
-
})]
|
|
104
|
+
children: [logoComponent, /*#__PURE__*/_jsx(Divider, {
|
|
105
|
+
style: {
|
|
106
|
+
color: theme.colorFill,
|
|
107
|
+
height: extraSize,
|
|
108
|
+
width: extraSize
|
|
109
|
+
}
|
|
110
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
111
|
+
className: styles.extraTitle,
|
|
112
|
+
style: {
|
|
113
|
+
fontSize: extraSize
|
|
114
|
+
},
|
|
115
|
+
children: extra
|
|
110
116
|
})]
|
|
111
117
|
}));
|
|
112
118
|
});
|
package/es/Logo/style.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ export declare const LOGO_3D: string;
|
|
|
2
2
|
export declare const LOGO_FLAT: string;
|
|
3
3
|
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
4
4
|
extraTitle: import("antd-style").SerializedStyles;
|
|
5
|
-
flexCenter: import("antd-style").SerializedStyles;
|
|
6
5
|
}>;
|
package/es/Logo/style.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject
|
|
2
|
+
var _templateObject;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { genCdnUrl } from "../utils/genCdnUrl";
|
|
5
5
|
export var LOGO_3D = genCdnUrl({
|
|
@@ -15,7 +15,6 @@ export var LOGO_FLAT = genCdnUrl({
|
|
|
15
15
|
export var useStyles = createStyles(function (_ref) {
|
|
16
16
|
var css = _ref.css;
|
|
17
17
|
return {
|
|
18
|
-
extraTitle: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 300;\n white-space: nowrap;\n "])))
|
|
19
|
-
flexCenter: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n "])))
|
|
18
|
+
extraTitle: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 300;\n white-space: nowrap;\n "])))
|
|
20
19
|
};
|
|
21
20
|
});
|