@lobehub/ui 1.10.0 → 1.11.1

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 (161) hide show
  1. package/es/ActionIcon/style.js +1 -1
  2. package/es/Highlighter/style.js +1 -2
  3. package/es/Input/index.js +7 -5
  4. package/es/Input/style.js +2 -3
  5. package/es/Markdown/style.js +1 -1
  6. package/es/SearchBar/index.js +2 -1
  7. package/es/Snippet/style.js +1 -2
  8. package/es/StroyBook/style.js +1 -1
  9. package/es/ThemeProvider/index.d.ts +2 -6
  10. package/es/ThemeProvider/index.js +8 -18
  11. package/es/styles/algorithms/generateColorPalette.d.ts +11 -0
  12. package/es/styles/algorithms/generateColorPalette.js +31 -0
  13. package/es/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  14. package/es/styles/{customStylish.js → algorithms/generateCustomStylish.js} +1 -1
  15. package/es/styles/algorithms/generateCustomToken.d.ts +3 -0
  16. package/es/styles/algorithms/generateCustomToken.js +57 -0
  17. package/es/styles/algorithms/generateTheme.d.ts +5 -0
  18. package/es/styles/algorithms/generateTheme.js +18 -0
  19. package/es/styles/colors.d.ts +38 -0
  20. package/es/styles/colors.js +176 -0
  21. package/es/styles/index.d.ts +3 -3
  22. package/es/styles/index.js +3 -3
  23. package/es/styles/theme/base.d.ts +2 -2
  24. package/es/styles/theme/base.js +8 -14
  25. package/es/styles/theme/dark.d.ts +3 -4
  26. package/es/styles/theme/dark.js +40 -71
  27. package/es/styles/theme/light.d.ts +3 -4
  28. package/es/styles/theme/light.js +41 -32
  29. package/es/types/customToken.d.ts +1027 -0
  30. package/es/types/global.d.ts +12 -0
  31. package/es/types/index.d.ts +5 -28
  32. package/es/types/index.js +1 -0
  33. package/lib/ActionIcon/index.js +77 -79
  34. package/lib/ActionIcon/style.js +17 -61
  35. package/lib/Avatar/index.js +62 -67
  36. package/lib/Chat/const.js +6 -27
  37. package/lib/Chat/index.js +24 -28
  38. package/lib/Chat/store/index.js +46 -40
  39. package/lib/Chat/store/initialState.js +6 -27
  40. package/lib/Chat/store/messageReducer.js +51 -58
  41. package/lib/Chat/store/selectors.js +44 -46
  42. package/lib/Chat/store/store.js +242 -115
  43. package/lib/Chat/types.js +4 -16
  44. package/lib/Chat/utils/fetch.js +104 -68
  45. package/lib/ContextMenu/MenuItem/icons.js +48 -66
  46. package/lib/ContextMenu/MenuItem/index.js +73 -66
  47. package/lib/ContextMenu/MenuItem/style.js +19 -89
  48. package/lib/ContextMenu/index.js +194 -178
  49. package/lib/ContextMenu/style.js +17 -85
  50. package/lib/ContextMenu/types/index.js +15 -18
  51. package/lib/ContextMenu/types/menuItem.js +4 -16
  52. package/lib/Conversation/App.js +47 -50
  53. package/lib/Conversation/ChatList/MessageItem/Content.js +98 -93
  54. package/lib/Conversation/ChatList/MessageItem/Toolbar.js +94 -104
  55. package/lib/Conversation/ChatList/MessageItem/index.js +125 -157
  56. package/lib/Conversation/ChatList/index.js +64 -58
  57. package/lib/Conversation/InputArea/ActionBar.js +74 -92
  58. package/lib/Conversation/InputArea/index.js +103 -142
  59. package/lib/Conversation/StoreUpdater.js +28 -48
  60. package/lib/Conversation/index.js +30 -42
  61. package/lib/CopyButton/index.js +37 -62
  62. package/lib/DraggablePanel/index.js +192 -207
  63. package/lib/DraggablePanel/style.js +30 -278
  64. package/lib/DraggablePanel/utils.js +14 -35
  65. package/lib/EditableMessage/index.js +66 -89
  66. package/lib/EditableMessageList/index.js +97 -112
  67. package/lib/EditableText/index.js +36 -49
  68. package/lib/Highlighter/SyntaxHighlighter/Prism.js +43 -38
  69. package/lib/Highlighter/SyntaxHighlighter/index.js +62 -53
  70. package/lib/Highlighter/SyntaxHighlighter/style.js +18 -56
  71. package/lib/Highlighter/index.js +52 -58
  72. package/lib/Highlighter/style.js +22 -102
  73. package/lib/Icon/index.js +29 -36
  74. package/lib/Input/index.js +45 -39
  75. package/lib/Input/style.js +17 -68
  76. package/lib/List/ListItem/index.js +108 -150
  77. package/lib/List/ListItem/time.js +15 -47
  78. package/lib/List/index.js +9 -37
  79. package/lib/Logo/Divider.js +21 -34
  80. package/lib/Logo/Logo3D.js +17 -33
  81. package/lib/Logo/LogoFlat.js +108 -118
  82. package/lib/Logo/LogoHighContrast.js +30 -33
  83. package/lib/Logo/LogoText.js +21 -34
  84. package/lib/Logo/index.js +97 -59
  85. package/lib/Logo/style.js +13 -36
  86. package/lib/Markdown/Code.js +16 -30
  87. package/lib/Markdown/CodeBlock.js +33 -65
  88. package/lib/Markdown/index.js +35 -54
  89. package/lib/Markdown/style.js +15 -125
  90. package/lib/MessageInput/index.js +60 -56
  91. package/lib/MessageModal/index.js +80 -91
  92. package/lib/SearchBar/index.js +86 -72
  93. package/lib/SearchBar/style.js +18 -46
  94. package/lib/SideNav/index.js +43 -31
  95. package/lib/SideNav/style.js +13 -43
  96. package/lib/Snippet/index.js +42 -45
  97. package/lib/Snippet/style.js +13 -72
  98. package/lib/StroyBook/index.js +60 -61
  99. package/lib/StroyBook/style.js +19 -87
  100. package/lib/Swatches/index.js +35 -53
  101. package/lib/TabsNav/index.js +23 -31
  102. package/lib/TabsNav/style.js +17 -60
  103. package/lib/ThemeProvider/GlobalStyle.js +29 -92
  104. package/lib/ThemeProvider/index.d.ts +2 -6
  105. package/lib/ThemeProvider/index.js +44 -69
  106. package/lib/ThemeSwitch/index.js +62 -46
  107. package/lib/Tooltip/index.js +26 -31
  108. package/lib/Tooltip/style.js +13 -49
  109. package/lib/components/ControlInput.js +86 -87
  110. package/lib/hooks/useCopied.js +27 -37
  111. package/lib/hooks/useHighlight.js +65 -70
  112. package/lib/index.js +211 -120
  113. package/lib/styles/algorithms/generateColorPalette.d.ts +11 -0
  114. package/lib/styles/algorithms/generateColorPalette.js +40 -0
  115. package/lib/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  116. package/lib/styles/algorithms/generateCustomStylish.js +27 -0
  117. package/lib/styles/algorithms/generateCustomToken.d.ts +3 -0
  118. package/lib/styles/algorithms/generateCustomToken.js +65 -0
  119. package/lib/styles/algorithms/generateTheme.d.ts +5 -0
  120. package/lib/styles/algorithms/generateTheme.js +28 -0
  121. package/lib/styles/colors.d.ts +38 -0
  122. package/lib/styles/colors.js +183 -0
  123. package/lib/styles/index.d.ts +3 -3
  124. package/lib/styles/index.js +25 -20
  125. package/lib/styles/theme/base.d.ts +2 -2
  126. package/lib/styles/theme/base.js +17 -44
  127. package/lib/styles/theme/dark.d.ts +3 -4
  128. package/lib/styles/theme/dark.js +45 -119
  129. package/lib/styles/theme/light.d.ts +3 -4
  130. package/lib/styles/theme/light.js +47 -61
  131. package/lib/types/customToken.d.ts +1027 -0
  132. package/lib/types/global.d.ts +12 -0
  133. package/lib/types/index.d.ts +5 -28
  134. package/lib/types/index.js +5 -0
  135. package/lib/utils/colorUtils.js +14 -48
  136. package/package.json +1 -1
  137. package/es/styles/algorithms/colorRelationship.d.ts +0 -6
  138. package/es/styles/algorithms/colorRelationship.js +0 -88
  139. package/es/styles/algorithms/index.d.ts +0 -15
  140. package/es/styles/algorithms/index.js +0 -66
  141. package/es/styles/algorithms/paletteGenerator.d.ts +0 -51
  142. package/es/styles/algorithms/paletteGenerator.js +0 -74
  143. package/es/styles/antdTheme.d.ts +0 -2
  144. package/es/styles/antdTheme.js +0 -4
  145. package/es/styles/customToken.d.ts +0 -65
  146. package/es/styles/customToken.js +0 -24
  147. package/es/styles/theme/index.d.ts +0 -2
  148. package/es/styles/theme/index.js +0 -2
  149. package/lib/styles/algorithms/colorRelationship.d.ts +0 -6
  150. package/lib/styles/algorithms/colorRelationship.js +0 -87
  151. package/lib/styles/algorithms/index.d.ts +0 -15
  152. package/lib/styles/algorithms/index.js +0 -81
  153. package/lib/styles/algorithms/paletteGenerator.d.ts +0 -51
  154. package/lib/styles/algorithms/paletteGenerator.js +0 -91
  155. package/lib/styles/antdTheme.d.ts +0 -2
  156. package/lib/styles/antdTheme.js +0 -30
  157. package/lib/styles/customStylish.js +0 -118
  158. package/lib/styles/customToken.d.ts +0 -65
  159. package/lib/styles/customToken.js +0 -54
  160. package/lib/styles/theme/index.d.ts +0 -2
  161. package/lib/styles/theme/index.js +0 -32
@@ -1,68 +1,50 @@
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);
1
+ "use strict";
18
2
 
19
- // src/Swatches/index.tsx
20
- var Swatches_exports = {};
21
- __export(Swatches_exports, {
22
- default: () => Swatches_default
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
23
5
  });
24
- module.exports = __toCommonJS(Swatches_exports);
25
- var import_antd_style = require("antd-style");
26
- var import_react = require("react");
27
- var import_react_layout_kit = require("react-layout-kit");
28
- var Swatches = (0, import_react.memo)(({ colors, activeColor, onSelect }) => {
29
- const theme = (0, import_antd_style.useTheme)();
30
- return /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, gap: 8 }, /* @__PURE__ */ React.createElement(
31
- import_react_layout_kit.Flexbox,
32
- {
6
+ exports.default = void 0;
7
+ var _antdStyle = require("antd-style");
8
+ var _react = require("react");
9
+ var _reactLayoutKit = require("react-layout-kit");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ var Swatches = /*#__PURE__*/(0, _react.memo)(function (_ref) {
12
+ var colors = _ref.colors,
13
+ activeColor = _ref.activeColor,
14
+ onSelect = _ref.onSelect;
15
+ var theme = (0, _antdStyle.useTheme)();
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactLayoutKit.Flexbox, {
17
+ horizontal: true,
18
+ gap: 8,
19
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
33
20
  style: {
34
21
  width: 24,
35
22
  height: 24,
36
23
  background: theme.colorBgContainer,
37
- boxShadow: `inset 0 0 0px 2px ${!activeColor ? theme.colorPrimary : "rgba(0,0,0,0.1)"}`,
38
- borderRadius: "50%",
39
- cursor: "pointer"
24
+ boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
25
+ borderRadius: '50%',
26
+ cursor: 'pointer'
40
27
  },
41
- onClick: () => {
42
- onSelect == null ? void 0 : onSelect(null);
28
+ onClick: function onClick() {
29
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
43
30
  }
44
- }
45
- ), colors.map((c) => {
46
- const borderColor = c === activeColor ? theme.colorPrimary : "rgba(0,0,0,0.1)";
47
- return /* @__PURE__ */ React.createElement(
48
- import_react_layout_kit.Flexbox,
49
- {
50
- key: c,
31
+ }), colors.map(function (c) {
32
+ var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
51
34
  style: {
52
35
  width: 24,
53
36
  height: 24,
54
37
  background: c,
55
- boxShadow: `inset 0 0 0px 2px ${borderColor}`,
56
- borderRadius: "50%",
57
- cursor: "pointer"
38
+ boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
39
+ borderRadius: '50%',
40
+ cursor: 'pointer'
58
41
  },
59
- onClick: () => {
60
- onSelect == null ? void 0 : onSelect(c);
42
+ onClick: function onClick() {
43
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
61
44
  }
62
- }
63
- );
64
- }));
45
+ }, c);
46
+ })]
47
+ });
65
48
  });
66
- var Swatches_default = Swatches;
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {});
49
+ var _default = Swatches;
50
+ exports.default = _default;
@@ -1,34 +1,26 @@
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);
1
+ "use strict";
18
2
 
19
- // src/TabsNav/index.tsx
20
- var TabsNav_exports = {};
21
- __export(TabsNav_exports, {
22
- default: () => TabsNav_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(TabsNav_exports);
25
- var import_antd = require("antd");
26
- var import_react = require("react");
27
- var import_style = require("./style");
28
- var TabsNav = (0, import_react.memo)(({ className, ...props }) => {
29
- const { styles, cx } = (0, import_style.useStyles)();
30
- return /* @__PURE__ */ React.createElement(import_antd.Tabs, { className: cx(styles.tabs, className), ...props });
7
+ exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _antd = require("antd");
11
+ var _react = require("react");
12
+ var _style = require("./style");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ var _excluded = ["className"];
15
+ var TabsNav = /*#__PURE__*/(0, _react.memo)(function (_ref) {
16
+ var className = _ref.className,
17
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
18
+ var _useStyles = (0, _style.useStyles)(),
19
+ styles = _useStyles.styles,
20
+ cx = _useStyles.cx;
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, (0, _objectSpread2.default)({
22
+ className: cx(styles.tabs, className)
23
+ }, props));
31
24
  });
32
- var TabsNav_default = TabsNav;
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {});
25
+ var _default = TabsNav;
26
+ exports.default = _default;
@@ -1,65 +1,22 @@
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);
1
+ "use strict";
18
2
 
19
- // src/TabsNav/style.ts
20
- var style_exports = {};
21
- __export(style_exports, {
22
- useStyles: () => useStyles
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(style_exports);
25
- var import_antd_style = require("antd-style");
26
- var useStyles = (0, import_antd_style.createStyles)(({ css, token, prefixCls }) => {
27
- const prefix = `.${prefixCls}-tabs`;
28
- const marginHoriz = 16;
29
- const paddingVertical = 6;
7
+ exports.useStyles = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _antdStyle = require("antd-style");
10
+ var _templateObject;
11
+ var useStyles = (0, _antdStyle.createStyles)(function (_ref) {
12
+ var css = _ref.css,
13
+ token = _ref.token,
14
+ prefixCls = _ref.prefixCls;
15
+ var prefix = ".".concat(prefixCls, "-tabs");
16
+ var marginHoriz = 16;
17
+ var paddingVertical = 6;
30
18
  return {
31
- tabs: css`
32
- ${prefix}-tab + ${prefix}-tab {
33
- margin: ${marginHoriz}px 4px !important;
34
- padding: 0 12px !important;
35
- }
36
-
37
- ${prefix}-tab {
38
- color: ${token.colorTextSecondary};
39
- transition: background-color 100ms ease-out;
40
-
41
- &:first-child {
42
- margin: ${marginHoriz}px 4px ${marginHoriz}px 0;
43
- padding: ${paddingVertical}px 12px !important;
44
- }
45
-
46
- &:hover {
47
- color: ${token.colorText} !important;
48
- background: ${token.colorFillTertiary};
49
- border-radius: ${token.borderRadius}px;
50
- }
51
- }
52
-
53
- ${prefix}-nav {
54
- margin-bottom: 0;
55
- &::before {
56
- display: none;
57
- }
58
- }
59
- `
19
+ tabs: css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "-tab + ", "-tab {\n margin: ", "px 4px !important;\n padding: 0 12px !important;\n }\n\n ", "-tab {\n color: ", ";\n transition: background-color 100ms ease-out;\n\n &:first-child {\n margin: ", "px 4px ", "px 0;\n padding: ", "px 12px !important;\n }\n\n &:hover {\n color: ", " !important;\n background: ", ";\n border-radius: ", "px;\n }\n }\n\n ", "-nav {\n margin-bottom: 0;\n &::before {\n display: none;\n }\n }\n "])), prefix, prefix, marginHoriz, prefix, token.colorTextSecondary, marginHoriz, marginHoriz, paddingVertical, token.colorText, token.colorFillTertiary, token.borderRadius, prefix)
60
20
  };
61
21
  });
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- useStyles
65
- });
22
+ exports.useStyles = useStyles;
@@ -1,94 +1,31 @@
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);
1
+ "use strict";
18
2
 
19
- // src/ThemeProvider/GlobalStyle.ts
20
- var GlobalStyle_exports = {};
21
- __export(GlobalStyle_exports, {
22
- default: () => GlobalStyle_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(GlobalStyle_exports);
25
- var import_antd_style = require("antd-style");
26
- var GlobalStyle = import_antd_style.createGlobalStyle`
27
-
28
- html,body {
29
- --font-settings: "cv01", "tnum", "kern";
30
- --font-variations: "opsz" auto, tabular-nums;
31
-
32
- overflow-x: hidden;
33
-
34
- margin: 0;
35
- padding: 0;
36
-
37
- font-family: ${({ theme }) => theme.fontFamily};
38
- font-size: ${({ theme }) => theme.fontSize}px;
39
- font-feature-settings: var(--font-settings);
40
- font-variation-settings: var(--font-variations);
41
- line-height: 1;
42
- color: ${({ theme }) => theme.colorTextBase};
43
- text-size-adjust: none;
44
- text-rendering: optimizelegibility;
45
- vertical-align: baseline;
46
-
47
- color-scheme: dark;
48
- background-color: ${({ theme }) => theme.colorBgLayout};
49
-
50
- -webkit-font-smoothing: antialiased;
51
- -moz-osx-font-smoothing: grayscale;
52
- -webkit-tap-highlight-color: transparent;
53
- }
54
-
55
-
56
- * {
57
- box-sizing: border-box;
58
- vertical-align: baseline;
59
- }
60
-
61
- #root {
62
- min-height: 100vh;
63
- }
64
-
65
- ::-webkit-scrollbar {
66
- width: 0;
67
- height: 4px;
68
- background-color: transparent;
69
-
70
- &-thumb {
71
- background-color: ${({ theme }) => theme.colorFill};
72
- border-radius: 4px;
73
- }
74
-
75
- &-corner {
76
- display: none;
77
- }
78
- }
79
-
80
- p {
81
- text-align: justify;
82
- word-wrap: break-word;
83
- }
84
-
85
- code {
86
- font-family: ${({ theme }) => theme.fontFamilyCode} !important;
87
- * {
88
- font-family: inherit !important;
89
- }
90
- }
91
- `;
92
- var GlobalStyle_default = GlobalStyle;
93
- // Annotate the CommonJS export names for ESM import in node:
94
- 0 && (module.exports = {});
7
+ exports.default = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _antdStyle = require("antd-style");
10
+ var _templateObject;
11
+ var GlobalStyle = (0, _antdStyle.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n\n\n * {\n box-sizing: border-box;\n vertical-align: baseline;\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n }\n\n &-corner {\n display: none;\n }\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n code {\n\t font-family: ", " !important;\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n"])), function (_ref) {
12
+ var theme = _ref.theme;
13
+ return theme.fontFamily;
14
+ }, function (_ref2) {
15
+ var theme = _ref2.theme;
16
+ return theme.fontSize;
17
+ }, function (_ref3) {
18
+ var theme = _ref3.theme;
19
+ return theme.colorTextBase;
20
+ }, function (_ref4) {
21
+ var theme = _ref4.theme;
22
+ return theme.colorBgLayout;
23
+ }, function (_ref5) {
24
+ var theme = _ref5.theme;
25
+ return theme.colorFill;
26
+ }, function (_ref6) {
27
+ var theme = _ref6.theme;
28
+ return theme.fontFamilyCode;
29
+ });
30
+ var _default = GlobalStyle;
31
+ exports.default = _default;
@@ -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;
@@ -1,71 +1,46 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/ThemeProvider/index.tsx
30
- var ThemeProvider_exports = {};
31
- __export(ThemeProvider_exports, {
32
- default: () => ThemeProvider_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
33
6
  });
34
- module.exports = __toCommonJS(ThemeProvider_exports);
35
- var import_antd = require("antd");
36
- var import_antd_style = require("antd-style");
37
- var import_react = __toESM(require("react"));
38
- var import_react_font_loader = __toESM(require("react-font-loader"));
39
- var import_styled_components = require("styled-components");
40
- var import_styles = require("../styles");
41
- var import_GlobalStyle = __toESM(require("./GlobalStyle"));
42
- var ThemeProvider = ({ token, children, themeMode }) => {
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(
56
- import_antd_style.ThemeProvider,
57
- {
58
- themeMode,
59
- theme: import_styles.getAntdTheme,
60
- customStylish: import_styles.getCustomStylish,
61
- customToken: getCustomToken
62
- },
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)
67
- ));
68
- };
69
- var ThemeProvider_default = ThemeProvider;
70
- // Annotate the CommonJS export names for ESM import in node:
71
- 0 && (module.exports = {});
7
+ exports.default = void 0;
8
+ var _styles = require("../styles");
9
+ var _antd = require("antd");
10
+ var _antdStyle = require("antd-style");
11
+ var _react = require("react");
12
+ var _reactFontLoader = _interopRequireDefault(require("react-font-loader"));
13
+ var _styledComponents = require("styled-components");
14
+ var _GlobalStyle = _interopRequireDefault(require("./GlobalStyle"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ // @ts-ignore
17
+
18
+ var ThemeProvider = /*#__PURE__*/(0, _react.memo)(function (_ref) {
19
+ var children = _ref.children,
20
+ themeMode = _ref.themeMode;
21
+ (0, _antdStyle.setupStyled)({
22
+ ThemeContext: _styledComponents.ThemeContext
23
+ });
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdStyle.StyleProvider, {
25
+ speedy: process.env.NODE_ENV === 'production',
26
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antdStyle.ThemeProvider, {
27
+ themeMode: themeMode,
28
+ theme: _styles.lobeTheme,
29
+ customStylish: _styles.lobeCustomStylish,
30
+ customToken: _styles.lobeCustomToken,
31
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
32
+ url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
33
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
34
+ url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
35
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyle.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.App, {
36
+ style: {
37
+ minHeight: 'inherit',
38
+ width: 'inherit'
39
+ },
40
+ children: children
41
+ })]
42
+ })
43
+ });
44
+ });
45
+ var _default = ThemeProvider;
46
+ exports.default = _default;
@@ -1,50 +1,66 @@
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);
1
+ "use strict";
18
2
 
19
- // src/ThemeSwitch/index.tsx
20
- var ThemeSwitch_exports = {};
21
- __export(ThemeSwitch_exports, {
22
- default: () => ThemeSwitch_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(ThemeSwitch_exports);
25
- var import_ui = require("..");
26
- var import_antd = require("antd");
27
- var import_lucide_react = require("lucide-react");
28
- var import_react = require("react");
7
+ exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _ = require("./..");
11
+ var _antd = require("antd");
12
+ var _lucideReact = require("lucide-react");
13
+ var _react = require("react");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ var _excluded = ["size", "themeMode", "onThemeSwitch"];
29
16
  var icons = {
30
- auto: import_lucide_react.Monitor,
31
- light: import_lucide_react.Sun,
32
- dark: import_lucide_react.Moon
17
+ auto: _lucideReact.Monitor,
18
+ light: _lucideReact.Sun,
19
+ dark: _lucideReact.Moon
33
20
  };
34
- var items = [
35
- { label: "System", icon: /* @__PURE__ */ React.createElement(import_ui.Icon, { size: "small", icon: icons.auto }), key: "auto" },
36
- { label: "Light", icon: /* @__PURE__ */ React.createElement(import_ui.Icon, { size: "small", icon: icons.light }), key: "light" },
37
- { label: "Dark", icon: /* @__PURE__ */ React.createElement(import_ui.Icon, { size: "small", icon: icons.dark }), key: "dark" }
38
- ];
39
- var ThemeSwitch = (0, import_react.memo)(
40
- ({ size = "site", themeMode, onThemeSwitch, ...props }) => {
41
- const menuProps = {
42
- items,
43
- onClick: (e) => onThemeSwitch(e.key)
44
- };
45
- return /* @__PURE__ */ React.createElement(import_antd.Dropdown, { menu: menuProps, trigger: ["click"], ...props }, /* @__PURE__ */ React.createElement(import_ui.ActionIcon, { size, icon: icons[themeMode] }));
46
- }
47
- );
48
- var ThemeSwitch_default = ThemeSwitch;
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {});
21
+ var items = [{
22
+ label: 'System',
23
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
24
+ size: "small",
25
+ icon: icons.auto
26
+ }),
27
+ key: 'auto'
28
+ }, {
29
+ label: 'Light',
30
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
31
+ size: "small",
32
+ icon: icons.light
33
+ }),
34
+ key: 'light'
35
+ }, {
36
+ label: 'Dark',
37
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
38
+ size: "small",
39
+ icon: icons.dark
40
+ }),
41
+ key: 'dark'
42
+ }];
43
+ var ThemeSwitch = /*#__PURE__*/(0, _react.memo)(function (_ref) {
44
+ var _ref$size = _ref.size,
45
+ size = _ref$size === void 0 ? 'site' : _ref$size,
46
+ themeMode = _ref.themeMode,
47
+ onThemeSwitch = _ref.onThemeSwitch,
48
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
+ var menuProps = {
50
+ items: items,
51
+ onClick: function onClick(e) {
52
+ return onThemeSwitch(e.key);
53
+ }
54
+ };
55
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, (0, _objectSpread2.default)((0, _objectSpread2.default)({
56
+ menu: menuProps,
57
+ trigger: ['click']
58
+ }, props), {}, {
59
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionIcon, {
60
+ size: size,
61
+ icon: icons[themeMode]
62
+ })
63
+ }));
64
+ });
65
+ var _default = ThemeSwitch;
66
+ exports.default = _default;