@spacego/fe-components 0.0.1-alpha.2 → 0.0.1-alpha.4
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/lib/assets/svg/chrome-bg-after.svg.js +3 -2
- package/lib/assets/svg/chrome-bg-before.svg.js +2 -1
- package/lib/assets/svg/icon-arrows-right.svg.js +3 -2
- package/lib/assets/svg/icon-bell.svg.js +3 -2
- package/lib/assets/svg/icon-custom.svg.js +3 -2
- package/lib/assets/svg/icon-sun-moon.svg.js +3 -2
- package/lib/assets/svg/icon-system.svg.js +3 -2
- package/lib/assets/svg/login-view.svg.js +871 -2
- package/lib/fe-layouts/auth-layout/index.js +8 -8
- package/lib/fe-layouts/basics-layout/components/basics-layout/tabs.js +5 -5
- package/package.json +9 -1
- package/src/assets/styles/animate.css +0 -62
- package/src/assets/styles/index.css +0 -49
- package/src/assets/svg/chrome-bg-after.svg +0 -1
- package/src/assets/svg/chrome-bg-before.svg +0 -1
- package/src/assets/svg/icon-arrows-right.svg +0 -1
- package/src/assets/svg/icon-bell.svg +0 -1
- package/src/assets/svg/icon-custom.svg +0 -1
- package/src/assets/svg/icon-sun-moon.svg +0 -1
- package/src/assets/svg/icon-system.svg +0 -1
- package/src/assets/svg/loading.svg +0 -13
- package/src/assets/svg/login-view.svg +0 -193
- package/src/config/constants.ts +0 -19
- package/src/config/index.ts +0 -2
- package/src/config/theme.ts +0 -20
- package/src/fe-layouts/auth-layout/index.scss +0 -34
- package/src/fe-layouts/auth-layout/index.tsx +0 -121
- package/src/fe-layouts/basics-layout/components/basics-layout/header.tsx +0 -148
- package/src/fe-layouts/basics-layout/components/basics-layout/setting-custom-color.tsx +0 -52
- package/src/fe-layouts/basics-layout/components/basics-layout/setting-drawer.tsx +0 -165
- package/src/fe-layouts/basics-layout/components/basics-layout/sidebar.tsx +0 -88
- package/src/fe-layouts/basics-layout/components/basics-layout/tabs.tsx +0 -94
- package/src/fe-layouts/basics-layout/components/utils/index.ts +0 -142
- package/src/fe-layouts/basics-layout/index.scss +0 -110
- package/src/fe-layouts/basics-layout/index.tsx +0 -207
- package/src/fe-layouts/blank-layout/index.tsx +0 -12
- package/src/fe-layouts/context/context.ts +0 -11
- package/src/fe-layouts/context/global-context.d.ts +0 -241
- package/src/fe-layouts/context/global-context.provider.tsx +0 -81
- package/src/fe-layouts/context/index.ts +0 -10
- package/src/fe-layouts/index.ts +0 -13
- package/src/fe-layouts/layout.tsx +0 -74
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-auth.hook.ts +0 -54
- package/src/index.ts +0 -24
- package/src/router/index.ts +0 -110
- package/src/router/permission.tsx +0 -134
- package/src/router/routes.tsx +0 -94
- package/src/router/utils.ts +0 -283
- package/src/store/index.ts +0 -9
- package/src/store/modules/layout-config.store.ts +0 -343
- package/src/store/modules/theme.store.ts +0 -99
- package/src/typings/index.d.ts +0 -59
- package/src/typings/shims-axios.d.ts +0 -38
- package/src/utils/icon.tsx +0 -32
- package/src/utils/index.ts +0 -9
- package/src/utils/theme.ts +0 -219
- package/tsconfig.json +0 -28
- package/vite.config.ts +0 -85
|
@@ -16,9 +16,9 @@ import "antd";
|
|
|
16
16
|
import { useGlobal as C } from "../context/context.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
import "../basics-layout/index.js";
|
|
19
|
-
function
|
|
20
|
-
const { appName: s, logo: n } = C(), { theme: o, themeColor: c, TOGGLE_THEME: m, SET_THEME_COLOR: f } = T(p(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [a,
|
|
21
|
-
const
|
|
19
|
+
function q() {
|
|
20
|
+
const { appName: s, logo: n } = C(), { theme: o, themeColor: c, TOGGLE_THEME: m, SET_THEME_COLOR: f } = T(p(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [a, i] = u(!1), d = (r) => {
|
|
21
|
+
const l = r.currentTarget.getBoundingClientRect(), h = l.left + l.width / 2, x = l.top + l.height / 2;
|
|
22
22
|
k(o === "light" ? "dark" : "light", h, x).then(() => {
|
|
23
23
|
m();
|
|
24
24
|
});
|
|
@@ -40,8 +40,8 @@ function A() {
|
|
|
40
40
|
opacity: a ? 1 : 0,
|
|
41
41
|
transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
42
42
|
},
|
|
43
|
-
onMouseEnter: () =>
|
|
44
|
-
onMouseLeave: () =>
|
|
43
|
+
onMouseEnter: () => i(!0),
|
|
44
|
+
onMouseLeave: () => i(!1),
|
|
45
45
|
children: E.map((r) => /* @__PURE__ */ e(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
@@ -59,8 +59,8 @@ function A() {
|
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: "w-8 h-8 flex items-center justify-center cursor-pointer hover-scale-animation",
|
|
62
|
-
onMouseEnter: () =>
|
|
63
|
-
onMouseLeave: () =>
|
|
62
|
+
onMouseEnter: () => i(!0),
|
|
63
|
+
onMouseLeave: () => i(!1),
|
|
64
64
|
children: /* @__PURE__ */ e(N, { className: "h-[16px] w-[16px] text-(--color-primary)" })
|
|
65
65
|
}
|
|
66
66
|
),
|
|
@@ -91,5 +91,5 @@ function A() {
|
|
|
91
91
|
] });
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
q as default
|
|
95
95
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as r, jsxs as i, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { classnames as s } from "@spacego/turbo-utils";
|
|
3
3
|
import { Divider as x } from "antd";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { MdClear as
|
|
4
|
+
import { useRef as v, useState as b, useEffect as g } from "react";
|
|
5
|
+
import { MdClear as k } from "react-icons/md";
|
|
6
6
|
import y from "../../../../assets/svg/chrome-bg-after.svg.js";
|
|
7
7
|
import w from "../../../../assets/svg/chrome-bg-before.svg.js";
|
|
8
8
|
function z(c) {
|
|
9
|
-
const { tabs: o, activeKey: d, onChange: f, onClose: h } = c, n =
|
|
9
|
+
const { tabs: o, activeKey: d, onChange: f, onClose: h } = c, n = v(null), [l, m] = b(!1), a = () => {
|
|
10
10
|
const e = n.current;
|
|
11
11
|
if (e) {
|
|
12
12
|
const t = e.scrollWidth > e.clientWidth;
|
|
13
13
|
m(t);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
return
|
|
16
|
+
return g(() => (a(), window.addEventListener("resize", a), () => {
|
|
17
17
|
window.removeEventListener("resize", a);
|
|
18
18
|
}), [o]), /* @__PURE__ */ r(
|
|
19
19
|
"div",
|
|
@@ -43,7 +43,7 @@ function z(c) {
|
|
|
43
43
|
onClick: (p) => {
|
|
44
44
|
p.stopPropagation(), h(e.key);
|
|
45
45
|
},
|
|
46
|
-
children: /* @__PURE__ */ r(
|
|
46
|
+
children: /* @__PURE__ */ r(k, { className: "text-xs text-[#333333] dark:text-[#cfd0d0] hover:text-black dark:hover:text-white transition-all" })
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
]
|
package/package.json
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spacego/fe-components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"description": "🚀 A component library for fe to use.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "lib/index.js",
|
|
8
8
|
"typings": "lib/types/index.d.ts",
|
|
9
|
+
"style": "lib/index.css",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./lib/types/index.d.ts",
|
|
12
13
|
"import": "./lib/index.js",
|
|
13
14
|
"require": "./lib/index.js"
|
|
14
15
|
},
|
|
16
|
+
"./index.css": {
|
|
17
|
+
"import": "./lib/index.css",
|
|
18
|
+
"require": "./lib/index.css"
|
|
19
|
+
},
|
|
15
20
|
"./*": {
|
|
16
21
|
"types": "./lib/types/*.d.ts",
|
|
17
22
|
"import": "./lib/*.js",
|
|
18
23
|
"require": "./lib/*.js"
|
|
19
24
|
}
|
|
20
25
|
},
|
|
26
|
+
"files": [
|
|
27
|
+
"lib"
|
|
28
|
+
],
|
|
21
29
|
"scripts": {
|
|
22
30
|
"build": "vite build"
|
|
23
31
|
},
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
@keyframes enter-x-animation {
|
|
2
|
-
100% {
|
|
3
|
-
opacity: 1;
|
|
4
|
-
transform: translate(0);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
@keyframes float {
|
|
9
|
-
0% {
|
|
10
|
-
transform: translateY(0);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
50% {
|
|
14
|
-
transform: translateY(-20px);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
100% {
|
|
18
|
-
transform: translateY(0);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@keyframes slide-right {
|
|
23
|
-
0% {
|
|
24
|
-
opacity: 0;
|
|
25
|
-
transform: translate(50px);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
100% {
|
|
29
|
-
opacity: 1;
|
|
30
|
-
transform: translate(0);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@keyframes exit-x-animation {
|
|
35
|
-
0% {
|
|
36
|
-
opacity: 1;
|
|
37
|
-
transform: translate(0);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
100% {
|
|
41
|
-
opacity: 0;
|
|
42
|
-
transform: translate(50px);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@keyframes scale-pulse {
|
|
47
|
-
0% {
|
|
48
|
-
transform: scale(1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
50% {
|
|
52
|
-
transform: scale(0.9);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
100% {
|
|
56
|
-
transform: scale(1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.hover-scale-animation:hover {
|
|
61
|
-
animation: scale-pulse 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
62
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
@import "./animate.css";
|
|
2
|
-
|
|
3
|
-
/* 配置 Tailwind CSS dark 模式为 class 模式,而不是跟随系统 */
|
|
4
|
-
/* 这样 dark: 前缀会基于 html.dark 类,而不是系统主题 */
|
|
5
|
-
@custom-variant dark (&:where(.dark, .dark *));
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
--color-primary: #006BE6;
|
|
9
|
-
--global-background-color: white;
|
|
10
|
-
--border-color: #e4e4e7;
|
|
11
|
-
--text-color: #323639;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[data-theme='dark'] {
|
|
15
|
-
--global-background-color: #1a1c1f;
|
|
16
|
-
--border-color: #36363a;
|
|
17
|
-
--text-color: #f2f2f2;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
html {
|
|
21
|
-
background-color: var(--global-background-color);
|
|
22
|
-
--hover-primary-color: color-mix(in srgb, var(--color-primary) 80%, transparent);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#root,
|
|
26
|
-
body,
|
|
27
|
-
html {
|
|
28
|
-
height: 100%;
|
|
29
|
-
width: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
body {
|
|
33
|
-
min-height: 100vh;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* Spin 遮罩样式,确保在当前容器内撑满 */
|
|
37
|
-
.spin-wrapper-full {
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
|
|
41
|
-
.ant-spin-container {
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ant-spin {
|
|
47
|
-
max-height: 100% !important;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg data-v-f1ce25ed="" class="tabs-chrome__background-after absolute bottom-0 right-[-7px] fill-transparent transition-all duration-500 group-[.is-active]:fill-(--background-primary-light)" height="7" width="7"><path data-v-f1ce25ed="" d="M 0 0 A 7 7 0 0 0 7 7 L 0 7 Z"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg data-v-f1ce25ed="" class="tabs-chrome__background-before absolute bottom-0 left-[-7px] fill-transparent transition-all duration-500 group-[.is-active]:fill-(--background-primary-light)" height="7" width="7"><path data-v-f1ce25ed="" d="M 0 7 A 7 7 0 0 0 7 0 L 7 7 Z"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right-icon lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide size-4 lucide-bell-icon lucide-bell size-4"><path d="M10.268 21a2 2 0 0 0 3.464 0"></path><path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide z-1 absolute size-5 opacity-60"><path d="M2 21a8 8 0 0 1 10.821-7.487"></path><path d="M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"></path><circle cx="10" cy="8" r="5"></circle></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide mx-9 size-5 lucide-sun-moon-icon lucide-sun-moon mx-9 size-5"><path d="M12 2v2"></path><path d="M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715"></path><path d="M16 12a4 4 0 0 0-4-4"></path><path d="m19 5-1.256 1.256"></path><path d="M20 12h2"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide size-4 lucide-settings-icon lucide-settings size-4"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"></path><circle cx="12" cy="12" r="3"></circle></svg>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" className="spin-animation">
|
|
2
|
-
<g clipPath="url(#clip0_324_2488)">
|
|
3
|
-
<path d="M15 0H10C9.44772 0 9 0.447715 9 1V6C9 6.55228 9.44772 7 10 7H15C15.5523 7 16 6.55228 16 6V1C16 0.447715 15.5523 0 15 0Z" fill="var(--color-primary)" />
|
|
4
|
-
<path opacity="0.5" d="M15 9H10C9.44772 9 9 9.44772 9 10V15C9 15.5523 9.44772 16 10 16H15C15.5523 16 16 15.5523 16 15V10C16 9.44772 15.5523 9 15 9Z" fill="var(--color-primary)" />
|
|
5
|
-
<path opacity="0.1" d="M6 9H1C0.447715 9 0 9.44772 0 10V15C0 15.5523 0.447715 16 1 16H6C6.55228 16 7 15.5523 7 15V10C7 9.44772 6.55228 9 6 9Z" fill="var(--color-primary)" />
|
|
6
|
-
<path opacity="0.2" d="M6 0H1C0.447715 0 0 0.447715 0 1V6C0 6.55228 0.447715 7 1 7H6C6.55228 7 7 6.55228 7 6V1C7 0.447715 6.55228 0 6 0Z" fill="var(--color-primary)" />
|
|
7
|
-
</g>
|
|
8
|
-
<defs>
|
|
9
|
-
<clipPath id="clip0_324_2488">
|
|
10
|
-
<rect width="16" height="16" fill="white" />
|
|
11
|
-
</clipPath>
|
|
12
|
-
</defs>
|
|
13
|
-
</svg>
|