@lark-apaas/coding-templates 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +128 -0
  3. package/meta.json +22 -0
  4. package/package.json +22 -0
  5. package/template-html/README.md +148 -0
  6. package/template-html/_gitignore +2 -0
  7. package/template-html/index.html +22 -0
  8. package/template-html/package.json +12 -0
  9. package/template-html/routes.json +1 -0
  10. package/template-html/scripts/build.sh +31 -0
  11. package/template-nextjs-fullstack/README.md +169 -0
  12. package/template-nextjs-fullstack/_env.local.example +1 -0
  13. package/template-nextjs-fullstack/_gitignore +41 -0
  14. package/template-nextjs-fullstack/components.json +25 -0
  15. package/template-nextjs-fullstack/drizzle.config.ts +10 -0
  16. package/template-nextjs-fullstack/eslint.config.js +15 -0
  17. package/template-nextjs-fullstack/next.config.ts +5 -0
  18. package/template-nextjs-fullstack/package.json +85 -0
  19. package/template-nextjs-fullstack/postcss.config.js +8 -0
  20. package/template-nextjs-fullstack/scripts/build.sh +37 -0
  21. package/template-nextjs-fullstack/src/app/favicon.ico +0 -0
  22. package/template-nextjs-fullstack/src/app/globals.css +130 -0
  23. package/template-nextjs-fullstack/src/app/layout.tsx +24 -0
  24. package/template-nextjs-fullstack/src/app/page.tsx +69 -0
  25. package/template-nextjs-fullstack/src/app/todos/actions.ts +37 -0
  26. package/template-nextjs-fullstack/src/app/todos/page.tsx +26 -0
  27. package/template-nextjs-fullstack/src/app/todos/todo-form.tsx +27 -0
  28. package/template-nextjs-fullstack/src/app/todos/todo-list.tsx +44 -0
  29. package/template-nextjs-fullstack/src/components/header.tsx +32 -0
  30. package/template-nextjs-fullstack/src/components/theme-provider.tsx +8 -0
  31. package/template-nextjs-fullstack/src/components/ui/README.md +134 -0
  32. package/template-nextjs-fullstack/src/components/ui/accordion.tsx +66 -0
  33. package/template-nextjs-fullstack/src/components/ui/alert-dialog.tsx +157 -0
  34. package/template-nextjs-fullstack/src/components/ui/alert.tsx +71 -0
  35. package/template-nextjs-fullstack/src/components/ui/aspect-ratio.tsx +11 -0
  36. package/template-nextjs-fullstack/src/components/ui/avatar.tsx +53 -0
  37. package/template-nextjs-fullstack/src/components/ui/badge.tsx +42 -0
  38. package/template-nextjs-fullstack/src/components/ui/breadcrumb.tsx +109 -0
  39. package/template-nextjs-fullstack/src/components/ui/button-group.tsx +83 -0
  40. package/template-nextjs-fullstack/src/components/ui/button.tsx +69 -0
  41. package/template-nextjs-fullstack/src/components/ui/calendar.tsx +213 -0
  42. package/template-nextjs-fullstack/src/components/ui/card.tsx +82 -0
  43. package/template-nextjs-fullstack/src/components/ui/carousel.tsx +241 -0
  44. package/template-nextjs-fullstack/src/components/ui/chart.tsx +357 -0
  45. package/template-nextjs-fullstack/src/components/ui/checkbox.tsx +32 -0
  46. package/template-nextjs-fullstack/src/components/ui/collapsible.tsx +33 -0
  47. package/template-nextjs-fullstack/src/components/ui/command.tsx +208 -0
  48. package/template-nextjs-fullstack/src/components/ui/context-menu.tsx +324 -0
  49. package/template-nextjs-fullstack/src/components/ui/dialog.tsx +143 -0
  50. package/template-nextjs-fullstack/src/components/ui/drawer.tsx +135 -0
  51. package/template-nextjs-fullstack/src/components/ui/dropdown-menu.tsx +329 -0
  52. package/template-nextjs-fullstack/src/components/ui/empty.tsx +104 -0
  53. package/template-nextjs-fullstack/src/components/ui/field.tsx +248 -0
  54. package/template-nextjs-fullstack/src/components/ui/form.tsx +167 -0
  55. package/template-nextjs-fullstack/src/components/ui/hover-card.tsx +44 -0
  56. package/template-nextjs-fullstack/src/components/ui/icons/file-ae-colorful-icon.tsx +21 -0
  57. package/template-nextjs-fullstack/src/components/ui/icons/file-ai-colorful-icon.tsx +36 -0
  58. package/template-nextjs-fullstack/src/components/ui/icons/file-android-colorful-icon.tsx +33 -0
  59. package/template-nextjs-fullstack/src/components/ui/icons/file-audio-colorful-icon.tsx +21 -0
  60. package/template-nextjs-fullstack/src/components/ui/icons/file-code-colorful-icon.tsx +28 -0
  61. package/template-nextjs-fullstack/src/components/ui/icons/file-csv-colorful-icon.tsx +21 -0
  62. package/template-nextjs-fullstack/src/components/ui/icons/file-eml-colorful-icon.tsx +29 -0
  63. package/template-nextjs-fullstack/src/components/ui/icons/file-ios-colorful-icon.tsx +25 -0
  64. package/template-nextjs-fullstack/src/components/ui/icons/file-keynote-colorful-icon.tsx +29 -0
  65. package/template-nextjs-fullstack/src/components/ui/icons/file-pages-colorful-icon.tsx +29 -0
  66. package/template-nextjs-fullstack/src/components/ui/icons/file-ps-colorful-icon.tsx +21 -0
  67. package/template-nextjs-fullstack/src/components/ui/icons/file-sketch-colorful-icon.tsx +21 -0
  68. package/template-nextjs-fullstack/src/components/ui/icons/file-slide-colorful-icon.tsx +21 -0
  69. package/template-nextjs-fullstack/src/components/ui/icons/file-vcf-colorful-icon.tsx +29 -0
  70. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +23 -0
  71. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +27 -0
  72. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +20 -0
  73. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +21 -0
  74. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +12 -0
  75. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +14 -0
  76. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +23 -0
  77. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +38 -0
  78. package/template-nextjs-fullstack/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +21 -0
  79. package/template-nextjs-fullstack/src/components/ui/image.tsx +183 -0
  80. package/template-nextjs-fullstack/src/components/ui/input-group.tsx +166 -0
  81. package/template-nextjs-fullstack/src/components/ui/input-otp.tsx +77 -0
  82. package/template-nextjs-fullstack/src/components/ui/input.tsx +21 -0
  83. package/template-nextjs-fullstack/src/components/ui/item.tsx +193 -0
  84. package/template-nextjs-fullstack/src/components/ui/kbd.tsx +28 -0
  85. package/template-nextjs-fullstack/src/components/ui/label.tsx +24 -0
  86. package/template-nextjs-fullstack/src/components/ui/menubar.tsx +348 -0
  87. package/template-nextjs-fullstack/src/components/ui/native-select.tsx +48 -0
  88. package/template-nextjs-fullstack/src/components/ui/navigation-menu.tsx +168 -0
  89. package/template-nextjs-fullstack/src/components/ui/pagination.tsx +127 -0
  90. package/template-nextjs-fullstack/src/components/ui/popover.tsx +48 -0
  91. package/template-nextjs-fullstack/src/components/ui/progress.tsx +31 -0
  92. package/template-nextjs-fullstack/src/components/ui/radio-group.tsx +45 -0
  93. package/template-nextjs-fullstack/src/components/ui/resizable.tsx +56 -0
  94. package/template-nextjs-fullstack/src/components/ui/scroll-area.tsx +58 -0
  95. package/template-nextjs-fullstack/src/components/ui/select.tsx +243 -0
  96. package/template-nextjs-fullstack/src/components/ui/separator.tsx +28 -0
  97. package/template-nextjs-fullstack/src/components/ui/sheet.tsx +139 -0
  98. package/template-nextjs-fullstack/src/components/ui/sidebar.tsx +727 -0
  99. package/template-nextjs-fullstack/src/components/ui/skeleton.tsx +13 -0
  100. package/template-nextjs-fullstack/src/components/ui/slider.tsx +87 -0
  101. package/template-nextjs-fullstack/src/components/ui/sonner.tsx +67 -0
  102. package/template-nextjs-fullstack/src/components/ui/spinner.tsx +16 -0
  103. package/template-nextjs-fullstack/src/components/ui/streamdown.tsx +186 -0
  104. package/template-nextjs-fullstack/src/components/ui/switch.tsx +31 -0
  105. package/template-nextjs-fullstack/src/components/ui/table.tsx +116 -0
  106. package/template-nextjs-fullstack/src/components/ui/tabs.tsx +66 -0
  107. package/template-nextjs-fullstack/src/components/ui/textarea.tsx +18 -0
  108. package/template-nextjs-fullstack/src/components/ui/toggle-group.tsx +83 -0
  109. package/template-nextjs-fullstack/src/components/ui/toggle.tsx +47 -0
  110. package/template-nextjs-fullstack/src/components/ui/tooltip.tsx +61 -0
  111. package/template-nextjs-fullstack/src/db/index.ts +8 -0
  112. package/template-nextjs-fullstack/src/db/schema.ts +11 -0
  113. package/template-nextjs-fullstack/src/hooks/use-mobile.ts +19 -0
  114. package/template-nextjs-fullstack/src/lib/utils.ts +6 -0
  115. package/template-nextjs-fullstack/tailwind.config.ts +10 -0
  116. package/template-nextjs-fullstack/tsconfig.json +34 -0
  117. package/template-nextjs-static/README.md +80 -0
  118. package/template-nextjs-static/_gitignore +41 -0
  119. package/template-nextjs-static/components.json +25 -0
  120. package/template-nextjs-static/eslint.config.js +15 -0
  121. package/template-nextjs-static/next.config.ts +8 -0
  122. package/template-nextjs-static/package.json +77 -0
  123. package/template-nextjs-static/postcss.config.js +8 -0
  124. package/template-nextjs-static/public/favicon.ico +0 -0
  125. package/template-nextjs-static/scripts/build.sh +36 -0
  126. package/template-nextjs-static/src/components/header.tsx +30 -0
  127. package/template-nextjs-static/src/components/theme-provider.tsx +6 -0
  128. package/template-nextjs-static/src/components/ui/README.md +134 -0
  129. package/template-nextjs-static/src/components/ui/accordion.tsx +66 -0
  130. package/template-nextjs-static/src/components/ui/alert-dialog.tsx +157 -0
  131. package/template-nextjs-static/src/components/ui/alert.tsx +71 -0
  132. package/template-nextjs-static/src/components/ui/aspect-ratio.tsx +11 -0
  133. package/template-nextjs-static/src/components/ui/avatar.tsx +53 -0
  134. package/template-nextjs-static/src/components/ui/badge.tsx +42 -0
  135. package/template-nextjs-static/src/components/ui/breadcrumb.tsx +109 -0
  136. package/template-nextjs-static/src/components/ui/button-group.tsx +83 -0
  137. package/template-nextjs-static/src/components/ui/button.tsx +69 -0
  138. package/template-nextjs-static/src/components/ui/calendar.tsx +213 -0
  139. package/template-nextjs-static/src/components/ui/card.tsx +82 -0
  140. package/template-nextjs-static/src/components/ui/carousel.tsx +241 -0
  141. package/template-nextjs-static/src/components/ui/chart.tsx +357 -0
  142. package/template-nextjs-static/src/components/ui/checkbox.tsx +32 -0
  143. package/template-nextjs-static/src/components/ui/collapsible.tsx +33 -0
  144. package/template-nextjs-static/src/components/ui/command.tsx +208 -0
  145. package/template-nextjs-static/src/components/ui/context-menu.tsx +324 -0
  146. package/template-nextjs-static/src/components/ui/dialog.tsx +143 -0
  147. package/template-nextjs-static/src/components/ui/drawer.tsx +135 -0
  148. package/template-nextjs-static/src/components/ui/dropdown-menu.tsx +329 -0
  149. package/template-nextjs-static/src/components/ui/empty.tsx +104 -0
  150. package/template-nextjs-static/src/components/ui/field.tsx +248 -0
  151. package/template-nextjs-static/src/components/ui/form.tsx +167 -0
  152. package/template-nextjs-static/src/components/ui/hover-card.tsx +44 -0
  153. package/template-nextjs-static/src/components/ui/icons/file-ae-colorful-icon.tsx +21 -0
  154. package/template-nextjs-static/src/components/ui/icons/file-ai-colorful-icon.tsx +36 -0
  155. package/template-nextjs-static/src/components/ui/icons/file-android-colorful-icon.tsx +33 -0
  156. package/template-nextjs-static/src/components/ui/icons/file-audio-colorful-icon.tsx +21 -0
  157. package/template-nextjs-static/src/components/ui/icons/file-code-colorful-icon.tsx +28 -0
  158. package/template-nextjs-static/src/components/ui/icons/file-csv-colorful-icon.tsx +21 -0
  159. package/template-nextjs-static/src/components/ui/icons/file-eml-colorful-icon.tsx +29 -0
  160. package/template-nextjs-static/src/components/ui/icons/file-ios-colorful-icon.tsx +25 -0
  161. package/template-nextjs-static/src/components/ui/icons/file-keynote-colorful-icon.tsx +29 -0
  162. package/template-nextjs-static/src/components/ui/icons/file-pages-colorful-icon.tsx +29 -0
  163. package/template-nextjs-static/src/components/ui/icons/file-ps-colorful-icon.tsx +21 -0
  164. package/template-nextjs-static/src/components/ui/icons/file-sketch-colorful-icon.tsx +21 -0
  165. package/template-nextjs-static/src/components/ui/icons/file-slide-colorful-icon.tsx +21 -0
  166. package/template-nextjs-static/src/components/ui/icons/file-vcf-colorful-icon.tsx +29 -0
  167. package/template-nextjs-static/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +23 -0
  168. package/template-nextjs-static/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +27 -0
  169. package/template-nextjs-static/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +20 -0
  170. package/template-nextjs-static/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +21 -0
  171. package/template-nextjs-static/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +12 -0
  172. package/template-nextjs-static/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +14 -0
  173. package/template-nextjs-static/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +23 -0
  174. package/template-nextjs-static/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +38 -0
  175. package/template-nextjs-static/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +21 -0
  176. package/template-nextjs-static/src/components/ui/image.tsx +183 -0
  177. package/template-nextjs-static/src/components/ui/input-group.tsx +166 -0
  178. package/template-nextjs-static/src/components/ui/input-otp.tsx +77 -0
  179. package/template-nextjs-static/src/components/ui/input.tsx +21 -0
  180. package/template-nextjs-static/src/components/ui/item.tsx +193 -0
  181. package/template-nextjs-static/src/components/ui/kbd.tsx +28 -0
  182. package/template-nextjs-static/src/components/ui/label.tsx +24 -0
  183. package/template-nextjs-static/src/components/ui/menubar.tsx +348 -0
  184. package/template-nextjs-static/src/components/ui/native-select.tsx +48 -0
  185. package/template-nextjs-static/src/components/ui/navigation-menu.tsx +168 -0
  186. package/template-nextjs-static/src/components/ui/pagination.tsx +127 -0
  187. package/template-nextjs-static/src/components/ui/popover.tsx +48 -0
  188. package/template-nextjs-static/src/components/ui/progress.tsx +31 -0
  189. package/template-nextjs-static/src/components/ui/radio-group.tsx +45 -0
  190. package/template-nextjs-static/src/components/ui/resizable.tsx +56 -0
  191. package/template-nextjs-static/src/components/ui/scroll-area.tsx +58 -0
  192. package/template-nextjs-static/src/components/ui/select.tsx +243 -0
  193. package/template-nextjs-static/src/components/ui/separator.tsx +28 -0
  194. package/template-nextjs-static/src/components/ui/sheet.tsx +139 -0
  195. package/template-nextjs-static/src/components/ui/sidebar.tsx +727 -0
  196. package/template-nextjs-static/src/components/ui/skeleton.tsx +13 -0
  197. package/template-nextjs-static/src/components/ui/slider.tsx +87 -0
  198. package/template-nextjs-static/src/components/ui/sonner.tsx +67 -0
  199. package/template-nextjs-static/src/components/ui/spinner.tsx +16 -0
  200. package/template-nextjs-static/src/components/ui/streamdown.tsx +186 -0
  201. package/template-nextjs-static/src/components/ui/switch.tsx +31 -0
  202. package/template-nextjs-static/src/components/ui/table.tsx +116 -0
  203. package/template-nextjs-static/src/components/ui/tabs.tsx +66 -0
  204. package/template-nextjs-static/src/components/ui/textarea.tsx +18 -0
  205. package/template-nextjs-static/src/components/ui/toggle-group.tsx +83 -0
  206. package/template-nextjs-static/src/components/ui/toggle.tsx +47 -0
  207. package/template-nextjs-static/src/components/ui/tooltip.tsx +61 -0
  208. package/template-nextjs-static/src/hooks/use-mobile.ts +19 -0
  209. package/template-nextjs-static/src/lib/utils.ts +6 -0
  210. package/template-nextjs-static/src/pages/_app.tsx +11 -0
  211. package/template-nextjs-static/src/pages/_document.tsx +13 -0
  212. package/template-nextjs-static/src/pages/hello.tsx +32 -0
  213. package/template-nextjs-static/src/pages/index.tsx +76 -0
  214. package/template-nextjs-static/src/styles/globals.css +143 -0
  215. package/template-nextjs-static/tailwind.config.ts +10 -0
  216. package/template-nextjs-static/tsconfig.json +34 -0
@@ -0,0 +1,47 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as TogglePrimitive from "@radix-ui/react-toggle"
5
+ import { cva, type VariantProps } from "class-variance-authority"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const toggleVariants = cva(
10
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-normal enabled:hover:bg-muted enabled:hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline:
16
+ "border border-input bg-transparent enabled:hover:bg-accent enabled:hover:text-accent-foreground",
17
+ },
18
+ size: {
19
+ default: "h-9 px-2 min-w-9",
20
+ sm: "h-8 px-1.5 min-w-8",
21
+ lg: "h-10 px-2.5 min-w-10",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ }
29
+ )
30
+
31
+ function Toggle({
32
+ className,
33
+ variant,
34
+ size,
35
+ ...props
36
+ }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
+ VariantProps<typeof toggleVariants>) {
38
+ return (
39
+ <TogglePrimitive.Root
40
+ data-slot="toggle"
41
+ className={cn(toggleVariants({ variant, size, className }))}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ export { Toggle, toggleVariants }
@@ -0,0 +1,61 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function TooltipProvider({
9
+ delayDuration = 0,
10
+ ...props
11
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
12
+ return (
13
+ <TooltipPrimitive.Provider
14
+ data-slot="tooltip-provider"
15
+ delayDuration={delayDuration}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ function Tooltip({
22
+ ...props
23
+ }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
24
+ return (
25
+ <TooltipProvider>
26
+ <TooltipPrimitive.Root data-slot="tooltip" {...props} />
27
+ </TooltipProvider>
28
+ )
29
+ }
30
+
31
+ function TooltipTrigger({
32
+ ...props
33
+ }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
34
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
35
+ }
36
+
37
+ function TooltipContent({
38
+ className,
39
+ sideOffset = 0,
40
+ children,
41
+ ...props
42
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
43
+ return (
44
+ <TooltipPrimitive.Portal>
45
+ <TooltipPrimitive.Content
46
+ data-slot="tooltip-content"
47
+ sideOffset={sideOffset}
48
+ className={cn(
49
+ "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance shadow-md",
50
+ className
51
+ )}
52
+ {...props}
53
+ >
54
+ {children}
55
+ <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
56
+ </TooltipPrimitive.Content>
57
+ </TooltipPrimitive.Portal>
58
+ )
59
+ }
60
+
61
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
@@ -0,0 +1,19 @@
1
+ import * as React from "react"
2
+
3
+ const MOBILE_BREAKPOINT = 768
4
+
5
+ export function useIsMobile() {
6
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
+
8
+ React.useEffect(() => {
9
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
+ const onChange = () => {
11
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
+ }
13
+ mql.addEventListener("change", onChange)
14
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
+ return () => mql.removeEventListener("change", onChange)
16
+ }, [])
17
+
18
+ return !!isMobile
19
+ }
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -0,0 +1,11 @@
1
+ import type { AppProps } from "next/app";
2
+ import { ThemeProvider } from "@/components/theme-provider";
3
+ import "@/styles/globals.css";
4
+
5
+ export default function App({ Component, pageProps }: AppProps) {
6
+ return (
7
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
8
+ <Component {...pageProps} />
9
+ </ThemeProvider>
10
+ );
11
+ }
@@ -0,0 +1,13 @@
1
+ import { Html, Head, Main, NextScript } from "next/document";
2
+
3
+ export default function Document() {
4
+ return (
5
+ <Html lang="en">
6
+ <Head />
7
+ <body className="antialiased">
8
+ <Main />
9
+ <NextScript />
10
+ </body>
11
+ </Html>
12
+ );
13
+ }
@@ -0,0 +1,32 @@
1
+ import Head from "next/head";
2
+ import { Header } from "@/components/header";
3
+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
4
+
5
+ export default function Hello() {
6
+ return (
7
+ <>
8
+ <Head>
9
+ <title>Hello World - OpenClaw</title>
10
+ </Head>
11
+ <div className="min-h-screen bg-background">
12
+ <Header />
13
+ <main className="container mx-auto px-4 py-16 max-w-2xl">
14
+ <h1 className="text-3xl font-bold mb-8">Hello World</h1>
15
+ <Card>
16
+ <CardHeader>
17
+ <CardTitle>Pages Router 示例页面</CardTitle>
18
+ </CardHeader>
19
+ <CardContent className="text-muted-foreground">
20
+ <p className="mb-4">
21
+ 这是一个简单的 Hello World 页面,用于演示 Pages Router 的多路由产物结构。
22
+ </p>
23
+ <p>
24
+ 在 Pages Router 中,<code className="bg-muted px-1.5 py-0.5 rounded text-sm">src/pages/hello.tsx</code> 会自动映射为 <code className="bg-muted px-1.5 py-0.5 rounded text-sm">/hello</code> 路由。
25
+ </p>
26
+ </CardContent>
27
+ </Card>
28
+ </main>
29
+ </div>
30
+ </>
31
+ );
32
+ }
@@ -0,0 +1,76 @@
1
+ import Head from "next/head";
2
+ import { Button } from "@/components/ui/button";
3
+ import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
4
+ import { Badge } from "@/components/ui/badge";
5
+ import { Header } from "@/components/header";
6
+ import { Zap, Palette, Code } from "lucide-react";
7
+
8
+ export default function Home() {
9
+ return (
10
+ <>
11
+ <Head>
12
+ <title>OpenClaw Template</title>
13
+ <meta name="description" content="Next.js Pages Router Static Export Template for Vibe Coding" />
14
+ </Head>
15
+ <div className="min-h-screen bg-background">
16
+ <Header />
17
+ <main>
18
+ {/* Hero */}
19
+ <section className="container mx-auto px-4 py-24 text-center">
20
+ <Badge variant="secondary" className="mb-4">Next.js Pages Router</Badge>
21
+ <h1 className="text-4xl font-bold tracking-tight sm:text-6xl mb-6">
22
+ 轻量级前端模版
23
+ </h1>
24
+ <p className="text-lg text-muted-foreground max-w-2xl mx-auto mb-8">
25
+ 基于 Next.js Pages Router + shadcn/ui 的静态导出模版,无 RSC 开销,产物干净轻量,为 AI 协作开发而生。
26
+ </p>
27
+ <div className="flex gap-4 justify-center">
28
+ <Button size="lg">开始使用</Button>
29
+ <Button size="lg" variant="outline">了解更多</Button>
30
+ </div>
31
+ </section>
32
+
33
+ {/* Features */}
34
+ <section className="container mx-auto px-4 py-16">
35
+ <div className="grid gap-6 md:grid-cols-3">
36
+ <Card>
37
+ <CardHeader>
38
+ <Zap className="h-10 w-10 mb-2 text-primary" />
39
+ <CardTitle>AI 最友好</CardTitle>
40
+ <CardDescription>
41
+ Pages Router 拥有 9 年积累的海量训练数据,AI 生成准确率最高,无 Server/Client 组件区分的心智负担。
42
+ </CardDescription>
43
+ </CardHeader>
44
+ </Card>
45
+ <Card>
46
+ <CardHeader>
47
+ <Palette className="h-10 w-10 mb-2 text-primary" />
48
+ <CardTitle>产物干净</CardTitle>
49
+ <CardDescription>
50
+ 无 RSC payload(.txt 文件),产出只有 HTML + JS/CSS/字体,部署架构极简。
51
+ </CardDescription>
52
+ </CardHeader>
53
+ </Card>
54
+ <Card>
55
+ <CardHeader>
56
+ <Code className="h-10 w-10 mb-2 text-primary" />
57
+ <CardTitle>渐进升级</CardTitle>
58
+ <CardDescription>
59
+ 去掉 output: export 即可开启 SSR,加 API Routes 即有后端能力,代码结构零改动。
60
+ </CardDescription>
61
+ </CardHeader>
62
+ </Card>
63
+ </div>
64
+ </section>
65
+
66
+ {/* Footer */}
67
+ <footer className="border-t py-8">
68
+ <div className="container mx-auto px-4 text-center text-sm text-muted-foreground">
69
+ OpenClaw Template — Built for Vibe Coding
70
+ </div>
71
+ </footer>
72
+ </main>
73
+ </div>
74
+ </>
75
+ );
76
+ }
@@ -0,0 +1,143 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+ @import "shadcn/tailwind.css";
4
+ @config "../../tailwind.config.ts";
5
+
6
+ @custom-variant dark (&:is(.dark *));
7
+
8
+ :root {
9
+ --background: oklch(1 0 0);
10
+ --foreground: oklch(0.145 0 0);
11
+ --card: oklch(1 0 0);
12
+ --card-foreground: oklch(0.145 0 0);
13
+ --popover: oklch(1 0 0);
14
+ --popover-foreground: oklch(0.145 0 0);
15
+ --primary: oklch(0.205 0 0);
16
+ --primary-foreground: oklch(0.985 0 0);
17
+ --secondary: oklch(0.97 0 0);
18
+ --secondary-foreground: oklch(0.205 0 0);
19
+ --muted: oklch(0.97 0 0);
20
+ --muted-foreground: oklch(0.556 0 0);
21
+ --accent: oklch(0.97 0 0);
22
+ --accent-foreground: oklch(0.205 0 0);
23
+ --destructive: oklch(0.577 0.245 27.325);
24
+ --border: oklch(0.922 0 0);
25
+ --input: oklch(0.922 0 0);
26
+ --ring: oklch(0.708 0 0);
27
+ --chart-1: oklch(0.809 0.105 251.813);
28
+ --chart-2: oklch(0.623 0.214 259.815);
29
+ --chart-3: oklch(0.546 0.245 262.881);
30
+ --chart-4: oklch(0.488 0.243 264.376);
31
+ --chart-5: oklch(0.424 0.199 265.638);
32
+ --radius: 0.625rem;
33
+ --sidebar: oklch(0.985 0 0);
34
+ --sidebar-foreground: oklch(0.145 0 0);
35
+ --sidebar-primary: oklch(0.205 0 0);
36
+ --sidebar-primary-foreground: oklch(0.985 0 0);
37
+ --sidebar-accent: oklch(0.97 0 0);
38
+ --sidebar-accent-foreground: oklch(0.205 0 0);
39
+ --sidebar-border: oklch(0.922 0 0);
40
+ --sidebar-ring: oklch(0.708 0 0);
41
+ }
42
+
43
+ @theme inline {
44
+ --color-background: var(--background);
45
+ --color-foreground: var(--foreground);
46
+ --font-sans: var(--font-sans);
47
+ --font-mono: var(--font-geist-mono);
48
+ --color-sidebar-ring: var(--sidebar-ring);
49
+ --color-sidebar-border: var(--sidebar-border);
50
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
51
+ --color-sidebar-accent: var(--sidebar-accent);
52
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
53
+ --color-sidebar-primary: var(--sidebar-primary);
54
+ --color-sidebar-foreground: var(--sidebar-foreground);
55
+ --color-sidebar: var(--sidebar);
56
+ --color-chart-5: var(--chart-5);
57
+ --color-chart-4: var(--chart-4);
58
+ --color-chart-3: var(--chart-3);
59
+ --color-chart-2: var(--chart-2);
60
+ --color-chart-1: var(--chart-1);
61
+ --color-ring: var(--ring);
62
+ --color-input: var(--input);
63
+ --color-border: var(--border);
64
+ --color-destructive: var(--destructive);
65
+ --color-accent-foreground: var(--accent-foreground);
66
+ --color-accent: var(--accent);
67
+ --color-muted-foreground: var(--muted-foreground);
68
+ --color-muted: var(--muted);
69
+ --color-secondary-foreground: var(--secondary-foreground);
70
+ --color-secondary: var(--secondary);
71
+ --color-primary-foreground: var(--primary-foreground);
72
+ --color-primary: var(--primary);
73
+ --color-popover-foreground: var(--popover-foreground);
74
+ --color-popover: var(--popover);
75
+ --color-card-foreground: var(--card-foreground);
76
+ --color-card: var(--card);
77
+ --radius-sm: calc(var(--radius) * 0.6);
78
+ --radius-md: calc(var(--radius) * 0.8);
79
+ --radius-lg: var(--radius);
80
+ --radius-xl: calc(var(--radius) * 1.4);
81
+ --radius-2xl: calc(var(--radius) * 1.8);
82
+ --radius-3xl: calc(var(--radius) * 2.2);
83
+ --radius-4xl: calc(var(--radius) * 2.6);
84
+ }
85
+
86
+ @media (prefers-color-scheme: dark) {
87
+ :root {
88
+ --background: #0a0a0a;
89
+ --foreground: #ededed;
90
+ }
91
+ }
92
+
93
+ body {
94
+ background: var(--background);
95
+ color: var(--foreground);
96
+ font-family: Arial, Helvetica, sans-serif;
97
+ }
98
+
99
+ .dark {
100
+ --background: oklch(0.145 0 0);
101
+ --foreground: oklch(0.985 0 0);
102
+ --card: oklch(0.205 0 0);
103
+ --card-foreground: oklch(0.985 0 0);
104
+ --popover: oklch(0.205 0 0);
105
+ --popover-foreground: oklch(0.985 0 0);
106
+ --primary: oklch(0.922 0 0);
107
+ --primary-foreground: oklch(0.205 0 0);
108
+ --secondary: oklch(0.269 0 0);
109
+ --secondary-foreground: oklch(0.985 0 0);
110
+ --muted: oklch(0.269 0 0);
111
+ --muted-foreground: oklch(0.708 0 0);
112
+ --accent: oklch(0.269 0 0);
113
+ --accent-foreground: oklch(0.985 0 0);
114
+ --destructive: oklch(0.704 0.191 22.216);
115
+ --border: oklch(1 0 0 / 10%);
116
+ --input: oklch(1 0 0 / 15%);
117
+ --ring: oklch(0.556 0 0);
118
+ --chart-1: oklch(0.809 0.105 251.813);
119
+ --chart-2: oklch(0.623 0.214 259.815);
120
+ --chart-3: oklch(0.546 0.245 262.881);
121
+ --chart-4: oklch(0.488 0.243 264.376);
122
+ --chart-5: oklch(0.424 0.199 265.638);
123
+ --sidebar: oklch(0.205 0 0);
124
+ --sidebar-foreground: oklch(0.985 0 0);
125
+ --sidebar-primary: oklch(0.488 0.243 264.376);
126
+ --sidebar-primary-foreground: oklch(0.985 0 0);
127
+ --sidebar-accent: oklch(0.269 0 0);
128
+ --sidebar-accent-foreground: oklch(0.985 0 0);
129
+ --sidebar-border: oklch(1 0 0 / 10%);
130
+ --sidebar-ring: oklch(0.556 0 0);
131
+ }
132
+
133
+ @layer base {
134
+ * {
135
+ @apply border-border outline-ring/50;
136
+ }
137
+ body {
138
+ @apply bg-background text-foreground;
139
+ }
140
+ html {
141
+ @apply font-sans;
142
+ }
143
+ }
@@ -0,0 +1,10 @@
1
+ import type { Config } from 'tailwindcss';
2
+
3
+ const config: Config = {
4
+ content: [
5
+ './src/**/*.{ts,tsx,css}',
6
+ ],
7
+ plugins: [],
8
+ };
9
+
10
+ export default config;
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./src/*"]
23
+ }
24
+ },
25
+ "include": [
26
+ "next-env.d.ts",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ ".next/types/**/*.ts",
30
+ ".next/dev/types/**/*.ts",
31
+ "**/*.mts"
32
+ ],
33
+ "exclude": ["node_modules"]
34
+ }