@lobehub/ui 1.124.0 → 1.124.2

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,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { type FlexboxProps } from 'react-layout-kit';
2
3
  import { type IconProps, type IconSizeConfig, type IconSizeType } from "../Icon";
3
4
  import { type TooltipProps } from "../Tooltip";
4
5
  interface ActionIconSizeConfig extends IconSizeConfig {
@@ -7,7 +8,7 @@ interface ActionIconSizeConfig extends IconSizeConfig {
7
8
  }
8
9
  type ActionIconSizeType = 'site' | IconSizeType;
9
10
  export type ActionIconSize = ActionIconSizeType | ActionIconSizeConfig;
10
- export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'> {
11
+ export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'>, FlexboxProps {
11
12
  /**
12
13
  * @description Whether the icon is active or not
13
14
  * @default false
@@ -69,6 +69,7 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
69
69
  var actionIconBlock = /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
70
70
  align: 'center',
71
71
  className: cx(styles.block, disable ? styles.disabled : styles.normal, className),
72
+ horizontal: true,
72
73
  justify: 'center',
73
74
  onClick: loading || disable ? undefined : onClick,
74
75
  ref: ref,
@@ -1,16 +1,19 @@
1
- /// <reference types="react" />
2
1
  import { MenuProps } from 'antd';
3
- import { DivProps } from "../types";
4
- export interface BurgerProps extends DivProps {
2
+ import { CSSProperties } from 'react';
3
+ import { type ActionIconProps } from "../ActionIcon";
4
+ export interface BurgerProps {
5
+ className?: string;
5
6
  /**
6
7
  * @description The height of the header component
7
8
  * @default 64
8
9
  */
9
10
  headerHeight?: number;
11
+ icon?: ActionIconProps;
10
12
  /**
11
13
  * @description The items to be displayed in the menu
12
14
  */
13
15
  items: MenuProps['items'];
16
+ onClick?: MenuProps['onClick'];
14
17
  /**
15
18
  * @description The keys of the currently open sub-menus
16
19
  */
@@ -27,6 +30,7 @@ export interface BurgerProps extends DivProps {
27
30
  * @description A callback function to set the opened state
28
31
  */
29
32
  setOpened: (state: boolean) => void;
33
+ style?: CSSProperties;
30
34
  }
31
35
  declare const Burger: import("react").NamedExoticComponent<BurgerProps>;
32
36
  export default Burger;
@@ -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 = ["items", "openKeys", "selectedKeys", "opened", "setOpened", "className", "headerHeight"];
3
+ var _excluded = ["items", "openKeys", "selectedKeys", "opened", "setOpened", "className", "headerHeight", "onClick", "icon"];
4
4
  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; }
5
5
  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; }
6
6
  import { Drawer, Menu } from 'antd';
@@ -20,6 +20,9 @@ var Burger = /*#__PURE__*/memo(function (_ref) {
20
20
  className = _ref.className,
21
21
  _ref$headerHeight = _ref.headerHeight,
22
22
  headerHeight = _ref$headerHeight === void 0 ? 64 : _ref$headerHeight,
23
+ onClick = _ref.onClick,
24
+ _ref$icon = _ref.icon,
25
+ icon = _ref$icon === void 0 ? {} : _ref$icon,
23
26
  rest = _objectWithoutProperties(_ref, _excluded);
24
27
  var _useStyles = useStyles(headerHeight),
25
28
  cx = _useStyles.cx,
@@ -30,10 +33,10 @@ var Burger = /*#__PURE__*/memo(function (_ref) {
30
33
  setOpened(!opened);
31
34
  }
32
35
  }, rest), {}, {
33
- children: [/*#__PURE__*/_jsx(ActionIcon, {
36
+ children: [/*#__PURE__*/_jsx(ActionIcon, _objectSpread({
34
37
  icon: opened ? X : MenuIcon,
35
38
  size: "site"
36
- }), /*#__PURE__*/_jsxs(Drawer, {
39
+ }, icon)), /*#__PURE__*/_jsxs(Drawer, {
37
40
  className: styles.drawer,
38
41
  closeIcon: undefined,
39
42
  open: opened,
@@ -52,6 +55,7 @@ var Burger = /*#__PURE__*/memo(function (_ref) {
52
55
  className: styles.menu,
53
56
  items: items,
54
57
  mode: 'inline',
58
+ onClick: onClick,
55
59
  openKeys: openKeys,
56
60
  selectedKeys: selectedKeys
57
61
  }), /*#__PURE__*/_jsx("div", {
@@ -27,7 +27,7 @@ export var useStyles = createStyles(function (_ref, variant) {
27
27
  var variantStyle = cx(variant === 'default' && defaultStyle, variant === 'block' && blockStyle, variant === 'ghost' && ghostStyle, variant === 'pure' && pureStyle);
28
28
  return {
29
29
  flatGroup: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: hidden;\n padding-inline: 16px;\n "]))), variantStyle),
30
- group: cx(isDarkMode && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", "-collapse-content {\n background: transparent;\n border-color: ", ";\n }\n\n .", "-collapse-header {\n background: ", ";\n }\n "])), prefixCls, token.colorBorderSecondary, prefixCls, token.colorFillTertiary), css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n .", "-collapse-item {\n border: none;\n }\n\n .", "-collapse-header {\n align-items: center !important;\n border-radius: 0 !important;\n }\n\n .", "-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .", "-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls), variantStyle),
30
+ group: cx(isDarkMode && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", "-collapse-content {\n background: transparent;\n border-color: ", ";\n }\n\n .", "-collapse-header {\n background: ", ";\n }\n "])), prefixCls, token.colorBorderSecondary, prefixCls, token.colorFillTertiary), css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n overflow: hidden;\n flex: none;\n\n .", "-collapse-item {\n border: none;\n }\n\n .", "-collapse-header {\n align-items: center !important;\n border-radius: 0 !important;\n }\n\n .", "-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .", "-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls), variantStyle),
31
31
  icon: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n transition: all 100ms ", ";\n "])), token.motionEaseOut),
32
32
  mobileGroupBody: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding: 0 16px;\n background: ", ";\n "])), token.colorBgContainer),
33
33
  mobileGroupHeader: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 16px;\n background: ", ";\n "])), token.colorBgLayout),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.124.0",
3
+ "version": "1.124.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",