@lobehub/ui 2.15.1 → 2.15.3
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/DraggablePanel/DraggablePanel.js +6 -0
- package/es/DraggablePanel/style.d.ts +1 -0
- package/es/DraggablePanel/style.js +11 -11
- package/es/DraggablePanel/type.d.ts +1 -0
- package/es/DraggableSideNav/DraggableSideNav.js +28 -3
- package/es/DraggableSideNav/style.d.ts +1 -0
- package/es/DraggableSideNav/style.js +8 -8
- package/es/DraggableSideNav/type.d.ts +4 -1
- package/package.json +1 -1
|
@@ -55,6 +55,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
55
55
|
showHandleHighlight = _ref$showHandleHighli === void 0 ? false : _ref$showHandleHighli,
|
|
56
56
|
_ref$showHandleWideAr = _ref.showHandleWideArea,
|
|
57
57
|
showHandleWideArea = _ref$showHandleWideAr === void 0 ? DEFAULT_SHOW_HANDLE_WIDE_AREA : _ref$showHandleWideAr,
|
|
58
|
+
backgroundColor = _ref.backgroundColor,
|
|
58
59
|
size = _ref.size,
|
|
59
60
|
customizeDefaultSize = _ref.defaultSize,
|
|
60
61
|
minWidth = _ref.minWidth,
|
|
@@ -88,6 +89,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
88
89
|
return direction === 'rtl' && ['left', 'right'].includes(placement) ? placement === 'left' ? 'right' : 'left' : placement;
|
|
89
90
|
}, [direction, placement]);
|
|
90
91
|
var _useStyles = useStyles({
|
|
92
|
+
backgroundColor: backgroundColor,
|
|
91
93
|
headerHeight: headerHeight,
|
|
92
94
|
showBorder: showBorder,
|
|
93
95
|
showHandleWideArea: showHandleWideArea
|
|
@@ -282,6 +284,10 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
282
284
|
icon: Arrow,
|
|
283
285
|
size: 16,
|
|
284
286
|
style: {
|
|
287
|
+
marginBottom: internalPlacement === 'top' ? 4 : 0,
|
|
288
|
+
marginLeft: internalPlacement === 'right' ? 4 : 0,
|
|
289
|
+
marginRight: internalPlacement === 'left' ? 4 : 0,
|
|
290
|
+
marginTop: internalPlacement === 'bottom' ? 4 : 0,
|
|
285
291
|
transform: "rotate(".concat(isExpand ? 180 : 0, "deg)")
|
|
286
292
|
}
|
|
287
293
|
})
|
|
@@ -11,14 +11,14 @@ import { createStyles, css, cx } from 'antd-style';
|
|
|
11
11
|
// Layout constants
|
|
12
12
|
var LAYOUT = {
|
|
13
13
|
offset: 16,
|
|
14
|
-
toggleLength:
|
|
14
|
+
toggleLength: 54,
|
|
15
15
|
toggleShort: 16
|
|
16
16
|
};
|
|
17
17
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
18
18
|
var prefixCls = _ref.prefixCls,
|
|
19
|
-
token = _ref.token
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
token = _ref.token;
|
|
20
|
+
var backgroundColor = _ref2.backgroundColor,
|
|
21
|
+
headerHeight = _ref2.headerHeight,
|
|
22
22
|
showBorder = _ref2.showBorder,
|
|
23
23
|
showHandleWideArea = _ref2.showHandleWideArea;
|
|
24
24
|
var prefix = "".concat(prefixCls, "-draggable-panel");
|
|
@@ -41,7 +41,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// Handle styles
|
|
44
|
-
var handleBaseStyle = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n
|
|
44
|
+
var handleBaseStyle = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n transition: all 0.2s ", ";\n }\n "])), token.motionEaseOut);
|
|
45
45
|
var handleHighlightStyle = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n &:hover {\n &::before {\n background: ", ";\n box-shadow: 0 0 8px ", "40;\n }\n }\n\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.colorPrimary, token.colorPrimary, token.colorPrimary);
|
|
46
46
|
var handleStyles = {
|
|
47
47
|
handleBottom: cx("".concat(prefix, "-bottom-handle"), css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n &::before {\n inset-block-end: 50%;\n width: 100%;\n height: 2px;\n }\n "])))),
|
|
@@ -52,13 +52,13 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
// Toggle styles
|
|
55
|
-
var toggleBaseStyle = cx("".concat(prefix, "-toggle"), css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n pointer-events: ", ";\n\n position: absolute;\n z-index:
|
|
55
|
+
var toggleBaseStyle = cx("".concat(prefix, "-toggle"), css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n pointer-events: ", ";\n\n position: absolute;\n z-index: 50;\n\n opacity: 0;\n\n transition: all 0.2s ", ";\n\n &:hover,\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n pointer-events: all;\n cursor: pointer;\n\n position: absolute;\n\n border: 1px solid ", ";\n\n color: ", ";\n\n background: ", ";\n backdrop-filter: blur(8px);\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n "])), showHandleWideArea ? 'all' : 'none', token.motionEaseOut, token.colorBorder, token.colorTextTertiary, backgroundColor || token.colorBgLayout, token.motionEaseOut, token.colorTextSecondary, token.colorText));
|
|
56
56
|
var toggleStyles = {
|
|
57
|
-
toggleBottom: cx("".concat(prefix, "-toggle-bottom"), css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n inset-block-end: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n inset-inline-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-inline-start: -
|
|
58
|
-
toggleLeft: cx("".concat(prefix, "-toggle-left"), css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n inset-inline-start: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -
|
|
59
|
-
toggleRight: cx("".concat(prefix, "-toggle-right"), css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n inset-inline-end: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -
|
|
57
|
+
toggleBottom: cx("".concat(prefix, "-toggle-bottom"), css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n inset-block-end: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n inset-inline-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-inline-start: -27px;\n border-block-start-width: 0;\n border-radius: 0 0 ", "px ", "px;\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleLength, LAYOUT.toggleShort, token.borderRadiusLG, token.borderRadiusLG)),
|
|
58
|
+
toggleLeft: cx("".concat(prefix, "-toggle-left"), css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n inset-inline-start: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -27px;\n border-inline-end-width: 0;\n border-radius: ", "px 0 0 ", "px;\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleShort, LAYOUT.toggleLength, token.borderRadiusLG, token.borderRadiusLG)),
|
|
59
|
+
toggleRight: cx("".concat(prefix, "-toggle-right"), css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n inset-inline-end: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -27px;\n border-inline-start-width: 0;\n border-radius: 0 ", "px ", "px 0;\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleShort, LAYOUT.toggleLength, token.borderRadiusLG, token.borderRadiusLG)),
|
|
60
60
|
toggleRoot: toggleBaseStyle,
|
|
61
|
-
toggleTop: cx("".concat(prefix, "-toggle-top"), css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n inset-block-start: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n inset-inline-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-inline-start: -
|
|
61
|
+
toggleTop: cx("".concat(prefix, "-toggle-top"), css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n inset-block-start: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n inset-inline-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-inline-start: -27px;\n border-block-end-width: 0;\n border-radius: ", "px ", "px 0 0;\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleLength, LAYOUT.toggleShort, token.borderRadiusLG, token.borderRadiusLG))
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
// Additional component styles
|
|
@@ -66,7 +66,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
66
66
|
fixed: css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: relative;\n "]))),
|
|
67
67
|
fullscreen: css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n position: absolute;\n inset-block: ", "px 0;\n inset-inline: 0;\n\n width: 100%;\n height: calc(100% - ", "px);\n\n background: ", ";\n "])), headerHeight, headerHeight, token.colorBgContainerSecondary),
|
|
68
68
|
handlerIcon: css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n transition: all 0.2s ", ";\n "])), token.motionEaseOut),
|
|
69
|
-
panel: cx("".concat(prefix, "-fixed"), css(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
|
|
69
|
+
panel: cx("".concat(prefix, "-fixed"), css(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n overflow: hidden;\n background: ", ";\n transition: all 0.2s ", ";\n "])), backgroundColor || token.colorBgLayout, token.motionEaseOut)),
|
|
70
70
|
root: cx(prefix, css(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n border: 0 solid ", ";\n\n &:hover {\n > .", "-toggle {\n opacity: 1;\n }\n }\n "])), token.colorBorderSecondary, prefix))
|
|
71
71
|
};
|
|
72
72
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, borderStyles), floatPositions), handleStyles), {}, {
|
|
@@ -4,6 +4,7 @@ import type { Props as RndProps } from 'react-rnd';
|
|
|
4
4
|
import type { DivProps } from "../types";
|
|
5
5
|
type PlacementType = 'right' | 'left' | 'top' | 'bottom';
|
|
6
6
|
export interface DraggablePanelProps extends DivProps {
|
|
7
|
+
backgroundColor?: string;
|
|
7
8
|
classNames?: {
|
|
8
9
|
content?: string;
|
|
9
10
|
handle?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _excluded = ["animation", "children", "className", "classNames", "defaultExpand", "defaultWidth", "expand", "expandable", "footer", "header", "maxWidth", "minWidth", "onExpandChange", "onWidthChange", "onWidthDragging", "placement", "resizable", "showBorder", "showHandle", "showHandleWhenCollapsed", "showHandleHighlight", "styles", "width"];
|
|
4
|
+
var _excluded = ["animation", "children", "className", "classNames", "defaultExpand", "defaultWidth", "expand", "expandable", "footer", "header", "maxWidth", "minWidth", "onExpandChange", "onWidthChange", "onWidthDragging", "placement", "resizable", "showBorder", "showHandle", "showHandleWhenCollapsed", "showHandleHighlight", "backgroundColor", "styles", "width"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -113,10 +113,12 @@ var DraggableSideNav = /*#__PURE__*/memo(function (_ref2) {
|
|
|
113
113
|
showHandleWhenCollapsed = _ref2$showHandleWhenC === void 0 ? false : _ref2$showHandleWhenC,
|
|
114
114
|
_ref2$showHandleHighl = _ref2.showHandleHighlight,
|
|
115
115
|
showHandleHighlight = _ref2$showHandleHighl === void 0 ? false : _ref2$showHandleHighl,
|
|
116
|
+
backgroundColor = _ref2.backgroundColor,
|
|
116
117
|
customStyles = _ref2.styles,
|
|
117
118
|
width = _ref2.width,
|
|
118
119
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
119
120
|
var _useStyles = useStyles({
|
|
121
|
+
backgroundColor: backgroundColor,
|
|
120
122
|
showBorder: showBorder
|
|
121
123
|
}),
|
|
122
124
|
styles = _useStyles.styles,
|
|
@@ -179,6 +181,21 @@ var DraggableSideNav = /*#__PURE__*/memo(function (_ref2) {
|
|
|
179
181
|
}, 400);
|
|
180
182
|
};
|
|
181
183
|
|
|
184
|
+
// 用于跟踪上一次的 expand 状态,以检测外部变化
|
|
185
|
+
var prevExpandRef = useRef(isExpand);
|
|
186
|
+
|
|
187
|
+
// 监听外部 expand prop 变化,触发动画
|
|
188
|
+
useEffect(function () {
|
|
189
|
+
// 检测到 expand 状态变化,且不在拖拽和动画中
|
|
190
|
+
if (prevExpandRef.current !== isExpand && !isResizing && !isAnimating) {
|
|
191
|
+
setIsAnimating(true);
|
|
192
|
+
setTimeout(function () {
|
|
193
|
+
setIsAnimating(false);
|
|
194
|
+
}, 400);
|
|
195
|
+
}
|
|
196
|
+
prevExpandRef.current = isExpand;
|
|
197
|
+
}, [isExpand, isResizing, isAnimating]);
|
|
198
|
+
|
|
182
199
|
// 处理展开/折叠状态变化时的宽度动画和内容切换时机
|
|
183
200
|
useEffect(function () {
|
|
184
201
|
if (isAnimating) {
|
|
@@ -207,12 +224,16 @@ var DraggableSideNav = /*#__PURE__*/memo(function (_ref2) {
|
|
|
207
224
|
}, [isExpand, isAnimating, isResizing]);
|
|
208
225
|
|
|
209
226
|
// 处理外部 width prop 变化
|
|
227
|
+
// width 表示展开时的宽度,实际显示宽度根据 isExpand 状态决定
|
|
210
228
|
useEffect(function () {
|
|
211
229
|
if (width !== undefined && !isResizing && !isAnimating) {
|
|
212
|
-
|
|
230
|
+
// 更新展开宽度记录
|
|
231
|
+
setExpandedWidth(width);
|
|
232
|
+
// 根据当前状态设置实际宽度
|
|
213
233
|
if (isExpand) {
|
|
214
|
-
|
|
234
|
+
setInternalWidth(width);
|
|
215
235
|
}
|
|
236
|
+
// 如果是折叠状态,保持 minWidth,不改变 internalWidth
|
|
216
237
|
}
|
|
217
238
|
}, [width, isResizing, isAnimating, isExpand]);
|
|
218
239
|
|
|
@@ -319,6 +340,10 @@ var DraggableSideNav = /*#__PURE__*/memo(function (_ref2) {
|
|
|
319
340
|
animate: {
|
|
320
341
|
rotate: isExpand ? 0 : 180
|
|
321
342
|
},
|
|
343
|
+
style: {
|
|
344
|
+
marginLeft: placement === 'right' ? 4 : 0,
|
|
345
|
+
marginRight: placement === 'left' ? 4 : 0
|
|
346
|
+
},
|
|
322
347
|
transition: {
|
|
323
348
|
duration: 0.3,
|
|
324
349
|
ease: [0.22, 1, 0.36, 1]
|
|
@@ -5,29 +5,29 @@ import { createStyles } from 'antd-style';
|
|
|
5
5
|
// Layout constants (aligned with DraggablePanel)
|
|
6
6
|
var LAYOUT = {
|
|
7
7
|
offset: 16,
|
|
8
|
-
toggleLength:
|
|
8
|
+
toggleLength: 54,
|
|
9
9
|
toggleShort: 16
|
|
10
10
|
};
|
|
11
11
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
12
12
|
var css = _ref.css,
|
|
13
13
|
token = _ref.token,
|
|
14
|
-
stylish = _ref.stylish,
|
|
15
14
|
prefixCls = _ref.prefixCls;
|
|
16
|
-
var showBorder = _ref2.showBorder
|
|
15
|
+
var showBorder = _ref2.showBorder,
|
|
16
|
+
backgroundColor = _ref2.backgroundColor;
|
|
17
17
|
return {
|
|
18
18
|
body: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Smooth scroll behavior */\n scroll-behavior: smooth;\n overflow: hidden auto;\n flex: 1;\n\n /* Better scrollbar styling */\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n }\n "])), token.colorBorderSecondary, token.colorBorder),
|
|
19
19
|
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* Width transition controlled by inline style */\n\n /* Ensure smooth animations */\n will-change: width;\n\n position: relative;\n\n display: flex;\n flex-direction: column;\n\n height: 100%;\n "]))),
|
|
20
|
-
contentContainer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n height: 100%;\n border-inline-end: ", " solid ", ";\n\n background: ", ";\n "])), showBorder ? '1px' : '0', token.colorBorderSecondary, token.colorBgLayout),
|
|
20
|
+
contentContainer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n height: 100%;\n border-inline-end: ", " solid ", ";\n\n background: ", ";\n "])), showBorder ? '1px' : '0', token.colorBorderSecondary, backgroundColor || token.colorBgLayout),
|
|
21
21
|
footer: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n "]))),
|
|
22
22
|
handlerIcon: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /* Icon transitions are now handled by framer-motion */\n display: flex;\n align-items: center;\n justify-content: center;\n "]))),
|
|
23
23
|
header: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n "]))),
|
|
24
24
|
menuOverride: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .", "-menu {\n .", "-menu-item {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n\n height: unset;\n min-height: 36px;\n padding-block: 4px;\n padding-inline: 8px !important;\n }\n\n .", "-menu-item-group-title {\n overflow: hidden;\n padding-inline: 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .", "-menu-item-icon {\n position: absolute;\n inset-inline-start: 0;\n\n display: flex !important;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: 36px;\n height: 36px;\n }\n\n .", "-menu-title-content {\n overflow: hidden;\n flex: 1;\n\n margin: 0 !important;\n padding-inline-start: 36px;\n\n line-height: 1.5;\n }\n\n &.", "-menu-inline-collapsed {\n .ant-menu-title-content {\n display: none;\n width: 0;\n opacity: 0;\n }\n\n .", "-menu-item {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 36px !important;\n height: 36px !important;\n }\n }\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls),
|
|
25
|
-
resizeHandle: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: col-resize;\n\n position: absolute;\n
|
|
25
|
+
resizeHandle: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: col-resize;\n\n position: absolute;\n inset-block: 0 0;\n\n width: 8px;\n\n transition: background-color 0.2s ease;\n\n &::after {\n content: '';\n\n position: absolute;\n inset-block: 0;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: 2px;\n\n background: transparent;\n\n transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);\n }\n "]))),
|
|
26
26
|
resizeHandleHighlight: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n &:hover {\n &::after {\n width: 3px;\n background: ", ";\n box-shadow: 0 0 8px ", "40;\n }\n }\n\n &:active {\n &::after {\n background: ", ";\n }\n }\n "])), token.colorPrimary, token.colorPrimary, token.colorPrimaryActive),
|
|
27
27
|
resizeHandleLeft: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n inset-inline-end: -4px;\n "]))),
|
|
28
28
|
resizeHandleRight: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n inset-inline-start: -4px;\n "]))),
|
|
29
|
-
toggleLeft: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n inset-inline-end: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -", "px;\n border-radius: 0
|
|
30
|
-
toggleRight: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n inset-inline-start: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -", "px;\n border-radius:
|
|
31
|
-
toggleRoot: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n\n /* Smooth transitions for all states */\n transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);\n\n &:has(> div) {\n pointer-events: all;\n }\n\n > div {\n
|
|
29
|
+
toggleLeft: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n inset-inline-end: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -", "px;\n border-inline-start-width: 0;\n border-radius: 0 ", "px ", "px 0;\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleShort, LAYOUT.toggleLength, LAYOUT.toggleLength / 2, token.borderRadiusLG, token.borderRadiusLG),
|
|
30
|
+
toggleRight: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n inset-inline-start: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n inset-block-start: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-block-start: -", "px;\n border-inline-end-width: 0;\n border-radius: ", "px 0 0 ", "px; /* \u53F3\u4FA7\u9762\u677F\uFF0Chandle \u5728\u5DE6\u8FB9\uFF0C\u5DE6\u4FA7\u5706\u89D2 */\n }\n "])), LAYOUT.offset, LAYOUT.toggleShort, LAYOUT.toggleShort, LAYOUT.toggleLength, LAYOUT.toggleLength / 2, token.borderRadiusLG, token.borderRadiusLG),
|
|
31
|
+
toggleRoot: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n z-index: 50;\n\n /* Smooth transitions for all states */\n transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);\n\n &:has(> div) {\n pointer-events: all;\n }\n\n > div {\n pointer-events: all;\n cursor: pointer;\n\n position: absolute;\n\n border: 1px solid ", ";\n\n color: ", ";\n\n background: ", ";\n backdrop-filter: blur(8px);\n\n /* Enhanced transitions with backdrop blur */\n transition:\n color 0.2s ", ",\n transform 0.2s ", ",\n box-shadow 0.2s ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n transform: scale(0.95);\n color: ", ";\n }\n }\n "])), token.colorBorder, token.colorTextTertiary, backgroundColor || token.colorBgLayout, token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorTextSecondary, token.colorText)
|
|
32
32
|
};
|
|
33
33
|
});
|
|
@@ -34,6 +34,7 @@ export interface DraggableSideNavProps extends Omit<DivProps, 'children' | 'onSe
|
|
|
34
34
|
*/
|
|
35
35
|
header?: boolean;
|
|
36
36
|
};
|
|
37
|
+
backgroundColor?: string;
|
|
37
38
|
/**
|
|
38
39
|
* Body content (main content area)
|
|
39
40
|
* Can be a static element or a function that receives expand state
|
|
@@ -141,7 +142,9 @@ export interface DraggableSideNavProps extends Omit<DivProps, 'children' | 'onSe
|
|
|
141
142
|
header?: CSSProperties;
|
|
142
143
|
};
|
|
143
144
|
/**
|
|
144
|
-
*
|
|
145
|
+
* Expanded width (controlled)
|
|
146
|
+
* This represents the width when expanded, not the current displayed width
|
|
147
|
+
* The actual displayed width will be `width` when expanded, or `minWidth` when collapsed
|
|
145
148
|
*/
|
|
146
149
|
width?: number;
|
|
147
150
|
}
|