@skyroc/scripts 2.5.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 (333) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +508 -0
  3. package/dist/cli.mjs +78 -0
  4. package/dist/config-BKkdncJS.mjs +987 -0
  5. package/dist/index.mjs +14 -0
  6. package/package.json +83 -0
  7. package/templates/admin/.env +62 -0
  8. package/templates/admin/.env.prod +7 -0
  9. package/templates/admin/.env.test +7 -0
  10. package/templates/admin/.oxlintrc.json +6 -0
  11. package/templates/admin/README.md +508 -0
  12. package/templates/admin/index.html +14 -0
  13. package/templates/admin/package.json +105 -0
  14. package/templates/admin/public/favicon.svg +3 -0
  15. package/templates/admin/src/App.tsx +71 -0
  16. package/templates/admin/src/assets/audio/wechat-style-notification.wav +0 -0
  17. package/templates/admin/src/assets/imgs/skyroc.jpg +0 -0
  18. package/templates/admin/src/assets/svg-icon/activity.svg +1 -0
  19. package/templates/admin/src/assets/svg-icon/at-sign.svg +1 -0
  20. package/templates/admin/src/assets/svg-icon/avatar.svg +1 -0
  21. package/templates/admin/src/assets/svg-icon/banner.svg +1 -0
  22. package/templates/admin/src/assets/svg-icon/cast.svg +1 -0
  23. package/templates/admin/src/assets/svg-icon/chrome.svg +1 -0
  24. package/templates/admin/src/assets/svg-icon/copy.svg +1 -0
  25. package/templates/admin/src/assets/svg-icon/custom-icon.svg +1 -0
  26. package/templates/admin/src/assets/svg-icon/empty-data.svg +1 -0
  27. package/templates/admin/src/assets/svg-icon/error.svg +1 -0
  28. package/templates/admin/src/assets/svg-icon/expectation.svg +1 -0
  29. package/templates/admin/src/assets/svg-icon/heart.svg +1 -0
  30. package/templates/admin/src/assets/svg-icon/logo.svg +15 -0
  31. package/templates/admin/src/assets/svg-icon/network-error.svg +1 -0
  32. package/templates/admin/src/assets/svg-icon/no-icon.svg +1 -0
  33. package/templates/admin/src/assets/svg-icon/no-permission.svg +1 -0
  34. package/templates/admin/src/assets/svg-icon/not-found.svg +1 -0
  35. package/templates/admin/src/assets/svg-icon/service-error.svg +1 -0
  36. package/templates/admin/src/bootstrap.tsx +60 -0
  37. package/templates/admin/src/components/SkyrocAvatar.tsx +13 -0
  38. package/templates/admin/src/components/SystemLogo.tsx +7 -0
  39. package/templates/admin/src/config.ts +125 -0
  40. package/templates/admin/src/features/antd/AntdProvider.tsx +21 -0
  41. package/templates/admin/src/features/auth/components/UserAvatar.tsx +76 -0
  42. package/templates/admin/src/features/auth/use-auth-form-rules.ts +83 -0
  43. package/templates/admin/src/features/auth/use-auth.ts +96 -0
  44. package/templates/admin/src/features/auth/use-login.ts +72 -0
  45. package/templates/admin/src/features/effects/GlobalEffect.tsx +15 -0
  46. package/templates/admin/src/features/menus/dynamic-routes.ts +10 -0
  47. package/templates/admin/src/features/menus/extras.ts +3 -0
  48. package/templates/admin/src/features/menus/menu-category.ts +14 -0
  49. package/templates/admin/src/features/menus/menu-config.ts +5 -0
  50. package/templates/admin/src/features/router/RouterProvider.tsx +18 -0
  51. package/templates/admin/src/features/router/guard.ts +97 -0
  52. package/templates/admin/src/features/router/index.ts +52 -0
  53. package/templates/admin/src/features/router/routeTree.gen.ts +237 -0
  54. package/templates/admin/src/features/router/router-ref.ts +24 -0
  55. package/templates/admin/src/locales/antd.ts +8 -0
  56. package/templates/admin/src/locales/index.ts +22 -0
  57. package/templates/admin/src/locales/sync.ts +14 -0
  58. package/templates/admin/src/main.tsx +9 -0
  59. package/templates/admin/src/pages/(admin)/home/index.tsx +46 -0
  60. package/templates/admin/src/pages/(admin)/layout.tsx +44 -0
  61. package/templates/admin/src/pages/(auth)/login/index.tsx +102 -0
  62. package/templates/admin/src/pages/(auth)/login/layout.tsx +71 -0
  63. package/templates/admin/src/pages/(auth)/login-out.tsx +27 -0
  64. package/templates/admin/src/pages/(errors)/403.tsx +16 -0
  65. package/templates/admin/src/pages/(errors)/404.tsx +16 -0
  66. package/templates/admin/src/pages/(errors)/500.tsx +16 -0
  67. package/templates/admin/src/pages/__root.tsx +54 -0
  68. package/templates/admin/src/pages/error.tsx +19 -0
  69. package/templates/admin/src/pages/index.tsx +14 -0
  70. package/templates/admin/src/pages/loading.tsx +45 -0
  71. package/templates/admin/src/pages/not-found.tsx +9 -0
  72. package/templates/admin/src/plugins/app.tsx +47 -0
  73. package/templates/admin/src/plugins/assets.ts +4 -0
  74. package/templates/admin/src/plugins/index.ts +32 -0
  75. package/templates/admin/src/service/adapter.ts +63 -0
  76. package/templates/admin/src/service/api/auth/api.ts +31 -0
  77. package/templates/admin/src/service/api/auth/hooks.ts +28 -0
  78. package/templates/admin/src/service/api/auth/index.ts +10 -0
  79. package/templates/admin/src/service/api/auth/keys.ts +7 -0
  80. package/templates/admin/src/service/api/auth/urls.ts +7 -0
  81. package/templates/admin/src/service/api/index.ts +2 -0
  82. package/templates/admin/src/service/api/route/api.ts +7 -0
  83. package/templates/admin/src/service/api/route/hooks.ts +21 -0
  84. package/templates/admin/src/service/api/route/index.ts +10 -0
  85. package/templates/admin/src/service/api/route/keys.ts +3 -0
  86. package/templates/admin/src/service/api/route/urls.ts +5 -0
  87. package/templates/admin/src/service/queryClient.ts +13 -0
  88. package/templates/admin/src/service/request/index.ts +62 -0
  89. package/templates/admin/src/styles/scss/global.scss +1 -0
  90. package/templates/admin/src/styles/scss/scrollbar.scss +28 -0
  91. package/templates/admin/src/types/auto-imports.d.ts +186 -0
  92. package/templates/admin/src/types/global.d.ts +16 -0
  93. package/templates/admin/src/types/router.d.ts +14 -0
  94. package/templates/admin/src/types/storage.d.ts +17 -0
  95. package/templates/admin/src/types/vite-env.d.ts +117 -0
  96. package/templates/admin/src/utils/common.tsx +38 -0
  97. package/templates/admin/src/utils/icon.ts +9 -0
  98. package/templates/admin/src/utils/service.ts +75 -0
  99. package/templates/admin/src/utils/storage.ts +7 -0
  100. package/templates/admin/tsconfig.json +22 -0
  101. package/templates/admin/uno.config.ts +18 -0
  102. package/templates/admin/vite.config.ts +13 -0
  103. package/templates/admin-shell/i18n/atoms/lang.ts +20 -0
  104. package/templates/admin-shell/i18n/config/default.ts +11 -0
  105. package/templates/admin-shell/i18n/features/lang/LangEffect.tsx +25 -0
  106. package/templates/admin-shell/i18n/features/lang/LangSwitch.tsx +49 -0
  107. package/templates/admin-shell/i18n/hooks/use-lang.ts +47 -0
  108. package/templates/admin-shell/i18n/i18n.ts +116 -0
  109. package/templates/admin-shell/i18n/index.ts +23 -0
  110. package/templates/admin-shell/i18n/langs/en-us/common.json +49 -0
  111. package/templates/admin-shell/i18n/langs/en-us/datatable.json +8 -0
  112. package/templates/admin-shell/i18n/langs/en-us/dropdown.json +9 -0
  113. package/templates/admin-shell/i18n/langs/en-us/form.json +27 -0
  114. package/templates/admin-shell/i18n/langs/en-us/icon.json +13 -0
  115. package/templates/admin-shell/i18n/langs/en-us/notification.json +20 -0
  116. package/templates/admin-shell/i18n/langs/en-us/page.json +442 -0
  117. package/templates/admin-shell/i18n/langs/en-us/request.json +8 -0
  118. package/templates/admin-shell/i18n/langs/en-us/route.json +84 -0
  119. package/templates/admin-shell/i18n/langs/en-us/system.json +9 -0
  120. package/templates/admin-shell/i18n/langs/en-us/theme.json +173 -0
  121. package/templates/admin-shell/i18n/langs/index.ts +63 -0
  122. package/templates/admin-shell/i18n/langs/zh-cn/common.json +49 -0
  123. package/templates/admin-shell/i18n/langs/zh-cn/datatable.json +8 -0
  124. package/templates/admin-shell/i18n/langs/zh-cn/dropdown.json +9 -0
  125. package/templates/admin-shell/i18n/langs/zh-cn/form.json +27 -0
  126. package/templates/admin-shell/i18n/langs/zh-cn/icon.json +13 -0
  127. package/templates/admin-shell/i18n/langs/zh-cn/notification.json +20 -0
  128. package/templates/admin-shell/i18n/langs/zh-cn/page.json +442 -0
  129. package/templates/admin-shell/i18n/langs/zh-cn/request.json +8 -0
  130. package/templates/admin-shell/i18n/langs/zh-cn/route.json +84 -0
  131. package/templates/admin-shell/i18n/langs/zh-cn/system.json +9 -0
  132. package/templates/admin-shell/i18n/langs/zh-cn/theme.json +173 -0
  133. package/templates/admin-shell/i18n/types/i18n.ts +29 -0
  134. package/templates/admin-shell/i18n/types.ts +53 -0
  135. package/templates/admin-shell/i18n/utils/helpers.ts +18 -0
  136. package/templates/admin-shell/layouts/AdminLayout.tsx +161 -0
  137. package/templates/admin-shell/layouts/constant.ts +56 -0
  138. package/templates/admin-shell/layouts/context.tsx +101 -0
  139. package/templates/admin-shell/layouts/features/menus/MenuBadge.tsx +76 -0
  140. package/templates/admin-shell/layouts/features/menus/dynamic-routes.ts +146 -0
  141. package/templates/admin-shell/layouts/features/menus/menu-generator.tsx +444 -0
  142. package/templates/admin-shell/layouts/features/menus/menu-renderer.tsx +149 -0
  143. package/templates/admin-shell/layouts/features/menus/permissions.ts +28 -0
  144. package/templates/admin-shell/layouts/features/menus/use-menus.ts +98 -0
  145. package/templates/admin-shell/layouts/features/use-route.ts +30 -0
  146. package/templates/admin-shell/layouts/index.ts +44 -0
  147. package/templates/admin-shell/layouts/materials/index.ts +6 -0
  148. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.module.css +63 -0
  149. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.module.css.d.ts +18 -0
  150. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.tsx +238 -0
  151. package/templates/admin-shell/layouts/materials/libs/admin-layout/shared.ts +67 -0
  152. package/templates/admin-shell/layouts/materials/libs/page-tab/ButtonTab.tsx +44 -0
  153. package/templates/admin-shell/layouts/materials/libs/page-tab/ChromeTab.tsx +54 -0
  154. package/templates/admin-shell/layouts/materials/libs/page-tab/ChromeTabBg.tsx +30 -0
  155. package/templates/admin-shell/layouts/materials/libs/page-tab/SliderTab.tsx +44 -0
  156. package/templates/admin-shell/layouts/materials/libs/page-tab/SvgClose.tsx +51 -0
  157. package/templates/admin-shell/layouts/materials/libs/page-tab/hook.ts +34 -0
  158. package/templates/admin-shell/layouts/materials/libs/page-tab/index.module.css +120 -0
  159. package/templates/admin-shell/layouts/materials/libs/page-tab/index.module.css.d.ts +18 -0
  160. package/templates/admin-shell/layouts/materials/libs/page-tab/index.tsx +76 -0
  161. package/templates/admin-shell/layouts/materials/libs/page-tab/shared.ts +32 -0
  162. package/templates/admin-shell/layouts/materials/types/index.ts +322 -0
  163. package/templates/admin-shell/layouts/modules/AdminContent.tsx +285 -0
  164. package/templates/admin-shell/layouts/modules/AdminFooter.tsx +13 -0
  165. package/templates/admin-shell/layouts/modules/AdminLogo.tsx +28 -0
  166. package/templates/admin-shell/layouts/modules/AdminSider.tsx +50 -0
  167. package/templates/admin-shell/layouts/modules/admin-header/AdminHeader.tsx +132 -0
  168. package/templates/admin-shell/layouts/modules/admin-header/components/Breadcrumb.tsx +62 -0
  169. package/templates/admin-shell/layouts/modules/admin-header/components/ThemeButton.tsx +24 -0
  170. package/templates/admin-shell/layouts/modules/admin-menu/AdminMenu.tsx +37 -0
  171. package/templates/admin-shell/layouts/modules/admin-menu/components/FirstLevelMenu.tsx +156 -0
  172. package/templates/admin-shell/layouts/modules/admin-menu/components/HorizontalMenu.tsx +88 -0
  173. package/templates/admin-shell/layouts/modules/admin-menu/components/MenuPortal.tsx +28 -0
  174. package/templates/admin-shell/layouts/modules/admin-menu/components/VerticalMenu.tsx +123 -0
  175. package/templates/admin-shell/layouts/modules/admin-menu/enum.ts +47 -0
  176. package/templates/admin-shell/layouts/modules/admin-menu/modules/Horizontal.tsx +22 -0
  177. package/templates/admin-shell/layouts/modules/admin-menu/modules/TopHybridHeaderFirst.tsx +15 -0
  178. package/templates/admin-shell/layouts/modules/admin-menu/modules/TopHybridSidebarFirst.tsx +18 -0
  179. package/templates/admin-shell/layouts/modules/admin-menu/modules/Vertical.tsx +14 -0
  180. package/templates/admin-shell/layouts/modules/admin-menu/modules/VerticalHybridHeaderFirst.tsx +18 -0
  181. package/templates/admin-shell/layouts/modules/admin-menu/modules/VerticalMix.tsx +132 -0
  182. package/templates/admin-shell/layouts/modules/admin-search/AdminSearch.tsx +36 -0
  183. package/templates/admin-shell/layouts/modules/admin-search/components/SearchFooter.tsx +38 -0
  184. package/templates/admin-shell/layouts/modules/admin-search/components/SearchModal.tsx +171 -0
  185. package/templates/admin-shell/layouts/modules/admin-search/components/SearchResult.tsx +43 -0
  186. package/templates/admin-shell/layouts/modules/admin-tab/AdminTab.tsx +125 -0
  187. package/templates/admin-shell/layouts/modules/admin-tab/components/TabContextMenu.tsx +107 -0
  188. package/templates/admin-shell/layouts/modules/admin-tab/hooks/useTabScroll.ts +86 -0
  189. package/templates/admin-shell/layouts/modules/shared/logo.ts +42 -0
  190. package/templates/admin-shell/layouts/modules/theme-drawer/ThemeDrawer.tsx +68 -0
  191. package/templates/admin-shell/layouts/modules/theme-drawer/components/AnimatedCollapse.tsx +36 -0
  192. package/templates/admin-shell/layouts/modules/theme-drawer/components/AnimatedItem.tsx +35 -0
  193. package/templates/admin-shell/layouts/modules/theme-drawer/components/LayoutModeCard.tsx +110 -0
  194. package/templates/admin-shell/layouts/modules/theme-drawer/components/SettingItem.tsx +31 -0
  195. package/templates/admin-shell/layouts/modules/theme-drawer/modules/ConfigOperation.tsx +53 -0
  196. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/CustomPicker.tsx +105 -0
  197. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeColor.tsx +58 -0
  198. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeSchema.tsx +42 -0
  199. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeToken.tsx +44 -0
  200. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/index.tsx +23 -0
  201. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/GlobalSettings.tsx +57 -0
  202. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/ThemeGeneral.tsx +20 -0
  203. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/WatermarkSettings.tsx +103 -0
  204. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/ContentSettings.tsx +100 -0
  205. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/FooterSettings.tsx +71 -0
  206. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/HeaderSettings.tsx +63 -0
  207. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/LayoutMode.tsx +73 -0
  208. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/SiderSettings.tsx +124 -0
  209. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/TabSettings.tsx +95 -0
  210. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/ThemeLayout.tsx +32 -0
  211. package/templates/admin-shell/layouts/modules/theme-drawer/modules/preset/ThemePreset.tsx +132 -0
  212. package/templates/admin-shell/layouts/options.tsx +79 -0
  213. package/templates/admin-shell/layouts/setup.ts +102 -0
  214. package/templates/admin-shell/layouts/state/AdminEffect.tsx +56 -0
  215. package/templates/admin-shell/layouts/state/AdminTabEffect.tsx +28 -0
  216. package/templates/admin-shell/layouts/state/index.ts +3 -0
  217. package/templates/admin-shell/layouts/state/menus/MenuToggler.tsx +53 -0
  218. package/templates/admin-shell/layouts/state/menus/use-admin-menu-badges.ts +46 -0
  219. package/templates/admin-shell/layouts/state/menus/use-admin-menus.tsx +164 -0
  220. package/templates/admin-shell/layouts/state/tabs/index.ts +1 -0
  221. package/templates/admin-shell/layouts/state/tabs/shared.tsx +148 -0
  222. package/templates/admin-shell/layouts/state/tabs/use-admin-tab.ts +377 -0
  223. package/templates/admin-shell/layouts/state/use-admin-state.ts +118 -0
  224. package/templates/admin-shell/layouts/types/router.d.ts +10 -0
  225. package/templates/admin-shell/layouts/types/storage.ts +18 -0
  226. package/templates/admin-shell/notification/NotificationButton.tsx +91 -0
  227. package/templates/admin-shell/notification/NotificationContext.ts +8 -0
  228. package/templates/admin-shell/notification/NotificationPanel.tsx +194 -0
  229. package/templates/admin-shell/notification/NotificationProvider.tsx +59 -0
  230. package/templates/admin-shell/notification/index.ts +12 -0
  231. package/templates/admin-shell/notification/mock.ts +59 -0
  232. package/templates/admin-shell/notification/notification-store.ts +438 -0
  233. package/templates/admin-shell/notification/notification.css +60 -0
  234. package/templates/admin-shell/notification/types.ts +104 -0
  235. package/templates/admin-shell/notification/use-notification.ts +51 -0
  236. package/templates/admin-shell/notification/useNotificationContext.ts +14 -0
  237. package/templates/admin-shell/runtime/app-update.ts +156 -0
  238. package/templates/admin-shell/runtime/dayjs.ts +20 -0
  239. package/templates/admin-shell/runtime/iconify.ts +17 -0
  240. package/templates/admin-shell/runtime/index.ts +10 -0
  241. package/templates/admin-shell/runtime/nprogress.ts +25 -0
  242. package/templates/admin-shell/runtime/plugins.ts +62 -0
  243. package/templates/admin-shell/styles/global.css +54 -0
  244. package/templates/admin-shell/styles/nprogress.css +85 -0
  245. package/templates/admin-shell/styles/reset.css +378 -0
  246. package/templates/admin-shell/theme/antd/AntdProvider.tsx +106 -0
  247. package/templates/admin-shell/theme/antd/index.ts +23 -0
  248. package/templates/admin-shell/theme/antd/shared.ts +80 -0
  249. package/templates/admin-shell/theme/antd/ui.ts +250 -0
  250. package/templates/admin-shell/theme/antd-algorithm/algorithm/dark/colors.ts +99 -0
  251. package/templates/admin-shell/theme/antd-algorithm/algorithm/dark/index.ts +87 -0
  252. package/templates/admin-shell/theme/antd-algorithm/algorithm/default/colors.ts +91 -0
  253. package/templates/admin-shell/theme/antd-algorithm/algorithm/default/index.ts +77 -0
  254. package/templates/admin-shell/theme/antd-algorithm/index.ts +80 -0
  255. package/templates/admin-shell/theme/antd-algorithm/seed/index.ts +41 -0
  256. package/templates/admin-shell/theme/antd-algorithm/shared/colorAlgorithm.ts +10 -0
  257. package/templates/admin-shell/theme/antd-algorithm/shared/genColorMapToken.ts +165 -0
  258. package/templates/admin-shell/theme/antd-algorithm/shared/genCommonMapToken.ts +23 -0
  259. package/templates/admin-shell/theme/antd-algorithm/shared/genControlHeight.ts +14 -0
  260. package/templates/admin-shell/theme/antd-algorithm/shared/genFontMapToken.ts +274 -0
  261. package/templates/admin-shell/theme/antd-algorithm/shared/genRadiusMapToken.ts +139 -0
  262. package/templates/admin-shell/theme/antd-algorithm/shared/genSizeMapToken.ts +114 -0
  263. package/templates/admin-shell/theme/antd-algorithm/types/index.ts +20 -0
  264. package/templates/admin-shell/theme/components/ThemeEffect.tsx +55 -0
  265. package/templates/admin-shell/theme/components/ThemeSchemaSegmented.tsx +27 -0
  266. package/templates/admin-shell/theme/components/ThemeSchemaSwitch.tsx +77 -0
  267. package/templates/admin-shell/theme/components/shared.ts +5 -0
  268. package/templates/admin-shell/theme/config/default.ts +108 -0
  269. package/templates/admin-shell/theme/config/index.ts +1 -0
  270. package/templates/admin-shell/theme/hooks/index.ts +2 -0
  271. package/templates/admin-shell/theme/hooks/use-theme.ts +244 -0
  272. package/templates/admin-shell/theme/index.ts +78 -0
  273. package/templates/admin-shell/theme/presets/azir.json +39 -0
  274. package/templates/admin-shell/theme/presets/compact.json +38 -0
  275. package/templates/admin-shell/theme/presets/dark.json +93 -0
  276. package/templates/admin-shell/theme/presets/default.json +95 -0
  277. package/templates/admin-shell/theme/presets/index.ts +29 -0
  278. package/templates/admin-shell/theme/presets/shadcn.json +99 -0
  279. package/templates/admin-shell/theme/setup.ts +115 -0
  280. package/templates/admin-shell/theme/types/index.ts +27 -0
  281. package/templates/admin-shell/theme/types/theme.d.ts +316 -0
  282. package/templates/admin-shell/theme/utils/dark-mode.ts +46 -0
  283. package/templates/admin-shell/theme/utils/filters.ts +20 -0
  284. package/templates/admin-shell/theme/utils/index.ts +3 -0
  285. package/templates/admin-shell/theme/utils/settings.ts +43 -0
  286. package/templates/admin-shell/types/api/auth.d.ts +148 -0
  287. package/templates/admin-shell/types/api/common.d.ts +54 -0
  288. package/templates/admin-shell/types/api/route.d.ts +104 -0
  289. package/templates/admin-shell/types/api/service.d.ts +51 -0
  290. package/templates/admin-shell/types/api/system-manage.d.ts +160 -0
  291. package/templates/admin-shell/types/app/common.d.ts +31 -0
  292. package/templates/admin-shell/types/app/global.d.ts +71 -0
  293. package/templates/admin-shell/types/app/menu.d.ts +57 -0
  294. package/templates/admin-shell/types/app/router.d.ts +201 -0
  295. package/templates/admin-shell/types/app/storage.d.ts +10 -0
  296. package/templates/admin-shell/types/app/union-key.d.ts +156 -0
  297. package/templates/admin-shell/types/locales/i18n.d.ts +135 -0
  298. package/templates/admin-shell/ui/antd/components/AppTree.tsx +62 -0
  299. package/templates/admin-shell/ui/antd/components/BeyondHiding.tsx +42 -0
  300. package/templates/admin-shell/ui/antd/components/ButtonIcon.tsx +123 -0
  301. package/templates/admin-shell/ui/antd/components/ButtonLink.tsx +30 -0
  302. package/templates/admin-shell/ui/antd/components/ErrorBoundary.tsx +45 -0
  303. package/templates/admin-shell/ui/antd/components/ExceptionBase.tsx +69 -0
  304. package/templates/admin-shell/ui/antd/components/FullScreen.tsx +33 -0
  305. package/templates/admin-shell/ui/antd/components/PinToggler.tsx +35 -0
  306. package/templates/admin-shell/ui/antd/components/ReloadButton.tsx +20 -0
  307. package/templates/admin-shell/ui/antd/components/index.ts +12 -0
  308. package/templates/admin-shell/ui/antd/components/styles/button-icon-animations.css +246 -0
  309. package/templates/admin-shell/ui/antd/index.ts +1 -0
  310. package/templates/admin-shell/ui/antd/styles.d.ts +1 -0
  311. package/templates/admin-shell/ui/compose/animate-feature.ts +5 -0
  312. package/templates/admin-shell/ui/compose/components/BetterScroll.tsx +51 -0
  313. package/templates/admin-shell/ui/compose/components/DarkModeContainer.tsx +22 -0
  314. package/templates/admin-shell/ui/compose/components/FlipText.tsx +41 -0
  315. package/templates/admin-shell/ui/compose/components/I18nLabel.tsx +18 -0
  316. package/templates/admin-shell/ui/compose/components/LazyAnimate.tsx +10 -0
  317. package/templates/admin-shell/ui/compose/components/LookForward.tsx +24 -0
  318. package/templates/admin-shell/ui/compose/components/NumberTicker.tsx +105 -0
  319. package/templates/admin-shell/ui/compose/components/Portal.tsx +74 -0
  320. package/templates/admin-shell/ui/compose/components/SvgIcon.tsx +39 -0
  321. package/templates/admin-shell/ui/compose/components/TypingAnimation.tsx +83 -0
  322. package/templates/admin-shell/ui/compose/components/WaveBg.tsx +56 -0
  323. package/templates/admin-shell/ui/compose/components/index.ts +11 -0
  324. package/templates/admin-shell/ui/compose/index.ts +2 -0
  325. package/templates/admin-shell/ui/compose/table/DragContent.tsx +239 -0
  326. package/templates/admin-shell/ui/compose/table/TableHeaderOperation.tsx +210 -0
  327. package/templates/admin-shell/ui/compose/table/hooks.ts +196 -0
  328. package/templates/admin-shell/ui/compose/table/index.ts +16 -0
  329. package/templates/admin-shell/ui/compose/table/types.ts +244 -0
  330. package/templates/admin-shell/ui/compose/table/use-table-operate.ts +136 -0
  331. package/templates/admin-shell/ui/compose/table/use-table-scroll.ts +49 -0
  332. package/templates/admin-shell/ui/compose/table/use-table.ts +303 -0
  333. package/templates/admin.meta.json +756 -0
@@ -0,0 +1,58 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { Button, Switch, Tooltip } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import SettingItem from '../../components/SettingItem';
6
+
7
+ import CustomPicker from './CustomPicker';
8
+
9
+ const ThemeColor = () => {
10
+ const { t } = useTranslation();
11
+
12
+ const { isInfoFollowPrimary, recommendColor, setSettings, themeColor, themeColors } = useSettingsTheme();
13
+
14
+ function handleRecommendColorChange(value: boolean) {
15
+ setSettings({ recommendColor: value });
16
+ }
17
+
18
+ return (
19
+ <div className="flex-col-stretch gap-12px">
20
+ <Tooltip
21
+ placement="topLeft"
22
+ title={
23
+ <p>
24
+ <span className="pr-12px">{t('theme.appearance.recommendColorDesc')}</span>
25
+ <br />
26
+ <Button
27
+ className="text-gray"
28
+ href="https://uicolors.app/create"
29
+ rel="noopener noreferrer"
30
+ target="_blank"
31
+ type="link"
32
+ >
33
+ https://uicolors.app/create
34
+ </Button>
35
+ </p>
36
+ }
37
+ >
38
+ <div>
39
+ <SettingItem key="recommend-color" label={t('theme.appearance.recommendColor')}>
40
+ <Switch checked={recommendColor} onChange={handleRecommendColorChange} />
41
+ </SettingItem>
42
+ </div>
43
+ </Tooltip>
44
+ {Object.entries(themeColors).map(([key, value], index) => (
45
+ <CustomPicker
46
+ index={index}
47
+ isInfoFollowPrimary={isInfoFollowPrimary}
48
+ key={key}
49
+ label={key}
50
+ theme={themeColor}
51
+ value={value as string}
52
+ />
53
+ ))}
54
+ </div>
55
+ );
56
+ };
57
+
58
+ export default ThemeColor;
@@ -0,0 +1,42 @@
1
+ // oxlint-disable import/no-unassigned-import
2
+ import { ThemeSchemaSegmented, useSettingsTheme } from '@shell/theme';
3
+ import { Switch as ASwitch } from 'antd';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ import AnimatedCollapse from '../../components/AnimatedCollapse';
7
+ import SettingItem from '../../components/SettingItem';
8
+
9
+ const DarkMode = () => {
10
+ const { t } = useTranslation();
11
+
12
+ const { colourWeakness, darkMode, grayscale, setColourWeakness, setGrayscale, setSettings, sider } =
13
+ useSettingsTheme();
14
+
15
+ const handleSiderInvertedChange = (value: boolean) => {
16
+ setSettings({ sider: { ...sider, inverted: value } });
17
+ };
18
+
19
+ return (
20
+ <div className="flex-col-stretch gap-16px">
21
+ <div className="i-flex-center">
22
+ <ThemeSchemaSegmented />
23
+ </div>
24
+
25
+ <AnimatedCollapse visible={!darkMode}>
26
+ <SettingItem label={t('theme.layout.sider.inverted')}>
27
+ <ASwitch checked={sider.inverted} onChange={handleSiderInvertedChange} />
28
+ </SettingItem>
29
+ </AnimatedCollapse>
30
+
31
+ <SettingItem label={t('theme.appearance.grayscale')}>
32
+ <ASwitch checked={grayscale} onChange={setGrayscale} />
33
+ </SettingItem>
34
+
35
+ <SettingItem label={t('theme.appearance.colourWeakness')}>
36
+ <ASwitch checked={colourWeakness} onChange={setColourWeakness} />
37
+ </SettingItem>
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default DarkMode;
@@ -0,0 +1,44 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { InputNumber as AInputNumber } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import SettingItem from '../../components/SettingItem';
6
+
7
+ const ThemeToken = () => {
8
+ const { t } = useTranslation();
9
+
10
+ const { setSettings, themeRadius, themeTextSize } = useSettingsTheme();
11
+
12
+ function handleThemeRadiusChange(value: number | null) {
13
+ if (value === null) return;
14
+
15
+ setSettings({ themeRadius: value });
16
+ }
17
+
18
+ function handleThemeTextSizeChange(value: number | null) {
19
+ if (value === null) return;
20
+
21
+ setSettings({ themeTextSize: value });
22
+ }
23
+
24
+ return (
25
+ <div className="flex-col-stretch gap-12px">
26
+ <SettingItem label={t('theme.appearance.themeBase.textSize')}>
27
+ <AInputNumber className="w-120px" min={0} step={1} value={themeTextSize} onChange={handleThemeTextSizeChange} />
28
+ </SettingItem>
29
+
30
+ <SettingItem label={t('theme.appearance.themeBase.radius')}>
31
+ <AInputNumber
32
+ className="w-120px"
33
+ max={16}
34
+ min={0}
35
+ step={1}
36
+ value={themeRadius}
37
+ onChange={handleThemeRadiusChange}
38
+ />
39
+ </SettingItem>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ export default ThemeToken;
@@ -0,0 +1,23 @@
1
+ import { Divider as ADivider } from 'antd';
2
+ import { useTranslation } from 'react-i18next';
3
+
4
+ import ThemeColor from './ThemeColor';
5
+ import ThemeSchema from './ThemeSchema';
6
+ import ThemeToken from './ThemeToken';
7
+
8
+ const Appearance = () => {
9
+ const { t } = useTranslation();
10
+
11
+ return (
12
+ <div className="flex-col-stretch gap-16px">
13
+ <ADivider>{t('theme.appearance.themeSchema.title')}</ADivider>
14
+ <ThemeSchema />
15
+ <ADivider>{t('theme.appearance.themeBase.title')}</ADivider>
16
+ <ThemeToken />
17
+ <ADivider>{t('theme.appearance.themeColor.title')}</ADivider>
18
+ <ThemeColor />
19
+ </div>
20
+ );
21
+ };
22
+
23
+ export default Appearance;
@@ -0,0 +1,57 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { Switch as ASwitch } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import SettingItem from '../../components/SettingItem';
6
+
7
+ const GlobalSettings = () => {
8
+ const { t } = useTranslation();
9
+
10
+ const { header, setSettings } = useSettingsTheme();
11
+
12
+ const updateMultilingual = (patch: Partial<typeof header.multilingual>) => {
13
+ setSettings({
14
+ header: {
15
+ ...header,
16
+ multilingual: {
17
+ ...header.multilingual,
18
+ ...patch
19
+ }
20
+ }
21
+ });
22
+ };
23
+
24
+ const updateGlobalSearch = (patch: Partial<typeof header.globalSearch>) => {
25
+ setSettings({
26
+ header: {
27
+ ...header,
28
+ globalSearch: {
29
+ ...header.globalSearch,
30
+ ...patch
31
+ }
32
+ }
33
+ });
34
+ };
35
+
36
+ const handleMultilingualVisibleChange = (visible: boolean) => {
37
+ updateMultilingual({ visible });
38
+ };
39
+
40
+ const handleGlobalSearchVisibleChange = (visible: boolean) => {
41
+ updateGlobalSearch({ visible });
42
+ };
43
+
44
+ return (
45
+ <>
46
+ <SettingItem label={t('theme.general.multilingual.visible')}>
47
+ <ASwitch checked={header.multilingual.visible} onChange={handleMultilingualVisibleChange} />
48
+ </SettingItem>
49
+
50
+ <SettingItem label={t('theme.general.globalSearch.visible')}>
51
+ <ASwitch checked={header.globalSearch.visible} onChange={handleGlobalSearchVisibleChange} />
52
+ </SettingItem>
53
+ </>
54
+ );
55
+ };
56
+
57
+ export default GlobalSettings;
@@ -0,0 +1,20 @@
1
+ import { Divider as ADivider } from 'antd';
2
+ import { useTranslation } from 'react-i18next';
3
+
4
+ import GlobalSettings from './GlobalSettings';
5
+ import WatermarkSettings from './WatermarkSettings';
6
+
7
+ const ThemeGeneral = () => {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <div className="flex-col-stretch gap-16px">
12
+ <ADivider>{t('theme.general.title')}</ADivider>
13
+ <GlobalSettings />
14
+ <ADivider>{t('theme.general.watermark.title')}</ADivider>
15
+ <WatermarkSettings />
16
+ </div>
17
+ );
18
+ };
19
+
20
+ export default ThemeGeneral;
@@ -0,0 +1,103 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { Input as AInput, Select as ASelect, Switch as ASwitch } from 'antd';
3
+ import { AnimatePresence } from 'motion/react';
4
+ import type { ChangeEvent } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+
7
+ import { watermarkTimeFormatOptions } from '../../../../options';
8
+
9
+ import AnimatedItem from '../../components/AnimatedItem';
10
+ import SettingItem from '../../components/SettingItem';
11
+
12
+ const WatermarkSettings = () => {
13
+ const { t } = useTranslation();
14
+
15
+ const { setSettings, setWatermarkEnableTime, setWatermarkEnableUserName, watermark } = useSettingsTheme();
16
+
17
+ const updateWatermark = (patch: Partial<typeof watermark>) => {
18
+ setSettings({
19
+ watermark: {
20
+ ...watermark,
21
+ ...patch
22
+ }
23
+ });
24
+ };
25
+
26
+ const handleVisibleChange = (visible: boolean) => {
27
+ updateWatermark({ visible });
28
+ };
29
+
30
+ const handleEnableUserNameChange = (enable: boolean) => {
31
+ setWatermarkEnableUserName(enable);
32
+ };
33
+
34
+ const handleEnableTimeChange = (enable: boolean) => {
35
+ setWatermarkEnableTime(enable);
36
+ };
37
+
38
+ const handleTimeFormatChange = (timeFormat: string) => {
39
+ updateWatermark({ timeFormat });
40
+ };
41
+
42
+ const handleEnableCustomTextChange = (enable: boolean) => {
43
+ updateWatermark({ enableCustomText: enable });
44
+ };
45
+
46
+ const handleTextChange = (e: ChangeEvent<HTMLInputElement>) => {
47
+ updateWatermark({ text: e.target.value });
48
+ };
49
+
50
+ return (
51
+ <div className="flex-col-stretch gap-12px">
52
+ <SettingItem label={t('theme.general.watermark.visible')}>
53
+ <ASwitch checked={watermark.visible} onChange={handleVisibleChange} />
54
+ </SettingItem>
55
+
56
+ <AnimatePresence initial={false} mode="popLayout">
57
+ <AnimatedItem className="flex-col-stretch gap-12px" key="enableCustomText" visible={watermark.visible}>
58
+ <SettingItem label={t('theme.general.watermark.enableCustomText')}>
59
+ <ASwitch checked={watermark.enableCustomText} onChange={handleEnableCustomTextChange} />
60
+ </SettingItem>
61
+ </AnimatedItem>
62
+
63
+ <AnimatedItem key="text" visible={watermark.visible && watermark.enableCustomText}>
64
+ <SettingItem label={t('theme.general.watermark.text')}>
65
+ <AInput
66
+ className="w-120px"
67
+ placeholder="SoybeanAdmin"
68
+ size="small"
69
+ value={watermark.text}
70
+ onChange={handleTextChange}
71
+ />
72
+ </SettingItem>
73
+ </AnimatedItem>
74
+
75
+ <AnimatedItem className="flex-col-stretch gap-12px" key="enableUserName" visible={watermark.visible}>
76
+ <SettingItem label={t('theme.general.watermark.enableUserName')}>
77
+ <ASwitch checked={watermark.enableUserName} onChange={handleEnableUserNameChange} />
78
+ </SettingItem>
79
+ </AnimatedItem>
80
+
81
+ <AnimatedItem key="enableTime" visible={watermark.visible}>
82
+ <SettingItem label={t('theme.general.watermark.enableTime')}>
83
+ <ASwitch checked={watermark.enableTime} onChange={handleEnableTimeChange} />
84
+ </SettingItem>
85
+ </AnimatedItem>
86
+
87
+ <AnimatedItem key="timeFormat" visible={watermark.visible && watermark.enableTime}>
88
+ <SettingItem label={t('theme.general.watermark.timeFormat')}>
89
+ <ASelect
90
+ className="w-210px"
91
+ options={watermarkTimeFormatOptions}
92
+ size="small"
93
+ value={watermark.timeFormat}
94
+ onChange={handleTimeFormatChange}
95
+ />
96
+ </SettingItem>
97
+ </AnimatedItem>
98
+ </AnimatePresence>
99
+ </div>
100
+ );
101
+ };
102
+
103
+ export default WatermarkSettings;
@@ -0,0 +1,100 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { SvgIcon } from '@shell/ui/compose';
3
+ import { Select as ASelect, Switch as ASwitch, Tooltip as ATooltip } from 'antd';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ import { themePageAnimationModeOptions, themeScrollModeOptions, translateOptions } from '../../../../options';
7
+
8
+ import AnimatedCollapse from '../../components/AnimatedCollapse';
9
+ import SettingItem from '../../components/SettingItem';
10
+
11
+ const ContentSettings = () => {
12
+ const { t } = useTranslation();
13
+
14
+ const { fixedHeaderAndTab, layout, page, setSettings } = useSettingsTheme();
15
+
16
+ const isWrapperScrollMode = layout.scrollMode === 'wrapper';
17
+
18
+ const scrollModeOptions = translateOptions(themeScrollModeOptions);
19
+
20
+ const pageAnimationModeOptions = translateOptions(themePageAnimationModeOptions);
21
+
22
+ const updateLayout = (patch: Partial<typeof layout>) => {
23
+ setSettings({
24
+ layout: {
25
+ ...layout,
26
+ ...patch
27
+ }
28
+ });
29
+ };
30
+
31
+ const updatePage = (patch: Partial<typeof page>) => {
32
+ setSettings({
33
+ page: {
34
+ ...page,
35
+ ...patch
36
+ }
37
+ });
38
+ };
39
+
40
+ const handleScrollModeChange = (scrollMode: UnionKey.ThemeScrollMode) => {
41
+ updateLayout({ scrollMode });
42
+ };
43
+
44
+ const handlePageAnimateChange = (animate: boolean) => {
45
+ updatePage({ animate });
46
+ };
47
+
48
+ const handlePageAnimateModeChange = (animateMode: UnionKey.ThemePageAnimateMode) => {
49
+ updatePage({ animateMode });
50
+ };
51
+
52
+ const handleFixedHeaderAndTabChange = (value: boolean) => {
53
+ setSettings({ fixedHeaderAndTab: value });
54
+ };
55
+
56
+ return (
57
+ <div className="flex-col-stretch gap-12px">
58
+ <SettingItem
59
+ label={t('theme.layout.content.scrollMode.title')}
60
+ suffix={
61
+ <ATooltip title={t('theme.layout.content.scrollMode.tip')}>
62
+ <SvgIcon className="text-icon-info" icon="mdi:information-outline" />
63
+ </ATooltip>
64
+ }
65
+ >
66
+ <ASelect
67
+ className="w-120px"
68
+ options={scrollModeOptions}
69
+ size="small"
70
+ value={layout.scrollMode}
71
+ onChange={handleScrollModeChange}
72
+ />
73
+ </SettingItem>
74
+
75
+ <SettingItem label={t('theme.layout.content.page.animate')}>
76
+ <ASwitch checked={page.animate} onChange={handlePageAnimateChange} />
77
+ </SettingItem>
78
+
79
+ <AnimatedCollapse visible={page.animate}>
80
+ <SettingItem label={t('theme.layout.content.page.mode.title')}>
81
+ <ASelect
82
+ className="w-120px"
83
+ options={pageAnimationModeOptions}
84
+ size="small"
85
+ value={page.animateMode}
86
+ onChange={handlePageAnimateModeChange}
87
+ />
88
+ </SettingItem>
89
+ </AnimatedCollapse>
90
+
91
+ <AnimatedCollapse visible={isWrapperScrollMode}>
92
+ <SettingItem label={t('theme.layout.content.fixedHeaderAndTab')}>
93
+ <ASwitch checked={fixedHeaderAndTab} onChange={handleFixedHeaderAndTabChange} />
94
+ </SettingItem>
95
+ </AnimatedCollapse>
96
+ </div>
97
+ );
98
+ };
99
+
100
+ export default ContentSettings;
@@ -0,0 +1,71 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { InputNumber as AInputNumber, Switch as ASwitch } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import { TOP_HYBRID_LAYOUT_MODES } from '../../../../constant';
6
+ import AnimatedCollapse from '../../components/AnimatedCollapse';
7
+ import SettingItem from '../../components/SettingItem';
8
+
9
+ const FooterSettings = () => {
10
+ const { t } = useTranslation();
11
+
12
+ const { footer, layout, setSettings } = useSettingsTheme();
13
+
14
+ const layoutMode = layout.mode;
15
+ const isWrapperScrollMode = layout.scrollMode === 'wrapper';
16
+ const isMixHorizontalMode = TOP_HYBRID_LAYOUT_MODES.includes(layoutMode);
17
+
18
+ const updateFooter = (patch: Partial<typeof footer>) => {
19
+ setSettings({
20
+ footer: {
21
+ ...footer,
22
+ ...patch
23
+ }
24
+ });
25
+ };
26
+
27
+ const handleVisibleChange = (visible: boolean) => {
28
+ updateFooter({ visible });
29
+ };
30
+
31
+ const handleFixedChange = (fixed: boolean) => {
32
+ updateFooter({ fixed });
33
+ };
34
+
35
+ const handleHeightChange = (height: number | null) => {
36
+ if (height === null) return;
37
+ updateFooter({ height });
38
+ };
39
+
40
+ const handleRightChange = (right: boolean) => {
41
+ updateFooter({ right });
42
+ };
43
+
44
+ return (
45
+ <div className="flex-col-stretch gap-12px">
46
+ <SettingItem label={t('theme.layout.footer.visible')}>
47
+ <ASwitch checked={footer.visible} onChange={handleVisibleChange} />
48
+ </SettingItem>
49
+
50
+ <AnimatedCollapse visible={footer.visible && isWrapperScrollMode}>
51
+ <SettingItem label={t('theme.layout.footer.fixed')}>
52
+ <ASwitch checked={footer.fixed} onChange={handleFixedChange} />
53
+ </SettingItem>
54
+ </AnimatedCollapse>
55
+
56
+ <AnimatedCollapse visible={footer.visible}>
57
+ <SettingItem label={t('theme.layout.footer.height')}>
58
+ <AInputNumber className="w-120px" min={0} step={1} value={footer.height} onChange={handleHeightChange} />
59
+ </SettingItem>
60
+ </AnimatedCollapse>
61
+
62
+ <AnimatedCollapse visible={footer.visible && isMixHorizontalMode}>
63
+ <SettingItem label={t('theme.layout.footer.right')}>
64
+ <ASwitch checked={footer.right} onChange={handleRightChange} />
65
+ </SettingItem>
66
+ </AnimatedCollapse>
67
+ </div>
68
+ );
69
+ };
70
+
71
+ export default FooterSettings;
@@ -0,0 +1,63 @@
1
+ import { useSettingsTheme } from '@shell/theme';
2
+ import { InputNumber as AInputNumber, Switch as ASwitch } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ import AnimatedCollapse from '../../components/AnimatedCollapse';
6
+ import SettingItem from '../../components/SettingItem';
7
+
8
+ const HeaderSettings = () => {
9
+ const { t } = useTranslation();
10
+
11
+ const { header, setSettings } = useSettingsTheme();
12
+
13
+ const updateHeader = (patch: Partial<typeof header>) => {
14
+ setSettings({
15
+ header: {
16
+ ...header,
17
+ ...patch
18
+ }
19
+ });
20
+ };
21
+
22
+ const updateBreadcrumb = (patch: Partial<typeof header.breadcrumb>) => {
23
+ updateHeader({
24
+ breadcrumb: {
25
+ ...header.breadcrumb,
26
+ ...patch
27
+ }
28
+ });
29
+ };
30
+
31
+ const handleHeightChange = (height: number | null) => {
32
+ if (height === null) return;
33
+ updateHeader({ height });
34
+ };
35
+
36
+ const handleBreadcrumbVisibleChange = (visible: boolean) => {
37
+ updateBreadcrumb({ visible });
38
+ };
39
+
40
+ const handleBreadcrumbShowIconChange = (showIcon: boolean) => {
41
+ updateBreadcrumb({ showIcon });
42
+ };
43
+
44
+ return (
45
+ <div className="flex-col-stretch gap-12px">
46
+ <SettingItem label={t('theme.layout.header.height')}>
47
+ <AInputNumber className="w-120px" min={0} step={1} value={header.height} onChange={handleHeightChange} />
48
+ </SettingItem>
49
+
50
+ <SettingItem label={t('theme.layout.header.breadcrumb.visible')}>
51
+ <ASwitch checked={header.breadcrumb.visible} onChange={handleBreadcrumbVisibleChange} />
52
+ </SettingItem>
53
+
54
+ <AnimatedCollapse visible={header.breadcrumb.visible}>
55
+ <SettingItem label={t('theme.layout.header.breadcrumb.showIcon')}>
56
+ <ASwitch checked={header.breadcrumb.showIcon} onChange={handleBreadcrumbShowIconChange} />
57
+ </SettingItem>
58
+ </AnimatedCollapse>
59
+ </div>
60
+ );
61
+ };
62
+
63
+ export default HeaderSettings;
@@ -0,0 +1,73 @@
1
+ import {
2
+ LAYOUT_MODE_HORIZONTAL,
3
+ LAYOUT_MODE_TOP_HYBRID_HEADER_FIRST,
4
+ LAYOUT_MODE_TOP_HYBRID_SIDEBAR_FIRST,
5
+ LAYOUT_MODE_VERTICAL,
6
+ LAYOUT_MODE_VERTICAL_HYBRID_HEADER_FIRST,
7
+ LAYOUT_MODE_VERTICAL_MIX
8
+ } from '../../../../constant';
9
+ import LayoutModeCard from '../../components/LayoutModeCard';
10
+
11
+ const LAYOUTS_COMPONENTS: Record<UnionKey.ThemeLayoutMode, React.ReactNode> = {
12
+ [LAYOUT_MODE_HORIZONTAL]: (
13
+ <>
14
+ <div className="h-16px rd-4px bg-primary" />
15
+ <div className="flex flex-1 gap-6px">
16
+ <div className="flex-1 rd-4px bg-primary-200" />
17
+ </div>
18
+ </>
19
+ ),
20
+ [LAYOUT_MODE_TOP_HYBRID_HEADER_FIRST]: (
21
+ <>
22
+ <div className="h-16px rd-4px bg-primary" />
23
+ <div className="flex flex-1 gap-6px">
24
+ <div className="w-18px rd-4px bg-primary-300" />
25
+ <div className="flex-1 rd-4px bg-primary-200" />
26
+ </div>
27
+ </>
28
+ ),
29
+ [LAYOUT_MODE_TOP_HYBRID_SIDEBAR_FIRST]: (
30
+ <>
31
+ <div className="h-16px rd-4px bg-primary-300" />
32
+ <div className="flex flex-1 gap-6px">
33
+ <div className="w-18px rd-4px bg-primary" />
34
+ <div className="flex-1 rd-4px bg-primary-200" />
35
+ </div>
36
+ </>
37
+ ),
38
+ [LAYOUT_MODE_VERTICAL]: (
39
+ <>
40
+ <div className="h-full w-18px rd-4px bg-primary" />
41
+ <div className="flex-col flex-1 gap-6px">
42
+ <div className="h-16px rd-4px bg-primary-200" />
43
+ <div className="flex-1 rd-4px bg-primary-200" />
44
+ </div>
45
+ </>
46
+ ),
47
+ [LAYOUT_MODE_VERTICAL_HYBRID_HEADER_FIRST]: (
48
+ <>
49
+ <div className="h-full w-8px rd-4px bg-primary" />
50
+ <div className="h-full w-16px rd-4px bg-primary-300" />
51
+ <div className="flex-col flex-1 gap-6px">
52
+ <div className="h-16px rd-4px bg-primary" />
53
+ <div className="flex-1 rd-4px bg-primary-200" />
54
+ </div>
55
+ </>
56
+ ),
57
+ [LAYOUT_MODE_VERTICAL_MIX]: (
58
+ <>
59
+ <div className="h-full w-8px rd-4px bg-primary" />
60
+ <div className="h-full w-16px rd-4px bg-primary-300" />
61
+ <div className="flex-col flex-1 gap-6px">
62
+ <div className="h-16px rd-4px bg-primary-200" />
63
+ <div className="flex-1 rd-4px bg-primary-200" />
64
+ </div>
65
+ </>
66
+ )
67
+ };
68
+
69
+ const LayoutMode = () => {
70
+ return <LayoutModeCard {...LAYOUTS_COMPONENTS} />;
71
+ };
72
+
73
+ export default LayoutMode;