@@ -19,7 +19,12 @@ import {
1919 writeJsonFile ,
2020} from '@nx/devkit' ;
2121
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' ;
2328import { bgRgb , bold , cyan , green , red } from 'ansis' ;
2429import { execSync } from 'child_process' ;
2530import { existsSync , readFileSync , writeFileSync } from 'fs' ;
@@ -127,8 +132,8 @@ async function handleInit() {
127132 uiComponentsPath : args [ 'uiComponentsPath' ] as string ,
128133 rootCssPath : args [ 'rootCssPath' ] as string ,
129134 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 ,
132137 } ;
133138
134139 if ( ! config . projectRoot ) {
@@ -211,8 +216,8 @@ async function handleInit() {
211216
212217 if ( ! shouldCustomize ) {
213218 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'] ;
216221 } else {
217222 if ( ! config . style ) {
218223 config . style = cancelable (
@@ -224,7 +229,7 @@ async function handleInit() {
224229 { label : 'Brutalist' , value : ThemeStyle . BRUTALIST } ,
225230 { label : 'Neumorphic' , value : ThemeStyle . NEUMORPHIC } ,
226231 ] ,
227- initialValue : 'simple' ,
232+ initialValue : ThemeStyle . SIMPLE ,
228233 } ) ,
229234 ) ;
230235 }
@@ -233,63 +238,51 @@ async function handleInit() {
233238 config . primaryColor = cancelable (
234239 await select ( {
235240 message : cyan ( 'Choose a primary color' ) ,
236- initialValue : Color . CYAN + '-600' ,
241+ initialValue : ThemePrimaryColor . CYAN600 ,
237242 options : [
238243 {
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+ } ,
245248 {
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 ,
251252 } ,
252253 {
253254 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 ,
258259 } ,
259260 {
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 ,
265264 } ,
266265 {
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 ,
272269 } ,
273270 {
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 ,
279274 } ,
280275 {
281276 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 ,
286281 } ,
287282 {
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 ,
293286 } ,
294287 ] ,
295288 } ) ,
0 commit comments