@lark-apaas/coding-template-vite-react 0.1.0-alpha.1

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 (82) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +20 -0
  3. package/hooks/after-install.mjs +3 -0
  4. package/hooks/after-render.mjs +3 -0
  5. package/hooks/before-render.mjs +3 -0
  6. package/package.json +27 -0
  7. package/template/README.md +109 -0
  8. package/template/_gitignore +24 -0
  9. package/template/client/index.html +14 -0
  10. package/template/client/public/favicon.svg +1 -0
  11. package/template/client/public/icons.svg +24 -0
  12. package/template/client/src/app.tsx +15 -0
  13. package/template/client/src/components/layout.tsx +9 -0
  14. package/template/client/src/components/ui/accordion.tsx +66 -0
  15. package/template/client/src/components/ui/alert-dialog.tsx +157 -0
  16. package/template/client/src/components/ui/alert.tsx +71 -0
  17. package/template/client/src/components/ui/aspect-ratio.tsx +11 -0
  18. package/template/client/src/components/ui/avatar.tsx +53 -0
  19. package/template/client/src/components/ui/badge.tsx +42 -0
  20. package/template/client/src/components/ui/breadcrumb.tsx +109 -0
  21. package/template/client/src/components/ui/button-group.tsx +83 -0
  22. package/template/client/src/components/ui/button.tsx +69 -0
  23. package/template/client/src/components/ui/calendar.tsx +213 -0
  24. package/template/client/src/components/ui/card.tsx +82 -0
  25. package/template/client/src/components/ui/carousel.tsx +241 -0
  26. package/template/client/src/components/ui/chart.tsx +357 -0
  27. package/template/client/src/components/ui/checkbox.tsx +32 -0
  28. package/template/client/src/components/ui/collapsible.tsx +33 -0
  29. package/template/client/src/components/ui/command.tsx +208 -0
  30. package/template/client/src/components/ui/context-menu.tsx +324 -0
  31. package/template/client/src/components/ui/dialog.tsx +143 -0
  32. package/template/client/src/components/ui/drawer.tsx +135 -0
  33. package/template/client/src/components/ui/dropdown-menu.tsx +329 -0
  34. package/template/client/src/components/ui/empty.tsx +104 -0
  35. package/template/client/src/components/ui/field.tsx +248 -0
  36. package/template/client/src/components/ui/form.tsx +167 -0
  37. package/template/client/src/components/ui/hover-card.tsx +44 -0
  38. package/template/client/src/components/ui/image.tsx +183 -0
  39. package/template/client/src/components/ui/input-group.tsx +166 -0
  40. package/template/client/src/components/ui/input-otp.tsx +77 -0
  41. package/template/client/src/components/ui/input.tsx +21 -0
  42. package/template/client/src/components/ui/item.tsx +193 -0
  43. package/template/client/src/components/ui/kbd.tsx +28 -0
  44. package/template/client/src/components/ui/label.tsx +24 -0
  45. package/template/client/src/components/ui/menubar.tsx +348 -0
  46. package/template/client/src/components/ui/native-select.tsx +48 -0
  47. package/template/client/src/components/ui/navigation-menu.tsx +168 -0
  48. package/template/client/src/components/ui/pagination.tsx +127 -0
  49. package/template/client/src/components/ui/popover.tsx +48 -0
  50. package/template/client/src/components/ui/progress.tsx +31 -0
  51. package/template/client/src/components/ui/radio-group.tsx +45 -0
  52. package/template/client/src/components/ui/resizable.tsx +56 -0
  53. package/template/client/src/components/ui/scroll-area.tsx +58 -0
  54. package/template/client/src/components/ui/select.tsx +243 -0
  55. package/template/client/src/components/ui/separator.tsx +28 -0
  56. package/template/client/src/components/ui/sheet.tsx +139 -0
  57. package/template/client/src/components/ui/sidebar.tsx +728 -0
  58. package/template/client/src/components/ui/skeleton.tsx +13 -0
  59. package/template/client/src/components/ui/slider.tsx +87 -0
  60. package/template/client/src/components/ui/sonner.tsx +67 -0
  61. package/template/client/src/components/ui/spinner.tsx +16 -0
  62. package/template/client/src/components/ui/switch.tsx +31 -0
  63. package/template/client/src/components/ui/table.tsx +116 -0
  64. package/template/client/src/components/ui/tabs.tsx +66 -0
  65. package/template/client/src/components/ui/textarea.tsx +18 -0
  66. package/template/client/src/components/ui/toggle-group.tsx +83 -0
  67. package/template/client/src/components/ui/toggle.tsx +47 -0
  68. package/template/client/src/components/ui/tooltip.tsx +61 -0
  69. package/template/client/src/hooks/use-mobile.ts +19 -0
  70. package/template/client/src/index.css +131 -0
  71. package/template/client/src/index.tsx +16 -0
  72. package/template/client/src/pages/NotFoundPage/NotFoundPage.tsx +11 -0
  73. package/template/components.json +21 -0
  74. package/template/eslint.config.mjs +34 -0
  75. package/template/package-lock.json +10533 -0
  76. package/template/package.json +84 -0
  77. package/template/scripts/build.sh +45 -0
  78. package/template/shared/types.ts +1 -0
  79. package/template/tsconfig.app.json +13 -0
  80. package/template/tsconfig.json +14 -0
  81. package/template/tsconfig.node.json +26 -0
  82. package/template/vite.config.ts +12 -0
@@ -0,0 +1,131 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ :root {
5
+ --button-outline: rgba(0,0,0, .10);
6
+ --badge-outline: rgba(0,0,0, .05);
7
+ --opaque-button-border-intensity: -8;
8
+ --elevate-1: rgba(0,0,0, .03);
9
+ --elevate-2: rgba(0,0,0, .08);
10
+
11
+ --background: hsl(0 0% 100%);
12
+ --foreground: hsl(220 14% 14%);
13
+ --card: hsl(0 0% 100%);
14
+ --card-foreground: hsl(220 14% 14%);
15
+ --popover: hsl(0 0% 100%);
16
+ --popover-foreground: hsl(220 14% 14%);
17
+ --primary: hsl(221 83% 53%);
18
+ --primary-foreground: hsl(220 14% 98%);
19
+ --secondary: hsl(220 14% 96%);
20
+ --secondary-foreground: hsl(220 14% 14%);
21
+ --muted: hsl(220 14% 96%);
22
+ --muted-foreground: hsl(218 7% 59%);
23
+ --accent: hsl(220 14% 96%);
24
+ --accent-foreground: hsl(220 14% 14%);
25
+ --info: hsl(221 83% 53%);
26
+ --info-foreground: hsl(230 100% 98%);
27
+ --destructive: hsl(2 84% 62%);
28
+ --destructive-foreground: hsl(0 0% 100%);
29
+ --success: hsl(130 54% 42%);
30
+ --success-foreground: hsl(115 77% 97%);
31
+ --warning: hsl(26 90% 49%);
32
+ --warning-foreground: hsl(33 100% 96%);
33
+ --border: hsl(220 14% 89%);
34
+ --input: hsl(220 14% 89%);
35
+ --ring: hsl(221 83% 53%);
36
+ --chart-1: hsl(222 82% 56%);
37
+ --chart-2: hsl(174 77% 46%);
38
+ --chart-3: hsl(46 100% 52%);
39
+ --chart-4: hsl(27 92% 49%);
40
+ --chart-5: hsl(292 54% 76%);
41
+ --sidebar: hsl(220 14% 96%);
42
+ --sidebar-foreground: hsl(220 14% 14%);
43
+ --sidebar-primary: hsl(221 83% 53%);
44
+ --sidebar-primary-foreground: hsl(220 14% 98%);
45
+ --sidebar-accent: hsl(222 100% 94%);
46
+ --sidebar-accent-foreground: hsl(221 83% 53%);
47
+ --sidebar-border: hsl(220 14% 89%);
48
+ --sidebar-ring: hsl(221 83% 53%);
49
+
50
+ --primary-border: hsl(from hsl(221 83% 53%) h s calc(l + var(--opaque-button-border-intensity)));
51
+ --secondary-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
52
+ --destructive-border: hsl(from hsl(2 84% 62%) h s calc(l + var(--opaque-button-border-intensity)));
53
+ --accent-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
54
+ --muted-border: hsl(from hsl(220 14% 96%) h s calc(l + var(--opaque-button-border-intensity)));
55
+
56
+ --font-sans:
57
+ -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Tahoma, 'PingFang SC',
58
+ 'Microsoft Yahei', Arial, 'Hiragino Sans GB', sans-serif,
59
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
60
+ --font-mono: Source Code Pro, monospace;
61
+ --radius: 0.5rem;
62
+ --spacing: 0.25rem;
63
+
64
+ --shadow-2xs: 0px 2px 12px 0px hsl(0 0% 0% / 0.01);
65
+ --shadow-xs: 0px 2px 12px 0px hsl(0 0% 0% / 0.01);
66
+ --shadow-sm: 0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
67
+ --shadow: 0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
68
+ --shadow-md: 0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
69
+ --shadow-lg: 0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
70
+ --shadow-xl: 0px 2px 12px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
71
+ --shadow-2xl: 0px 2px 12px 0px hsl(0 0% 0% / 0.05);
72
+ --tracking-normal: 0em;
73
+ }
74
+
75
+ @theme inline {
76
+ --color-background: var(--background);
77
+ --color-foreground: var(--foreground);
78
+ --color-card: var(--card);
79
+ --color-card-foreground: var(--card-foreground);
80
+ --color-popover: var(--popover);
81
+ --color-popover-foreground: var(--popover-foreground);
82
+ --color-primary: var(--primary);
83
+ --color-primary-foreground: var(--primary-foreground);
84
+ --color-secondary: var(--secondary);
85
+ --color-secondary-foreground: var(--secondary-foreground);
86
+ --color-muted: var(--muted);
87
+ --color-muted-foreground: var(--muted-foreground);
88
+ --color-accent: var(--accent);
89
+ --color-accent-foreground: var(--accent-foreground);
90
+ --color-info: var(--info);
91
+ --color-info-foreground: var(--info-foreground);
92
+ --color-destructive: var(--destructive);
93
+ --color-destructive-foreground: var(--destructive-foreground);
94
+ --color-success: var(--success);
95
+ --color-success-foreground: var(--success-foreground);
96
+ --color-warning: var(--warning);
97
+ --color-warning-foreground: var(--warning-foreground);
98
+ --color-border: var(--border);
99
+ --color-input: var(--input);
100
+ --color-ring: var(--ring);
101
+ --color-chart-1: var(--chart-1);
102
+ --color-chart-2: var(--chart-2);
103
+ --color-chart-3: var(--chart-3);
104
+ --color-chart-4: var(--chart-4);
105
+ --color-chart-5: var(--chart-5);
106
+ --color-sidebar: var(--sidebar);
107
+ --color-sidebar-foreground: var(--sidebar-foreground);
108
+ --color-sidebar-primary: var(--sidebar-primary);
109
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
110
+ --color-sidebar-accent: var(--sidebar-accent);
111
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
112
+ --color-sidebar-border: var(--sidebar-border);
113
+ --color-sidebar-ring: var(--sidebar-ring);
114
+
115
+ --font-sans: var(--font-sans);
116
+ --font-mono: var(--font-mono);
117
+
118
+ --radius-sm: calc(var(--radius) - 4px);
119
+ --radius-md: calc(var(--radius) - 2px);
120
+ --radius-lg: var(--radius);
121
+ --radius-xl: calc(var(--radius) + 4px);
122
+
123
+ --shadow-2xs: var(--shadow-2xs);
124
+ --shadow-xs: var(--shadow-xs);
125
+ --shadow-sm: var(--shadow-sm);
126
+ --shadow: var(--shadow);
127
+ --shadow-md: var(--shadow-md);
128
+ --shadow-lg: var(--shadow-lg);
129
+ --shadow-xl: var(--shadow-xl);
130
+ --shadow-2xl: var(--shadow-2xl);
131
+ }
@@ -0,0 +1,16 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import { BrowserRouter } from "react-router-dom";
4
+ import { AppContainer } from "@lark-apaas/client-toolkit-lite";
5
+ import App from "./app";
6
+ import "./index.css";
7
+
8
+ createRoot(document.getElementById("root")!).render(
9
+ <StrictMode>
10
+ <BrowserRouter basename={process.env.CLIENT_BASE_PATH || "/"}>
11
+ <AppContainer>
12
+ <App />
13
+ </AppContainer>
14
+ </BrowserRouter>
15
+ </StrictMode>,
16
+ );
@@ -0,0 +1,11 @@
1
+ import { Link } from "react-router-dom";
2
+
3
+ export default function NotFoundPage() {
4
+ return (
5
+ <div className="flex flex-col items-center justify-center py-24">
6
+ <h1 className="text-6xl font-bold mb-4">404</h1>
7
+ <p className="text-lg text-muted-foreground mb-8">页面不存在</p>
8
+ <Link to="/" className="text-primary hover:underline">返回首页</Link>
9
+ </div>
10
+ );
11
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "client/src/index.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
21
+ }
@@ -0,0 +1,34 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+ import { defineConfig, globalIgnores } from 'eslint/config'
7
+
8
+ export default defineConfig([
9
+ globalIgnores(['dist', '**/components/ui/**']),
10
+ {
11
+ files: ['**/*.{ts,tsx}'],
12
+ extends: [
13
+ js.configs.recommended,
14
+ tseslint.configs.recommended,
15
+ reactHooks.configs.flat.recommended,
16
+ reactRefresh.configs.vite,
17
+ ],
18
+ languageOptions: {
19
+ ecmaVersion: 2020,
20
+ globals: globals.browser,
21
+ },
22
+ rules: {
23
+ // 关闭仅语法相关、不影响编译和运行时的规则
24
+ 'react-refresh/only-export-components': 'off',
25
+ '@typescript-eslint/no-unused-vars': 'off',
26
+ '@typescript-eslint/no-explicit-any': 'off',
27
+ '@typescript-eslint/no-empty-object-type': 'off',
28
+ '@typescript-eslint/no-require-imports': 'off',
29
+ 'no-empty': 'off',
30
+ 'prefer-const': 'off',
31
+ 'no-unused-labels': 'off',
32
+ },
33
+ },
34
+ ])