@lobehub/ui 1.56.0 → 1.58.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/ActionIcon/index.d.ts +4 -2
- package/es/ActionIcon/index.js +7 -2
- package/es/FluentEmoji/index.js +5 -2
- package/es/Icon/index.d.ts +2 -0
- package/es/Icon/index.js +5 -1
- package/package.json +4 -3
package/es/ActionIcon/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { type IconProps } from "../Icon";
|
|
3
3
|
import { type TooltipProps } from "../Tooltip";
|
|
4
4
|
import { DivProps } from "../types";
|
|
5
5
|
export type ActionIconSize = 'large' | 'normal' | 'small' | 'site' | {
|
|
@@ -19,6 +19,8 @@ export interface ActionIconProps extends DivProps {
|
|
|
19
19
|
* @default false
|
|
20
20
|
*/
|
|
21
21
|
arrow?: boolean;
|
|
22
|
+
color?: IconProps['color'];
|
|
23
|
+
fill?: IconProps['fill'];
|
|
22
24
|
/**
|
|
23
25
|
* @description Glass blur style
|
|
24
26
|
* @default 'false'
|
|
@@ -28,7 +30,7 @@ export interface ActionIconProps extends DivProps {
|
|
|
28
30
|
* @description The icon element to be rendered
|
|
29
31
|
* @type LucideIcon
|
|
30
32
|
*/
|
|
31
|
-
icon?:
|
|
33
|
+
icon?: IconProps['icon'];
|
|
32
34
|
/**
|
|
33
35
|
* @description Set the loading status of ActionIcon
|
|
34
36
|
*/
|
package/es/ActionIcon/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay"];
|
|
3
|
+
var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay"];
|
|
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 { Loader2 } from 'lucide-react';
|
|
@@ -53,7 +53,9 @@ var calcSize = function calcSize(size) {
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
56
|
-
var
|
|
56
|
+
var color = _ref.color,
|
|
57
|
+
fill = _ref.fill,
|
|
58
|
+
className = _ref.className,
|
|
57
59
|
active = _ref.active,
|
|
58
60
|
icon = _ref.icon,
|
|
59
61
|
_ref$size = _ref.size,
|
|
@@ -84,11 +86,14 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
84
86
|
borderRadius = _useMemo.borderRadius;
|
|
85
87
|
var content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
86
88
|
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
89
|
+
color: color,
|
|
90
|
+
fill: fill,
|
|
87
91
|
icon: icon,
|
|
88
92
|
size: size === 'site' ? 'normal' : size
|
|
89
93
|
}), children]
|
|
90
94
|
});
|
|
91
95
|
var spin = /*#__PURE__*/_jsx(Icon, {
|
|
96
|
+
color: color,
|
|
92
97
|
icon: Loader2,
|
|
93
98
|
size: size === 'site' ? 'normal' : size,
|
|
94
99
|
spin: true
|
package/es/FluentEmoji/index.js
CHANGED
|
@@ -54,8 +54,11 @@ var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
}, [type]);
|
|
58
|
-
|
|
57
|
+
}, [type, emoji]);
|
|
58
|
+
var isFallback = useMemo(function () {
|
|
59
|
+
return type === 'pure' || !emojiUrl || loadingFail;
|
|
60
|
+
}, []);
|
|
61
|
+
if (isFallback) return /*#__PURE__*/_jsx("div", {
|
|
59
62
|
className: cx(styles.container, className),
|
|
60
63
|
style: _objectSpread({
|
|
61
64
|
fontSize: size * 0.9,
|
package/es/Icon/index.d.ts
CHANGED
package/es/Icon/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["icon", "size", "className", "spin"];
|
|
3
|
+
var _excluded = ["icon", "size", "color", "fill", "className", "spin"];
|
|
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 { memo, useMemo } from 'react';
|
|
@@ -48,6 +48,8 @@ var calcSize = function calcSize(size) {
|
|
|
48
48
|
var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
49
49
|
var icon = _ref.icon,
|
|
50
50
|
size = _ref.size,
|
|
51
|
+
color = _ref.color,
|
|
52
|
+
fill = _ref.fill,
|
|
51
53
|
className = _ref.className,
|
|
52
54
|
spin = _ref.spin,
|
|
53
55
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -65,6 +67,8 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
|
65
67
|
role: "img"
|
|
66
68
|
}, props), {}, {
|
|
67
69
|
children: /*#__PURE__*/_jsx(SvgIcon, {
|
|
70
|
+
color: color,
|
|
71
|
+
fill: fill,
|
|
68
72
|
focusable: false,
|
|
69
73
|
height: fontSize,
|
|
70
74
|
size: fontSize,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "father build",
|
|
31
|
-
"build:watch": "father dev",
|
|
32
31
|
"ci": "npm run lint && npm run type-check",
|
|
33
32
|
"clean": "rm -r es lib dist coverage .dumi/tmp .eslintcache node_modules/.cache",
|
|
34
|
-
"dev": "
|
|
33
|
+
"dev": "father dev",
|
|
35
34
|
"docs:build": "dumi build",
|
|
35
|
+
"docs:dev": "dumi dev",
|
|
36
36
|
"doctor": "father doctor",
|
|
37
37
|
"lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
38
38
|
"lint:md": "remark . --quiet --frail --output",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"prepare": "husky install && npm run setup",
|
|
41
41
|
"prepublishOnly": "father doctor && npm run build",
|
|
42
42
|
"prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
|
|
43
|
+
"pull": "git pull",
|
|
43
44
|
"release": "semantic-release",
|
|
44
45
|
"setup": "dumi setup",
|
|
45
46
|
"start": "dumi dev",
|