@lobehub/ui 1.146.6 → 1.146.8
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.js +14 -2
- package/es/Alert/style.js +1 -1
- package/package.json +1 -1
package/es/ActionIcon/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
6
|
var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "overlayStyle", "tooltipDelay", "fillOpacity", "fillRule", "focusable", "disable", "spin"];
|
|
6
7
|
import { Loader2 } from 'lucide-react';
|
|
7
|
-
import { forwardRef, useMemo } from 'react';
|
|
8
|
+
import { forwardRef, useCallback, useMemo, useState } from 'react';
|
|
8
9
|
import { Flexbox } from 'react-layout-kit';
|
|
9
10
|
import Icon from "../Icon";
|
|
10
11
|
import Spotlight from "../Spotlight";
|
|
@@ -70,12 +71,21 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
71
|
}, iconProps), {}, {
|
|
71
72
|
spin: true
|
|
72
73
|
}));
|
|
74
|
+
var _useState = useState(false),
|
|
75
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
76
|
+
tooltipOpen = _useState2[0],
|
|
77
|
+
setTooltipOpen = _useState2[1];
|
|
78
|
+
var handleClick = useCallback(function (event) {
|
|
79
|
+
if (loading || disable) return;
|
|
80
|
+
setTooltipOpen(false);
|
|
81
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
82
|
+
}, [loading, disable, setTooltipOpen, onClick]);
|
|
73
83
|
var actionIconBlock = /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
74
84
|
align: 'center',
|
|
75
85
|
className: cx(styles.block, disable ? styles.disabled : styles.normal, className),
|
|
76
86
|
horizontal: true,
|
|
77
87
|
justify: 'center',
|
|
78
|
-
onClick:
|
|
88
|
+
onClick: handleClick,
|
|
79
89
|
ref: ref,
|
|
80
90
|
style: _objectSpread({
|
|
81
91
|
borderRadius: borderRadius,
|
|
@@ -89,6 +99,8 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
99
|
return /*#__PURE__*/_jsx(Tooltip, {
|
|
90
100
|
arrow: arrow,
|
|
91
101
|
mouseEnterDelay: tooltipDelay,
|
|
102
|
+
onOpenChange: setTooltipOpen,
|
|
103
|
+
open: tooltipOpen,
|
|
92
104
|
overlayStyle: _objectSpread({
|
|
93
105
|
pointerEvents: 'none'
|
|
94
106
|
}, overlayStyle),
|
package/es/Alert/style.js
CHANGED
|
@@ -14,7 +14,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
14
14
|
return {
|
|
15
15
|
banner: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: none;\n border-radius: 0;\n "]))),
|
|
16
16
|
colorfulText: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-alert-message,.", "-alert-description {\n color: inherit;\n }\n "])), prefixCls, prefixCls),
|
|
17
|
-
container: cx(css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: row;\n gap: ", "px;\n align-items: flex-start;\n\n max-width: 100%;\n padding-block: ", "px;\n padding-inline: ", "px\n ", "px;\n\n .", "-alert-message {\n font-weight: ", ";\n line-height: 24px;\n word-break:
|
|
17
|
+
container: cx(css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: row;\n gap: ", "px;\n align-items: flex-start;\n\n max-width: 100%;\n padding-block: ", "px;\n padding-inline: ", "px\n ", "px;\n\n .", "-alert-message {\n font-weight: ", ";\n line-height: 24px;\n word-break: normal;\n }\n .", "-alert-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n .", "-alert-close-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n "])), hasTitle ? 12 : 8, baseBlockPadding, showIcon ? baseInlinePadding : baseInlinePadding * 1.5, closable ? baseInlinePadding : baseInlinePadding * 1.5, prefixCls, hasTitle ? 600 : 400, prefixCls, prefixCls), hasTitle && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n "])), prefixCls)),
|
|
18
18
|
expandText: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &:hover {\n cursor: pointer;\n }\n "]))),
|
|
19
19
|
extra: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: hidden;\n\n max-width: 100%;\n\n border: 1px solid;\n border-block-start: none;\n border-end-start-radius: ", "px;\n border-end-end-radius: ", "px;\n "])), token.borderRadiusLG, token.borderRadiusLG),
|
|
20
20
|
extraBody: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n overflow-x: auto;\n width: 100%;\n padding-block: ", "px;\n padding-inline: ", "px;\n "])), baseBlockPadding, baseInlinePadding),
|