@lobehub/ui 1.11.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 (91) hide show
  1. package/lib/ActionIcon/index.js +77 -79
  2. package/lib/ActionIcon/style.js +17 -61
  3. package/lib/Avatar/index.js +62 -67
  4. package/lib/Chat/const.js +6 -27
  5. package/lib/Chat/index.js +24 -28
  6. package/lib/Chat/store/index.js +46 -40
  7. package/lib/Chat/store/initialState.js +6 -27
  8. package/lib/Chat/store/messageReducer.js +51 -58
  9. package/lib/Chat/store/selectors.js +44 -46
  10. package/lib/Chat/store/store.js +242 -115
  11. package/lib/Chat/types.js +4 -16
  12. package/lib/Chat/utils/fetch.js +104 -68
  13. package/lib/ContextMenu/MenuItem/icons.js +48 -66
  14. package/lib/ContextMenu/MenuItem/index.js +73 -66
  15. package/lib/ContextMenu/MenuItem/style.js +19 -89
  16. package/lib/ContextMenu/index.js +194 -178
  17. package/lib/ContextMenu/style.js +17 -85
  18. package/lib/ContextMenu/types/index.js +15 -18
  19. package/lib/ContextMenu/types/menuItem.js +4 -16
  20. package/lib/Conversation/App.js +47 -50
  21. package/lib/Conversation/ChatList/MessageItem/Content.js +98 -93
  22. package/lib/Conversation/ChatList/MessageItem/Toolbar.js +94 -104
  23. package/lib/Conversation/ChatList/MessageItem/index.js +125 -157
  24. package/lib/Conversation/ChatList/index.js +64 -58
  25. package/lib/Conversation/InputArea/ActionBar.js +74 -92
  26. package/lib/Conversation/InputArea/index.js +103 -142
  27. package/lib/Conversation/StoreUpdater.js +28 -48
  28. package/lib/Conversation/index.js +30 -42
  29. package/lib/CopyButton/index.js +37 -62
  30. package/lib/DraggablePanel/index.js +192 -207
  31. package/lib/DraggablePanel/style.js +30 -278
  32. package/lib/DraggablePanel/utils.js +14 -35
  33. package/lib/EditableMessage/index.js +66 -89
  34. package/lib/EditableMessageList/index.js +97 -112
  35. package/lib/EditableText/index.js +36 -49
  36. package/lib/Highlighter/SyntaxHighlighter/Prism.js +43 -38
  37. package/lib/Highlighter/SyntaxHighlighter/index.js +62 -53
  38. package/lib/Highlighter/SyntaxHighlighter/style.js +18 -56
  39. package/lib/Highlighter/index.js +52 -58
  40. package/lib/Highlighter/style.js +22 -101
  41. package/lib/Icon/index.js +29 -36
  42. package/lib/Input/index.js +45 -43
  43. package/lib/Input/style.js +17 -67
  44. package/lib/List/ListItem/index.js +108 -150
  45. package/lib/List/ListItem/time.js +15 -47
  46. package/lib/List/index.js +9 -37
  47. package/lib/Logo/Divider.js +21 -34
  48. package/lib/Logo/Logo3D.js +17 -33
  49. package/lib/Logo/LogoFlat.js +108 -118
  50. package/lib/Logo/LogoHighContrast.js +30 -33
  51. package/lib/Logo/LogoText.js +21 -34
  52. package/lib/Logo/index.js +97 -59
  53. package/lib/Logo/style.js +13 -36
  54. package/lib/Markdown/Code.js +16 -30
  55. package/lib/Markdown/CodeBlock.js +33 -65
  56. package/lib/Markdown/index.js +35 -54
  57. package/lib/Markdown/style.js +15 -129
  58. package/lib/MessageInput/index.js +60 -56
  59. package/lib/MessageModal/index.js +80 -91
  60. package/lib/SearchBar/index.js +86 -73
  61. package/lib/SearchBar/style.js +18 -46
  62. package/lib/SideNav/index.js +43 -31
  63. package/lib/SideNav/style.js +13 -43
  64. package/lib/Snippet/index.js +42 -45
  65. package/lib/Snippet/style.js +13 -71
  66. package/lib/StroyBook/index.js +60 -61
  67. package/lib/StroyBook/style.js +19 -87
  68. package/lib/Swatches/index.js +35 -53
  69. package/lib/TabsNav/index.js +23 -31
  70. package/lib/TabsNav/style.js +17 -60
  71. package/lib/ThemeProvider/GlobalStyle.js +29 -92
  72. package/lib/ThemeProvider/index.js +43 -57
  73. package/lib/ThemeSwitch/index.js +62 -46
  74. package/lib/Tooltip/index.js +26 -31
  75. package/lib/Tooltip/style.js +13 -49
  76. package/lib/components/ControlInput.js +86 -87
  77. package/lib/hooks/useCopied.js +27 -37
  78. package/lib/hooks/useHighlight.js +65 -70
  79. package/lib/index.js +211 -120
  80. package/lib/styles/algorithms/generateColorPalette.js +28 -60
  81. package/lib/styles/algorithms/generateCustomStylish.js +22 -117
  82. package/lib/styles/algorithms/generateCustomToken.js +51 -65
  83. package/lib/styles/algorithms/generateTheme.js +22 -53
  84. package/lib/styles/colors.js +121 -1766
  85. package/lib/styles/index.js +23 -32
  86. package/lib/styles/theme/base.js +11 -32
  87. package/lib/styles/theme/dark.js +38 -62
  88. package/lib/styles/theme/light.js +38 -62
  89. package/lib/types/index.js +4 -16
  90. package/lib/utils/colorUtils.js +14 -48
  91. package/package.json +1 -1
@@ -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,60 +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_styles = require("../styles");
36
- var import_antd = require("antd");
37
- var import_antd_style = require("antd-style");
38
- var import_react = require("react");
39
- var import_react_font_loader = __toESM(require("react-font-loader"));
40
- var import_styled_components = require("styled-components");
41
- var import_GlobalStyle = __toESM(require("./GlobalStyle"));
42
- var ThemeProvider = (0, import_react.memo)(({ children, themeMode }) => {
43
- (0, import_antd_style.setupStyled)({ ThemeContext: import_styled_components.ThemeContext });
44
- return /* @__PURE__ */ React.createElement(import_antd_style.StyleProvider, { speedy: process.env.NODE_ENV === "production" }, /* @__PURE__ */ React.createElement(
45
- import_antd_style.ThemeProvider,
46
- {
47
- themeMode,
48
- theme: import_styles.lobeTheme,
49
- customStylish: import_styles.lobeCustomStylish,
50
- customToken: import_styles.lobeCustomToken
51
- },
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)
56
- ));
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
+ });
57
44
  });
58
- var ThemeProvider_default = ThemeProvider;
59
- // Annotate the CommonJS export names for ESM import in node:
60
- 0 && (module.exports = {});
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;
@@ -1,34 +1,29 @@
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/Tooltip/index.tsx
20
- var Tooltip_exports = {};
21
- __export(Tooltip_exports, {
22
- default: () => Tooltip_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(Tooltip_exports);
25
- var import_antd = require("antd");
26
- var import_react = require("react");
27
- var import_style = require("./style");
28
- var Tooltip = (0, import_react.memo)(({ className, arrow = false, ...props }) => {
29
- const { styles, cx } = (0, import_style.useStyles)();
30
- return /* @__PURE__ */ React.createElement(import_antd.Tooltip, { overlayClassName: cx(styles.tooltip, className), arrow, ...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", "arrow"];
15
+ var Tooltip = /*#__PURE__*/(0, _react.memo)(function (_ref) {
16
+ var className = _ref.className,
17
+ _ref$arrow = _ref.arrow,
18
+ arrow = _ref$arrow === void 0 ? false : _ref$arrow,
19
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
+ var _useStyles = (0, _style.useStyles)(),
21
+ styles = _useStyles.styles,
22
+ cx = _useStyles.cx;
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)({
24
+ overlayClassName: cx(styles.tooltip, className),
25
+ arrow: arrow
26
+ }, props));
31
27
  });
32
- var Tooltip_default = Tooltip;
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {});
28
+ var _default = Tooltip;
29
+ exports.default = _default;