@lark-apaas/coding-templates 0.1.2 → 0.1.4
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.
- package/package.json +2 -3
- package/template-html/README.md +1 -1
- package/template-vite-react/_gitignore +24 -0
- package/template-vite-react/client/index.html +13 -0
- package/template-vite-react/client/public/favicon.svg +1 -0
- package/template-vite-react/client/public/icons.svg +24 -0
- package/template-vite-react/client/src/api/index.ts +7 -0
- package/template-vite-react/client/src/app.tsx +17 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/header.tsx +5 -13
- package/template-vite-react/client/src/components/layout.tsx +13 -0
- package/template-vite-react/client/src/components/theme-provider.tsx +45 -0
- package/template-vite-react/client/src/components/ui/accordion.tsx +72 -0
- package/template-vite-react/client/src/components/ui/alert-dialog.tsx +187 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/alert.tsx +15 -10
- package/template-vite-react/client/src/components/ui/aspect-ratio.tsx +22 -0
- package/template-vite-react/client/src/components/ui/avatar.tsx +109 -0
- package/template-vite-react/client/src/components/ui/badge.tsx +52 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/breadcrumb.tsx +39 -23
- package/template-vite-react/client/src/components/ui/button.tsx +58 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/calendar.tsx +43 -37
- package/template-vite-react/client/src/components/ui/card.tsx +103 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/carousel.tsx +8 -7
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/chart.tsx +49 -35
- package/template-vite-react/client/src/components/ui/checkbox.tsx +29 -0
- package/template-vite-react/client/src/components/ui/collapsible.tsx +19 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/command.tsx +40 -52
- package/template-vite-react/client/src/components/ui/context-menu.tsx +271 -0
- package/template-vite-react/client/src/components/ui/dialog.tsx +158 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/drawer.tsx +9 -12
- package/template-vite-react/client/src/components/ui/dropdown-menu.tsx +268 -0
- package/template-vite-react/client/src/components/ui/hover-card.tsx +49 -0
- package/template-vite-react/client/src/components/ui/input-group.tsx +156 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/input-otp.tsx +17 -7
- package/template-vite-react/client/src/components/ui/input.tsx +20 -0
- package/template-vite-react/client/src/components/ui/label.tsx +18 -0
- package/template-vite-react/client/src/components/ui/menubar.tsx +280 -0
- package/template-vite-react/client/src/components/ui/navigation-menu.tsx +168 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/pagination.tsx +35 -32
- package/template-vite-react/client/src/components/ui/popover.tsx +90 -0
- package/template-vite-react/client/src/components/ui/progress.tsx +81 -0
- package/template-vite-react/client/src/components/ui/radio-group.tsx +38 -0
- package/template-vite-react/client/src/components/ui/resizable.tsx +48 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/scroll-area.tsx +10 -13
- package/template-vite-react/client/src/components/ui/select.tsx +199 -0
- package/template-vite-react/client/src/components/ui/separator.tsx +25 -0
- package/template-vite-react/client/src/components/ui/sheet.tsx +138 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/sidebar.tsx +156 -162
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/skeleton.tsx +1 -1
- package/template-vite-react/client/src/components/ui/slider.tsx +57 -0
- package/template-vite-react/client/src/components/ui/sonner.tsx +49 -0
- package/template-vite-react/client/src/components/ui/switch.tsx +30 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/table.tsx +5 -5
- package/template-vite-react/client/src/components/ui/tabs.tsx +80 -0
- package/template-vite-react/client/src/components/ui/textarea.tsx +18 -0
- package/template-vite-react/client/src/components/ui/toggle-group.tsx +89 -0
- package/template-vite-react/client/src/components/ui/toggle.tsx +44 -0
- package/template-vite-react/client/src/components/ui/tooltip.tsx +64 -0
- package/template-vite-react/client/src/index.css +1 -0
- package/template-vite-react/client/src/main.tsx +13 -0
- package/template-vite-react/client/src/pages/home/index.tsx +12 -0
- package/template-vite-react/client/src/pages/not-found/index.tsx +11 -0
- package/template-vite-react/client/src/types/index.ts +1 -0
- package/{template-nextjs-static → template-vite-react}/components.json +2 -2
- package/template-vite-react/eslint.config.js +23 -0
- package/template-vite-react/package.json +58 -0
- package/template-vite-react/scripts/build.sh +40 -0
- package/template-vite-react/shared/types.ts +1 -0
- package/template-vite-react/tsconfig.app.json +33 -0
- package/template-vite-react/tsconfig.json +14 -0
- package/template-vite-react/tsconfig.node.json +26 -0
- package/template-vite-react/vite.config.ts +17 -0
- package/template-nextjs-fullstack/README.md +0 -169
- package/template-nextjs-fullstack/_env.local.example +0 -1
- package/template-nextjs-fullstack/_gitignore +0 -41
- package/template-nextjs-fullstack/components.json +0 -25
- package/template-nextjs-fullstack/drizzle.config.ts +0 -10
- package/template-nextjs-fullstack/eslint.config.js +0 -15
- package/template-nextjs-fullstack/next.config.ts +0 -5
- package/template-nextjs-fullstack/package.json +0 -85
- package/template-nextjs-fullstack/postcss.config.js +0 -8
- package/template-nextjs-fullstack/scripts/build.sh +0 -37
- package/template-nextjs-fullstack/src/app/favicon.ico +0 -0
- package/template-nextjs-fullstack/src/app/globals.css +0 -130
- package/template-nextjs-fullstack/src/app/layout.tsx +0 -24
- package/template-nextjs-fullstack/src/app/page.tsx +0 -69
- package/template-nextjs-fullstack/src/app/todos/actions.ts +0 -37
- package/template-nextjs-fullstack/src/app/todos/page.tsx +0 -26
- package/template-nextjs-fullstack/src/app/todos/todo-form.tsx +0 -27
- package/template-nextjs-fullstack/src/app/todos/todo-list.tsx +0 -44
- package/template-nextjs-fullstack/src/components/header.tsx +0 -32
- package/template-nextjs-fullstack/src/components/theme-provider.tsx +0 -8
- package/template-nextjs-fullstack/src/components/ui/README.md +0 -134
- package/template-nextjs-fullstack/src/components/ui/accordion.tsx +0 -66
- package/template-nextjs-fullstack/src/components/ui/alert-dialog.tsx +0 -157
- package/template-nextjs-fullstack/src/components/ui/aspect-ratio.tsx +0 -11
- package/template-nextjs-fullstack/src/components/ui/avatar.tsx +0 -53
- package/template-nextjs-fullstack/src/components/ui/badge.tsx +0 -42
- package/template-nextjs-fullstack/src/components/ui/button.tsx +0 -69
- package/template-nextjs-fullstack/src/components/ui/calendar.tsx +0 -213
- package/template-nextjs-fullstack/src/components/ui/card.tsx +0 -82
- package/template-nextjs-fullstack/src/components/ui/chart.tsx +0 -357
- package/template-nextjs-fullstack/src/components/ui/checkbox.tsx +0 -32
- package/template-nextjs-fullstack/src/components/ui/collapsible.tsx +0 -33
- package/template-nextjs-fullstack/src/components/ui/context-menu.tsx +0 -324
- package/template-nextjs-fullstack/src/components/ui/dialog.tsx +0 -143
- package/template-nextjs-fullstack/src/components/ui/drawer.tsx +0 -135
- package/template-nextjs-fullstack/src/components/ui/dropdown-menu.tsx +0 -329
- package/template-nextjs-fullstack/src/components/ui/hover-card.tsx +0 -44
- package/template-nextjs-fullstack/src/components/ui/input-group.tsx +0 -166
- package/template-nextjs-fullstack/src/components/ui/input-otp.tsx +0 -77
- package/template-nextjs-fullstack/src/components/ui/input.tsx +0 -21
- package/template-nextjs-fullstack/src/components/ui/label.tsx +0 -24
- package/template-nextjs-fullstack/src/components/ui/menubar.tsx +0 -348
- package/template-nextjs-fullstack/src/components/ui/navigation-menu.tsx +0 -168
- package/template-nextjs-fullstack/src/components/ui/pagination.tsx +0 -127
- package/template-nextjs-fullstack/src/components/ui/popover.tsx +0 -48
- package/template-nextjs-fullstack/src/components/ui/progress.tsx +0 -31
- package/template-nextjs-fullstack/src/components/ui/radio-group.tsx +0 -45
- package/template-nextjs-fullstack/src/components/ui/resizable.tsx +0 -56
- package/template-nextjs-fullstack/src/components/ui/select.tsx +0 -243
- package/template-nextjs-fullstack/src/components/ui/separator.tsx +0 -28
- package/template-nextjs-fullstack/src/components/ui/sheet.tsx +0 -139
- package/template-nextjs-fullstack/src/components/ui/skeleton.tsx +0 -13
- package/template-nextjs-fullstack/src/components/ui/slider.tsx +0 -87
- package/template-nextjs-fullstack/src/components/ui/sonner.tsx +0 -67
- package/template-nextjs-fullstack/src/components/ui/switch.tsx +0 -31
- package/template-nextjs-fullstack/src/components/ui/tabs.tsx +0 -66
- package/template-nextjs-fullstack/src/components/ui/textarea.tsx +0 -18
- package/template-nextjs-fullstack/src/components/ui/toggle-group.tsx +0 -83
- package/template-nextjs-fullstack/src/components/ui/toggle.tsx +0 -47
- package/template-nextjs-fullstack/src/components/ui/tooltip.tsx +0 -61
- package/template-nextjs-fullstack/src/db/index.ts +0 -8
- package/template-nextjs-fullstack/src/db/schema.ts +0 -11
- package/template-nextjs-fullstack/tailwind.config.ts +0 -10
- package/template-nextjs-fullstack/tsconfig.json +0 -34
- package/template-nextjs-static/README.md +0 -80
- package/template-nextjs-static/_gitignore +0 -41
- package/template-nextjs-static/eslint.config.js +0 -15
- package/template-nextjs-static/next.config.ts +0 -8
- package/template-nextjs-static/package.json +0 -77
- package/template-nextjs-static/postcss.config.js +0 -8
- package/template-nextjs-static/public/favicon.ico +0 -0
- package/template-nextjs-static/scripts/build.sh +0 -36
- package/template-nextjs-static/src/components/theme-provider.tsx +0 -6
- package/template-nextjs-static/src/components/ui/README.md +0 -134
- package/template-nextjs-static/src/components/ui/accordion.tsx +0 -66
- package/template-nextjs-static/src/components/ui/alert-dialog.tsx +0 -157
- package/template-nextjs-static/src/components/ui/alert.tsx +0 -71
- package/template-nextjs-static/src/components/ui/aspect-ratio.tsx +0 -11
- package/template-nextjs-static/src/components/ui/avatar.tsx +0 -53
- package/template-nextjs-static/src/components/ui/badge.tsx +0 -42
- package/template-nextjs-static/src/components/ui/breadcrumb.tsx +0 -109
- package/template-nextjs-static/src/components/ui/button-group.tsx +0 -83
- package/template-nextjs-static/src/components/ui/button.tsx +0 -69
- package/template-nextjs-static/src/components/ui/card.tsx +0 -82
- package/template-nextjs-static/src/components/ui/carousel.tsx +0 -241
- package/template-nextjs-static/src/components/ui/checkbox.tsx +0 -32
- package/template-nextjs-static/src/components/ui/collapsible.tsx +0 -33
- package/template-nextjs-static/src/components/ui/command.tsx +0 -208
- package/template-nextjs-static/src/components/ui/context-menu.tsx +0 -324
- package/template-nextjs-static/src/components/ui/dialog.tsx +0 -143
- package/template-nextjs-static/src/components/ui/dropdown-menu.tsx +0 -329
- package/template-nextjs-static/src/components/ui/empty.tsx +0 -104
- package/template-nextjs-static/src/components/ui/field.tsx +0 -248
- package/template-nextjs-static/src/components/ui/form.tsx +0 -167
- package/template-nextjs-static/src/components/ui/hover-card.tsx +0 -44
- package/template-nextjs-static/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -36
- package/template-nextjs-static/src/components/ui/icons/file-android-colorful-icon.tsx +0 -33
- package/template-nextjs-static/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-code-colorful-icon.tsx +0 -28
- package/template-nextjs-static/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -25
- package/template-nextjs-static/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -23
- package/template-nextjs-static/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -27
- package/template-nextjs-static/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -20
- package/template-nextjs-static/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -12
- package/template-nextjs-static/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -14
- package/template-nextjs-static/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -23
- package/template-nextjs-static/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -38
- package/template-nextjs-static/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/image.tsx +0 -183
- package/template-nextjs-static/src/components/ui/input-group.tsx +0 -166
- package/template-nextjs-static/src/components/ui/input.tsx +0 -21
- package/template-nextjs-static/src/components/ui/item.tsx +0 -193
- package/template-nextjs-static/src/components/ui/kbd.tsx +0 -28
- package/template-nextjs-static/src/components/ui/label.tsx +0 -24
- package/template-nextjs-static/src/components/ui/menubar.tsx +0 -348
- package/template-nextjs-static/src/components/ui/native-select.tsx +0 -48
- package/template-nextjs-static/src/components/ui/navigation-menu.tsx +0 -168
- package/template-nextjs-static/src/components/ui/popover.tsx +0 -48
- package/template-nextjs-static/src/components/ui/progress.tsx +0 -31
- package/template-nextjs-static/src/components/ui/radio-group.tsx +0 -45
- package/template-nextjs-static/src/components/ui/resizable.tsx +0 -56
- package/template-nextjs-static/src/components/ui/scroll-area.tsx +0 -58
- package/template-nextjs-static/src/components/ui/select.tsx +0 -243
- package/template-nextjs-static/src/components/ui/separator.tsx +0 -28
- package/template-nextjs-static/src/components/ui/sheet.tsx +0 -139
- package/template-nextjs-static/src/components/ui/sidebar.tsx +0 -727
- package/template-nextjs-static/src/components/ui/slider.tsx +0 -87
- package/template-nextjs-static/src/components/ui/sonner.tsx +0 -67
- package/template-nextjs-static/src/components/ui/spinner.tsx +0 -16
- package/template-nextjs-static/src/components/ui/streamdown.tsx +0 -186
- package/template-nextjs-static/src/components/ui/switch.tsx +0 -31
- package/template-nextjs-static/src/components/ui/table.tsx +0 -116
- package/template-nextjs-static/src/components/ui/tabs.tsx +0 -66
- package/template-nextjs-static/src/components/ui/textarea.tsx +0 -18
- package/template-nextjs-static/src/components/ui/toggle-group.tsx +0 -83
- package/template-nextjs-static/src/components/ui/toggle.tsx +0 -47
- package/template-nextjs-static/src/components/ui/tooltip.tsx +0 -61
- package/template-nextjs-static/src/hooks/use-mobile.ts +0 -19
- package/template-nextjs-static/src/lib/utils.ts +0 -6
- package/template-nextjs-static/src/pages/_app.tsx +0 -11
- package/template-nextjs-static/src/pages/_document.tsx +0 -13
- package/template-nextjs-static/src/pages/hello.tsx +0 -32
- package/template-nextjs-static/src/pages/index.tsx +0 -76
- package/template-nextjs-static/src/styles/globals.css +0 -143
- package/template-nextjs-static/tailwind.config.ts +0 -10
- package/template-nextjs-static/tsconfig.json +0 -34
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/button-group.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/empty.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/field.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/form.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-android-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-code-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/image.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/item.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/kbd.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/native-select.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/spinner.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/streamdown.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/hooks/use-mobile.ts +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/lib/utils.ts +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
5
|
-
OUTPUT="$ROOT/dist/output"
|
|
6
|
-
OUTPUT_STATIC="$ROOT/dist/output_static"
|
|
7
|
-
OUTPUT_RESOURCE="$ROOT/dist/output_resource"
|
|
8
|
-
|
|
9
|
-
# 清理
|
|
10
|
-
rm -rf "$ROOT/dist"
|
|
11
|
-
|
|
12
|
-
# 1. Next.js 构建 → out/
|
|
13
|
-
npx next build
|
|
14
|
-
|
|
15
|
-
# 2. HTML → dist/output/
|
|
16
|
-
mkdir -p "$OUTPUT"
|
|
17
|
-
find "$ROOT/out" -maxdepth 1 -name '*.html' -exec cp {} "$OUTPUT/" \;
|
|
18
|
-
# 复制子目录(排除 _next)
|
|
19
|
-
find "$ROOT/out" -mindepth 1 -maxdepth 1 -type d -not -name '_next' \
|
|
20
|
-
-exec cp -r {} "$OUTPUT/" \;
|
|
21
|
-
|
|
22
|
-
# 生成 routes.json
|
|
23
|
-
echo '{ "version": 1, "type": "nextjs-static", "fallback": "404.html" }' > "$OUTPUT/routes.json"
|
|
24
|
-
|
|
25
|
-
# 3. _next/static/ → dist/output_resource/(JS/CSS/字体,上传到 CDN)
|
|
26
|
-
if [ -d "$ROOT/out/_next/static" ]; then
|
|
27
|
-
mkdir -p "$OUTPUT_RESOURCE/_next"
|
|
28
|
-
cp -r "$ROOT/out/_next/static" "$OUTPUT_RESOURCE/_next/"
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
# 4. 私有资源 → dist/output_static/(如有,按需补充)
|
|
32
|
-
|
|
33
|
-
echo "Build complete"
|
|
34
|
-
echo " HTML → dist/output/"
|
|
35
|
-
[ -d "$OUTPUT_RESOURCE" ] && echo " Resource → dist/output_resource/"
|
|
36
|
-
[ -d "$OUTPUT_STATIC" ] && echo " Static → dist/output_static/"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
3
|
-
|
|
4
|
-
export function ThemeProvider({ children, ...props }: React.ComponentProps<typeof NextThemesProvider>) {
|
|
5
|
-
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
|
6
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# shadcn/ui 组件开发指南
|
|
2
|
-
|
|
3
|
-
## 核心原则
|
|
4
|
-
|
|
5
|
-
- 组件位置:`/client/src/components/ui/`
|
|
6
|
-
- 图标库:必须使用 `lucide-react`,禁用 Emoji
|
|
7
|
-
- 查阅源码实现:直接读取组件源码了解最新组件实现
|
|
8
|
-
- 交互系统:Button、Badge 使用 elevate 遮罩系统处理 hover/active 状态(通过 `::after` 伪元素叠加 `--elevate-1` / `--elevate-2`)
|
|
9
|
-
|
|
10
|
-
## 关键组件规范
|
|
11
|
-
|
|
12
|
-
#### 1. Button 组件
|
|
13
|
-
|
|
14
|
-
**导入路径**:`import { Button } from '@/components/ui/button'`
|
|
15
|
-
|
|
16
|
-
**Props**:
|
|
17
|
-
- `variant`: `"link" | "default" | "destructive" | "outline" | "secondary" | "ghost"` - 按钮样式变体
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
// ✅ 使用变体
|
|
21
|
-
<Button variant="secondary">标准按钮</Button>
|
|
22
|
-
|
|
23
|
-
// ✅ 自定义颜色时必须配对前景色
|
|
24
|
-
<Button className="bg-primary text-primary-foreground">自定义按钮</Button>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
#### 2. Badge 组件
|
|
28
|
-
|
|
29
|
-
**导入路径**:`import { Badge } from '@/components/ui/badge'`
|
|
30
|
-
|
|
31
|
-
**Props**:
|
|
32
|
-
- `variant`: `"default" | "destructive" | "outline" | "secondary"` - 样式变体
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
// ✅ 使用变体
|
|
36
|
-
<Badge>默认</Badge>
|
|
37
|
-
<Badge variant="secondary">次要</Badge>
|
|
38
|
-
<Badge variant="outline">边框</Badge>
|
|
39
|
-
<Badge variant="destructive">危险</Badge>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
#### 3. Alert 组件
|
|
43
|
-
|
|
44
|
-
**导入路径**:`import { Alert, AlertTitle, AlertDescription, AlertAction } from '@/components/ui/alert'`
|
|
45
|
-
|
|
46
|
-
**Props**:
|
|
47
|
-
- `variant`: `"default" | "destructive" | "success" | "warning"` - 样式变体
|
|
48
|
-
|
|
49
|
-
```tsx
|
|
50
|
-
// ✅ default / destructive / success / warning 四种变体
|
|
51
|
-
<Alert variant="success">
|
|
52
|
-
<CheckCircle className="size-4" />
|
|
53
|
-
<AlertTitle>操作成功</AlertTitle>
|
|
54
|
-
<AlertDescription>您的更改已保存</AlertDescription>
|
|
55
|
-
</Alert>
|
|
56
|
-
|
|
57
|
-
<Alert variant="warning">
|
|
58
|
-
<AlertTriangle className="size-4" />
|
|
59
|
-
<AlertTitle>警告</AlertTitle>
|
|
60
|
-
<AlertDescription>请注意检查</AlertDescription>
|
|
61
|
-
</Alert>
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
#### 4. Empty 组件
|
|
66
|
-
|
|
67
|
-
**导入路径**:`import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent } from '@/components/ui/empty'`
|
|
68
|
-
|
|
69
|
-
**子组件 Props**:
|
|
70
|
-
- `EmptyMedia` 组件的 `variant`: `"default" | "icon"` - 媒体展示方式
|
|
71
|
-
|
|
72
|
-
```tsx
|
|
73
|
-
// 标准结构:EmptyHeader 包含 EmptyMedia + EmptyTitle + EmptyDescription
|
|
74
|
-
<Empty>
|
|
75
|
-
<EmptyHeader>
|
|
76
|
-
<EmptyMedia variant="icon">
|
|
77
|
-
<SearchIcon className="size-6" />
|
|
78
|
-
</EmptyMedia>
|
|
79
|
-
<EmptyTitle>暂无数据</EmptyTitle>
|
|
80
|
-
<EmptyDescription>当前没有找到相关内容</EmptyDescription>
|
|
81
|
-
</EmptyHeader>
|
|
82
|
-
<EmptyContent>
|
|
83
|
-
<Button>添加数据</Button>
|
|
84
|
-
</EmptyContent>
|
|
85
|
-
</Empty>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
#### 5. Card Padding 系统
|
|
89
|
-
|
|
90
|
-
**导入路径**:`import { CardHeader, CardContent, CardFooter } from '@/components/ui/card'`
|
|
91
|
-
|
|
92
|
-
- `CardHeader`: `p-6` (24px 全方向)
|
|
93
|
-
- `CardContent`: `p-6 pt-0` (与 header 无缝衔接)
|
|
94
|
-
- `CardFooter`: `p-6 pt-0` (与 content 无缝衔接)
|
|
95
|
-
|
|
96
|
-
#### 6. Dialog 组件
|
|
97
|
-
|
|
98
|
-
**导入路径**:`import { Dialog, DialogContent } from '@/components/ui/dialog'`
|
|
99
|
-
|
|
100
|
-
Dialog 默认提供了右上角的close能力,同时也提供了自定义关闭按钮的能力,即通过设置showCloseButton为false来关闭默认的关闭按钮。所以当默认存在close时,禁止在内容区域提供自定义的关闭按钮。
|
|
101
|
-
|
|
102
|
-
#### 7. Image 组件
|
|
103
|
-
|
|
104
|
-
**导入路径**:`import { Image } from '@/components/ui/image'`
|
|
105
|
-
|
|
106
|
-
**Props**:支持原生 `<img>` 标签所有属性。
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**使用规范**:
|
|
113
|
-
|
|
114
|
-
1. **响应式图片场景**:当图片尺寸需要根据视口宽度变化时,必须设置 `sizes` 属性
|
|
115
|
-
2. **固定尺寸图片场景**:当图片有固定尺寸时,必须设置 `width` 属性(number 类型)
|
|
116
|
-
3. **必须提供有意义的 `alt` 属性**
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
// ✅ 响应式图片
|
|
120
|
-
<Image
|
|
121
|
-
src="/path/to/image.jpg"
|
|
122
|
-
alt="描述文字"
|
|
123
|
-
sizes="(max-width: 768px) 100vw, 50vw"
|
|
124
|
-
/>
|
|
125
|
-
|
|
126
|
-
// ✅ 固定尺寸图片(width/height 使用 number)
|
|
127
|
-
<Image
|
|
128
|
-
src="/path/to/image.jpg"
|
|
129
|
-
alt="描述文字"
|
|
130
|
-
width={300}
|
|
131
|
-
height={200}
|
|
132
|
-
/>
|
|
133
|
-
|
|
134
|
-
```
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
5
|
-
import { ChevronDownIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Accordion({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
12
|
-
return <AccordionPrimitive.Root data-slot="accordion" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function AccordionItem({
|
|
16
|
-
className,
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
19
|
-
return (
|
|
20
|
-
<AccordionPrimitive.Item
|
|
21
|
-
data-slot="accordion-item"
|
|
22
|
-
className={cn("border-b last:border-b-0", className)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function AccordionTrigger({
|
|
29
|
-
className,
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
33
|
-
return (
|
|
34
|
-
<AccordionPrimitive.Header className="flex">
|
|
35
|
-
<AccordionPrimitive.Trigger
|
|
36
|
-
data-slot="accordion-trigger"
|
|
37
|
-
className={cn(
|
|
38
|
-
"focus-visible:border-ring focus-visible:ring-ring/20 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none enabled:hover:underline focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
|
|
45
|
-
</AccordionPrimitive.Trigger>
|
|
46
|
-
</AccordionPrimitive.Header>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function AccordionContent({
|
|
51
|
-
className,
|
|
52
|
-
children,
|
|
53
|
-
...props
|
|
54
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
55
|
-
return (
|
|
56
|
-
<AccordionPrimitive.Content
|
|
57
|
-
data-slot="accordion-content"
|
|
58
|
-
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
|
59
|
-
{...props}
|
|
60
|
-
>
|
|
61
|
-
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
62
|
-
</AccordionPrimitive.Content>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
import { buttonVariants } from "@/components/ui/button"
|
|
8
|
-
|
|
9
|
-
function AlertDialog({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
-
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function AlertDialogTrigger({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
-
return (
|
|
19
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function AlertDialogPortal({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
-
return (
|
|
27
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function AlertDialogOverlay({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
35
|
-
return (
|
|
36
|
-
<AlertDialogPrimitive.Overlay
|
|
37
|
-
data-slot="alert-dialog-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function AlertDialogContent({
|
|
48
|
-
className,
|
|
49
|
-
...props
|
|
50
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
51
|
-
return (
|
|
52
|
-
<AlertDialogPortal>
|
|
53
|
-
<AlertDialogOverlay />
|
|
54
|
-
<AlertDialogPrimitive.Content
|
|
55
|
-
data-slot="alert-dialog-content"
|
|
56
|
-
className={cn(
|
|
57
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-sm:max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 max-w-lg",
|
|
58
|
-
className
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
</AlertDialogPortal>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function AlertDialogHeader({
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: React.ComponentProps<"div">) {
|
|
70
|
-
return (
|
|
71
|
-
<div
|
|
72
|
-
data-slot="alert-dialog-header"
|
|
73
|
-
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function AlertDialogFooter({
|
|
80
|
-
className,
|
|
81
|
-
...props
|
|
82
|
-
}: React.ComponentProps<"div">) {
|
|
83
|
-
return (
|
|
84
|
-
<div
|
|
85
|
-
data-slot="alert-dialog-footer"
|
|
86
|
-
className={cn(
|
|
87
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
88
|
-
className
|
|
89
|
-
)}
|
|
90
|
-
{...props}
|
|
91
|
-
/>
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function AlertDialogTitle({
|
|
96
|
-
className,
|
|
97
|
-
...props
|
|
98
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
99
|
-
return (
|
|
100
|
-
<AlertDialogPrimitive.Title
|
|
101
|
-
data-slot="alert-dialog-title"
|
|
102
|
-
className={cn("text-lg font-semibold", className)}
|
|
103
|
-
{...props}
|
|
104
|
-
/>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function AlertDialogDescription({
|
|
109
|
-
className,
|
|
110
|
-
...props
|
|
111
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
112
|
-
return (
|
|
113
|
-
<AlertDialogPrimitive.Description
|
|
114
|
-
data-slot="alert-dialog-description"
|
|
115
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function AlertDialogAction({
|
|
122
|
-
className,
|
|
123
|
-
...props
|
|
124
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
125
|
-
return (
|
|
126
|
-
<AlertDialogPrimitive.Action
|
|
127
|
-
className={cn(buttonVariants(), className)}
|
|
128
|
-
{...props}
|
|
129
|
-
/>
|
|
130
|
-
)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function AlertDialogCancel({
|
|
134
|
-
className,
|
|
135
|
-
...props
|
|
136
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
137
|
-
return (
|
|
138
|
-
<AlertDialogPrimitive.Cancel
|
|
139
|
-
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export {
|
|
146
|
-
AlertDialog,
|
|
147
|
-
AlertDialogPortal,
|
|
148
|
-
AlertDialogOverlay,
|
|
149
|
-
AlertDialogTrigger,
|
|
150
|
-
AlertDialogContent,
|
|
151
|
-
AlertDialogHeader,
|
|
152
|
-
AlertDialogFooter,
|
|
153
|
-
AlertDialogTitle,
|
|
154
|
-
AlertDialogDescription,
|
|
155
|
-
AlertDialogAction,
|
|
156
|
-
AlertDialogCancel,
|
|
157
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
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",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-card text-card-foreground",
|
|
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",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
defaultVariants: {
|
|
22
|
-
variant: "default",
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
function Alert({
|
|
28
|
-
className,
|
|
29
|
-
variant,
|
|
30
|
-
...props
|
|
31
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
32
|
-
return (
|
|
33
|
-
<div
|
|
34
|
-
data-slot="alert"
|
|
35
|
-
role="alert"
|
|
36
|
-
className={cn(alertVariants({ variant }), className)}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
data-slot="alert-title"
|
|
46
|
-
className={cn(
|
|
47
|
-
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
48
|
-
className
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function AlertDescription({
|
|
56
|
-
className,
|
|
57
|
-
...props
|
|
58
|
-
}: React.ComponentProps<"div">) {
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
data-slot="alert-description"
|
|
62
|
-
className={cn(
|
|
63
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
4
|
-
|
|
5
|
-
function AspectRatio({
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
8
|
-
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { AspectRatio }
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Avatar({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<AvatarPrimitive.Root
|
|
14
|
-
data-slot="avatar"
|
|
15
|
-
className={cn(
|
|
16
|
-
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function AvatarImage({
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
28
|
-
return (
|
|
29
|
-
<AvatarPrimitive.Image
|
|
30
|
-
data-slot="avatar-image"
|
|
31
|
-
className={cn("aspect-square size-full", className)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function AvatarFallback({
|
|
38
|
-
className,
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
41
|
-
return (
|
|
42
|
-
<AvatarPrimitive.Fallback
|
|
43
|
-
data-slot="avatar-fallback"
|
|
44
|
-
className={cn(
|
|
45
|
-
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
const badgeVariants = cva(
|
|
7
|
-
// Whitespace-nowrap: Badges should never wrap.
|
|
8
|
-
// hover-elevate: adds subtle dark overlay on hover for interactive feedback
|
|
9
|
-
"whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold hover-elevate",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default:
|
|
14
|
-
// Primary badge with subtle shadow for elevation
|
|
15
|
-
"border-transparent bg-primary text-primary-foreground shadow-xs",
|
|
16
|
-
secondary:
|
|
17
|
-
// Subtle filled badge for secondary information
|
|
18
|
-
"border-transparent bg-secondary text-secondary-foreground",
|
|
19
|
-
destructive:
|
|
20
|
-
// Error/danger state with matching shadow
|
|
21
|
-
"border-transparent bg-destructive text-destructive-foreground shadow-xs",
|
|
22
|
-
// Outline uses badge-outline variable to blend with parent background
|
|
23
|
-
outline: "border [border-color:var(--badge-outline)] shadow-xs",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
variant: "default",
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
export interface BadgeProps
|
|
33
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
34
|
-
VariantProps<typeof badgeVariants> {}
|
|
35
|
-
|
|
36
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
37
|
-
return (
|
|
38
|
-
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { Badge, badgeVariants }
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
|
|
8
|
-
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
12
|
-
return (
|
|
13
|
-
<ol
|
|
14
|
-
data-slot="breadcrumb-list"
|
|
15
|
-
className={cn(
|
|
16
|
-
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
25
|
-
return (
|
|
26
|
-
<li
|
|
27
|
-
data-slot="breadcrumb-item"
|
|
28
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function BreadcrumbLink({
|
|
35
|
-
asChild,
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<"a"> & {
|
|
39
|
-
asChild?: boolean
|
|
40
|
-
}) {
|
|
41
|
-
const Comp = asChild ? Slot : "a"
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Comp
|
|
45
|
-
data-slot="breadcrumb-link"
|
|
46
|
-
className={cn("hover:text-foreground transition-colors", className)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
53
|
-
return (
|
|
54
|
-
<span
|
|
55
|
-
data-slot="breadcrumb-page"
|
|
56
|
-
role="link"
|
|
57
|
-
aria-disabled="true"
|
|
58
|
-
aria-current="page"
|
|
59
|
-
className={cn("text-foreground font-normal", className)}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function BreadcrumbSeparator({
|
|
66
|
-
children,
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: React.ComponentProps<"li">) {
|
|
70
|
-
return (
|
|
71
|
-
<li
|
|
72
|
-
data-slot="breadcrumb-separator"
|
|
73
|
-
role="presentation"
|
|
74
|
-
aria-hidden="true"
|
|
75
|
-
className={cn("[&>svg]:size-3.5", className)}
|
|
76
|
-
{...props}
|
|
77
|
-
>
|
|
78
|
-
{children ?? <ChevronRight />}
|
|
79
|
-
</li>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function BreadcrumbEllipsis({
|
|
84
|
-
className,
|
|
85
|
-
...props
|
|
86
|
-
}: React.ComponentProps<"span">) {
|
|
87
|
-
return (
|
|
88
|
-
<span
|
|
89
|
-
data-slot="breadcrumb-ellipsis"
|
|
90
|
-
role="presentation"
|
|
91
|
-
aria-hidden="true"
|
|
92
|
-
className={cn("flex size-9 items-center justify-center", className)}
|
|
93
|
-
{...props}
|
|
94
|
-
>
|
|
95
|
-
<MoreHorizontal className="size-4" />
|
|
96
|
-
<span className="sr-only">More</span>
|
|
97
|
-
</span>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
Breadcrumb,
|
|
103
|
-
BreadcrumbList,
|
|
104
|
-
BreadcrumbItem,
|
|
105
|
-
BreadcrumbLink,
|
|
106
|
-
BreadcrumbPage,
|
|
107
|
-
BreadcrumbSeparator,
|
|
108
|
-
BreadcrumbEllipsis,
|
|
109
|
-
}
|