@coze-arch/cli 0.0.8 → 0.0.9
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 +180 -17
- package/lib/__templates__/expo/README.md +180 -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/global.css +267 -0
- package/lib/__templates__/expo/client/metro.config.js +8 -1
- package/lib/__templates__/expo/client/package.json +3 -1
- package/lib/__templates__/expo/client/screens/demo/index.tsx +7 -13
- package/lib/__templates__/expo/client/uniwind-types.d.ts +10 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +495 -47
- package/lib/__templates__/nextjs/next.config.ts +1 -1
- package/lib/__templates__/taro/project.config.json +9 -1
- package/lib/cli.js +4 -1
- package/package.json +4 -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
|
@@ -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
|
+
});
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { View, Text } from 'react-native';
|
|
2
2
|
import { Image } from 'expo-image';
|
|
3
3
|
|
|
4
|
-
import { useTheme } from '@/hooks/useTheme';
|
|
5
4
|
import { Screen } from '@/components/Screen';
|
|
6
|
-
import { styles } from './styles';
|
|
7
5
|
|
|
8
6
|
export default function DemoPage() {
|
|
9
|
-
const { theme, isDark } = useTheme();
|
|
10
|
-
|
|
11
7
|
return (
|
|
12
|
-
<Screen
|
|
13
|
-
<View
|
|
14
|
-
style={styles.container}
|
|
15
|
-
>
|
|
8
|
+
<Screen statusBarStyle="auto">
|
|
9
|
+
<View className="absolute top-0 left-0 w-full h-full flex flex-col items-center justify-center">
|
|
16
10
|
<Image
|
|
17
|
-
|
|
18
|
-
source="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/
|
|
19
|
-
|
|
20
|
-
<Text
|
|
21
|
-
<Text
|
|
11
|
+
className="w-[130px] h-[109px]"
|
|
12
|
+
source="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/expo/coze-loading.gif"
|
|
13
|
+
/>
|
|
14
|
+
<Text className="text-base font-bold text-foreground">APP 开发中</Text>
|
|
15
|
+
<Text className="text-sm mt-2 text-muted">即将为您呈现应用界面</Text>
|
|
22
16
|
</View>
|
|
23
17
|
</Screen>
|
|
24
18
|
);
|