@lobehub/ui 1.9.0 → 1.11.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 (119) hide show
  1. package/es/ActionIcon/index.js +2 -2
  2. package/es/ActionIcon/style.js +1 -1
  3. package/es/EditableMessageList/index.js +6 -6
  4. package/es/EditableText/index.js +1 -4
  5. package/es/Highlighter/style.js +1 -2
  6. package/es/Icon/index.d.ts +1 -0
  7. package/es/Icon/index.js +5 -2
  8. package/es/Input/index.d.ts +13 -0
  9. package/es/Input/index.js +38 -0
  10. package/es/Input/style.d.ts +6 -0
  11. package/es/Input/style.js +12 -0
  12. package/es/Markdown/style.js +1 -1
  13. package/es/MessageInput/index.d.ts +2 -0
  14. package/es/MessageInput/index.js +10 -8
  15. package/es/SearchBar/index.d.ts +1 -2
  16. package/es/SearchBar/index.js +9 -18
  17. package/es/SearchBar/style.d.ts +1 -3
  18. package/es/SearchBar/style.js +6 -8
  19. package/es/Snippet/style.js +1 -2
  20. package/es/StroyBook/style.js +1 -1
  21. package/es/ThemeProvider/index.d.ts +2 -6
  22. package/es/ThemeProvider/index.js +8 -18
  23. package/es/components/ControlInput.d.ts +1 -1
  24. package/es/components/ControlInput.js +20 -23
  25. package/es/index.d.ts +1 -0
  26. package/es/index.js +1 -0
  27. package/es/styles/algorithms/generateColorPalette.d.ts +11 -0
  28. package/es/styles/algorithms/generateColorPalette.js +31 -0
  29. package/es/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  30. package/es/styles/{customStylish.js → algorithms/generateCustomStylish.js} +1 -1
  31. package/es/styles/algorithms/generateCustomToken.d.ts +3 -0
  32. package/es/styles/algorithms/generateCustomToken.js +57 -0
  33. package/es/styles/algorithms/generateTheme.d.ts +5 -0
  34. package/es/styles/algorithms/generateTheme.js +18 -0
  35. package/es/styles/colors.d.ts +38 -0
  36. package/es/styles/colors.js +176 -0
  37. package/es/styles/index.d.ts +3 -3
  38. package/es/styles/index.js +3 -3
  39. package/es/styles/theme/base.d.ts +2 -2
  40. package/es/styles/theme/base.js +8 -14
  41. package/es/styles/theme/dark.d.ts +3 -4
  42. package/es/styles/theme/dark.js +40 -71
  43. package/es/styles/theme/light.d.ts +3 -4
  44. package/es/styles/theme/light.js +41 -32
  45. package/es/types/customToken.d.ts +1027 -0
  46. package/es/types/global.d.ts +12 -0
  47. package/es/types/index.d.ts +5 -17
  48. package/es/types/index.js +1 -0
  49. package/lib/ActionIcon/index.js +2 -2
  50. package/lib/ActionIcon/style.js +2 -2
  51. package/lib/EditableMessageList/index.js +6 -6
  52. package/lib/EditableText/index.js +1 -1
  53. package/lib/Highlighter/style.js +1 -2
  54. package/lib/Icon/index.d.ts +1 -0
  55. package/lib/Icon/index.js +5 -2
  56. package/lib/Input/index.d.ts +13 -0
  57. package/lib/Input/index.js +45 -0
  58. package/lib/Input/style.d.ts +6 -0
  59. package/lib/Input/style.js +70 -0
  60. package/lib/Markdown/style.js +5 -1
  61. package/lib/MessageInput/index.d.ts +2 -0
  62. package/lib/MessageInput/index.js +6 -5
  63. package/lib/SearchBar/index.d.ts +1 -2
  64. package/lib/SearchBar/index.js +8 -26
  65. package/lib/SearchBar/style.d.ts +1 -3
  66. package/lib/SearchBar/style.js +1 -20
  67. package/lib/Snippet/style.js +1 -2
  68. package/lib/StroyBook/style.js +6 -1
  69. package/lib/ThemeProvider/index.d.ts +2 -6
  70. package/lib/ThemeProvider/index.js +12 -23
  71. package/lib/components/ControlInput.d.ts +1 -1
  72. package/lib/components/ControlInput.js +9 -19
  73. package/lib/index.d.ts +1 -0
  74. package/lib/index.js +5 -0
  75. package/lib/styles/algorithms/generateColorPalette.d.ts +11 -0
  76. package/lib/styles/algorithms/generateColorPalette.js +72 -0
  77. package/lib/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  78. package/lib/styles/{customStylish.js → algorithms/generateCustomStylish.js} +11 -7
  79. package/lib/styles/algorithms/generateCustomToken.d.ts +3 -0
  80. package/lib/styles/{customToken.js → algorithms/generateCustomToken.js} +42 -17
  81. package/lib/styles/algorithms/generateTheme.d.ts +5 -0
  82. package/lib/styles/algorithms/generateTheme.js +59 -0
  83. package/lib/styles/colors.d.ts +38 -0
  84. package/lib/styles/colors.js +1828 -0
  85. package/lib/styles/index.d.ts +3 -3
  86. package/lib/styles/index.js +18 -4
  87. package/lib/styles/theme/base.d.ts +2 -2
  88. package/lib/styles/theme/base.js +10 -16
  89. package/lib/styles/theme/dark.d.ts +3 -4
  90. package/lib/styles/theme/dark.js +46 -96
  91. package/lib/styles/theme/light.d.ts +3 -4
  92. package/lib/styles/theme/light.js +48 -38
  93. package/lib/types/customToken.d.ts +1027 -0
  94. package/lib/types/global.d.ts +12 -0
  95. package/lib/types/index.d.ts +5 -17
  96. package/lib/{styles/theme → types}/index.js +3 -18
  97. package/package.json +1 -1
  98. package/es/styles/algorithms/colorRelationship.d.ts +0 -6
  99. package/es/styles/algorithms/colorRelationship.js +0 -88
  100. package/es/styles/algorithms/index.d.ts +0 -15
  101. package/es/styles/algorithms/index.js +0 -66
  102. package/es/styles/algorithms/paletteGenerator.d.ts +0 -51
  103. package/es/styles/algorithms/paletteGenerator.js +0 -74
  104. package/es/styles/antdTheme.d.ts +0 -2
  105. package/es/styles/antdTheme.js +0 -4
  106. package/es/styles/customToken.d.ts +0 -65
  107. package/es/styles/customToken.js +0 -24
  108. package/es/styles/theme/index.d.ts +0 -2
  109. package/es/styles/theme/index.js +0 -2
  110. package/lib/styles/algorithms/colorRelationship.d.ts +0 -6
  111. package/lib/styles/algorithms/colorRelationship.js +0 -87
  112. package/lib/styles/algorithms/index.d.ts +0 -15
  113. package/lib/styles/algorithms/index.js +0 -81
  114. package/lib/styles/algorithms/paletteGenerator.d.ts +0 -51
  115. package/lib/styles/algorithms/paletteGenerator.js +0 -91
  116. package/lib/styles/antdTheme.d.ts +0 -2
  117. package/lib/styles/antdTheme.js +0 -30
  118. package/lib/styles/customToken.d.ts +0 -65
  119. package/lib/styles/theme/index.d.ts +0 -2
@@ -0,0 +1,12 @@
1
+ import { Theme as AntdStyleTheme } from 'antd-style';
2
+ import { LobeCustomToken } from './customToken';
3
+
4
+ declare module 'antd-style' {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ export interface CustomToken extends LobeCustomToken {}
7
+ }
8
+
9
+ declare module 'styled-components' {
10
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
11
+ export interface DefaultTheme extends AntdStyleTheme, LobeCustomToken {}
12
+ }
@@ -1,18 +1,6 @@
1
- import { Theme as AntdStyleTheme } from 'antd-style';
2
1
  import React from 'react';
3
-
4
- declare module 'styled-components' {
5
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
- export interface DefaultTheme extends AntdStyleTheme {}
7
- }
8
-
9
- export type DivProps = React.DetailedHTMLProps<
10
- React.HTMLAttributes<HTMLDivElement>,
11
- HTMLDivElement
12
- >;
13
-
14
- declare global {
15
- type SvgProps = React.DetailedHTMLProps<React.HTMLAttributes<SVGSVGElement>, SVGSVGElement>;
16
-
17
- type ImgProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLImageElement>, HTMLImageElement>;
18
- }
2
+ export declare type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3
+ export declare type SvgProps = React.DetailedHTMLProps<React.HTMLAttributes<SVGSVGElement>, SVGSVGElement>;
4
+ export declare type ImgProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLImageElement>, HTMLImageElement>;
5
+ export declare type InputProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLInputElement>, HTMLInputElement>;
6
+ export declare type TextAreaProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
@@ -0,0 +1 @@
1
+ export {};
@@ -51,7 +51,7 @@ var ActionIcon = (0, import_react.memo)(
51
51
  borderRadius = 5;
52
52
  break;
53
53
  case "small":
54
- blockSize = 28;
54
+ blockSize = 24;
55
55
  borderRadius = 5;
56
56
  break;
57
57
  case "site":
@@ -70,7 +70,7 @@ var ActionIcon = (0, import_react.memo)(
70
70
  style: { width: blockSize, height: blockSize, borderRadius, ...style },
71
71
  ...props
72
72
  },
73
- /* @__PURE__ */ React.createElement(import__.Icon, { size: size === "site" ? "small" : size, icon })
73
+ /* @__PURE__ */ React.createElement(import__.Icon, { size: size === "site" ? "normal" : size, icon })
74
74
  );
75
75
  if (!title)
76
76
  return actionIconBlock;
@@ -34,7 +34,7 @@ var useStyles = (0, import_antd_style.createStyles)(
34
34
  align-items: center;
35
35
  justify-content: center;
36
36
 
37
- color: ${active ? token.colorText : token.colorTextQuaternary};
37
+ color: ${active ? token.colorText : token.colorTextTertiary};
38
38
 
39
39
  background: ${active ? token.colorFillTertiary : "transparent"};
40
40
 
@@ -47,7 +47,7 @@ var useStyles = (0, import_antd_style.createStyles)(
47
47
 
48
48
  &:hover {
49
49
  color: ${token.colorText};
50
- background-color: ${active ? token.colorFillSecondary : token.colorFillTertiary};
50
+ background-color: ${token.colorFillSecondary};
51
51
  }
52
52
 
53
53
  &:active {
@@ -33,15 +33,15 @@ __export(EditableMessageList_exports, {
33
33
  default: () => EditableMessageList_default
34
34
  });
35
35
  module.exports = __toCommonJS(EditableMessageList_exports);
36
+ var import_ActionIcon = __toESM(require("../ActionIcon"));
37
+ var import_Chat = require("../Chat");
38
+ var import_ControlInput = require("../components/ControlInput");
36
39
  var import_icons = require("@ant-design/icons");
37
40
  var import_antd = require("antd");
38
41
  var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
42
+ var import_lucide_react = require("lucide-react");
39
43
  var import_react = require("react");
40
44
  var import_react_layout_kit = require("react-layout-kit");
41
- var import_ActionIcon = __toESM(require("../ActionIcon"));
42
- var import_Chat = require("../Chat");
43
- var import_ControlInput = require("../components/ControlInput");
44
- var import_lucide_react = require("lucide-react");
45
45
  var EditableMessageList = (0, import_react.memo)(
46
46
  ({ disabled, dataSources, onChange }) => {
47
47
  const [chatMessages, dispatch] = (0, import_react.useReducer)(import_Chat.messagesReducer, dataSources);
@@ -91,8 +91,8 @@ var EditableMessageList = (0, import_react.memo)(
91
91
  import_ActionIcon.default,
92
92
  {
93
93
  icon: import_lucide_react.TrashIcon,
94
- title: "删除",
95
- size: "small",
94
+ placement: "right",
95
+ title: "Delete",
96
96
  onClick: () => {
97
97
  dispatch({ type: "deleteMessage", index });
98
98
  }
@@ -44,7 +44,7 @@ var EditableText = (0, import_react.memo)(({ value, onChange }) => {
44
44
  title: "Edit",
45
45
  placement: "right",
46
46
  icon: import_lucide_react.Edit3,
47
- size: { fontSize: 14, blockSize: 24 },
47
+ size: "small",
48
48
  onClick: () => {
49
49
  setEdited(!edited);
50
50
  }
@@ -23,7 +23,6 @@ __export(style_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(style_exports);
25
25
  var import_antd_style = require("antd-style");
26
- var import_polished = require("polished");
27
26
  var useStyles = (0, import_antd_style.createStyles)(
28
27
  ({ token, css, cx, prefixCls }, type) => {
29
28
  const prefix = `${prefixCls}-highlighter`;
@@ -37,7 +36,7 @@ var useStyles = (0, import_antd_style.createStyles)(
37
36
 
38
37
  overflow: auto;
39
38
 
40
- background-color: ${type === "block" ? (0, import_polished.rgba)(token.colorBgElevated, 0.6) : "transparent"};
39
+ background-color: ${type === "block" ? token.colorFillTertiary : "transparent"};
41
40
  border-radius: ${token.borderRadius}px;
42
41
 
43
42
  transition: background-color 100ms ${token.motionEaseOut};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { SvgProps } from "../types";
2
3
  import { LucideIcon } from 'lucide-react';
3
4
  export declare type IconSize = 'large' | 'normal' | 'small' | {
4
5
  fontSize?: number;
package/lib/Icon/index.js CHANGED
@@ -29,12 +29,15 @@ var Icon = ({ icon, size = "normal", ...props }) => {
29
29
  const SvgIcon = icon;
30
30
  switch (size) {
31
31
  case "large":
32
- case "normal":
33
32
  fontSize = 24;
34
33
  strokeWidth = 2;
35
34
  break;
36
- case "small":
35
+ case "normal":
37
36
  fontSize = 20;
37
+ strokeWidth = 2;
38
+ break;
39
+ case "small":
40
+ fontSize = 14;
38
41
  strokeWidth = 1.5;
39
42
  break;
40
43
  default:
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { InputProps as AntdInputProps } from 'antd';
3
+ import { TextAreaProps as AntdTextAreaProps } from 'antd/es/input/TextArea';
4
+ export interface InputProps extends AntdInputProps {
5
+ ref?: any;
6
+ type?: 'ghost' | 'block';
7
+ }
8
+ export declare const Input: import("react").NamedExoticComponent<InputProps>;
9
+ export interface TextAreaProps extends AntdTextAreaProps {
10
+ ref?: any;
11
+ type?: 'ghost' | 'block';
12
+ }
13
+ export declare const TextArea: import("react").NamedExoticComponent<TextAreaProps>;
@@ -0,0 +1,45 @@
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/Input/index.tsx
20
+ var Input_exports = {};
21
+ __export(Input_exports, {
22
+ Input: () => Input,
23
+ TextArea: () => TextArea
24
+ });
25
+ module.exports = __toCommonJS(Input_exports);
26
+ var import_antd = require("antd");
27
+ var import_react = require("react");
28
+ var import_style = require("./style");
29
+ var Input = (0, import_react.memo)(
30
+ (0, import_react.forwardRef)(({ className, type = "ghost", ...props }, ref) => {
31
+ const { styles, cx } = (0, import_style.useStyles)({ type });
32
+ return /* @__PURE__ */ React.createElement(import_antd.Input, { ref, className: cx(styles.input, className), ...props });
33
+ })
34
+ );
35
+ var TextArea = (0, import_react.memo)(
36
+ (0, import_react.forwardRef)(({ className, type = "ghost", ...props }, ref) => {
37
+ const { styles, cx } = (0, import_style.useStyles)({ type });
38
+ return /* @__PURE__ */ React.createElement(import_antd.Input.TextArea, { ref, className: cx(styles.textarea, className), ...props });
39
+ })
40
+ );
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ Input,
44
+ TextArea
45
+ });
@@ -0,0 +1,6 @@
1
+ export declare const useStyles: (props?: {
2
+ type: 'ghost' | 'block';
3
+ } | undefined) => import("antd-style").ReturnStyles<{
4
+ input: import("antd-style").SerializedStyles;
5
+ textarea: import("antd-style").SerializedStyles;
6
+ }>;
@@ -0,0 +1,70 @@
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/Input/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, token }, { type }) => ({
27
+ input: css`
28
+ position: relative;
29
+
30
+ max-width: 100%;
31
+ height: 36px;
32
+ padding: 0 12px;
33
+
34
+ background-color: ${type === "block" ? token.colorFillTertiary : "transparent"};
35
+ border: 1px solid ${type === "block" ? "transparent" : token.colorBorder};
36
+
37
+ transition: background-color 100ms ${token.motionEaseOut};
38
+
39
+ input {
40
+ background: transparent;
41
+ }
42
+
43
+ &:hover {
44
+ background-color: ${token.colorFillTertiary};
45
+ }
46
+ `,
47
+ textarea: css`
48
+ position: relative;
49
+
50
+ max-width: 100%;
51
+ padding: 8px 12px;
52
+
53
+ background-color: ${type === "block" ? token.colorFillTertiary : "transparent"};
54
+ border: 1px solid ${type === "block" ? "transparent" : token.colorBorder};
55
+
56
+ transition: background-color 100ms ${token.motionEaseOut};
57
+
58
+ textarea {
59
+ background: transparent;
60
+ }
61
+
62
+ &:hover {
63
+ background-color: ${token.colorFillTertiary};
64
+ }
65
+ `
66
+ }));
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ useStyles
70
+ });
@@ -84,7 +84,7 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode })
84
84
  margin-inline-end: 0px;
85
85
  padding: 8px;
86
86
 
87
- border: 1px solid ${token.colorBorder};
87
+ border: 1px solid ${token.colorBorderSecondary};
88
88
  border-radius: ${token.borderRadius}px;
89
89
  }
90
90
 
@@ -115,6 +115,10 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode })
115
115
  ul li {
116
116
  line-height: 1.8;
117
117
  }
118
+
119
+ pre {
120
+ border-radius: ${token.borderRadius}px;
121
+ }
118
122
  `,
119
123
  code: css`
120
124
  padding: 2px 4px;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { type TextAreaProps } from "../index";
2
3
  import { ButtonProps } from 'antd';
3
4
  /**
4
5
  * @title MessageInputProps
@@ -30,6 +31,7 @@ export interface MessageInputProps {
30
31
  renderButtons?: (text: string) => ButtonProps[];
31
32
  height?: number;
32
33
  className?: string;
34
+ type?: TextAreaProps['type'];
33
35
  }
34
36
  declare const MessageInput: import("react").NamedExoticComponent<MessageInputProps>;
35
37
  export default MessageInput;
@@ -22,18 +22,19 @@ __export(MessageInput_exports, {
22
22
  default: () => MessageInput_default
23
23
  });
24
24
  module.exports = __toCommonJS(MessageInput_exports);
25
+ var import__ = require("../index");
25
26
  var import_antd = require("antd");
26
27
  var import_antd_style = require("antd-style");
27
28
  var import_react = require("react");
28
29
  var import_react_layout_kit = require("react-layout-kit");
29
30
  var MessageInput = (0, import_react.memo)(
30
- ({ onCancel, defaultValue, onConfirm, renderButtons, height, className }) => {
31
+ ({ type, onCancel, defaultValue, onConfirm, renderButtons, height, className }) => {
31
32
  const [tempSystemRole, setRole] = (0, import_react.useState)(defaultValue || "");
32
33
  return /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { gap: 8 }, /* @__PURE__ */ React.createElement(
33
- import_antd.Input.TextArea,
34
+ import__.TextArea,
34
35
  {
36
+ type,
35
37
  value: tempSystemRole,
36
- allowClear: true,
37
38
  placeholder: "例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。",
38
39
  style: { height: height ?? 200 },
39
40
  onChange: (e) => {
@@ -49,8 +50,8 @@ var MessageInput = (0, import_react.memo)(
49
50
  onConfirm == null ? void 0 : onConfirm(tempSystemRole);
50
51
  }
51
52
  },
52
- "设定"
53
- ), /* @__PURE__ */ React.createElement(import_antd.Button, { type: "text", onClick: onCancel }, "取消"))));
53
+ "Confirm"
54
+ ), /* @__PURE__ */ React.createElement(import_antd.Button, { type: "text", onClick: onCancel }, "Cancel"))));
54
55
  }
55
56
  );
56
57
  var MessageInput_default = MessageInput;
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { InputProps } from 'antd';
2
+ import { InputProps } from "../index";
3
3
  export interface SearchBarProps extends InputProps {
4
4
  shortKey?: string;
5
5
  enableShortKey?: boolean;
6
- type?: 'ghost' | 'block';
7
6
  }
8
7
  declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
9
8
  export default SearchBar;
@@ -32,51 +32,33 @@ var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(
32
32
  );
33
33
  var symbol = isAppleDevice ? "⌘" : "Ctrl";
34
34
  var SearchBar = (0, import_react.memo)(
35
- ({
36
- className,
37
- value,
38
- onChange,
39
- style,
40
- placeholder,
41
- type = "ghost",
42
- enableShortKey,
43
- shortKey = "f",
44
- ...props
45
- }) => {
35
+ ({ className, value, onChange, placeholder, enableShortKey, shortKey = "f", ...props }) => {
46
36
  const [showTag, setShowTag] = (0, import_react.useState)(true);
47
37
  const [inputValue, setInputValue] = (0, import_react.useState)(value);
48
- const { styles, cx } = (0, import_style.useStyles)({ type });
38
+ const { styles, cx } = (0, import_style.useStyles)();
49
39
  const inputRef = (0, import_react.useRef)(null);
50
40
  (0, import_react.useEffect)(() => {
51
41
  if (!enableShortKey)
52
42
  return;
53
43
  const handler = (ev) => {
44
+ var _a;
54
45
  if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === shortKey) {
55
46
  ev.preventDefault();
56
- inputRef.current.focus();
47
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
57
48
  }
58
49
  };
59
50
  document.addEventListener("keydown", handler);
60
51
  return () => document.removeEventListener("keydown", handler);
61
52
  }, []);
62
- return /* @__PURE__ */ React.createElement("div", { className: cx(styles.search, className) }, /* @__PURE__ */ React.createElement(
63
- import_antd.Input,
53
+ return /* @__PURE__ */ React.createElement("div", { className: styles.search }, /* @__PURE__ */ React.createElement(
54
+ import__.Input,
64
55
  {
65
56
  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
- ),
57
+ className: cx(styles.input, className),
58
+ prefix: /* @__PURE__ */ React.createElement(import__.Icon, { className: styles.icon, icon: import_lucide_react.Search, size: "small", style: { marginRight: 4 } }),
76
59
  allowClear: true,
77
60
  value,
78
61
  placeholder: placeholder ?? "Type keywords...",
79
- style: { ...style, borderColor: "transparent" },
80
62
  onChange: (e) => {
81
63
  setInputValue(e.target.value);
82
64
  setShowTag(e.target.value ? false : true);
@@ -1,6 +1,4 @@
1
- export declare const useStyles: (props?: {
2
- type: 'ghost' | 'block';
3
- } | undefined) => import("antd-style").ReturnStyles<{
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
4
2
  search: import("antd-style").SerializedStyles;
5
3
  input: import("antd-style").SerializedStyles;
6
4
  tag: import("antd-style").SerializedStyles;
@@ -23,33 +23,14 @@ __export(style_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(style_exports);
25
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 }) => ({
26
+ var useStyles = (0, import_antd_style.createStyles)(({ css, token }) => ({
28
27
  search: css`
29
28
  position: relative;
30
29
  max-width: 100%;
31
- height: 36px;
32
30
  `,
33
31
  input: css`
34
32
  position: relative;
35
- height: inherit;
36
33
  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
34
  `,
54
35
  tag: css`
55
36
  position: absolute;
@@ -23,7 +23,6 @@ __export(style_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(style_exports);
25
25
  var import_antd_style = require("antd-style");
26
- var import_polished = require("polished");
27
26
  var useStyles = (0, import_antd_style.createStyles)(
28
27
  ({ css, token }, type) => css`
29
28
  position: relative;
@@ -40,7 +39,7 @@ var useStyles = (0, import_antd_style.createStyles)(
40
39
 
41
40
  transition: background-color 100ms ${token.motionEaseOut};
42
41
  ${type === "block" ? css`
43
- background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)};
42
+ background-color: ${token.colorFillTertiary};
44
43
  ` : css`
45
44
  border: 1px solid ${token.colorBorder};
46
45
  `}
@@ -72,8 +72,13 @@ var useStyles = (0, import_antd_style.createStyles)(
72
72
  background: transparent;
73
73
  }
74
74
  }
75
+
75
76
  input:checked + label > svg {
76
- stroke: ${token.colorBorder};
77
+ stroke: ${token.colorBgLayout};
78
+ }
79
+
80
+ button {
81
+ --leva-colors-accent2: ${token.colorFillSecondary};
77
82
  }
78
83
  `
79
84
  };
@@ -1,10 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { extractStaticStyle, type ThemeMode } from 'antd-style';
2
- import React from 'react';
3
3
  export interface ThemeProviderProps {
4
- /**
5
- * @description Custom tokens to be used in the theme
6
- */
7
- token?: any;
8
4
  /**
9
5
  * @description The children of the ThemeProvider component
10
6
  */
@@ -22,5 +18,5 @@ export interface ThemeProviderProps {
22
18
  */
23
19
  cache?: typeof extractStaticStyle.cache;
24
20
  }
25
- declare const ThemeProvider: React.FC<ThemeProviderProps>;
21
+ declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
26
22
  export default ThemeProvider;
@@ -32,40 +32,29 @@ __export(ThemeProvider_exports, {
32
32
  default: () => ThemeProvider_default
33
33
  });
34
34
  module.exports = __toCommonJS(ThemeProvider_exports);
35
+ var import_styles = require("../styles");
35
36
  var import_antd = require("antd");
36
37
  var import_antd_style = require("antd-style");
37
- var import_react = __toESM(require("react"));
38
+ var import_react = require("react");
38
39
  var import_react_font_loader = __toESM(require("react-font-loader"));
39
40
  var import_styled_components = require("styled-components");
40
- var import_styles = require("../styles");
41
41
  var import_GlobalStyle = __toESM(require("./GlobalStyle"));
42
- var ThemeProvider = ({ token, children, themeMode }) => {
42
+ var ThemeProvider = (0, import_react.memo)(({ children, themeMode }) => {
43
43
  (0, import_antd_style.setupStyled)({ ThemeContext: import_styled_components.ThemeContext });
44
- const getCustomToken = (0, import_react.useCallback)(
45
- (params) => {
46
- const base = (0, import_styles.createCustomToken)(params);
47
- if (token) {
48
- return { ...base, ...token };
49
- } else {
50
- return base;
51
- }
52
- },
53
- [token]
54
- );
55
- return /* @__PURE__ */ import_react.default.createElement(import_antd_style.StyleProvider, { speedy: process.env.NODE_ENV === "production" }, /* @__PURE__ */ import_react.default.createElement(
44
+ return /* @__PURE__ */ React.createElement(import_antd_style.StyleProvider, { speedy: process.env.NODE_ENV === "production" }, /* @__PURE__ */ React.createElement(
56
45
  import_antd_style.ThemeProvider,
57
46
  {
58
47
  themeMode,
59
- theme: import_styles.getAntdTheme,
60
- customStylish: import_styles.getCustomStylish,
61
- customToken: getCustomToken
48
+ theme: import_styles.lobeTheme,
49
+ customStylish: import_styles.lobeCustomStylish,
50
+ customToken: import_styles.lobeCustomToken
62
51
  },
63
- /* @__PURE__ */ import_react.default.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css" }),
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" }),
65
- /* @__PURE__ */ import_react.default.createElement(import_GlobalStyle.default, null),
66
- /* @__PURE__ */ import_react.default.createElement(import_antd.App, { style: { minHeight: "inherit", width: "inherit" } }, children)
52
+ /* @__PURE__ */ React.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css" }),
53
+ /* @__PURE__ */ React.createElement(import_react_font_loader.default, { url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css" }),
54
+ /* @__PURE__ */ React.createElement(import_GlobalStyle.default, null),
55
+ /* @__PURE__ */ React.createElement(import_antd.App, { style: { minHeight: "inherit", width: "inherit" } }, children)
67
56
  ));
68
- };
57
+ });
69
58
  var ThemeProvider_default = ThemeProvider;
70
59
  // Annotate the CommonJS export names for ESM import in node:
71
60
  0 && (module.exports = {});
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InputProps } from 'antd';
2
+ import { InputProps } from "../index";
3
3
  export interface ControlInputProps extends Omit<InputProps, 'onChange' | 'value' | 'onAbort'> {
4
4
  onChange?: (value: string) => void;
5
5
  onValueChanging?: (value: string) => void;