@lobehub/ui 1.146.0 → 1.146.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,12 +1,12 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
- import { DivProps } from "../types";
3
- export interface ChatHeaderProps extends DivProps {
2
+ import { FlexboxProps } from 'react-layout-kit';
3
+ export interface ChatHeaderProps extends FlexboxProps {
4
4
  classNames?: {
5
5
  center?: string;
6
6
  left?: string;
7
7
  right?: string;
8
8
  };
9
- gap?: {
9
+ gaps?: {
10
10
  center?: number;
11
11
  left?: number;
12
12
  right?: number;
@@ -1,5 +1,8 @@
1
1
  'use client';
2
2
 
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ var _excluded = ["left", "right", "className", "styles", "gaps", "classNames", "showBackButton", "onBackClick", "children", "gap"];
3
6
  import { ChevronLeft } from 'lucide-react';
4
7
  import { memo } from 'react';
5
8
  import { Flexbox } from 'react-layout-kit';
@@ -11,28 +14,32 @@ var ChatHeader = /*#__PURE__*/memo(function (_ref) {
11
14
  var left = _ref.left,
12
15
  right = _ref.right,
13
16
  className = _ref.className,
14
- style = _ref.style,
15
17
  contentStyles = _ref.styles,
18
+ gaps = _ref.gaps,
16
19
  classNames = _ref.classNames,
17
20
  showBackButton = _ref.showBackButton,
18
21
  onBackClick = _ref.onBackClick,
19
- gap = _ref.gap,
20
- children = _ref.children;
22
+ children = _ref.children,
23
+ _ref$gap = _ref.gap,
24
+ gap = _ref$gap === void 0 ? 16 : _ref$gap,
25
+ rest = _objectWithoutProperties(_ref, _excluded);
21
26
  var _useStyles = useStyles(),
22
27
  cx = _useStyles.cx,
23
28
  styles = _useStyles.styles;
24
- return /*#__PURE__*/_jsxs(Flexbox, {
29
+ return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
25
30
  align: 'center',
26
31
  className: cx(styles.container, className),
27
32
  distribution: 'space-between',
33
+ gap: gap,
28
34
  horizontal: true,
29
- paddingInline: 16,
30
- style: style,
35
+ paddingInline: 16
36
+ }, rest), {}, {
31
37
  children: [/*#__PURE__*/_jsxs(Flexbox, {
32
38
  align: 'center',
33
39
  className: cx(styles.left, classNames === null || classNames === void 0 ? void 0 : classNames.left),
34
- gap: (gap === null || gap === void 0 ? void 0 : gap.left) || 12,
40
+ gap: (gaps === null || gaps === void 0 ? void 0 : gaps.left) || 12,
35
41
  horizontal: true,
42
+ justify: 'flex-start',
36
43
  style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.left,
37
44
  children: [showBackButton && /*#__PURE__*/_jsx(ActionIcon, {
38
45
  icon: ChevronLeft,
@@ -43,24 +50,26 @@ var ChatHeader = /*#__PURE__*/memo(function (_ref) {
43
50
  fontSize: 24
44
51
  },
45
52
  style: {
46
- marginRight: gap !== null && gap !== void 0 && gap.left ? -gap.left / 2 : -6
53
+ marginRight: gaps !== null && gaps !== void 0 && gaps.left ? -gaps.left / 2 : -6
47
54
  }
48
55
  }), left]
49
56
  }), children && /*#__PURE__*/_jsx(Flexbox, {
50
57
  align: 'center',
51
58
  className: cx(styles.center, classNames === null || classNames === void 0 ? void 0 : classNames.center),
52
- gap: (gap === null || gap === void 0 ? void 0 : gap.center) || 12,
59
+ gap: (gaps === null || gaps === void 0 ? void 0 : gaps.center) || 8,
53
60
  horizontal: true,
61
+ justify: 'center',
54
62
  style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.center,
55
63
  children: children
56
64
  }), /*#__PURE__*/_jsx(Flexbox, {
57
65
  align: 'center',
58
66
  className: cx(styles.right, classNames === null || classNames === void 0 ? void 0 : classNames.right),
59
- gap: (gap === null || gap === void 0 ? void 0 : gap.right) || 8,
67
+ gap: (gaps === null || gaps === void 0 ? void 0 : gaps.right) || 8,
60
68
  horizontal: true,
69
+ justify: 'flex-end',
61
70
  style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.right,
62
71
  children: right
63
72
  })]
64
- });
73
+ }));
65
74
  });
66
75
  export default ChatHeader;
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { type InputProps } from "../Input";
3
3
  export interface SearchBarProps extends Omit<InputProps, 'styles' | 'classNames'> {
4
- classNames: {
4
+ classNames?: {
5
5
  input?: string;
6
6
  shortKey?: string;
7
7
  };
@@ -24,7 +24,7 @@ export interface SearchBarProps extends Omit<InputProps, 'styles' | 'classNames'
24
24
  */
25
25
  shortKey?: string;
26
26
  spotlight?: boolean;
27
- styles: {
27
+ styles?: {
28
28
  input?: CSSProperties;
29
29
  shortKey?: CSSProperties;
30
30
  };
@@ -32,11 +32,13 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
32
32
  _onPressEnter = _ref.onPressEnter,
33
33
  _onFocus = _ref.onFocus,
34
34
  _ref$styles = _ref.styles,
35
- inputStyle = _ref$styles.input,
36
- shortKeyStyle = _ref$styles.shortKey,
35
+ _ref$styles2 = _ref$styles === void 0 ? {} : _ref$styles,
36
+ inputStyle = _ref$styles2.input,
37
+ shortKeyStyle = _ref$styles2.shortKey,
37
38
  _ref$classNames = _ref.classNames,
38
- inputClassName = _ref$classNames.input,
39
- shortKeyClassName = _ref$classNames.shortKey,
39
+ _ref$classNames2 = _ref$classNames === void 0 ? {} : _ref$classNames,
40
+ inputClassName = _ref$classNames2.input,
41
+ shortKeyClassName = _ref$classNames2.shortKey,
40
42
  rest = _objectWithoutProperties(_ref, _excluded);
41
43
  var _useControlledState = useControlledState(defaultValue, {
42
44
  defaultValue: defaultValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.146.0",
3
+ "version": "1.146.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",