@lobehub/ui 1.141.3 → 1.142.1

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.
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { type LucideIcon } from 'lucide-react';
3
3
  import { type ActionIconProps } from "../ActionIcon";
4
+ import { IconSizeType } from "../Icon";
4
5
  import { DivProps } from "../types";
5
6
  export interface ActionIconGroupItems {
7
+ disable?: boolean;
6
8
  icon: LucideIcon;
7
9
  key: string;
8
10
  label: string;
@@ -35,6 +37,11 @@ export interface ActionIconGroupProps extends DivProps {
35
37
  * @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
36
38
  */
37
39
  placement?: ActionIconProps['placement'];
40
+ /**
41
+ * @description The size of the group
42
+ * @default "small"
43
+ */
44
+ size?: IconSizeType;
38
45
  /**
39
46
  * @description Whether to add a spotlight background
40
47
  * @default true
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["type", "items", "placement", "spotlight", "direction", "dropdownMenu", "onActionClick"];
5
+ var _excluded = ["type", "items", "placement", "spotlight", "direction", "dropdownMenu", "onActionClick", "size"];
6
6
  import { Dropdown } from 'antd';
7
7
  import { MoreHorizontal } from 'lucide-react';
8
8
  import { memo } from 'react';
@@ -26,6 +26,8 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
26
26
  _ref$dropdownMenu = _ref.dropdownMenu,
27
27
  dropdownMenu = _ref$dropdownMenu === void 0 ? [] : _ref$dropdownMenu,
28
28
  onActionClick = _ref.onActionClick,
29
+ _ref$size = _ref.size,
30
+ size = _ref$size === void 0 ? 'small' : _ref$size,
29
31
  rest = _objectWithoutProperties(_ref, _excluded);
30
32
  var _useStyles = useStyles({
31
33
  type: type
@@ -38,6 +40,7 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
38
40
  }, rest), {}, {
39
41
  children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), (items === null || items === void 0 ? void 0 : items.length) > 0 && items.map(function (item) {
40
42
  return /*#__PURE__*/_jsx(ActionIcon, {
43
+ disable: item.disable,
41
44
  icon: item.icon,
42
45
  onClick: onActionClick ? function () {
43
46
  return onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick({
@@ -47,7 +50,7 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
47
50
  });
48
51
  } : undefined,
49
52
  placement: tooltipsPlacement,
50
- size: "small",
53
+ size: size,
51
54
  title: item.label
52
55
  }, item.key);
53
56
  }), (dropdownMenu === null || dropdownMenu === void 0 ? void 0 : dropdownMenu.length) > 0 && /*#__PURE__*/_jsx(Dropdown, {
@@ -55,9 +58,10 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
55
58
  items: dropdownMenu.map(function (item) {
56
59
  if (item.type) return item;
57
60
  return _objectSpread(_objectSpread({}, item), {}, {
61
+ disabled: item.disable,
58
62
  icon: /*#__PURE__*/_jsx(Icon, {
59
63
  icon: item.icon,
60
- size: "small"
64
+ size: size
61
65
  }),
62
66
  onClick: onActionClick ? function (info) {
63
67
  return onActionClick({
@@ -73,7 +77,7 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
73
77
  children: /*#__PURE__*/_jsx(ActionIcon, {
74
78
  icon: MoreHorizontal,
75
79
  placement: tooltipsPlacement,
76
- size: "small"
80
+ size: size
77
81
  }, "more")
78
82
  })]
79
83
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.141.3",
3
+ "version": "1.142.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",