@lobehub/ui 1.2.0 → 1.3.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 (179) hide show
  1. package/es/ActionIcon/index.d.ts +10 -5
  2. package/es/ActionIcon/index.js +15 -7
  3. package/es/ActionIcon/style.d.ts +4 -1
  4. package/es/ActionIcon/style.js +5 -3
  5. package/es/CopyButton/index.d.ts +34 -0
  6. package/es/CopyButton/index.js +49 -0
  7. package/es/DraggablePanel/index.d.ts +4 -4
  8. package/es/DraggablePanel/index.js +4 -4
  9. package/es/DraggablePanel/style.js +2 -2
  10. package/es/DraggablePanel/utils.d.ts +1 -1
  11. package/es/EditableText/ControlInput.d.ts +9 -0
  12. package/es/EditableText/ControlInput.js +88 -0
  13. package/es/EditableText/index.d.ts +5 -0
  14. package/es/EditableText/index.js +35 -0
  15. package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
  16. package/es/Highlighter/SyntaxHighlighter/Prism.js +40 -0
  17. package/es/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
  18. package/es/Highlighter/SyntaxHighlighter/index.js +58 -0
  19. package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
  20. package/es/Highlighter/SyntaxHighlighter/style.js +15 -0
  21. package/es/Highlighter/index.d.ts +36 -0
  22. package/es/Highlighter/index.js +42 -0
  23. package/es/Highlighter/style.d.ts +5 -0
  24. package/es/Highlighter/style.js +18 -0
  25. package/es/Icon/index.d.ts +2 -3
  26. package/es/Icon/index.js +2 -2
  27. package/es/Logo/Divider.d.ts +3 -3
  28. package/es/Logo/Divider.js +6 -4
  29. package/es/Logo/Logo3D.d.ts +3 -3
  30. package/es/Logo/Logo3D.js +6 -4
  31. package/es/Logo/LogoFlat.d.ts +3 -3
  32. package/es/Logo/LogoFlat.js +6 -4
  33. package/es/Logo/LogoHighContrast.d.ts +3 -3
  34. package/es/Logo/LogoHighContrast.js +6 -4
  35. package/es/Logo/LogoText.d.ts +3 -3
  36. package/es/Logo/LogoText.js +6 -4
  37. package/es/Logo/index.d.ts +3 -3
  38. package/es/Logo/index.js +5 -5
  39. package/es/Logo/style.js +1 -1
  40. package/es/Markdown/Code.d.ts +3 -0
  41. package/es/Markdown/Code.js +12 -0
  42. package/es/Markdown/CodeBlock.d.ts +3 -0
  43. package/es/Markdown/CodeBlock.js +27 -0
  44. package/es/Markdown/index.d.ts +13 -0
  45. package/es/Markdown/index.js +28 -0
  46. package/es/Markdown/style.d.ts +4 -0
  47. package/es/Markdown/style.js +12 -0
  48. package/es/MessageInput/index.d.ts +35 -0
  49. package/es/MessageInput/index.js +63 -0
  50. package/es/SearchBar/index.d.ts +5 -0
  51. package/es/SearchBar/index.js +27 -0
  52. package/es/SideNav/index.d.ts +6 -6
  53. package/es/SideNav/index.js +17 -20
  54. package/es/SideNav/style.d.ts +1 -0
  55. package/es/SideNav/style.js +8 -0
  56. package/es/Snippet/index.d.ts +29 -0
  57. package/es/Snippet/index.js +39 -0
  58. package/es/Snippet/style.d.ts +1 -0
  59. package/es/Snippet/style.js +9 -0
  60. package/es/StroyBook/index.d.ts +3 -4
  61. package/es/StroyBook/index.js +14 -7
  62. package/es/StroyBook/style.d.ts +4 -1
  63. package/es/StroyBook/style.js +7 -5
  64. package/es/Swatches/index.d.ts +8 -0
  65. package/es/Swatches/index.js +44 -0
  66. package/es/TabsNav/index.d.ts +3 -3
  67. package/es/TabsNav/index.js +4 -4
  68. package/es/ThemeProvider/GlobalStyle.js +1 -1
  69. package/es/ThemeProvider/index.d.ts +15 -0
  70. package/es/ThemeSwitch/index.d.ts +5 -5
  71. package/es/ThemeSwitch/index.js +5 -9
  72. package/es/Tooltip/index.d.ts +5 -0
  73. package/es/Tooltip/index.js +20 -0
  74. package/es/Tooltip/style.d.ts +3 -0
  75. package/es/Tooltip/style.js +10 -0
  76. package/es/hooks/useCopied.d.ts +4 -0
  77. package/es/hooks/useCopied.js +26 -0
  78. package/es/hooks/useHighlight.d.ts +36 -0
  79. package/es/hooks/useHighlight.js +63 -0
  80. package/es/index.d.ts +9 -0
  81. package/es/index.js +10 -1
  82. package/es/styles/theme/base.d.ts +2 -0
  83. package/es/styles/theme/base.js +15 -0
  84. package/es/styles/theme/dark.js +6 -14
  85. package/es/styles/theme/light.js +11 -12
  86. package/es/types/index.d.ts +14 -5
  87. package/lib/ActionIcon/index.d.ts +10 -5
  88. package/lib/ActionIcon/index.js +39 -50
  89. package/lib/ActionIcon/style.d.ts +4 -1
  90. package/lib/ActionIcon/style.js +29 -22
  91. package/lib/CopyButton/index.d.ts +34 -0
  92. package/lib/CopyButton/index.js +70 -0
  93. package/lib/DraggablePanel/index.d.ts +4 -4
  94. package/lib/DraggablePanel/index.js +160 -158
  95. package/lib/DraggablePanel/style.js +1 -2
  96. package/lib/DraggablePanel/utils.d.ts +1 -1
  97. package/lib/EditableText/ControlInput.d.ts +9 -0
  98. package/lib/EditableText/ControlInput.js +101 -0
  99. package/lib/EditableText/index.d.ts +5 -0
  100. package/lib/EditableText/index.js +52 -0
  101. package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
  102. package/lib/Highlighter/SyntaxHighlighter/Prism.js +41 -0
  103. package/lib/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
  104. package/lib/Highlighter/SyntaxHighlighter/index.js +55 -0
  105. package/lib/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
  106. package/lib/Highlighter/SyntaxHighlighter/style.js +58 -0
  107. package/lib/Highlighter/index.d.ts +36 -0
  108. package/lib/Highlighter/index.js +62 -0
  109. package/lib/Highlighter/style.d.ts +5 -0
  110. package/lib/Highlighter/style.js +107 -0
  111. package/lib/Icon/index.d.ts +2 -3
  112. package/lib/Icon/index.js +3 -13
  113. package/lib/Logo/Divider.d.ts +3 -3
  114. package/lib/Logo/Divider.js +5 -15
  115. package/lib/Logo/Logo3D.d.ts +3 -3
  116. package/lib/Logo/Logo3D.js +4 -14
  117. package/lib/Logo/LogoFlat.d.ts +3 -3
  118. package/lib/Logo/LogoFlat.js +18 -28
  119. package/lib/Logo/LogoHighContrast.d.ts +3 -3
  120. package/lib/Logo/LogoHighContrast.js +4 -14
  121. package/lib/Logo/LogoText.d.ts +3 -3
  122. package/lib/Logo/LogoText.js +5 -15
  123. package/lib/Logo/index.d.ts +3 -3
  124. package/lib/Logo/index.js +11 -18
  125. package/lib/Logo/style.js +1 -1
  126. package/lib/Markdown/Code.d.ts +3 -0
  127. package/lib/Markdown/Code.js +33 -0
  128. package/lib/Markdown/CodeBlock.d.ts +3 -0
  129. package/lib/Markdown/CodeBlock.js +64 -0
  130. package/lib/Markdown/index.d.ts +13 -0
  131. package/lib/Markdown/index.js +48 -0
  132. package/lib/Markdown/style.d.ts +4 -0
  133. package/lib/Markdown/style.js +64 -0
  134. package/lib/MessageInput/index.d.ts +35 -0
  135. package/lib/MessageInput/index.js +58 -0
  136. package/lib/SearchBar/index.d.ts +5 -0
  137. package/lib/SearchBar/index.js +42 -0
  138. package/lib/SideNav/index.d.ts +6 -6
  139. package/lib/SideNav/index.js +7 -31
  140. package/lib/SideNav/style.d.ts +1 -0
  141. package/lib/SideNav/style.js +46 -0
  142. package/lib/Snippet/index.d.ts +29 -0
  143. package/lib/Snippet/index.js +47 -0
  144. package/lib/Snippet/style.d.ts +1 -0
  145. package/lib/Snippet/style.js +71 -0
  146. package/lib/StroyBook/index.d.ts +3 -4
  147. package/lib/StroyBook/index.js +20 -13
  148. package/lib/StroyBook/style.d.ts +4 -1
  149. package/lib/StroyBook/style.js +49 -43
  150. package/lib/Swatches/index.d.ts +8 -0
  151. package/lib/Swatches/index.js +68 -0
  152. package/lib/TabsNav/index.d.ts +3 -3
  153. package/lib/TabsNav/index.js +5 -15
  154. package/lib/ThemeProvider/GlobalStyle.js +7 -5
  155. package/lib/ThemeProvider/index.d.ts +15 -0
  156. package/lib/ThemeSwitch/index.d.ts +5 -5
  157. package/lib/ThemeSwitch/index.js +15 -32
  158. package/lib/Tooltip/index.d.ts +5 -0
  159. package/lib/Tooltip/index.js +34 -0
  160. package/lib/Tooltip/style.d.ts +3 -0
  161. package/lib/Tooltip/style.js +51 -0
  162. package/lib/hooks/useCopied.d.ts +4 -0
  163. package/lib/hooks/useCopied.js +44 -0
  164. package/lib/hooks/useHighlight.d.ts +36 -0
  165. package/lib/hooks/useHighlight.js +76 -0
  166. package/lib/index.d.ts +9 -0
  167. package/lib/index.js +29 -0
  168. package/lib/styles/theme/base.d.ts +2 -0
  169. package/lib/styles/theme/base.js +43 -0
  170. package/lib/styles/theme/dark.js +5 -12
  171. package/lib/styles/theme/light.js +10 -10
  172. package/lib/types/index.d.ts +14 -5
  173. package/package.json +12 -4
  174. package/es/ThemeProvider/token.d.ts +0 -3
  175. package/es/ThemeProvider/token.js +0 -45
  176. package/es/types/index.js +0 -1
  177. package/lib/ThemeProvider/token.d.ts +0 -3
  178. package/lib/ThemeProvider/token.js +0 -73
  179. package/lib/types/index.js +0 -17
@@ -24,13 +24,15 @@ __export(light_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(light_exports);
26
26
  var import_algorithms = require("../algorithms");
27
+ var import_base = require("./base");
27
28
  var lightMode = (0, import_algorithms.genMapTokenAlgorithm)("light");
28
29
  var lightColorPalettes = lightMode.palettes;
29
30
  var lightTheme = {
30
31
  token: {
32
+ ...import_base.baseTheme.token,
31
33
  colorTextLightSolid: "#ffffff",
32
- colorBgLayout: "#ffffff",
33
- colorBgContainer: "#fafafa",
34
+ colorBgLayout: "#fafafa",
35
+ colorBgContainer: "#ffffff",
34
36
  colorBgElevated: "#f2f2f2",
35
37
  colorBgSpotlight: "#999999",
36
38
  colorBorder: "#eaeaea",
@@ -40,17 +42,15 @@ var lightTheme = {
40
42
  colorTextTertiary: "#666666",
41
43
  colorTextQuaternary: "#888888",
42
44
  colorPrimary: "#000000",
45
+ colorFill: "rgba(0,0,0,0.1)",
46
+ colorFillSecondary: "rgba(0,0,0,0.075)",
47
+ colorFillTertiary: "rgba(0,0,0,0.05)",
43
48
  colorFillQuaternary: "rgba(0,0,0,0)",
44
- borderRadius: 5,
45
- borderRadiusXS: 3,
46
- borderRadiusSM: 3,
47
- borderRadiusLG: 8,
48
- controlHeight: 36,
49
49
  boxShadow: "0 12px 20px 6px rgb(104 112 118 / 0.08)",
50
50
  boxShadowSecondary: "0 2px 8px 2px rgb(104 112 118 / 0.07), 0 2px 4px -1px rgb(104 112 118 / 0.04)",
51
- colorLinkHover: lightColorPalettes.primary[5],
52
- colorLink: lightColorPalettes.primary[6],
53
- colorLinkActive: lightColorPalettes.primary[7]
51
+ colorLinkHover: "#3291ff",
52
+ colorLink: "#0070f3",
53
+ colorLinkActive: "#0761d1"
54
54
  },
55
55
  algorithm: (seedToken, mapToken) => ({
56
56
  ...mapToken,
@@ -1,9 +1,18 @@
1
1
  import { Theme as AntdStyleTheme } from 'antd-style';
2
2
  import React from 'react';
3
+
3
4
  declare module 'styled-components' {
4
- interface DefaultTheme extends AntdStyleTheme {
5
- }
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>;
6
18
  }
7
- export declare type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
8
- export declare type SvgProps = React.DetailedHTMLProps<React.HTMLAttributes<SVGSVGElement>, SVGSVGElement>;
9
- export declare type ImgProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLImageElement>, HTMLImageElement>;
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.2.0",
4
- "description": "ui kit for lobehub",
3
+ "version": "1.3.0",
4
+ "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
- "npm",
7
- "template"
6
+ "lobehub",
7
+ "components",
8
+ "chatbot components",
9
+ "react components",
10
+ "react ui"
8
11
  ],
9
12
  "homepage": "https://github.com/lobehub/lobe-ui",
10
13
  "bugs": {
@@ -60,6 +63,7 @@
60
63
  ]
61
64
  },
62
65
  "dependencies": {
66
+ "@ant-design/icons": "^5",
63
67
  "@babel/runtime": "^7",
64
68
  "ahooks": "^3",
65
69
  "antd-style": "^3",
@@ -69,14 +73,18 @@
69
73
  "lodash": "^4",
70
74
  "lucide-react": "latest",
71
75
  "polished": "^4",
76
+ "prism-react-renderer": "^2",
72
77
  "re-resizable": "^6",
73
78
  "react-layout-kit": "^1",
79
+ "react-markdown": "^8",
74
80
  "react-rnd": "^10",
81
+ "shiki-es": "^0.2",
75
82
  "styled-components": "^6.0.0-rc.1",
76
83
  "use-merge-value": "^1",
77
84
  "zustand": "^4"
78
85
  },
79
86
  "devDependencies": {
87
+ "@ant-design/colors": "^7",
80
88
  "@commitlint/cli": "^17",
81
89
  "@testing-library/react": "^14",
82
90
  "@types/chroma-js": "^2",
@@ -1,3 +0,0 @@
1
- import { AliasToken } from 'antd/es/theme/interface';
2
- export declare const darkToken: Partial<AliasToken>;
3
- export declare const lightToken: Partial<AliasToken>;
@@ -1,45 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- export var darkToken = {
5
- colorTextLightSolid: '#000000',
6
- colorBgLayout: '#000000',
7
- colorBgContainer: '#111111',
8
- colorBgElevated: '#222222',
9
- colorBgSpotlight: '#444444',
10
- colorBorder: '#333333',
11
- colorBorderSecondary: '#333333',
12
- colorText: '#ffffff',
13
- colorTextSecondary: '#999999',
14
- colorTextTertiary: '#888888',
15
- colorTextQuaternary: '#666666',
16
- colorPrimary: '#ffffff',
17
- colorInfo: '#0070f3',
18
- colorSuccess: '#50e3c2',
19
- colorWarning: '#f5a623',
20
- colorError: '#ee0000',
21
- colorFillQuaternary: 'rgba(0,0,0,0)',
22
- borderRadius: 5,
23
- borderRadiusXS: 3,
24
- borderRadiusSM: 3,
25
- borderRadiusLG: 8,
26
- controlHeight: 36,
27
- boxShadow: '0 12px 20px 6px rgb(0 0 0 / 0.08)',
28
- boxShadowSecondary: '0 2px 8px 2px rgb(0 0 0 / 0.07), 0 2px 4px -1px rgb(0 0 0 / 0.04)'
29
- };
30
- export var lightToken = _objectSpread(_objectSpread({}, darkToken), {}, {
31
- colorTextLightSolid: '#ffffff',
32
- colorBgLayout: '#ffffff',
33
- colorBgContainer: '#fafafa',
34
- colorBgElevated: '#f2f2f2',
35
- colorBgSpotlight: '#999999',
36
- colorBorder: '#eaeaea',
37
- colorBorderSecondary: '#eaeaea',
38
- colorText: '#000000',
39
- colorTextSecondary: '#444444',
40
- colorTextTertiary: '#666666',
41
- colorTextQuaternary: '#888888',
42
- colorPrimary: '#000000',
43
- boxShadow: '0 12px 20px 6px rgb(104 112 118 / 0.08)',
44
- boxShadowSecondary: '0 2px 8px 2px rgb(104 112 118 / 0.07), 0 2px 4px -1px rgb(104 112 118 / 0.04)'
45
- });
package/es/types/index.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import { AliasToken } from 'antd/es/theme/interface';
2
- export declare const darkToken: Partial<AliasToken>;
3
- export declare const lightToken: Partial<AliasToken>;
@@ -1,73 +0,0 @@
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/ThemeProvider/token.ts
20
- var token_exports = {};
21
- __export(token_exports, {
22
- darkToken: () => darkToken,
23
- lightToken: () => lightToken
24
- });
25
- module.exports = __toCommonJS(token_exports);
26
- var darkToken = {
27
- colorTextLightSolid: "#000000",
28
- colorBgLayout: "#000000",
29
- colorBgContainer: "#111111",
30
- colorBgElevated: "#222222",
31
- colorBgSpotlight: "#444444",
32
- colorBorder: "#333333",
33
- colorBorderSecondary: "#333333",
34
- colorText: "#ffffff",
35
- colorTextSecondary: "#999999",
36
- colorTextTertiary: "#888888",
37
- colorTextQuaternary: "#666666",
38
- colorPrimary: "#ffffff",
39
- colorInfo: "#0070f3",
40
- colorSuccess: "#50e3c2",
41
- colorWarning: "#f5a623",
42
- colorError: "#ee0000",
43
- colorFillQuaternary: "rgba(0,0,0,0)",
44
- borderRadius: 5,
45
- borderRadiusXS: 3,
46
- borderRadiusSM: 3,
47
- borderRadiusLG: 8,
48
- controlHeight: 36,
49
- boxShadow: "0 12px 20px 6px rgb(0 0 0 / 0.08)",
50
- boxShadowSecondary: "0 2px 8px 2px rgb(0 0 0 / 0.07), 0 2px 4px -1px rgb(0 0 0 / 0.04)"
51
- };
52
- var lightToken = {
53
- ...darkToken,
54
- colorTextLightSolid: "#ffffff",
55
- colorBgLayout: "#ffffff",
56
- colorBgContainer: "#fafafa",
57
- colorBgElevated: "#f2f2f2",
58
- colorBgSpotlight: "#999999",
59
- colorBorder: "#eaeaea",
60
- colorBorderSecondary: "#eaeaea",
61
- colorText: "#000000",
62
- colorTextSecondary: "#444444",
63
- colorTextTertiary: "#666666",
64
- colorTextQuaternary: "#888888",
65
- colorPrimary: "#000000",
66
- boxShadow: "0 12px 20px 6px rgb(104 112 118 / 0.08)",
67
- boxShadowSecondary: "0 2px 8px 2px rgb(104 112 118 / 0.07), 0 2px 4px -1px rgb(104 112 118 / 0.04)"
68
- };
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- darkToken,
72
- lightToken
73
- });
@@ -1,17 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
-
15
- // src/types/index.ts
16
- var types_exports = {};
17
- module.exports = __toCommonJS(types_exports);