@lobehub/ui 1.1.0 → 1.2.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.
- package/README.md +6 -3
- package/es/ActionIcon/index.d.ts +19 -6
- package/es/ActionIcon/index.js +18 -47
- package/es/ActionIcon/style.d.ts +3 -0
- package/es/ActionIcon/style.js +10 -0
- package/es/DraggablePanel/index.d.ts +60 -0
- package/es/DraggablePanel/style.js +1 -1
- package/es/Icon/index.d.ts +21 -0
- package/es/Icon/index.js +36 -0
- package/es/Logo/Divider.d.ts +3 -0
- package/es/Logo/Divider.js +20 -0
- package/es/Logo/Logo3D.d.ts +1 -2
- package/es/Logo/LogoFlat.d.ts +1 -2
- package/es/Logo/LogoFlat.js +0 -1
- package/es/Logo/LogoHighContrast.d.ts +1 -2
- package/es/Logo/LogoHighContrast.js +0 -1
- package/es/Logo/LogoText.d.ts +1 -2
- package/es/Logo/index.d.ts +13 -1
- package/es/Logo/index.js +49 -5
- package/es/Logo/style.d.ts +4 -0
- package/es/Logo/style.js +10 -0
- package/es/SideNav/index.d.ts +9 -0
- package/es/StroyBook/index.d.ts +18 -0
- package/es/StroyBook/index.js +40 -0
- package/es/StroyBook/style.d.ts +5 -0
- package/es/StroyBook/style.js +12 -0
- package/es/TabsNav/index.d.ts +22 -0
- package/es/{Template → TabsNav}/index.js +12 -7
- package/es/TabsNav/style.d.ts +3 -0
- package/es/TabsNav/style.js +14 -0
- package/es/ThemeProvider/GlobalStyle.js +1 -1
- package/es/ThemeProvider/index.js +4 -0
- package/es/ThemeSwitch/index.d.ts +27 -0
- package/es/ThemeSwitch/index.js +64 -0
- package/es/index.d.ts +6 -3
- package/es/index.js +5 -2
- package/lib/ActionIcon/index.d.ts +19 -6
- package/lib/ActionIcon/index.js +7 -38
- package/lib/ActionIcon/style.d.ts +3 -0
- package/lib/ActionIcon/style.js +57 -0
- package/lib/DraggablePanel/index.d.ts +60 -0
- package/lib/DraggablePanel/style.js +1 -1
- package/lib/Icon/index.d.ts +21 -0
- package/lib/Icon/index.js +59 -0
- package/lib/Logo/Divider.d.ts +3 -0
- package/lib/Logo/Divider.js +51 -0
- package/lib/Logo/Logo3D.d.ts +1 -2
- package/lib/Logo/LogoFlat.d.ts +1 -2
- package/lib/Logo/LogoFlat.js +1 -1
- package/lib/Logo/LogoHighContrast.d.ts +1 -2
- package/lib/Logo/LogoHighContrast.js +6 -19
- package/lib/Logo/LogoText.d.ts +1 -2
- package/lib/Logo/index.d.ts +13 -1
- package/lib/Logo/index.js +18 -1
- package/lib/Logo/style.d.ts +4 -0
- package/lib/Logo/style.js +41 -0
- package/lib/SideNav/index.d.ts +9 -0
- package/lib/StroyBook/index.d.ts +18 -0
- package/lib/StroyBook/index.js +58 -0
- package/lib/StroyBook/style.d.ts +5 -0
- package/lib/StroyBook/style.js +75 -0
- package/lib/TabsNav/index.d.ts +22 -0
- package/lib/{Template → TabsNav}/index.js +11 -8
- package/lib/TabsNav/style.d.ts +3 -0
- package/lib/TabsNav/style.js +65 -0
- package/lib/ThemeProvider/GlobalStyle.js +7 -3
- package/lib/ThemeProvider/index.js +1 -1
- package/lib/ThemeSwitch/index.d.ts +27 -0
- package/lib/ThemeSwitch/index.js +67 -0
- package/lib/index.d.ts +6 -3
- package/lib/index.js +18 -5
- package/package.json +7 -6
- package/es/Template/index.d.ts +0 -7
- package/lib/Template/index.d.ts +0 -7
|
@@ -33,26 +33,13 @@ __export(LogoHighContrast_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(LogoHighContrast_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var LogoHighContrast = (props) => /* @__PURE__ */ import_react.default.createElement(
|
|
37
|
-
"
|
|
36
|
+
var LogoHighContrast = (props) => /* @__PURE__ */ import_react.default.createElement("svg", { viewBox: "0 0 320 320", fill: "currentColor", fillRule: "evenodd", ...props }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M25.401 140.14c3.71-5.453 8.81-9.628 15.313-12.838A23.89 23.89 0 0055 132.015a23.91 23.91 0 0016.053-6.159 48.924 48.924 0 0010.603-.294 56.54 56.54 0 006.809 6.555c-8.655 1.087-18.202 2.821-29.05 5.494-11.996 2.956-17.707 7.005-20.785 11.53-3.227 4.743-4.63 11.518-4.63 22.374 0 70.838 55.45 121.5 126 121.5 70.564 0 125.889-49.642 126-120.286-.751-13.724-2.613-20.518-5.764-24.763-3.023-4.073-8.262-7.153-19.898-10.42-9.615-2.7-20.317-4.252-31.506-5.103a48.977 48.977 0 006.306-6.763c2.995-1.106 6.948-.684 12.998.332l.321.054c2.498.421 5.641.95 8.543.95 5.214 0 10.234-.927 14.879-2.626 8.925 3.124 16.138 7.213 21.205 14.041 6.227 8.389 8.147 19.524 8.905 33.656l.011.214v.214c0 80.552-63.518 136.5-142 136.5-78.567 0-142-57.028-142-137.5 0-11.644 1.368-22.506 7.401-31.375z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M195.5 145.016a50.53 50.53 0 0018.014-3.295C238.551 143.519 255 146.556 255 150c0 4.335-26.066 8.026-62.517 9.413-.201-5.525-.323-10.211-.316-14.505 1.102.071 2.214.108 3.333.108zM125 145.016a58.278 58.278 0 01-19.063-3.182C81.773 143.646 66 146.628 66 150c0 4.295 25.591 7.958 61.52 9.374.238-5.823.186-10.311-.246-14.402a59.24 59.24 0 01-2.274.044zM122.87 228c9.79-4.353 16.63-14.277 16.63-25.823 0-15.562-12.424-28.177-27.75-28.177S84 186.615 84 202.177c0 10.646 5.815 19.913 14.396 24.705 2.902-.349 5.839-.554 8.729-.554 5.259 0 10.673.678 15.745 1.672zM236 202.177c0 10.646-5.815 19.913-14.396 24.705-2.902-.349-5.839-.554-8.729-.554-5.259 0-10.673.678-15.745 1.672-9.79-4.353-16.63-14.277-16.63-25.823 0-15.562 12.424-28.177 27.75-28.177S236 186.615 236 202.177zM127 248.787S133.923 245 160 245c26.077 0 33 3.787 33 3.787S189.769 278 160 278s-33-29.213-33-29.213z" }), /* @__PURE__ */ import_react.default.createElement(
|
|
37
|
+
"path",
|
|
38
38
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
...props
|
|
44
|
-
},
|
|
45
|
-
/* @__PURE__ */ import_react.default.createElement("path", { d: "M25.401 140.14c3.71-5.453 8.81-9.628 15.313-12.838A23.89 23.89 0 0055 132.015a23.91 23.91 0 0016.053-6.159 48.924 48.924 0 0010.603-.294 56.54 56.54 0 006.809 6.555c-8.655 1.087-18.202 2.821-29.05 5.494-11.996 2.956-17.707 7.005-20.785 11.53-3.227 4.743-4.63 11.518-4.63 22.374 0 70.838 55.45 121.5 126 121.5 70.564 0 125.889-49.642 126-120.286-.751-13.724-2.613-20.518-5.764-24.763-3.023-4.073-8.262-7.153-19.898-10.42-9.615-2.7-20.317-4.252-31.506-5.103a48.977 48.977 0 006.306-6.763c2.995-1.106 6.948-.684 12.998.332l.321.054c2.498.421 5.641.95 8.543.95 5.214 0 10.234-.927 14.879-2.626 8.925 3.124 16.138 7.213 21.205 14.041 6.227 8.389 8.147 19.524 8.905 33.656l.011.214v.214c0 80.552-63.518 136.5-142 136.5-78.567 0-142-57.028-142-137.5 0-11.644 1.368-22.506 7.401-31.375z" }),
|
|
46
|
-
/* @__PURE__ */ import_react.default.createElement("path", { d: "M195.5 145.016a50.53 50.53 0 0018.014-3.295C238.551 143.519 255 146.556 255 150c0 4.335-26.066 8.026-62.517 9.413-.201-5.525-.323-10.211-.316-14.505 1.102.071 2.214.108 3.333.108zM125 145.016a58.278 58.278 0 01-19.063-3.182C81.773 143.646 66 146.628 66 150c0 4.295 25.591 7.958 61.52 9.374.238-5.823.186-10.311-.246-14.402a59.24 59.24 0 01-2.274.044zM122.87 228c9.79-4.353 16.63-14.277 16.63-25.823 0-15.562-12.424-28.177-27.75-28.177S84 186.615 84 202.177c0 10.646 5.815 19.913 14.396 24.705 2.902-.349 5.839-.554 8.729-.554 5.259 0 10.673.678 15.745 1.672zM236 202.177c0 10.646-5.815 19.913-14.396 24.705-2.902-.349-5.839-.554-8.729-.554-5.259 0-10.673.678-15.745 1.672-9.79-4.353-16.63-14.277-16.63-25.823 0-15.562 12.424-28.177 27.75-28.177S236 186.615 236 202.177zM127 248.787S133.923 245 160 245c26.077 0 33 3.787 33 3.787S189.769 278 160 278s-33-29.213-33-29.213z" }),
|
|
47
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
48
|
-
"path",
|
|
49
|
-
{
|
|
50
|
-
d: "M173 19.016c-6.188 0-10.711-2.238-15.68-4.697-6.295-3.114-13.305-6.583-25.32-6.303-20.261 0-30.93 9.751-40.896 18.86-1.54 1.408-3.064 2.8-4.604 4.14-1.958 1.702-11.5 7-16 9-19.683 8.748-34.5 21.5-34.5 40.5 0 3.789.584 7.447 1.672 10.895A23.93 23.93 0 0155 84.016c13.255 0 24 10.745 24 24 0 3.552-.772 6.925-2.157 9.959a40.472 40.472 0 008.042-1.174c8.866 12.225 23.528 20.215 40.115 20.215 3.041 0 6.018-.269 8.906-.783 1.675 7.287 2.007 14.011 1.594 23.782h49c-.359-9.741-.486-17.161-.085-24.451a42.76 42.76 0 0011.085 1.452c14.294 0 26.9-7.006 34.364-17.668 6.059-3.498 13.291-2.284 19.597-1.225 2.746.461 5.317.893 7.539.893 18.778 0 34-14.551 34-32.5 0-8.333-3.281-15.934-8.675-21.686-4.31 5.012-10.697 8.186-17.825 8.186-12.979 0-23.5-10.522-23.5-23.5 0-12.98-30.137-31.5-45-31.5-5.31 0-10.313.325-14.617.604-3.249.21-6.099.396-8.383.396zM234.307 82.5c1.181 3.012-2.694 4.293-4.517 1.62l-.021-.03-.032-.047-.031-.043c-7.483-10.536-20.012-17.444-34.206-17.444a42.498 42.498 0 00-16.163 3.166c-6.41 2.63-14.55 1.24-19.499-3.61-8.882-8.704-21.21-14.096-34.838-14.096-17.152 0-32.245 8.542-41 21.478-1.966 2.365-5.65 1.323-4.535-1.543.06-.155.12-.305.182-.451C86.968 54.2 104.516 42.016 125 42.016c13.628 0 25.956 5.392 34.838 14.097 4.949 4.85 13.089 6.24 19.499 3.609a42.498 42.498 0 0116.163-3.166c17.73 0 32.863 10.778 38.807 25.944z",
|
|
51
|
-
clipRule: "evenodd"
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ import_react.default.createElement("path", { d: "M83 20.516a9.5 9.5 0 11-19 0 9.5 9.5 0 0119 0zM264.5 65.016c8.56 0 15.5-6.94 15.5-15.5 0-8.56-6.94-15.5-15.5-15.5-8.56 0-15.5 6.94-15.5 15.5 0 8.56 6.94 15.5 15.5 15.5zM55 124.016c8.837 0 16-7.164 16-16 0-8.837-7.163-16-16-16s-16 7.163-16 16c0 8.836 7.163 16 16 16z" })
|
|
55
|
-
);
|
|
39
|
+
d: "M173 19.016c-6.188 0-10.711-2.238-15.68-4.697-6.295-3.114-13.305-6.583-25.32-6.303-20.261 0-30.93 9.751-40.896 18.86-1.54 1.408-3.064 2.8-4.604 4.14-1.958 1.702-11.5 7-16 9-19.683 8.748-34.5 21.5-34.5 40.5 0 3.789.584 7.447 1.672 10.895A23.93 23.93 0 0155 84.016c13.255 0 24 10.745 24 24 0 3.552-.772 6.925-2.157 9.959a40.472 40.472 0 008.042-1.174c8.866 12.225 23.528 20.215 40.115 20.215 3.041 0 6.018-.269 8.906-.783 1.675 7.287 2.007 14.011 1.594 23.782h49c-.359-9.741-.486-17.161-.085-24.451a42.76 42.76 0 0011.085 1.452c14.294 0 26.9-7.006 34.364-17.668 6.059-3.498 13.291-2.284 19.597-1.225 2.746.461 5.317.893 7.539.893 18.778 0 34-14.551 34-32.5 0-8.333-3.281-15.934-8.675-21.686-4.31 5.012-10.697 8.186-17.825 8.186-12.979 0-23.5-10.522-23.5-23.5 0-12.98-30.137-31.5-45-31.5-5.31 0-10.313.325-14.617.604-3.249.21-6.099.396-8.383.396zM234.307 82.5c1.181 3.012-2.694 4.293-4.517 1.62l-.021-.03-.032-.047-.031-.043c-7.483-10.536-20.012-17.444-34.206-17.444a42.498 42.498 0 00-16.163 3.166c-6.41 2.63-14.55 1.24-19.499-3.61-8.882-8.704-21.21-14.096-34.838-14.096-17.152 0-32.245 8.542-41 21.478-1.966 2.365-5.65 1.323-4.535-1.543.06-.155.12-.305.182-.451C86.968 54.2 104.516 42.016 125 42.016c13.628 0 25.956 5.392 34.838 14.097 4.949 4.85 13.089 6.24 19.499 3.609a42.498 42.498 0 0116.163-3.166c17.73 0 32.863 10.778 38.807 25.944z",
|
|
40
|
+
clipRule: "evenodd"
|
|
41
|
+
}
|
|
42
|
+
), /* @__PURE__ */ import_react.default.createElement("path", { d: "M83 20.516a9.5 9.5 0 11-19 0 9.5 9.5 0 0119 0zM264.5 65.016c8.56 0 15.5-6.94 15.5-15.5 0-8.56-6.94-15.5-15.5-15.5-8.56 0-15.5 6.94-15.5 15.5 0 8.56 6.94 15.5 15.5 15.5zM55 124.016c8.837 0 16-7.164 16-16 0-8.837-7.163-16-16-16s-16 7.163-16 16c0 8.836 7.163 16 16 16z" }));
|
|
56
43
|
var LogoHighContrast_default = import_react.default.memo(LogoHighContrast);
|
|
57
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
45
|
0 && (module.exports = {});
|
package/lib/Logo/LogoText.d.ts
CHANGED
package/lib/Logo/index.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { DivProps } from "../types";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface LogoProps extends DivProps {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @description Type of the logo to be rendered
|
|
6
|
+
* @default '3d'
|
|
7
|
+
*/
|
|
8
|
+
type?: '3d' | 'flat' | 'high-contrast' | 'text' | 'combine';
|
|
9
|
+
/**
|
|
10
|
+
* @description Size of the logo in pixels
|
|
11
|
+
* @default 32
|
|
12
|
+
*/
|
|
5
13
|
size?: number;
|
|
14
|
+
/**
|
|
15
|
+
* @description Additional React Node to be rendered next to the logo
|
|
16
|
+
*/
|
|
17
|
+
extra?: React.ReactNode;
|
|
6
18
|
}
|
|
7
19
|
declare const _default: React.NamedExoticComponent<LogoProps>;
|
|
8
20
|
export default _default;
|
package/lib/Logo/index.js
CHANGED
|
@@ -32,12 +32,25 @@ __export(Logo_exports, {
|
|
|
32
32
|
default: () => Logo_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Logo_exports);
|
|
35
|
+
var import_antd_style = require("antd-style");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_Divider = __toESM(require("./Divider"));
|
|
36
38
|
var import_Logo3D = __toESM(require("./Logo3D"));
|
|
37
39
|
var import_LogoFlat = __toESM(require("./LogoFlat"));
|
|
38
40
|
var import_LogoHighContrast = __toESM(require("./LogoHighContrast"));
|
|
39
41
|
var import_LogoText = __toESM(require("./LogoText"));
|
|
40
|
-
var
|
|
42
|
+
var import_style = require("./style");
|
|
43
|
+
var Logo = ({
|
|
44
|
+
type = "3d",
|
|
45
|
+
size = 32,
|
|
46
|
+
style,
|
|
47
|
+
extra,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}) => {
|
|
51
|
+
const theme = (0, import_antd_style.useTheme)();
|
|
52
|
+
const { styles, cx } = (0, import_style.useStyles)();
|
|
53
|
+
let logoComponent;
|
|
41
54
|
switch (type) {
|
|
42
55
|
case "3d":
|
|
43
56
|
return /* @__PURE__ */ import_react.default.createElement(import_Logo3D.default, { style: { height: size, width: size, ...style }, ...props });
|
|
@@ -47,7 +60,11 @@ var Logo = ({ type = "3d", size = 32, style, ...props }) => {
|
|
|
47
60
|
return /* @__PURE__ */ import_react.default.createElement(import_LogoHighContrast.default, { style: { height: size, width: size, ...style }, ...props });
|
|
48
61
|
case "text":
|
|
49
62
|
return /* @__PURE__ */ import_react.default.createElement(import_LogoText.default, { style: { height: size, width: "auto", ...style }, ...props });
|
|
63
|
+
case "combine":
|
|
64
|
+
logoComponent = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Logo3D.default, { style: { height: size, width: size } }), /* @__PURE__ */ import_react.default.createElement(import_LogoText.default, { style: { marginLeft: Math.round(size / 4), height: size, width: "auto" } }));
|
|
50
65
|
}
|
|
66
|
+
const extraSize = Math.round(size / 3 * 2);
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: cx(styles.flexCenter, className), style, ...props }, logoComponent, extra && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, { style: { height: extraSize, width: extraSize, color: theme.colorBorder } }), /* @__PURE__ */ import_react.default.createElement("div", { className: styles.extraTitle, style: { fontSize: extraSize } }, extra)));
|
|
51
68
|
};
|
|
52
69
|
var Logo_default = import_react.default.memo(Logo);
|
|
53
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -0,0 +1,41 @@
|
|
|
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/Logo/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 }) => {
|
|
27
|
+
return {
|
|
28
|
+
flexCenter: css`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
`,
|
|
32
|
+
extraTitle: css`
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
font-weight: 200;
|
|
35
|
+
`
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
useStyles
|
|
41
|
+
});
|
package/lib/SideNav/index.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { DivProps } from "../types";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface SideNavProps extends DivProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description Avatar to be displayed at the top of the sidenav
|
|
6
|
+
*/
|
|
4
7
|
avatar?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* @description Actions to be displayed below the avatar
|
|
10
|
+
*/
|
|
5
11
|
topActions?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* @description Actions to be displayed at the bottom of the sidenav
|
|
14
|
+
*/
|
|
6
15
|
bottomActions: React.ReactNode;
|
|
7
16
|
}
|
|
8
17
|
declare const _default: React.NamedExoticComponent<SideNavProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DivProps } from "../types";
|
|
2
|
+
import { useControls, useCreateStore } from 'leva';
|
|
3
|
+
import React from 'react';
|
|
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: React.FC<StroyBookProps>;
|
|
17
|
+
declare const _default: React.NamedExoticComponent<StroyBookProps>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
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__ = require("../index");
|
|
39
|
+
var import_leva = require("leva");
|
|
40
|
+
var import_react = __toESM(require("react"));
|
|
41
|
+
var import_style = require("./style");
|
|
42
|
+
var StroyBook = ({
|
|
43
|
+
levaStore,
|
|
44
|
+
noPadding,
|
|
45
|
+
className,
|
|
46
|
+
children,
|
|
47
|
+
...props
|
|
48
|
+
}) => {
|
|
49
|
+
const { styles, cx } = (0, import_style.useStyles)(noPadding);
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: cx(styles.editor, className), ...props }, /* @__PURE__ */ import_react.default.createElement("div", { className: styles.left }, children), /* @__PURE__ */ import_react.default.createElement(import__.DraggablePanel, { className: styles.right, placement: "right" }, /* @__PURE__ */ import_react.default.createElement(import_leva.LevaPanel, { fill: true, store: levaStore, titleBar: false, flat: true }), " "));
|
|
51
|
+
};
|
|
52
|
+
var StroyBook_default = import_react.default.memo(StroyBook);
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
StroyBook,
|
|
56
|
+
useControls,
|
|
57
|
+
useCreateStore
|
|
58
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
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)(({ css, token }, noPadding) => {
|
|
27
|
+
return {
|
|
28
|
+
editor: css`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: stretch;
|
|
31
|
+
justify-content: stretch;
|
|
32
|
+
width: inherit;
|
|
33
|
+
min-height: inherit;
|
|
34
|
+
`,
|
|
35
|
+
left: css`
|
|
36
|
+
flex: 1;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
${!noPadding && css`
|
|
41
|
+
padding: 40px 24px;
|
|
42
|
+
`}
|
|
43
|
+
`,
|
|
44
|
+
right: css`
|
|
45
|
+
--leva-sizes-controlWidth: 66%;
|
|
46
|
+
--leva-colors-elevation1: ${token.colorFillSecondary};
|
|
47
|
+
--leva-colors-elevation2: transparent;
|
|
48
|
+
--leva-colors-elevation3: ${token.colorFillSecondary};
|
|
49
|
+
--leva-colors-accent1: ${token.colorPrimary};
|
|
50
|
+
--leva-colors-accent2: ${token.colorPrimaryHover};
|
|
51
|
+
--leva-colors-accent3: ${token.colorPrimaryActive};
|
|
52
|
+
--leva-colors-highlight1: ${token.colorTextTertiary};
|
|
53
|
+
--leva-colors-highlight2: ${token.colorTextSecondary};
|
|
54
|
+
--leva-colors-highlight3: ${token.colorText};
|
|
55
|
+
--leva-colors-vivid1: ${token.colorWarning};
|
|
56
|
+
--leva-shadows-level1: unset;
|
|
57
|
+
--leva-shadows-level2: unset;
|
|
58
|
+
padding: 6px 0;
|
|
59
|
+
background: ${token.colorBgLayout};
|
|
60
|
+
> div {
|
|
61
|
+
background: transparent;
|
|
62
|
+
> div {
|
|
63
|
+
background: transparent;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
input:checked + label > svg {
|
|
67
|
+
stroke: ${token.colorBorder};
|
|
68
|
+
}
|
|
69
|
+
`
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
useStyles
|
|
75
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TabsProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface TabsNavProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description Additional className to apply to the component
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description Callback function that is triggered when a tab is changed
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (activeKey: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @description An array of objects representing the tabs to be rendered
|
|
14
|
+
*/
|
|
15
|
+
items?: TabsProps['items'];
|
|
16
|
+
/**
|
|
17
|
+
* @description The key of the active tab
|
|
18
|
+
*/
|
|
19
|
+
activeKey?: TabsProps['activeKey'];
|
|
20
|
+
}
|
|
21
|
+
declare const _default: React.NamedExoticComponent<TabsNavProps>;
|
|
22
|
+
export default _default;
|
|
@@ -26,16 +26,19 @@ 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/
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
default: () =>
|
|
29
|
+
// src/TabsNav/index.tsx
|
|
30
|
+
var TabsNav_exports = {};
|
|
31
|
+
__export(TabsNav_exports, {
|
|
32
|
+
default: () => TabsNav_default
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(TabsNav_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
37
|
-
|
|
37
|
+
var import_style = require("./style");
|
|
38
|
+
var TabsNav = ({ className, ...props }) => {
|
|
39
|
+
const { styles, cx } = (0, import_style.useStyles)();
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Tabs, { className: cx(styles.tabs, className), ...props });
|
|
38
41
|
};
|
|
39
|
-
var
|
|
42
|
+
var TabsNav_default = import_react.default.memo(TabsNav);
|
|
40
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
44
|
0 && (module.exports = {});
|
|
@@ -0,0 +1,65 @@
|
|
|
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/TabsNav/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, prefixCls }) => {
|
|
27
|
+
const prefix = `.${prefixCls}-tabs`;
|
|
28
|
+
const marginHoriz = 16;
|
|
29
|
+
const paddingVertical = 6;
|
|
30
|
+
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
|
+
`
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
useStyles
|
|
65
|
+
});
|
|
@@ -26,20 +26,24 @@ var import_antd_style = require("antd-style");
|
|
|
26
26
|
var GlobalStyle = import_antd_style.createGlobalStyle`
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
font-family:
|
|
30
|
-
font-size: ${({ theme }) => theme.fontSize};
|
|
29
|
+
font-family: 'Segoe UI', SegoeUI, AliPuHui, ${({ theme }) => theme.fontFamily};
|
|
30
|
+
font-size: ${({ theme }) => theme.fontSize}px;
|
|
31
31
|
line-height: 1;
|
|
32
32
|
color: ${({ theme }) => theme.colorTextBase};
|
|
33
33
|
|
|
34
34
|
margin: 0;
|
|
35
35
|
padding: 0;
|
|
36
36
|
background-color: ${(p) => p.theme.colorBgLayout};
|
|
37
|
-
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
* {
|
|
41
40
|
box-sizing: border-box;
|
|
42
41
|
}
|
|
42
|
+
|
|
43
|
+
#root {
|
|
44
|
+
min-height: 100vh;
|
|
45
|
+
width: 100vw;
|
|
46
|
+
}
|
|
43
47
|
|
|
44
48
|
@font-face {
|
|
45
49
|
font-family: AliPuHui;
|
|
@@ -60,7 +60,7 @@ var ThemeProvider = ({ token, children, themeMode }) => {
|
|
|
60
60
|
customToken: getCustomToken
|
|
61
61
|
},
|
|
62
62
|
/* @__PURE__ */ import_react.default.createElement(import_GlobalStyle.default, null),
|
|
63
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.App,
|
|
63
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.App, { style: { minHeight: "inherit", width: "inherit" } }, children)
|
|
64
64
|
));
|
|
65
65
|
};
|
|
66
66
|
var ThemeProvider_default = ThemeProvider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ActionIconSize } from "../index";
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
import { ThemeMode } from 'antd-style';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface ThemeSwitchProps extends DivProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description Size of the action icon
|
|
8
|
+
* @default {
|
|
9
|
+
* blockSize: 34,
|
|
10
|
+
* fontSize: 20,
|
|
11
|
+
* strokeWidth: 1.5,
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
size?: ActionIconSize;
|
|
15
|
+
/**
|
|
16
|
+
* @description The theme mode of the component
|
|
17
|
+
* @type ThemeMode
|
|
18
|
+
*/
|
|
19
|
+
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
|
+
}
|
|
26
|
+
declare const _default: React.NamedExoticComponent<ThemeSwitchProps>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
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/ThemeSwitch/index.tsx
|
|
30
|
+
var ThemeSwitch_exports = {};
|
|
31
|
+
__export(ThemeSwitch_exports, {
|
|
32
|
+
default: () => ThemeSwitch_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ThemeSwitch_exports);
|
|
35
|
+
var import__ = require("../index");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var icons = {
|
|
40
|
+
auto: import_lucide_react.Monitor,
|
|
41
|
+
light: import_lucide_react.Sun,
|
|
42
|
+
dark: import_lucide_react.Moon
|
|
43
|
+
};
|
|
44
|
+
var items = [
|
|
45
|
+
{ label: "System", icon: /* @__PURE__ */ import_react.default.createElement(import__.Icon, { size: "small", icon: icons.auto }), key: "auto" },
|
|
46
|
+
{ label: "Light", icon: /* @__PURE__ */ import_react.default.createElement(import__.Icon, { size: "small", icon: icons.light }), key: "light" },
|
|
47
|
+
{ label: "Dark", icon: /* @__PURE__ */ import_react.default.createElement(import__.Icon, { size: "small", icon: icons.dark }), key: "dark" }
|
|
48
|
+
];
|
|
49
|
+
var ThemeSwitch = ({
|
|
50
|
+
size = {
|
|
51
|
+
blockSize: 34,
|
|
52
|
+
fontSize: 20,
|
|
53
|
+
strokeWidth: 1.5
|
|
54
|
+
},
|
|
55
|
+
themeMode,
|
|
56
|
+
onThemeSwitch,
|
|
57
|
+
...props
|
|
58
|
+
}) => {
|
|
59
|
+
const menuProps = {
|
|
60
|
+
items,
|
|
61
|
+
onClick: (e) => onThemeSwitch(e.key)
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Dropdown, { menu: menuProps, trigger: ["click"], ...props }, /* @__PURE__ */ import_react.default.createElement(import__.ActionIcon, { size, icon: icons[themeMode] }));
|
|
64
|
+
};
|
|
65
|
+
var ThemeSwitch_default = import_react.default.memo(ThemeSwitch);
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {});
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export { default as ActionIcon, type ActionIconProps } from './ActionIcon';
|
|
1
|
+
export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
|
|
2
2
|
export { default as DraggablePanel, type DraggablePanelProps } from './DraggablePanel';
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as Icon, type IconProps, type IconSize } from './Icon';
|
|
4
|
+
export { default as Logo, type LogoProps } from './Logo';
|
|
4
5
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
5
|
-
export { default as
|
|
6
|
+
export { default as StroyBook, useControls, useCreateStore, type StroyBookProps, } from './StroyBook';
|
|
7
|
+
export { default as TabsNav, type TabsNavProps } from './TabsNav';
|
|
6
8
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
9
|
+
export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
|