@@ -19,7 +19,12 @@ import {
19
19
writeJsonFile ,
20
20
} from '@nx/devkit' ;
21
21
22
- import { Color , ThemeStyle , type BorderRadius , type ThemeConfig } from '@qwik-ui/utils' ;
22
+ import {
23
+ ThemePrimaryColor ,
24
+ ThemeStyle ,
25
+ ThemeBorderRadius ,
26
+ ThemeConfig ,
27
+ } from '@qwik-ui/utils' ;
23
28
import { bgRgb , bold , cyan , green , red } from 'ansis' ;
24
29
import { execSync } from 'child_process' ;
25
30
import { existsSync , readFileSync , writeFileSync } from 'fs' ;
@@ -127,8 +132,8 @@ async function handleInit() {
127
132
uiComponentsPath : args [ 'uiComponentsPath' ] as string ,
128
133
rootCssPath : args [ 'rootCssPath' ] as string ,
129
134
style : args [ 'style' ] as ThemeStyle ,
130
- primaryColor : args [ 'primaryColor' ] as string ,
131
- borderRadius : args [ 'borderRadius' ] as BorderRadius ,
135
+ primaryColor : args [ 'primaryColor' ] as ThemePrimaryColor ,
136
+ borderRadius : args [ 'borderRadius' ] as ThemeBorderRadius ,
132
137
} ;
133
138
134
139
if ( ! config . projectRoot ) {
@@ -211,8 +216,8 @@ async function handleInit() {
211
216
212
217
if ( ! shouldCustomize ) {
213
218
config . style ||= ThemeStyle . SIMPLE ;
214
- config . primaryColor ||= Color . CYAN + '-600' ;
215
- config . borderRadius ||= 'border-radius -0';
219
+ config . primaryColor ||= ThemePrimaryColor . CYAN600 ;
220
+ config . borderRadius ||= ThemeBorderRadius [ 'BORDER-RADIUS -0'] ;
216
221
} else {
217
222
if ( ! config . style ) {
218
223
config . style = cancelable (
@@ -224,7 +229,7 @@ async function handleInit() {
224
229
{ label : 'Brutalist' , value : ThemeStyle . BRUTALIST } ,
225
230
{ label : 'Neumorphic' , value : ThemeStyle . NEUMORPHIC } ,
226
231
] ,
227
- initialValue : 'simple' ,
232
+ initialValue : ThemeStyle . SIMPLE ,
228
233
} ) ,
229
234
) ;
230
235
}
@@ -233,63 +238,51 @@ async function handleInit() {
233
238
config . primaryColor = cancelable (
234
239
await select ( {
235
240
message : cyan ( 'Choose a primary color' ) ,
236
- initialValue : Color . CYAN + '-600' ,
241
+ initialValue : ThemePrimaryColor . CYAN600 ,
237
242
options : [
238
243
{
239
- label : bold `${ bgRgb ( 220 , 38 , 38 ) ` ` } ${ capitalizeFirstLetter (
240
- Color . RED ,
241
- ) } `,
242
- hint : Color . RED + '-600' ,
243
- value : Color . RED + '-600' ,
244
- } , // 600
244
+ label : bold `${ bgRgb ( 220 , 38 , 38 ) ` ` } ${ capitalizeFirstLetter ( 'Red' ) } ` ,
245
+ hint : ThemePrimaryColor . RED600 ,
246
+ value : ThemePrimaryColor . RED600 ,
247
+ } ,
245
248
{
246
- label : bold `${ bgRgb ( 234 , 88 , 12 ) ` ` } ${ capitalizeFirstLetter (
247
- Color . ORANGE ,
248
- ) } `, // 600
249
- hint : Color . ORANGE + '-600' ,
250
- value : Color . ORANGE + '-600' ,
249
+ label : bold `${ bgRgb ( 234 , 88 , 12 ) ` ` } ${ capitalizeFirstLetter ( 'Orange' ) } ` ,
250
+ hint : ThemePrimaryColor . ORANGE600 ,
251
+ value : ThemePrimaryColor . ORANGE600 ,
251
252
} ,
252
253
{
253
254
label : bold `${ bgRgb ( 250 , 204 , 21 ) ` ` } ${ capitalizeFirstLetter (
254
- Color . YELLOW ,
255
- ) } `, // 400
256
- hint : Color . YELLOW + '-400' ,
257
- value : Color . YELLOW + '-400' ,
255
+ 'Yellow' ,
256
+ ) } `,
257
+ hint : ThemePrimaryColor . YELLOW400 ,
258
+ value : ThemePrimaryColor . YELLOW400 ,
258
259
} ,
259
260
{
260
- label : bold `${ bgRgb ( 22 , 163 , 74 ) ` ` } ${ capitalizeFirstLetter (
261
- Color . GREEN ,
262
- ) } `, // 600
263
- hint : Color . GREEN + '-600' ,
264
- value : Color . GREEN + '-600' ,
261
+ label : bold `${ bgRgb ( 22 , 163 , 74 ) ` ` } ${ capitalizeFirstLetter ( 'Green' ) } ` ,
262
+ hint : ThemePrimaryColor . GREEN600 ,
263
+ value : ThemePrimaryColor . GREEN600 ,
265
264
} ,
266
265
{
267
- label : bold `${ bgRgb ( 6 , 182 , 212 ) ` ` } ${ capitalizeFirstLetter (
268
- Color . CYAN ,
269
- ) } `, // 600
270
- hint : Color . CYAN + '-600' ,
271
- value : Color . CYAN + '-600' ,
266
+ label : bold `${ bgRgb ( 6 , 182 , 212 ) ` ` } ${ capitalizeFirstLetter ( 'Cyan' ) } ` ,
267
+ hint : ThemePrimaryColor . CYAN600 ,
268
+ value : ThemePrimaryColor . CYAN600 ,
272
269
} ,
273
270
{
274
- label : bold `${ bgRgb ( 37 , 99 , 235 ) ` ` } ${ capitalizeFirstLetter (
275
- Color . BLUE ,
276
- ) } `, // 600
277
- hint : Color . BLUE + '-600' ,
278
- value : Color . BLUE + '-600' ,
271
+ label : bold `${ bgRgb ( 37 , 99 , 235 ) ` ` } ${ capitalizeFirstLetter ( 'Blue' ) } ` ,
272
+ hint : ThemePrimaryColor . BLUE600 ,
273
+ value : ThemePrimaryColor . BLUE600 ,
279
274
} ,
280
275
{
281
276
label : bold `${ bgRgb ( 147 , 51 , 234 ) ` ` } ${ capitalizeFirstLetter (
282
- Color . PURPLE ,
283
- ) } `, // 600
284
- hint : Color . PURPLE + '-600' ,
285
- value : Color . PURPLE + '-600' ,
277
+ 'Purple' ,
278
+ ) } `,
279
+ hint : ThemePrimaryColor . PURPLE600 ,
280
+ value : ThemePrimaryColor . PURPLE600 ,
286
281
} ,
287
282
{
288
- label : bold `${ bgRgb ( 219 , 39 , 119 ) ` ` } ${ capitalizeFirstLetter (
289
- Color . PINK ,
290
- ) } `, // 600
291
- hint : Color . PINK + '-600' ,
292
- value : Color . PINK + '-600' ,
283
+ label : bold `${ bgRgb ( 219 , 39 , 119 ) ` ` } ${ capitalizeFirstLetter ( 'Pink' ) } ` ,
284
+ hint : ThemePrimaryColor . PINK600 ,
285
+ value : ThemePrimaryColor . PINK600 ,
293
286
} ,
294
287
] ,
295
288
} ) ,
0 commit comments