create-modsemi 0.1.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 (53) hide show
  1. package/README.md +99 -0
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +155 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +38 -0
  7. package/template/.browserslistrc +4 -0
  8. package/template/.env.example +9 -0
  9. package/template/.github/workflows/ci.yml +36 -0
  10. package/template/.nvmrc +2 -0
  11. package/template/README.md +199 -0
  12. package/template/_gitignore +33 -0
  13. package/template/_package.json +36 -0
  14. package/template/biome.json +37 -0
  15. package/template/modern.config.ts +38 -0
  16. package/template/orval.config.ts +98 -0
  17. package/template/src/api/instance.ts +87 -0
  18. package/template/src/components/Access/index.tsx +32 -0
  19. package/template/src/components/AppBreadcrumb/index.tsx +34 -0
  20. package/template/src/components/UserAvatar/index.less +66 -0
  21. package/template/src/components/UserAvatar/index.tsx +96 -0
  22. package/template/src/config/global.tsx +59 -0
  23. package/template/src/config/navigation.tsx +91 -0
  24. package/template/src/hooks/useAccess.ts +53 -0
  25. package/template/src/hooks/useMenuData.ts +171 -0
  26. package/template/src/hooks/usePageTitle.ts +26 -0
  27. package/template/src/layouts/ProLayout/DoubleLayout.tsx +157 -0
  28. package/template/src/layouts/ProLayout/LayoutBreadcrumb.tsx +32 -0
  29. package/template/src/layouts/ProLayout/MixLayout.tsx +134 -0
  30. package/template/src/layouts/ProLayout/SideLayout.tsx +108 -0
  31. package/template/src/layouts/ProLayout/TopLayout.tsx +98 -0
  32. package/template/src/layouts/ProLayout/index.tsx +75 -0
  33. package/template/src/layouts/SettingDrawer/index.tsx +390 -0
  34. package/template/src/modern-app-env.d.ts +1 -0
  35. package/template/src/modern.runtime.ts +3 -0
  36. package/template/src/pages/Dashboard/Workplace/index.tsx +7 -0
  37. package/template/src/pages/Error/NotFound/index.less +211 -0
  38. package/template/src/pages/Error/NotFound/index.tsx +64 -0
  39. package/template/src/pages/Login/index.less +491 -0
  40. package/template/src/pages/Login/index.tsx +204 -0
  41. package/template/src/pages/Welcome/index.less +351 -0
  42. package/template/src/pages/Welcome/index.tsx +164 -0
  43. package/template/src/routes/$.tsx +14 -0
  44. package/template/src/routes/dashboard/workplace/page.tsx +3 -0
  45. package/template/src/routes/layout.tsx +53 -0
  46. package/template/src/routes/login/page.tsx +3 -0
  47. package/template/src/routes/page.tsx +3 -0
  48. package/template/src/store/authStore.ts +61 -0
  49. package/template/src/store/layoutStore.ts +82 -0
  50. package/template/src/store/pageTitleStore.ts +12 -0
  51. package/template/src/styles/global.less +80 -0
  52. package/template/swagger/sample.json +263 -0
  53. package/template/tsconfig.json +16 -0
@@ -0,0 +1,211 @@
1
+ // ============================================================
2
+ // NotFound (404) Page Styles
3
+ // 沿用 Welcome 頁的設計語言:grid 背景、radial 光暈、shimmer 動畫
4
+ // ============================================================
5
+
6
+ @keyframes float-up {
7
+ from {
8
+ opacity: 0;
9
+ transform: translateY(24px);
10
+ }
11
+ to {
12
+ opacity: 1;
13
+ transform: translateY(0);
14
+ }
15
+ }
16
+
17
+ @keyframes shimmer {
18
+ 0% { background-position: -200% center; }
19
+ 100% { background-position: 200% center; }
20
+ }
21
+
22
+ @keyframes grid-fade {
23
+ from { opacity: 0; }
24
+ to { opacity: 1; }
25
+ }
26
+
27
+ @keyframes float {
28
+ 0%, 100% { transform: translateY(0px); }
29
+ 50% { transform: translateY(-10px); }
30
+ }
31
+
32
+ @keyframes spin-orbit {
33
+ from { transform: rotate(0deg) translateX(52px) rotate(0deg); }
34
+ to { transform: rotate(360deg) translateX(52px) rotate(-360deg); }
35
+ }
36
+
37
+ @keyframes pulse-glow {
38
+ 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--semi-color-primary) 35%, transparent); }
39
+ 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--semi-color-primary) 0%, transparent); }
40
+ }
41
+
42
+ // ── 頁面容器 ─────────────────────────────────────────────
43
+ .not-found-page {
44
+ position: relative;
45
+ min-height: calc(100vh - 56px);
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ overflow: hidden;
50
+ background-color: var(--semi-color-bg-0);
51
+
52
+ // 背景網格紋理(與 Welcome 完全一致)
53
+ &::before {
54
+ content: '';
55
+ position: absolute;
56
+ inset: 0;
57
+ background-image:
58
+ linear-gradient(var(--semi-color-border) 1px, transparent 1px),
59
+ linear-gradient(90deg, var(--semi-color-border) 1px, transparent 1px);
60
+ background-size: 40px 40px;
61
+ opacity: 0.4;
62
+ pointer-events: none;
63
+ animation: grid-fade 1s ease forwards;
64
+ }
65
+
66
+ // 頂部光暈
67
+ &::after {
68
+ content: '';
69
+ position: absolute;
70
+ top: -160px;
71
+ left: 50%;
72
+ transform: translateX(-50%);
73
+ width: 700px;
74
+ height: 480px;
75
+ border-radius: 50%;
76
+ background: radial-gradient(
77
+ ellipse at center,
78
+ color-mix(in srgb, var(--semi-color-primary) 10%, transparent) 0%,
79
+ transparent 70%
80
+ );
81
+ pointer-events: none;
82
+ }
83
+ }
84
+
85
+ // ── 內容區 ───────────────────────────────────────────────
86
+ .not-found-inner {
87
+ position: relative;
88
+ z-index: 1;
89
+ display: flex;
90
+ flex-direction: column;
91
+ align-items: center;
92
+ text-align: center;
93
+ padding: 64px 32px;
94
+ max-width: 520px;
95
+ width: 100%;
96
+ }
97
+
98
+ // ── 404 數字 ─────────────────────────────────────────────
99
+ .not-found-code {
100
+ font-size: clamp(100px, 18vw, 160px);
101
+ font-weight: 900;
102
+ line-height: 1;
103
+ letter-spacing: -0.06em;
104
+ background: linear-gradient(
105
+ 130deg,
106
+ var(--semi-color-primary) 0%,
107
+ #7b93ff 50%,
108
+ var(--semi-color-primary) 100%
109
+ );
110
+ background-size: 200% auto;
111
+ -webkit-background-clip: text;
112
+ -webkit-text-fill-color: transparent;
113
+ background-clip: text;
114
+ animation:
115
+ float-up 0.6s ease both,
116
+ shimmer 4s linear infinite;
117
+ user-select: none;
118
+ }
119
+
120
+ // ── 星球插圖 ─────────────────────────────────────────────
121
+ .not-found-orbit {
122
+ position: relative;
123
+ width: 130px;
124
+ height: 130px;
125
+ margin: 8px 0 32px;
126
+ animation: float-up 0.6s ease 0.1s both;
127
+
128
+ // 讓整個插圖上下漂浮
129
+ & > * {
130
+ position: absolute;
131
+ inset: 0;
132
+ }
133
+ }
134
+
135
+ .orbit-ring {
136
+ border-radius: 50%;
137
+ border: 1.5px solid color-mix(in srgb, var(--semi-color-primary) 30%, transparent);
138
+ animation: float 4s ease-in-out infinite;
139
+
140
+ &--outer {
141
+ inset: 0;
142
+ }
143
+
144
+ &--inner {
145
+ inset: 22px;
146
+ border-color: color-mix(in srgb, var(--semi-color-primary) 20%, transparent);
147
+ animation-delay: -1s;
148
+ }
149
+ }
150
+
151
+ .orbit-planet {
152
+ inset: 34px;
153
+ border-radius: 50%;
154
+ background: linear-gradient(
155
+ 135deg,
156
+ color-mix(in srgb, var(--semi-color-primary) 60%, transparent) 0%,
157
+ color-mix(in srgb, var(--semi-color-primary) 25%, transparent) 100%
158
+ );
159
+ border: 1.5px solid color-mix(in srgb, var(--semi-color-primary) 40%, transparent);
160
+ animation: float 4s ease-in-out infinite, pulse-glow 3s ease-in-out infinite;
161
+ backdrop-filter: blur(2px);
162
+ }
163
+
164
+ // 環繞小圓點
165
+ .orbit-dot {
166
+ // 重置 inset,改為絕對定位從中心出發
167
+ inset: unset;
168
+ top: 50%;
169
+ left: 50%;
170
+ width: 10px;
171
+ height: 10px;
172
+ margin: -5px 0 0 -5px;
173
+ border-radius: 50%;
174
+ background: var(--semi-color-primary);
175
+ box-shadow: 0 0 8px color-mix(in srgb, var(--semi-color-primary) 70%, transparent);
176
+ animation: spin-orbit 3s linear infinite;
177
+ transform-origin: 0 0;
178
+ }
179
+
180
+ // ── 標題 ─────────────────────────────────────────────────
181
+ .not-found-title {
182
+ // 覆蓋 Semi Typography 預設 margin
183
+ &.semi-typography {
184
+ color: var(--semi-color-text-0) !important;
185
+ margin: 0 0 12px !important;
186
+ font-weight: 700 !important;
187
+ }
188
+ animation: float-up 0.6s ease 0.2s both;
189
+ }
190
+
191
+ // ── 副標題 ───────────────────────────────────────────────
192
+ .not-found-subtitle {
193
+ &.semi-typography {
194
+ color: var(--semi-color-text-2) !important;
195
+ font-size: 15px !important;
196
+ line-height: 1.7 !important;
197
+ margin: 0 !important;
198
+ }
199
+ animation: float-up 0.6s ease 0.25s both;
200
+ }
201
+
202
+ // ── 操作按鈕 ─────────────────────────────────────────────
203
+ .not-found-actions {
204
+ display: flex;
205
+ align-items: center;
206
+ justify-content: center;
207
+ gap: 12px;
208
+ margin-top: 36px;
209
+ flex-wrap: wrap;
210
+ animation: float-up 0.6s ease 0.35s both;
211
+ }
@@ -0,0 +1,64 @@
1
+ import { IconArrowLeft, IconHome } from '@douyinfe/semi-icons';
2
+ import { Button, Typography } from '@douyinfe/semi-ui-19';
3
+ import { useNavigate } from '@modern-js/runtime/router';
4
+ import './index.less';
5
+
6
+ const { Title, Paragraph } = Typography;
7
+
8
+ export function NotFoundPage() {
9
+ const navigate = useNavigate();
10
+
11
+ return (
12
+ <div className="not-found-page">
13
+ <div className="not-found-inner">
14
+ {/* 數字 404 */}
15
+ <div className="not-found-code" aria-hidden="true">
16
+ 404
17
+ </div>
18
+
19
+ {/* 星球插圖 */}
20
+ <div className="not-found-orbit" aria-hidden="true">
21
+ <div className="orbit-ring orbit-ring--outer" />
22
+ <div className="orbit-ring orbit-ring--inner" />
23
+ <div className="orbit-planet" />
24
+ <div className="orbit-dot" />
25
+ </div>
26
+
27
+ {/* 文字內容 */}
28
+ <Title heading={3} className="not-found-title">
29
+ 哎呀,頁面不見了
30
+ </Title>
31
+
32
+ <Paragraph className="not-found-subtitle">
33
+ 您訪問的頁面可能已被移除、名稱已更改,
34
+ <br />
35
+ 或暫時無法訪問。
36
+ </Paragraph>
37
+
38
+ {/* 操作按鈕 */}
39
+ <div className="not-found-actions">
40
+ <Button
41
+ theme="solid"
42
+ type="primary"
43
+ size="large"
44
+ icon={<IconHome />}
45
+ onClick={() => navigate('/')}
46
+ >
47
+ 返回首頁
48
+ </Button>
49
+ <Button
50
+ theme="borderless"
51
+ type="tertiary"
52
+ size="large"
53
+ icon={<IconArrowLeft />}
54
+ onClick={() => navigate(-1)}
55
+ >
56
+ 返回上一頁
57
+ </Button>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ );
62
+ }
63
+
64
+ export default NotFoundPage;