@melt-js/libs-vben 0.0.0-stage → 2026.11.8-2

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 (174) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +86 -2
  3. package/package.json +98 -3
  4. package/src/access/access-control.vue +47 -0
  5. package/src/access/accessible.ts +236 -0
  6. package/src/access/directive.ts +42 -0
  7. package/src/access/index.ts +4 -0
  8. package/src/access/use-access.ts +53 -0
  9. package/src/composables/index.ts +14 -0
  10. package/src/composables/use-is-mobile.ts +7 -0
  11. package/src/composables/use-layout-style.ts +51 -0
  12. package/src/composables/use-layout-viewport-height.ts +71 -0
  13. package/src/composables/use-namespace.ts +106 -0
  14. package/src/composables/use-priority-value.ts +96 -0
  15. package/src/composables/use-scroll-lock.ts +151 -0
  16. package/src/composables/use-simple-locale/README.md +3 -0
  17. package/src/composables/use-simple-locale/index.ts +27 -0
  18. package/src/composables/use-simple-locale/messages.ts +31 -0
  19. package/src/composables/use-sortable.ts +32 -0
  20. package/src/constants/core.ts +76 -0
  21. package/src/constants/index.ts +2 -0
  22. package/src/core-icons/create-icon.ts +14 -0
  23. package/src/core-icons/index.ts +11 -0
  24. package/src/core-icons/lucide.ts +95 -0
  25. package/src/core-preferences/config.ts +172 -0
  26. package/src/core-preferences/constants.ts +116 -0
  27. package/src/core-preferences/index.ts +24 -0
  28. package/src/core-preferences/preferences.ts +503 -0
  29. package/src/core-preferences/types.ts +471 -0
  30. package/src/core-preferences/update-css-variables.ts +129 -0
  31. package/src/core-preferences/use-preferences.ts +282 -0
  32. package/src/design/css/global.css +1 -0
  33. package/src/design/css/nprogress.css +61 -0
  34. package/src/design/css/transition.css +238 -0
  35. package/src/design/css/ui.css +101 -0
  36. package/src/design/design-tokens/dark.css +446 -0
  37. package/src/design/design-tokens/default.css +491 -0
  38. package/src/design/design-tokens/index.ts +2 -0
  39. package/src/design/index.ts +6 -0
  40. package/src/design/scss-bem/bem.scss +34 -0
  41. package/src/design/scss-bem/constants.scss +5 -0
  42. package/src/hooks/index.ts +9 -0
  43. package/src/hooks/use-app-config.ts +39 -0
  44. package/src/hooks/use-content-maximize.ts +24 -0
  45. package/src/hooks/use-design-tokens.ts +421 -0
  46. package/src/hooks/use-hover-toggle.ts +163 -0
  47. package/src/hooks/use-pagination.ts +72 -0
  48. package/src/hooks/use-refresh.ts +16 -0
  49. package/src/hooks/use-tabs.ts +143 -0
  50. package/src/hooks/use-watermark.ts +84 -0
  51. package/src/icons/iconify/index.ts +5 -0
  52. package/src/icons/icons/empty-icon.vue +27 -0
  53. package/src/icons/index.ts +3 -0
  54. package/src/icons/svg/icons/antdv-logo.svg +29 -0
  55. package/src/icons/svg/icons/antdv-next-logo.svg +1 -0
  56. package/src/icons/svg/icons/avatar-1.svg +1 -0
  57. package/src/icons/svg/icons/avatar-2.svg +1 -0
  58. package/src/icons/svg/icons/avatar-3.svg +1 -0
  59. package/src/icons/svg/icons/avatar-4.svg +1 -0
  60. package/src/icons/svg/icons/bell.svg +1 -0
  61. package/src/icons/svg/icons/cake.svg +1 -0
  62. package/src/icons/svg/icons/card.svg +1 -0
  63. package/src/icons/svg/icons/dingding.svg +1 -0
  64. package/src/icons/svg/icons/download.svg +1 -0
  65. package/src/icons/svg/icons/github.svg +1 -0
  66. package/src/icons/svg/icons/google.svg +1 -0
  67. package/src/icons/svg/icons/qqchat.svg +1 -0
  68. package/src/icons/svg/icons/tdesign-logo.svg +39 -0
  69. package/src/icons/svg/icons/wechat.svg +1 -0
  70. package/src/icons/svg/index.ts +39 -0
  71. package/src/icons/svg/load.ts +81 -0
  72. package/src/locales/i18n.ts +147 -0
  73. package/src/locales/index.ts +30 -0
  74. package/src/locales/langs/en-US/authentication.json +65 -0
  75. package/src/locales/langs/en-US/common.json +27 -0
  76. package/src/locales/langs/en-US/preferences.json +245 -0
  77. package/src/locales/langs/en-US/profile.json +4 -0
  78. package/src/locales/langs/en-US/ui.json +165 -0
  79. package/src/locales/langs/zh-CN/authentication.json +65 -0
  80. package/src/locales/langs/zh-CN/common.json +27 -0
  81. package/src/locales/langs/zh-CN/preferences.json +245 -0
  82. package/src/locales/langs/zh-CN/profile.json +4 -0
  83. package/src/locales/langs/zh-CN/ui.json +165 -0
  84. package/src/locales/langs/zh-TW/authentication.json +65 -0
  85. package/src/locales/langs/zh-TW/common.json +27 -0
  86. package/src/locales/langs/zh-TW/preferences.json +245 -0
  87. package/src/locales/langs/zh-TW/profile.json +4 -0
  88. package/src/locales/langs/zh-TW/ui.json +165 -0
  89. package/src/locales/typing.ts +27 -0
  90. package/src/preferences/index.ts +42 -0
  91. package/src/request/index.ts +2 -0
  92. package/src/request/request-client/index.ts +3 -0
  93. package/src/request/request-client/modules/downloader.ts +60 -0
  94. package/src/request/request-client/modules/interceptor.ts +40 -0
  95. package/src/request/request-client/modules/sse.ts +134 -0
  96. package/src/request/request-client/modules/uploader.ts +79 -0
  97. package/src/request/request-client/preset-interceptors.ts +178 -0
  98. package/src/request/request-client/request-client.ts +163 -0
  99. package/src/request/request-client/types.ts +90 -0
  100. package/src/shared/cache/README.md +418 -0
  101. package/src/shared/cache/index.ts +5 -0
  102. package/src/shared/cache/indexeddb-driver.ts +137 -0
  103. package/src/shared/cache/local-storage-driver.ts +70 -0
  104. package/src/shared/cache/memory-storage-driver.ts +32 -0
  105. package/src/shared/cache/storage-manager.ts +146 -0
  106. package/src/shared/cache/types.ts +39 -0
  107. package/src/shared/color/color.ts +9 -0
  108. package/src/shared/color/convert.ts +62 -0
  109. package/src/shared/color/generator.ts +45 -0
  110. package/src/shared/color/index.ts +3 -0
  111. package/src/shared/constants/globals.ts +20 -0
  112. package/src/shared/constants/index.ts +2 -0
  113. package/src/shared/constants/vben.ts +30 -0
  114. package/src/shared/global-state.ts +45 -0
  115. package/src/shared/store.ts +1 -0
  116. package/src/shared/utils/cn.ts +10 -0
  117. package/src/shared/utils/date.ts +80 -0
  118. package/src/shared/utils/diff.ts +114 -0
  119. package/src/shared/utils/dom.ts +126 -0
  120. package/src/shared/utils/download.ts +186 -0
  121. package/src/shared/utils/error.ts +19 -0
  122. package/src/shared/utils/index.ts +22 -0
  123. package/src/shared/utils/inference.ts +164 -0
  124. package/src/shared/utils/letter.ts +47 -0
  125. package/src/shared/utils/merge.ts +11 -0
  126. package/src/shared/utils/nprogress.ts +52 -0
  127. package/src/shared/utils/resources.ts +21 -0
  128. package/src/shared/utils/stack.ts +103 -0
  129. package/src/shared/utils/state-handler.ts +61 -0
  130. package/src/shared/utils/to.ts +21 -0
  131. package/src/shared/utils/tree.ts +159 -0
  132. package/src/shared/utils/unique.ts +15 -0
  133. package/src/shared/utils/update-css-variables.ts +47 -0
  134. package/src/shared/utils/util.ts +50 -0
  135. package/src/shared/utils/window.ts +37 -0
  136. package/src/stores/index.ts +3 -0
  137. package/src/stores/modules/access.ts +130 -0
  138. package/src/stores/modules/dict.ts +244 -0
  139. package/src/stores/modules/index.ts +5 -0
  140. package/src/stores/modules/tabbar.ts +797 -0
  141. package/src/stores/modules/timezone.ts +132 -0
  142. package/src/stores/modules/user.ts +42 -0
  143. package/src/stores/setup.ts +79 -0
  144. package/src/stores/shim-pinia.d.ts +11 -0
  145. package/src/styles/antd/index.css +78 -0
  146. package/src/styles/antdv-next/index.css +90 -0
  147. package/src/styles/ele/index.css +44 -0
  148. package/src/styles/global/index.scss +1 -0
  149. package/src/styles/index.ts +1 -0
  150. package/src/styles/naive/index.css +26 -0
  151. package/src/styles/style-exports.d.ts +3 -0
  152. package/src/theme.css +592 -0
  153. package/src/types/global.d.ts +28 -0
  154. package/src/types/index.ts +2 -0
  155. package/src/types/shims.d.ts +1 -0
  156. package/src/types/user.ts +20 -0
  157. package/src/typings/app.d.ts +128 -0
  158. package/src/typings/basic.d.ts +42 -0
  159. package/src/typings/helper.d.ts +147 -0
  160. package/src/typings/index.ts +16 -0
  161. package/src/typings/languages.ts +28 -0
  162. package/src/typings/menu-record.ts +82 -0
  163. package/src/typings/tabs.ts +8 -0
  164. package/src/typings/vue-router.d.ts +169 -0
  165. package/src/utils/helpers/find-menu-by-path.ts +37 -0
  166. package/src/utils/helpers/generate-menus.ts +89 -0
  167. package/src/utils/helpers/generate-routes-backend.ts +108 -0
  168. package/src/utils/helpers/generate-routes-frontend.ts +58 -0
  169. package/src/utils/helpers/get-popup-container.ts +10 -0
  170. package/src/utils/helpers/index.ts +8 -0
  171. package/src/utils/helpers/merge-route-modules.ts +28 -0
  172. package/src/utils/helpers/reset-routes.ts +30 -0
  173. package/src/utils/helpers/unmount-global-loading.ts +31 -0
  174. package/src/utils/index.ts +4 -0
@@ -0,0 +1,491 @@
1
+ :root {
2
+ /** 弹出层的基础层级 **/
3
+ --popup-z-index: 2000;
4
+ --font-family:
5
+ -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, 'Helvetica Neue',
6
+ arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
7
+ 'Segoe UI Symbol', 'Noto Color Emoji';
8
+
9
+ /* Default background color of <body />...etc */
10
+ --background: 0 0% 100%;
11
+
12
+ /* 主体区域背景色 */
13
+ --background-deep: 216 20.11% 95.47%;
14
+ --foreground: 210 6% 21%;
15
+
16
+ /* Background color for <Card /> */
17
+ --card: 0 0% 100%;
18
+ --card-foreground: 222.2 84% 4.9%;
19
+
20
+ /* Background color for popovers such as <DropdownMenu />, <HoverCard />, <Popover /> */
21
+ --popover: 0 0% 100%;
22
+ --popover-foreground: 222.2 84% 4.9%;
23
+
24
+ /* Muted backgrounds such as <TabsList />, <Skeleton /> and <Switch /> */
25
+
26
+ /* --muted: 210 40% 96.1%;
27
+ --muted-foreground: 215.4 16.3% 46.9%; */
28
+
29
+ --muted: 240 4.8% 95.9%;
30
+ --muted-foreground: 240 3.8% 46.1%;
31
+
32
+ /* 主题颜色 */
33
+
34
+ --primary: 212 100% 45%;
35
+ --primary-foreground: 0 0% 98%;
36
+
37
+ /* Used for destructive actions such as <Button variant="destructive"> */
38
+
39
+ --destructive: 359.33 100% 65.1%;
40
+ --destructive-foreground: 0 0% 98%;
41
+
42
+ /* Used for success actions such as <message> */
43
+
44
+ --info: 240, 5%, 96%;
45
+ --info-foreground: 220, 4%, 58%;
46
+
47
+ /* Used for success actions such as <message> */
48
+
49
+ --success: 144 57% 58%;
50
+ --success-foreground: 0 0% 98%;
51
+
52
+ /* Used for warning actions such as <message> */
53
+
54
+ --warning: 42 84% 61%;
55
+ --warning-foreground: 0 0% 98%;
56
+
57
+ /* Secondary colors for <Button /> */
58
+
59
+ --secondary: 240 5% 96%;
60
+ --secondary-foreground: 240 6% 10%;
61
+
62
+ /* Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc */
63
+ --accent: 240 5% 96%;
64
+ --accent-dark: 216 14% 93%;
65
+ --accent-darker: 216 11% 91%;
66
+ --accent-lighter: 240 0% 98%;
67
+ --accent-hover: 200deg 10% 90%;
68
+ --accent-foreground: 240 6% 10%;
69
+
70
+ /* Darker color */
71
+ --heavy: 192deg 9.43% 89.61%;
72
+ --heavy-foreground: var(--accent-foreground);
73
+
74
+ /* Default border color */
75
+ --border: 240 5.9% 90%;
76
+
77
+ /* Border color for inputs such as <Input />, <Select />, <Textarea /> */
78
+ --input: 240deg 5.88% 90%;
79
+ --input-placeholder: 217 10.6% 65%;
80
+ --input-background: 0 0% 100%;
81
+
82
+ /* Used for focus ring */
83
+ --ring: 222.2 84% 4.9%;
84
+
85
+ /* Border radius for card, input and buttons */
86
+ --radius: 0.5rem;
87
+
88
+ /* ============= custom ============= */
89
+
90
+ /* 遮罩颜色 */
91
+ --overlay: 0 0% 0% / 45%;
92
+ --overlay-content: 0 0% 95% / 45%;
93
+
94
+ /* 基本文字大小 */
95
+ --font-size-base: 16px;
96
+ --menu-font-size: calc(var(--font-size-base) * 0.875);
97
+
98
+ /* =============component & UI============= */
99
+
100
+ /* menu */
101
+ --sidebar: 0 0% 100%;
102
+ --sidebar-deep: 0 0% 100%;
103
+ --menu: var(--sidebar);
104
+
105
+ /* header */
106
+ --header: 0 0% 100%;
107
+
108
+ accent-color: var(--primary);
109
+ color-scheme: light;
110
+ }
111
+
112
+ .light,
113
+ .light[data-theme='custom'],
114
+ .light[data-theme='default'] {
115
+ /* Default background color of <body />...etc */
116
+ --background: 0 0% 100%;
117
+
118
+ /* 主体区域背景色 */
119
+ --background-deep: 216 20.11% 95.47%;
120
+ --foreground: 210 6% 21%;
121
+
122
+ /* Background color for <Card /> */
123
+ --card: 0 0% 100%;
124
+ --card-foreground: 222.2 84% 4.9%;
125
+
126
+ /* Background color for popovers such as <DropdownMenu />, <HoverCard />, <Popover /> */
127
+ --popover: 0 0% 100%;
128
+ --popover-foreground: 222.2 84% 4.9%;
129
+
130
+ /* Muted backgrounds such as <TabsList />, <Skeleton /> and <Switch /> */
131
+ --muted: 240 4.8% 95.9%;
132
+ --muted-foreground: 240 3.8% 46.1%;
133
+
134
+ /* 主题颜色 */
135
+ --primary-foreground: 0 0% 98%;
136
+
137
+ /* Used for destructive actions such as <Button variant="destructive"> */
138
+ --destructive-foreground: 0 0% 98%;
139
+
140
+ /* Used for success actions such as <message> */
141
+ --info-foreground: 220, 4%, 58%;
142
+ --success-foreground: 0 0% 98%;
143
+
144
+ /* Used for warning actions such as <message> */
145
+ --warning-foreground: 0 0% 98%;
146
+
147
+ /* Secondary colors for <Button /> */
148
+ --secondary: 240 5% 96%;
149
+ --secondary-foreground: 240 6% 10%;
150
+
151
+ /* Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc */
152
+ --accent: 240 5% 96%;
153
+ --accent-dark: 216 14% 93%;
154
+ --accent-darker: 216 11% 91%;
155
+ --accent-lighter: 240 0% 98%;
156
+ --accent-hover: 200deg 10% 90%;
157
+ --accent-foreground: 240 6% 10%;
158
+
159
+ /* Darker color */
160
+ --heavy: 192deg 9.43% 89.61%;
161
+ --heavy-foreground: var(--accent-foreground);
162
+
163
+ /* Default border color */
164
+ --border: 240 5.9% 90%;
165
+
166
+ /* Border color for inputs such as <Input />, <Select />, <Textarea /> */
167
+ --input: 240deg 5.88% 90%;
168
+ --input-placeholder: 217 10.6% 65%;
169
+ --input-background: 0 0% 100%;
170
+
171
+ /* Used for focus ring */
172
+ --ring: 222.2 84% 4.9%;
173
+
174
+ /* ============= custom ============= */
175
+
176
+ /* 遮罩颜色 */
177
+ --overlay: 0 0% 0% / 45%;
178
+ --overlay-content: 0 0% 95% / 45%;
179
+
180
+ /* =============component & UI============= */
181
+
182
+ /* menu */
183
+ --sidebar: 0 0% 100%;
184
+ --sidebar-deep: 0 0% 100%;
185
+ --menu: var(--sidebar);
186
+
187
+ /* header */
188
+ --header: 0 0% 100%;
189
+
190
+ accent-color: var(--primary);
191
+ color-scheme: light;
192
+ }
193
+
194
+ .light[data-theme='violet'],
195
+ [data-theme='violet'] .light,
196
+ [data-theme='violet'] {
197
+ /* --background: 0 0% 100%; */
198
+ --foreground: 224 71.4% 4.1%;
199
+ --card: 0 0% 100%;
200
+ --card-foreground: 224 71.4% 4.1%;
201
+ --popover: 0 0% 100%;
202
+ --popover-foreground: 224 71.4% 4.1%;
203
+ --primary-foreground: 210 20% 98%;
204
+ --secondary: 220 14.3% 95.9%;
205
+ --secondary-foreground: 220.9 39.3% 11%;
206
+ --muted: 220 14.3% 95.9%;
207
+ --muted-foreground: 220 8.9% 46.1%;
208
+ --accent: 220 14.3% 95.9%;
209
+ --accent-foreground: 220.9 39.3% 11%;
210
+ --destructive: 0 84.2% 60.2%;
211
+ --destructive-foreground: 210 20% 98%;
212
+ --border: 220 13% 91%;
213
+ --input: 220 13% 91%;
214
+ --ring: 262.1 83.3% 57.8%;
215
+ }
216
+
217
+ .light[data-theme='pink'],
218
+ [data-theme='pink'] .light,
219
+ [data-theme='pink'] {
220
+ /* --background: 0 0% 100%; */
221
+ --foreground: 240 10% 3.9%;
222
+ --card: 0 0% 100%;
223
+ --card-foreground: 240 10% 3.9%;
224
+ --popover: 0 0% 100%;
225
+ --popover-foreground: 240 10% 3.9%;
226
+ --primary-foreground: 355.7 100% 97.3%;
227
+ --secondary: 240 4.8% 95.9%;
228
+ --secondary-foreground: 240 5.9% 10%;
229
+ --muted: 240 4.8% 95.9%;
230
+ --muted-foreground: 240 3.8% 46.1%;
231
+ --accent: 240 4.8% 95.9%;
232
+ --accent-foreground: 240 5.9% 10%;
233
+ --destructive: 0 84.2% 60.2%;
234
+ --destructive-foreground: 0 0% 98%;
235
+ --border: 240 5.9% 90%;
236
+ --input: 240 5.9% 90%;
237
+ --ring: 346.8 77.2% 49.8%;
238
+ }
239
+
240
+ .light[data-theme='rose'],
241
+ [data-theme='rose'] .light,
242
+ [data-theme='rose'] {
243
+ /* --background: 0 0% 100%; */
244
+ --foreground: 240 10% 3.9%;
245
+ --card: 0 0% 100%;
246
+ --card-foreground: 240 10% 3.9%;
247
+ --popover: 0 0% 100%;
248
+ --popover-foreground: 240 10% 3.9%;
249
+ --primary-foreground: 355.7 100% 97.3%;
250
+ --secondary: 240 4.8% 95.9%;
251
+ --secondary-foreground: 240 5.9% 10%;
252
+ --muted: 240 4.8% 95.9%;
253
+ --muted-foreground: 240 3.8% 46.1%;
254
+ --accent: 240 4.8% 95.9%;
255
+ --accent-foreground: 240 5.9% 10%;
256
+ --destructive: 0 84.2% 60.2%;
257
+ --destructive-foreground: 0 0% 98%;
258
+ --border: 240 5.9% 90%;
259
+ --input: 240 5.9% 90%;
260
+ --ring: 346.8 77.2% 49.8%;
261
+ }
262
+
263
+ .light[data-theme='sky-blue'],
264
+ [data-theme='sky-blue'] .light,
265
+ [data-theme='sky-blue'] {
266
+ /* --background: 0 0% 100%; */
267
+ --foreground: 222.2 84% 4.9%;
268
+ --card: 0 0% 100%;
269
+ --card-foreground: 222.2 84% 4.9%;
270
+ --popover: 0 0% 100%;
271
+ --popover-foreground: 222.2 84% 4.9%;
272
+ --primary-foreground: 210 40% 98%;
273
+ --secondary: 210 40% 96.1%;
274
+ --secondary-foreground: 222.2 47.4% 11.2%;
275
+ --muted: 210 40% 96.1%;
276
+ --muted-foreground: 215.4 16.3% 46.9%;
277
+ --accent: 210 40% 96.1%;
278
+ --accent-foreground: 222.2 47.4% 11.2%;
279
+ --destructive: 0 84.2% 60.2%;
280
+ --destructive-foreground: 210 40% 98%;
281
+ --border: 214.3 31.8% 91.4%;
282
+ --input: 214.3 31.8% 91.4%;
283
+ --ring: 221.2 83.2% 53.3%;
284
+ }
285
+
286
+ .light[data-theme='deep-blue'],
287
+ [data-theme='deep-blue'] .light,
288
+ [data-theme='deep-blue'] {
289
+ /* --background: 0 0% 100%; */
290
+ --foreground: 222.2 84% 4.9%;
291
+ --card: 0 0% 100%;
292
+ --card-foreground: 222.2 84% 4.9%;
293
+ --popover: 0 0% 100%;
294
+ --popover-foreground: 222.2 84% 4.9%;
295
+ --primary-foreground: 210 40% 98%;
296
+ --secondary: 210 40% 96.1%;
297
+ --secondary-foreground: 222.2 47.4% 11.2%;
298
+ --muted: 210 40% 96.1%;
299
+ --muted-foreground: 215.4 16.3% 46.9%;
300
+ --accent: 210 40% 96.1%;
301
+ --accent-foreground: 222.2 47.4% 11.2%;
302
+ --destructive: 0 84.2% 60.2%;
303
+ --destructive-foreground: 210 40% 98%;
304
+ --border: 214.3 31.8% 91.4%;
305
+ --input: 214.3 31.8% 91.4%;
306
+ --ring: 221.2 83.2% 53.3%;
307
+ }
308
+
309
+ .light[data-theme='green'],
310
+ [data-theme='green'] .light,
311
+ [data-theme='green'] {
312
+ /* --background: 0 0% 100%; */
313
+ --foreground: 240 10% 3.9%;
314
+ --card: 0 0% 100%;
315
+ --card-foreground: 240 10% 3.9%;
316
+ --popover: 0 0% 100%;
317
+ --popover-foreground: 240 10% 3.9%;
318
+ --primary-foreground: 355.7 100% 97.3%;
319
+ --secondary: 240 4.8% 95.9%;
320
+ --secondary-foreground: 240 5.9% 10%;
321
+ --muted: 240 4.8% 95.9%;
322
+ --muted-foreground: 240 3.8% 46.1%;
323
+ --accent: 240 4.8% 95.9%;
324
+ --accent-foreground: 240 5.9% 10%;
325
+ --destructive: 0 84.2% 60.2%;
326
+ --destructive-foreground: 0 0% 98%;
327
+ --border: 240 5.9% 90%;
328
+ --input: 240 5.9% 90%;
329
+ --ring: 142.1 76.2% 36.3%;
330
+ }
331
+
332
+ .light[data-theme='deep-green'],
333
+ [data-theme='deep-green'] .light,
334
+ [data-theme='deep-green'] {
335
+ /* --background: 0 0% 100%; */
336
+ --foreground: 240 10% 3.9%;
337
+ --card: 0 0% 100%;
338
+ --card-foreground: 240 10% 3.9%;
339
+ --popover: 0 0% 100%;
340
+ --popover-foreground: 240 10% 3.9%;
341
+ --primary-foreground: 355.7 100% 97.3%;
342
+ --secondary: 240 4.8% 95.9%;
343
+ --secondary-foreground: 240 5.9% 10%;
344
+ --muted: 240 4.8% 95.9%;
345
+ --muted-foreground: 240 3.8% 46.1%;
346
+ --accent: 240 4.8% 95.9%;
347
+ --accent-foreground: 240 5.9% 10%;
348
+ --destructive: 0 84.2% 60.2%;
349
+ --destructive-foreground: 0 0% 98%;
350
+ --border: 240 5.9% 90%;
351
+ --input: 240 5.9% 90%;
352
+ --ring: 142.1 76.2% 36.3%;
353
+ }
354
+
355
+ .light[data-theme='orange'],
356
+ [data-theme='orange'] .light,
357
+ [data-theme='orange'] {
358
+ /* --background: 0 0% 100%; */
359
+ --foreground: 20 14.3% 4.1%;
360
+ --card: 0 0% 100%;
361
+ --card-foreground: 20 14.3% 4.1%;
362
+ --popover: 0 0% 100%;
363
+ --popover-foreground: 20 14.3% 4.1%;
364
+ --primary-foreground: 60 9.1% 97.8%;
365
+ --secondary: 60 4.8% 95.9%;
366
+ --secondary-foreground: 24 9.8% 10%;
367
+ --muted: 60 4.8% 95.9%;
368
+ --muted-foreground: 25 5.3% 44.7%;
369
+ --accent: 60 4.8% 95.9%;
370
+ --accent-foreground: 24 9.8% 10%;
371
+ --destructive: 0 84.2% 60.2%;
372
+ --destructive-foreground: 60 9.1% 97.8%;
373
+ --border: 20 5.9% 90%;
374
+ --input: 20 5.9% 90%;
375
+ --ring: 24.6 95% 53.1%;
376
+ }
377
+
378
+ .light[data-theme='yellow'],
379
+ [data-theme='yellow'] .light,
380
+ [data-theme='yellow'] {
381
+ /* --background: 0 0% 100%; */
382
+ --foreground: 20 14.3% 4.1%;
383
+ --card: 0 0% 100%;
384
+ --card-foreground: 20 14.3% 4.1%;
385
+ --popover: 0 0% 100%;
386
+ --popover-foreground: 20 14.3% 4.1%;
387
+ --primary-foreground: 26 83.3% 14.1%;
388
+ --secondary: 60 4.8% 95.9%;
389
+ --secondary-foreground: 24 9.8% 10%;
390
+ --muted: 60 4.8% 95.9%;
391
+ --muted-foreground: 25 5.3% 44.7%;
392
+ --accent: 60 4.8% 95.9%;
393
+ --accent-foreground: 24 9.8% 10%;
394
+ --destructive: 0 84.2% 60.2%;
395
+ --destructive-foreground: 60 9.1% 97.8%;
396
+ --border: 20 5.9% 90%;
397
+ --input: 20 5.9% 90%;
398
+ --ring: 20 14.3% 4.1%;
399
+ }
400
+
401
+ .light[data-theme='zinc'],
402
+ [data-theme='zinc'] .light,
403
+ [data-theme='zinc'] {
404
+ /* --background: 0 0% 100%; */
405
+ --foreground: 240 10% 3.9%;
406
+ --card: 0 0% 100%;
407
+ --card-foreground: 240 10% 3.9%;
408
+ --popover: 0 0% 100%;
409
+ --popover-foreground: 240 10% 3.9%;
410
+ --primary-foreground: 0 0% 98%;
411
+ --secondary: 240 4.8% 95.9%;
412
+ --secondary-foreground: 240 5.9% 10%;
413
+ --muted: 240 4.8% 95.9%;
414
+ --muted-foreground: 240 3.8% 46.1%;
415
+ --accent: 240 4.8% 95.9%;
416
+ --accent-foreground: 240 5.9% 10%;
417
+ --destructive: 0 84.2% 60.2%;
418
+ --destructive-foreground: 0 0% 98%;
419
+ --border: 240 5.9% 90%;
420
+ --input: 240 5.9% 90%;
421
+ --ring: 240 5.9% 10%;
422
+ }
423
+
424
+ .light[data-theme='neutral'],
425
+ [data-theme='neutral'] .light,
426
+ [data-theme='neutral'] {
427
+ /* --background: 0 0% 100%; */
428
+ --foreground: 0 0% 3.9%;
429
+ --card: 0 0% 100%;
430
+ --card-foreground: 0 0% 3.9%;
431
+ --popover: 0 0% 100%;
432
+ --popover-foreground: 0 0% 3.9%;
433
+ --primary-foreground: 0 0% 98%;
434
+ --secondary: 0 0% 96.1%;
435
+ --secondary-foreground: 0 0% 9%;
436
+ --muted: 0 0% 96.1%;
437
+ --muted-foreground: 0 0% 45.1%;
438
+ --accent: 0 0% 96.1%;
439
+ --accent-foreground: 0 0% 9%;
440
+ --destructive: 0 84.2% 60.2%;
441
+ --destructive-foreground: 0 0% 98%;
442
+ --border: 0 0% 89.8%;
443
+ --input: 0 0% 89.8%;
444
+ --ring: 0 0% 3.9%;
445
+ }
446
+
447
+ .light[data-theme='slate'],
448
+ [data-theme='slate'] .light,
449
+ [data-theme='slate'] {
450
+ /* --background: 0 0% 100%; */
451
+ --foreground: 222.2 84% 4.9%;
452
+ --card: 0 0% 100%;
453
+ --card-foreground: 222.2 84% 4.9%;
454
+ --popover: 0 0% 100%;
455
+ --popover-foreground: 222.2 84% 4.9%;
456
+ --primary-foreground: 210 40% 98%;
457
+ --secondary: 210 40% 96.1%;
458
+ --secondary-foreground: 222.2 47.4% 11.2%;
459
+ --muted: 210 40% 96.1%;
460
+ --muted-foreground: 215.4 16.3% 46.9%;
461
+ --accent: 210 40% 96.1%;
462
+ --accent-foreground: 222.2 47.4% 11.2%;
463
+ --destructive: 0 84.2% 60.2%;
464
+ --destructive-foreground: 210 40% 98%;
465
+ --border: 214.3 31.8% 91.4%;
466
+ --input: 214.3 31.8% 91.4%;
467
+ --ring: 222.2 84% 4.9%;
468
+ }
469
+
470
+ .light[data-theme='gray'],
471
+ [data-theme='gray'] .light,
472
+ [data-theme='gray'] {
473
+ /* --background: 0 0% 100%; */
474
+ --foreground: 224 71.4% 4.1%;
475
+ --card: 0 0% 100%;
476
+ --card-foreground: 224 71.4% 4.1%;
477
+ --popover: 0 0% 100%;
478
+ --popover-foreground: 224 71.4% 4.1%;
479
+ --primary-foreground: 210 20% 98%;
480
+ --secondary: 220 14.3% 95.9%;
481
+ --secondary-foreground: 220.9 39.3% 11%;
482
+ --muted: 220 14.3% 95.9%;
483
+ --muted-foreground: 220 8.9% 46.1%;
484
+ --accent: 220 14.3% 95.9%;
485
+ --accent-foreground: 220.9 39.3% 11%;
486
+ --destructive: 0 84.2% 60.2%;
487
+ --destructive-foreground: 210 20% 98%;
488
+ --border: 220 13% 91%;
489
+ --input: 220 13% 91%;
490
+ --ring: 224 71.4% 4.1%;
491
+ }
@@ -0,0 +1,2 @@
1
+ import './default.css';
2
+ import './dark.css';
@@ -0,0 +1,6 @@
1
+ import './design-tokens';
2
+
3
+ import './css/global.css';
4
+ import './css/transition.css';
5
+ import './css/nprogress.css';
6
+ import './css/ui.css';
@@ -0,0 +1,34 @@
1
+ @forward './constants';
2
+
3
+ @mixin b($block) {
4
+ $B: $namespace + '-' + $block !global;
5
+
6
+ .#{$B} {
7
+ @content;
8
+ }
9
+ }
10
+
11
+ @mixin e($name) {
12
+ @at-root {
13
+ &#{$element-separator}#{$name} {
14
+ @content;
15
+ }
16
+ }
17
+ }
18
+
19
+ @mixin m($name) {
20
+ @at-root {
21
+ &#{$modifier-separator}#{$name} {
22
+ @content;
23
+ }
24
+ }
25
+ }
26
+
27
+ // block__element.is-active {}
28
+ @mixin is($state, $prefix: $state-prefix) {
29
+ @at-root {
30
+ &.#{$prefix}-#{$state} {
31
+ @content;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,5 @@
1
+ $namespace: 'vben' !default;
2
+ $common-separator: '-' !default;
3
+ $element-separator: '__' !default;
4
+ $modifier-separator: '--' !default;
5
+ $state-prefix: 'is' !default;
@@ -0,0 +1,9 @@
1
+ export * from './use-app-config';
2
+ export * from './use-content-maximize';
3
+ export * from './use-design-tokens';
4
+ export * from './use-hover-toggle';
5
+ export * from './use-pagination';
6
+ export * from './use-refresh';
7
+ export * from './use-tabs';
8
+ export * from './use-watermark';
9
+ export * from '@melt-js/libs-vben/composables';
@@ -0,0 +1,39 @@
1
+ import type {
2
+ ApplicationConfig,
3
+ VbenAdminProAppConfigRaw,
4
+ } from '@melt-js/libs-vben/types/global';
5
+
6
+ /**
7
+ * 由 vite-inject-app-config 注入的全局配置
8
+ */
9
+ export function useAppConfig(
10
+ env: Record<string, any>,
11
+ isProduction: boolean,
12
+ ): ApplicationConfig {
13
+ // 生产环境优先使用 window._VBEN_ADMIN_PRO_APP_CONF_(上游由
14
+ // extra-app-config 插件注入);本模板没有该插件时回退到构建期 env。
15
+ const config = (
16
+ isProduction
17
+ ? (window._VBEN_ADMIN_PRO_APP_CONF_ ?? env)
18
+ : env
19
+ ) as VbenAdminProAppConfigRaw;
20
+
21
+ const {
22
+ VITE_GLOB_API_URL,
23
+ VITE_GLOB_AUTH_DINGDING_CORP_ID,
24
+ VITE_GLOB_AUTH_DINGDING_CLIENT_ID,
25
+ } = config;
26
+
27
+ const applicationConfig: ApplicationConfig = {
28
+ apiURL: VITE_GLOB_API_URL,
29
+ auth: {},
30
+ };
31
+ if (VITE_GLOB_AUTH_DINGDING_CORP_ID && VITE_GLOB_AUTH_DINGDING_CLIENT_ID) {
32
+ applicationConfig.auth.dingding = {
33
+ clientId: VITE_GLOB_AUTH_DINGDING_CLIENT_ID,
34
+ corpId: VITE_GLOB_AUTH_DINGDING_CORP_ID,
35
+ };
36
+ }
37
+
38
+ return applicationConfig;
39
+ }
@@ -0,0 +1,24 @@
1
+ import { updatePreferences, usePreferences } from '@melt-js/libs-vben/preferences';
2
+ /**
3
+ * 主体区域最大化
4
+ */
5
+ export function useContentMaximize() {
6
+ const { contentIsMaximize } = usePreferences();
7
+
8
+ function toggleMaximize() {
9
+ const isMaximize = contentIsMaximize.value;
10
+
11
+ updatePreferences({
12
+ header: {
13
+ hidden: !isMaximize,
14
+ },
15
+ sidebar: {
16
+ hidden: !isMaximize,
17
+ },
18
+ });
19
+ }
20
+ return {
21
+ contentIsMaximize,
22
+ toggleMaximize,
23
+ };
24
+ }