@lobehub/ui 1.3.0 → 1.4.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.
Files changed (55) hide show
  1. package/es/Avatar/index.d.ts +10 -0
  2. package/es/Avatar/index.js +61 -0
  3. package/es/ContextMenu/MenuItem/icons.d.ts +4 -0
  4. package/es/ContextMenu/MenuItem/icons.js +73 -0
  5. package/es/ContextMenu/MenuItem/index.d.ts +12 -0
  6. package/es/ContextMenu/MenuItem/index.js +73 -0
  7. package/es/ContextMenu/MenuItem/style.d.ts +7 -0
  8. package/es/ContextMenu/MenuItem/style.js +16 -0
  9. package/es/ContextMenu/index.d.ts +9 -0
  10. package/es/ContextMenu/index.js +265 -0
  11. package/es/ContextMenu/style.d.ts +4 -0
  12. package/es/ContextMenu/style.js +12 -0
  13. package/es/ContextMenu/types/index.d.ts +5 -0
  14. package/es/ContextMenu/types/index.js +2 -0
  15. package/es/ContextMenu/types/menuItem.d.ts +21 -0
  16. package/es/ContextMenu/types/menuItem.js +1 -0
  17. package/es/DraggablePanel/index.d.ts +7 -1
  18. package/es/DraggablePanel/index.js +6 -7
  19. package/es/DraggablePanel/utils.d.ts +1 -1
  20. package/es/List/ListItem/index.d.ts +64 -0
  21. package/es/List/ListItem/index.js +110 -0
  22. package/es/List/ListItem/time.d.ts +2 -0
  23. package/es/List/ListItem/time.js +10 -0
  24. package/es/List/index.d.ts +5 -0
  25. package/es/List/index.js +5 -0
  26. package/es/index.d.ts +3 -0
  27. package/es/index.js +3 -0
  28. package/lib/Avatar/index.d.ts +10 -0
  29. package/lib/Avatar/index.js +74 -0
  30. package/lib/ContextMenu/MenuItem/icons.d.ts +4 -0
  31. package/lib/ContextMenu/MenuItem/icons.js +100 -0
  32. package/lib/ContextMenu/MenuItem/index.d.ts +12 -0
  33. package/lib/ContextMenu/MenuItem/index.js +72 -0
  34. package/lib/ContextMenu/MenuItem/style.d.ts +7 -0
  35. package/lib/ContextMenu/MenuItem/style.js +94 -0
  36. package/lib/ContextMenu/index.d.ts +9 -0
  37. package/lib/ContextMenu/index.js +254 -0
  38. package/lib/ContextMenu/style.d.ts +4 -0
  39. package/lib/ContextMenu/style.js +88 -0
  40. package/lib/ContextMenu/types/index.d.ts +5 -0
  41. package/lib/ContextMenu/types/index.js +19 -0
  42. package/lib/ContextMenu/types/menuItem.d.ts +21 -0
  43. package/lib/ContextMenu/types/menuItem.js +17 -0
  44. package/lib/DraggablePanel/index.d.ts +7 -1
  45. package/lib/DraggablePanel/index.js +17 -19
  46. package/lib/DraggablePanel/utils.d.ts +1 -1
  47. package/lib/List/ListItem/index.d.ts +64 -0
  48. package/lib/List/ListItem/index.js +157 -0
  49. package/lib/List/ListItem/time.d.ts +2 -0
  50. package/lib/List/ListItem/time.js +50 -0
  51. package/lib/List/index.d.ts +5 -0
  52. package/lib/List/index.js +41 -0
  53. package/lib/index.d.ts +3 -0
  54. package/lib/index.js +9 -0
  55. package/package.json +3 -1
@@ -0,0 +1,254 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/ContextMenu/index.tsx
30
+ var ContextMenu_exports = {};
31
+ __export(ContextMenu_exports, {
32
+ default: () => ContextMenu_default
33
+ });
34
+ module.exports = __toCommonJS(ContextMenu_exports);
35
+ var import_react = require("@floating-ui/react");
36
+ var import_react2 = require("react");
37
+ var import_antd = require("antd");
38
+ var import_MenuItem = __toESM(require("./MenuItem"));
39
+ var import_style = require("./style");
40
+ var MenuComponent = (0, import_react2.forwardRef)(({ items, label, container, ...props }, forwardedRef) => {
41
+ const { styles } = (0, import_style.useStyles)();
42
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
43
+ const [activeIndex, setActiveIndex] = (0, import_react2.useState)(null);
44
+ const [allowHover, setAllowHover] = (0, import_react2.useState)(false);
45
+ const listItemsRef = (0, import_react2.useRef)([]);
46
+ const listContentRef = (0, import_react2.useRef)(items.map((item) => item.label));
47
+ const allowMouseUpCloseRef = (0, import_react2.useRef)(false);
48
+ const tree = (0, import_react.useFloatingTree)();
49
+ const nodeId = (0, import_react.useFloatingNodeId)();
50
+ const parentId = (0, import_react.useFloatingParentNodeId)();
51
+ const isNested = parentId !== null;
52
+ const { refs, floatingStyles, context } = (0, import_react.useFloating)({
53
+ nodeId,
54
+ open: isOpen,
55
+ onOpenChange: setIsOpen,
56
+ placement: isNested ? "right-start" : "bottom-start",
57
+ middleware: [
58
+ (0, import_react.offset)({ mainAxis: isNested ? 0 : 4, alignmentAxis: isNested ? -4 : 0 }),
59
+ (0, import_react.flip)(),
60
+ (0, import_react.shift)()
61
+ ],
62
+ whileElementsMounted: import_react.autoUpdate
63
+ });
64
+ const hover = (0, import_react.useHover)(context, {
65
+ enabled: isNested && allowHover,
66
+ delay: { open: 75 },
67
+ handleClose: (0, import_react.safePolygon)({
68
+ blockPointerEvents: true
69
+ })
70
+ });
71
+ const click = (0, import_react.useClick)(context, {
72
+ event: "mousedown",
73
+ toggle: !isNested || !allowHover,
74
+ ignoreMouse: isNested
75
+ });
76
+ const role = (0, import_react.useRole)(context, { role: "menu" });
77
+ const dismiss = (0, import_react.useDismiss)(context);
78
+ const listNavigation = (0, import_react.useListNavigation)(context, {
79
+ listRef: listItemsRef,
80
+ activeIndex,
81
+ nested: isNested,
82
+ onNavigate: setActiveIndex
83
+ });
84
+ const typeahead = (0, import_react.useTypeahead)(context, {
85
+ enabled: isOpen,
86
+ listRef: listContentRef,
87
+ onMatch: isOpen ? setActiveIndex : void 0,
88
+ activeIndex
89
+ });
90
+ const { getReferenceProps, getFloatingProps, getItemProps } = (0, import_react.useInteractions)([
91
+ hover,
92
+ click,
93
+ role,
94
+ dismiss,
95
+ listNavigation,
96
+ typeahead
97
+ ]);
98
+ (0, import_react2.useEffect)(() => {
99
+ if (!tree)
100
+ return;
101
+ function handleTreeClick() {
102
+ setIsOpen(false);
103
+ }
104
+ function onSubMenuOpen(event) {
105
+ if (event.nodeId !== nodeId && event.parentId === parentId) {
106
+ setIsOpen(false);
107
+ }
108
+ }
109
+ tree.events.on("click", handleTreeClick);
110
+ tree.events.on("menuopen", onSubMenuOpen);
111
+ return () => {
112
+ tree.events.off("click", handleTreeClick);
113
+ tree.events.off("menuopen", onSubMenuOpen);
114
+ };
115
+ }, [tree, nodeId, parentId]);
116
+ (0, import_react2.useEffect)(() => {
117
+ if (isOpen && tree) {
118
+ tree.events.emit("menuopen", { parentId, nodeId });
119
+ }
120
+ }, [tree, isOpen, nodeId, parentId]);
121
+ (0, import_react2.useEffect)(() => {
122
+ function onPointerMove({ pointerType }) {
123
+ if (pointerType !== "touch") {
124
+ setAllowHover(true);
125
+ }
126
+ }
127
+ function onKeyDown() {
128
+ setAllowHover(false);
129
+ }
130
+ window.addEventListener("pointermove", onPointerMove, {
131
+ once: true,
132
+ capture: true
133
+ });
134
+ window.addEventListener("keydown", onKeyDown, true);
135
+ return () => {
136
+ window.removeEventListener("pointermove", onPointerMove, {
137
+ capture: true
138
+ });
139
+ window.removeEventListener("keydown", onKeyDown, true);
140
+ };
141
+ }, [allowHover]);
142
+ (0, import_react2.useEffect)(() => {
143
+ let timeout;
144
+ function onContextMenu(e) {
145
+ e.preventDefault();
146
+ refs.setPositionReference({
147
+ getBoundingClientRect() {
148
+ return {
149
+ width: 0,
150
+ height: 0,
151
+ x: e.clientX,
152
+ y: e.clientY,
153
+ top: e.clientY,
154
+ right: e.clientX,
155
+ bottom: e.clientY,
156
+ left: e.clientX
157
+ };
158
+ }
159
+ });
160
+ setIsOpen(true);
161
+ clearTimeout(timeout);
162
+ allowMouseUpCloseRef.current = false;
163
+ timeout = window.setTimeout(() => {
164
+ allowMouseUpCloseRef.current = true;
165
+ }, 300);
166
+ }
167
+ function onMouseUp() {
168
+ if (allowMouseUpCloseRef.current) {
169
+ setIsOpen(false);
170
+ }
171
+ }
172
+ document.addEventListener("contextmenu", onContextMenu);
173
+ document.addEventListener("mouseup", onMouseUp);
174
+ return () => {
175
+ document.removeEventListener("contextmenu", onContextMenu);
176
+ document.removeEventListener("mouseup", onMouseUp);
177
+ clearTimeout(timeout);
178
+ };
179
+ }, [refs, container]);
180
+ const renderMenuItem = (0, import_react2.useCallback)(
181
+ (item, index) => {
182
+ if ("type" in item && item.type === "divider")
183
+ return /* @__PURE__ */ React.createElement(import_antd.Divider, { style: { margin: "4px 12px", minWidth: "auto", width: "auto" } });
184
+ const data = item;
185
+ const props2 = {
186
+ label: data.label,
187
+ key: data.key,
188
+ icon: data.icon,
189
+ shortcut: data.shortcut,
190
+ active: activeIndex === index,
191
+ ...getItemProps({
192
+ ref(node) {
193
+ listItemsRef.current[index] = node;
194
+ },
195
+ onClick() {
196
+ var _a;
197
+ (_a = data.onClick) == null ? void 0 : _a.call(data);
198
+ setIsOpen(false);
199
+ },
200
+ onMouseUp() {
201
+ var _a;
202
+ (_a = data.onClick) == null ? void 0 : _a.call(data);
203
+ setIsOpen(false);
204
+ }
205
+ })
206
+ };
207
+ if ("children" in item) {
208
+ return /* @__PURE__ */ React.createElement(MenuComponent, { ...props2, items: item.children });
209
+ }
210
+ return /* @__PURE__ */ React.createElement(import_MenuItem.default, { ...props2 });
211
+ },
212
+ [activeIndex]
213
+ );
214
+ const referenceRef = (0, import_react.useMergeRefs)([refs.setReference, forwardedRef]);
215
+ return /* @__PURE__ */ React.createElement(import_react.FloatingNode, { id: nodeId }, !label ? null : /* @__PURE__ */ React.createElement(
216
+ import_MenuItem.default,
217
+ {
218
+ ref: referenceRef,
219
+ nested: isNested,
220
+ label,
221
+ role: isNested ? "menuitem" : "menu",
222
+ ...props,
223
+ ...getReferenceProps({
224
+ onClick(event) {
225
+ event.stopPropagation();
226
+ }
227
+ })
228
+ }
229
+ ), /* @__PURE__ */ React.createElement(import_react.FloatingPortal, null, isOpen && /* @__PURE__ */ React.createElement(
230
+ import_react.FloatingFocusManager,
231
+ {
232
+ context,
233
+ modal: false,
234
+ initialFocus: isNested ? -1 : 0,
235
+ returnFocus: !isNested
236
+ },
237
+ /* @__PURE__ */ React.createElement(
238
+ "div",
239
+ {
240
+ ref: refs.setFloating,
241
+ className: styles.container,
242
+ style: floatingStyles,
243
+ ...getFloatingProps()
244
+ },
245
+ items == null ? void 0 : items.map(renderMenuItem)
246
+ )
247
+ )));
248
+ });
249
+ var ContextMenu = (0, import_react2.forwardRef)(
250
+ (props, ref) => /* @__PURE__ */ React.createElement(import_react.FloatingTree, null, /* @__PURE__ */ React.createElement(MenuComponent, { ...props, ref }))
251
+ );
252
+ var ContextMenu_default = ContextMenu;
253
+ // Annotate the CommonJS export names for ESM import in node:
254
+ 0 && (module.exports = {});
@@ -0,0 +1,4 @@
1
+ export declare const useStyles: (props?: string | undefined) => import("antd-style").ReturnStyles<{
2
+ container: string;
3
+ button: string;
4
+ }>;
@@ -0,0 +1,88 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ContextMenu/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyles: () => useStyles
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var useStyles = (0, import_antd_style.createStyles)(({ css, cx, token }, prefixCls) => ({
27
+ container: cx(
28
+ prefixCls,
29
+ css`
30
+ user-select: none;
31
+ scrollbar-width: none;
32
+
33
+ overflow-y: auto;
34
+ overscroll-behavior: contain;
35
+
36
+ box-sizing: border-box;
37
+ width: 200px;
38
+ padding: 5px;
39
+
40
+ font-size: ${token.fontSize};
41
+
42
+ background: ${token.colorBgContainer};
43
+ border: 1px solid ${token.colorBorder};
44
+ border-radius: 8px;
45
+ outline: 0;
46
+ box-shadow: ${token.boxShadowSecondary};
47
+
48
+ &::-webkit-scrollbar {
49
+ display: none;
50
+ }
51
+ `
52
+ ),
53
+ button: cx(
54
+ `${prefixCls}-button`,
55
+ css`
56
+ all: unset;
57
+
58
+ cursor: default;
59
+ user-select: none;
60
+
61
+ padding: 12px 10px;
62
+
63
+ font-size: ${token.fontSize}px;
64
+ line-height: 1;
65
+ color: ${token.colorText};
66
+
67
+ background: ${token.colorBgContainer};
68
+ border: 1px solid ${token.colorBorder};
69
+ border-radius: ${token.borderRadius}px;
70
+
71
+ -webkit-tap-highlight-color: transparent;
72
+
73
+ &:hover {
74
+ background: ${token.colorPrimaryBg};
75
+ border-color: transparent;
76
+ }
77
+
78
+ &:focus-visible {
79
+ border-color: ${token.colorPrimary};
80
+ box-shadow: 0 0 0 2px ${token.colorPrimaryBg};
81
+ }
82
+ `
83
+ )
84
+ }));
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ useStyles
88
+ });
@@ -0,0 +1,5 @@
1
+ import { MenuItemType } from './menuItem';
2
+ export * from './menuItem';
3
+ export interface MenuProps {
4
+ items: MenuItemType[];
5
+ }
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/ContextMenu/types/index.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ __reExport(types_exports, require("./menuItem"), module.exports);
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ interface CommonType {
3
+ key: string;
4
+ label: string;
5
+ onClick?: () => void;
6
+ icon?: ReactNode;
7
+ }
8
+ export interface GeneralItemType extends CommonType {
9
+ disabled?: boolean;
10
+ danger?: boolean;
11
+ shortcut?: ('meta' | 'control' | 'shift' | 'alt' | string)[];
12
+ }
13
+ export interface SubMenuType extends CommonType {
14
+ children: MenuItemType[];
15
+ }
16
+ export interface MenuDividerType {
17
+ type: 'divider';
18
+ dashed?: boolean;
19
+ }
20
+ export declare type MenuItemType = GeneralItemType | SubMenuType | MenuDividerType;
21
+ export {};
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/ContextMenu/types/menuItem.ts
16
+ var menuItem_exports = {};
17
+ module.exports = __toCommonJS(menuItem_exports);
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { NumberSize, Size } from 're-resizable';
2
+ import { ReactNode } from 'react';
3
3
  import type { Props as RndProps } from 'react-rnd';
4
4
  import { DivProps } from "../types";
5
5
  export declare type placementType = 'right' | 'left' | 'top' | 'bottom';
@@ -81,6 +81,12 @@ export interface DraggablePanelProps extends DivProps {
81
81
  * @type CSSProperties
82
82
  */
83
83
  hanlderStyle?: React.CSSProperties;
84
+ children: ReactNode;
85
+ className?: string;
86
+ classNames?: {
87
+ handle?: string;
88
+ content?: string;
89
+ };
84
90
  }
85
91
  declare const DraggablePanel: import("react").NamedExoticComponent<DraggablePanelProps>;
86
92
  export default DraggablePanel;
@@ -63,7 +63,8 @@ var DraggablePanel = (0, import_react.memo)(
63
63
  className,
64
64
  showHandlerWhenUnexpand,
65
65
  destroyOnClose,
66
- hanlderStyle
66
+ hanlderStyle,
67
+ classNames = {}
67
68
  }) => {
68
69
  const ref = (0, import_react.useRef)(null);
69
70
  const isHovering = (0, import_ahooks.useHover)(ref);
@@ -140,30 +141,27 @@ var DraggablePanel = (0, import_react.memo)(
140
141
  return { className: "Right", Arrow: import_lucide_react.ChevronRight };
141
142
  }
142
143
  }, [styles, placement]);
143
- const handler = (
144
- // @ts-ignore
144
+ const handler = /* @__PURE__ */ React.createElement(
145
+ import_react_layout_kit.Center,
146
+ {
147
+ className: cx(styles[`toggle${arrowPlacement}`], classNames.handle),
148
+ style: { opacity: isExpand ? !pin ? 0 : void 0 : showHandlerWhenUnexpand ? 1 : 0 }
149
+ },
145
150
  /* @__PURE__ */ React.createElement(
146
151
  import_react_layout_kit.Center,
147
152
  {
148
- className: cx(styles[`toggle${arrowPlacement}`]),
149
- style: { opacity: isExpand ? !pin ? 0 : void 0 : showHandlerWhenUnexpand ? 1 : 0 }
153
+ style: hanlderStyle,
154
+ onClick: () => {
155
+ setIsExpand(!isExpand);
156
+ }
150
157
  },
151
158
  /* @__PURE__ */ React.createElement(
152
- import_react_layout_kit.Center,
159
+ "div",
153
160
  {
154
- style: hanlderStyle,
155
- onClick: () => {
156
- setIsExpand(!isExpand);
157
- }
161
+ className: styles.handlerIcon,
162
+ style: { transform: `rotate(${isExpand ? 180 : 0}deg)` }
158
163
  },
159
- /* @__PURE__ */ React.createElement(
160
- "div",
161
- {
162
- className: styles.handlerIcon,
163
- style: { transform: `rotate(${isExpand ? 180 : 0}deg)` }
164
- },
165
- /* @__PURE__ */ React.createElement(Arrow, { size: 16, strokeWidth: 1.5 })
166
- )
164
+ /* @__PURE__ */ React.createElement(Arrow, { size: 16, strokeWidth: 1.5 })
167
165
  )
168
166
  )
169
167
  );
@@ -174,7 +172,7 @@ var DraggablePanel = (0, import_react.memo)(
174
172
  {
175
173
  ...sizeProps,
176
174
  style,
177
- className: styles.panel,
175
+ className: cx(styles.panel, classNames.content),
178
176
  enable: canResizing ? resizing : void 0,
179
177
  handleClasses: resizeHandleClassNames,
180
178
  onResizeStop: (e, direction, ref2, delta) => {
@@ -1,2 +1,2 @@
1
1
  import { placementType } from './index';
2
- export declare const revesePlacement: (placement: placementType) => "top" | "left" | "right" | "bottom";
2
+ export declare const revesePlacement: (placement: placementType) => "left" | "right" | "bottom" | "top";
@@ -0,0 +1,64 @@
1
+ import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * 卡片列表项的属性
4
+ */
5
+ export interface ListItemProps {
6
+ /**
7
+ * 是否处于激活状态
8
+ */
9
+ active: boolean;
10
+ /**
11
+ * 是否处于加载状态
12
+ */
13
+ loading?: boolean;
14
+ /**
15
+ * 标题
16
+ */
17
+ title: string;
18
+ /**
19
+ * 描述信息
20
+ */
21
+ description?: string;
22
+ /**
23
+ * 日期时间戳
24
+ */
25
+ date?: number;
26
+ /**
27
+ * 点击事件回调函数
28
+ */
29
+ onClick?: () => void;
30
+ /**
31
+ * 鼠标悬停状态变化事件回调函数
32
+ * @param hover - 是否悬停
33
+ */
34
+ onHoverChange?: (hover: boolean) => void;
35
+ /**
36
+ * 渲染操作区域的 React 节点
37
+ */
38
+ renderActions?: ReactNode;
39
+ /**
40
+ * 头像的 React 节点
41
+ */
42
+ avatar?: ReactNode;
43
+ /**
44
+ * 自定义样式类名
45
+ */
46
+ className?: string;
47
+ /**
48
+ * 自定义样式对象
49
+ */
50
+ style?: CSSProperties;
51
+ /**
52
+ * 是否显示操作区域
53
+ */
54
+ showAction?: boolean;
55
+ /**
56
+ * 自定义样式类名对象
57
+ * @property time - 时间的样式类名
58
+ */
59
+ classNames?: {
60
+ time?: string;
61
+ };
62
+ }
63
+ declare const ListItem: import("react").ForwardRefExoticComponent<ListItemProps & HTMLAttributes<any> & import("react").RefAttributes<HTMLElement>>;
64
+ export default ListItem;