@coze-arch/cli 0.0.7-alpha.e6346c → 0.0.8-alpha.fe3c0f
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/lib/__templates__/expo/AGENTS.md +46 -17
- package/lib/__templates__/expo/README.md +46 -17
- package/lib/__templates__/expo/client/app/+not-found.tsx +4 -19
- package/lib/__templates__/expo/client/app/_layout.tsx +16 -22
- package/lib/__templates__/expo/client/components/ColorSchemeUpdater.tsx +43 -0
- package/lib/__templates__/expo/client/components/Provider.tsx +18 -0
- package/lib/__templates__/expo/client/components/Screen.tsx +1 -1
- package/lib/__templates__/expo/client/eslint.config.mjs +1 -0
- package/lib/__templates__/expo/client/global.css +267 -0
- package/lib/__templates__/expo/client/metro.config.js +8 -1
- package/lib/__templates__/expo/client/package.json +5 -2
- package/lib/__templates__/expo/client/screens/demo/index.tsx +7 -13
- package/lib/__templates__/expo/client/scripts/formatter.mjs +78 -0
- package/lib/__templates__/expo/client/scripts/reporter.mjs +1358 -0
- package/lib/__templates__/expo/client/scripts/stylish-formatter.mjs +153 -0
- package/lib/__templates__/expo/client/scripts/text-table.mjs +68 -0
- package/lib/__templates__/expo/client/uniwind-types.d.ts +10 -0
- package/lib/__templates__/expo/package.json +4 -1
- package/lib/__templates__/expo/pnpm-lock.yaml +15 -4
- package/lib/__templates__/expo/server/package.json +2 -1
- package/lib/__templates__/nextjs/AGENTS.md +0 -7
- package/lib/__templates__/nextjs/package.json +0 -2
- package/lib/__templates__/nextjs/scripts/build.sh +2 -2
- package/lib/__templates__/nextjs/scripts/dev.sh +1 -1
- package/lib/__templates__/nuxt-vue/AGENTS.md +0 -7
- package/lib/__templates__/nuxt-vue/nuxt.config.ts +13 -0
- package/lib/__templates__/nuxt-vue/package.json +1 -7
- package/lib/__templates__/nuxt-vue/scripts/build.sh +1 -1
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +1 -1
- package/lib/__templates__/vite/AGENTS.md +0 -7
- package/lib/__templates__/vite/package.json +0 -2
- package/lib/__templates__/vite/scripts/build.sh +2 -2
- package/lib/__templates__/vite/scripts/dev.sh +1 -1
- package/lib/cli.js +4175 -522
- package/package.json +3 -1
- package/lib/__templates__/expo/client/components/ThemedText.tsx +0 -33
- package/lib/__templates__/expo/client/components/ThemedView.tsx +0 -37
- package/lib/__templates__/expo/client/constants/theme.ts +0 -177
- package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +0 -48
- package/lib/__templates__/expo/client/hooks/useTheme.ts +0 -33
- package/lib/__templates__/expo/client/screens/demo/styles.ts +0 -28
- package/lib/__templates__/nuxt-vue/eslint.config.mjs +0 -12
|
@@ -7,33 +7,66 @@
|
|
|
7
7
|
- Expo 代码在 client 目录,Express.js 代码在 server 目录
|
|
8
8
|
- 本模板默认无 Tab Bar,可按需改造
|
|
9
9
|
|
|
10
|
-
目录结构说明
|
|
11
|
-
|
|
12
|
-
├── server/ # 服务端代码根目录 (Express.js)
|
|
13
|
-
| ├── src/
|
|
14
|
-
│ │ └── index.ts # Express 入口文件
|
|
15
|
-
| └── package.json # 服务端 package.json
|
|
16
10
|
├── client/ # React Native 前端代码
|
|
17
11
|
│ ├── app/ # Expo Router 路由目录(仅路由配置)
|
|
18
12
|
│ │ ├── _layout.tsx # 根布局文件(必需,务必阅读)
|
|
19
|
-
│ │
|
|
20
|
-
│ │ └── index.tsx # re-export home.tsx
|
|
13
|
+
│ │ └── index.tsx # 首页
|
|
21
14
|
│ ├── screens/ # 页面实现目录(与 app/ 路由对应)
|
|
22
|
-
│ │ └── demo/ #
|
|
23
|
-
│ │
|
|
24
|
-
│ │ └── styles.ts # 页面样式
|
|
15
|
+
│ │ └── demo/ # 示例页面
|
|
16
|
+
│ │ └── index.tsx
|
|
25
17
|
│ ├── components/ # 可复用组件
|
|
26
18
|
│ │ └── Screen.tsx # 页面容器组件(必用)
|
|
27
19
|
│ ├── hooks/ # 自定义 Hooks
|
|
28
20
|
│ ├── contexts/ # React Context 代码
|
|
29
|
-
│ ├── constants/ # 常量定义(如主题配置)
|
|
30
21
|
│ ├── utils/ # 工具函数
|
|
31
22
|
│ ├── assets/ # 静态资源
|
|
32
23
|
| └── package.json # Expo 应用 package.json
|
|
24
|
+
├── server/ # 服务端代码根目录 (Express.js)
|
|
25
|
+
| ├── src/
|
|
26
|
+
│ │ └── index.ts # 服务端入口文件
|
|
27
|
+
| └── package.json # 服务端 package.json
|
|
33
28
|
├── package.json
|
|
34
29
|
├── .cozeproj # 预置脚手架脚本(禁止修改)
|
|
35
30
|
└── .coze # 配置文件(禁止修改)
|
|
36
31
|
|
|
32
|
+
## 样式方案
|
|
33
|
+
|
|
34
|
+
基于 tailwindcss 进行样式开发(底层基于 Uniwind)
|
|
35
|
+
|
|
36
|
+
写法示例:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<View className="flex-1 bg-white dark:bg-gray-900 p-4"></View>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<Text
|
|
44
|
+
className="text-lg font-bold text-gray-900 dark:text-white"
|
|
45
|
+
selectionColorClassName="accent-blue-500"
|
|
46
|
+
>
|
|
47
|
+
Hello World
|
|
48
|
+
</Text>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Uniwind 官方文档:https://docs.uniwind.dev/llms.txt
|
|
52
|
+
|
|
53
|
+
## 如何进行静态校验(TSC + ESLint)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 对 client 和 server 目录同时进行校验
|
|
57
|
+
npm run lint
|
|
58
|
+
|
|
59
|
+
# 对 client 目录进行校验
|
|
60
|
+
npm run lint:client
|
|
61
|
+
|
|
62
|
+
# 对 server 目录进行校验
|
|
63
|
+
npm run lint:server
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 如何修改主题模式(跟随系统、固定暗色、固定亮色)
|
|
67
|
+
|
|
68
|
+
默认为跟随系统,如果用户明确指定为“暗色”或“亮色”,需要修改 `client/components/ColorSchemeUpdater.tsx` 的 `DEFAULT_THEME` 变量为合适的值
|
|
69
|
+
|
|
37
70
|
## 依赖管理与模块导入规范
|
|
38
71
|
|
|
39
72
|
### 依赖安装
|
|
@@ -70,8 +103,4 @@ import { Screen } from '../../../components/Screen';
|
|
|
70
103
|
|
|
71
104
|
## 本地开发
|
|
72
105
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
coze dev
|
|
77
|
-
```
|
|
106
|
+
`coze dev`:用来首次启动前后端服务,也可以用来重启前后端服务(该命令会先尝试杀掉占用端口的进程,再启动服务)
|
|
@@ -7,33 +7,66 @@
|
|
|
7
7
|
- Expo 代码在 client 目录,Express.js 代码在 server 目录
|
|
8
8
|
- 本模板默认无 Tab Bar,可按需改造
|
|
9
9
|
|
|
10
|
-
目录结构说明
|
|
11
|
-
|
|
12
|
-
├── server/ # 服务端代码根目录 (Express.js)
|
|
13
|
-
| ├── src/
|
|
14
|
-
│ │ └── index.ts # Express 入口文件
|
|
15
|
-
| └── package.json # 服务端 package.json
|
|
16
10
|
├── client/ # React Native 前端代码
|
|
17
11
|
│ ├── app/ # Expo Router 路由目录(仅路由配置)
|
|
18
12
|
│ │ ├── _layout.tsx # 根布局文件(必需,务必阅读)
|
|
19
|
-
│ │
|
|
20
|
-
│ │ └── index.tsx # re-export home.tsx
|
|
13
|
+
│ │ └── index.tsx # 首页
|
|
21
14
|
│ ├── screens/ # 页面实现目录(与 app/ 路由对应)
|
|
22
|
-
│ │ └── demo/ #
|
|
23
|
-
│ │
|
|
24
|
-
│ │ └── styles.ts # 页面样式
|
|
15
|
+
│ │ └── demo/ # 示例页面
|
|
16
|
+
│ │ └── index.tsx
|
|
25
17
|
│ ├── components/ # 可复用组件
|
|
26
18
|
│ │ └── Screen.tsx # 页面容器组件(必用)
|
|
27
19
|
│ ├── hooks/ # 自定义 Hooks
|
|
28
20
|
│ ├── contexts/ # React Context 代码
|
|
29
|
-
│ ├── constants/ # 常量定义(如主题配置)
|
|
30
21
|
│ ├── utils/ # 工具函数
|
|
31
22
|
│ ├── assets/ # 静态资源
|
|
32
23
|
| └── package.json # Expo 应用 package.json
|
|
24
|
+
├── server/ # 服务端代码根目录 (Express.js)
|
|
25
|
+
| ├── src/
|
|
26
|
+
│ │ └── index.ts # 服务端入口文件
|
|
27
|
+
| └── package.json # 服务端 package.json
|
|
33
28
|
├── package.json
|
|
34
29
|
├── .cozeproj # 预置脚手架脚本(禁止修改)
|
|
35
30
|
└── .coze # 配置文件(禁止修改)
|
|
36
31
|
|
|
32
|
+
## 样式方案
|
|
33
|
+
|
|
34
|
+
基于 tailwindcss 进行样式开发(底层基于 Uniwind)
|
|
35
|
+
|
|
36
|
+
写法示例:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<View className="flex-1 bg-white dark:bg-gray-900 p-4"></View>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<Text
|
|
44
|
+
className="text-lg font-bold text-gray-900 dark:text-white"
|
|
45
|
+
selectionColorClassName="accent-blue-500"
|
|
46
|
+
>
|
|
47
|
+
Hello World
|
|
48
|
+
</Text>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Uniwind 官方文档:https://docs.uniwind.dev/llms.txt
|
|
52
|
+
|
|
53
|
+
## 如何进行静态校验(TSC + ESLint)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 对 client 和 server 目录同时进行校验
|
|
57
|
+
npm run lint
|
|
58
|
+
|
|
59
|
+
# 对 client 目录进行校验
|
|
60
|
+
npm run lint:client
|
|
61
|
+
|
|
62
|
+
# 对 server 目录进行校验
|
|
63
|
+
npm run lint:server
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 如何修改主题模式(跟随系统、固定暗色、固定亮色)
|
|
67
|
+
|
|
68
|
+
默认为跟随系统,如果用户明确指定为“暗色”或“亮色”,需要修改 `client/components/ColorSchemeUpdater.tsx` 的 `DEFAULT_THEME` 变量为合适的值
|
|
69
|
+
|
|
37
70
|
## 依赖管理与模块导入规范
|
|
38
71
|
|
|
39
72
|
### 依赖安装
|
|
@@ -70,8 +103,4 @@ import { Screen } from '../../../components/Screen';
|
|
|
70
103
|
|
|
71
104
|
## 本地开发
|
|
72
105
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
coze dev
|
|
77
|
-
```
|
|
106
|
+
`coze dev`:用来首次启动前后端服务,也可以用来重启前后端服务(该命令会先尝试杀掉占用端口的进程,再启动服务)
|
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import { View, Text
|
|
1
|
+
import { View, Text } from 'react-native';
|
|
2
2
|
import { Link } from 'expo-router';
|
|
3
|
-
import { useTheme } from '@/hooks/useTheme';
|
|
4
|
-
import { Spacing } from '@/constants/theme';
|
|
5
3
|
|
|
6
4
|
export default function NotFoundScreen() {
|
|
7
|
-
const { theme } = useTheme();
|
|
8
|
-
|
|
9
5
|
return (
|
|
10
|
-
<View
|
|
11
|
-
<Text>
|
|
6
|
+
<View className="flex-1 justify-center items-center bg-background">
|
|
7
|
+
<Text className="text-foreground">
|
|
12
8
|
页面不存在
|
|
13
9
|
</Text>
|
|
14
|
-
<Link href="/"
|
|
10
|
+
<Link href="/" className="text-accent mt-6">
|
|
15
11
|
返回首页
|
|
16
12
|
</Link>
|
|
17
13
|
</View>
|
|
18
14
|
);
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
const styles = StyleSheet.create({
|
|
22
|
-
container: {
|
|
23
|
-
flex: 1,
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
},
|
|
27
|
-
gohome: {
|
|
28
|
-
marginTop: Spacing['2xl'],
|
|
29
|
-
},
|
|
30
|
-
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
3
1
|
import { Stack } from 'expo-router';
|
|
4
2
|
import { StatusBar } from 'expo-status-bar';
|
|
5
3
|
import { LogBox } from 'react-native';
|
|
6
4
|
import Toast from 'react-native-toast-message';
|
|
7
|
-
import {
|
|
8
|
-
|
|
5
|
+
import { Provider } from '@/components/Provider';
|
|
6
|
+
|
|
7
|
+
import '../global.css';
|
|
9
8
|
|
|
10
9
|
LogBox.ignoreLogs([
|
|
11
10
|
"TurboModuleRegistry.getEnforcing(...): 'RNMapsAirModule' could not be found",
|
|
@@ -14,23 +13,18 @@ LogBox.ignoreLogs([
|
|
|
14
13
|
|
|
15
14
|
export default function RootLayout() {
|
|
16
15
|
return (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</Stack>
|
|
31
|
-
<Toast />
|
|
32
|
-
</GestureHandlerRootView>
|
|
33
|
-
</ColorSchemeProvider>
|
|
34
|
-
</AuthProvider>
|
|
16
|
+
<Provider>
|
|
17
|
+
<Stack
|
|
18
|
+
screenOptions={{
|
|
19
|
+
animation: 'slide_from_right',
|
|
20
|
+
gestureEnabled: true,
|
|
21
|
+
gestureDirection: 'horizontal',
|
|
22
|
+
headerShown: false
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Stack.Screen name="index" options={{ title: "" }} />
|
|
26
|
+
</Stack>
|
|
27
|
+
<Toast />
|
|
28
|
+
</Provider>
|
|
35
29
|
);
|
|
36
30
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Fragment, useEffect } from 'react';
|
|
2
|
+
import { ColorSchemeName, Platform } from 'react-native';
|
|
3
|
+
import { Uniwind } from 'uniwind'
|
|
4
|
+
|
|
5
|
+
// system: 跟随系统变化
|
|
6
|
+
// light: 固定为 light 主题
|
|
7
|
+
// dark: 固定为 dark 主题
|
|
8
|
+
const DEFAULT_THEME: 'system' | 'light' | 'dark' = 'system'
|
|
9
|
+
|
|
10
|
+
const WebOnlyColorSchemeUpdater = function ({ children }: { children?: ReactNode }) {
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
Uniwind.setTheme(DEFAULT_THEME);
|
|
13
|
+
}, []);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
function handleMessage(e: MessageEvent<{ event: string; colorScheme: ColorSchemeName; } | undefined>) {
|
|
17
|
+
if (e.data?.event === 'coze.workbench.colorScheme') {
|
|
18
|
+
const cs = e.data.colorScheme;
|
|
19
|
+
if (typeof cs === 'string') {
|
|
20
|
+
Uniwind.setTheme(cs);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (Platform.OS === 'web') {
|
|
26
|
+
window.addEventListener('message', handleMessage, false);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return () => {
|
|
30
|
+
if (Platform.OS === 'web') {
|
|
31
|
+
window.removeEventListener('message', handleMessage, false);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return <Fragment>
|
|
37
|
+
{children}
|
|
38
|
+
</Fragment>
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
WebOnlyColorSchemeUpdater,
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AuthProvider } from '@/contexts/AuthContext';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
4
|
+
import { WebOnlyColorSchemeUpdater } from './ColorSchemeUpdater';
|
|
5
|
+
|
|
6
|
+
function Provider({ children }: { children: ReactNode }) {
|
|
7
|
+
return <WebOnlyColorSchemeUpdater>
|
|
8
|
+
<AuthProvider>
|
|
9
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
10
|
+
{children}
|
|
11
|
+
</GestureHandlerRootView>
|
|
12
|
+
</AuthProvider>
|
|
13
|
+
</WebOnlyColorSchemeUpdater>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
Provider,
|
|
18
|
+
}
|
|
@@ -142,7 +142,7 @@ const KeyboardAwareScrollable = ({
|
|
|
142
142
|
|
|
143
143
|
export const Screen = ({
|
|
144
144
|
children,
|
|
145
|
-
backgroundColor = '
|
|
145
|
+
backgroundColor = 'var(--background)',
|
|
146
146
|
statusBarStyle = 'dark',
|
|
147
147
|
statusBarColor = 'transparent',
|
|
148
148
|
safeAreaEdges = ['top', 'left', 'right', 'bottom'],
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@import 'uniwind';
|
|
3
|
+
|
|
4
|
+
@theme {
|
|
5
|
+
/* Primitive Colors (Do not change between light and dark) */
|
|
6
|
+
--white: oklch(100% 0 0);
|
|
7
|
+
--black: oklch(0% 0 0);
|
|
8
|
+
--snow: oklch(0.9911 0 0);
|
|
9
|
+
--eclipse: oklch(0.2103 0.0059 285.89);
|
|
10
|
+
|
|
11
|
+
/* Border */
|
|
12
|
+
--border-width: 1px;
|
|
13
|
+
--field-border-width: 0px;
|
|
14
|
+
|
|
15
|
+
/* Base radius */
|
|
16
|
+
--radius: 0.5rem;
|
|
17
|
+
--field-radius: calc(var(--radius) * 1.5);
|
|
18
|
+
|
|
19
|
+
/* Opacity */
|
|
20
|
+
--opacity-disabled: 0.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@layer theme {
|
|
24
|
+
:root {
|
|
25
|
+
@variant light {
|
|
26
|
+
/* Base Colors */
|
|
27
|
+
--background: #fafafa;
|
|
28
|
+
--foreground: var(--eclipse);
|
|
29
|
+
|
|
30
|
+
/* Surface: Used for non-overlay components (cards, accordions, disclosure groups) */
|
|
31
|
+
--surface: var(--white);
|
|
32
|
+
--surface-foreground: var(--foreground);
|
|
33
|
+
|
|
34
|
+
/* Overlay: Used for floating/overlay components (dialogs, popovers, modals, menus) */
|
|
35
|
+
--overlay: var(--white);
|
|
36
|
+
--overlay-foreground: var(--foreground);
|
|
37
|
+
|
|
38
|
+
--muted: oklch(0.5517 0.0138 285.94);
|
|
39
|
+
|
|
40
|
+
--default: oklch(94% 0.001 286.375);
|
|
41
|
+
--default-foreground: var(--eclipse);
|
|
42
|
+
|
|
43
|
+
--accent: oklch(0.6204 0.195 253.83);
|
|
44
|
+
--accent-foreground: var(--snow);
|
|
45
|
+
|
|
46
|
+
/* Form Fields */
|
|
47
|
+
--field-background: var(--white);
|
|
48
|
+
--field-foreground: oklch(0.2103 0.0059 285.89);
|
|
49
|
+
--field-placeholder: var(--muted);
|
|
50
|
+
--field-border: transparent; /* no border by default on form fields */
|
|
51
|
+
|
|
52
|
+
/* Status Colors */
|
|
53
|
+
--success: oklch(0.7329 0.1935 150.81);
|
|
54
|
+
--success-foreground: var(--eclipse);
|
|
55
|
+
|
|
56
|
+
--warning: oklch(0.7819 0.1585 72.33);
|
|
57
|
+
--warning-foreground: var(--eclipse);
|
|
58
|
+
|
|
59
|
+
--danger: oklch(0.6532 0.2328 25.74);
|
|
60
|
+
--danger-foreground: var(--snow);
|
|
61
|
+
|
|
62
|
+
/* Component Colors */
|
|
63
|
+
--segment: var(--white);
|
|
64
|
+
--segment-foreground: var(--eclipse);
|
|
65
|
+
|
|
66
|
+
/* Misc Colors */
|
|
67
|
+
--border: oklch(90% 0.004 286.32);
|
|
68
|
+
--separator: oklch(74% 0.004 286.32);
|
|
69
|
+
--focus: var(--accent);
|
|
70
|
+
--link: var(--foreground);
|
|
71
|
+
|
|
72
|
+
/* Shadows */
|
|
73
|
+
--surface-shadow:
|
|
74
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.06),
|
|
75
|
+
0 0 1px 0 rgba(0, 0, 0, 0.06);
|
|
76
|
+
--overlay-shadow:
|
|
77
|
+
0 2px 8px 0 rgba(0, 0, 0, 0.04), 0 -6px 12px 0 rgba(0, 0, 0, 0.02),
|
|
78
|
+
0 14px 28px 0 rgba(0, 0, 0, 0.06);
|
|
79
|
+
--field-shadow:
|
|
80
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.06),
|
|
81
|
+
0 0 1px 0 rgba(0, 0, 0, 0.06);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@variant dark {
|
|
85
|
+
/* Base Colors */
|
|
86
|
+
--background: #09090b;
|
|
87
|
+
--foreground: var(--snow);
|
|
88
|
+
|
|
89
|
+
/* Surface: Used for non-overlay components (cards, accordions, disclosure groups) */
|
|
90
|
+
--surface: oklch(0.2103 0.0059 285.89);
|
|
91
|
+
--surface-foreground: var(--foreground);
|
|
92
|
+
|
|
93
|
+
/* Overlay: Used for floating/overlay components (dialogs, popovers, modals, menus) - lighter for contrast */
|
|
94
|
+
--overlay: oklch(0.2103 0.0059 285.89);
|
|
95
|
+
--overlay-foreground: var(--foreground);
|
|
96
|
+
|
|
97
|
+
--muted: oklch(70.5% 0.015 286.067);
|
|
98
|
+
|
|
99
|
+
--default: oklch(27.4% 0.006 286.033);
|
|
100
|
+
--default-foreground: var(--snow);
|
|
101
|
+
|
|
102
|
+
--accent: oklch(0.6204 0.195 253.83);
|
|
103
|
+
--accent-foreground: var(--snow);
|
|
104
|
+
|
|
105
|
+
/* Form Field Defaults - Colors (only the ones that are different from light theme) */
|
|
106
|
+
--field-background: oklch(0.2103 0.0059 285.89);
|
|
107
|
+
--field-foreground: var(--foreground);
|
|
108
|
+
--field-placeholder: var(--muted);
|
|
109
|
+
--field-border: transparent; /* no border by default on form fields */
|
|
110
|
+
|
|
111
|
+
/* Status Colors */
|
|
112
|
+
--success: oklch(0.7329 0.1935 150.81);
|
|
113
|
+
--success-foreground: var(--eclipse);
|
|
114
|
+
|
|
115
|
+
--warning: oklch(0.8203 0.1388 76.34);
|
|
116
|
+
--warning-foreground: var(--eclipse);
|
|
117
|
+
|
|
118
|
+
--danger: oklch(0.594 0.1967 24.63);
|
|
119
|
+
--danger-foreground: var(--snow);
|
|
120
|
+
|
|
121
|
+
/* Component Colors */
|
|
122
|
+
--segment: oklch(0.3964 0.01 285.93);
|
|
123
|
+
--segment-foreground: var(--foreground);
|
|
124
|
+
|
|
125
|
+
/* Misc Colors */
|
|
126
|
+
--border: oklch(28% 0.006 286.033);
|
|
127
|
+
--separator: oklch(40% 0.006 286.033);
|
|
128
|
+
--focus: var(--accent);
|
|
129
|
+
--link: var(--foreground);
|
|
130
|
+
|
|
131
|
+
/* Shadows */
|
|
132
|
+
--surface-shadow: 0 0 0 0 transparent inset; /* No shadow on dark mode */
|
|
133
|
+
--overlay-shadow: 0 0 1px 0 rgba(255, 255, 255, 0.2) inset;
|
|
134
|
+
--field-shadow: 0 0 0 0 transparent inset; /* Transparent shadow to allow ring utilities to work */
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@theme inline static {
|
|
140
|
+
--color-background: var(--background);
|
|
141
|
+
--color-foreground: var(--foreground);
|
|
142
|
+
|
|
143
|
+
--color-surface: var(--surface);
|
|
144
|
+
--color-surface-foreground: var(--surface-foreground);
|
|
145
|
+
--color-surface-hover: color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%);
|
|
146
|
+
|
|
147
|
+
--color-overlay: var(--overlay);
|
|
148
|
+
--color-overlay-foreground: var(--overlay-foreground);
|
|
149
|
+
|
|
150
|
+
--color-muted: var(--muted);
|
|
151
|
+
|
|
152
|
+
--color-accent: var(--accent);
|
|
153
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
154
|
+
|
|
155
|
+
--color-segment: var(--segment);
|
|
156
|
+
--color-segment-foreground: var(--segment-foreground);
|
|
157
|
+
|
|
158
|
+
--color-border: var(--border);
|
|
159
|
+
--color-separator: var(--separator);
|
|
160
|
+
--color-focus: var(--focus);
|
|
161
|
+
--color-link: var(--link);
|
|
162
|
+
|
|
163
|
+
--color-default: var(--default);
|
|
164
|
+
--color-default-foreground: var(--default-foreground);
|
|
165
|
+
|
|
166
|
+
--color-success: var(--success);
|
|
167
|
+
--color-success-foreground: var(--success-foreground);
|
|
168
|
+
|
|
169
|
+
--color-warning: var(--warning);
|
|
170
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
171
|
+
|
|
172
|
+
--color-danger: var(--danger);
|
|
173
|
+
--color-danger-foreground: var(--danger-foreground);
|
|
174
|
+
|
|
175
|
+
/* Form Field Tokens */
|
|
176
|
+
--color-field: var(--field-background, var(--default));
|
|
177
|
+
--color-field-foreground: var(--field-foreground, var(--foreground));
|
|
178
|
+
--color-field-placeholder: var(--field-placeholder, var(--muted));
|
|
179
|
+
--color-field-border: var(--field-border, var(--border));
|
|
180
|
+
--radius-field: var(--field-radius, var(--radius-xl));
|
|
181
|
+
--border-width-field: var(--field-border-width, var(--border-width));
|
|
182
|
+
|
|
183
|
+
--shadow-surface: var(--surface-shadow);
|
|
184
|
+
--shadow-overlay: var(--overlay-shadow);
|
|
185
|
+
--shadow-field: var(--field-shadow);
|
|
186
|
+
|
|
187
|
+
/* Calculated Variables */
|
|
188
|
+
|
|
189
|
+
/* Colors */
|
|
190
|
+
|
|
191
|
+
/* --- background shades --- */
|
|
192
|
+
--color-background-secondary: color-mix(in oklab, var(--background) 96%, var(--foreground) 4%);
|
|
193
|
+
--color-background-tertiary: color-mix(in oklab, var(--background) 92%, var(--foreground) 8%);
|
|
194
|
+
--color-background-inverse: var(--foreground);
|
|
195
|
+
|
|
196
|
+
/* ------------------------- */
|
|
197
|
+
--color-default-hover: color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%);
|
|
198
|
+
--color-accent-hover: color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%);
|
|
199
|
+
--color-success-hover: color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%);
|
|
200
|
+
--color-warning-hover: color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%);
|
|
201
|
+
--color-danger-hover: color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%);
|
|
202
|
+
|
|
203
|
+
/* Form Field Colors */
|
|
204
|
+
--color-field-hover: color-mix(in oklab, var(--field-background, var(--default)) 90%, var(--field-foreground, var(--foreground)) 2%);
|
|
205
|
+
--color-field-focus: var(--field-background, var(--default));
|
|
206
|
+
--color-field-border-hover: color-mix(in oklab, var(--field-border, var(--border)) 88%, var(--field-foreground, var(--foreground)) 10%);
|
|
207
|
+
--color-field-border-focus: color-mix(in oklab, var(--field-border, var(--border)) 74%, var(--field-foreground, var(--foreground)) 22%);
|
|
208
|
+
|
|
209
|
+
/* Soft Colors */
|
|
210
|
+
--color-accent-soft: color-mix(in oklab, var(--accent) 15%, transparent);
|
|
211
|
+
--color-accent-soft-foreground: var(--accent);
|
|
212
|
+
--color-accent-soft-hover: color-mix(in oklab, var(--accent) 20%, transparent);
|
|
213
|
+
|
|
214
|
+
--color-danger-soft: color-mix(in oklab, var(--danger) 15%, transparent);
|
|
215
|
+
--color-danger-soft-foreground: var(--danger);
|
|
216
|
+
--color-danger-soft-hover: color-mix(in oklab, var(--danger) 20%, transparent);
|
|
217
|
+
|
|
218
|
+
--color-warning-soft: color-mix(in oklab, var(--warning) 15%, transparent);
|
|
219
|
+
--color-warning-soft-foreground: var(--warning);
|
|
220
|
+
--color-warning-soft-hover: color-mix(in oklab, var(--warning) 20%, transparent);
|
|
221
|
+
|
|
222
|
+
--color-success-soft: color-mix(in oklab, var(--success) 15%, transparent);
|
|
223
|
+
--color-success-soft-foreground: var(--success);
|
|
224
|
+
--color-success-soft-hover: color-mix(in oklab, var(--success) 20%, transparent);
|
|
225
|
+
|
|
226
|
+
/* Surface Levels - progressively darker/lighter shades for layering */
|
|
227
|
+
--color-surface-secondary: color-mix(in oklab, var(--surface) 94%, var(--surface-foreground) 6%);
|
|
228
|
+
--color-surface-tertiary: color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%);
|
|
229
|
+
|
|
230
|
+
/* On Surface Colors */
|
|
231
|
+
--color-on-surface: color-mix(in oklab, var(--surface) 93%, var(--surface-foreground) 7%);
|
|
232
|
+
--color-on-surface-foreground: var(--surface-foreground);
|
|
233
|
+
--color-on-surface-hover: color-mix(in oklab, var(--surface) 91%, var(--surface-foreground) 9%);
|
|
234
|
+
--color-on-surface-focus: color-mix(in oklab, var(--surface) 93%, var(--surface-foreground) 7%);
|
|
235
|
+
|
|
236
|
+
/* On Surface Colors - Secondary (on secondary surface) */
|
|
237
|
+
--color-on-surface-secondary: color-mix(in oklab, var(--surface) 87%, var(--surface-foreground) 13%);
|
|
238
|
+
--color-on-surface-secondary-foreground: var(--surface-foreground);
|
|
239
|
+
--color-on-surface-secondary-hover: color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%);
|
|
240
|
+
--color-on-surface-secondary-focus: color-mix(in oklab, var(--surface) 87%, var(--surface-foreground) 13%);
|
|
241
|
+
|
|
242
|
+
/* On Surface Colors - Tertiary (on tertiary surface) */
|
|
243
|
+
--color-on-surface-tertiary: color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%);
|
|
244
|
+
--color-on-surface-tertiary-foreground: var(--surface-foreground);
|
|
245
|
+
--color-on-surface-tertiary-hover: color-mix(in oklab, var(--surface) 84%, var(--surface-foreground) 16%);
|
|
246
|
+
--color-on-surface-tertiary-focus: color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%);
|
|
247
|
+
|
|
248
|
+
/* Separator Colors - Levels */
|
|
249
|
+
--color-separator-secondary: color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%);
|
|
250
|
+
--color-separator-tertiary: color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%);
|
|
251
|
+
|
|
252
|
+
/* Border Colors - Levels (progressive contrast: default → secondary → tertiary) */
|
|
253
|
+
/* Light mode: lighter → darker | Dark mode: darker → lighter */
|
|
254
|
+
--color-border-secondary: color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%);
|
|
255
|
+
--color-border-tertiary: color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%);
|
|
256
|
+
|
|
257
|
+
/* Radius and default sizes - defaults can change by just changing the --radius */
|
|
258
|
+
--radius-xs: calc(var(--radius) * 0.25); /* 0.125rem (2px) */
|
|
259
|
+
--radius-sm: calc(var(--radius) * 0.5); /* 0.25rem (4px) */
|
|
260
|
+
--radius-md: calc(var(--radius) * 0.75); /* 0.375rem (6px) */
|
|
261
|
+
--radius-lg: calc(var(--radius) * 1); /* 0.5rem (8px) */
|
|
262
|
+
--radius-xl: calc(var(--radius) * 1.5); /* 0.75rem (12px) */
|
|
263
|
+
--radius-2xl: calc(var(--radius) * 2); /* 1rem (16px) */
|
|
264
|
+
--radius-3xl: calc(var(--radius) * 3); /* 1.5rem (24px) */
|
|
265
|
+
--radius-4xl: calc(var(--radius) * 4); /* 2rem (32px) */
|
|
266
|
+
}
|
|
267
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
2
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
3
3
|
const connect = require('connect');
|
|
4
|
+
const { withUniwindConfig } = require('uniwind/metro');
|
|
4
5
|
|
|
5
6
|
const config = getDefaultConfig(__dirname);
|
|
6
7
|
|
|
@@ -121,4 +122,10 @@ config.server = {
|
|
|
121
122
|
},
|
|
122
123
|
};
|
|
123
124
|
|
|
124
|
-
module.exports = config
|
|
125
|
+
module.exports = withUniwindConfig(config, {
|
|
126
|
+
// relative path to your global.css file
|
|
127
|
+
cssEntryFile: './global.css',
|
|
128
|
+
// (optional) path where we gonna auto-generate typings
|
|
129
|
+
// defaults to project's root
|
|
130
|
+
dtsFile: './uniwind-types.d.ts'
|
|
131
|
+
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"check-deps": "npx depcheck",
|
|
8
8
|
"postinstall": "npm run install-missing",
|
|
9
9
|
"install-missing": "node ./scripts/install-missing-deps.js",
|
|
10
|
-
"lint": "
|
|
10
|
+
"lint": "tsc --noEmit; eslint ./ -f ./scripts/formatter.mjs --quiet",
|
|
11
11
|
"start": "expo start --web --clear",
|
|
12
12
|
"test": "jest --watchAll"
|
|
13
13
|
},
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
"react-test-renderer": "19.1.0",
|
|
91
91
|
"tsx": "^4.21.0",
|
|
92
92
|
"typescript": "^5.8.3",
|
|
93
|
-
"typescript-eslint": "^8.32.1"
|
|
93
|
+
"typescript-eslint": "^8.32.1",
|
|
94
|
+
"axios": "^1.13.6",
|
|
95
|
+
"tailwindcss": "^4.1.18",
|
|
96
|
+
"uniwind": "^1.2.7"
|
|
94
97
|
}
|
|
95
98
|
}
|