@lobehub/ui 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +6 -3
  2. package/es/ActionIcon/index.d.ts +28 -10
  3. package/es/ActionIcon/index.js +29 -50
  4. package/es/ActionIcon/style.d.ts +6 -0
  5. package/es/ActionIcon/style.js +12 -0
  6. package/es/CopyButton/index.d.ts +34 -0
  7. package/es/CopyButton/index.js +49 -0
  8. package/es/DraggablePanel/index.d.ts +64 -4
  9. package/es/DraggablePanel/index.js +4 -4
  10. package/es/DraggablePanel/style.js +1 -1
  11. package/es/DraggablePanel/utils.d.ts +1 -1
  12. package/es/EditableText/ControlInput.d.ts +9 -0
  13. package/es/EditableText/ControlInput.js +88 -0
  14. package/es/EditableText/index.d.ts +5 -0
  15. package/es/EditableText/index.js +35 -0
  16. package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
  17. package/es/Highlighter/SyntaxHighlighter/Prism.js +40 -0
  18. package/es/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
  19. package/es/Highlighter/SyntaxHighlighter/index.js +58 -0
  20. package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
  21. package/es/Highlighter/SyntaxHighlighter/style.js +15 -0
  22. package/es/Highlighter/index.d.ts +36 -0
  23. package/es/Highlighter/index.js +42 -0
  24. package/es/Highlighter/style.d.ts +5 -0
  25. package/es/Highlighter/style.js +18 -0
  26. package/es/Icon/index.d.ts +20 -0
  27. package/es/Icon/index.js +36 -0
  28. package/es/Logo/Divider.d.ts +3 -0
  29. package/es/Logo/Divider.js +22 -0
  30. package/es/Logo/Logo3D.d.ts +3 -4
  31. package/es/Logo/Logo3D.js +6 -4
  32. package/es/Logo/LogoFlat.d.ts +3 -4
  33. package/es/Logo/LogoFlat.js +6 -5
  34. package/es/Logo/LogoHighContrast.d.ts +3 -4
  35. package/es/Logo/LogoHighContrast.js +6 -5
  36. package/es/Logo/LogoText.d.ts +3 -4
  37. package/es/Logo/LogoText.js +6 -4
  38. package/es/Logo/index.d.ts +16 -4
  39. package/es/Logo/index.js +53 -9
  40. package/es/Logo/style.d.ts +4 -0
  41. package/es/Logo/style.js +10 -0
  42. package/es/Markdown/Code.d.ts +3 -0
  43. package/es/Markdown/Code.js +12 -0
  44. package/es/Markdown/CodeBlock.d.ts +3 -0
  45. package/es/Markdown/CodeBlock.js +27 -0
  46. package/es/Markdown/index.d.ts +13 -0
  47. package/es/Markdown/index.js +28 -0
  48. package/es/Markdown/style.d.ts +4 -0
  49. package/es/Markdown/style.js +12 -0
  50. package/es/MessageInput/index.d.ts +35 -0
  51. package/es/MessageInput/index.js +63 -0
  52. package/es/SearchBar/index.d.ts +5 -0
  53. package/es/SearchBar/index.js +27 -0
  54. package/es/SideNav/index.d.ts +15 -6
  55. package/es/SideNav/index.js +17 -20
  56. package/es/SideNav/style.d.ts +1 -0
  57. package/es/SideNav/style.js +8 -0
  58. package/es/Snippet/index.d.ts +29 -0
  59. package/es/Snippet/index.js +39 -0
  60. package/es/Snippet/style.d.ts +1 -0
  61. package/es/Snippet/style.js +9 -0
  62. package/es/StroyBook/index.d.ts +17 -0
  63. package/es/StroyBook/index.js +47 -0
  64. package/es/StroyBook/style.d.ts +8 -0
  65. package/es/StroyBook/style.js +14 -0
  66. package/es/Swatches/index.d.ts +8 -0
  67. package/es/Swatches/index.js +44 -0
  68. package/es/TabsNav/index.d.ts +22 -0
  69. package/es/{Template → TabsNav}/index.js +14 -9
  70. package/es/TabsNav/style.d.ts +3 -0
  71. package/es/TabsNav/style.js +14 -0
  72. package/es/ThemeProvider/GlobalStyle.js +1 -1
  73. package/es/ThemeProvider/index.d.ts +15 -0
  74. package/es/ThemeProvider/index.js +4 -0
  75. package/es/ThemeSwitch/index.d.ts +27 -0
  76. package/es/ThemeSwitch/index.js +60 -0
  77. package/es/Tooltip/index.d.ts +5 -0
  78. package/es/Tooltip/index.js +20 -0
  79. package/es/Tooltip/style.d.ts +3 -0
  80. package/es/Tooltip/style.js +10 -0
  81. package/es/hooks/useCopied.d.ts +4 -0
  82. package/es/hooks/useCopied.js +26 -0
  83. package/es/hooks/useHighlight.d.ts +36 -0
  84. package/es/hooks/useHighlight.js +63 -0
  85. package/es/index.d.ts +15 -3
  86. package/es/index.js +14 -2
  87. package/es/styles/theme/base.d.ts +2 -0
  88. package/es/styles/theme/base.js +15 -0
  89. package/es/styles/theme/dark.js +6 -14
  90. package/es/styles/theme/light.js +11 -12
  91. package/es/types/index.d.ts +14 -5
  92. package/lib/ActionIcon/index.d.ts +28 -10
  93. package/lib/ActionIcon/index.js +41 -83
  94. package/lib/ActionIcon/style.d.ts +6 -0
  95. package/lib/ActionIcon/style.js +64 -0
  96. package/lib/CopyButton/index.d.ts +34 -0
  97. package/lib/CopyButton/index.js +70 -0
  98. package/lib/DraggablePanel/index.d.ts +64 -4
  99. package/lib/DraggablePanel/index.js +160 -158
  100. package/lib/DraggablePanel/style.js +0 -1
  101. package/lib/DraggablePanel/utils.d.ts +1 -1
  102. package/lib/EditableText/ControlInput.d.ts +9 -0
  103. package/lib/EditableText/ControlInput.js +101 -0
  104. package/lib/EditableText/index.d.ts +5 -0
  105. package/lib/EditableText/index.js +52 -0
  106. package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +7 -0
  107. package/lib/Highlighter/SyntaxHighlighter/Prism.js +41 -0
  108. package/lib/Highlighter/SyntaxHighlighter/index.d.ts +5 -0
  109. package/lib/Highlighter/SyntaxHighlighter/index.js +55 -0
  110. package/lib/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
  111. package/lib/Highlighter/SyntaxHighlighter/style.js +58 -0
  112. package/lib/Highlighter/index.d.ts +36 -0
  113. package/lib/Highlighter/index.js +62 -0
  114. package/lib/Highlighter/style.d.ts +5 -0
  115. package/lib/Highlighter/style.js +107 -0
  116. package/lib/Icon/index.d.ts +20 -0
  117. package/lib/Icon/index.js +49 -0
  118. package/lib/Logo/Divider.d.ts +3 -0
  119. package/lib/Logo/Divider.js +41 -0
  120. package/lib/Logo/Logo3D.d.ts +3 -4
  121. package/lib/Logo/Logo3D.js +4 -14
  122. package/lib/Logo/LogoFlat.d.ts +3 -4
  123. package/lib/Logo/LogoFlat.js +18 -28
  124. package/lib/Logo/LogoHighContrast.d.ts +3 -4
  125. package/lib/Logo/LogoHighContrast.js +8 -31
  126. package/lib/Logo/LogoText.d.ts +3 -4
  127. package/lib/Logo/LogoText.js +5 -15
  128. package/lib/Logo/index.d.ts +16 -4
  129. package/lib/Logo/index.js +18 -8
  130. package/lib/Logo/style.d.ts +4 -0
  131. package/lib/Logo/style.js +41 -0
  132. package/lib/Markdown/Code.d.ts +3 -0
  133. package/lib/Markdown/Code.js +33 -0
  134. package/lib/Markdown/CodeBlock.d.ts +3 -0
  135. package/lib/Markdown/CodeBlock.js +64 -0
  136. package/lib/Markdown/index.d.ts +13 -0
  137. package/lib/Markdown/index.js +48 -0
  138. package/lib/Markdown/style.d.ts +4 -0
  139. package/lib/Markdown/style.js +64 -0
  140. package/lib/MessageInput/index.d.ts +35 -0
  141. package/lib/MessageInput/index.js +58 -0
  142. package/lib/SearchBar/index.d.ts +5 -0
  143. package/lib/SearchBar/index.js +42 -0
  144. package/lib/SideNav/index.d.ts +15 -6
  145. package/lib/SideNav/index.js +7 -31
  146. package/lib/SideNav/style.d.ts +1 -0
  147. package/lib/SideNav/style.js +46 -0
  148. package/lib/Snippet/index.d.ts +29 -0
  149. package/lib/{Template → Snippet}/index.js +16 -10
  150. package/lib/Snippet/style.d.ts +1 -0
  151. package/lib/Snippet/style.js +71 -0
  152. package/lib/StroyBook/index.d.ts +17 -0
  153. package/lib/StroyBook/index.js +65 -0
  154. package/lib/StroyBook/style.d.ts +8 -0
  155. package/lib/StroyBook/style.js +81 -0
  156. package/lib/Swatches/index.d.ts +8 -0
  157. package/lib/Swatches/index.js +68 -0
  158. package/lib/TabsNav/index.d.ts +22 -0
  159. package/lib/TabsNav/index.js +34 -0
  160. package/lib/TabsNav/style.d.ts +3 -0
  161. package/lib/TabsNav/style.js +65 -0
  162. package/lib/ThemeProvider/GlobalStyle.js +10 -4
  163. package/lib/ThemeProvider/index.d.ts +15 -0
  164. package/lib/ThemeProvider/index.js +1 -1
  165. package/lib/ThemeSwitch/index.d.ts +27 -0
  166. package/lib/ThemeSwitch/index.js +50 -0
  167. package/lib/Tooltip/index.d.ts +5 -0
  168. package/lib/Tooltip/index.js +34 -0
  169. package/lib/Tooltip/style.d.ts +3 -0
  170. package/lib/Tooltip/style.js +51 -0
  171. package/lib/hooks/useCopied.d.ts +4 -0
  172. package/lib/hooks/useCopied.js +44 -0
  173. package/lib/hooks/useHighlight.d.ts +36 -0
  174. package/lib/hooks/useHighlight.js +76 -0
  175. package/lib/index.d.ts +15 -3
  176. package/lib/index.js +47 -5
  177. package/lib/styles/theme/base.d.ts +2 -0
  178. package/lib/styles/theme/base.js +43 -0
  179. package/lib/styles/theme/dark.js +5 -12
  180. package/lib/styles/theme/light.js +10 -10
  181. package/lib/types/index.d.ts +14 -5
  182. package/package.json +18 -9
  183. package/es/Template/index.d.ts +0 -7
  184. package/es/ThemeProvider/token.d.ts +0 -3
  185. package/es/ThemeProvider/token.js +0 -45
  186. package/es/types/index.js +0 -1
  187. package/lib/Template/index.d.ts +0 -7
  188. package/lib/ThemeProvider/token.d.ts +0 -3
  189. package/lib/ThemeProvider/token.js +0 -73
  190. package/lib/types/index.js +0 -17
@@ -0,0 +1,64 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/Markdown/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyles: () => useStyles
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode }) => {
27
+ return {
28
+ container: css`
29
+ p {
30
+ margin: 20px auto;
31
+ line-height: 2;
32
+ word-wrap: break-word;
33
+ font-size: 14px;
34
+ color: ${token.colorText};
35
+ }
36
+
37
+ p:not(:last-child) {
38
+ margin-bottom: 1em;
39
+ }
40
+
41
+ blockquote p {
42
+ color: ${token.colorTextDescription};
43
+ }
44
+
45
+ ol,
46
+ ul {
47
+ li {
48
+ line-height: 2;
49
+ display: list-item;
50
+ }
51
+ }
52
+ `,
53
+ code: css`
54
+ padding: 2px 4px;
55
+ font-family: ${token.fontFamilyCode} !important;
56
+ color: ${isDarkMode ? token.cyan8 : token.pink7};
57
+ border-radius: 4px;
58
+ `
59
+ };
60
+ });
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ useStyles
64
+ });
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from 'antd';
3
+ /**
4
+ * @title MessageInputProps
5
+ * @category Props
6
+ * @description MessageInput 组件的 Props
7
+ */
8
+ export interface MessageInputProps {
9
+ /**
10
+ * @title 确认回调函数
11
+ * @description 用户点击确认按钮后的回调函数
12
+ * @param text - 用户输入的文本
13
+ */
14
+ onConfirm?: (text: string) => void;
15
+ /**
16
+ * @title 取消回调函数
17
+ * @description 用户点击取消按钮后的回调函数
18
+ */
19
+ onCancel?: () => void;
20
+ /**
21
+ * @title 默认值
22
+ * @description 输入框的默认值
23
+ */
24
+ defaultValue?: string;
25
+ /**
26
+ * @title 渲染按钮
27
+ * @description 自定义渲染底部按钮
28
+ * @param text - 用户输入的文本
29
+ */
30
+ renderButtons?: (text: string) => ButtonProps[];
31
+ height?: number;
32
+ className?: string;
33
+ }
34
+ declare const MessageInput: import("react").NamedExoticComponent<MessageInputProps>;
35
+ export default MessageInput;
@@ -0,0 +1,58 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/MessageInput/index.tsx
20
+ var MessageInput_exports = {};
21
+ __export(MessageInput_exports, {
22
+ default: () => MessageInput_default
23
+ });
24
+ module.exports = __toCommonJS(MessageInput_exports);
25
+ var import_antd = require("antd");
26
+ var import_antd_style = require("antd-style");
27
+ var import_react = require("react");
28
+ var import_react_layout_kit = require("react-layout-kit");
29
+ var MessageInput = (0, import_react.memo)(
30
+ ({ onCancel, defaultValue, onConfirm, renderButtons, height, className }) => {
31
+ const [tempSystemRole, setRole] = (0, import_react.useState)(defaultValue || "");
32
+ return /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { gap: 8 }, /* @__PURE__ */ React.createElement(
33
+ import_antd.Input.TextArea,
34
+ {
35
+ value: tempSystemRole,
36
+ allowClear: true,
37
+ placeholder: "例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。",
38
+ style: { height: height ?? 200 },
39
+ onChange: (e) => {
40
+ setRole(e.target.value);
41
+ },
42
+ className: (0, import_antd_style.cx)("nowheel", className)
43
+ }
44
+ ), /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { direction: "horizontal-reverse", gap: 8 }, renderButtons ? renderButtons(tempSystemRole).map((buttonProps, index) => /* @__PURE__ */ React.createElement(import_antd.Button, { key: index, ...buttonProps })) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
45
+ import_antd.Button,
46
+ {
47
+ type: "primary",
48
+ onClick: () => {
49
+ onConfirm == null ? void 0 : onConfirm(tempSystemRole);
50
+ }
51
+ },
52
+ "设定"
53
+ ), /* @__PURE__ */ React.createElement(import_antd.Button, { type: "text", onClick: onCancel }, "取消"))));
54
+ }
55
+ );
56
+ var MessageInput_default = MessageInput;
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {});
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from 'antd';
3
+ export declare type SearchBarProps = InputProps;
4
+ declare const SearchBar: import("react").MemoExoticComponent<({ value, onChange, style, placeholder, ...props }: SearchBarProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default SearchBar;
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/SearchBar/index.tsx
20
+ var SearchBar_exports = {};
21
+ __export(SearchBar_exports, {
22
+ default: () => SearchBar_default
23
+ });
24
+ module.exports = __toCommonJS(SearchBar_exports);
25
+ var import_icons = require("@ant-design/icons");
26
+ var import_antd = require("antd");
27
+ var import_react = require("react");
28
+ var SearchBar = (0, import_react.memo)(({ value, onChange, style, placeholder, ...props }) => /* @__PURE__ */ React.createElement(
29
+ import_antd.Input,
30
+ {
31
+ prefix: /* @__PURE__ */ React.createElement(import_icons.SearchOutlined, null),
32
+ allowClear: true,
33
+ value,
34
+ placeholder: placeholder ?? "Search",
35
+ style: { ...style, borderColor: "transparent" },
36
+ onChange,
37
+ ...props
38
+ }
39
+ ));
40
+ var SearchBar_default = SearchBar;
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {});
@@ -1,9 +1,18 @@
1
1
  import { DivProps } from "../types";
2
- import React from 'react';
2
+ import { ReactNode } from 'react';
3
3
  export interface SideNavProps extends DivProps {
4
- avatar?: React.ReactNode;
5
- topActions?: React.ReactNode;
6
- bottomActions: React.ReactNode;
4
+ /**
5
+ * @description Avatar to be displayed at the top of the sidenav
6
+ */
7
+ avatar?: ReactNode;
8
+ /**
9
+ * @description Actions to be displayed below the avatar
10
+ */
11
+ topActions?: ReactNode;
12
+ /**
13
+ * @description Actions to be displayed at the bottom of the sidenav
14
+ */
15
+ bottomActions: ReactNode;
7
16
  }
8
- declare const _default: React.NamedExoticComponent<SideNavProps>;
9
- export default _default;
17
+ declare const SideNav: import("react").NamedExoticComponent<SideNavProps>;
18
+ export default SideNav;
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
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
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/SideNav/index.tsx
@@ -33,26 +23,12 @@ __export(SideNav_exports, {
33
23
  });
34
24
  module.exports = __toCommonJS(SideNav_exports);
35
25
  var import_antd = require("antd");
36
- var import_react = __toESM(require("react"));
37
- var import_styled_components = __toESM(require("styled-components"));
38
- var Layout = import_styled_components.default.div`
39
- display: flex;
40
- flex: none;
41
- flex-direction: column;
42
- align-items: center;
43
- justify-content: space-between;
44
-
45
- width: 64px;
46
- height: 100%;
47
- min-height: 640px;
48
- padding: 16px 0;
49
-
50
- background: ${({ theme }) => theme.colorBgContainer};
51
- border-right: 1px solid ${({ theme }) => theme.colorBorder};
52
- `;
53
- var SideNav = ({ avatar, topActions, bottomActions, ...props }) => {
54
- return /* @__PURE__ */ import_react.default.createElement(Layout, { ...props }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 16, direction: "vertical", align: "center" }, avatar, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 8, direction: "vertical", align: "center" }, topActions)), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4, direction: "vertical", align: "center" }, bottomActions));
55
- };
56
- var SideNav_default = import_react.default.memo(SideNav);
26
+ var import_react = require("react");
27
+ var import_style = require("./style");
28
+ var SideNav = (0, import_react.memo)(({ className, avatar, topActions, bottomActions, ...props }) => {
29
+ const { styles, cx } = (0, import_style.useStyles)();
30
+ return /* @__PURE__ */ React.createElement("div", { className: cx(styles, className), ...props }, /* @__PURE__ */ React.createElement(import_antd.Space, { size: 16, direction: "vertical", align: "center" }, avatar, /* @__PURE__ */ React.createElement(import_antd.Space, { size: 8, direction: "vertical", align: "center" }, topActions)), /* @__PURE__ */ React.createElement(import_antd.Space, { size: 4, direction: "vertical", align: "center" }, bottomActions));
31
+ });
32
+ var SideNav_default = SideNav;
57
33
  // Annotate the CommonJS export names for ESM import in node:
58
34
  0 && (module.exports = {});
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/SideNav/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyles: () => useStyles
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var useStyles = (0, import_antd_style.createStyles)(
27
+ ({ css, token }) => css`
28
+ display: flex;
29
+ flex: none;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ justify-content: space-between;
33
+
34
+ width: 64px;
35
+ height: 100%;
36
+ min-height: 640px;
37
+ padding: 16px 0;
38
+
39
+ background: ${token.colorBgContainer};
40
+ border-right: 1px solid ${token.colorBorder};
41
+ `
42
+ );
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ useStyles
46
+ });
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { DivProps } from "../types";
3
+ export interface SnippetProps extends DivProps {
4
+ /**
5
+ * @description The content to be displayed inside the Snippet component
6
+ */
7
+ children: string;
8
+ /**
9
+ * @description The symbol to be displayed before the content inside the Snippet component
10
+ */
11
+ symbol?: string;
12
+ /**
13
+ * @description The language of the content inside the Snippet component
14
+ * @default 'tsx'
15
+ */
16
+ language?: string;
17
+ /**
18
+ * @description Whether the Snippet component is copyable or not
19
+ * @default true
20
+ */
21
+ copyable?: boolean;
22
+ /**
23
+ * @description The type of the Snippet component
24
+ * @default 'ghost'
25
+ */
26
+ type?: 'ghost' | 'block';
27
+ }
28
+ declare const Snippet: import("react").NamedExoticComponent<SnippetProps>;
29
+ export default Snippet;
@@ -26,16 +26,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // src/Template/index.tsx
30
- var Template_exports = {};
31
- __export(Template_exports, {
32
- default: () => Template_default
29
+ // src/Snippet/index.tsx
30
+ var Snippet_exports = {};
31
+ __export(Snippet_exports, {
32
+ default: () => Snippet_default
33
33
  });
34
- module.exports = __toCommonJS(Template_exports);
35
- var import_react = __toESM(require("react"));
36
- var Template = ({ children, ...props }) => {
37
- return /* @__PURE__ */ import_react.default.createElement("div", { ...props }, children);
38
- };
39
- var Template_default = import_react.default.memo(Template);
34
+ module.exports = __toCommonJS(Snippet_exports);
35
+ var import_react = require("react");
36
+ var import_CopyButton = __toESM(require("../CopyButton"));
37
+ var import_Highlighter = require("../Highlighter");
38
+ var import_style = require("./style");
39
+ var Snippet = (0, import_react.memo)(
40
+ ({ symbol, language = "tsx", children, copyable = true, type = "ghost", ...props }) => {
41
+ const { styles } = (0, import_style.useStyles)(type);
42
+ return /* @__PURE__ */ React.createElement("div", { className: styles, ...props }, /* @__PURE__ */ React.createElement(import_Highlighter.SyntaxHighlighter, { language }, [symbol, children].filter(Boolean).join(" ")), copyable && /* @__PURE__ */ React.createElement(import_CopyButton.default, { size: { fontSize: 14, blockSize: 24 }, content: children }));
43
+ }
44
+ );
45
+ var Snippet_default = Snippet;
40
46
  // Annotate the CommonJS export names for ESM import in node:
41
47
  0 && (module.exports = {});
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
@@ -0,0 +1,71 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/Snippet/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyles: () => useStyles
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var import_polished = require("polished");
27
+ var useStyles = (0, import_antd_style.createStyles)(
28
+ ({ css, token }, type) => css`
29
+ display: flex;
30
+ max-width: 100%;
31
+ position: relative;
32
+ align-items: center;
33
+ border-radius: ${token.borderRadius}px;
34
+ gap: 8px;
35
+ padding: 0 8px;
36
+ height: 36px;
37
+ transition: background-color 100ms ${token.motionEaseOut};
38
+
39
+ ${type === "block" ? css`
40
+ background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)};
41
+ ` : css`
42
+ border: 1px solid ${token.colorBorder};
43
+ `}
44
+
45
+ &:hover {
46
+ background-color: ${token.colorFillTertiary};
47
+ }
48
+
49
+ .ant-highlighter-shiki {
50
+ overflow: auto;
51
+ flex: 1;
52
+ }
53
+ .prism-code {
54
+ background: none !important;
55
+ }
56
+
57
+ pre {
58
+ background: none !important;
59
+ padding-top: 6px; !important;
60
+ margin: 0 !important;
61
+ line-height: 1;
62
+ }
63
+ code[class*='language-'] {
64
+ background: none !important;
65
+ }
66
+ `
67
+ );
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ useStyles
71
+ });
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { DivProps } from "../types";
3
+ import { useControls, useCreateStore } from 'leva';
4
+ export { useCreateStore, useControls };
5
+ export interface StroyBookProps extends DivProps {
6
+ /**
7
+ * @description The Leva store instance to be used by the component
8
+ * @type levaStore
9
+ */
10
+ levaStore: any;
11
+ /**
12
+ * @description If use padding around component
13
+ */
14
+ noPadding?: boolean;
15
+ }
16
+ export declare const StroyBook: import("react").NamedExoticComponent<StroyBookProps>;
17
+ export default StroyBook;
@@ -0,0 +1,65 @@
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);
28
+
29
+ // src/StroyBook/index.tsx
30
+ var StroyBook_exports = {};
31
+ __export(StroyBook_exports, {
32
+ StroyBook: () => StroyBook,
33
+ default: () => StroyBook_default,
34
+ useControls: () => import_leva.useControls,
35
+ useCreateStore: () => import_leva.useCreateStore
36
+ });
37
+ module.exports = __toCommonJS(StroyBook_exports);
38
+ var import_antd_style = require("antd-style");
39
+ var import_leva = require("leva");
40
+ var import_react = require("react");
41
+ var import_DraggablePanel = __toESM(require("../DraggablePanel"));
42
+ var import_style = require("./style");
43
+ var StroyBook = (0, import_react.memo)(
44
+ ({ levaStore, noPadding, className, children, ...props }) => {
45
+ const { mobile } = (0, import_antd_style.useResponsive)();
46
+ const { styles, cx } = (0, import_style.useStyles)({ noPadding: Boolean(noPadding), mobile: Boolean(mobile) });
47
+ return /* @__PURE__ */ React.createElement("div", { className: cx(styles.editor, className), ...props }, /* @__PURE__ */ React.createElement("div", { className: styles.left }, children), /* @__PURE__ */ React.createElement(
48
+ import_DraggablePanel.default,
49
+ {
50
+ className: styles.right,
51
+ placement: mobile ? "bottom" : "right",
52
+ minWidth: 280
53
+ },
54
+ /* @__PURE__ */ React.createElement(import_leva.LevaPanel, { fill: true, store: levaStore, titleBar: false, flat: true }),
55
+ " "
56
+ ));
57
+ }
58
+ );
59
+ var StroyBook_default = StroyBook;
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ StroyBook,
63
+ useControls,
64
+ useCreateStore
65
+ });
@@ -0,0 +1,8 @@
1
+ export declare const useStyles: (props?: {
2
+ noPadding: boolean;
3
+ mobile: boolean;
4
+ } | undefined) => import("antd-style").ReturnStyles<{
5
+ editor: import("antd-style").SerializedStyles;
6
+ left: import("antd-style").SerializedStyles;
7
+ right: import("antd-style").SerializedStyles;
8
+ }>;
@@ -0,0 +1,81 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/StroyBook/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyles: () => useStyles
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var useStyles = (0, import_antd_style.createStyles)(
27
+ ({ css, token }, { noPadding, mobile }) => {
28
+ return {
29
+ editor: css`
30
+ display: flex;
31
+ align-items: stretch;
32
+ justify-content: stretch;
33
+ width: inherit;
34
+ min-height: inherit;
35
+ ${mobile && css`
36
+ flex-direction: column;
37
+ `}
38
+ `,
39
+ left: css`
40
+ flex: 1;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ overflow: auto;
45
+ ${!noPadding && css`
46
+ padding: 40px 24px;
47
+ `}
48
+ `,
49
+ right: css`
50
+ --leva-sizes-controlWidth: 66%;
51
+ --leva-colors-elevation1: ${token.colorFillSecondary};
52
+ --leva-colors-elevation2: transparent;
53
+ --leva-colors-elevation3: ${token.colorFillSecondary};
54
+ --leva-colors-accent1: ${token.colorPrimary};
55
+ --leva-colors-accent2: ${token.colorPrimaryHover};
56
+ --leva-colors-accent3: ${token.colorPrimaryActive};
57
+ --leva-colors-highlight1: ${token.colorTextTertiary};
58
+ --leva-colors-highlight2: ${token.colorTextSecondary};
59
+ --leva-colors-highlight3: ${token.colorText};
60
+ --leva-colors-vivid1: ${token.colorWarning};
61
+ --leva-shadows-level1: unset;
62
+ --leva-shadows-level2: unset;
63
+ padding: 6px 0;
64
+ background: ${token.colorBgLayout};
65
+ > div {
66
+ background: transparent;
67
+ > div {
68
+ background: transparent;
69
+ }
70
+ }
71
+ input:checked + label > svg {
72
+ stroke: ${token.colorBorder};
73
+ }
74
+ `
75
+ };
76
+ }
77
+ );
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ useStyles
81
+ });
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export interface SwatchesProps {
3
+ colors: string[];
4
+ activeColor?: string;
5
+ onSelect?: (c: string | null) => void;
6
+ }
7
+ declare const Swatches: import("react").NamedExoticComponent<SwatchesProps>;
8
+ export default Swatches;