@lark-apaas/coding-templates 0.1.3 → 0.1.5

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 (261) hide show
  1. package/package.json +2 -3
  2. package/template-vite-react/_gitignore +24 -0
  3. package/template-vite-react/client/index.html +13 -0
  4. package/template-vite-react/client/public/favicon.svg +1 -0
  5. package/template-vite-react/client/public/icons.svg +24 -0
  6. package/template-vite-react/client/src/api/index.ts +7 -0
  7. package/template-vite-react/client/src/app.tsx +19 -0
  8. package/{template-nextjs-static → template-vite-react/client}/src/components/header.tsx +5 -13
  9. package/template-vite-react/client/src/components/layout.tsx +13 -0
  10. package/template-vite-react/client/src/components/theme-provider.tsx +45 -0
  11. package/template-vite-react/client/src/components/ui/accordion.tsx +72 -0
  12. package/template-vite-react/client/src/components/ui/alert-dialog.tsx +187 -0
  13. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/alert.tsx +15 -10
  14. package/template-vite-react/client/src/components/ui/aspect-ratio.tsx +22 -0
  15. package/template-vite-react/client/src/components/ui/avatar.tsx +109 -0
  16. package/template-vite-react/client/src/components/ui/badge.tsx +52 -0
  17. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/breadcrumb.tsx +39 -23
  18. package/template-vite-react/client/src/components/ui/button.tsx +58 -0
  19. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/calendar.tsx +43 -37
  20. package/template-vite-react/client/src/components/ui/card.tsx +103 -0
  21. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/carousel.tsx +8 -7
  22. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/chart.tsx +49 -35
  23. package/template-vite-react/client/src/components/ui/checkbox.tsx +29 -0
  24. package/template-vite-react/client/src/components/ui/collapsible.tsx +19 -0
  25. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/command.tsx +40 -52
  26. package/template-vite-react/client/src/components/ui/context-menu.tsx +271 -0
  27. package/template-vite-react/client/src/components/ui/dialog.tsx +158 -0
  28. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/drawer.tsx +9 -12
  29. package/template-vite-react/client/src/components/ui/dropdown-menu.tsx +268 -0
  30. package/template-vite-react/client/src/components/ui/hover-card.tsx +49 -0
  31. package/template-vite-react/client/src/components/ui/input-group.tsx +156 -0
  32. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/input-otp.tsx +17 -7
  33. package/template-vite-react/client/src/components/ui/input.tsx +20 -0
  34. package/template-vite-react/client/src/components/ui/label.tsx +18 -0
  35. package/template-vite-react/client/src/components/ui/menubar.tsx +280 -0
  36. package/template-vite-react/client/src/components/ui/navigation-menu.tsx +168 -0
  37. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/pagination.tsx +35 -32
  38. package/template-vite-react/client/src/components/ui/popover.tsx +90 -0
  39. package/template-vite-react/client/src/components/ui/progress.tsx +81 -0
  40. package/template-vite-react/client/src/components/ui/radio-group.tsx +38 -0
  41. package/template-vite-react/client/src/components/ui/resizable.tsx +48 -0
  42. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/scroll-area.tsx +10 -13
  43. package/template-vite-react/client/src/components/ui/select.tsx +199 -0
  44. package/template-vite-react/client/src/components/ui/separator.tsx +25 -0
  45. package/template-vite-react/client/src/components/ui/sheet.tsx +138 -0
  46. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/sidebar.tsx +156 -162
  47. package/{template-nextjs-static → template-vite-react/client}/src/components/ui/skeleton.tsx +1 -1
  48. package/template-vite-react/client/src/components/ui/slider.tsx +57 -0
  49. package/template-vite-react/client/src/components/ui/sonner.tsx +49 -0
  50. package/template-vite-react/client/src/components/ui/switch.tsx +30 -0
  51. package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/table.tsx +5 -5
  52. package/template-vite-react/client/src/components/ui/tabs.tsx +80 -0
  53. package/template-vite-react/client/src/components/ui/textarea.tsx +18 -0
  54. package/template-vite-react/client/src/components/ui/toggle-group.tsx +89 -0
  55. package/template-vite-react/client/src/components/ui/toggle.tsx +44 -0
  56. package/template-vite-react/client/src/components/ui/tooltip.tsx +64 -0
  57. package/template-vite-react/client/src/index.css +1 -0
  58. package/template-vite-react/client/src/main.tsx +13 -0
  59. package/template-vite-react/client/src/pages/home/index.tsx +12 -0
  60. package/template-vite-react/client/src/pages/not-found/index.tsx +11 -0
  61. package/template-vite-react/client/src/types/index.ts +1 -0
  62. package/{template-nextjs-static → template-vite-react}/components.json +2 -2
  63. package/template-vite-react/eslint.config.js +23 -0
  64. package/template-vite-react/package.json +58 -0
  65. package/template-vite-react/scripts/build.sh +40 -0
  66. package/template-vite-react/shared/types.ts +1 -0
  67. package/template-vite-react/tsconfig.app.json +33 -0
  68. package/template-vite-react/tsconfig.json +14 -0
  69. package/template-vite-react/tsconfig.node.json +26 -0
  70. package/template-vite-react/vite.config.ts +22 -0
  71. package/template-nextjs-fullstack/README.md +0 -169
  72. package/template-nextjs-fullstack/_env.local.example +0 -1
  73. package/template-nextjs-fullstack/_gitignore +0 -41
  74. package/template-nextjs-fullstack/components.json +0 -25
  75. package/template-nextjs-fullstack/drizzle.config.ts +0 -10
  76. package/template-nextjs-fullstack/eslint.config.js +0 -15
  77. package/template-nextjs-fullstack/next.config.ts +0 -5
  78. package/template-nextjs-fullstack/package.json +0 -85
  79. package/template-nextjs-fullstack/postcss.config.js +0 -8
  80. package/template-nextjs-fullstack/scripts/build.sh +0 -37
  81. package/template-nextjs-fullstack/src/app/favicon.ico +0 -0
  82. package/template-nextjs-fullstack/src/app/globals.css +0 -130
  83. package/template-nextjs-fullstack/src/app/layout.tsx +0 -24
  84. package/template-nextjs-fullstack/src/app/page.tsx +0 -69
  85. package/template-nextjs-fullstack/src/app/todos/actions.ts +0 -37
  86. package/template-nextjs-fullstack/src/app/todos/page.tsx +0 -26
  87. package/template-nextjs-fullstack/src/app/todos/todo-form.tsx +0 -27
  88. package/template-nextjs-fullstack/src/app/todos/todo-list.tsx +0 -44
  89. package/template-nextjs-fullstack/src/components/header.tsx +0 -32
  90. package/template-nextjs-fullstack/src/components/theme-provider.tsx +0 -8
  91. package/template-nextjs-fullstack/src/components/ui/README.md +0 -134
  92. package/template-nextjs-fullstack/src/components/ui/accordion.tsx +0 -66
  93. package/template-nextjs-fullstack/src/components/ui/alert-dialog.tsx +0 -157
  94. package/template-nextjs-fullstack/src/components/ui/aspect-ratio.tsx +0 -11
  95. package/template-nextjs-fullstack/src/components/ui/avatar.tsx +0 -53
  96. package/template-nextjs-fullstack/src/components/ui/badge.tsx +0 -42
  97. package/template-nextjs-fullstack/src/components/ui/button.tsx +0 -69
  98. package/template-nextjs-fullstack/src/components/ui/calendar.tsx +0 -213
  99. package/template-nextjs-fullstack/src/components/ui/card.tsx +0 -82
  100. package/template-nextjs-fullstack/src/components/ui/chart.tsx +0 -357
  101. package/template-nextjs-fullstack/src/components/ui/checkbox.tsx +0 -32
  102. package/template-nextjs-fullstack/src/components/ui/collapsible.tsx +0 -33
  103. package/template-nextjs-fullstack/src/components/ui/context-menu.tsx +0 -324
  104. package/template-nextjs-fullstack/src/components/ui/dialog.tsx +0 -143
  105. package/template-nextjs-fullstack/src/components/ui/drawer.tsx +0 -135
  106. package/template-nextjs-fullstack/src/components/ui/dropdown-menu.tsx +0 -329
  107. package/template-nextjs-fullstack/src/components/ui/hover-card.tsx +0 -44
  108. package/template-nextjs-fullstack/src/components/ui/input-group.tsx +0 -166
  109. package/template-nextjs-fullstack/src/components/ui/input-otp.tsx +0 -77
  110. package/template-nextjs-fullstack/src/components/ui/input.tsx +0 -21
  111. package/template-nextjs-fullstack/src/components/ui/label.tsx +0 -24
  112. package/template-nextjs-fullstack/src/components/ui/menubar.tsx +0 -348
  113. package/template-nextjs-fullstack/src/components/ui/navigation-menu.tsx +0 -168
  114. package/template-nextjs-fullstack/src/components/ui/pagination.tsx +0 -127
  115. package/template-nextjs-fullstack/src/components/ui/popover.tsx +0 -48
  116. package/template-nextjs-fullstack/src/components/ui/progress.tsx +0 -31
  117. package/template-nextjs-fullstack/src/components/ui/radio-group.tsx +0 -45
  118. package/template-nextjs-fullstack/src/components/ui/resizable.tsx +0 -56
  119. package/template-nextjs-fullstack/src/components/ui/select.tsx +0 -243
  120. package/template-nextjs-fullstack/src/components/ui/separator.tsx +0 -28
  121. package/template-nextjs-fullstack/src/components/ui/sheet.tsx +0 -139
  122. package/template-nextjs-fullstack/src/components/ui/skeleton.tsx +0 -13
  123. package/template-nextjs-fullstack/src/components/ui/slider.tsx +0 -87
  124. package/template-nextjs-fullstack/src/components/ui/sonner.tsx +0 -67
  125. package/template-nextjs-fullstack/src/components/ui/switch.tsx +0 -31
  126. package/template-nextjs-fullstack/src/components/ui/tabs.tsx +0 -66
  127. package/template-nextjs-fullstack/src/components/ui/textarea.tsx +0 -18
  128. package/template-nextjs-fullstack/src/components/ui/toggle-group.tsx +0 -83
  129. package/template-nextjs-fullstack/src/components/ui/toggle.tsx +0 -47
  130. package/template-nextjs-fullstack/src/components/ui/tooltip.tsx +0 -61
  131. package/template-nextjs-fullstack/src/db/index.ts +0 -8
  132. package/template-nextjs-fullstack/src/db/schema.ts +0 -11
  133. package/template-nextjs-fullstack/tailwind.config.ts +0 -10
  134. package/template-nextjs-fullstack/tsconfig.json +0 -34
  135. package/template-nextjs-static/README.md +0 -80
  136. package/template-nextjs-static/_gitignore +0 -41
  137. package/template-nextjs-static/eslint.config.js +0 -15
  138. package/template-nextjs-static/next.config.ts +0 -8
  139. package/template-nextjs-static/package.json +0 -77
  140. package/template-nextjs-static/postcss.config.js +0 -8
  141. package/template-nextjs-static/public/favicon.ico +0 -0
  142. package/template-nextjs-static/scripts/build.sh +0 -36
  143. package/template-nextjs-static/src/components/theme-provider.tsx +0 -6
  144. package/template-nextjs-static/src/components/ui/README.md +0 -134
  145. package/template-nextjs-static/src/components/ui/accordion.tsx +0 -66
  146. package/template-nextjs-static/src/components/ui/alert-dialog.tsx +0 -157
  147. package/template-nextjs-static/src/components/ui/alert.tsx +0 -71
  148. package/template-nextjs-static/src/components/ui/aspect-ratio.tsx +0 -11
  149. package/template-nextjs-static/src/components/ui/avatar.tsx +0 -53
  150. package/template-nextjs-static/src/components/ui/badge.tsx +0 -42
  151. package/template-nextjs-static/src/components/ui/breadcrumb.tsx +0 -109
  152. package/template-nextjs-static/src/components/ui/button-group.tsx +0 -83
  153. package/template-nextjs-static/src/components/ui/button.tsx +0 -69
  154. package/template-nextjs-static/src/components/ui/card.tsx +0 -82
  155. package/template-nextjs-static/src/components/ui/carousel.tsx +0 -241
  156. package/template-nextjs-static/src/components/ui/checkbox.tsx +0 -32
  157. package/template-nextjs-static/src/components/ui/collapsible.tsx +0 -33
  158. package/template-nextjs-static/src/components/ui/command.tsx +0 -208
  159. package/template-nextjs-static/src/components/ui/context-menu.tsx +0 -324
  160. package/template-nextjs-static/src/components/ui/dialog.tsx +0 -143
  161. package/template-nextjs-static/src/components/ui/dropdown-menu.tsx +0 -329
  162. package/template-nextjs-static/src/components/ui/empty.tsx +0 -104
  163. package/template-nextjs-static/src/components/ui/field.tsx +0 -248
  164. package/template-nextjs-static/src/components/ui/form.tsx +0 -167
  165. package/template-nextjs-static/src/components/ui/hover-card.tsx +0 -44
  166. package/template-nextjs-static/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -21
  167. package/template-nextjs-static/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -36
  168. package/template-nextjs-static/src/components/ui/icons/file-android-colorful-icon.tsx +0 -33
  169. package/template-nextjs-static/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -21
  170. package/template-nextjs-static/src/components/ui/icons/file-code-colorful-icon.tsx +0 -28
  171. package/template-nextjs-static/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -21
  172. package/template-nextjs-static/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -29
  173. package/template-nextjs-static/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -25
  174. package/template-nextjs-static/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -29
  175. package/template-nextjs-static/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -29
  176. package/template-nextjs-static/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -21
  177. package/template-nextjs-static/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -21
  178. package/template-nextjs-static/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -21
  179. package/template-nextjs-static/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -29
  180. package/template-nextjs-static/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -23
  181. package/template-nextjs-static/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -27
  182. package/template-nextjs-static/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -20
  183. package/template-nextjs-static/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -21
  184. package/template-nextjs-static/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -12
  185. package/template-nextjs-static/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -14
  186. package/template-nextjs-static/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -23
  187. package/template-nextjs-static/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -38
  188. package/template-nextjs-static/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -21
  189. package/template-nextjs-static/src/components/ui/image.tsx +0 -183
  190. package/template-nextjs-static/src/components/ui/input-group.tsx +0 -166
  191. package/template-nextjs-static/src/components/ui/input.tsx +0 -21
  192. package/template-nextjs-static/src/components/ui/item.tsx +0 -193
  193. package/template-nextjs-static/src/components/ui/kbd.tsx +0 -28
  194. package/template-nextjs-static/src/components/ui/label.tsx +0 -24
  195. package/template-nextjs-static/src/components/ui/menubar.tsx +0 -348
  196. package/template-nextjs-static/src/components/ui/native-select.tsx +0 -48
  197. package/template-nextjs-static/src/components/ui/navigation-menu.tsx +0 -168
  198. package/template-nextjs-static/src/components/ui/popover.tsx +0 -48
  199. package/template-nextjs-static/src/components/ui/progress.tsx +0 -31
  200. package/template-nextjs-static/src/components/ui/radio-group.tsx +0 -45
  201. package/template-nextjs-static/src/components/ui/resizable.tsx +0 -56
  202. package/template-nextjs-static/src/components/ui/scroll-area.tsx +0 -58
  203. package/template-nextjs-static/src/components/ui/select.tsx +0 -243
  204. package/template-nextjs-static/src/components/ui/separator.tsx +0 -28
  205. package/template-nextjs-static/src/components/ui/sheet.tsx +0 -139
  206. package/template-nextjs-static/src/components/ui/sidebar.tsx +0 -727
  207. package/template-nextjs-static/src/components/ui/slider.tsx +0 -87
  208. package/template-nextjs-static/src/components/ui/sonner.tsx +0 -67
  209. package/template-nextjs-static/src/components/ui/spinner.tsx +0 -16
  210. package/template-nextjs-static/src/components/ui/streamdown.tsx +0 -186
  211. package/template-nextjs-static/src/components/ui/switch.tsx +0 -31
  212. package/template-nextjs-static/src/components/ui/table.tsx +0 -116
  213. package/template-nextjs-static/src/components/ui/tabs.tsx +0 -66
  214. package/template-nextjs-static/src/components/ui/textarea.tsx +0 -18
  215. package/template-nextjs-static/src/components/ui/toggle-group.tsx +0 -83
  216. package/template-nextjs-static/src/components/ui/toggle.tsx +0 -47
  217. package/template-nextjs-static/src/components/ui/tooltip.tsx +0 -61
  218. package/template-nextjs-static/src/hooks/use-mobile.ts +0 -19
  219. package/template-nextjs-static/src/lib/utils.ts +0 -6
  220. package/template-nextjs-static/src/pages/_app.tsx +0 -11
  221. package/template-nextjs-static/src/pages/_document.tsx +0 -13
  222. package/template-nextjs-static/src/pages/hello.tsx +0 -32
  223. package/template-nextjs-static/src/pages/index.tsx +0 -76
  224. package/template-nextjs-static/src/styles/globals.css +0 -143
  225. package/template-nextjs-static/tailwind.config.ts +0 -10
  226. package/template-nextjs-static/tsconfig.json +0 -34
  227. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/button-group.tsx +0 -0
  228. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/empty.tsx +0 -0
  229. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/field.tsx +0 -0
  230. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/form.tsx +0 -0
  231. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -0
  232. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -0
  233. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-android-colorful-icon.tsx +0 -0
  234. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -0
  235. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-code-colorful-icon.tsx +0 -0
  236. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -0
  237. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -0
  238. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -0
  239. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -0
  240. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -0
  241. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -0
  242. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -0
  243. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -0
  244. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -0
  245. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -0
  246. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -0
  247. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -0
  248. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -0
  249. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -0
  250. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -0
  251. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -0
  252. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -0
  253. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -0
  254. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/image.tsx +0 -0
  255. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/item.tsx +0 -0
  256. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/kbd.tsx +0 -0
  257. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/native-select.tsx +0 -0
  258. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/spinner.tsx +0 -0
  259. /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/streamdown.tsx +0 -0
  260. /package/{template-nextjs-fullstack → template-vite-react/client}/src/hooks/use-mobile.ts +0 -0
  261. /package/{template-nextjs-fullstack → template-vite-react/client}/src/lib/utils.ts +0 -0
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-templates",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "OpenClaw project templates for mclaw CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "files": [
9
9
  "template-html",
10
- "template-nextjs-static",
11
- "template-nextjs-fullstack",
10
+ "template-vite-react",
12
11
  "meta.json"
13
12
  ],
14
13
  "keywords": [
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>{{projectName}}</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
@@ -0,0 +1,7 @@
1
+ // API 层示例
2
+ // 根据实际后端接口补充
3
+
4
+ export async function fetchExample() {
5
+ const response = await fetch("/api/example");
6
+ return response.json();
7
+ }
@@ -0,0 +1,19 @@
1
+ import { BrowserRouter, Routes, Route } from "react-router-dom";
2
+ import { Layout } from "@/components/layout";
3
+ import HomePage from "@/pages/home";
4
+ import NotFoundPage from "@/pages/not-found";
5
+
6
+ declare const __APP_BASE_PATH__: string;
7
+
8
+ export default function App() {
9
+ return (
10
+ <BrowserRouter basename={__APP_BASE_PATH__}>
11
+ <Routes>
12
+ <Route element={<Layout />}>
13
+ <Route index element={<HomePage />} />
14
+ <Route path="*" element={<NotFoundPage />} />
15
+ </Route>
16
+ </Routes>
17
+ </BrowserRouter>
18
+ );
19
+ }
@@ -1,7 +1,5 @@
1
1
  import { Moon, Sun } from "lucide-react";
2
- import { useTheme } from "next-themes";
3
- import { Button } from "@/components/ui/button";
4
- import Link from "next/link";
2
+ import { useTheme } from "@/components/theme-provider";
5
3
 
6
4
  export function Header() {
7
5
  const { theme, setTheme } = useTheme();
@@ -9,21 +7,15 @@ export function Header() {
9
7
  return (
10
8
  <header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
11
9
  <div className="container flex h-14 items-center justify-between mx-auto px-4">
12
- <div className="flex items-center gap-6">
13
- <Link href="/" className="font-semibold">OpenClaw</Link>
14
- <nav className="flex items-center gap-4 text-sm">
15
- <Link href="/hello" className="text-muted-foreground hover:text-foreground transition-colors">Hello</Link>
16
- </nav>
17
- </div>
18
- <Button
19
- variant="ghost"
20
- size="icon"
10
+ <a href="/" className="font-semibold">OpenClaw</a>
11
+ <button
12
+ className="inline-flex items-center justify-center rounded-md h-9 w-9 hover:bg-accent hover:text-accent-foreground transition-colors"
21
13
  onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
22
14
  >
23
15
  <Sun className="h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
24
16
  <Moon className="absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
25
17
  <span className="sr-only">切换主题</span>
26
- </Button>
18
+ </button>
27
19
  </div>
28
20
  </header>
29
21
  );
@@ -0,0 +1,13 @@
1
+ import { Outlet } from "react-router-dom";
2
+ import { Header } from "@/components/header";
3
+
4
+ export function Layout() {
5
+ return (
6
+ <div className="min-h-screen bg-background text-foreground">
7
+ <Header />
8
+ <main className="container mx-auto px-4 py-8">
9
+ <Outlet />
10
+ </main>
11
+ </div>
12
+ );
13
+ }
@@ -0,0 +1,45 @@
1
+ import { createContext, useContext, useEffect, useState } from "react";
2
+
3
+ type Theme = "light" | "dark" | "system";
4
+
5
+ const ThemeContext = createContext<{
6
+ theme: Theme;
7
+ setTheme: (theme: Theme) => void;
8
+ }>({ theme: "system", setTheme: () => {} });
9
+
10
+ export function useTheme() {
11
+ return useContext(ThemeContext);
12
+ }
13
+
14
+ export function ThemeProvider({
15
+ children,
16
+ defaultTheme = "system",
17
+ }: {
18
+ children: React.ReactNode;
19
+ defaultTheme?: Theme;
20
+ }) {
21
+ const [theme, setTheme] = useState<Theme>(
22
+ () => (localStorage.getItem("theme") as Theme) || defaultTheme,
23
+ );
24
+
25
+ useEffect(() => {
26
+ const root = document.documentElement;
27
+ root.classList.remove("light", "dark");
28
+
29
+ const resolved =
30
+ theme === "system"
31
+ ? window.matchMedia("(prefers-color-scheme: dark)").matches
32
+ ? "dark"
33
+ : "light"
34
+ : theme;
35
+
36
+ root.classList.add(resolved);
37
+ localStorage.setItem("theme", theme);
38
+ }, [theme]);
39
+
40
+ return (
41
+ <ThemeContext.Provider value={{ theme, setTheme }}>
42
+ {children}
43
+ </ThemeContext.Provider>
44
+ );
45
+ }
@@ -0,0 +1,72 @@
1
+ import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
2
+
3
+ import { cn } from "@/lib/utils"
4
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
5
+
6
+ function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
7
+ return (
8
+ <AccordionPrimitive.Root
9
+ data-slot="accordion"
10
+ className={cn("flex w-full flex-col", className)}
11
+ {...props}
12
+ />
13
+ )
14
+ }
15
+
16
+ function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
17
+ return (
18
+ <AccordionPrimitive.Item
19
+ data-slot="accordion-item"
20
+ className={cn("not-last:border-b", className)}
21
+ {...props}
22
+ />
23
+ )
24
+ }
25
+
26
+ function AccordionTrigger({
27
+ className,
28
+ children,
29
+ ...props
30
+ }: AccordionPrimitive.Trigger.Props) {
31
+ return (
32
+ <AccordionPrimitive.Header className="flex">
33
+ <AccordionPrimitive.Trigger
34
+ data-slot="accordion-trigger"
35
+ className={cn(
36
+ "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
37
+ className
38
+ )}
39
+ {...props}
40
+ >
41
+ {children}
42
+ <ChevronDownIcon data-slot="accordion-trigger-icon" className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
43
+ <ChevronUpIcon data-slot="accordion-trigger-icon" className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
44
+ </AccordionPrimitive.Trigger>
45
+ </AccordionPrimitive.Header>
46
+ )
47
+ }
48
+
49
+ function AccordionContent({
50
+ className,
51
+ children,
52
+ ...props
53
+ }: AccordionPrimitive.Panel.Props) {
54
+ return (
55
+ <AccordionPrimitive.Panel
56
+ data-slot="accordion-content"
57
+ className="overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
58
+ {...props}
59
+ >
60
+ <div
61
+ className={cn(
62
+ "h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
63
+ className
64
+ )}
65
+ >
66
+ {children}
67
+ </div>
68
+ </AccordionPrimitive.Panel>
69
+ )
70
+ }
71
+
72
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -0,0 +1,187 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
5
+
6
+ import { cn } from "@/lib/utils"
7
+ import { Button } from "@/components/ui/button"
8
+
9
+ function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
10
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
11
+ }
12
+
13
+ function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
14
+ return (
15
+ <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
16
+ )
17
+ }
18
+
19
+ function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
20
+ return (
21
+ <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
22
+ )
23
+ }
24
+
25
+ function AlertDialogOverlay({
26
+ className,
27
+ ...props
28
+ }: AlertDialogPrimitive.Backdrop.Props) {
29
+ return (
30
+ <AlertDialogPrimitive.Backdrop
31
+ data-slot="alert-dialog-overlay"
32
+ className={cn(
33
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ )
39
+ }
40
+
41
+ function AlertDialogContent({
42
+ className,
43
+ size = "default",
44
+ ...props
45
+ }: AlertDialogPrimitive.Popup.Props & {
46
+ size?: "default" | "sm"
47
+ }) {
48
+ return (
49
+ <AlertDialogPortal>
50
+ <AlertDialogOverlay />
51
+ <AlertDialogPrimitive.Popup
52
+ data-slot="alert-dialog-content"
53
+ data-size={size}
54
+ className={cn(
55
+ "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
56
+ className
57
+ )}
58
+ {...props}
59
+ />
60
+ </AlertDialogPortal>
61
+ )
62
+ }
63
+
64
+ function AlertDialogHeader({
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<"div">) {
68
+ return (
69
+ <div
70
+ data-slot="alert-dialog-header"
71
+ className={cn(
72
+ "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
73
+ className
74
+ )}
75
+ {...props}
76
+ />
77
+ )
78
+ }
79
+
80
+ function AlertDialogFooter({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="alert-dialog-footer"
87
+ className={cn(
88
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ function AlertDialogMedia({
97
+ className,
98
+ ...props
99
+ }: React.ComponentProps<"div">) {
100
+ return (
101
+ <div
102
+ data-slot="alert-dialog-media"
103
+ className={cn(
104
+ "mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
105
+ className
106
+ )}
107
+ {...props}
108
+ />
109
+ )
110
+ }
111
+
112
+ function AlertDialogTitle({
113
+ className,
114
+ ...props
115
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
116
+ return (
117
+ <AlertDialogPrimitive.Title
118
+ data-slot="alert-dialog-title"
119
+ className={cn(
120
+ "text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
121
+ className
122
+ )}
123
+ {...props}
124
+ />
125
+ )
126
+ }
127
+
128
+ function AlertDialogDescription({
129
+ className,
130
+ ...props
131
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
132
+ return (
133
+ <AlertDialogPrimitive.Description
134
+ data-slot="alert-dialog-description"
135
+ className={cn(
136
+ "text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
137
+ className
138
+ )}
139
+ {...props}
140
+ />
141
+ )
142
+ }
143
+
144
+ function AlertDialogAction({
145
+ className,
146
+ ...props
147
+ }: React.ComponentProps<typeof Button>) {
148
+ return (
149
+ <Button
150
+ data-slot="alert-dialog-action"
151
+ className={cn(className)}
152
+ {...props}
153
+ />
154
+ )
155
+ }
156
+
157
+ function AlertDialogCancel({
158
+ className,
159
+ variant = "outline",
160
+ size = "default",
161
+ ...props
162
+ }: AlertDialogPrimitive.Close.Props &
163
+ Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
164
+ return (
165
+ <AlertDialogPrimitive.Close
166
+ data-slot="alert-dialog-cancel"
167
+ className={cn(className)}
168
+ render={<Button variant={variant} size={size} />}
169
+ {...props}
170
+ />
171
+ )
172
+ }
173
+
174
+ export {
175
+ AlertDialog,
176
+ AlertDialogAction,
177
+ AlertDialogCancel,
178
+ AlertDialogContent,
179
+ AlertDialogDescription,
180
+ AlertDialogFooter,
181
+ AlertDialogHeader,
182
+ AlertDialogMedia,
183
+ AlertDialogOverlay,
184
+ AlertDialogPortal,
185
+ AlertDialogTitle,
186
+ AlertDialogTrigger,
187
+ }
@@ -4,18 +4,13 @@ import { cva, type VariantProps } from "class-variance-authority"
4
4
  import { cn } from "@/lib/utils"
5
5
 
6
6
  const alertVariants = cva(
7
- "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
7
+ "group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
11
  default: "bg-card text-card-foreground",
12
12
  destructive:
13
- "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
14
- // 新增语义化 success/warning variant
15
- success:
16
- "bg-success text-success-foreground border-success/50 [&>svg]:text-success-foreground *:data-[slot=alert-description]:text-success-foreground/90",
17
- warning:
18
- "bg-warning text-warning-foreground border-warning/50 [&>svg]:text-warning-foreground *:data-[slot=alert-description]:text-warning-foreground/90",
13
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
19
14
  },
20
15
  },
21
16
  defaultVariants: {
@@ -44,7 +39,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
44
39
  <div
45
40
  data-slot="alert-title"
46
41
  className={cn(
47
- "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
42
+ "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
48
43
  className
49
44
  )}
50
45
  {...props}
@@ -60,7 +55,7 @@ function AlertDescription({
60
55
  <div
61
56
  data-slot="alert-description"
62
57
  className={cn(
63
- "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
58
+ "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
64
59
  className
65
60
  )}
66
61
  {...props}
@@ -68,4 +63,14 @@ function AlertDescription({
68
63
  )
69
64
  }
70
65
 
71
- export { Alert, AlertTitle, AlertDescription }
66
+ function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
67
+ return (
68
+ <div
69
+ data-slot="alert-action"
70
+ className={cn("absolute top-2 right-2", className)}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ export { Alert, AlertTitle, AlertDescription, AlertAction }
@@ -0,0 +1,22 @@
1
+ import { cn } from "@/lib/utils"
2
+
3
+ function AspectRatio({
4
+ ratio,
5
+ className,
6
+ ...props
7
+ }: React.ComponentProps<"div"> & { ratio: number }) {
8
+ return (
9
+ <div
10
+ data-slot="aspect-ratio"
11
+ style={
12
+ {
13
+ "--ratio": ratio,
14
+ } as React.CSSProperties
15
+ }
16
+ className={cn("relative aspect-(--ratio)", className)}
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ export { AspectRatio }