@lobehub/ui 1.16.0 → 1.16.2

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 (107) hide show
  1. package/es/ActionIcon/index.d.ts +15 -15
  2. package/es/ActionIcon/index.js +7 -5
  3. package/es/ActionIcon/style.d.ts +1 -1
  4. package/es/ActionIcon/style.js +5 -3
  5. package/es/Avatar/index.d.ts +9 -9
  6. package/es/Avatar/index.js +3 -3
  7. package/es/Chat/store/initialState.d.ts +12 -12
  8. package/es/Chat/store/messageReducer.d.ts +12 -12
  9. package/es/Chat/store/store.d.ts +12 -12
  10. package/es/Chat/store/store.js +11 -9
  11. package/es/Chat/types.d.ts +14 -14
  12. package/es/Chat/utils/fetch.d.ts +1 -1
  13. package/es/Chat/utils/fetch.js +3 -3
  14. package/es/ColorScales/ScaleRow.d.ts +1 -1
  15. package/es/ColorScales/ScaleRow.js +3 -3
  16. package/es/ColorScales/index.d.ts +1 -1
  17. package/es/ColorScales/index.js +8 -8
  18. package/es/ContextMenu/MenuItem/icons.js +23 -23
  19. package/es/ContextMenu/MenuItem/index.d.ts +4 -4
  20. package/es/ContextMenu/MenuItem/index.js +6 -5
  21. package/es/ContextMenu/index.d.ts +4 -4
  22. package/es/ContextMenu/index.js +11 -17
  23. package/es/ContextMenu/types/menuItem.d.ts +3 -3
  24. package/es/Conversation/App.d.ts +5 -5
  25. package/es/Conversation/App.js +5 -5
  26. package/es/Conversation/ChatList/MessageItem/Content.js +13 -13
  27. package/es/Conversation/ChatList/MessageItem/Toolbar.d.ts +3 -3
  28. package/es/Conversation/ChatList/MessageItem/Toolbar.js +20 -23
  29. package/es/Conversation/ChatList/MessageItem/index.js +15 -15
  30. package/es/Conversation/ChatList/index.d.ts +4 -4
  31. package/es/Conversation/ChatList/index.js +8 -6
  32. package/es/Conversation/InputArea/ActionBar.js +7 -7
  33. package/es/Conversation/InputArea/index.js +17 -17
  34. package/es/Conversation/StoreUpdater.d.ts +1 -1
  35. package/es/Conversation/index.js +4 -2
  36. package/es/CopyButton/index.d.ts +10 -10
  37. package/es/CopyButton/index.js +10 -8
  38. package/es/DraggablePanel/index.d.ts +45 -44
  39. package/es/DraggablePanel/index.js +11 -10
  40. package/es/EditableMessage/index.d.ts +23 -23
  41. package/es/EditableMessage/index.js +15 -15
  42. package/es/EditableMessageList/index.d.ts +5 -5
  43. package/es/EditableMessageList/index.js +16 -16
  44. package/es/EditableText/index.js +9 -9
  45. package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +1 -1
  46. package/es/Highlighter/SyntaxHighlighter/Prism.js +4 -2
  47. package/es/Highlighter/SyntaxHighlighter/index.js +8 -8
  48. package/es/Highlighter/SyntaxHighlighter/style.d.ts +1 -1
  49. package/es/Highlighter/SyntaxHighlighter/style.js +3 -2
  50. package/es/Highlighter/index.d.ts +5 -5
  51. package/es/Highlighter/index.js +5 -5
  52. package/es/Icon/index.d.ts +6 -6
  53. package/es/Icon/index.js +3 -1
  54. package/es/Input/index.js +7 -5
  55. package/es/List/ListItem/index.d.ts +21 -21
  56. package/es/List/ListItem/index.js +13 -11
  57. package/es/List/ListItem/time.js +1 -1
  58. package/es/Logo/Divider.js +4 -2
  59. package/es/Logo/Logo3D.js +3 -1
  60. package/es/Logo/LogoFlat.js +46 -44
  61. package/es/Logo/LogoHighContrast.js +7 -5
  62. package/es/Logo/LogoText.js +6 -4
  63. package/es/Logo/index.d.ts +5 -5
  64. package/es/Logo/index.js +3 -1
  65. package/es/Markdown/Code.js +1 -1
  66. package/es/Markdown/CodeBlock.js +4 -4
  67. package/es/MessageInput/index.d.ts +10 -10
  68. package/es/MessageInput/index.js +12 -10
  69. package/es/MessageModal/index.d.ts +11 -11
  70. package/es/MessageModal/index.js +15 -15
  71. package/es/SearchBar/index.d.ts +5 -5
  72. package/es/SearchBar/index.js +19 -17
  73. package/es/SideNav/index.d.ts +5 -5
  74. package/es/SideNav/index.js +9 -7
  75. package/es/Snippet/index.d.ts +5 -5
  76. package/es/Snippet/index.js +5 -3
  77. package/es/StroyBook/index.d.ts +2 -2
  78. package/es/StroyBook/index.js +7 -5
  79. package/es/StroyBook/style.d.ts +1 -1
  80. package/es/Swatches/index.d.ts +4 -4
  81. package/es/Swatches/index.js +7 -7
  82. package/es/TabsNav/index.d.ts +6 -6
  83. package/es/TabsNav/index.js +3 -1
  84. package/es/ThemeProvider/GlobalStyle.js +5 -2
  85. package/es/ThemeProvider/index.d.ts +6 -6
  86. package/es/ThemeProvider/index.js +3 -3
  87. package/es/ThemeSwitch/index.d.ts +5 -5
  88. package/es/ThemeSwitch/index.js +11 -9
  89. package/es/Tooltip/index.js +5 -3
  90. package/es/components/ControlInput.d.ts +1 -1
  91. package/es/components/ControlInput.js +20 -18
  92. package/es/hooks/useHighlight.d.ts +8 -8
  93. package/es/hooks/useHighlight.js +4 -4
  94. package/es/styles/algorithms/generateColorPalette.d.ts +4 -4
  95. package/es/styles/algorithms/generateCustomStylish.d.ts +1 -1
  96. package/es/styles/algorithms/generateCustomStylish.js +1 -1
  97. package/es/styles/algorithms/generateCustomToken.d.ts +1 -1
  98. package/es/styles/algorithms/generateCustomToken.js +3 -2
  99. package/es/styles/algorithms/generateTheme.js +3 -1
  100. package/es/styles/colors.d.ts +13 -13
  101. package/es/styles/colors.js +1 -1
  102. package/es/styles/theme/dark.js +3 -1
  103. package/es/styles/theme/light.js +3 -1
  104. package/es/types/customStylish.d.ts +4 -4
  105. package/es/types/customToken.d.ts +5 -5
  106. package/es/types/global.d.ts +2 -0
  107. package/package.json +71 -68
@@ -1,10 +1,12 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import { TextArea } from "./..";
3
+ 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; }
4
+ 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
5
  import { Button } from 'antd';
5
6
  import { cx } from 'antd-style';
6
7
  import { memo, useState } from 'react';
7
8
  import { Flexbox } from 'react-layout-kit';
9
+ import { TextArea } from "./..";
8
10
 
9
11
  /**
10
12
  * @title MessageInputProps
@@ -29,16 +31,16 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
29
31
  return /*#__PURE__*/_jsxs(Flexbox, {
30
32
  gap: 8,
31
33
  children: [/*#__PURE__*/_jsx(TextArea, {
32
- type: type,
33
- value: tempSystemRole,
34
+ className: cx('nowheel', className),
35
+ onChange: function onChange(e) {
36
+ setRole(e.target.value);
37
+ },
34
38
  placeholder: '例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。',
35
39
  style: {
36
40
  height: height !== null && height !== void 0 ? height : 200
37
41
  },
38
- onChange: function onChange(e) {
39
- setRole(e.target.value);
40
- },
41
- className: cx('nowheel', className)
42
+ type: type,
43
+ value: tempSystemRole
42
44
  }), /*#__PURE__*/_jsx(Flexbox, {
43
45
  direction: 'horizontal-reverse',
44
46
  gap: 8,
@@ -46,14 +48,14 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
46
48
  return /*#__PURE__*/_jsx(Button, _objectSpread({}, buttonProps), index);
47
49
  }) : /*#__PURE__*/_jsxs(_Fragment, {
48
50
  children: [/*#__PURE__*/_jsx(Button, {
49
- type: "primary",
50
51
  onClick: function onClick() {
51
52
  onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(tempSystemRole);
52
53
  },
54
+ type: "primary",
53
55
  children: "Confirm"
54
56
  }), /*#__PURE__*/_jsx(Button, {
55
- type: "text",
56
57
  onClick: onCancel,
58
+ type: "text",
57
59
  children: "Cancel"
58
60
  })]
59
61
  })
@@ -1,27 +1,27 @@
1
1
  /// <reference types="react" />
2
2
  export interface MessageModalProps {
3
- /**
4
- * @description Whether the modal is open or not
5
- * @default false
6
- */
7
- open?: boolean;
8
- /**
9
- * @description Callback fired when open state is changed
10
- */
11
- onOpenChange?: (open: boolean) => void;
12
3
  /**
13
4
  * @description Whether the message is being edited or not
14
5
  * @default false
15
6
  */
16
7
  editing?: boolean;
8
+ /**
9
+ * @description Callback fired when message content is changed
10
+ */
11
+ onChange?: (text: string) => void;
17
12
  /**
18
13
  * @description Callback fired when editing state is changed
19
14
  */
20
15
  onEditingChange?: (editing: boolean) => void;
21
16
  /**
22
- * @description Callback fired when message content is changed
17
+ * @description Callback fired when open state is changed
23
18
  */
24
- onChange?: (text: string) => void;
19
+ onOpenChange?: (open: boolean) => void;
20
+ /**
21
+ * @description Whether the modal is open or not
22
+ * @default false
23
+ */
24
+ open?: boolean;
25
25
  /**
26
26
  * @description The value of the message content
27
27
  */
@@ -1,11 +1,11 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import Markdown from "../Markdown";
3
- import MessageInput from "../MessageInput";
4
2
  import { AimOutlined } from '@ant-design/icons';
5
3
  import { Modal } from 'antd';
6
4
  import { memo } from 'react';
7
5
  import { Flexbox } from 'react-layout-kit';
8
6
  import useControlledState from 'use-merge-value';
7
+ import Markdown from "../Markdown";
8
+ import MessageInput from "../MessageInput";
9
9
  import { useStyles } from "./style";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -33,34 +33,34 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
33
33
  expand = _useControlledState4[0],
34
34
  setExpand = _useControlledState4[1];
35
35
  return /*#__PURE__*/_jsx(Modal, {
36
- open: expand,
37
- width: 800,
36
+ cancelText: '关闭',
37
+ className: styles.modal,
38
+ footer: isEdit ? null : undefined,
39
+ okText: '编辑',
38
40
  onCancel: function onCancel() {
39
41
  return setExpand(false);
40
42
  },
41
- okText: '编辑',
42
43
  onOk: function onOk() {
43
44
  setTyping(true);
44
45
  },
45
- footer: isEdit ? null : undefined,
46
- cancelText: '关闭',
46
+ open: expand,
47
47
  title: /*#__PURE__*/_jsxs(Flexbox, {
48
- horizontal: true,
49
48
  align: 'center',
50
49
  gap: 4,
50
+ horizontal: true,
51
51
  children: [/*#__PURE__*/_jsx(AimOutlined, {}), "\u63D0\u793A\u8BCD"]
52
52
  }),
53
- className: styles.modal,
53
+ width: 800,
54
54
  children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
55
- onConfirm: function onConfirm(text) {
56
- setTyping(false);
57
- onChange === null || onChange === void 0 ? void 0 : onChange(text);
58
- },
55
+ defaultValue: value,
56
+ height: 400,
59
57
  onCancel: function onCancel() {
60
58
  return setTyping(false);
61
59
  },
62
- defaultValue: value,
63
- height: 400
60
+ onConfirm: function onConfirm(text) {
61
+ setTyping(false);
62
+ onChange === null || onChange === void 0 ? void 0 : onChange(text);
63
+ }
64
64
  }) : /*#__PURE__*/_jsx(Markdown, {
65
65
  className: styles.body,
66
66
  children: value
@@ -1,16 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from "../index";
3
3
  export interface SearchBarProps extends InputProps {
4
- /**
5
- * @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
6
- * @default 'f'
7
- */
8
- shortKey?: string;
9
4
  /**
10
5
  * @description Whether to enable the shortcut key to focus on the input
11
6
  * @default false
12
7
  */
13
8
  enableShortKey?: boolean;
9
+ /**
10
+ * @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
11
+ * @default 'f'
12
+ */
13
+ shortKey?: string;
14
14
  }
15
15
  declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
16
16
  export default SearchBar;
@@ -1,12 +1,14 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
5
5
  var _navigator;
6
- import { Icon, Input } from "./..";
6
+ 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; }
7
+ 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; }
7
8
  import { Tag } from 'antd';
8
9
  import { Search } from 'lucide-react';
9
10
  import { memo, useEffect, useRef, useState } from 'react';
11
+ import { Icon, Input } from "./..";
10
12
  import { useStyles } from "./style";
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -50,19 +52,11 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
50
52
  return /*#__PURE__*/_jsxs("div", {
51
53
  className: styles.search,
52
54
  children: [/*#__PURE__*/_jsx(Input, _objectSpread({
53
- ref: inputRef,
54
- className: cx(styles.input, className),
55
- prefix: /*#__PURE__*/_jsx(Icon, {
56
- className: styles.icon,
57
- icon: Search,
58
- size: "small",
59
- style: {
60
- marginRight: 4
61
- }
62
- }),
63
55
  allowClear: true,
64
- value: value,
65
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
56
+ className: cx(styles.input, className),
57
+ onBlur: function onBlur() {
58
+ return setShowTag(true);
59
+ },
66
60
  onChange: function onChange(e) {
67
61
  setInputValue(e.target.value);
68
62
  setShowTag(e.target.value ? false : true);
@@ -71,9 +65,17 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
71
65
  onFocus: function onFocus() {
72
66
  return setShowTag(false);
73
67
  },
74
- onBlur: function onBlur() {
75
- return setShowTag(true);
76
- }
68
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
69
+ prefix: /*#__PURE__*/_jsx(Icon, {
70
+ className: styles.icon,
71
+ icon: Search,
72
+ size: "small",
73
+ style: {
74
+ marginRight: 4
75
+ }
76
+ }),
77
+ ref: inputRef,
78
+ value: value
77
79
  }, props)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
78
80
  className: styles.tag,
79
81
  children: [symbol, " ", shortKey.toUpperCase()]
@@ -1,18 +1,18 @@
1
- import { DivProps } from "../types";
2
1
  import { ReactNode } from 'react';
2
+ import { DivProps } from "../types";
3
3
  export interface SideNavProps extends DivProps {
4
4
  /**
5
5
  * @description Avatar to be displayed at the top of the sidenav
6
6
  */
7
7
  avatar?: ReactNode;
8
- /**
9
- * @description Actions to be displayed below the avatar
10
- */
11
- topActions?: ReactNode;
12
8
  /**
13
9
  * @description Actions to be displayed at the bottom of the sidenav
14
10
  */
15
11
  bottomActions: ReactNode;
12
+ /**
13
+ * @description Actions to be displayed below the avatar
14
+ */
15
+ topActions?: ReactNode;
16
16
  }
17
17
  declare const SideNav: import("react").NamedExoticComponent<SideNavProps>;
18
18
  export default SideNav;
@@ -1,6 +1,8 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["className", "avatar", "topActions", "bottomActions"];
4
+ 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; }
5
+ 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
6
  import { Space } from 'antd';
5
7
  import { memo } from 'react';
6
8
  import { useStyles } from "./style";
@@ -19,19 +21,19 @@ var SideNav = /*#__PURE__*/memo(function (_ref) {
19
21
  className: cx(styles, className)
20
22
  }, props), {}, {
21
23
  children: [/*#__PURE__*/_jsxs(Space, {
22
- size: 16,
23
- direction: "vertical",
24
24
  align: "center",
25
+ direction: "vertical",
26
+ size: 16,
25
27
  children: [avatar, /*#__PURE__*/_jsx(Space, {
26
- size: 8,
27
- direction: "vertical",
28
28
  align: "center",
29
+ direction: "vertical",
30
+ size: 8,
29
31
  children: topActions
30
32
  })]
31
33
  }), /*#__PURE__*/_jsx(Space, {
32
- size: 4,
33
- direction: "vertical",
34
34
  align: "center",
35
+ direction: "vertical",
36
+ size: 4,
35
37
  children: bottomActions
36
38
  })]
37
39
  }));
@@ -6,19 +6,19 @@ export interface SnippetProps extends DivProps {
6
6
  */
7
7
  children: string;
8
8
  /**
9
- * @description The symbol to be displayed before the content inside the Snippet component
9
+ * @description Whether the Snippet component is copyable or not
10
+ * @default true
10
11
  */
11
- symbol?: string;
12
+ copyable?: boolean;
12
13
  /**
13
14
  * @description The language of the content inside the Snippet component
14
15
  * @default 'tsx'
15
16
  */
16
17
  language?: string;
17
18
  /**
18
- * @description Whether the Snippet component is copyable or not
19
- * @default true
19
+ * @description The symbol to be displayed before the content inside the Snippet component
20
20
  */
21
- copyable?: boolean;
21
+ symbol?: string;
22
22
  /**
23
23
  * @description The type of the Snippet component
24
24
  * @default 'ghost'
@@ -1,6 +1,8 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["symbol", "language", "children", "copyable", "type"];
4
+ 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; }
5
+ 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
6
  import { memo } from 'react';
5
7
  import CopyButton from "../CopyButton";
6
8
  import { SyntaxHighlighter } from "../Highlighter";
@@ -26,11 +28,11 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
26
28
  language: language,
27
29
  children: [symbol, children].filter(Boolean).join(' ')
28
30
  }), copyable && /*#__PURE__*/_jsx(CopyButton, {
31
+ content: children,
29
32
  size: {
30
33
  fontSize: 14,
31
34
  blockSize: 24
32
- },
33
- content: children
35
+ }
34
36
  })]
35
37
  }));
36
38
  });
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { DivProps } from "../types";
3
2
  import { useControls, useCreateStore } from 'leva';
4
- export { useCreateStore, useControls };
3
+ import { DivProps } from "../types";
4
+ export { useControls, useCreateStore };
5
5
  export interface StroyBookProps extends DivProps {
6
6
  /**
7
7
  * @description The Leva store instance to be used by the component
@@ -1,6 +1,8 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["levaStore", "noPadding", "className", "children"];
4
+ 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; }
5
+ 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
6
  import { useResponsive } from 'antd-style';
5
7
  import { LevaPanel, useControls, useCreateStore } from 'leva';
6
8
  import { memo } from 'react';
@@ -8,7 +10,7 @@ import DraggablePanel from "../DraggablePanel";
8
10
  import { useStyles } from "./style";
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
10
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
- export { useCreateStore, useControls };
13
+ export { useControls, useCreateStore };
12
14
  export var StroyBook = /*#__PURE__*/memo(function (_ref) {
13
15
  var levaStore = _ref.levaStore,
14
16
  noPadding = _ref.noPadding,
@@ -31,15 +33,15 @@ export var StroyBook = /*#__PURE__*/memo(function (_ref) {
31
33
  children: children
32
34
  }), /*#__PURE__*/_jsx(DraggablePanel, {
33
35
  className: styles.right,
34
- placement: mobile ? 'bottom' : 'right',
35
36
  minWidth: 280,
37
+ placement: mobile ? 'bottom' : 'right',
36
38
  children: /*#__PURE__*/_jsxs("div", {
37
39
  className: styles.leva,
38
40
  children: [/*#__PURE__*/_jsx(LevaPanel, {
39
41
  fill: true,
42
+ flat: true,
40
43
  store: levaStore,
41
- titleBar: false,
42
- flat: true
44
+ titleBar: false
43
45
  }), ' ']
44
46
  })
45
47
  })]
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: {
2
- noPadding: boolean;
3
2
  mobile: boolean;
3
+ noPadding: boolean;
4
4
  } | undefined) => import("antd-style").ReturnStyles<{
5
5
  editor: import("antd-style").SerializedStyles;
6
6
  left: import("antd-style").SerializedStyles;
@@ -1,14 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  export interface SwatchesProps {
3
- /**
4
- * @description An array of colors to be displayed as swatches
5
- */
6
- colors: string[];
7
3
  /**
8
4
  * @description The currently active color
9
5
  * @default undefined
10
6
  */
11
7
  activeColor?: string;
8
+ /**
9
+ * @description An array of colors to be displayed as swatches
10
+ */
11
+ colors: string[];
12
12
  /**
13
13
  * @description A function to be called when a swatch is selected
14
14
  * @default undefined
@@ -9,9 +9,12 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
9
9
  onSelect = _ref.onSelect;
10
10
  var theme = useTheme();
11
11
  return /*#__PURE__*/_jsxs(Flexbox, {
12
- horizontal: true,
13
12
  gap: 8,
13
+ horizontal: true,
14
14
  children: [/*#__PURE__*/_jsx(Flexbox, {
15
+ onClick: function onClick() {
16
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
17
+ },
15
18
  style: {
16
19
  width: 24,
17
20
  height: 24,
@@ -19,13 +22,13 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
19
22
  boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
20
23
  borderRadius: '50%',
21
24
  cursor: 'pointer'
22
- },
23
- onClick: function onClick() {
24
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
25
25
  }
26
26
  }), colors.map(function (c) {
27
27
  var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
28
28
  return /*#__PURE__*/_jsx(Flexbox, {
29
+ onClick: function onClick() {
30
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
31
+ },
29
32
  style: {
30
33
  width: 24,
31
34
  height: 24,
@@ -33,9 +36,6 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
33
36
  boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
34
37
  borderRadius: '50%',
35
38
  cursor: 'pointer'
36
- },
37
- onClick: function onClick() {
38
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
39
39
  }
40
40
  }, c);
41
41
  })]
@@ -2,21 +2,21 @@
2
2
  import { TabsProps } from 'antd';
3
3
  export interface TabsNavProps {
4
4
  /**
5
- * @description Additional className to apply to the component
5
+ * @description The key of the active tab
6
6
  */
7
- className?: string;
7
+ activeKey?: TabsProps['activeKey'];
8
8
  /**
9
- * @description Callback function that is triggered when a tab is changed
9
+ * @description Additional className to apply to the component
10
10
  */
11
- onChange?: (activeKey: string) => void;
11
+ className?: string;
12
12
  /**
13
13
  * @description An array of objects representing the tabs to be rendered
14
14
  */
15
15
  items?: TabsProps['items'];
16
16
  /**
17
- * @description The key of the active tab
17
+ * @description Callback function that is triggered when a tab is changed
18
18
  */
19
- activeKey?: TabsProps['activeKey'];
19
+ onChange?: (activeKey: string) => void;
20
20
  }
21
21
  declare const TabsNav: import("react").NamedExoticComponent<TabsNavProps>;
22
22
  export default TabsNav;
@@ -1,6 +1,8 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["className"];
4
+ 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; }
5
+ 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
6
  import { Tabs } from 'antd';
5
7
  import { memo } from 'react';
6
8
  import { useStyles } from "./style";
@@ -1,7 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject;
3
3
  import { createGlobalStyle } from 'antd-style';
4
- var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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) {
4
+ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::-webkit-scrollbar {\n\t width: 0;\n\t height: 4px;\n\t background-color: transparent;\n\n\t &-thumb {\n\t\t background-color: transparent;\n\t\t border-radius: 4px;\n\t\t transition: background-color 500ms ", ";\n\t }\n\n\t &-corner {\n\t\t display: none;\n\t }\n }\n\n #root {\n\t min-height: 100vh;\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\n *:hover, *:focus {\n\t ::-webkit-scrollbar {\n\t\t &-thumb {\n\t\t\t background-color: ", ";\n\t\t }\n\t }\n }\n"])), function (_ref) {
5
5
  var theme = _ref.theme;
6
6
  return theme.fontFamily;
7
7
  }, function (_ref2) {
@@ -15,9 +15,12 @@ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _tagge
15
15
  return theme.colorBgLayout;
16
16
  }, function (_ref5) {
17
17
  var theme = _ref5.theme;
18
- return theme.colorFill;
18
+ return theme.motionEaseOut;
19
19
  }, function (_ref6) {
20
20
  var theme = _ref6.theme;
21
21
  return theme.fontFamilyCode;
22
+ }, function (_ref7) {
23
+ var theme = _ref7.theme;
24
+ return theme.colorFill;
22
25
  });
23
26
  export default GlobalStyle;
@@ -2,21 +2,21 @@
2
2
  import { extractStaticStyle, type ThemeMode } from 'antd-style';
3
3
  export interface ThemeProviderProps {
4
4
  /**
5
- * @description The children of the ThemeProvider component
5
+ * @description Cache for the extracted static styles
6
6
  */
7
- children: React.ReactNode;
7
+ cache?: typeof extractStaticStyle.cache;
8
8
  /**
9
- * @description The mode of the theme (light or dark)
9
+ * @description The children of the ThemeProvider component
10
10
  */
11
- themeMode?: ThemeMode;
11
+ children: React.ReactNode;
12
12
  /**
13
13
  * @description Whether to inline the styles on server-side rendering or not
14
14
  */
15
15
  ssrInline?: boolean;
16
16
  /**
17
- * @description Cache for the extracted static styles
17
+ * @description The mode of the theme (light or dark)
18
18
  */
19
- cache?: typeof extractStaticStyle.cache;
19
+ themeMode?: ThemeMode;
20
20
  }
21
21
  declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
22
22
  export default ThemeProvider;
@@ -1,10 +1,10 @@
1
- import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
2
1
  import { App } from 'antd';
3
2
  import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
4
3
  import { memo } from 'react';
5
4
  // @ts-ignore
6
5
  import ReactFontLoader from 'react-font-loader';
7
6
  import { ThemeContext } from 'styled-components';
7
+ import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
8
8
  import GlobalStyle from "./GlobalStyle";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -17,10 +17,10 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
17
17
  return /*#__PURE__*/_jsx(StyleProvider, {
18
18
  speedy: process.env.NODE_ENV === 'production',
19
19
  children: /*#__PURE__*/_jsxs(AntdThemeProvider, {
20
- themeMode: themeMode,
21
- theme: lobeTheme,
22
20
  customStylish: lobeCustomStylish,
23
21
  customToken: lobeCustomToken,
22
+ theme: lobeTheme,
23
+ themeMode: themeMode,
24
24
  children: [/*#__PURE__*/_jsx(ReactFontLoader, {
25
25
  url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
26
26
  }), /*#__PURE__*/_jsx(ReactFontLoader, {
@@ -3,6 +3,11 @@ import { type ActionIconSize } from "..";
3
3
  import { ThemeMode } from 'antd-style';
4
4
  import { DivProps } from "../types";
5
5
  export interface ThemeSwitchProps extends DivProps {
6
+ /**
7
+ * @description Callback function when the theme mode is switched
8
+ * @type {(themeMode: ThemeMode) => void}
9
+ */
10
+ onThemeSwitch: (themeMode: ThemeMode) => void;
6
11
  /**
7
12
  * @description Size of the action icon
8
13
  * @default {
@@ -17,11 +22,6 @@ export interface ThemeSwitchProps extends DivProps {
17
22
  * @type ThemeMode
18
23
  */
19
24
  themeMode: ThemeMode;
20
- /**
21
- * @description Callback function when the theme mode is switched
22
- * @type {(themeMode: ThemeMode) => void}
23
- */
24
- onThemeSwitch: (themeMode: ThemeMode) => void;
25
25
  }
26
26
  declare const ThemeSwitch: import("react").NamedExoticComponent<ThemeSwitchProps>;
27
27
  export default ThemeSwitch;