@lobehub/ui 1.25.2 → 1.25.4

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.
@@ -7,8 +7,8 @@ var toggleShort = 16;
7
7
  export var useStyles = createStyles(function (_ref, prefix) {
8
8
  var token = _ref.token;
9
9
  var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
10
- var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1001;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
11
- var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 2000;\n "])));
10
+ var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 101;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
11
+ var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 200;\n "])));
12
12
  return {
13
13
  container: cx(prefix, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n border: 0 solid ", ";\n\n &:hover {\n .", "-toggle {\n opacity: 1;\n }\n }\n "])), token.colorBorderSecondary, prefix)),
14
14
  fixed: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n "]))),
@@ -4,7 +4,6 @@ var _excluded = ["style", "className", "row", "column", "description", "image",
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
6
  import { Icon } from "./..";
7
- import { Link, history } from 'dumi';
8
7
  import * as LucideIcon from 'lucide-react';
9
8
  import { memo } from 'react';
10
9
  import { Center, Flexbox } from 'react-layout-kit';
@@ -49,37 +48,24 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
49
48
  var FeatureIcon = icon && LucideIcon[icon];
50
49
  return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
51
50
  className: cx(styles.container, className),
52
- onClick: function onClick() {
53
- if (!link) return;
54
- if (openExternal) {
55
- window.open(link);
56
- } else {
57
- history.push(link);
58
- }
59
- },
60
51
  style: _objectSpread({
61
52
  gridRow: "span ".concat(rowNum),
62
- gridColumn: "span ".concat(column || 1),
63
- cursor: link ? 'pointer' : 'default'
53
+ gridColumn: "span ".concat(column || 1)
64
54
  }, style)
65
55
  }, props), {}, {
66
56
  children: /*#__PURE__*/_jsxs("div", {
67
57
  className: styles.cell,
68
- children: [image && /*#__PURE__*/_jsx(Center, {
58
+ children: [image || FeatureIcon && /*#__PURE__*/_jsxs(Center, {
69
59
  className: styles.imgContainer,
70
60
  style: imageStyle,
71
- children: /*#__PURE__*/_jsx(Image, {
61
+ children: [FeatureIcon && /*#__PURE__*/_jsx(Icon, {
62
+ className: styles.img,
63
+ icon: FeatureIcon
64
+ }), image && /*#__PURE__*/_jsx(Image, {
72
65
  className: styles.img,
73
66
  image: image,
74
67
  title: title
75
- })
76
- }), FeatureIcon && /*#__PURE__*/_jsx(Center, {
77
- className: styles.imgContainer,
78
- style: imageStyle,
79
- children: /*#__PURE__*/_jsx(Icon, {
80
- className: styles.img,
81
- icon: FeatureIcon
82
- })
68
+ })]
83
69
  }), title && /*#__PURE__*/_jsx(Flexbox, {
84
70
  align: 'center',
85
71
  as: 'h3',
@@ -94,8 +80,10 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
94
80
  }
95
81
  }), link && /*#__PURE__*/_jsx("div", {
96
82
  className: styles.link,
97
- children: /*#__PURE__*/_jsx(Link, {
98
- to: link,
83
+ children: /*#__PURE__*/_jsx("a", {
84
+ href: link,
85
+ rel: "noreferrer",
86
+ target: openExternal ? '_blank' : undefined,
99
87
  children: "Read More"
100
88
  })
101
89
  })]
@@ -13,11 +13,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
13
13
  var descCls = "".concat(prefix, "-description");
14
14
  var titleCls = "".concat(prefix, "-title");
15
15
  var imgCls = "".concat(prefix, "-img");
16
-
17
- // 通过简单估计,缩放值乘以 rowNum 就可以得到合适的尺寸
18
16
  var scaleUnit = 20;
19
-
20
- // 尺寸工具
21
17
  var genSize = function genSize(size) {
22
18
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n font-size: ", "px;\n "])), size, size, size * (22 / 24));
23
19
  };
@@ -28,7 +24,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
28
24
  title: cx(titleCls, withTransition, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n margin: 16px 0;\n\n font-size: 20px;\n line-height: ", ";\n color: ", ";\n "])), token.lineHeightHeading3, token.colorText)),
29
25
  desc: cx(descCls, withTransition, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none;\n color: ", ";\n\n quotient {\n position: relative;\n\n display: block;\n\n margin: 12px 0;\n padding-left: 12px;\n\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorTextDescription)),
30
26
  imgContainer: cx(coverCls, withTransition, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", ";\n padding: 4px;\n opacity: 0.8;\n border-radius: ", "px;\n "])), genSize(24), token.borderRadius)),
31
- img: cx(imgCls, withTransition, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n color: ", ";\n "])), genSize(20), token.colorWhite)),
27
+ img: cx(imgCls, withTransition, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n color: ", ";\n "])), genSize(20), token.colorText)),
32
28
  link: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", ";\n margin-top: 24px;\n "])), withTransition)
33
29
  };
34
30
  });
package/es/Hero/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { GradientButton, Icon } from "./..";
2
2
  import { Button, ConfigProvider, Space } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
- import { Link } from 'dumi';
5
4
  import * as LucideIcon from 'lucide-react';
6
5
  import { memo, useCallback } from 'react';
7
6
  import { Center, Flexbox } from 'react-layout-kit';
@@ -29,10 +28,10 @@ var Hero = /*#__PURE__*/memo(function (_ref) {
29
28
  type = _ref2.type;
30
29
  // @ts-ignore
31
30
  var ButtonIcon = icon && LucideIcon[icon];
32
- return /*#__PURE__*/_jsx(Link, {
31
+ return /*#__PURE__*/_jsx("a", {
32
+ href: link,
33
33
  rel: "noreferrer",
34
34
  target: openExternal ? '_blank' : undefined,
35
- to: link,
36
35
  children: type === 'primary' ? /*#__PURE__*/_jsx(GradientButton, {
37
36
  size: "large",
38
37
  children: text
@@ -19,10 +19,7 @@ export var StroyBook = /*#__PURE__*/memo(function (_ref) {
19
19
  props = _objectWithoutProperties(_ref, _excluded);
20
20
  var _useResponsive = useResponsive(),
21
21
  mobile = _useResponsive.mobile;
22
- var _useStyles = useStyles({
23
- noPadding: Boolean(noPadding),
24
- mobile: Boolean(mobile)
25
- }),
22
+ var _useStyles = useStyles(Boolean(noPadding)),
26
23
  styles = _useStyles.styles,
27
24
  cx = _useStyles.cx;
28
25
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
@@ -1,7 +1,4 @@
1
- export declare const useStyles: (props?: {
2
- mobile: boolean;
3
- noPadding: boolean;
4
- } | undefined) => import("antd-style").ReturnStyles<{
1
+ export declare const useStyles: (props?: boolean | undefined) => import("antd-style").ReturnStyles<{
5
2
  editor: import("antd-style").SerializedStyles;
6
3
  left: import("antd-style").SerializedStyles;
7
4
  right: import("antd-style").SerializedStyles;
@@ -1,15 +1,14 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3
3
  import { createStyles } from 'antd-style';
4
- export var useStyles = createStyles(function (_ref, _ref2) {
4
+ export var useStyles = createStyles(function (_ref, noPadding) {
5
5
  var css = _ref.css,
6
- token = _ref.token;
7
- var noPadding = _ref2.noPadding,
8
- mobile = _ref2.mobile;
6
+ token = _ref.token,
7
+ responsive = _ref.responsive;
9
8
  return {
10
- editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
11
- left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
12
- right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n\n .draggable-panel-fixed {\n width: 100% !important;\n }\n "])), token.colorBgLayout),
13
- leva: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
9
+ editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n\n ", " {\n flex-direction: column;\n }\n "])), responsive.mobile),
10
+ left: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
11
+ right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: ", ";\n\n ", " {\n .draggable-panel-fixed {\n width: 100% !important;\n }\n }\n "])), token.colorBgLayout, responsive.mobile),
12
+ leva: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
14
13
  };
15
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.25.2",
3
+ "version": "1.25.4",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -82,7 +82,6 @@
82
82
  "chroma-js": "^2",
83
83
  "copy-to-clipboard": "^3",
84
84
  "dayjs": "^1",
85
- "dumi": "^2",
86
85
  "fast-deep-equal": "^3",
87
86
  "immer": "^10",
88
87
  "leva": "^0",
@@ -118,6 +117,7 @@
118
117
  "commitlint": "^17",
119
118
  "concurrently": "^8",
120
119
  "cross-env": "^7",
120
+ "dumi": "^2",
121
121
  "dumi-assets-types": "^1",
122
122
  "dumi-theme-lobehub": "workspace:latest",
123
123
  "eslint": "^8",
@@ -138,7 +138,6 @@
138
138
  "peerDependencies": {
139
139
  "antd": ">=5",
140
140
  "antd-style": ">=3",
141
- "dumi": ">=2",
142
141
  "react": ">=18",
143
142
  "react-dom": ">=18"
144
143
  },