@spacego/fe-components 0.0.1-alpha.1 → 0.0.1-alpha.3

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 (56) hide show
  1. package/lib/fe-layouts/auth-layout/index.js +1 -1
  2. package/lib/fe-layouts/layout.js +8 -8
  3. package/lib/index.js +23 -21
  4. package/lib/store/modules/layout-config.store.js +1 -1
  5. package/lib/store/modules/theme.store.js +1 -1
  6. package/lib/types/index.d.ts +2 -0
  7. package/lib/types/router/index.d.ts +1 -1
  8. package/package.json +9 -1
  9. package/src/assets/styles/animate.css +0 -62
  10. package/src/assets/styles/index.css +0 -49
  11. package/src/assets/svg/chrome-bg-after.svg +0 -1
  12. package/src/assets/svg/chrome-bg-before.svg +0 -1
  13. package/src/assets/svg/icon-arrows-right.svg +0 -1
  14. package/src/assets/svg/icon-bell.svg +0 -1
  15. package/src/assets/svg/icon-custom.svg +0 -1
  16. package/src/assets/svg/icon-sun-moon.svg +0 -1
  17. package/src/assets/svg/icon-system.svg +0 -1
  18. package/src/assets/svg/loading.svg +0 -13
  19. package/src/assets/svg/login-view.svg +0 -193
  20. package/src/config/constants.ts +0 -19
  21. package/src/config/index.ts +0 -2
  22. package/src/config/theme.ts +0 -20
  23. package/src/fe-layouts/auth-layout/index.scss +0 -34
  24. package/src/fe-layouts/auth-layout/index.tsx +0 -121
  25. package/src/fe-layouts/basics-layout/components/basics-layout/header.tsx +0 -148
  26. package/src/fe-layouts/basics-layout/components/basics-layout/setting-custom-color.tsx +0 -52
  27. package/src/fe-layouts/basics-layout/components/basics-layout/setting-drawer.tsx +0 -165
  28. package/src/fe-layouts/basics-layout/components/basics-layout/sidebar.tsx +0 -88
  29. package/src/fe-layouts/basics-layout/components/basics-layout/tabs.tsx +0 -94
  30. package/src/fe-layouts/basics-layout/components/utils/index.ts +0 -142
  31. package/src/fe-layouts/basics-layout/index.scss +0 -110
  32. package/src/fe-layouts/basics-layout/index.tsx +0 -207
  33. package/src/fe-layouts/blank-layout/index.tsx +0 -12
  34. package/src/fe-layouts/context/context.ts +0 -11
  35. package/src/fe-layouts/context/global-context.d.ts +0 -241
  36. package/src/fe-layouts/context/global-context.provider.tsx +0 -81
  37. package/src/fe-layouts/context/index.ts +0 -10
  38. package/src/fe-layouts/index.ts +0 -13
  39. package/src/fe-layouts/layout.tsx +0 -74
  40. package/src/hooks/index.ts +0 -1
  41. package/src/hooks/use-auth.hook.ts +0 -54
  42. package/src/index.ts +0 -21
  43. package/src/router/index.ts +0 -110
  44. package/src/router/permission.tsx +0 -134
  45. package/src/router/routes.tsx +0 -94
  46. package/src/router/utils.ts +0 -283
  47. package/src/store/index.ts +0 -9
  48. package/src/store/modules/layout-config.store.ts +0 -343
  49. package/src/store/modules/theme.store.ts +0 -99
  50. package/src/typings/index.d.ts +0 -59
  51. package/src/typings/shims-axios.d.ts +0 -38
  52. package/src/utils/icon.tsx +0 -32
  53. package/src/utils/index.ts +0 -9
  54. package/src/utils/theme.ts +0 -219
  55. package/tsconfig.json +0 -28
  56. package/vite.config.ts +0 -85
@@ -13,9 +13,9 @@ import "../../store/modules/layout-config.store.js";
13
13
  import { useThemeStore as T } from "../../store/modules/theme.store.js";
14
14
  import { THEME_COLORS as E } from "../../config/theme.js";
15
15
  import "antd";
16
+ import { useGlobal as C } from "../context/context.js";
16
17
  /* empty css */
17
18
  import "../basics-layout/index.js";
18
- import { useGlobal as C } from "../context/context.js";
19
19
  function A() {
20
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, l] = u(!1), d = (r) => {
21
21
  const i = r.currentTarget.getBoundingClientRect(), h = i.left + i.width / 2, x = i.top + i.height / 2;
@@ -8,11 +8,11 @@ import { useLayoutConfigStore as d } from "../store/modules/layout-config.store.
8
8
  import { useThemeStore as C } from "../store/modules/theme.store.js";
9
9
  import a from "../config/theme.js";
10
10
  import "react-router-dom";
11
- import y from "./auth-layout/index.js";
12
- import k from "./basics-layout/index.js";
13
- import L from "./blank-layout/index.js";
14
11
  import "./context/context.js";
15
- import M from "./context/global-context.provider.js";
12
+ import y from "./context/global-context.provider.js";
13
+ import k from "./auth-layout/index.js";
14
+ import L from "./basics-layout/index.js";
15
+ import M from "./blank-layout/index.js";
16
16
  function q(p) {
17
17
  const { layoutType: e } = p, { loadingConfig: s } = d(n(["loadingConfig"])), { theme: t, themeColor: r } = C(n(["theme", "themeColor"])), l = u(() => {
18
18
  const f = g(t);
@@ -31,11 +31,11 @@ function q(p) {
31
31
  }
32
32
  };
33
33
  }, [t, r]), m = (/* @__PURE__ */ new Map([
34
- ["blank", L],
35
- ["basic", k],
36
- ["auth", y]
34
+ ["blank", M],
35
+ ["basic", L],
36
+ ["auth", k]
37
37
  ])).get(e);
38
- return /* @__PURE__ */ o(h, { theme: l, children: /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
38
+ return /* @__PURE__ */ o(h, { theme: l, children: /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(
39
39
  c,
40
40
  {
41
41
  spinning: s.show && e !== "basic",
package/lib/index.js CHANGED
@@ -5,44 +5,46 @@ import { useThemeStore as y } from "./store/modules/theme.store.js";
5
5
  import { APP_KEY as g, NOOP as d, STORE_KEY as L } from "./config/constants.js";
6
6
  import { THEME_COLORS as C } from "./config/theme.js";
7
7
  import { createRouter as E, generateRouter as O } from "./router/index.js";
8
- import { default as b } from "./fe-layouts/auth-layout/index.js";
9
- import { default as _ } from "./fe-layouts/basics-layout/index.js";
10
- import { default as B } from "./fe-layouts/blank-layout/index.js";
11
- import { GlobalContext as I, useGlobal as K } from "./fe-layouts/context/context.js";
12
- import { default as k } from "./fe-layouts/context/global-context.provider.js";
13
- import { default as z } from "./fe-layouts/layout.js";
14
- import { createDefaultRoutes as F } from "./router/routes.js";
15
- import { createLazyComponent as N, getPath as W, processRoutes as j } from "./router/utils.js";
16
- import { createPermissionHelpers as w } from "./router/permission.js";
8
+ import { useAuth as b } from "./hooks/use-auth.hook.js";
9
+ import { default as G } from "./fe-layouts/auth-layout/index.js";
10
+ import { default as B } from "./fe-layouts/basics-layout/index.js";
11
+ import { default as I } from "./fe-layouts/blank-layout/index.js";
12
+ import { GlobalContext as Y, useGlobal as k } from "./fe-layouts/context/context.js";
13
+ import { default as z } from "./fe-layouts/context/global-context.provider.js";
14
+ import { default as F } from "./fe-layouts/layout.js";
15
+ import { createDefaultRoutes as N } from "./router/routes.js";
16
+ import { createLazyComponent as j, getPath as q, processRoutes as w } from "./router/utils.js";
17
+ import { createPermissionHelpers as Q } from "./router/permission.js";
17
18
  export {
18
19
  g as APP_KEY,
19
- b as AuthLayout,
20
- _ as BasicsLayout,
21
- B as BlankLayout,
22
- z as FeLayout,
23
- I as GlobalContext,
24
- k as GlobalContextProvider,
20
+ G as AuthLayout,
21
+ B as BasicsLayout,
22
+ I as BlankLayout,
23
+ F as FeLayout,
24
+ Y as GlobalContext,
25
+ z as GlobalContextProvider,
25
26
  d as NOOP,
26
27
  L as STORE_KEY,
27
28
  C as THEME_COLORS,
28
29
  m as applyTheme,
29
30
  p as applyThemeColor,
30
31
  f as applyThemeWithTransition,
31
- F as createDefaultRoutes,
32
- N as createLazyComponent,
33
- w as createPermissionHelpers,
32
+ N as createDefaultRoutes,
33
+ j as createLazyComponent,
34
+ Q as createPermissionHelpers,
34
35
  E as createRouter,
35
36
  O as generateRouter,
36
37
  t as getIcon,
37
- W as getPath,
38
+ q as getPath,
38
39
  l as getRealTheme,
39
40
  s as getTheme,
40
41
  u as initTheme,
41
42
  x as listenSystemTheme,
42
- j as processRoutes,
43
+ w as processRoutes,
43
44
  r as renderIcon,
44
45
  n as toggleTheme,
45
- K as useGlobal,
46
+ b as useAuth,
47
+ k as useGlobal,
46
48
  T as useLayoutConfigStore,
47
49
  y as useThemeStore
48
50
  };
@@ -7,6 +7,7 @@ import { STORE_KEY as E } from "../../config/constants.js";
7
7
  import "react-router-dom";
8
8
  import "antd";
9
9
  import "react";
10
+ import "../../fe-layouts/context/context.js";
10
11
  import "@spacego/zustand";
11
12
  import "react-icons/fa6";
12
13
  import "react-icons/io5";
@@ -14,7 +15,6 @@ import "react-icons/lu";
14
15
  import "react-icons/md";
15
16
  /* empty css */
16
17
  import "../../fe-layouts/basics-layout/index.js";
17
- import "../../fe-layouts/context/context.js";
18
18
  const A = () => ({
19
19
  tabsAttribute: {
20
20
  tabsList: [{
@@ -8,6 +8,7 @@ import { STORE_KEY as i } from "../../config/constants.js";
8
8
  import "react-router-dom";
9
9
  import "antd";
10
10
  import "react";
11
+ import "../../fe-layouts/context/context.js";
11
12
  import "@spacego/zustand";
12
13
  import "react-icons/fa6";
13
14
  import "react-icons/io5";
@@ -15,7 +16,6 @@ import "react-icons/lu";
15
16
  import "react-icons/md";
16
17
  /* empty css */
17
18
  import "../../fe-layouts/basics-layout/index.js";
18
- import "../../fe-layouts/context/context.js";
19
19
  const a = () => ({
20
20
  theme: "light",
21
21
  themeColor: "#006BE6",
@@ -6,5 +6,7 @@ export * from './store';
6
6
  export * from './config';
7
7
  /**------------------------------------------- router ------------------------------------------- */
8
8
  export * from './router';
9
+ /**------------------------------------------- hooks ------------------------------------------- */
10
+ export * from './hooks';
9
11
  /**------------------------------------------- components ------------------------------------------- */
10
12
  export * from './fe-layouts';
@@ -15,7 +15,7 @@ export interface CreateRouterOptions {
15
15
  /**
16
16
  * 创建路由器配置(第一层)
17
17
  * @param options
18
- * @returns { routes, permissionHelpers }
18
+ * @returns
19
19
  */
20
20
  export declare function createRouter(options: CreateRouterOptions): {
21
21
  /** 最终合并后的路由配置 */
package/package.json CHANGED
@@ -1,23 +1,31 @@
1
1
  {
2
2
  "name": "@spacego/fe-components",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.3",
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>