@lobehub/ui 1.8.2 → 1.9.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.
@@ -1,9 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { EditOutlined } from '@ant-design/icons';
3
- import { Tooltip } from 'antd';
2
+ import { ControlInput } from "../components/ControlInput";
3
+ import { ActionIcon } from "./..";
4
+ import { Edit3 } from 'lucide-react';
4
5
  import { memo, useState } from 'react';
5
6
  import { Flexbox } from 'react-layout-kit';
6
- import { ControlInput } from "../components/ControlInput";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  var EditableText = /*#__PURE__*/memo(function (_ref) {
@@ -22,13 +22,17 @@ var EditableText = /*#__PURE__*/memo(function (_ref) {
22
22
  }) : /*#__PURE__*/_jsxs(Flexbox, {
23
23
  horizontal: true,
24
24
  gap: 8,
25
- children: [value, /*#__PURE__*/_jsx(Tooltip, {
26
- title: '编辑',
27
- children: /*#__PURE__*/_jsx(EditOutlined, {
28
- onClick: function onClick() {
29
- setEdited(!edited);
30
- }
31
- })
25
+ children: [value, /*#__PURE__*/_jsx(ActionIcon, {
26
+ title: 'Edit',
27
+ placement: "right",
28
+ icon: Edit3,
29
+ size: {
30
+ fontSize: 14,
31
+ blockSize: 24
32
+ },
33
+ onClick: function onClick() {
34
+ setEdited(!edited);
35
+ }
32
36
  })]
33
37
  });
34
38
  });
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from 'antd';
3
- export declare type SearchBarProps = InputProps;
4
- declare const SearchBar: import("react").MemoExoticComponent<({ value, onChange, style, placeholder, ...props }: SearchBarProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export interface SearchBarProps extends InputProps {
4
+ shortKey?: string;
5
+ enableShortKey?: boolean;
6
+ type?: 'ghost' | 'block';
7
+ }
8
+ declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
5
9
  export default SearchBar;
@@ -1,25 +1,92 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["value", "onChange", "style", "placeholder"];
4
- import { SearchOutlined } from '@ant-design/icons';
5
- import { Input } from 'antd';
6
- import { memo } from 'react';
4
+ var _excluded = ["className", "value", "onChange", "style", "placeholder", "type", "enableShortKey", "shortKey"];
5
+ var _navigator;
6
+ import { Icon } from "./..";
7
+ import { Input, Tag } from 'antd';
8
+ import { Search } from 'lucide-react';
9
+ import { memo, useEffect, useRef, useState } from 'react';
10
+ import { useStyles } from "./style";
7
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform : '');
14
+ var symbol = isAppleDevice ? '⌘' : 'Ctrl';
8
15
  var SearchBar = /*#__PURE__*/memo(function (_ref) {
9
- var value = _ref.value,
10
- onChange = _ref.onChange,
16
+ var className = _ref.className,
17
+ value = _ref.value,
18
+ _onChange = _ref.onChange,
11
19
  style = _ref.style,
12
20
  placeholder = _ref.placeholder,
21
+ _ref$type = _ref.type,
22
+ type = _ref$type === void 0 ? 'ghost' : _ref$type,
23
+ enableShortKey = _ref.enableShortKey,
24
+ _ref$shortKey = _ref.shortKey,
25
+ shortKey = _ref$shortKey === void 0 ? 'f' : _ref$shortKey,
13
26
  props = _objectWithoutProperties(_ref, _excluded);
14
- return /*#__PURE__*/_jsx(Input, _objectSpread({
15
- prefix: /*#__PURE__*/_jsx(SearchOutlined, {}),
16
- allowClear: true,
17
- value: value,
18
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Search',
19
- style: _objectSpread(_objectSpread({}, style), {}, {
20
- borderColor: 'transparent'
27
+ var _useState = useState(true),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ showTag = _useState2[0],
30
+ setShowTag = _useState2[1];
31
+ var _useState3 = useState(value),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ inputValue = _useState4[0],
34
+ setInputValue = _useState4[1];
35
+ var _useStyles = useStyles({
36
+ type: type
21
37
  }),
22
- onChange: onChange
23
- }, props));
38
+ styles = _useStyles.styles,
39
+ cx = _useStyles.cx;
40
+ var inputRef = useRef(null);
41
+ useEffect(function () {
42
+ if (!enableShortKey) return;
43
+ var handler = function handler(ev) {
44
+ if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === shortKey) {
45
+ ev.preventDefault();
46
+ inputRef.current.focus();
47
+ }
48
+ };
49
+ document.addEventListener('keydown', handler);
50
+ return function () {
51
+ return document.removeEventListener('keydown', handler);
52
+ };
53
+ }, []);
54
+ return /*#__PURE__*/_jsxs("div", {
55
+ className: cx(styles.search, className),
56
+ children: [/*#__PURE__*/_jsx(Input, _objectSpread({
57
+ ref: inputRef,
58
+ className: styles.input,
59
+ prefix: /*#__PURE__*/_jsx(Icon, {
60
+ className: styles.icon,
61
+ icon: Search,
62
+ size: {
63
+ fontSize: 14
64
+ },
65
+ style: {
66
+ marginRight: 4
67
+ }
68
+ }),
69
+ allowClear: true,
70
+ value: value,
71
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
72
+ style: _objectSpread(_objectSpread({}, style), {}, {
73
+ borderColor: 'transparent'
74
+ }),
75
+ onChange: function onChange(e) {
76
+ setInputValue(e.target.value);
77
+ setShowTag(e.target.value ? false : true);
78
+ if (_onChange) _onChange(e);
79
+ },
80
+ onFocus: function onFocus() {
81
+ return setShowTag(false);
82
+ },
83
+ onBlur: function onBlur() {
84
+ return setShowTag(true);
85
+ }
86
+ }, props)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
87
+ className: styles.tag,
88
+ children: [symbol, " ", shortKey.toUpperCase()]
89
+ })]
90
+ });
24
91
  });
25
92
  export default SearchBar;
@@ -0,0 +1,8 @@
1
+ export declare const useStyles: (props?: {
2
+ type: 'ghost' | 'block';
3
+ } | undefined) => import("antd-style").ReturnStyles<{
4
+ search: import("antd-style").SerializedStyles;
5
+ input: import("antd-style").SerializedStyles;
6
+ tag: import("antd-style").SerializedStyles;
7
+ icon: import("antd-style").SerializedStyles;
8
+ }>;
@@ -0,0 +1,15 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
3
+ import { createStyles } from 'antd-style';
4
+ import { rgba } from 'polished';
5
+ export var useStyles = createStyles(function (_ref, _ref2) {
6
+ var css = _ref.css,
7
+ token = _ref.token;
8
+ var type = _ref2.type;
9
+ return {
10
+ search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n height: 36px;\n "]))),
11
+ input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n height: inherit;\n padding: 0 8px 0 12px;\n transition: background-color 100ms ", ";\n\n ", "\n\n &:hover {\n background-color: ", " !important;\n }\n\n input {\n background: transparent;\n }\n "])), token.motionEaseOut, type === 'block' ? css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: ", " !important;\n "])), rgba(token.colorBgElevated, 0.6)) : css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: transparent !important;\n border: 1px solid ", " !important;\n "])), token.colorBorder), token.colorFillTertiary),
12
+ tag: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n "]))),
13
+ icon: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
14
+ };
15
+ });
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
9
9
  return {
10
10
  editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
11
11
  left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
12
- right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n\n padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n input:checked + label > svg {\n stroke: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.colorBgLayout, token.colorBorder)
12
+ right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n input:checked + label > svg {\n stroke: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorBorder)
13
13
  };
14
14
  });
@@ -32,8 +32,6 @@ var ThemeProvider = function ThemeProvider(_ref) {
32
32
  customStylish: getCustomStylish,
33
33
  customToken: getCustomToken,
34
34
  children: [/*#__PURE__*/_jsx(ReactFontLoader, {
35
- url: "https://raw.githubusercontent.com/divspace/hack/master/css/hack.css"
36
- }), /*#__PURE__*/_jsx(ReactFontLoader, {
37
35
  url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
38
36
  }), /*#__PURE__*/_jsx(ReactFontLoader, {
39
37
  url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
@@ -1,18 +1,21 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className"];
3
+ var _excluded = ["className", "arrow"];
4
4
  import { Tooltip as AntdTooltip } from 'antd';
5
5
  import { memo } from 'react';
6
6
  import { useStyles } from "./style";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  var Tooltip = /*#__PURE__*/memo(function (_ref) {
9
9
  var className = _ref.className,
10
+ _ref$arrow = _ref.arrow,
11
+ arrow = _ref$arrow === void 0 ? false : _ref$arrow,
10
12
  props = _objectWithoutProperties(_ref, _excluded);
11
13
  var _useStyles = useStyles(),
12
14
  styles = _useStyles.styles,
13
15
  cx = _useStyles.cx;
14
16
  return /*#__PURE__*/_jsx(AntdTooltip, _objectSpread({
15
- overlayClassName: cx(styles.tooltip, className)
17
+ overlayClassName: cx(styles.tooltip, className),
18
+ arrow: arrow
16
19
  }, props));
17
20
  });
18
21
  export default Tooltip;
@@ -1,7 +1,7 @@
1
- var FONT_EMOJI = "\"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Apple Color Emoji\", \"Twemoji Mozilla\", \"Noto Color Emoji\", \"Android Emoji\"";
2
- var FONT_EN = "\"HarmonyOS Sans\", \"Segoe UI\", \"SF Pro Display\",-apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif";
3
- var FONT_CN = "\"HarmonyOS Sans SC\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft Yahei UI\", \"Microsoft Yahei\", \"Source Han Sans CN\", sans-serif";
4
- var FONT_CODE = "Hack, \"SFMono Regular\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace";
1
+ var FONT_EMOJI = "\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Apple Color Emoji\",\"Twemoji Mozilla\",\"Noto Color Emoji\",\"Android Emoji\"";
2
+ var FONT_EN = "\"HarmonyOS Sans\",\"Segoe UI\",\"SF Pro Display\",-apple-system,BlinkMacSystemFont,Roboto,Oxygen,Ubuntu,Cantarell,\"Open Sans\",\"Helvetica Neue\",sans-serif";
3
+ var FONT_CN = "\"HarmonyOS Sans SC\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft Yahei UI\",\"Microsoft Yahei\",\"Source Han Sans CN\",sans-serif";
4
+ var FONT_CODE = "ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace";
5
5
  export var baseTheme = {
6
6
  token: {
7
7
  colorInfo: '#0070f3',
@@ -22,11 +22,11 @@ __export(EditableText_exports, {
22
22
  default: () => EditableText_default
23
23
  });
24
24
  module.exports = __toCommonJS(EditableText_exports);
25
- var import_icons = require("@ant-design/icons");
26
- var import_antd = require("antd");
25
+ var import_ControlInput = require("../components/ControlInput");
26
+ var import__ = require("../index");
27
+ var import_lucide_react = require("lucide-react");
27
28
  var import_react = require("react");
28
29
  var import_react_layout_kit = require("react-layout-kit");
29
- var import_ControlInput = require("../components/ControlInput");
30
30
  var EditableText = (0, import_react.memo)(({ value, onChange }) => {
31
31
  const [edited, setEdited] = (0, import_react.useState)(false);
32
32
  return edited ? /* @__PURE__ */ React.createElement(
@@ -38,14 +38,18 @@ var EditableText = (0, import_react.memo)(({ value, onChange }) => {
38
38
  },
39
39
  onChange
40
40
  }
41
- ) : /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, gap: 8 }, value, /* @__PURE__ */ React.createElement(import_antd.Tooltip, { title: "编辑" }, /* @__PURE__ */ React.createElement(
42
- import_icons.EditOutlined,
41
+ ) : /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, gap: 8 }, value, /* @__PURE__ */ React.createElement(
42
+ import__.ActionIcon,
43
43
  {
44
+ title: "Edit",
45
+ placement: "right",
46
+ icon: import_lucide_react.Edit3,
47
+ size: { fontSize: 14, blockSize: 24 },
44
48
  onClick: () => {
45
49
  setEdited(!edited);
46
50
  }
47
51
  }
48
- )));
52
+ ));
49
53
  });
50
54
  var EditableText_default = EditableText;
51
55
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from 'antd';
3
- export declare type SearchBarProps = InputProps;
4
- declare const SearchBar: import("react").MemoExoticComponent<({ value, onChange, style, placeholder, ...props }: SearchBarProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export interface SearchBarProps extends InputProps {
4
+ shortKey?: string;
5
+ enableShortKey?: boolean;
6
+ type?: 'ghost' | 'block';
7
+ }
8
+ declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
5
9
  export default SearchBar;
@@ -22,21 +22,74 @@ __export(SearchBar_exports, {
22
22
  default: () => SearchBar_default
23
23
  });
24
24
  module.exports = __toCommonJS(SearchBar_exports);
25
- var import_icons = require("@ant-design/icons");
25
+ var import__ = require("../index");
26
26
  var import_antd = require("antd");
27
+ var import_lucide_react = require("lucide-react");
27
28
  var import_react = require("react");
28
- var SearchBar = (0, import_react.memo)(({ value, onChange, style, placeholder, ...props }) => /* @__PURE__ */ React.createElement(
29
- import_antd.Input,
30
- {
31
- prefix: /* @__PURE__ */ React.createElement(import_icons.SearchOutlined, null),
32
- allowClear: true,
29
+ var import_style = require("./style");
30
+ var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(
31
+ typeof navigator !== "undefined" ? navigator == null ? void 0 : navigator.platform : ""
32
+ );
33
+ var symbol = isAppleDevice ? "⌘" : "Ctrl";
34
+ var SearchBar = (0, import_react.memo)(
35
+ ({
36
+ className,
33
37
  value,
34
- placeholder: placeholder ?? "Search",
35
- style: { ...style, borderColor: "transparent" },
36
38
  onChange,
39
+ style,
40
+ placeholder,
41
+ type = "ghost",
42
+ enableShortKey,
43
+ shortKey = "f",
37
44
  ...props
45
+ }) => {
46
+ const [showTag, setShowTag] = (0, import_react.useState)(true);
47
+ const [inputValue, setInputValue] = (0, import_react.useState)(value);
48
+ const { styles, cx } = (0, import_style.useStyles)({ type });
49
+ const inputRef = (0, import_react.useRef)(null);
50
+ (0, import_react.useEffect)(() => {
51
+ if (!enableShortKey)
52
+ return;
53
+ const handler = (ev) => {
54
+ if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === shortKey) {
55
+ ev.preventDefault();
56
+ inputRef.current.focus();
57
+ }
58
+ };
59
+ document.addEventListener("keydown", handler);
60
+ return () => document.removeEventListener("keydown", handler);
61
+ }, []);
62
+ return /* @__PURE__ */ React.createElement("div", { className: cx(styles.search, className) }, /* @__PURE__ */ React.createElement(
63
+ import_antd.Input,
64
+ {
65
+ ref: inputRef,
66
+ className: styles.input,
67
+ prefix: /* @__PURE__ */ React.createElement(
68
+ import__.Icon,
69
+ {
70
+ className: styles.icon,
71
+ icon: import_lucide_react.Search,
72
+ size: { fontSize: 14 },
73
+ style: { marginRight: 4 }
74
+ }
75
+ ),
76
+ allowClear: true,
77
+ value,
78
+ placeholder: placeholder ?? "Type keywords...",
79
+ style: { ...style, borderColor: "transparent" },
80
+ onChange: (e) => {
81
+ setInputValue(e.target.value);
82
+ setShowTag(e.target.value ? false : true);
83
+ if (onChange)
84
+ onChange(e);
85
+ },
86
+ onFocus: () => setShowTag(false),
87
+ onBlur: () => setShowTag(true),
88
+ ...props
89
+ }
90
+ ), enableShortKey && showTag && !inputValue && /* @__PURE__ */ React.createElement(import_antd.Tag, { className: styles.tag }, symbol, " ", shortKey.toUpperCase()));
38
91
  }
39
- ));
92
+ );
40
93
  var SearchBar_default = SearchBar;
41
94
  // Annotate the CommonJS export names for ESM import in node:
42
95
  0 && (module.exports = {});
@@ -0,0 +1,8 @@
1
+ export declare const useStyles: (props?: {
2
+ type: 'ghost' | 'block';
3
+ } | undefined) => import("antd-style").ReturnStyles<{
4
+ search: import("antd-style").SerializedStyles;
5
+ input: import("antd-style").SerializedStyles;
6
+ tag: import("antd-style").SerializedStyles;
7
+ icon: import("antd-style").SerializedStyles;
8
+ }>;
@@ -0,0 +1,68 @@
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/SearchBar/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 import_polished = require("polished");
27
+ var useStyles = (0, import_antd_style.createStyles)(({ css, token }, { type }) => ({
28
+ search: css`
29
+ position: relative;
30
+ max-width: 100%;
31
+ height: 36px;
32
+ `,
33
+ input: css`
34
+ position: relative;
35
+ height: inherit;
36
+ padding: 0 8px 0 12px;
37
+ transition: background-color 100ms ${token.motionEaseOut};
38
+
39
+ ${type === "block" ? css`
40
+ background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)} !important;
41
+ ` : css`
42
+ background: transparent !important;
43
+ border: 1px solid ${token.colorBorder} !important;
44
+ `}
45
+
46
+ &:hover {
47
+ background-color: ${token.colorFillTertiary} !important;
48
+ }
49
+
50
+ input {
51
+ background: transparent;
52
+ }
53
+ `,
54
+ tag: css`
55
+ position: absolute;
56
+ z-index: 5;
57
+ top: 50%;
58
+ right: 0;
59
+ transform: translateY(-50%);
60
+ `,
61
+ icon: css`
62
+ color: ${token.colorTextPlaceholder};
63
+ `
64
+ }));
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ useStyles
68
+ });
@@ -62,6 +62,7 @@ var useStyles = (0, import_antd_style.createStyles)(
62
62
  --leva-colors-vivid1: ${token.colorWarning};
63
63
  --leva-shadows-level1: unset;
64
64
  --leva-shadows-level2: unset;
65
+ --leva-fonts-mono: ${token.fontFamilyCode};
65
66
 
66
67
  padding: 6px 0;
67
68
  background: ${token.colorBgLayout};
@@ -60,7 +60,6 @@ var ThemeProvider = ({ token, children, themeMode }) => {
60
60
  customStylish: import_styles.getCustomStylish,
61
61
  customToken: getCustomToken
62
62
  },
63
- /* @__PURE__ */ import_react.default.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/divspace/hack/master/css/hack.css" }),
64
63
  /* @__PURE__ */ import_react.default.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css" }),
65
64
  /* @__PURE__ */ import_react.default.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css" }),
66
65
  /* @__PURE__ */ import_react.default.createElement(import_GlobalStyle.default, null),
@@ -25,9 +25,9 @@ module.exports = __toCommonJS(Tooltip_exports);
25
25
  var import_antd = require("antd");
26
26
  var import_react = require("react");
27
27
  var import_style = require("./style");
28
- var Tooltip = (0, import_react.memo)(({ className, ...props }) => {
28
+ var Tooltip = (0, import_react.memo)(({ className, arrow = false, ...props }) => {
29
29
  const { styles, cx } = (0, import_style.useStyles)();
30
- return /* @__PURE__ */ React.createElement(import_antd.Tooltip, { overlayClassName: cx(styles.tooltip, className), ...props });
30
+ return /* @__PURE__ */ React.createElement(import_antd.Tooltip, { overlayClassName: cx(styles.tooltip, className), arrow, ...props });
31
31
  });
32
32
  var Tooltip_default = Tooltip;
33
33
  // Annotate the CommonJS export names for ESM import in node:
@@ -22,10 +22,10 @@ __export(base_exports, {
22
22
  baseTheme: () => baseTheme
23
23
  });
24
24
  module.exports = __toCommonJS(base_exports);
25
- var FONT_EMOJI = `"Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"`;
26
- var FONT_EN = `"HarmonyOS Sans", "Segoe UI", "SF Pro Display",-apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif`;
27
- var FONT_CN = `"HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei UI", "Microsoft Yahei", "Source Han Sans CN", sans-serif`;
28
- var FONT_CODE = `Hack, "SFMono Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace`;
25
+ var FONT_EMOJI = `"Segoe UI Emoji","Segoe UI Symbol","Apple Color Emoji","Twemoji Mozilla","Noto Color Emoji","Android Emoji"`;
26
+ var FONT_EN = `"HarmonyOS Sans","Segoe UI","SF Pro Display",-apple-system,BlinkMacSystemFont,Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif`;
27
+ var FONT_CN = `"HarmonyOS Sans SC","PingFang SC","Hiragino Sans GB","Microsoft Yahei UI","Microsoft Yahei","Source Han Sans CN",sans-serif`;
28
+ var FONT_CODE = `ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace`;
29
29
  var baseTheme = {
30
30
  token: {
31
31
  colorInfo: "#0070f3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",