@lobehub/ui 1.69.0 → 1.71.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/Features/Item.d.ts +2 -1
- package/es/Features/Item.js +9 -10
- package/es/GridBackground/Grid.d.ts +26 -0
- package/es/GridBackground/Grid.js +99 -0
- package/es/GridBackground/GridShowcase.d.ts +8 -0
- package/es/GridBackground/GridShowcase.js +50 -0
- package/es/GridBackground/index.d.ts +16 -0
- package/es/GridBackground/index.js +87 -0
- package/es/GridBackground/style.d.ts +9 -0
- package/es/GridBackground/style.js +22 -0
- package/es/LogoThree/Loading.d.ts +5 -0
- package/es/LogoThree/Loading.js +21 -0
- package/es/LogoThree/Logo.d.ts +6 -0
- package/es/LogoThree/Logo.js +27 -0
- package/es/LogoThree/index.d.ts +8 -0
- package/es/LogoThree/index.js +36 -0
- package/es/TokenTag/index.d.ts +0 -1
- package/es/TokenTag/index.js +3 -6
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/package.json +5 -1
package/es/Features/Item.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { IconProps } from "../Icon";
|
|
2
3
|
import type { DivProps } from "../types";
|
|
3
4
|
export interface FeatureItem {
|
|
4
5
|
/**
|
|
@@ -16,7 +17,7 @@ export interface FeatureItem {
|
|
|
16
17
|
/**
|
|
17
18
|
* @description The name of the icon to display on the feature item.
|
|
18
19
|
*/
|
|
19
|
-
icon?:
|
|
20
|
+
icon?: IconProps['icon'];
|
|
20
21
|
/**
|
|
21
22
|
* @description The URL of the image to display on the feature item.
|
|
22
23
|
*/
|
package/es/Features/Item.js
CHANGED
|
@@ -3,10 +3,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["style", "className", "row", "column", "description", "image", "title", "link", "icon", "imageStyle", "openExternal"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
-
import { Icon } from "./..";
|
|
7
|
-
import * as LucideIcon from 'lucide-react';
|
|
8
6
|
import { memo } from 'react';
|
|
9
7
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
8
|
+
import Icon from "../Icon";
|
|
10
9
|
import { useStyles } from "./Item.style";
|
|
11
10
|
|
|
12
11
|
// @ts-ignore
|
|
@@ -15,13 +14,16 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
14
|
var Image = /*#__PURE__*/memo(function (_ref) {
|
|
16
15
|
var image = _ref.image,
|
|
17
16
|
className = _ref.className,
|
|
18
|
-
title = _ref.title
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
style = _ref.style;
|
|
19
19
|
return image.startsWith('http') ? /*#__PURE__*/_jsx("img", {
|
|
20
20
|
alt: title,
|
|
21
21
|
className: className,
|
|
22
|
-
src: image
|
|
22
|
+
src: image,
|
|
23
|
+
style: style
|
|
23
24
|
}) : /*#__PURE__*/_jsx(Center, {
|
|
24
25
|
className: className,
|
|
26
|
+
style: style,
|
|
25
27
|
children: image
|
|
26
28
|
});
|
|
27
29
|
});
|
|
@@ -45,9 +47,6 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
|
|
|
45
47
|
}),
|
|
46
48
|
styles = _useStyles.styles,
|
|
47
49
|
cx = _useStyles.cx;
|
|
48
|
-
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
var FeatureIcon = icon && LucideIcon[icon];
|
|
51
50
|
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
52
51
|
className: cx(styles.container, className),
|
|
53
52
|
style: _objectSpread({
|
|
@@ -57,12 +56,12 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
|
|
|
57
56
|
}, props), {}, {
|
|
58
57
|
children: /*#__PURE__*/_jsxs("div", {
|
|
59
58
|
className: styles.cell,
|
|
60
|
-
children: [image ||
|
|
59
|
+
children: [image || icon && /*#__PURE__*/_jsxs(Center, {
|
|
61
60
|
className: styles.imgContainer,
|
|
62
61
|
style: imageStyle,
|
|
63
|
-
children: [
|
|
62
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
64
63
|
className: styles.img,
|
|
65
|
-
icon:
|
|
64
|
+
icon: icon
|
|
66
65
|
}), image && /*#__PURE__*/_jsx(Image, {
|
|
67
66
|
className: styles.img,
|
|
68
67
|
image: image,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
declare enum Line {
|
|
4
|
+
l7 = 0,
|
|
5
|
+
l6 = 1,
|
|
6
|
+
l5 = 2,
|
|
7
|
+
l4 = 3,
|
|
8
|
+
l3 = 4,
|
|
9
|
+
l2 = 5,
|
|
10
|
+
l1 = 6,
|
|
11
|
+
center = 7,
|
|
12
|
+
r1 = 8,
|
|
13
|
+
r2 = 9,
|
|
14
|
+
r3 = 10,
|
|
15
|
+
r4 = 11,
|
|
16
|
+
r5 = 12,
|
|
17
|
+
r6 = 13,
|
|
18
|
+
r7 = 14
|
|
19
|
+
}
|
|
20
|
+
export interface GridProps extends DivProps {
|
|
21
|
+
color?: string;
|
|
22
|
+
linePick?: Line;
|
|
23
|
+
strokeWidth?: number;
|
|
24
|
+
}
|
|
25
|
+
declare const Grid: import("react").NamedExoticComponent<GridProps>;
|
|
26
|
+
export default Grid;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["color", "strokeWidth", "linePick"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
+
import { isUndefined } from 'lodash-es';
|
|
7
|
+
import { memo, useCallback } from 'react';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
var Line = /*#__PURE__*/function (Line) {
|
|
12
|
+
Line[Line["l7"] = 0] = "l7";
|
|
13
|
+
Line[Line["l6"] = 1] = "l6";
|
|
14
|
+
Line[Line["l5"] = 2] = "l5";
|
|
15
|
+
Line[Line["l4"] = 3] = "l4";
|
|
16
|
+
Line[Line["l3"] = 4] = "l3";
|
|
17
|
+
Line[Line["l2"] = 5] = "l2";
|
|
18
|
+
Line[Line["l1"] = 6] = "l1";
|
|
19
|
+
Line[Line["center"] = 7] = "center";
|
|
20
|
+
Line[Line["r1"] = 8] = "r1";
|
|
21
|
+
Line[Line["r2"] = 9] = "r2";
|
|
22
|
+
Line[Line["r3"] = 10] = "r3";
|
|
23
|
+
Line[Line["r4"] = 11] = "r4";
|
|
24
|
+
Line[Line["r5"] = 12] = "r5";
|
|
25
|
+
Line[Line["r6"] = 13] = "r6";
|
|
26
|
+
Line[Line["r7"] = 14] = "r7";
|
|
27
|
+
return Line;
|
|
28
|
+
}(Line || {});
|
|
29
|
+
var Grid = /*#__PURE__*/memo(function (_ref) {
|
|
30
|
+
var _ref$color = _ref.color,
|
|
31
|
+
color = _ref$color === void 0 ? '#fff' : _ref$color,
|
|
32
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
33
|
+
strokeWidth = _ref$strokeWidth === void 0 ? 3 : _ref$strokeWidth,
|
|
34
|
+
linePick = _ref.linePick,
|
|
35
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
var isUnpick = isUndefined(linePick);
|
|
37
|
+
var showLine = useCallback(function (l) {
|
|
38
|
+
return isUnpick || linePick === l;
|
|
39
|
+
}, [linePick]);
|
|
40
|
+
var vLine = /*#__PURE__*/_jsxs(_Fragment, {
|
|
41
|
+
children: [showLine(Line.l7) && /*#__PURE__*/_jsx("path", {
|
|
42
|
+
d: "M2 420v-60.343c0-21.82 14.15-41.12 34.959-47.684L1026 0h0"
|
|
43
|
+
}), showLine(Line.l6) && /*#__PURE__*/_jsx("path", {
|
|
44
|
+
d: "M268 420v-62.077c0-20.977 13.094-39.724 32.789-46.944L1149 0h0"
|
|
45
|
+
}), showLine(Line.l5) && /*#__PURE__*/_jsx("path", {
|
|
46
|
+
d: "M534 420v-64.358a50 50 0 0129.884-45.775L1269 0h0"
|
|
47
|
+
}), showLine(Line.l4) && /*#__PURE__*/_jsx("path", {
|
|
48
|
+
d: "M800 420v-67.395a50 50 0 0125.958-43.84L1389 0h0"
|
|
49
|
+
}), showLine(Line.l3) && /*#__PURE__*/_jsx("path", {
|
|
50
|
+
d: "M1066 420v-71.645a50 50 0 0120.456-40.337L1507 0h0"
|
|
51
|
+
}), showLine(Line.l2) && /*#__PURE__*/_jsx("path", {
|
|
52
|
+
d: "M1332 420v-77.506a50 50 0 0113.194-33.843L1629 0h0"
|
|
53
|
+
}), showLine(Line.l1) && /*#__PURE__*/_jsx("path", {
|
|
54
|
+
d: "M1598 420v-86.225a50 50 0 014.438-20.594L1744 0h0"
|
|
55
|
+
}), showLine(Line.center) && /*#__PURE__*/_jsx("path", {
|
|
56
|
+
d: "M1864 420V0h0"
|
|
57
|
+
}), showLine(Line.r1) && /*#__PURE__*/_jsx("path", {
|
|
58
|
+
d: "M2130 420v-86.225a50 50 0 00-4.438-20.594L1984 0h0"
|
|
59
|
+
}), showLine(Line.r2) && /*#__PURE__*/_jsx("path", {
|
|
60
|
+
d: "M2396 420v-77.506a50 50 0 00-13.194-33.843L2099 0h0"
|
|
61
|
+
}), showLine(Line.r3) && /*#__PURE__*/_jsx("path", {
|
|
62
|
+
d: "M2662 420v-71.645a50 50 0 00-20.456-40.337L2221 0h0"
|
|
63
|
+
}), showLine(Line.r4) && /*#__PURE__*/_jsx("path", {
|
|
64
|
+
d: "M2928 420v-67.395a50 50 0 00-25.958-43.84L2339 0h0"
|
|
65
|
+
}), showLine(Line.r5) && /*#__PURE__*/_jsx("path", {
|
|
66
|
+
d: "M3194 420v-64.358a50 50 0 00-29.884-45.775L2459 0h0"
|
|
67
|
+
}), showLine(Line.r6) && /*#__PURE__*/_jsx("path", {
|
|
68
|
+
d: "M3460 420v-62.077c0-20.977-13.094-39.724-32.789-46.944L2579 0h0"
|
|
69
|
+
}), showLine(Line.r7) && /*#__PURE__*/_jsx("path", {
|
|
70
|
+
d: "M3726 420v-60.343c0-21.82-14.15-41.12-34.959-47.684L2702 0h0"
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
var hLine = isUnpick && /*#__PURE__*/_jsxs(_Fragment, {
|
|
74
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
75
|
+
d: "M2835 42H892"
|
|
76
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
77
|
+
d: "M595 136h2538"
|
|
78
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
79
|
+
d: "M237 249h3254"
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, props), {}, {
|
|
83
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
84
|
+
style: {
|
|
85
|
+
width: '100%'
|
|
86
|
+
},
|
|
87
|
+
viewBox: "0 0 3728 422",
|
|
88
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
89
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
90
|
+
fill: "none",
|
|
91
|
+
fillRule: "evenodd",
|
|
92
|
+
stroke: color,
|
|
93
|
+
strokeWidth: strokeWidth,
|
|
94
|
+
children: [vLine, hLine]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}));
|
|
98
|
+
});
|
|
99
|
+
export default Grid;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
import { type GridBackgroundProps } from './index';
|
|
4
|
+
export interface GridShowcaseProps extends DivProps {
|
|
5
|
+
backgroundColor?: GridBackgroundProps['backgroundColor'];
|
|
6
|
+
}
|
|
7
|
+
declare const GridShowcase: import("react").NamedExoticComponent<GridShowcaseProps>;
|
|
8
|
+
export default GridShowcase;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["style", "children", "backgroundColor"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
+
import { useTheme } from 'antd-style';
|
|
7
|
+
import { rgba } from 'polished';
|
|
8
|
+
import { memo } from 'react';
|
|
9
|
+
import { Flexbox } from 'react-layout-kit';
|
|
10
|
+
import GridBackground from "./index";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var GridShowcase = /*#__PURE__*/memo(function (_ref) {
|
|
14
|
+
var style = _ref.style,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
_ref$backgroundColor = _ref.backgroundColor,
|
|
17
|
+
backgroundColor = _ref$backgroundColor === void 0 ? '#001dff' : _ref$backgroundColor,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var theme = useTheme();
|
|
20
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
21
|
+
style: _objectSpread({
|
|
22
|
+
position: 'relative'
|
|
23
|
+
}, style)
|
|
24
|
+
}, props), {}, {
|
|
25
|
+
children: [/*#__PURE__*/_jsx(GridBackground, {
|
|
26
|
+
animation: true,
|
|
27
|
+
colorBack: rgba(theme.colorText, 0.12),
|
|
28
|
+
colorFront: rgba(theme.colorText, 0.6),
|
|
29
|
+
flip: true
|
|
30
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
31
|
+
align: 'center',
|
|
32
|
+
style: {
|
|
33
|
+
zIndex: 4
|
|
34
|
+
},
|
|
35
|
+
children: children
|
|
36
|
+
}), /*#__PURE__*/_jsx(GridBackground, {
|
|
37
|
+
animation: true,
|
|
38
|
+
backgroundColor: backgroundColor,
|
|
39
|
+
colorBack: rgba(theme.colorText, 0.24),
|
|
40
|
+
colorFront: theme.colorText,
|
|
41
|
+
random: true,
|
|
42
|
+
reverse: true,
|
|
43
|
+
showBackground: true,
|
|
44
|
+
style: {
|
|
45
|
+
zIndex: 0
|
|
46
|
+
}
|
|
47
|
+
})]
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
export default GridShowcase;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
export interface GridBackgroundProps extends DivProps {
|
|
4
|
+
animation?: boolean;
|
|
5
|
+
animationDuration?: number;
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
colorBack?: string;
|
|
8
|
+
colorFront?: string;
|
|
9
|
+
flip?: boolean;
|
|
10
|
+
random?: boolean;
|
|
11
|
+
reverse?: boolean;
|
|
12
|
+
showBackground?: boolean;
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
}
|
|
15
|
+
declare const GridBackground: import("react").NamedExoticComponent<GridBackgroundProps>;
|
|
16
|
+
export default GridBackground;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["flip", "reverse", "showBackground", "backgroundColor", "random", "animationDuration", "className", "colorFront", "colorBack", "strokeWidth", "style", "animation"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
+
import { useSize } from 'ahooks';
|
|
7
|
+
import { shuffle } from 'lodash-es';
|
|
8
|
+
import { memo, useCallback, useMemo, useRef } from 'react';
|
|
9
|
+
import Grid from "./Grid";
|
|
10
|
+
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var GridBackground = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var flip = _ref.flip,
|
|
16
|
+
reverse = _ref.reverse,
|
|
17
|
+
showBackground = _ref.showBackground,
|
|
18
|
+
backgroundColor = _ref.backgroundColor,
|
|
19
|
+
random = _ref.random,
|
|
20
|
+
_ref$animationDuratio = _ref.animationDuration,
|
|
21
|
+
animationDuration = _ref$animationDuratio === void 0 ? 8 : _ref$animationDuratio,
|
|
22
|
+
className = _ref.className,
|
|
23
|
+
colorFront = _ref.colorFront,
|
|
24
|
+
colorBack = _ref.colorBack,
|
|
25
|
+
strokeWidth = _ref.strokeWidth,
|
|
26
|
+
style = _ref.style,
|
|
27
|
+
animation = _ref.animation,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var ref = useRef(null);
|
|
30
|
+
var size = useSize(ref);
|
|
31
|
+
var _useStyles = useStyles({
|
|
32
|
+
backgroundColor: backgroundColor,
|
|
33
|
+
reverse: reverse
|
|
34
|
+
}),
|
|
35
|
+
styles = _useStyles.styles,
|
|
36
|
+
cx = _useStyles.cx;
|
|
37
|
+
var gridProps = useMemo(function () {
|
|
38
|
+
return {
|
|
39
|
+
className: styles.highlight,
|
|
40
|
+
color: colorFront,
|
|
41
|
+
strokeWidth: strokeWidth
|
|
42
|
+
};
|
|
43
|
+
}, [reverse, colorFront, strokeWidth]);
|
|
44
|
+
var HighlightGrid = useCallback(function () {
|
|
45
|
+
if (!random) return /*#__PURE__*/_jsx(Grid, _objectSpread({
|
|
46
|
+
style: {
|
|
47
|
+
'--duration': "".concat(animationDuration, "s")
|
|
48
|
+
}
|
|
49
|
+
}, gridProps));
|
|
50
|
+
var group = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
|
51
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
52
|
+
children: shuffle(group).map(function (item, index) {
|
|
53
|
+
return /*#__PURE__*/_jsx(Grid, _objectSpread({
|
|
54
|
+
linePick: item,
|
|
55
|
+
style: {
|
|
56
|
+
'--delay': "".concat(index + Math.random(), "s"),
|
|
57
|
+
'--duration': "".concat(animationDuration, "s")
|
|
58
|
+
}
|
|
59
|
+
}, gridProps), item);
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
}, [random, animationDuration, gridProps]);
|
|
63
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
64
|
+
className: cx(styles.container, className),
|
|
65
|
+
ref: ref,
|
|
66
|
+
style: flip ? _objectSpread({
|
|
67
|
+
transform: 'scaleY(-1)'
|
|
68
|
+
}, style) : style
|
|
69
|
+
}, props), {}, {
|
|
70
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
|
71
|
+
color: colorBack,
|
|
72
|
+
strokeWidth: strokeWidth,
|
|
73
|
+
style: {
|
|
74
|
+
zIndex: 2
|
|
75
|
+
}
|
|
76
|
+
}), animation && /*#__PURE__*/_jsx(HighlightGrid, {}), showBackground && /*#__PURE__*/_jsx("div", {
|
|
77
|
+
className: styles.backgroundContainer,
|
|
78
|
+
style: size ? {
|
|
79
|
+
fontSize: size.width / 80
|
|
80
|
+
} : {},
|
|
81
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
82
|
+
className: styles.background
|
|
83
|
+
})
|
|
84
|
+
})]
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
export default GridBackground;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useStyles: (props?: {
|
|
2
|
+
backgroundColor?: string | undefined;
|
|
3
|
+
reverse?: boolean | undefined;
|
|
4
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
+
background: import("antd-style").SerializedStyles;
|
|
6
|
+
backgroundContainer: import("antd-style").SerializedStyles;
|
|
7
|
+
container: import("antd-style").SerializedStyles;
|
|
8
|
+
highlight: import("antd-style").SerializedStyles;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
+
import { createStyles, keyframes } from 'antd-style';
|
|
4
|
+
import chroma from 'chroma-js';
|
|
5
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
6
|
+
var css = _ref.css,
|
|
7
|
+
token = _ref.token;
|
|
8
|
+
var reverse = _ref2.reverse,
|
|
9
|
+
_ref2$backgroundColor = _ref2.backgroundColor,
|
|
10
|
+
backgroundColor = _ref2$backgroundColor === void 0 ? 'blue' : _ref2$backgroundColor;
|
|
11
|
+
var highlightAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n mask-position: 100% 0%;\n }\n 16%,100% {\n mask-position: 100% 200%;\n }\n "])));
|
|
12
|
+
var highlightAnimationReverse = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n mask-position: 100% 200%;\n }\n 16%,100% {\n mask-position: 100% 0%;\n }\n "])));
|
|
13
|
+
var scale = chroma.bezier([token.colorText, backgroundColor, token.colorBgLayout]).scale().mode('lch').correctLightness().colors(6);
|
|
14
|
+
var width = 24;
|
|
15
|
+
var height = 36;
|
|
16
|
+
return {
|
|
17
|
+
background: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: ", "%;\n left: ", "%;\n transform: rotateX(60deg);\n\n width: ", "%;\n height: ", "%;\n\n background: ", ";\n filter: blur(2em) saturate(400%);\n border-radius: 50%;\n box-shadow:\n 0 0 1em 2em ", ",\n 0 0 3em 6em ", ",\n 0 0 6em 10em ", ",\n 0 0 8em 16em ", ";\n "])), 60 - height / 2, 50 - width / 2, width, height, scale[1], scale[1], scale[2], scale[3], scale[4]),
|
|
18
|
+
backgroundContainer: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: -1;\n inset: 0;\n\n width: 100%;\n height: 100%;\n\n perspective: 200px;\n "]))),
|
|
19
|
+
container: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n\n mask-image: linear-gradient(to bottom, transparent, #fff 30%, #fff 70%, transparent);\n mask-size: cover;\n "]))),
|
|
20
|
+
highlight: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --duration: 6s;\n --delay: 0s;\n\n position: absolute;\n z-index: 1;\n inset: 0;\n\n animation: ", " var(--duration)\n cubic-bezier(0.62, 0.62, 0.28, 0.67) infinite;\n animation-delay: var(--delay);\n\n mask-image: linear-gradient(to bottom, transparent 40%, #fff 60%, transparent);\n mask-size: 100% 200%;\n "])), reverse ? highlightAnimationReverse : highlightAnimation)
|
|
21
|
+
};
|
|
22
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Html } from '@react-three/drei';
|
|
2
|
+
import { Loader2 } from 'lucide-react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Center } from 'react-layout-kit';
|
|
5
|
+
import Icon from "../Icon";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
var Loading = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
+
var size = _ref.size;
|
|
9
|
+
return /*#__PURE__*/_jsx(Html, {
|
|
10
|
+
children: /*#__PURE__*/_jsx(Center, {
|
|
11
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
12
|
+
icon: Loader2,
|
|
13
|
+
size: {
|
|
14
|
+
fontSize: size
|
|
15
|
+
},
|
|
16
|
+
spin: true
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export default Loading;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
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; }
|
|
5
|
+
import { useGLTF } from '@react-three/drei';
|
|
6
|
+
import { useFrame } from '@react-three/fiber';
|
|
7
|
+
import { memo, useRef } from 'react';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
var NUM = 10;
|
|
10
|
+
var Logo = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var props = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
var ref = useRef(null);
|
|
13
|
+
var _useGLTF = useGLTF('https://gw.alipayobjects.com/os/kitchen/ygwdCZyaMZ/lobehub.gltf'),
|
|
14
|
+
scene = _useGLTF.scene;
|
|
15
|
+
useFrame(function (state) {
|
|
16
|
+
var t = state.clock.getElapsedTime();
|
|
17
|
+
ref.current.rotation.set(Math.cos(t / 4) / NUM, Math.sin(t / 3) / NUM / 2, 0.15 + Math.sin(t / 2) / NUM);
|
|
18
|
+
ref.current.position.y = -0.2 + (0.8 + Math.cos(t / 2)) / 7;
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/_jsx("group", {
|
|
21
|
+
ref: ref,
|
|
22
|
+
children: /*#__PURE__*/_jsx("primitive", _objectSpread({
|
|
23
|
+
object: scene
|
|
24
|
+
}, props))
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
export default Logo;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
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; }
|
|
4
|
+
import { Canvas } from '@react-three/fiber';
|
|
5
|
+
import { Suspense, memo } from 'react';
|
|
6
|
+
import Loading from "./Loading";
|
|
7
|
+
import Logo from "./Logo";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
var LogoThree = /*#__PURE__*/memo(function (_ref) {
|
|
10
|
+
var _ref$size = _ref.size,
|
|
11
|
+
size = _ref$size === void 0 ? 320 : _ref$size,
|
|
12
|
+
style = _ref.style,
|
|
13
|
+
className = _ref.className;
|
|
14
|
+
return /*#__PURE__*/_jsx(Canvas, {
|
|
15
|
+
camera: {
|
|
16
|
+
fov: 16,
|
|
17
|
+
position: [10, 1, 0]
|
|
18
|
+
},
|
|
19
|
+
className: className,
|
|
20
|
+
style: size ? _objectSpread({
|
|
21
|
+
height: size,
|
|
22
|
+
maxHeight: size,
|
|
23
|
+
maxWidth: size,
|
|
24
|
+
width: size
|
|
25
|
+
}, style) : style,
|
|
26
|
+
children: /*#__PURE__*/_jsx(Suspense, {
|
|
27
|
+
fallback: /*#__PURE__*/_jsx(Loading, {
|
|
28
|
+
size: size / 2 > 48 ? 48 : size / 2
|
|
29
|
+
}),
|
|
30
|
+
children: /*#__PURE__*/_jsx(Logo, {
|
|
31
|
+
rotation: [0, 1.5, 0]
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export default LogoThree;
|
package/es/TokenTag/index.d.ts
CHANGED
package/es/TokenTag/index.js
CHANGED
|
@@ -3,8 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["className", "displayMode", "maxValue", "value", "text"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
-
import {
|
|
7
|
-
import { forwardRef, useRef } from 'react';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
8
7
|
import FluentEmoji from "../FluentEmoji";
|
|
9
8
|
import { ICON_SIZE, useStyles } from "./style";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,8 +16,6 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
17
16
|
value = _ref.value,
|
|
18
17
|
text = _ref.text,
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
var reference = useRef(ref);
|
|
21
|
-
var isHovering = useHover(reference);
|
|
22
19
|
var valueLeft = maxValue - value;
|
|
23
20
|
var percent = valueLeft / maxValue;
|
|
24
21
|
var type;
|
|
@@ -38,12 +35,12 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
35
|
cx = _useStyles.cx;
|
|
39
36
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
40
37
|
className: cx(styles.container, className),
|
|
41
|
-
ref:
|
|
38
|
+
ref: ref
|
|
42
39
|
}, props), {}, {
|
|
43
40
|
children: [/*#__PURE__*/_jsx(FluentEmoji, {
|
|
44
41
|
emoji: emoji,
|
|
45
42
|
size: ICON_SIZE
|
|
46
|
-
}), valueLeft > 0 ? [displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? valueLeft : value
|
|
43
|
+
}), valueLeft > 0 ? [displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? valueLeft : value].join(' ') : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload']
|
|
47
44
|
}));
|
|
48
45
|
});
|
|
49
46
|
export default TokenTag;
|
package/es/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export { default as FormItem, type FormItemProps } from './Form/components/FormI
|
|
|
31
31
|
export { default as FormTitle, type FormTitleProps } from './Form/components/FormTitle';
|
|
32
32
|
export { default as Giscus, type GiscusProps } from './Giscus';
|
|
33
33
|
export { default as GradientButton, type GradientButtonProps } from './GradientButton';
|
|
34
|
+
export { default as GridBackground, type GridBackgroundProps } from './GridBackground';
|
|
35
|
+
export { default as GridShowcase, type GridShowcaseProps } from './GridBackground/GridShowcase';
|
|
34
36
|
export { default as Header, type HeaderProps } from './Header';
|
|
35
37
|
export { default as Hero, type HeroAction, type HeroProps } from './Hero';
|
|
36
38
|
export { default as Highlighter, type HighlighterProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from './Highlighter';
|
|
@@ -39,6 +41,7 @@ export { Input, type InputProps, TextArea, type TextAreaProps } from './Input';
|
|
|
39
41
|
export { default as Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, } from './Layout';
|
|
40
42
|
export { default as List } from './List';
|
|
41
43
|
export { default as Logo, type LogoProps } from './Logo';
|
|
44
|
+
export { default as LogoThree, type LogoThreeProps } from './LogoThree';
|
|
42
45
|
export { default as Markdown, type MarkdownProps } from './Markdown';
|
|
43
46
|
export { default as MessageInput, type MessageInputProps } from './MessageInput';
|
|
44
47
|
export { default as MessageModal, type MessageModalProps } from './MessageModal';
|
package/es/index.js
CHANGED
|
@@ -30,6 +30,8 @@ export { default as FormItem } from "./Form/components/FormItem";
|
|
|
30
30
|
export { default as FormTitle } from "./Form/components/FormTitle";
|
|
31
31
|
export { default as Giscus } from "./Giscus";
|
|
32
32
|
export { default as GradientButton } from "./GradientButton";
|
|
33
|
+
export { default as GridBackground } from "./GridBackground";
|
|
34
|
+
export { default as GridShowcase } from "./GridBackground/GridShowcase";
|
|
33
35
|
export { default as Header } from "./Header";
|
|
34
36
|
export { default as Hero } from "./Hero";
|
|
35
37
|
export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
|
|
@@ -38,6 +40,7 @@ export { Input, TextArea } from "./Input";
|
|
|
38
40
|
export { default as Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc } from "./Layout";
|
|
39
41
|
export { default as List } from "./List";
|
|
40
42
|
export { default as Logo } from "./Logo";
|
|
43
|
+
export { default as LogoThree } from "./LogoThree";
|
|
41
44
|
export { default as Markdown } from "./Markdown";
|
|
42
45
|
export { default as MessageInput } from "./MessageInput";
|
|
43
46
|
export { default as MessageModal } from "./MessageModal";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.71.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
"@giscus/react": "^2",
|
|
77
77
|
"@lobehub/emojilib": "latest",
|
|
78
78
|
"@react-spring/web": "^9",
|
|
79
|
+
"@react-three/drei": "^9",
|
|
80
|
+
"@react-three/fiber": "^8",
|
|
79
81
|
"ahooks": "^3",
|
|
80
82
|
"antd": "^5",
|
|
81
83
|
"chroma-js": "^2",
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
"remark-gfm": "^3",
|
|
100
102
|
"shiki-es": "^0",
|
|
101
103
|
"styled-components": "^6",
|
|
104
|
+
"three": "^0.150",
|
|
102
105
|
"ts-md5": "^1",
|
|
103
106
|
"use-merge-value": "^1",
|
|
104
107
|
"zustand": "^4",
|
|
@@ -113,6 +116,7 @@
|
|
|
113
116
|
"@types/pangu": "^4",
|
|
114
117
|
"@types/react": "^18",
|
|
115
118
|
"@types/react-dom": "^18",
|
|
119
|
+
"@types/three": "^0.149",
|
|
116
120
|
"@vitest/coverage-v8": "latest",
|
|
117
121
|
"antd-style": "^3",
|
|
118
122
|
"babel-plugin-antd-style": "latest",
|