ui-thing 0.2.4 → 0.2.5
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/CHANGELOG.md +24 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/eslint.config.ts +19 -0
- package/package.json +15 -7
- package/src/commands/add.ts +1 -1
- package/src/commands/init.ts +1 -1
- package/src/commands/theme.ts +41 -18
- package/src/utils/addShortcutFiles.ts +1 -1
- package/src/utils/compareUIConfig.ts +1 -1
- package/src/utils/config.ts +5 -1
- package/src/utils/fileExists.ts +1 -0
- package/src/utils/promptForComponents.ts +0 -1
- package/src/utils/uiConfigPrompt.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.2.5
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.2.4...v0.2.5)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **theme:** Add theme name validation and improve theme selection process ([737acaf](https://github.com/BayBreezy/ui-thing-cli/commit/737acaf))
|
|
10
|
+
|
|
11
|
+
### 🏡 Chore
|
|
12
|
+
|
|
13
|
+
- **deps-dev:** Bump @types/node from 24.2.1 to 24.3.0 ([858469e](https://github.com/BayBreezy/ui-thing-cli/commit/858469e))
|
|
14
|
+
- **deps-dev:** Bump knip from 5.62.0 to 5.63.0 ([0409d0f](https://github.com/BayBreezy/ui-thing-cli/commit/0409d0f))
|
|
15
|
+
- **deps-dev:** Bump @ianvs/prettier-plugin-sort-imports ([1dc849d](https://github.com/BayBreezy/ui-thing-cli/commit/1dc849d))
|
|
16
|
+
- Update package.json to add linting scripts and ESLint configuration ([f836ee1](https://github.com/BayBreezy/ui-thing-cli/commit/f836ee1))
|
|
17
|
+
- Update ESLint configuration to disable no-explicit-any rule ([112a5dd](https://github.com/BayBreezy/ui-thing-cli/commit/112a5dd))
|
|
18
|
+
|
|
19
|
+
### 🎨 Styles
|
|
20
|
+
|
|
21
|
+
- **eslint:** Fix eslint errors ([3972b3d](https://github.com/BayBreezy/ui-thing-cli/commit/3972b3d))
|
|
22
|
+
|
|
23
|
+
### ❤️ Contributors
|
|
24
|
+
|
|
25
|
+
- Behon Baker
|
|
26
|
+
|
|
3
27
|
## v0.2.4
|
|
4
28
|
|
|
5
29
|
[compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.2.3...v0.2.4)
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
2
|
+
import{Command as je}from"commander";var H="0.2.4";import E from"path";import{updateConfig as no}from"c12/update";import{Command as Jo}from"commander";import{consola as S}from"consola";import u from"kleur";import y from"lodash";import A from"prompts";import{join as Q}from"path";import{loadConfig as Fo}from"c12";import f from"fs-extra";import Ko from"lodash";import{loadFile as Ao,writeFile as Lo}from"magicast";import{addNuxtModule as Uo}from"magicast/helpers";import jo from"prompts";var v="ui-thing.config.ts",W={theme:"zinc",tailwindCSSLocation:"assets/css/tailwind.css",componentsLocation:"components/Ui",composablesLocation:"composables",pluginsLocation:"plugins",utilsLocation:"utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},V={theme:"zinc",tailwindCSSLocation:"app/assets/css/tailwind.css",componentsLocation:"app/components/Ui",composablesLocation:"app/composables",pluginsLocation:"app/plugins",utilsLocation:"app/utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},z=["tailwindcss","motion-v","@tailwindcss/vite","reka-ui","tailwind-variants","tailwind-merge","@nuxt/fonts","@nuxtjs/color-mode","@nuxt/icon","@vueuse/nuxt","@tailwindcss/forms"],Y=["typescript","prettier-plugin-tailwindcss","prettier","@ianvs/prettier-plugin-sort-imports","tw-animate-css"],J=["@nuxtjs/color-mode","motion-v/nuxt","@vueuse/nuxt","@nuxt/icon","@nuxt/fonts"],m=[{title:"Npm",value:"npm"},{title:"Yarn",value:"yarn"},{title:"Pnpm",value:"pnpm"},{title:"Bun",value:"bun"}],g=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];import Mo from"fs";function X(){try{let o=JSON.parse(Mo.readFileSync("package.json","utf-8")),r=o.dependencies?.nuxt||o.devDependencies?.nuxt;if(r)return/^[~^>=<\s]*4/.test(r)?4:3}catch{return 4}return 4}import Z from"kleur";import Oo from"prompts";var q=async o=>{let r=await Oo([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:g},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:(e,t)=>o==3?"assets/css/tailwind.css":"app/assets/css/tailwind.css"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:(e,t)=>o==3?"components/Ui":"app/components/Ui"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:(e,t)=>o==3?"composables":"app/composables"},{name:"pluginsLocation",type:"text",message:"Where should your plugins be stored?",initial:(e,t)=>o==3?"plugins":"app/plugins"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:(e,t)=>o==3?"utils":"app/utils"},{name:"force",type:"confirm",message:"Should we just replace component files if they already exist?",initial:!0},{name:"useDefaultFilename",type:"confirm",message:"Would you like to use the default filename when adding components?",initial:!0},{name:"packageManager",type:"select",message:"Which package manager do you use?",choices:m}]);return!r||Object.keys(r).length<9?(console.log(Z.red(Z.bold("Incomplete configuration submitted. Exiting..."))),process.exit(0)):r};var oo=process.cwd(),s=async o=>{let r=f.existsSync(v),e={},t=Number(o?.nuxtVersion)||X();if(!r||o?.force){if(e=o?.yes?t===4?V:W:await q(t),await f.writeFile(v,`export default ${JSON.stringify(e,null,2)}`),e.packageManager==="pnpm"){let n=f.existsSync(".npmrc"),a=!0;if(n){let{confirmCreateNpmrc:d}=await jo({type:"confirm",name:"confirmCreateNpmrc",message:"A .npmrc file already exists. Overwrite it?",initial:!1});a=d}a&&await f.writeFile(".npmrc",`shamefully-hoist=true
|
|
3
3
|
strict-peer-dependencies=false
|
|
4
|
-
`)}}else e=(await Fo({configFile:
|
|
5
|
-
${r}`:
|
|
6
|
-
`+Vo(o,r,e))};import zo from"prompts";var co=async(o,r=[])=>{if(o)return r.map(t=>t.value);let{components:e}=await zo({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:r.map(t=>({title:t.name,value:t.value}))});return e};import O from"fs";import Yo from"path";var ao=async(o,r)=>{if(!await C(o)){let t=Yo.dirname(o);O.existsSync(t)||O.mkdirSync(t,{recursive:!0})}O.writeFileSync(o,r)};var L=[],
|
|
7
|
-
`,{box:{title:"Components Added"}});let $=
|
|
4
|
+
`)}}else e=(await Fo({configFile:v.replace(".ts","")})).config;return Ko.isEmpty(e)?s({force:!0}):(Po(e),e)},Po=o=>{let r=(e,t=!1)=>{e&&(t?f.ensureDirSync(e):f.ensureFileSync(e))};r(o.tailwindCSSLocation),r(o.pluginsLocation,!0),r(o.componentsLocation,!0),r(o.composablesLocation,!0),r(o.utilsLocation,!0)},eo=async o=>{if(!o)return;let r=typeof o=="string"?[o]:o,e=await Ao(Q(oo,"nuxt.config.ts"));r.forEach(t=>Uo(e,t)),await Lo(e,Q(oo,"nuxt.config.ts"))};var w=async()=>{let o=await s(),r={nuxtVersion:3,theme:"string",tailwindCSSLocation:"string",componentsLocation:"string",composablesLocation:"string",utilsLocation:"string",force:!0,useDefaultFilename:!0,packageManager:"string"},e=[];for(let t of Object.keys(r))o[t]===void 0&&e.push(t);return!(e.length>1)};import Ro from"axios";import Do from"dotenv";import $o from"ora";Do.config();var ro=async()=>{let o=$o("Fetching components...").start(),{data:r}=await Ro.get(process.env.COMPONENTS_API||"https://uithing.com/api/components");return o.succeed("Components fetched."),r};import _ from"fs";var C=async o=>{try{return await _.promises.access(o,_.constants.F_OK||_.constants.W_OK),!0}catch{return!1}};import{execa as M}from"execa";import x from"lodash";import Go from"ora";var h=async(o,r,e)=>{typeof r=="string"&&(r=[r]),typeof e=="string"&&(e=[e]);let t=Go("Installing dependencies...").start();!x.isUndefined(r)&&!x.isEmpty(r)&&await M(o,[o==="yarn"?"add":"install",...r]),t.text="Installing dev dependencies...",!x.isUndefined(e)&&!x.isEmpty(e)&&await M(o,[o==="yarn"?"add":"install","-D",...e]),t.text="Running nuxt prepare...",await M`npx -y nuxt prepare`,t.succeed("Installed dependencies!")};import Bo from"prompts";var to=async o=>{let r={yup:["yup","@vee-validate/yup"],zod:["zod","@vee-validate/zod"],joi:["joi","@vee-validate/joi"],valibot:["valibot","@vee-validate/valibot"]},{validator:e}=await Bo({type:"select",name:"validator",message:"Choose the validator package to use with Vee Validate: ",choices:[{title:"Yup",value:"yup"},{title:"Zod",value:"zod"},{title:"Joi",value:"joi"},{title:"Valibot",value:"valibot"}]});if(!e){console.log("No validator package selected");return}return console.log(`Selected ${e} as the validator package`),r[e]&&await h(o,r[e]),e};import Ho from"boxen";import Wo from"figlet";var Vo=(o,r,e={})=>{let{box:t,figletFont:n}=e,a=Wo.textSync(o,{font:n||"Standard"}),i=Ho(a,{...{borderColor:"greenBright",padding:1,borderStyle:"round",titleAlignment:"center"},...t});return r?`${i}
|
|
5
|
+
${r}`:i},l=(o,r,e)=>{console.log(`
|
|
6
|
+
`+Vo(o,r,e))};import zo from"prompts";var co=async(o,r=[])=>{if(o)return r.map(t=>t.value);let{components:e}=await zo({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:r.map(t=>({title:t.name,value:t.value}))});return e};import O from"fs";import Yo from"path";var ao=async(o,r)=>{if(!await C(o)){let t=Yo.dirname(o);O.existsSync(t)||O.mkdirSync(t,{recursive:!0})}O.writeFileSync(o,r)};var L=[],b=process.cwd(),F=o=>L.find(r=>r.value.toLowerCase()===o.toLowerCase());async function io(o,r,e,t){if(await C(o)&&!e){let{value:a}=await A({type:"confirm",name:"value",message:t,initial:!1});if(!a)return S.info(`Skipped: ${u.cyan(E.basename(o))}`),!1}return await ao(o,r),!0}async function K(o,r,e,t){for(let n of r){let a=E.join(b,e,n.fileName);await io(a,n.fileContent,t,`The ${o} file ${u.bold(n.fileName)} already exists. Overwrite?`)}}var Xo=async(o,r)=>{let e=await s();await w()||(e=await s({force:!0})),y.isEmpty(e)&&(S.info("Config file not set. Exiting..."),process.exit(0)),L=await ro();let t=o;if(t.length===0){let c=await co(r.all,L);(!c||c.length===0)&&(S.info("No components selected. Exiting..."),process.exit(0)),t=c}let n=t.filter(c=>!F(c));n.length>0&&S.error(`Not found: ${u.bgRed(n.join(", "))}`);let a=t.map(c=>F(c)).filter(Boolean);for(let c of[...a])c.components&&c.components.forEach(p=>{a.find(k=>k.value===p)||a.push(F(p))});for(let c of a)for(let p of c.files){let k=e.componentsLocation,G=E.join(b,k,p.fileName);if(!e.useDefaultFilename){let{value:B}=await A({type:"text",name:"value",message:`Where should we add the file ${u.cyan(p.fileName)}?`,initial:k});B&&(k=B,G=E.join(b,k,p.fileName))}await io(G,p.fileContent,e.force,`The file ${u.bold(p.fileName)} already exists. Overwrite?`)&&((c.value==="vue-sonner"||c.value==="sonner")&&await Zo(),c.value==="datatable"&&await qo(),await K("utils",c.utils,e.utilsLocation,e.force),await K("composables",c.composables,e.composablesLocation,e.force),await K("plugins",c.plugins,e.pluginsLocation??"",e.force))}await eo(y.uniq(a.flatMap(c=>c.nuxtModules||[])));let d=y.uniq(a.flatMap(c=>c.deps||[])),i=y.uniq(a.flatMap(c=>c.devDeps||[]));if(d.length>0||i.length>0)if(r.all)await h(e.packageManager,d,i);else{let{confirmInstall:c}=await A({type:"confirm",name:"confirmInstall",message:`Install packages: ${u.cyan([...d,...i].join(", "))}?`,initial:!0});c&&await h(e.packageManager,d,i)}a.some(c=>c.askValidator)&&await to(e.packageManager),l("All Done!",`Run the ${u.cyan("ui-thing@latest --help")} command to learn more.
|
|
7
|
+
`,{box:{title:"Components Added"}});let $=y.compact(a.flatMap(c=>c.instructions));$.length>0&&(console.log(""),console.log(u.bgCyan(" Instructions ")),$.forEach(c=>console.log(`${u.cyan("-")} ${c}`)))},so=new Jo().name("add").command("add").description("Add a list of components to your project.").option("-a --all","Add all components to your project.",!1).argument("[componentNames...]","Components that you want to add.").action(Xo);async function Zo(){await no({configFile:"nuxt.config",cwd:b,onUpdate(o){o.imports||={imports:[]},o.imports.imports.find(r=>r.from==="vue-sonner"&&r.name==="toast")||o.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"})}})}async function qo(){await no({configFile:"nuxt.config",cwd:b,onUpdate(o){o.app||={head:{script:[]}},["https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js","https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js"].forEach(e=>{o.app.head.script.find(t=>t.src===e)||o.app.head.script.push({src:e,defer:!0})})}})}import Se from"path";import{updateConfig as Ee}from"c12/update";import{Command as Ie}from"commander";import fo from"fs-extra";import R from"kleur";import Te from"ora";var Qo=`@import "tailwindcss";
|
|
8
8
|
@import "tw-animate-css";
|
|
9
9
|
|
|
10
10
|
@plugin "@tailwindcss/forms" {
|
|
@@ -1001,12 +1001,12 @@ ${r}`:n},l=(o,r,e)=>{console.log(`
|
|
|
1001
1001
|
* Utility function to return Tailwind CSS classes.
|
|
1002
1002
|
*/
|
|
1003
1003
|
export const tw = <T extends TemplateStringsArray | string>(tailwindClasses: T) => tailwindClasses;
|
|
1004
|
-
`;import{join as pe}from"path";import{$ as ke}from"execa";import U from"fs-extra";import me from"ora";import fe from"prompts";var
|
|
1004
|
+
`;import{join as pe}from"path";import{$ as ke}from"execa";import U from"fs-extra";import me from"ora";import fe from"prompts";var T={arrowParens:"always",endOfLine:"lf",plugins:["@ianvs/prettier-plugin-sort-imports","prettier-plugin-tailwindcss"],printWidth:100,semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",useTabs:!1,vueIndentScriptAndStyle:!0,tailwindFunctions:["tv"],importOrder:["<BUILTIN_MODULES>","<THIRD_PARTY_MODULES>","<TYPES>","","^[.]"]};var N=async(o=process.cwd(),r=!0)=>{let e=pe(o,".prettierrc"),t=T;if(U.existsSync(e)){let a=await U.readFile(e,"utf-8"),d={};try{d=JSON.parse(a)}catch{console.warn("\u26A0\uFE0F Existing .prettierrc is not valid JSON \u2014 will prompt for overwrite.")}let i=await fe({name:"merge",type:"select",message:"A prettier config file already exists. What would you like to do?",choices:[{title:"Merge configs",value:"merge"},{title:"Overwrite with new config",value:"overwrite"},{title:"Cancel",value:"cancel"}],initial:0});if(i.merge==="merge")t={...d,...T};else if(i.merge==="overwrite")t=T;else return!1}if(await U.writeFile(e,JSON.stringify(t,null,2),"utf-8"),!r)return!0;let n=me("Formatting files with prettier...").start();return await ke`npx prettier --write .`,n.succeed("Files formatted with prettier"),!0};import{join as ge}from"path";import{builders as ye,loadFile as be,writeFile as ve}from"magicast";import{getDefaultExportOptions as we}from"magicast/helpers";var uo=async()=>{let o=ge(process.cwd(),"nuxt.config.ts"),r=await be(o);if(!r.$code.includes("tailwindcss()")){let e=we(r);e.vite||={},e.vite.plugins||=[],e.vite.plugins.push(ye.functionCall("tailwindcss"))}r.imports.$items.find(e=>e.local==="tailwindcss")||r.imports.$prepend({from:"@tailwindcss/vite",local:"tailwindcss",imported:"default"}),await ve(r,o)};import xe from"fs-extra";var po={recommendations:["vue.volar","bradlc.vscode-tailwindcss","esbenp.prettier-vscode","antfu.iconify","formulahendry.auto-close-tag","formulahendry.auto-rename-tag"]},ko={"editor.formatOnSave":!0,"editor.quickSuggestions":{strings:"on"},"files.associations":{"*.css":"tailwindcss"},"tailwindCSS.classFunctions":["tw","clsx","tw\\.[a-z-]+"],"tailwindCSS.experimental.classRegex":[["([\"'`][^\"'`]*.*?[\"'`])","[\"'`]([^\"'`]*)[\"'`]"]]};import{merge as Ce}from"es-toolkit";import j from"fs-extra";function P(o,r){let e={};if(j.existsSync(o))try{e=j.readJsonSync(o)}catch{console.warn(`\u26A0\uFE0F Could not parse ${o}, starting fresh.`)}let t=Ce(e,r);j.writeJsonSync(o,t,{spaces:2})}var mo=(o=".vscode")=>{xe.ensureDirSync(o),P(`${o}/extensions.json`,po),P(`${o}/settings.json`,ko)};var Ne=async o=>{let r=await s(o),e=Te("Updating nuxt.config...").start();await Ee({cwd:process.cwd(),configFile:"nuxt.config",async onUpdate(t){t.modules||(t.modules=[]),t.imports||(t.imports={imports:[]});for(let i of J)t.modules.includes(i)||t.modules.push(i);if(!t.colorMode){let i=Se.basename(process.cwd());t.colorMode={storageKey:`${i}-color-mode`,classSuffix:""}}t.icon||(t.icon={clientBundle:{scan:!0,sizeLimitKb:0},mode:"svg",class:"shrink-0",fetchTimeout:2e3,serverBundle:"local"}),t.imports.imports.find(i=>i.from==="tailwind-variants"&&i.name==="tv")||t.imports.imports.push({from:"tailwind-variants",name:"tv"}),t.imports.imports.find(i=>i.from==="tailwind-variants"&&i.name==="VariantProps")||t.imports.imports.push({from:"tailwind-variants",name:"VariantProps",type:!0}),t.css||=[];let n=r.tailwindCSSLocation?.split("app/")[1],a=`~/${n}`,d=`@/${n}`;!t.css.includes(a)&&!t.css.includes(d)&&t.css.push(a)}}),await uo(),e.succeed("Updated nuxt.config!"),e.start("Adding initial Tailwind CSS file..."),fo.writeFileSync(r.tailwindCSSLocation,I(r.theme.toUpperCase()),"utf-8"),e.succeed("Added initial Tailwind CSS file!"),e.start("Adding Autocomplete helper..."),fo.writeFileSync(r.utilsLocation+"/tw-helper.ts",ho,"utf-8"),e.succeed("Added Autocomplete helper!"),e.start("Merging VS Code settings..."),mo(),e.succeed("Merged VS Code settings!"),await h(r.packageManager,z,Y),await N(),l("Initialized",`Feel free to start adding components with the ${R.bgWhite(" add ")} command.`,{box:{title:"Complete"}})},go=new Ie().command("init").name("init").summary("Initialize UI Thing in your Nuxt project.").description(`${R.bold("Initialize UI Thing in your Nuxt project.")}
|
|
1005
1005
|
|
|
1006
1006
|
\u2705 Add tailwindcss to your project
|
|
1007
1007
|
\u2705 Update your nuxt.config file
|
|
1008
1008
|
\u2705 Add the necessary dependencies
|
|
1009
|
-
\u2705 Create a ${
|
|
1009
|
+
\u2705 Create a ${R.bold("ui-thing.config")} file with the default configuration`).option("-f --force","Overwrite config file if it exists.",!1).option("-y --yes","Skip prompts and use default values.",!1).option("-n --nuxtVersion <number>","Specify the Nuxt version you are using.").action(Ne);import{Command as _e}from"commander";import Me from"prompts";var yo=new _e().command("prettier").name("prettier").description("Adds prettier config to your project.").action(async()=>{if(!await N(void 0,!1)){l("Not Added","Prettier config was not added.",{box:{title:"Prettier Not Added",borderColor:"red"}});return}let{pkgManager:r}=await Me({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:m});if(!r)return process.exit(0);await h(r,void 0,["prettier","prettier-plugin-tailwindcss","@ianvs/prettier-plugin-sort-imports"]),l("All Done!","A .prettierrc file has been added to your project and the code formatted. Enjoy!",{box:{title:"Prettier Added"}})});import{Command as Oe}from"commander";import{execa as Fe}from"execa";import Ke from"ora";import Ae from"prompts";import{join as vo}from"path";import wo from"fs-extra";var bo=`import {
|
|
1010
1010
|
createSharedComposable,
|
|
1011
1011
|
useActiveElement,
|
|
1012
1012
|
useDebounceFn,
|
|
@@ -1326,5 +1326,5 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
|
|
|
1326
1326
|
return useEventListener("keydown", onKeyDown);
|
|
1327
1327
|
}
|
|
1328
1328
|
|
|
1329
|
-
`;var Co=async(o=process.cwd())=>{let r=await s(),e=vo(o,r.composablesLocation);await wo.ensureDir(e),await wo.writeFile(vo(e,"shortcuts.ts"),bo,"utf-8")};var xo=new Oe().command("shortcuts").name("shortcuts").description("Add the shortcuts composables to your project.").action(async()=>{await Co();let{pkgManager:o}=await Ae({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:m});if(!o)return process.exit(0);let r=Ke("Installing vueuse module...").start();await Fe`npx -y nuxi@latest module add vueuse`,r.succeed("VueUse module installed successfully!"),l("All Done!","Check the composables folder for the shortcuts composables.",{box:{title:"Composable Added"}})});import{Command as Le}from"commander";import So from"fs-extra";import Eo from"kleur";import
|
|
1329
|
+
`;var Co=async(o=process.cwd())=>{let r=await s(),e=vo(o,r.composablesLocation);await wo.ensureDir(e),await wo.writeFile(vo(e,"shortcuts.ts"),bo,"utf-8")};var xo=new Oe().command("shortcuts").name("shortcuts").description("Add the shortcuts composables to your project.").action(async()=>{await Co();let{pkgManager:o}=await Ae({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:m});if(!o)return process.exit(0);let r=Ke("Installing vueuse module...").start();await Fe`npx -y nuxi@latest module add vueuse`,r.succeed("VueUse module installed successfully!"),l("All Done!","Check the composables folder for the shortcuts composables.",{box:{title:"Composable Added"}})});import{Command as Le}from"commander";import So from"fs-extra";import Eo from"kleur";import D from"lodash";import Io from"prompts";var Ue=o=>g.some(r=>r.value===o?.toLowerCase()),To=new Le().command("theme").name("theme").description("Add a new theme to your project.").argument("[themeName]","The name of the theme you would like to add").action(async o=>{let r=await s();await w()||(r=await s({force:!0})),D.isEmpty(r)&&(console.log(Eo.red("Config file not set. Exiting...")),process.exit(0));let t=o&&Ue(o)?o.toLowerCase():void 0;if(!t){let{theme:n}=await Io([{name:"theme",type:"autocomplete",message:"Which theme do you want to add?",choices:g}]);n||(console.log(Eo.red("No theme selected. Exiting...")),process.exit(0)),t=n}if(So.existsSync(r.tailwindCSSLocation)){let{force:n}=await Io([{name:"force",type:"confirm",message:"The Tailwind CSS file already exists. Overwrite?",initial:!1}]);if(!n)return console.log("Exiting..."),process.exit(0)}So.writeFileSync(r.tailwindCSSLocation,I(t.toUpperCase()),"utf-8"),l(`${D.capitalize(t)}`,`${D.capitalize(t)} theme has been added to ${r.tailwindCSSLocation}`,{box:{title:"New Theme Added"}})});process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));process.on("SIGTSTP",()=>process.exit(0));var No=new je;console.clear();l("UI Thing",void 0,{box:{title:"Welcome"}});console.log();No.name("ui-thing").description("CLI for adding ui-thing components to your Nuxt application").version(H).addCommand(go).addCommand(so).addCommand(To).addCommand(xo).addCommand(yo);No.parse(process.argv);
|
|
1330
1330
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../package.json","../src/commands/add.ts","../src/utils/config.ts","../src/utils/constants.ts","../src/utils/detectNuxtVersion.ts","../src/utils/uiConfigPrompt.ts","../src/utils/compareUIConfig.ts","../src/utils/fetchComponents.ts","../src/utils/fileExists.ts","../src/utils/installPackages.ts","../src/utils/installValidator.ts","../src/utils/printFancyBoxMessage.ts","../src/utils/promptForComponents.ts","../src/utils/writeFile.ts","../src/commands/init.ts","../src/templates/css.ts","../src/templates/tw-helper.ts","../src/utils/addPrettierConfig.ts","../src/templates/prettier.ts","../src/utils/addTailwindVitePlugin.ts","../src/utils/addVSCodeFiles.ts","../src/templates/vs-code.ts","../src/utils/mergeJsonFile.ts","../src/commands/prettier.ts","../src/commands/shortcuts.ts","../src/utils/addShortcutFiles.ts","../src/templates/shortcuts.ts","../src/commands/theme.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\n\nimport { version } from \"../package.json\";\nimport { add } from \"./commands/add\";\nimport { init } from \"./commands/init\";\nimport { addPrettier } from \"./commands/prettier\";\nimport { addShortcuts } from \"./commands/shortcuts\";\nimport { theme } from \"./commands/theme\";\nimport { printFancyBoxMessage } from \"./utils/printFancyBoxMessage\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\nprocess.on(\"SIGTSTP\", () => process.exit(0));\n\nconst program = new Command();\n\nconsole.clear();\n\nprintFancyBoxMessage(\"UI Thing\", undefined, { box: { title: \"Welcome\" } });\nconsole.log();\n\nprogram\n .name(\"ui-thing\")\n .description(\"CLI for adding ui-thing components to your Nuxt application\")\n .version(version)\n .addCommand(init)\n .addCommand(add)\n .addCommand(theme)\n .addCommand(addShortcuts)\n .addCommand(addPrettier);\n\nprogram.parse(process.argv);\n","{\n \"name\": \"ui-thing\",\n \"version\": \"0.2.3\",\n \"description\": \"CLI used to add Nuxt components to a project\",\n \"keywords\": [\n \"cli\",\n \"ui\",\n \"thing\",\n \"nuxt\",\n \"reka-ui\",\n \"tailwindcss\",\n \"nuxtui\",\n \"shadcn-ui\"\n ],\n \"repository\": {\n \"url\": \"git+https://github.com/BayBreezy/ui-thing-cli.git\"\n },\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Behon Baker\",\n \"email\": \"behon.baker@yahoo.com\",\n \"url\": \"https://behonbaker.com/\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"ui-thing\": \"dist/index.js\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"rm -rf dist coverage node_modules package-lock.json && npm install\",\n \"coverage\": \"vitest run --coverage\",\n \"dev\": \"tsup --watch\",\n \"format\": \"npx prettier --write .\",\n \"knip\": \"knip\",\n \"knip:fix\": \"knip --fix\",\n \"lint-staged\": \"lint-staged\",\n \"prepare\": \"husky\",\n \"release\": \"npm run build && npx changelogen@latest --release && npm publish && git push --follow-tags\",\n \"start\": \"node dist/index.js\",\n \"test\": \"vitest\"\n },\n \"lint-staged\": {\n \"*\": [\n \"npm run format\"\n ]\n },\n \"dependencies\": {\n \"axios\": \"^1.11.0\",\n \"boxen\": \"^8.0.1\",\n \"c12\": \"^3.2.0\",\n \"commander\": \"^14.0.0\",\n \"consola\": \"^3.4.2\",\n \"dotenv\": \"^17.2.1\",\n \"es-toolkit\": \"^1.39.9\",\n \"execa\": \"^9.6.0\",\n \"figlet\": \"^1.8.2\",\n \"fs-extra\": \"^11.3.1\",\n \"kleur\": \"^4.1.5\",\n \"lodash\": \"^4.17.21\",\n \"magicast\": \"^0.3.5\",\n \"ora\": \"^8.2.0\",\n \"prompts\": \"^2.4.2\"\n },\n \"devDependencies\": {\n \"@ianvs/prettier-plugin-sort-imports\": \"^4.6.2\",\n \"@types/figlet\": \"^1.7.0\",\n \"@types/fs-extra\": \"^11.0.4\",\n \"@types/lodash\": \"^4.17.20\",\n \"@types/node\": \"^24.2.1\",\n \"@types/prompts\": \"^2.4.9\",\n \"@vitest/coverage-v8\": \"^3.2.4\",\n \"husky\": \"^9.1.7\",\n \"knip\": \"^5.62.0\",\n \"lint-staged\": \"^16.1.5\",\n \"prettier\": \"^3.6.2\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"vitest\": \"^3.2.4\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"node:path\";\nimport { updateConfig } from \"c12/update\";\nimport { Command } from \"commander\";\nimport { consola } from \"consola\";\nimport kleur from \"kleur\";\nimport _ from \"lodash\";\nimport prompts from \"prompts\";\n\nimport { AddCommand, Component } from \"../types\";\nimport { compareUIConfig } from \"../utils/compareUIConfig\";\nimport { addModuleToConfig, getUIConfig } from \"../utils/config\";\nimport { fetchComponents } from \"../utils/fetchComponents\";\nimport { fileExists } from \"../utils/fileExists\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { installValidator } from \"../utils/installValidator\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\nimport { promptUserForComponents } from \"../utils/promptForComponents\";\nimport { writeFile } from \"../utils/writeFile\";\n\nlet allComponents: Component[] = [];\nconst currentDirectory = process.cwd();\n\n/**\n * Finds a component definition by its name (case-insensitive).\n */\nconst findComponent = (name: string) =>\n allComponents.find((c) => c.value.toLowerCase() === name.toLowerCase());\n\n/**\n * Handles writing a file with overwrite checks.\n */\nasync function safeWriteFile(\n targetPath: string,\n content: string,\n forceOverwrite: boolean,\n promptMessage: string\n) {\n const exists = await fileExists(targetPath);\n\n if (exists && !forceOverwrite) {\n const { value: overwrite } = await prompts({\n type: \"confirm\",\n name: \"value\",\n message: promptMessage,\n initial: false,\n });\n if (!overwrite) {\n consola.info(`Skipped: ${kleur.cyan(path.basename(targetPath))}`);\n return false;\n }\n }\n\n await writeFile(targetPath, content);\n return true;\n}\n\n/**\n * Writes all files in a given category (utils, composables, plugins).\n */\nasync function writeCategoryFiles(\n category: string,\n items: Array<{ fileName: string; fileContent: string; dirPath?: string }>,\n baseDir: string,\n forceOverwrite: boolean\n) {\n for (const item of items) {\n const targetPath = path.join(currentDirectory, baseDir, item.fileName);\n await safeWriteFile(\n targetPath,\n item.fileContent,\n forceOverwrite,\n `The ${category} file ${kleur.bold(item.fileName)} already exists. Overwrite?`\n );\n }\n}\n\n/**\n * Main command logic for adding components.\n */\nconst runAddCommand = async (components: string[], options: AddCommand) => {\n // Step 1 — Load and verify UI config\n let uiConfig = await getUIConfig();\n if (!(await compareUIConfig())) {\n uiConfig = await getUIConfig({ force: true });\n }\n if (_.isEmpty(uiConfig)) {\n consola.info(\"Config file not set. Exiting...\");\n process.exit(0);\n }\n\n // Step 2 — Fetch all available components\n allComponents = await fetchComponents();\n\n // Step 3 — If no components were passed, prompt user to select them\n let componentNames = components;\n if (componentNames.length === 0) {\n const response = await promptUserForComponents(options.all, allComponents);\n if (!response || response.length === 0) {\n consola.info(\"No components selected. Exiting...\");\n process.exit(0);\n }\n componentNames = response;\n }\n\n // Step 4 — Validate component names\n const notFound = componentNames.filter((name) => !findComponent(name));\n if (notFound.length > 0) {\n consola.error(`Not found: ${kleur.bgRed(notFound.join(\", \"))}`);\n }\n\n // Step 5 — Collect found components and their dependencies\n let found: Component[] = componentNames\n .map((name) => findComponent(name))\n .filter(Boolean) as Component[];\n\n for (const comp of [...found]) {\n if (comp.components) {\n comp.components.forEach((dep) => {\n if (!found.find((c) => c.value === dep)) {\n found.push(findComponent(dep)!);\n }\n });\n }\n }\n\n // Step 6 — Write files for each component\n for (const component of found) {\n for (const file of component.files) {\n let dirPath = uiConfig.componentsLocation;\n let filePath = path.join(currentDirectory, dirPath, file.fileName);\n\n // Ask for custom location if not using default\n if (!uiConfig.useDefaultFilename) {\n const { value: newDir } = await prompts({\n type: \"text\",\n name: \"value\",\n message: `Where should we add the file ${kleur.cyan(file.fileName)}?`,\n initial: dirPath,\n });\n if (newDir) {\n dirPath = newDir;\n filePath = path.join(currentDirectory, dirPath, file.fileName);\n }\n }\n\n const fileWritten = await safeWriteFile(\n filePath,\n file.fileContent,\n uiConfig.force,\n `The file ${kleur.bold(file.fileName)} already exists. Overwrite?`\n );\n if (!fileWritten) continue;\n\n // Component-specific logic hooks\n if (component.value === \"vue-sonner\" || component.value === \"sonner\") await addSonner();\n if (component.value === \"datatable\") await addDataTable();\n\n // Write related files\n await writeCategoryFiles(\"utils\", component.utils, uiConfig.utilsLocation, uiConfig.force);\n await writeCategoryFiles(\n \"composables\",\n component.composables,\n uiConfig.composablesLocation,\n uiConfig.force\n );\n await writeCategoryFiles(\n \"plugins\",\n component.plugins,\n uiConfig.pluginsLocation ?? \"\",\n uiConfig.force\n );\n }\n }\n\n // Step 7 — Add Nuxt modules\n await addModuleToConfig(_.uniq(found.flatMap((c) => c.nuxtModules || [])));\n\n // Step 8 — Install dependencies if necessary\n const deps = _.uniq(found.flatMap((c) => c.deps || []));\n const devDeps = _.uniq(found.flatMap((c) => c.devDeps || []));\n if (deps.length > 0 || devDeps.length > 0) {\n if (options.all) {\n await installPackages(uiConfig.packageManager, deps, devDeps);\n } else {\n const { confirmInstall } = await prompts({\n type: \"confirm\",\n name: \"confirmInstall\",\n message: `Install packages: ${kleur.cyan([...deps, ...devDeps].join(\", \"))}?`,\n initial: true,\n });\n if (confirmInstall) {\n await installPackages(uiConfig.packageManager, deps, devDeps);\n }\n }\n }\n\n // Step 9 — Install validator if required\n if (found.some((c) => c.askValidator)) {\n await installValidator(uiConfig.packageManager);\n }\n\n // Step 10 — Success message & instructions\n printFancyBoxMessage(\n \"All Done!\",\n `Run the ${kleur.cyan(\"ui-thing@latest --help\")} command to learn more.\\n`,\n { box: { title: \"Components Added\" } }\n );\n\n const instructions = _.compact(found.flatMap((c) => c.instructions));\n if (instructions.length > 0) {\n console.log(\"\");\n console.log(kleur.bgCyan(\" Instructions \"));\n instructions.forEach((i) => console.log(`${kleur.cyan(\"-\")} ${i}`));\n }\n};\n\n/**\n * CLI Command Registration\n */\nexport const add = new Command()\n .name(\"add\")\n .command(\"add\")\n .description(\"Add a list of components to your project.\")\n .option(\"-a --all\", \"Add all components to your project.\", false)\n .argument(\"[componentNames...]\", \"Components that you want to add.\")\n .action(runAddCommand);\n\n/**\n * Component-specific setup helpers\n */\nasync function addSonner() {\n await updateConfig({\n configFile: \"nuxt.config\",\n cwd: currentDirectory,\n onUpdate(config: any) {\n config.imports ||= { imports: [] };\n if (!config.imports.imports.find((i: any) => i.from === \"vue-sonner\" && i.name === \"toast\")) {\n config.imports.imports.push({ from: \"vue-sonner\", name: \"toast\", as: \"useSonner\" });\n }\n },\n });\n}\n\nasync function addDataTable() {\n await updateConfig({\n configFile: \"nuxt.config\",\n cwd: currentDirectory,\n onUpdate(cfg: any) {\n cfg.app ||= { head: { script: [] } };\n const scripts = [\n \"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js\",\n ];\n scripts.forEach((src) => {\n if (!cfg.app.head.script.find((i: any) => i.src === src)) {\n cfg.app.head.script.push({ src, defer: true });\n }\n });\n },\n });\n}\n","import { join } from \"node:path\";\nimport { loadConfig } from \"c12\";\nimport fse from \"fs-extra\";\nimport _ from \"lodash\";\nimport { loadFile, writeFile } from \"magicast\";\nimport { addNuxtModule } from \"magicast/helpers\";\nimport prompts from \"prompts\";\n\nimport { InitOptions, UIConfig } from \"../types\";\nimport { DEFAULT_CONFIG, DEFAULT_CONFIG_NUXT4, UI_CONFIG_FILENAME } from \"./constants\";\nimport { detectNuxtVersion } from \"./detectNuxtVersion\";\nimport { initPrompts } from \"./uiConfigPrompt\";\n\nconst currentDir = process.cwd();\n\n/**\n * Creates or retrieves the UI Thing config.\n */\nexport const getUIConfig = async (options?: InitOptions): Promise<UIConfig> => {\n const configExists = fse.existsSync(UI_CONFIG_FILENAME);\n let uiConfig: UIConfig = {} as UIConfig;\n const nuxtVersion = Number(options?.nuxtVersion) || detectNuxtVersion();\n\n // Force creation or first-time setup\n if (!configExists || options?.force) {\n uiConfig = options?.yes\n ? nuxtVersion === 4\n ? DEFAULT_CONFIG_NUXT4\n : DEFAULT_CONFIG\n : await initPrompts(nuxtVersion);\n\n await fse.writeFile(UI_CONFIG_FILENAME, `export default ${JSON.stringify(uiConfig, null, 2)}`);\n\n // Handle pnpm special case\n if (uiConfig.packageManager === \"pnpm\") {\n const npmrcExists = fse.existsSync(\".npmrc\");\n let shouldWrite = true;\n\n if (npmrcExists) {\n const { confirmCreateNpmrc } = await prompts({\n type: \"confirm\",\n name: \"confirmCreateNpmrc\",\n message: \"A .npmrc file already exists. Overwrite it?\",\n initial: false,\n });\n shouldWrite = confirmCreateNpmrc;\n }\n\n if (shouldWrite) {\n await fse.writeFile(\".npmrc\", \"shamefully-hoist=true\\nstrict-peer-dependencies=false\\n\");\n }\n }\n } else {\n const data = await loadConfig<UIConfig>({\n configFile: UI_CONFIG_FILENAME.replace(\".ts\", \"\"),\n });\n uiConfig = data.config as UIConfig;\n }\n\n // Ensure valid config\n if (_.isEmpty(uiConfig)) return getUIConfig({ force: true });\n\n createConfigPaths(uiConfig);\n return uiConfig;\n};\n\n/**\n * Ensures all required paths exist for UI Thing.\n */\nconst createConfigPaths = (uiConfig: UIConfig) => {\n const ensureFileOrDir = (pathValue?: string, isDir = false) => {\n if (!pathValue) return;\n isDir ? fse.ensureDirSync(pathValue) : fse.ensureFileSync(pathValue);\n };\n\n ensureFileOrDir(uiConfig.tailwindCSSLocation);\n ensureFileOrDir(uiConfig.pluginsLocation, true);\n ensureFileOrDir(uiConfig.componentsLocation, true);\n ensureFileOrDir(uiConfig.composablesLocation, true);\n ensureFileOrDir(uiConfig.utilsLocation, true);\n};\n\n/**\n * Adds one or multiple Nuxt modules to nuxt.config.ts safely.\n */\nexport const addModuleToConfig = async (modules: string[] | string) => {\n if (!modules) return;\n const modulesArray = typeof modules === \"string\" ? [modules] : modules;\n\n const proxy = await loadFile(join(currentDir, \"nuxt.config.ts\"));\n modulesArray.forEach((m) => addNuxtModule(proxy, m));\n await writeFile(proxy, join(currentDir, \"nuxt.config.ts\"));\n};\n","import { UIConfig } from \"../types\";\n\n/**\n * The filename of the UI Thing configuration file.\n */\nexport const UI_CONFIG_FILENAME = \"ui-thing.config.ts\";\n/**\n * The default UI Thing configuration.\n *\n * Used when Nuxt 3 is detected\n */\nexport const DEFAULT_CONFIG: UIConfig = {\n theme: \"zinc\",\n tailwindCSSLocation: \"assets/css/tailwind.css\",\n componentsLocation: \"components/Ui\",\n composablesLocation: \"composables\",\n pluginsLocation: \"plugins\",\n utilsLocation: \"utils\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"npm\",\n};\n\n/**\n * The default UI Thing configuration.\n *\n * Used when Nuxt 4 is detected\n */\nexport const DEFAULT_CONFIG_NUXT4: UIConfig = {\n theme: \"zinc\",\n tailwindCSSLocation: \"app/assets/css/tailwind.css\",\n componentsLocation: \"app/components/Ui\",\n composablesLocation: \"app/composables\",\n pluginsLocation: \"app/plugins\",\n utilsLocation: \"app/utils\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"npm\",\n};\n\n/**\n * The initial core dependencies\n */\nexport const INIT_DEPS = [\n \"tailwindcss\",\n \"motion-v\",\n \"@tailwindcss/vite\",\n \"reka-ui\",\n \"tailwind-variants\",\n \"tailwind-merge\",\n \"@nuxt/fonts\",\n \"@nuxtjs/color-mode\",\n \"@nuxt/icon\",\n \"@vueuse/nuxt\",\n \"@tailwindcss/forms\",\n];\n\n/**\n * The initial development dependencies\n */\nexport const INIT_DEV_DEPS = [\n \"typescript\",\n \"prettier-plugin-tailwindcss\",\n \"prettier\",\n \"@ianvs/prettier-plugin-sort-imports\",\n \"tw-animate-css\",\n];\n\n/**\n * Initial modules that are needed\n */\nexport const INIT_MODULES = [\n \"@nuxtjs/color-mode\",\n \"motion-v/nuxt\",\n \"@vueuse/nuxt\",\n \"@nuxt/icon\",\n \"@nuxt/fonts\",\n];\n\n/**\n * List of available package managers to chose from\n */\nexport const PACKAGE_MANAGER_CHOICES = [\n { title: \"Npm\", value: \"npm\" },\n { title: \"Yarn\", value: \"yarn\" },\n { title: \"Pnpm\", value: \"pnpm\" },\n { title: \"Bun\", value: \"bun\" },\n];\n\n/**\n * List of available CSS themes to choose from\n */\nexport const CSS_THEME_OPTIONS = [\n { title: \"Zinc\", value: \"zinc\" },\n { title: \"Slate\", value: \"slate\" },\n { title: \"Stone\", value: \"stone\" },\n { title: \"Gray\", value: \"gray\" },\n { title: \"Neutral\", value: \"neutral\" },\n { title: \"Red\", value: \"red\" },\n { title: \"Rose\", value: \"rose\" },\n { title: \"Orange\", value: \"orange\" },\n { title: \"Green\", value: \"green\" },\n { title: \"Blue\", value: \"blue\" },\n { title: \"Yellow\", value: \"yellow\" },\n { title: \"Violet\", value: \"violet\" },\n];\n","import fs from \"fs\";\n\n/**\n * Detect the Nuxt.js version from package.json.\n */\nexport function detectNuxtVersion() {\n try {\n const pkg = JSON.parse(fs.readFileSync(\"package.json\", \"utf-8\"));\n const nuxtVer = pkg.dependencies?.nuxt || pkg.devDependencies?.nuxt;\n if (nuxtVer) {\n // check if version is 4.x\n // check for all possible formats with a regex\n if (/^[~^>=<\\s]*4/.test(nuxtVer)) return 4;\n return 3;\n }\n } catch {\n return 4;\n }\n return 4;\n}\n","import kleur from \"kleur\";\nimport prompts from \"prompts\";\n\nimport { CSS_THEME_OPTIONS, PACKAGE_MANAGER_CHOICES } from \"./constants\";\n\n/**\n * Prompts the user for UI configuration values.\n */\nexport const initPrompts = async (nuxtVersion: number) => {\n const response = await prompts([\n {\n name: \"theme\",\n type: \"autocomplete\",\n message: \"Which theme do you want to start with?\",\n choices: CSS_THEME_OPTIONS,\n },\n {\n name: \"tailwindCSSLocation\",\n type: \"text\",\n message: \"Where is your tailwind.css file located?\",\n initial: (_, v) =>\n nuxtVersion == 3 ? \"assets/css/tailwind.css\" : \"app/assets/css/tailwind.css\",\n },\n {\n name: \"componentsLocation\",\n type: \"text\",\n message: \"Where should your components be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"components/Ui\" : \"app/components/Ui\"),\n },\n {\n name: \"composablesLocation\",\n type: \"text\",\n message: \"Where should your composables be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"composables\" : \"app/composables\"),\n },\n {\n name: \"pluginsLocation\",\n type: \"text\",\n message: \"Where should your plugins be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"plugins\" : \"app/plugins\"),\n },\n {\n name: \"utilsLocation\",\n type: \"text\",\n message: \"Where should your utils be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"utils\" : \"app/utils\"),\n },\n {\n name: \"force\",\n type: \"confirm\",\n message: \"Should we just replace component files if they already exist?\",\n initial: true,\n },\n {\n name: \"useDefaultFilename\",\n type: \"confirm\",\n message: \"Would you like to use the default filename when adding components?\",\n initial: true,\n },\n {\n name: \"packageManager\",\n type: \"select\",\n message: \"Which package manager do you use?\",\n choices: PACKAGE_MANAGER_CHOICES,\n },\n ]);\n\n if (!response || Object.keys(response).length < 9) {\n console.log(kleur.red(kleur.bold(\"Incomplete configuration submitted. Exiting...\")));\n return process.exit(0);\n }\n return response;\n};\n","import { UIConfig } from \"../types\";\nimport { getUIConfig } from \"./config\";\n\n/**\n * Compares the UI config with a temporary config to see if any properties are missing\n * @returns {boolean} - Returns true if all properties are present\n */\nexport const compareUIConfig = async () => {\n // Get ui config\n let userConfig: UIConfig = await getUIConfig();\n const tempConfig: UIConfig = {\n nuxtVersion: 3,\n theme: \"string\",\n tailwindCSSLocation: \"string\",\n componentsLocation: \"string\",\n composablesLocation: \"string\",\n utilsLocation: \"string\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"string\",\n };\n\n const missingProperties: string[] = [];\n\n for (const key of Object.keys(tempConfig)) {\n if (userConfig[key as keyof UIConfig] === undefined) {\n missingProperties.push(key);\n }\n }\n\n if (missingProperties.length > 1) {\n return false;\n }\n return true;\n};\n","import axios from \"axios\";\nimport dotenv from \"dotenv\";\nimport ora from \"ora\";\n\nimport { Component } from \"../types\";\n\ndotenv.config();\n\n/**\n * Function used to fetch components from the API.\n */\nexport const fetchComponents = async () => {\n const spinner = ora(\"Fetching components...\").start();\n\n const { data } = await axios.get<Component[]>(\n process.env.COMPONENTS_API || \"https://uithing.com/api/components\"\n );\n spinner.succeed(\"Components fetched.\");\n\n return data;\n};\n","import fs from \"node:fs\";\n\nexport const fileExists = async (path: string) => {\n try {\n await fs.promises.access(path, fs.constants.F_OK || fs.constants.W_OK);\n return true;\n } catch (error) {\n return false;\n }\n};\n","import { execa } from \"execa\";\nimport _ from \"lodash\";\nimport ora from \"ora\";\n\nexport const installPackages = async (\n packageManager: string,\n deps?: string[] | string,\n devDeps?: string | string[]\n) => {\n if (typeof deps === \"string\") {\n deps = [deps];\n }\n if (typeof devDeps === \"string\") {\n devDeps = [devDeps];\n }\n\n const depsSpinner = ora(\"Installing dependencies...\").start();\n if (!_.isUndefined(deps) && !_.isEmpty(deps)) {\n await execa(packageManager, [packageManager === \"yarn\" ? \"add\" : \"install\", ...deps]);\n }\n depsSpinner.text = \"Installing dev dependencies...\";\n if (!_.isUndefined(devDeps) && !_.isEmpty(devDeps)) {\n await execa(packageManager, [packageManager === \"yarn\" ? \"add\" : \"install\", \"-D\", ...devDeps]);\n }\n\n // we should check to see if there is a postinstall script and run it\n depsSpinner.text = \"Running nuxt prepare...\";\n await execa`npx -y nuxt prepare`;\n\n depsSpinner.succeed(\"Installed dependencies!\");\n};\n","import prompts from \"prompts\";\n\nimport { installPackages } from \"./installPackages\";\n\nexport const installValidator = async (packageManager: string) => {\n // Depending on the selected validator, install the corresponding packages\n const validatorPackages = {\n yup: [\"yup\", \"@vee-validate/yup\"],\n zod: [\"zod\", \"@vee-validate/zod\"],\n joi: [\"joi\", \"@vee-validate/joi\"],\n valibot: [\"valibot\", \"@vee-validate/valibot\"],\n };\n\n const { validator }: { validator: keyof typeof validatorPackages } = await prompts({\n type: \"select\",\n name: \"validator\",\n message: \"Choose the validator package to use with Vee Validate: \",\n choices: [\n { title: \"Yup\", value: \"yup\" },\n { title: \"Zod\", value: \"zod\" },\n { title: \"Joi\", value: \"joi\" },\n { title: \"Valibot\", value: \"valibot\" },\n ],\n });\n if (!validator) {\n console.log(\"No validator package selected\");\n return;\n }\n console.log(`Selected ${validator} as the validator package`);\n\n if (validatorPackages[validator]) {\n await installPackages(packageManager, validatorPackages[validator]);\n }\n return validator;\n};\n","import boxen, { Options as BoxOptions } from \"boxen\";\nimport figlet from \"figlet\";\n\n/**\n * Extra configuration options for the fancy box.\n */\ninterface FancyBoxOptions {\n box?: BoxOptions; // Overrides for boxen (border style, color, etc.)\n figletFont?: figlet.Fonts; // Optional font name for ASCII art\n}\n\n/**\n * Creates the ASCII-art box as a string (pure function — does not log).\n * Useful for testing because it avoids side effects like console output.\n *\n * @param title - The main text to display in big ASCII font\n * @param description - Optional subtitle or extra info below the box\n * @param options - Styling and font configuration\n * @returns A fully formatted string with ASCII title inside a box\n */\nconst createFancyBoxMessage = (\n title: string,\n description?: string,\n options: FancyBoxOptions = {}\n): string => {\n const { box, figletFont } = options;\n\n // Generate the ASCII art title using figlet\n const asciiTitle = figlet.textSync(title, {\n font: figletFont || \"Standard\", // Default font if none provided\n });\n\n // Default box styling so all boxes look consistent\n const defaultBoxOptions: BoxOptions = {\n borderColor: \"greenBright\",\n padding: 1,\n borderStyle: \"round\",\n titleAlignment: \"center\",\n };\n\n // Wrap ASCII art in a decorative box\n const boxMessage = boxen(asciiTitle, {\n ...defaultBoxOptions, // Base styles\n ...box, // User overrides\n });\n\n // Append description if provided\n return description ? `${boxMessage}\\n${description}` : boxMessage;\n};\n\n/**\n * CLI-friendly helper that prints the fancy box directly to the terminal.\n * This simply calls `createFancyBoxMessage` and logs the result.\n *\n * @param title - The main title to display\n * @param description - Optional extra info under the box\n * @param options - Font and box customization\n */\nexport const printFancyBoxMessage = (\n title: string,\n description?: string,\n options?: FancyBoxOptions\n) => {\n console.log(\"\\n\" + createFancyBoxMessage(title, description, options));\n};\n","import prompts from \"prompts\";\n\nimport { Component } from \"../types\";\nimport { fetchComponents } from \"./fetchComponents\";\n\n/**\n * Prompts the user to select components to add.\n */\nexport const promptUserForComponents = async (\n all?: boolean,\n allComponents: Component[] = []\n): Promise<string[]> => {\n // If all is true, return all components\n if (all) return allComponents.map((c: Component) => c.value);\n const { components } = await prompts({\n type: \"autocompleteMultiselect\",\n name: \"components\",\n message: \"Select the components you want to add\",\n choices: allComponents.map((c: Component) => ({ title: c.name, value: c.value })),\n });\n return components;\n};\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { fileExists } from \"./fileExists\";\n\nexport const writeFile = async (filePath: string, fileContent: string) => {\n // check if the file exists\n const exists = await fileExists(filePath);\n // if it doesn't, create it\n if (!exists) {\n // if it doesn't, create it\n const folderPath = path.dirname(filePath);\n if (!fs.existsSync(folderPath)) {\n fs.mkdirSync(folderPath, { recursive: true });\n }\n }\n fs.writeFileSync(filePath, fileContent);\n};\n","import path from \"node:path\";\nimport { updateConfig } from \"c12/update\";\nimport { Command } from \"commander\";\nimport fse from \"fs-extra\";\nimport kleur from \"kleur\";\nimport ora from \"ora\";\n\nimport { createCSS } from \"../templates/css\";\nimport { TW_HELPER } from \"../templates/tw-helper\";\nimport { InitOptions, UIConfig } from \"../types\";\nimport { addPrettierConfig } from \"../utils/addPrettierConfig\";\nimport { addTailwindVitePlugin } from \"../utils/addTailwindVitePlugin\";\nimport { addVSCodeFiles } from \"../utils/addVSCodeFiles\";\nimport { getUIConfig } from \"../utils/config\";\nimport { INIT_DEPS, INIT_DEV_DEPS, INIT_MODULES } from \"../utils/constants\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Runs the initialization command.\n */\nconst runInitCommand = async (options: InitOptions) => {\n // Get or create the initial configuration file\n let uiConfig: UIConfig = await getUIConfig(options);\n const spinner = ora(\"Updating nuxt.config...\").start();\n // Get nuxt config\n await updateConfig({\n cwd: process.cwd(),\n configFile: \"nuxt.config\",\n async onUpdate(config: any) {\n // Create modules array if it does not exist\n if (!config.modules) config.modules = [];\n // Create imports object if it does not exist\n if (!config.imports) config.imports = { imports: [] };\n for (const mod of INIT_MODULES) {\n if (!config.modules.includes(mod)) {\n config.modules.push(mod);\n }\n }\n // Add color mode config to nuxt.config file\n if (!config.colorMode) {\n // get the name of the folder(project name)\n const projectName = path.basename(process.cwd());\n config.colorMode = { storageKey: `${projectName}-color-mode`, classSuffix: \"\" };\n }\n // Add icon config if not present\n if (!config.icon) {\n config.icon = {\n clientBundle: { scan: true, sizeLimitKb: 0 },\n mode: \"svg\",\n class: \"shrink-0\",\n fetchTimeout: 2000,\n serverBundle: \"local\",\n };\n }\n // Add `tv` auto-import to the config file if it does not exists\n if (\n !config.imports.imports.find((i: any) => i.from === \"tailwind-variants\" && i.name === \"tv\")\n ) {\n config.imports.imports.push({ from: \"tailwind-variants\", name: \"tv\" });\n }\n // Add `VariantProps` auto-import to the config file if it does not exists\n if (\n !config.imports.imports.find(\n (i: any) => i.from === \"tailwind-variants\" && i.name === \"VariantProps\"\n )\n ) {\n config.imports.imports.push({\n from: \"tailwind-variants\",\n name: \"VariantProps\",\n type: true,\n });\n }\n // Add css path to config\n config.css ||= [];\n\n const relativeCssPath = uiConfig.tailwindCSSLocation?.split(\"app/\")[1];\n const tildePath = `~/${relativeCssPath}`;\n const atPath = `@/${relativeCssPath}`;\n\n // Only add if neither alias is present\n if (!config.css.includes(tildePath) && !config.css.includes(atPath)) {\n config.css.push(tildePath);\n }\n },\n });\n await addTailwindVitePlugin();\n spinner.succeed(\"Updated nuxt.config!\");\n spinner.start(\"Adding initial Tailwind CSS file...\");\n fse.writeFileSync(\n uiConfig.tailwindCSSLocation,\n createCSS(uiConfig.theme.toUpperCase() as any),\n \"utf-8\"\n );\n spinner.succeed(\"Added initial Tailwind CSS file!\");\n spinner.start(\"Adding Autocomplete helper...\");\n // Add Autocomplete helper\n fse.writeFileSync(uiConfig.utilsLocation + \"/tw-helper.ts\", TW_HELPER, \"utf-8\");\n spinner.succeed(\"Added Autocomplete helper!\");\n spinner.start(\"Merging VS Code settings...\");\n // Add .vscode folder with recommendations & settings\n addVSCodeFiles();\n spinner.succeed(\"Merged VS Code settings!\");\n // Install deps\n await installPackages(uiConfig.packageManager, INIT_DEPS, INIT_DEV_DEPS);\n // Add prettier config\n await addPrettierConfig();\n printFancyBoxMessage(\n \"Initialized\",\n `Feel free to start adding components with the ${kleur.bgWhite(\" add \")} command.`,\n { box: { title: \"Complete\" } }\n );\n};\n\n/**\n * Command to initialize UI Thing in a Nuxt project.\n */\nexport const init = new Command()\n .command(\"init\")\n .name(\"init\")\n .summary(\"Initialize UI Thing in your Nuxt project.\")\n .description(\n `${kleur.bold(\"Initialize UI Thing in your Nuxt project.\")}\n\n ✅ Add tailwindcss to your project\n ✅ Update your nuxt.config file\n ✅ Add the necessary dependencies\n ✅ Create a ${kleur.bold(\"ui-thing.config\")} file with the default configuration`\n )\n .option(\"-f --force\", \"Overwrite config file if it exists.\", false)\n .option(\"-y --yes\", \"Skip prompts and use default values.\", false)\n .option(\"-n --nuxtVersion <number>\", \"Specify the Nuxt version you are using.\")\n .action(runInitCommand);\n","const CSS_START = `@import \"tailwindcss\";\n@import \"tw-animate-css\";\n\n@plugin \"@tailwindcss/forms\" {\n strategy: \"class\";\n}\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --font-sans: \"Inter\", ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\",\n \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: \"Fira Code\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --font-display--font-feature-settings: \"cv02\", \"cv03\", \"cv04\", \"cv11\";\n\n --animate-shine: shine 3s ease-out infinite;\n --animate-gradient-flow: gradientFlow 10s ease 0s infinite normal none running;\n --animate-meteor: meteor 5s linear infinite;\n --animate-background-position-spin: background-position-spin 3000ms infinite alternate;\n --animate-grid: grid 15s linear infinite;\n\n @keyframes grid {\n 0% {\n transform: translateY(-50%);\n }\n 100% {\n transform: translateY(0);\n }\n }\n\n @keyframes shine {\n 0% {\n background-position: 200% 0;\n }\n 25%,\n 100% {\n background-position: -200% 0;\n }\n }\n\n @keyframes gradientFlow {\n 50% {\n background-position: 100% 50%;\n }\n 0%,\n 100% {\n background-position: 0% 50%;\n }\n }\n\n @keyframes meteor {\n 0% {\n transform: rotate(var(--angle)) translateX(0);\n opacity: 1;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n transform: rotate(var(--angle)) translateX(-500px);\n opacity: 0;\n }\n }\n\n @keyframes background-position-spin {\n 0% {\n background-position: top center;\n }\n 100% {\n background-position: bottom center;\n }\n }\n}\n\n@theme inline {\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --color-card: var(--card);\n --color-card-foreground: var(--card-foreground);\n --color-popover: var(--popover);\n --color-popover-foreground: var(--popover-foreground);\n --color-primary: var(--primary);\n --color-primary-foreground: var(--primary-foreground);\n --color-secondary: var(--secondary);\n --color-secondary-foreground: var(--secondary-foreground);\n --color-muted: var(--muted);\n --color-muted-foreground: var(--muted-foreground);\n --color-accent: var(--accent);\n --color-accent-foreground: var(--accent-foreground);\n --color-destructive: var(--destructive);\n --color-destructive-foreground: var(--destructive-foreground);\n --color-border: var(--border);\n --color-input: var(--input);\n --color-ring: var(--ring);\n\n --color-sidebar-background: var(--sidebar-background);\n --color-sidebar-foreground: var(--sidebar-foreground);\n --color-sidebar-primary: var(--sidebar-primary);\n --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);\n --color-sidebar-accent: var(--sidebar-accent);\n --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);\n --color-sidebar-border: var(--sidebar-border);\n --color-sidebar-ring: var(--sidebar-ring);\n --color-sidebar-input: var(--sidebar-input);\n\n --color-gradient-lime: var(--gradient-lime);\n --color-gradient-ocean: var(--gradient-ocean);\n --color-gradient-wine: var(--gradient-wine);\n --color-gradient-rust: var(--gradient-rust);\n}\n\n:root {\n /* Gradient slide show Colors */\n --gradient-lime: oklch(67.287% 0.1546 116.644);\n --gradient-ocean: oklch(44.56% 0.10114 242.813);\n --gradient-wine: oklch(32.332% 0.12034 5.266);\n --gradient-rust: oklch(55.695% 0.19944 34.155);\n}\n \n`;\n\nconst CSS_END = `@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n * {\n scrollbar-width: thin;\n scrollbar-color: var(--border) transparent;\n }\n html {\n @apply antialiased;\n }\n body {\n @apply bg-background text-foreground;\n }\n ::-webkit-scrollbar {\n width: 4px;\n }\n ::-webkit-scrollbar-track {\n background: transparent;\n }\n ::-webkit-scrollbar-thumb {\n background: var(--border);\n border-radius: 4px;\n }\n button:not(:disabled),\n [role=\"button\"]:not(:disabled) {\n cursor: pointer;\n }\n}\n`;\n\nexport const createCSS = (theme: keyof typeof themes) => {\n // if them is not in themes, set them to ZINC\n if (!themes[theme]) {\n theme = \"ZINC\";\n }\n return `${CSS_START}${themes[theme]}${CSS_END}`;\n};\n\nexport const ZINC_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.922 0 0);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.205 0 0);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.269 0 0);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.556 0 0);\n}\n\n`;\nconst SLATE_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.129 0.042 264.695);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.129 0.042 264.695);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.129 0.042 264.695);\n --primary: oklch(0.208 0.042 265.755);\n --primary-foreground: oklch(0.984 0.003 247.858);\n --secondary: oklch(0.968 0.007 247.896);\n --secondary-foreground: oklch(0.208 0.042 265.755);\n --muted: oklch(0.968 0.007 247.896);\n --muted-foreground: oklch(0.554 0.046 257.417);\n --accent: oklch(0.968 0.007 247.896);\n --accent-foreground: oklch(0.208 0.042 265.755);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.929 0.013 255.508);\n --input: oklch(0.929 0.013 255.508);\n --ring: oklch(0.704 0.04 256.788);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.984 0.003 247.858);\n --sidebar-foreground: oklch(0.129 0.042 264.695);\n --sidebar-primary: oklch(0.208 0.042 265.755);\n --sidebar-primary-foreground: oklch(0.984 0.003 247.858);\n --sidebar-accent: oklch(0.968 0.007 247.896);\n --sidebar-accent-foreground: oklch(0.208 0.042 265.755);\n --sidebar-border: oklch(0.929 0.013 255.508);\n --sidebar-ring: oklch(0.704 0.04 256.788);\n}\n\n.dark {\n --background: oklch(0.129 0.042 264.695);\n --foreground: oklch(0.984 0.003 247.858);\n --card: oklch(0.208 0.042 265.755);\n --card-foreground: oklch(0.984 0.003 247.858);\n --popover: oklch(0.208 0.042 265.755);\n --popover-foreground: oklch(0.984 0.003 247.858);\n --primary: oklch(0.929 0.013 255.508);\n --primary-foreground: oklch(0.208 0.042 265.755);\n --secondary: oklch(0.279 0.041 260.031);\n --secondary-foreground: oklch(0.984 0.003 247.858);\n --muted: oklch(0.279 0.041 260.031);\n --muted-foreground: oklch(0.704 0.04 256.788);\n --accent: oklch(0.279 0.041 260.031);\n --accent-foreground: oklch(0.984 0.003 247.858);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.551 0.027 264.364);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.208 0.042 265.755);\n --sidebar-foreground: oklch(0.984 0.003 247.858);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.984 0.003 247.858);\n --sidebar-accent: oklch(0.279 0.041 260.031);\n --sidebar-accent-foreground: oklch(0.984 0.003 247.858);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.551 0.027 264.364);\n}\n\n`;\n\nconst STONE_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.147 0.004 49.25);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.147 0.004 49.25);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.147 0.004 49.25);\n --primary: oklch(0.216 0.006 56.043);\n --primary-foreground: oklch(0.985 0.001 106.423);\n --secondary: oklch(0.97 0.001 106.424);\n --secondary-foreground: oklch(0.216 0.006 56.043);\n --muted: oklch(0.97 0.001 106.424);\n --muted-foreground: oklch(0.553 0.013 58.071);\n --accent: oklch(0.97 0.001 106.424);\n --accent-foreground: oklch(0.216 0.006 56.043);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.923 0.003 48.717);\n --input: oklch(0.923 0.003 48.717);\n --ring: oklch(0.709 0.01 56.259);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0.001 106.423);\n --sidebar-foreground: oklch(0.147 0.004 49.25);\n --sidebar-primary: oklch(0.216 0.006 56.043);\n --sidebar-primary-foreground: oklch(0.985 0.001 106.423);\n --sidebar-accent: oklch(0.97 0.001 106.424);\n --sidebar-accent-foreground: oklch(0.216 0.006 56.043);\n --sidebar-border: oklch(0.923 0.003 48.717);\n --sidebar-ring: oklch(0.709 0.01 56.259);\n}\n.dark {\n --background: oklch(0.147 0.004 49.25);\n --foreground: oklch(0.985 0.001 106.423);\n --card: oklch(0.216 0.006 56.043);\n --card-foreground: oklch(0.985 0.001 106.423);\n --popover: oklch(0.216 0.006 56.043);\n --popover-foreground: oklch(0.985 0.001 106.423);\n --primary: oklch(0.923 0.003 48.717);\n --primary-foreground: oklch(0.216 0.006 56.043);\n --secondary: oklch(0.268 0.007 34.298);\n --secondary-foreground: oklch(0.985 0.001 106.423);\n --muted: oklch(0.268 0.007 34.298);\n --muted-foreground: oklch(0.709 0.01 56.259);\n --accent: oklch(0.268 0.007 34.298);\n --accent-foreground: oklch(0.985 0.001 106.423);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.553 0.013 58.071);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.216 0.006 56.043);\n --sidebar-foreground: oklch(0.985 0.001 106.423);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0.001 106.423);\n --sidebar-accent: oklch(0.268 0.007 34.298);\n --sidebar-accent-foreground: oklch(0.985 0.001 106.423);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.553 0.013 58.071);\n}\n\n`;\n\nconst GRAY_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.13 0.028 261.692);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.13 0.028 261.692);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.13 0.028 261.692);\n --primary: oklch(0.21 0.034 264.665);\n --primary-foreground: oklch(0.985 0.002 247.839);\n --secondary: oklch(0.967 0.003 264.542);\n --secondary-foreground: oklch(0.21 0.034 264.665);\n --muted: oklch(0.967 0.003 264.542);\n --muted-foreground: oklch(0.551 0.027 264.364);\n --accent: oklch(0.967 0.003 264.542);\n --accent-foreground: oklch(0.21 0.034 264.665);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.928 0.006 264.531);\n --input: oklch(0.928 0.006 264.531);\n --ring: oklch(0.707 0.022 261.325);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0.002 247.839);\n --sidebar-foreground: oklch(0.13 0.028 261.692);\n --sidebar-primary: oklch(0.21 0.034 264.665);\n --sidebar-primary-foreground: oklch(0.985 0.002 247.839);\n --sidebar-accent: oklch(0.967 0.003 264.542);\n --sidebar-accent-foreground: oklch(0.21 0.034 264.665);\n --sidebar-border: oklch(0.928 0.006 264.531);\n --sidebar-ring: oklch(0.707 0.022 261.325);\n}\n\n.dark {\n --background: oklch(0.13 0.028 261.692);\n --foreground: oklch(0.985 0.002 247.839);\n --card: oklch(0.21 0.034 264.665);\n --card-foreground: oklch(0.985 0.002 247.839);\n --popover: oklch(0.21 0.034 264.665);\n --popover-foreground: oklch(0.985 0.002 247.839);\n --primary: oklch(0.928 0.006 264.531);\n --primary-foreground: oklch(0.21 0.034 264.665);\n --secondary: oklch(0.278 0.033 256.848);\n --secondary-foreground: oklch(0.985 0.002 247.839);\n --muted: oklch(0.278 0.033 256.848);\n --muted-foreground: oklch(0.707 0.022 261.325);\n --accent: oklch(0.278 0.033 256.848);\n --accent-foreground: oklch(0.985 0.002 247.839);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.551 0.027 264.364);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.034 264.665);\n --sidebar-foreground: oklch(0.985 0.002 247.839);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0.002 247.839);\n --sidebar-accent: oklch(0.278 0.033 256.848);\n --sidebar-accent-foreground: oklch(0.985 0.002 247.839);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.551 0.027 264.364);\n}\n\n`;\n\nconst NEUTRAL_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.922 0 0);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.205 0 0);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.269 0 0);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.556 0 0);\n}\n\n`;\n\nconst RED_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.637 0.237 25.331);\n --primary-foreground: oklch(0.971 0.013 17.38);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.637 0.237 25.331);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.637 0.237 25.331);\n --sidebar-primary-foreground: oklch(0.971 0.013 17.38);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.637 0.237 25.331);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.637 0.237 25.331);\n --primary-foreground: oklch(0.971 0.013 17.38);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.637 0.237 25.331);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.637 0.237 25.331);\n --sidebar-primary-foreground: oklch(0.971 0.013 17.38);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.637 0.237 25.331);\n}\n\n`;\n\nconst ROSE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.645 0.246 16.439);\n --primary-foreground: oklch(0.969 0.015 12.422);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.645 0.246 16.439);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.645 0.246 16.439);\n --sidebar-primary-foreground: oklch(0.969 0.015 12.422);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.645 0.246 16.439);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.645 0.246 16.439);\n --primary-foreground: oklch(0.969 0.015 12.422);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.645 0.246 16.439);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.645 0.246 16.439);\n --sidebar-primary-foreground: oklch(0.969 0.015 12.422);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.645 0.246 16.439);\n}\n\n`;\n\nconst ORANGE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.705 0.213 47.604);\n --primary-foreground: oklch(0.98 0.016 73.684);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.705 0.213 47.604);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.705 0.213 47.604);\n --sidebar-primary-foreground: oklch(0.98 0.016 73.684);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.705 0.213 47.604);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.646 0.222 41.116);\n --primary-foreground: oklch(0.98 0.016 73.684);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.646 0.222 41.116);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.646 0.222 41.116);\n --sidebar-primary-foreground: oklch(0.98 0.016 73.684);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.646 0.222 41.116);\n}\n\n`;\n\nconst GREEN_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.723 0.219 149.579);\n --primary-foreground: oklch(0.982 0.018 155.826);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.723 0.219 149.579);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.723 0.219 149.579);\n --sidebar-primary-foreground: oklch(0.982 0.018 155.826);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.723 0.219 149.579);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.696 0.17 162.48);\n --primary-foreground: oklch(0.393 0.095 152.535);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.527 0.154 150.069);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.696 0.17 162.48);\n --sidebar-primary-foreground: oklch(0.393 0.095 152.535);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.527 0.154 150.069);\n}\n\n`;\n\nexport const BLUE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.623 0.214 259.815);\n --primary-foreground: oklch(0.97 0.014 254.604);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.623 0.214 259.815);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.623 0.214 259.815);\n --sidebar-primary-foreground: oklch(0.97 0.014 254.604);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.623 0.214 259.815);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.546 0.245 262.881);\n --primary-foreground: oklch(0.379 0.146 265.522);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.488 0.243 264.376);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.546 0.245 262.881);\n --sidebar-primary-foreground: oklch(0.379 0.146 265.522);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.488 0.243 264.376);\n}\n\n`;\n\nconst YELLOW_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.795 0.184 86.047);\n --primary-foreground: oklch(0.421 0.095 57.708);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.795 0.184 86.047);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.795 0.184 86.047);\n --sidebar-primary-foreground: oklch(0.421 0.095 57.708);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.795 0.184 86.047);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.795 0.184 86.047);\n --primary-foreground: oklch(0.421 0.095 57.708);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.554 0.135 66.442);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.795 0.184 86.047);\n --sidebar-primary-foreground: oklch(0.421 0.095 57.708);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.554 0.135 66.442);\n}\n\n`;\n\nconst VIOLET_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.606 0.25 292.717);\n --primary-foreground: oklch(0.969 0.016 293.756);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.606 0.25 292.717);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.606 0.25 292.717);\n --sidebar-primary-foreground: oklch(0.969 0.016 293.756);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.606 0.25 292.717);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.541 0.281 293.009);\n --primary-foreground: oklch(0.969 0.016 293.756);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.541 0.281 293.009);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.541 0.281 293.009);\n --sidebar-primary-foreground: oklch(0.969 0.016 293.756);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.541 0.281 293.009);\n}\n\n`;\nconst themes = {\n ZINC: ZINC_THEME,\n SLATE: SLATE_THEME,\n STONE: STONE_THEME,\n GRAY: GRAY_THEME,\n NEUTRAL: NEUTRAL_THEME,\n RED: RED_THEME,\n ROSE: ROSE_THEME,\n ORANGE: ORANGE_THEME,\n GREEN: GREEN_THEME,\n BLUE: BLUE_THEME,\n YELLOW: YELLOW_THEME,\n VIOLET: VIOLET_THEME,\n};\n","/**\n * Helper function used to get auto complete suggestions for Tailwind CSS classes.\n */\nexport const TW_HELPER = `/**\n * Utility function to return Tailwind CSS classes.\n */\nexport const tw = <T extends TemplateStringsArray | string>(tailwindClasses: T) => tailwindClasses;\n`;\n","import { join } from \"node:path\";\nimport { $ } from \"execa\";\nimport fse from \"fs-extra\";\nimport ora from \"ora\";\nimport prompts from \"prompts\";\n\nimport { PRETTIER_CONFIG } from \"../templates/prettier\";\n\n/**\n * Adds or merges a Prettier configuration into the project.\n *\n * - If `.prettierrc` doesn't exist, creates it with `PRETTIER_CONFIG`.\n * - If it exists, merges keys instead of overwriting, unless user chooses overwrite.\n *\n * @param cwd - The working directory of the project.\n * @param format - Whether to run `prettier --write .` after adding/merging.\n */\nexport const addPrettierConfig = async (cwd = process.cwd(), format: boolean = true) => {\n const prettierLocation = join(cwd, \".prettierrc\");\n let finalConfig = PRETTIER_CONFIG;\n\n if (fse.existsSync(prettierLocation)) {\n // Read existing config\n const existingRaw = await fse.readFile(prettierLocation, \"utf-8\");\n let existingConfig: Record<string, any> = {};\n\n try {\n existingConfig = JSON.parse(existingRaw);\n } catch {\n console.warn(\"⚠️ Existing .prettierrc is not valid JSON — will prompt for overwrite.\");\n }\n\n const res = await prompts({\n name: \"merge\",\n type: \"select\",\n message: \"A prettier config file already exists. What would you like to do?\",\n choices: [\n { title: \"Merge configs\", value: \"merge\" },\n { title: \"Overwrite with new config\", value: \"overwrite\" },\n { title: \"Cancel\", value: \"cancel\" },\n ],\n initial: 0,\n });\n\n if (res.merge === \"merge\") {\n // Merge existing config with PRETTIER_CONFIG\n finalConfig = {\n ...existingConfig,\n ...PRETTIER_CONFIG,\n };\n } else if (res.merge === \"overwrite\") {\n finalConfig = PRETTIER_CONFIG;\n } else {\n return false; // Cancelled\n }\n }\n\n // Save merged or new config\n await fse.writeFile(prettierLocation, JSON.stringify(finalConfig, null, 2), \"utf-8\");\n\n if (!format) return true;\n\n // Format project files\n const spinner = ora(\"Formatting files with prettier...\").start();\n await $`npx prettier --write .`;\n spinner.succeed(\"Files formatted with prettier\");\n\n return true;\n};\n","export const PRETTIER_CONFIG = {\n arrowParens: \"always\",\n endOfLine: \"lf\",\n plugins: [\"@ianvs/prettier-plugin-sort-imports\", \"prettier-plugin-tailwindcss\"],\n printWidth: 100,\n semi: true,\n singleQuote: false,\n tabWidth: 2,\n trailingComma: \"es5\",\n useTabs: false,\n vueIndentScriptAndStyle: true,\n tailwindFunctions: [\"tv\"],\n importOrder: [\"<BUILTIN_MODULES>\", \"<THIRD_PARTY_MODULES>\", \"<TYPES>\", \"\", \"^[.]\"],\n};\n","import { join } from \"node:path\";\nimport { builders, loadFile, writeFile } from \"magicast\";\nimport { getDefaultExportOptions } from \"magicast/helpers\";\n\n/**\n * Adds the Tailwind CSS Vite plugin to the Nuxt config.\n */\nexport const addTailwindVitePlugin = async () => {\n // Get the path to nuxt config\n const CONFIG_PATH = join(process.cwd(), \"nuxt.config.ts\");\n // Load the nuxt config file\n const cfg = await loadFile(CONFIG_PATH);\n // check if `tailwindcss()` is already present in the code\n\n if (!cfg.$code.includes(\"tailwindcss()\")) {\n // get the exported config object\n const defaultExport = getDefaultExportOptions(cfg);\n // ensure vite and plugins are defined\n defaultExport.vite ||= {};\n defaultExport.vite.plugins ||= [];\n // push the function to the plugins array\n defaultExport.vite.plugins.push(builders.functionCall(\"tailwindcss\"));\n }\n // check if tailwind plugin is already imported\n if (!cfg.imports.$items.find((i) => i.local === \"tailwindcss\")) {\n // prepend the import for tailwindcss\n cfg.imports.$prepend({\n from: \"@tailwindcss/vite\",\n local: \"tailwindcss\",\n imported: \"default\",\n });\n }\n // write the changes to the `nuxt.config.ts` file\n await writeFile(cfg, CONFIG_PATH);\n};\n","import fse from \"fs-extra\";\n\nimport { VS_CODE_RECOMMENDATIONS, VS_CODE_SETTINGS } from \"../templates/vs-code\";\nimport { mergeJsonFile } from \"./mergeJsonFile\";\n\n/**\n * Adds the necessary VS Code configuration files.\n */\nexport const addVSCodeFiles = (VS_CODE_FOLDER = \".vscode\") => {\n fse.ensureDirSync(VS_CODE_FOLDER);\n mergeJsonFile(`${VS_CODE_FOLDER}/extensions.json`, VS_CODE_RECOMMENDATIONS);\n mergeJsonFile(`${VS_CODE_FOLDER}/settings.json`, VS_CODE_SETTINGS);\n};\n","/**\n * VS Code extensions recommendations for Tailwind CSS development.\n */\nexport const VS_CODE_RECOMMENDATIONS = {\n recommendations: [\n \"vue.volar\",\n \"bradlc.vscode-tailwindcss\",\n \"esbenp.prettier-vscode\",\n \"antfu.iconify\",\n \"formulahendry.auto-close-tag\",\n \"formulahendry.auto-rename-tag\",\n ],\n};\n\n/**\n * VS Code settings for Tailwind CSS development.\n */\nexport const VS_CODE_SETTINGS = {\n \"editor.formatOnSave\": true,\n \"editor.quickSuggestions\": { strings: \"on\" },\n \"files.associations\": { \"*.css\": \"tailwindcss\" },\n \"tailwindCSS.classFunctions\": [\"tw\", \"clsx\", \"tw\\\\.[a-z-]+\"],\n \"tailwindCSS.experimental.classRegex\": [[\"([\\\"'`][^\\\"'`]*.*?[\\\"'`])\", \"[\\\"'`]([^\\\"'`]*)[\\\"'`]\"]],\n};\n","import { merge } from \"es-toolkit\";\nimport fse from \"fs-extra\";\n\n/**\n * Merges JSON data into a file without overwriting existing keys.\n * Creates the file if it does not exist.\n *\n * @param filePath - Path to the JSON file to update.\n * @param newData - The new JSON data to merge in.\n */\nexport function mergeJsonFile(filePath: string, newData: Record<string, any>) {\n let currentData: Record<string, any> = {};\n\n // Read current JSON if it exists\n if (fse.existsSync(filePath)) {\n try {\n currentData = fse.readJsonSync(filePath);\n } catch {\n console.warn(`⚠️ Could not parse ${filePath}, starting fresh.`);\n }\n }\n\n // Merge existing and new data\n const merged = merge(currentData, newData);\n\n // Write merged JSON with pretty formatting\n fse.writeJsonSync(filePath, merged, { spaces: 2 });\n}\n","import { Command } from \"commander\";\nimport prompts from \"prompts\";\n\nimport { addPrettierConfig } from \"../utils/addPrettierConfig\";\nimport { PACKAGE_MANAGER_CHOICES } from \"../utils/constants\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\nexport const addPrettier = new Command()\n .command(\"prettier\")\n .name(\"prettier\")\n .description(\"Adds prettier config to your project.\")\n .action(async () => {\n const added = await addPrettierConfig(undefined, false);\n if (!added) {\n printFancyBoxMessage(\"Not Added\", `Prettier config was not added.`, {\n box: { title: \"Prettier Not Added\", borderColor: \"red\" },\n });\n return;\n }\n\n const { pkgManager } = await prompts({\n name: \"pkgManager\",\n type: \"select\",\n message: \"Which package manager are you using?\",\n choices: PACKAGE_MANAGER_CHOICES,\n });\n if (!pkgManager) return process.exit(0);\n\n // install prettier dep\n await installPackages(pkgManager, undefined, [\n \"prettier\",\n \"prettier-plugin-tailwindcss\",\n \"@ianvs/prettier-plugin-sort-imports\",\n ]);\n printFancyBoxMessage(\n \"All Done!\",\n `A .prettierrc file has been added to your project and the code formatted. Enjoy!`,\n { box: { title: \"Prettier Added\" } }\n );\n });\n","import { Command } from \"commander\";\nimport { execa } from \"execa\";\nimport ora from \"ora\";\nimport prompts from \"prompts\";\n\nimport { addShortcutFiles } from \"../utils/addShortcutFiles\";\nimport { PACKAGE_MANAGER_CHOICES } from \"../utils/constants\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Adds the shortcuts composables to the project.\n */\nexport const addShortcuts = new Command()\n .command(\"shortcuts\")\n .name(\"shortcuts\")\n .description(\"Add the shortcuts composables to your project.\")\n .action(async () => {\n await addShortcutFiles();\n\n const { pkgManager } = await prompts({\n name: \"pkgManager\",\n type: \"select\",\n message: \"Which package manager are you using?\",\n choices: PACKAGE_MANAGER_CHOICES,\n });\n if (!pkgManager) return process.exit(0);\n\n const spinner = ora(\"Installing vueuse module...\").start();\n // install vueuse for nuxt\n await execa`npx -y nuxi@latest module add vueuse`;\n spinner.succeed(\"VueUse module installed successfully!\");\n\n printFancyBoxMessage(\n \"All Done!\",\n `Check the composables folder for the shortcuts composables.`,\n { box: { title: \"Composable Added\" } }\n );\n });\n","import { join } from \"node:path\";\nimport fse from \"fs-extra\";\n\nimport { DEFINE_SHORTCUT } from \"../templates/shortcuts\";\nimport { UIConfig } from \"../types\";\nimport { getUIConfig } from \"./config\";\n\n/**\n * Adds shortcut files to the specified directory.\n */\nexport const addShortcutFiles = async (cwd = process.cwd()) => {\n // get config\n let userConfig: UIConfig = await getUIConfig();\n const composablesLocation = join(cwd, userConfig.composablesLocation);\n // ensure that the composable folder exists\n await fse.ensureDir(composablesLocation);\n // write the defineShortcuts composable\n await fse.writeFile(join(composablesLocation, \"shortcuts.ts\"), DEFINE_SHORTCUT, \"utf-8\");\n};\n","export const DEFINE_SHORTCUT = `import {\n createSharedComposable,\n useActiveElement,\n useDebounceFn,\n useEventListener,\n} from \"@vueuse/core\";\nimport type { MaybeRef } from \"vue\";\n\ntype KbdKeysSpecificMap = {\n meta: string;\n alt: string;\n ctrl: string;\n};\n\nexport const kbdKeysMap = {\n meta: \"\",\n ctrl: \"\",\n alt: \"\",\n win: \"⊞\",\n command: \"⌘\",\n shift: \"⇧\",\n control: \"⌃\",\n option: \"⌥\",\n enter: \"↵\",\n delete: \"⌦\",\n backspace: \"⌫\",\n escape: \"⎋\",\n tab: \"⇥\",\n capslock: \"⇪\",\n arrowup: \"↑\",\n arrowright: \"→\",\n arrowdown: \"↓\",\n arrowleft: \"←\",\n pageup: \"⇞\",\n pagedown: \"⇟\",\n home: \"↖\",\n end: \"↘\",\n};\n\nexport type KbdKey = keyof typeof kbdKeysMap;\nexport type KbdKeySpecific = keyof KbdKeysSpecificMap;\n\nconst _useKbd = () => {\n const macOS = computed(\n () =>\n import.meta.client &&\n navigator &&\n navigator.userAgent &&\n navigator.userAgent.match(/Macintosh;/)\n );\n\n const kbdKeysSpecificMap = reactive({\n meta: \" \",\n alt: \" \",\n ctrl: \" \",\n });\n\n onMounted(() => {\n kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : \"Ctrl\";\n kbdKeysSpecificMap.ctrl = macOS.value ? kbdKeysMap.control : \"Ctrl\";\n kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : \"Alt\";\n });\n\n function getKbdKey(value?: KbdKey | string) {\n if (!value) {\n return;\n }\n\n if ([\"meta\", \"alt\", \"ctrl\"].includes(value)) {\n return kbdKeysSpecificMap[value as KbdKeySpecific];\n }\n\n return kbdKeysMap[value as KbdKey] || value.toUpperCase();\n }\n\n return {\n macOS,\n getKbdKey,\n };\n};\n\nexport const useKbd = /* @__PURE__ */ createSharedComposable(_useKbd);\n\ntype Handler = (e?: any) => void;\n\nexport interface ShortcutConfig {\n handler: Handler;\n usingInput?: string | boolean;\n}\n\nexport interface ShortcutsConfig {\n [key: string]: ShortcutConfig | Handler | false | null | undefined;\n}\n\nexport interface ShortcutsOptions {\n chainDelay?: number;\n}\n\ninterface Shortcut {\n handler: Handler;\n enabled: boolean;\n chained: boolean;\n // KeyboardEvent attributes\n key: string;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n // code?: string\n // keyCode?: number\n}\n\nconst chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;\nconst combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;\n// keyboard keys which can be combined with Shift modifier (in addition to alphabet keys)\nconst shiftableKeys = [\n \"arrowleft\",\n \"arrowright\",\n \"arrowup\",\n \"arrowright\",\n \"tab\",\n \"escape\",\n \"enter\",\n \"backspace\",\n];\n\nexport function extractShortcuts(items: any[] | any[][]) {\n const shortcuts: Record<string, Handler> = {};\n\n function traverse(items: any[]) {\n items.forEach((item) => {\n if (item.kbds?.length && (item.onSelect || item.onClick)) {\n const shortcutKey = item.kbds.join(\"_\");\n shortcuts[shortcutKey] = item.onSelect || item.onClick;\n }\n if (item.children) {\n traverse(item.children.flat());\n }\n if (item.items) {\n traverse(item.items.flat());\n }\n });\n }\n\n traverse(items.flat());\n\n return shortcuts;\n}\n\nexport function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: ShortcutsOptions = {}) {\n const chainedInputs = ref<string[]>([]);\n const clearChainedInput = () => {\n chainedInputs.value.splice(0, chainedInputs.value.length);\n };\n const debouncedClearChainedInput = useDebounceFn(clearChainedInput, options.chainDelay ?? 800);\n\n const { macOS } = useKbd();\n const activeElement = useActiveElement();\n\n const onKeyDown = (e: KeyboardEvent) => {\n // Input autocomplete triggers a keydown event\n if (!e.key) {\n return;\n }\n\n const alphabetKey = /^[a-z]{1}$/i.test(e.key);\n const shiftableKey = shiftableKeys.includes(e.key.toLowerCase());\n\n let chainedKey;\n chainedInputs.value.push(e.key);\n // try matching a chained shortcut\n if (chainedInputs.value.length >= 2) {\n chainedKey = chainedInputs.value.slice(-2).join(\"-\");\n\n for (const shortcut of shortcuts.value.filter((s) => s.chained)) {\n if (shortcut.key !== chainedKey) {\n continue;\n }\n\n if (shortcut.enabled) {\n e.preventDefault();\n shortcut.handler(e);\n }\n clearChainedInput();\n return;\n }\n }\n\n // try matching a standard shortcut\n for (const shortcut of shortcuts.value.filter((s) => !s.chained)) {\n if (e.key.toLowerCase() !== shortcut.key) {\n continue;\n }\n if (e.metaKey !== shortcut.metaKey) {\n continue;\n }\n if (e.ctrlKey !== shortcut.ctrlKey) {\n continue;\n }\n // shift modifier is only checked in combination with alphabet keys and some extra keys\n // (shift with special characters would change the key)\n if ((alphabetKey || shiftableKey) && e.shiftKey !== shortcut.shiftKey) {\n continue;\n }\n // alt modifier changes the combined key anyways\n // if (e.altKey !== shortcut.altKey) { continue }\n\n if (shortcut.enabled) {\n e.preventDefault();\n shortcut.handler(e);\n }\n clearChainedInput();\n return;\n }\n\n debouncedClearChainedInput();\n };\n\n const usingInput = computed(() => {\n const tagName = activeElement.value?.tagName;\n const contentEditable = activeElement.value?.contentEditable;\n\n const usingInput = !!(\n tagName === \"INPUT\" ||\n tagName === \"TEXTAREA\" ||\n contentEditable === \"true\" ||\n contentEditable === \"plaintext-only\"\n );\n\n if (usingInput) {\n return ((activeElement.value as any)?.name as string) || true;\n }\n\n return false;\n });\n\n // Map config to full detailed shortcuts\n const shortcuts = computed<Shortcut[]>(() => {\n return Object.entries(toValue(config))\n .map(([key, shortcutConfig]) => {\n if (!shortcutConfig) {\n return null;\n }\n\n // Parse key and modifiers\n let shortcut: Partial<Shortcut>;\n\n if (\n key.includes(\"-\") &&\n key !== \"-\" &&\n !key.includes(\"_\") &&\n !key.match(chainedShortcutRegex)?.length\n ) {\n console.trace(\\`[Shortcut] Invalid key: \"\\${key}\"\\`);\n }\n\n if (key.includes(\"_\") && key !== \"_\" && !key.match(combinedShortcutRegex)?.length) {\n console.trace(\\`[Shortcut] Invalid key: \"\\${key}\"\\`);\n }\n\n const chained = key.includes(\"-\") && key !== \"-\" && !key.includes(\"_\");\n if (chained) {\n shortcut = {\n key: key.toLowerCase(),\n metaKey: false,\n ctrlKey: false,\n shiftKey: false,\n altKey: false,\n };\n } else {\n const keySplit = key\n .toLowerCase()\n .split(\"_\")\n .map((k) => k);\n shortcut = {\n key: keySplit\n .filter((k) => ![\"meta\", \"command\", \"ctrl\", \"shift\", \"alt\", \"option\"].includes(k))\n .join(\"_\"),\n metaKey: keySplit.includes(\"meta\") || keySplit.includes(\"command\"),\n ctrlKey: keySplit.includes(\"ctrl\"),\n shiftKey: keySplit.includes(\"shift\"),\n altKey: keySplit.includes(\"alt\") || keySplit.includes(\"option\"),\n };\n }\n shortcut.chained = chained;\n\n // Convert Meta to Ctrl for non-MacOS\n if (!macOS.value && shortcut.metaKey && !shortcut.ctrlKey) {\n shortcut.metaKey = false;\n shortcut.ctrlKey = true;\n }\n\n // Retrieve handler function\n if (typeof shortcutConfig === \"function\") {\n shortcut.handler = shortcutConfig;\n } else if (typeof shortcutConfig === \"object\") {\n shortcut = { ...shortcut, handler: shortcutConfig.handler };\n }\n\n if (!shortcut.handler) {\n console.trace(\"[Shortcut] Invalid value\");\n return null;\n }\n\n let enabled = true;\n if (!(shortcutConfig as ShortcutConfig).usingInput) {\n enabled = !usingInput.value;\n } else if (typeof (shortcutConfig as ShortcutConfig).usingInput === \"string\") {\n enabled = usingInput.value === (shortcutConfig as ShortcutConfig).usingInput;\n }\n shortcut.enabled = enabled;\n\n return shortcut;\n })\n .filter(Boolean) as Shortcut[];\n });\n\n return useEventListener(\"keydown\", onKeyDown);\n}\n\n`;\n","import { Command } from \"commander\";\nimport fse from \"fs-extra\";\nimport kleur from \"kleur\";\nimport _ from \"lodash\";\nimport prompts from \"prompts\";\n\nimport { createCSS } from \"../templates/css\";\nimport { compareUIConfig } from \"../utils/compareUIConfig\";\nimport { getUIConfig } from \"../utils/config\";\nimport { CSS_THEME_OPTIONS } from \"../utils/constants\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Adds a new theme to the project.\n */\nexport const theme = new Command()\n .command(\"theme\")\n .name(\"theme\")\n .description(\"Add a new theme to your project.\")\n .action(async () => {\n // Get ui config\n let uiConfig = await getUIConfig();\n let uiConfigIsCorrect = await compareUIConfig();\n if (!uiConfigIsCorrect) {\n uiConfig = await getUIConfig({ force: true });\n }\n if (_.isEmpty(uiConfig)) {\n console.log(kleur.red(\"Config file not set. Exiting...\"));\n process.exit(0);\n }\n const { theme } = await prompts([\n {\n name: \"theme\",\n type: \"autocomplete\",\n message: \"Which theme do you want to add?\",\n choices: CSS_THEME_OPTIONS,\n },\n ]);\n if (!theme) {\n console.log(kleur.red(\"No theme selected. Exiting...\"));\n process.exit(0);\n }\n if (fse.existsSync(uiConfig.tailwindCSSLocation)) {\n const { force } = await prompts([\n {\n name: \"force\",\n type: \"confirm\",\n message: \"Do you want to overwrite your current css file?\",\n initial: true,\n },\n ]);\n if (!force) {\n console.log(\"Exiting...\");\n return process.exit(0);\n }\n }\n fse.writeFileSync(uiConfig.tailwindCSSLocation, createCSS(theme.toUpperCase() as any), \"utf-8\");\n\n printFancyBoxMessage(\n `${_.capitalize(theme)}`,\n `${_.capitalize(theme)} theme has been added to ${uiConfig.tailwindCSSLocation}`,\n { box: { title: \"New Theme Added\" } }\n );\n });\n"],"mappings":";AACA,OAAS,WAAAA,OAAe,YCCtB,IAAAC,EAAW,QCFb,OAAOC,MAAU,OACjB,OAAS,gBAAAC,OAAoB,aAC7B,OAAS,WAAAC,OAAe,YACxB,OAAS,WAAAC,MAAe,UACxB,OAAOC,MAAW,QAClB,OAAOC,MAAO,SACd,OAAOC,MAAa,UCNpB,OAAS,QAAAC,MAAY,OACrB,OAAS,cAAAC,OAAkB,MAC3B,OAAOC,MAAS,WAChB,OAAOC,OAAO,SACd,OAAS,YAAAC,G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AQ,CAC9B,CACE,KAAM,QACN,KAAM,UACN,QAAS,kDACT,QAAS,EACX,CACF,CAAC,EACD,GAAI,CAACG,EACH,eAAQ,IAAI,YAAY,EACjB,QAAQ,KAAK,CAAC,CAEzB,CACAD,GAAI,cAAcP,EAAS,oBAAqBS,EAAUX,EAAM,YAAY,CAAQ,EAAG,OAAO,EAE9FY,EACE,GAAGP,EAAE,WAAWL,CAAK,CAAC,GACtB,GAAGK,EAAE,WAAWL,CAAK,CAAC,4BAA4BE,EAAS,mBAAmB,GAC9E,CAAE,IAAK,CAAE,MAAO,iBAAkB,CAAE,CACtC,CACF,CAAC,E5BpDH,QAAQ,GAAG,SAAU,IAAM,QAAQ,KAAK,CAAC,CAAC,EAC1C,QAAQ,GAAG,UAAW,IAAM,QAAQ,KAAK,CAAC,CAAC,EAC3C,QAAQ,GAAG,UAAW,IAAM,QAAQ,KAAK,CAAC,CAAC,EAE3C,IAAMW,GAAU,IAAIC,GAEpB,QAAQ,MAAM,EAEdC,EAAqB,WAAY,OAAW,CAAE,IAAK,CAAE,MAAO,SAAU,CAAE,CAAC,EACzE,QAAQ,IAAI,EAEZF,GACG,KAAK,UAAU,EACf,YAAY,6DAA6D,EACzE,QAAQG,CAAO,EACf,WAAWC,EAAI,EACf,WAAWC,EAAG,EACd,WAAWC,EAAK,EAChB,WAAWC,EAAY,EACvB,WAAWC,EAAW,EAEzBR,GAAQ,MAAM,QAAQ,IAAI","names":["Command","version","path","updateConfig","Command","consola","kleur","_","prompts","join","loadConfig","fse","_","loadFile","writeFile","addNuxtModule","prompts","UI_CONFIG_FILENAME","DEFAULT_CONFIG","DEFAULT_CONFIG_NUXT4","INIT_DEPS","INIT_DEV_DEPS","INIT_MODULES","PACKAGE_MANAGER_CHOICES","CSS_THEME_OPTIONS","fs","detectNuxtVersion","pkg","nuxtVer","kleur","prompts","initPrompts","nuxtVersion","response","prompts","CSS_THEME_OPTIONS","_","v","PACKAGE_MANAGER_CHOICES","kleur","currentDir","getUIConfig","options","configExists","fse","UI_CONFIG_FILENAME","uiConfig","nuxtVersion","detectNuxtVersion","DEFAULT_CONFIG_NUXT4","DEFAULT_CONFIG","initPrompts","npmrcExists","shouldWrite","confirmCreateNpmrc","prompts","loadConfig","_","createConfigPaths","ensureFileOrDir","pathValue","isDir","addModuleToConfig","modules","modulesArray","proxy","loadFile","join","m","addNuxtModule","writeFile","compareUIConfig","userConfig","getUIConfig","tempConfig","missingProperties","key","axios","dotenv","ora","fetchComponents","spinner","data","fs","fileExists","path","execa","_","ora","installPackages","packageManager","deps","devDeps","depsSpinner","prompts","installValidator","packageManager","validatorPackages","validator","prompts","installPackages","boxen","figlet","createFancyBoxMessage","title","description","options","box","figletFont","asciiTitle","boxMessage","printFancyBoxMessage","prompts","promptUserForComponents","all","allComponents","c","components","fs","path","writeFile","filePath","fileContent","fileExists","folderPath","path","fs","allComponents","currentDirectory","findComponent","name","c","safeWriteFile","targetPath","content","forceOverwrite","promptMessage","fileExists","overwrite","prompts","consola","kleur","path","writeFile","writeCategoryFiles","category","items","baseDir","item","runAddCommand","components","options","uiConfig","getUIConfig","compareUIConfig","_","fetchComponents","componentNames","response","promptUserForComponents","notFound","found","comp","dep","component","file","dirPath","filePath","newDir","addSonner","addDataTable","addModuleToConfig","deps","devDeps","installPackages","confirmInstall","installValidator","printFancyBoxMessage","instructions","i","add","Command","updateConfig","config","cfg","src","path","updateConfig","Command","fse","kleur","ora","CSS_START","CSS_END","createCSS","theme","themes","ZINC_THEME","SLATE_THEME","STONE_THEME","GRAY_THEME","NEUTRAL_THEME","RED_THEME","ROSE_THEME","ORANGE_THEME","GREEN_THEME","BLUE_THEME","YELLOW_THEME","VIOLET_THEME","TW_HELPER","join","$","fse","ora","prompts","PRETTIER_CONFIG","addPrettierConfig","cwd","format","prettierLocation","join","finalConfig","PRETTIER_CONFIG","fse","existingRaw","existingConfig","res","prompts","spinner","ora","$","join","builders","loadFile","writeFile","getDefaultExportOptions","addTailwindVitePlugin","CONFIG_PATH","cfg","defaultExport","i","fse","VS_CODE_RECOMMENDATIONS","VS_CODE_SETTINGS","merge","fse","mergeJsonFile","filePath","newData","currentData","merged","addVSCodeFiles","VS_CODE_FOLDER","fse","mergeJsonFile","VS_CODE_RECOMMENDATIONS","VS_CODE_SETTINGS","runInitCommand","options","uiConfig","getUIConfig","spinner","ora","updateConfig","config","mod","INIT_MODULES","projectName","path","i","relativeCssPath","tildePath","atPath","addTailwindVitePlugin","fse","createCSS","TW_HELPER","addVSCodeFiles","installPackages","INIT_DEPS","INIT_DEV_DEPS","addPrettierConfig","printFancyBoxMessage","kleur","init","Command","Command","prompts","addPrettier","Command","addPrettierConfig","printFancyBoxMessage","pkgManager","prompts","PACKAGE_MANAGER_CHOICES","installPackages","Command","execa","ora","prompts","join","fse","DEFINE_SHORTCUT","addShortcutFiles","cwd","userConfig","getUIConfig","composablesLocation","join","fse","DEFINE_SHORTCUT","addShortcuts","Command","addShortcutFiles","pkgManager","prompts","PACKAGE_MANAGER_CHOICES","spinner","ora","execa","printFancyBoxMessage","Command","fse","kleur","_","prompts","theme","Command","uiConfig","getUIConfig","compareUIConfig","_","kleur","prompts","CSS_THEME_OPTIONS","fse","force","createCSS","printFancyBoxMessage","program","Command","printFancyBoxMessage","version","init","add","theme","addShortcuts","addPrettier"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../package.json","../src/commands/add.ts","../src/utils/config.ts","../src/utils/constants.ts","../src/utils/detectNuxtVersion.ts","../src/utils/uiConfigPrompt.ts","../src/utils/compareUIConfig.ts","../src/utils/fetchComponents.ts","../src/utils/fileExists.ts","../src/utils/installPackages.ts","../src/utils/installValidator.ts","../src/utils/printFancyBoxMessage.ts","../src/utils/promptForComponents.ts","../src/utils/writeFile.ts","../src/commands/init.ts","../src/templates/css.ts","../src/templates/tw-helper.ts","../src/utils/addPrettierConfig.ts","../src/templates/prettier.ts","../src/utils/addTailwindVitePlugin.ts","../src/utils/addVSCodeFiles.ts","../src/templates/vs-code.ts","../src/utils/mergeJsonFile.ts","../src/commands/prettier.ts","../src/commands/shortcuts.ts","../src/utils/addShortcutFiles.ts","../src/templates/shortcuts.ts","../src/commands/theme.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\n\nimport { version } from \"../package.json\";\nimport { add } from \"./commands/add\";\nimport { init } from \"./commands/init\";\nimport { addPrettier } from \"./commands/prettier\";\nimport { addShortcuts } from \"./commands/shortcuts\";\nimport { theme } from \"./commands/theme\";\nimport { printFancyBoxMessage } from \"./utils/printFancyBoxMessage\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\nprocess.on(\"SIGTSTP\", () => process.exit(0));\n\nconst program = new Command();\n\nconsole.clear();\n\nprintFancyBoxMessage(\"UI Thing\", undefined, { box: { title: \"Welcome\" } });\nconsole.log();\n\nprogram\n .name(\"ui-thing\")\n .description(\"CLI for adding ui-thing components to your Nuxt application\")\n .version(version)\n .addCommand(init)\n .addCommand(add)\n .addCommand(theme)\n .addCommand(addShortcuts)\n .addCommand(addPrettier);\n\nprogram.parse(process.argv);\n","{\n \"name\": \"ui-thing\",\n \"version\": \"0.2.4\",\n \"description\": \"CLI used to add Nuxt components to a project\",\n \"keywords\": [\n \"cli\",\n \"ui\",\n \"thing\",\n \"nuxt\",\n \"reka-ui\",\n \"tailwindcss\",\n \"nuxtui\",\n \"shadcn-ui\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/BayBreezy/ui-thing-cli.git\"\n },\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Behon Baker\",\n \"email\": \"behon.baker@yahoo.com\",\n \"url\": \"https://behonbaker.com/\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"ui-thing\": \"dist/index.js\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"rm -rf dist coverage node_modules package-lock.json && npm install\",\n \"coverage\": \"vitest run --coverage\",\n \"dev\": \"tsup --watch\",\n \"format\": \"npx prettier --write .\",\n \"knip\": \"knip\",\n \"knip:fix\": \"knip --fix\",\n \"lint\": \"eslint src\",\n \"lint-staged\": \"lint-staged\",\n \"lint:fix\": \"eslint src --fix\",\n \"prepare\": \"husky\",\n \"release\": \"npm run build && npx changelogen@latest --release && npm publish && git push --follow-tags\",\n \"start\": \"node dist/index.js\",\n \"test\": \"vitest\"\n },\n \"lint-staged\": {\n \"*\": [\n \"npm run format\"\n ]\n },\n \"dependencies\": {\n \"axios\": \"^1.11.0\",\n \"boxen\": \"^8.0.1\",\n \"c12\": \"^3.2.0\",\n \"commander\": \"^14.0.0\",\n \"consola\": \"^3.4.2\",\n \"dotenv\": \"^17.2.2\",\n \"es-toolkit\": \"^1.39.10\",\n \"execa\": \"^9.6.0\",\n \"figlet\": \"^1.8.2\",\n \"fs-extra\": \"^11.3.1\",\n \"kleur\": \"^4.1.5\",\n \"lodash\": \"^4.17.21\",\n \"magicast\": \"^0.3.5\",\n \"ora\": \"^8.2.0\",\n \"prompts\": \"^2.4.2\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.35.0\",\n \"@ianvs/prettier-plugin-sort-imports\": \"^4.7.0\",\n \"@types/figlet\": \"^1.7.0\",\n \"@types/fs-extra\": \"^11.0.4\",\n \"@types/lodash\": \"^4.17.20\",\n \"@types/node\": \"^24.3.1\",\n \"@types/prompts\": \"^2.4.9\",\n \"@vitest/coverage-v8\": \"^3.2.4\",\n \"eslint\": \"^9.35.0\",\n \"globals\": \"^16.3.0\",\n \"husky\": \"^9.1.7\",\n \"jiti\": \"^2.5.1\",\n \"knip\": \"^5.63.1\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.42.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"node:path\";\nimport { updateConfig } from \"c12/update\";\nimport { Command } from \"commander\";\nimport { consola } from \"consola\";\nimport kleur from \"kleur\";\nimport _ from \"lodash\";\nimport prompts from \"prompts\";\n\nimport { AddCommand, Component } from \"../types\";\nimport { compareUIConfig } from \"../utils/compareUIConfig\";\nimport { addModuleToConfig, getUIConfig } from \"../utils/config\";\nimport { fetchComponents } from \"../utils/fetchComponents\";\nimport { fileExists } from \"../utils/fileExists\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { installValidator } from \"../utils/installValidator\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\nimport { promptUserForComponents } from \"../utils/promptForComponents\";\nimport { writeFile } from \"../utils/writeFile\";\n\nlet allComponents: Component[] = [];\nconst currentDirectory = process.cwd();\n\n/**\n * Finds a component definition by its name (case-insensitive).\n */\nconst findComponent = (name: string) =>\n allComponents.find((c) => c.value.toLowerCase() === name.toLowerCase());\n\n/**\n * Handles writing a file with overwrite checks.\n */\nasync function safeWriteFile(\n targetPath: string,\n content: string,\n forceOverwrite: boolean,\n promptMessage: string\n) {\n const exists = await fileExists(targetPath);\n\n if (exists && !forceOverwrite) {\n const { value: overwrite } = await prompts({\n type: \"confirm\",\n name: \"value\",\n message: promptMessage,\n initial: false,\n });\n if (!overwrite) {\n consola.info(`Skipped: ${kleur.cyan(path.basename(targetPath))}`);\n return false;\n }\n }\n\n await writeFile(targetPath, content);\n return true;\n}\n\n/**\n * Writes all files in a given category (utils, composables, plugins).\n */\nasync function writeCategoryFiles(\n category: string,\n items: Array<{ fileName: string; fileContent: string; dirPath?: string }>,\n baseDir: string,\n forceOverwrite: boolean\n) {\n for (const item of items) {\n const targetPath = path.join(currentDirectory, baseDir, item.fileName);\n await safeWriteFile(\n targetPath,\n item.fileContent,\n forceOverwrite,\n `The ${category} file ${kleur.bold(item.fileName)} already exists. Overwrite?`\n );\n }\n}\n\n/**\n * Main command logic for adding components.\n */\nconst runAddCommand = async (components: string[], options: AddCommand) => {\n // Step 1 — Load and verify UI config\n let uiConfig = await getUIConfig();\n if (!(await compareUIConfig())) {\n uiConfig = await getUIConfig({ force: true });\n }\n if (_.isEmpty(uiConfig)) {\n consola.info(\"Config file not set. Exiting...\");\n process.exit(0);\n }\n\n // Step 2 — Fetch all available components\n allComponents = await fetchComponents();\n\n // Step 3 — If no components were passed, prompt user to select them\n let componentNames = components;\n if (componentNames.length === 0) {\n const response = await promptUserForComponents(options.all, allComponents);\n if (!response || response.length === 0) {\n consola.info(\"No components selected. Exiting...\");\n process.exit(0);\n }\n componentNames = response;\n }\n\n // Step 4 — Validate component names\n const notFound = componentNames.filter((name) => !findComponent(name));\n if (notFound.length > 0) {\n consola.error(`Not found: ${kleur.bgRed(notFound.join(\", \"))}`);\n }\n\n // Step 5 — Collect found components and their dependencies\n const found: Component[] = componentNames\n .map((name) => findComponent(name))\n .filter(Boolean) as Component[];\n\n for (const comp of [...found]) {\n if (comp.components) {\n comp.components.forEach((dep) => {\n if (!found.find((c) => c.value === dep)) {\n found.push(findComponent(dep)!);\n }\n });\n }\n }\n\n // Step 6 — Write files for each component\n for (const component of found) {\n for (const file of component.files) {\n let dirPath = uiConfig.componentsLocation;\n let filePath = path.join(currentDirectory, dirPath, file.fileName);\n\n // Ask for custom location if not using default\n if (!uiConfig.useDefaultFilename) {\n const { value: newDir } = await prompts({\n type: \"text\",\n name: \"value\",\n message: `Where should we add the file ${kleur.cyan(file.fileName)}?`,\n initial: dirPath,\n });\n if (newDir) {\n dirPath = newDir;\n filePath = path.join(currentDirectory, dirPath, file.fileName);\n }\n }\n\n const fileWritten = await safeWriteFile(\n filePath,\n file.fileContent,\n uiConfig.force,\n `The file ${kleur.bold(file.fileName)} already exists. Overwrite?`\n );\n if (!fileWritten) continue;\n\n // Component-specific logic hooks\n if (component.value === \"vue-sonner\" || component.value === \"sonner\") await addSonner();\n if (component.value === \"datatable\") await addDataTable();\n\n // Write related files\n await writeCategoryFiles(\"utils\", component.utils, uiConfig.utilsLocation, uiConfig.force);\n await writeCategoryFiles(\n \"composables\",\n component.composables,\n uiConfig.composablesLocation,\n uiConfig.force\n );\n await writeCategoryFiles(\n \"plugins\",\n component.plugins,\n uiConfig.pluginsLocation ?? \"\",\n uiConfig.force\n );\n }\n }\n\n // Step 7 — Add Nuxt modules\n await addModuleToConfig(_.uniq(found.flatMap((c) => c.nuxtModules || [])));\n\n // Step 8 — Install dependencies if necessary\n const deps = _.uniq(found.flatMap((c) => c.deps || []));\n const devDeps = _.uniq(found.flatMap((c) => c.devDeps || []));\n if (deps.length > 0 || devDeps.length > 0) {\n if (options.all) {\n await installPackages(uiConfig.packageManager, deps, devDeps);\n } else {\n const { confirmInstall } = await prompts({\n type: \"confirm\",\n name: \"confirmInstall\",\n message: `Install packages: ${kleur.cyan([...deps, ...devDeps].join(\", \"))}?`,\n initial: true,\n });\n if (confirmInstall) {\n await installPackages(uiConfig.packageManager, deps, devDeps);\n }\n }\n }\n\n // Step 9 — Install validator if required\n if (found.some((c) => c.askValidator)) {\n await installValidator(uiConfig.packageManager);\n }\n\n // Step 10 — Success message & instructions\n printFancyBoxMessage(\n \"All Done!\",\n `Run the ${kleur.cyan(\"ui-thing@latest --help\")} command to learn more.\\n`,\n { box: { title: \"Components Added\" } }\n );\n\n const instructions = _.compact(found.flatMap((c) => c.instructions));\n if (instructions.length > 0) {\n console.log(\"\");\n console.log(kleur.bgCyan(\" Instructions \"));\n instructions.forEach((i) => console.log(`${kleur.cyan(\"-\")} ${i}`));\n }\n};\n\n/**\n * CLI Command Registration\n */\nexport const add = new Command()\n .name(\"add\")\n .command(\"add\")\n .description(\"Add a list of components to your project.\")\n .option(\"-a --all\", \"Add all components to your project.\", false)\n .argument(\"[componentNames...]\", \"Components that you want to add.\")\n .action(runAddCommand);\n\n/**\n * Component-specific setup helpers\n */\nasync function addSonner() {\n await updateConfig({\n configFile: \"nuxt.config\",\n cwd: currentDirectory,\n onUpdate(config: any) {\n config.imports ||= { imports: [] };\n if (!config.imports.imports.find((i: any) => i.from === \"vue-sonner\" && i.name === \"toast\")) {\n config.imports.imports.push({ from: \"vue-sonner\", name: \"toast\", as: \"useSonner\" });\n }\n },\n });\n}\n\nasync function addDataTable() {\n await updateConfig({\n configFile: \"nuxt.config\",\n cwd: currentDirectory,\n onUpdate(cfg: any) {\n cfg.app ||= { head: { script: [] } };\n const scripts = [\n \"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js\",\n ];\n scripts.forEach((src) => {\n if (!cfg.app.head.script.find((i: any) => i.src === src)) {\n cfg.app.head.script.push({ src, defer: true });\n }\n });\n },\n });\n}\n","import { join } from \"node:path\";\nimport { loadConfig } from \"c12\";\nimport fse from \"fs-extra\";\nimport _ from \"lodash\";\nimport { loadFile, writeFile } from \"magicast\";\nimport { addNuxtModule } from \"magicast/helpers\";\nimport prompts from \"prompts\";\n\nimport { InitOptions, UIConfig } from \"../types\";\nimport { DEFAULT_CONFIG, DEFAULT_CONFIG_NUXT4, UI_CONFIG_FILENAME } from \"./constants\";\nimport { detectNuxtVersion } from \"./detectNuxtVersion\";\nimport { initPrompts } from \"./uiConfigPrompt\";\n\nconst currentDir = process.cwd();\n\n/**\n * Creates or retrieves the UI Thing config.\n */\nexport const getUIConfig = async (options?: InitOptions): Promise<UIConfig> => {\n const configExists = fse.existsSync(UI_CONFIG_FILENAME);\n let uiConfig: UIConfig = {} as UIConfig;\n const nuxtVersion = Number(options?.nuxtVersion) || detectNuxtVersion();\n\n // Force creation or first-time setup\n if (!configExists || options?.force) {\n uiConfig = options?.yes\n ? nuxtVersion === 4\n ? DEFAULT_CONFIG_NUXT4\n : DEFAULT_CONFIG\n : await initPrompts(nuxtVersion);\n\n await fse.writeFile(UI_CONFIG_FILENAME, `export default ${JSON.stringify(uiConfig, null, 2)}`);\n\n // Handle pnpm special case\n if (uiConfig.packageManager === \"pnpm\") {\n const npmrcExists = fse.existsSync(\".npmrc\");\n let shouldWrite = true;\n\n if (npmrcExists) {\n const { confirmCreateNpmrc } = await prompts({\n type: \"confirm\",\n name: \"confirmCreateNpmrc\",\n message: \"A .npmrc file already exists. Overwrite it?\",\n initial: false,\n });\n shouldWrite = confirmCreateNpmrc;\n }\n\n if (shouldWrite) {\n await fse.writeFile(\".npmrc\", \"shamefully-hoist=true\\nstrict-peer-dependencies=false\\n\");\n }\n }\n } else {\n const data = await loadConfig<UIConfig>({\n configFile: UI_CONFIG_FILENAME.replace(\".ts\", \"\"),\n });\n uiConfig = data.config as UIConfig;\n }\n\n // Ensure valid config\n if (_.isEmpty(uiConfig)) return getUIConfig({ force: true });\n\n createConfigPaths(uiConfig);\n return uiConfig;\n};\n\n/**\n * Ensures all required paths exist for UI Thing.\n */\nconst createConfigPaths = (uiConfig: UIConfig) => {\n const ensureFileOrDir = (pathValue?: string, isDir = false) => {\n if (!pathValue) return;\n if (isDir) {\n fse.ensureDirSync(pathValue);\n } else {\n fse.ensureFileSync(pathValue);\n }\n };\n\n ensureFileOrDir(uiConfig.tailwindCSSLocation);\n ensureFileOrDir(uiConfig.pluginsLocation, true);\n ensureFileOrDir(uiConfig.componentsLocation, true);\n ensureFileOrDir(uiConfig.composablesLocation, true);\n ensureFileOrDir(uiConfig.utilsLocation, true);\n};\n\n/**\n * Adds one or multiple Nuxt modules to nuxt.config.ts safely.\n */\nexport const addModuleToConfig = async (modules: string[] | string) => {\n if (!modules) return;\n const modulesArray = typeof modules === \"string\" ? [modules] : modules;\n\n const proxy = await loadFile(join(currentDir, \"nuxt.config.ts\"));\n modulesArray.forEach((m) => addNuxtModule(proxy, m));\n await writeFile(proxy, join(currentDir, \"nuxt.config.ts\"));\n};\n","import { UIConfig } from \"../types\";\n\n/**\n * The filename of the UI Thing configuration file.\n */\nexport const UI_CONFIG_FILENAME = \"ui-thing.config.ts\";\n/**\n * The default UI Thing configuration.\n *\n * Used when Nuxt 3 is detected\n */\nexport const DEFAULT_CONFIG: UIConfig = {\n theme: \"zinc\",\n tailwindCSSLocation: \"assets/css/tailwind.css\",\n componentsLocation: \"components/Ui\",\n composablesLocation: \"composables\",\n pluginsLocation: \"plugins\",\n utilsLocation: \"utils\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"npm\",\n};\n\n/**\n * The default UI Thing configuration.\n *\n * Used when Nuxt 4 is detected\n */\nexport const DEFAULT_CONFIG_NUXT4: UIConfig = {\n theme: \"zinc\",\n tailwindCSSLocation: \"app/assets/css/tailwind.css\",\n componentsLocation: \"app/components/Ui\",\n composablesLocation: \"app/composables\",\n pluginsLocation: \"app/plugins\",\n utilsLocation: \"app/utils\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"npm\",\n};\n\n/**\n * The initial core dependencies\n */\nexport const INIT_DEPS = [\n \"tailwindcss\",\n \"motion-v\",\n \"@tailwindcss/vite\",\n \"reka-ui\",\n \"tailwind-variants\",\n \"tailwind-merge\",\n \"@nuxt/fonts\",\n \"@nuxtjs/color-mode\",\n \"@nuxt/icon\",\n \"@vueuse/nuxt\",\n \"@tailwindcss/forms\",\n];\n\n/**\n * The initial development dependencies\n */\nexport const INIT_DEV_DEPS = [\n \"typescript\",\n \"prettier-plugin-tailwindcss\",\n \"prettier\",\n \"@ianvs/prettier-plugin-sort-imports\",\n \"tw-animate-css\",\n];\n\n/**\n * Initial modules that are needed\n */\nexport const INIT_MODULES = [\n \"@nuxtjs/color-mode\",\n \"motion-v/nuxt\",\n \"@vueuse/nuxt\",\n \"@nuxt/icon\",\n \"@nuxt/fonts\",\n];\n\n/**\n * List of available package managers to chose from\n */\nexport const PACKAGE_MANAGER_CHOICES = [\n { title: \"Npm\", value: \"npm\" },\n { title: \"Yarn\", value: \"yarn\" },\n { title: \"Pnpm\", value: \"pnpm\" },\n { title: \"Bun\", value: \"bun\" },\n];\n\n/**\n * List of available CSS themes to choose from\n */\nexport const CSS_THEME_OPTIONS = [\n { title: \"Zinc\", value: \"zinc\" },\n { title: \"Slate\", value: \"slate\" },\n { title: \"Stone\", value: \"stone\" },\n { title: \"Gray\", value: \"gray\" },\n { title: \"Neutral\", value: \"neutral\" },\n { title: \"Red\", value: \"red\" },\n { title: \"Rose\", value: \"rose\" },\n { title: \"Orange\", value: \"orange\" },\n { title: \"Green\", value: \"green\" },\n { title: \"Blue\", value: \"blue\" },\n { title: \"Yellow\", value: \"yellow\" },\n { title: \"Violet\", value: \"violet\" },\n];\n","import fs from \"fs\";\n\n/**\n * Detect the Nuxt.js version from package.json.\n */\nexport function detectNuxtVersion() {\n try {\n const pkg = JSON.parse(fs.readFileSync(\"package.json\", \"utf-8\"));\n const nuxtVer = pkg.dependencies?.nuxt || pkg.devDependencies?.nuxt;\n if (nuxtVer) {\n // check if version is 4.x\n // check for all possible formats with a regex\n if (/^[~^>=<\\s]*4/.test(nuxtVer)) return 4;\n return 3;\n }\n } catch {\n return 4;\n }\n return 4;\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport kleur from \"kleur\";\nimport prompts from \"prompts\";\n\nimport { CSS_THEME_OPTIONS, PACKAGE_MANAGER_CHOICES } from \"./constants\";\n\n/**\n * Prompts the user for UI configuration values.\n */\nexport const initPrompts = async (nuxtVersion: number) => {\n const response = await prompts([\n {\n name: \"theme\",\n type: \"autocomplete\",\n message: \"Which theme do you want to start with?\",\n choices: CSS_THEME_OPTIONS,\n },\n {\n name: \"tailwindCSSLocation\",\n type: \"text\",\n message: \"Where is your tailwind.css file located?\",\n initial: (_, v) =>\n nuxtVersion == 3 ? \"assets/css/tailwind.css\" : \"app/assets/css/tailwind.css\",\n },\n {\n name: \"componentsLocation\",\n type: \"text\",\n message: \"Where should your components be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"components/Ui\" : \"app/components/Ui\"),\n },\n {\n name: \"composablesLocation\",\n type: \"text\",\n message: \"Where should your composables be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"composables\" : \"app/composables\"),\n },\n {\n name: \"pluginsLocation\",\n type: \"text\",\n message: \"Where should your plugins be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"plugins\" : \"app/plugins\"),\n },\n {\n name: \"utilsLocation\",\n type: \"text\",\n message: \"Where should your utils be stored?\",\n initial: (_, v) => (nuxtVersion == 3 ? \"utils\" : \"app/utils\"),\n },\n {\n name: \"force\",\n type: \"confirm\",\n message: \"Should we just replace component files if they already exist?\",\n initial: true,\n },\n {\n name: \"useDefaultFilename\",\n type: \"confirm\",\n message: \"Would you like to use the default filename when adding components?\",\n initial: true,\n },\n {\n name: \"packageManager\",\n type: \"select\",\n message: \"Which package manager do you use?\",\n choices: PACKAGE_MANAGER_CHOICES,\n },\n ]);\n\n if (!response || Object.keys(response).length < 9) {\n console.log(kleur.red(kleur.bold(\"Incomplete configuration submitted. Exiting...\")));\n return process.exit(0);\n }\n return response;\n};\n","import { UIConfig } from \"../types\";\nimport { getUIConfig } from \"./config\";\n\n/**\n * Compares the UI config with a temporary config to see if any properties are missing\n * @returns {boolean} - Returns true if all properties are present\n */\nexport const compareUIConfig = async () => {\n // Get ui config\n const userConfig: UIConfig = await getUIConfig();\n const tempConfig: UIConfig = {\n nuxtVersion: 3,\n theme: \"string\",\n tailwindCSSLocation: \"string\",\n componentsLocation: \"string\",\n composablesLocation: \"string\",\n utilsLocation: \"string\",\n force: true,\n useDefaultFilename: true,\n packageManager: \"string\",\n };\n\n const missingProperties: string[] = [];\n\n for (const key of Object.keys(tempConfig)) {\n if (userConfig[key as keyof UIConfig] === undefined) {\n missingProperties.push(key);\n }\n }\n\n if (missingProperties.length > 1) {\n return false;\n }\n return true;\n};\n","import axios from \"axios\";\nimport dotenv from \"dotenv\";\nimport ora from \"ora\";\n\nimport { Component } from \"../types\";\n\ndotenv.config();\n\n/**\n * Function used to fetch components from the API.\n */\nexport const fetchComponents = async () => {\n const spinner = ora(\"Fetching components...\").start();\n\n const { data } = await axios.get<Component[]>(\n process.env.COMPONENTS_API || \"https://uithing.com/api/components\"\n );\n spinner.succeed(\"Components fetched.\");\n\n return data;\n};\n","import fs from \"node:fs\";\n\nexport const fileExists = async (path: string) => {\n try {\n await fs.promises.access(path, fs.constants.F_OK || fs.constants.W_OK);\n return true;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return false;\n }\n};\n","import { execa } from \"execa\";\nimport _ from \"lodash\";\nimport ora from \"ora\";\n\nexport const installPackages = async (\n packageManager: string,\n deps?: string[] | string,\n devDeps?: string | string[]\n) => {\n if (typeof deps === \"string\") {\n deps = [deps];\n }\n if (typeof devDeps === \"string\") {\n devDeps = [devDeps];\n }\n\n const depsSpinner = ora(\"Installing dependencies...\").start();\n if (!_.isUndefined(deps) && !_.isEmpty(deps)) {\n await execa(packageManager, [packageManager === \"yarn\" ? \"add\" : \"install\", ...deps]);\n }\n depsSpinner.text = \"Installing dev dependencies...\";\n if (!_.isUndefined(devDeps) && !_.isEmpty(devDeps)) {\n await execa(packageManager, [packageManager === \"yarn\" ? \"add\" : \"install\", \"-D\", ...devDeps]);\n }\n\n // we should check to see if there is a postinstall script and run it\n depsSpinner.text = \"Running nuxt prepare...\";\n await execa`npx -y nuxt prepare`;\n\n depsSpinner.succeed(\"Installed dependencies!\");\n};\n","import prompts from \"prompts\";\n\nimport { installPackages } from \"./installPackages\";\n\nexport const installValidator = async (packageManager: string) => {\n // Depending on the selected validator, install the corresponding packages\n const validatorPackages = {\n yup: [\"yup\", \"@vee-validate/yup\"],\n zod: [\"zod\", \"@vee-validate/zod\"],\n joi: [\"joi\", \"@vee-validate/joi\"],\n valibot: [\"valibot\", \"@vee-validate/valibot\"],\n };\n\n const { validator }: { validator: keyof typeof validatorPackages } = await prompts({\n type: \"select\",\n name: \"validator\",\n message: \"Choose the validator package to use with Vee Validate: \",\n choices: [\n { title: \"Yup\", value: \"yup\" },\n { title: \"Zod\", value: \"zod\" },\n { title: \"Joi\", value: \"joi\" },\n { title: \"Valibot\", value: \"valibot\" },\n ],\n });\n if (!validator) {\n console.log(\"No validator package selected\");\n return;\n }\n console.log(`Selected ${validator} as the validator package`);\n\n if (validatorPackages[validator]) {\n await installPackages(packageManager, validatorPackages[validator]);\n }\n return validator;\n};\n","import boxen, { Options as BoxOptions } from \"boxen\";\nimport figlet from \"figlet\";\n\n/**\n * Extra configuration options for the fancy box.\n */\ninterface FancyBoxOptions {\n box?: BoxOptions; // Overrides for boxen (border style, color, etc.)\n figletFont?: figlet.Fonts; // Optional font name for ASCII art\n}\n\n/**\n * Creates the ASCII-art box as a string (pure function — does not log).\n * Useful for testing because it avoids side effects like console output.\n *\n * @param title - The main text to display in big ASCII font\n * @param description - Optional subtitle or extra info below the box\n * @param options - Styling and font configuration\n * @returns A fully formatted string with ASCII title inside a box\n */\nconst createFancyBoxMessage = (\n title: string,\n description?: string,\n options: FancyBoxOptions = {}\n): string => {\n const { box, figletFont } = options;\n\n // Generate the ASCII art title using figlet\n const asciiTitle = figlet.textSync(title, {\n font: figletFont || \"Standard\", // Default font if none provided\n });\n\n // Default box styling so all boxes look consistent\n const defaultBoxOptions: BoxOptions = {\n borderColor: \"greenBright\",\n padding: 1,\n borderStyle: \"round\",\n titleAlignment: \"center\",\n };\n\n // Wrap ASCII art in a decorative box\n const boxMessage = boxen(asciiTitle, {\n ...defaultBoxOptions, // Base styles\n ...box, // User overrides\n });\n\n // Append description if provided\n return description ? `${boxMessage}\\n${description}` : boxMessage;\n};\n\n/**\n * CLI-friendly helper that prints the fancy box directly to the terminal.\n * This simply calls `createFancyBoxMessage` and logs the result.\n *\n * @param title - The main title to display\n * @param description - Optional extra info under the box\n * @param options - Font and box customization\n */\nexport const printFancyBoxMessage = (\n title: string,\n description?: string,\n options?: FancyBoxOptions\n) => {\n console.log(\"\\n\" + createFancyBoxMessage(title, description, options));\n};\n","import prompts from \"prompts\";\n\nimport { Component } from \"../types\";\n\n/**\n * Prompts the user to select components to add.\n */\nexport const promptUserForComponents = async (\n all?: boolean,\n allComponents: Component[] = []\n): Promise<string[]> => {\n // If all is true, return all components\n if (all) return allComponents.map((c: Component) => c.value);\n const { components } = await prompts({\n type: \"autocompleteMultiselect\",\n name: \"components\",\n message: \"Select the components you want to add\",\n choices: allComponents.map((c: Component) => ({ title: c.name, value: c.value })),\n });\n return components;\n};\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { fileExists } from \"./fileExists\";\n\nexport const writeFile = async (filePath: string, fileContent: string) => {\n // check if the file exists\n const exists = await fileExists(filePath);\n // if it doesn't, create it\n if (!exists) {\n // if it doesn't, create it\n const folderPath = path.dirname(filePath);\n if (!fs.existsSync(folderPath)) {\n fs.mkdirSync(folderPath, { recursive: true });\n }\n }\n fs.writeFileSync(filePath, fileContent);\n};\n","import path from \"node:path\";\nimport { updateConfig } from \"c12/update\";\nimport { Command } from \"commander\";\nimport fse from \"fs-extra\";\nimport kleur from \"kleur\";\nimport ora from \"ora\";\n\nimport { createCSS } from \"../templates/css\";\nimport { TW_HELPER } from \"../templates/tw-helper\";\nimport { InitOptions, UIConfig } from \"../types\";\nimport { addPrettierConfig } from \"../utils/addPrettierConfig\";\nimport { addTailwindVitePlugin } from \"../utils/addTailwindVitePlugin\";\nimport { addVSCodeFiles } from \"../utils/addVSCodeFiles\";\nimport { getUIConfig } from \"../utils/config\";\nimport { INIT_DEPS, INIT_DEV_DEPS, INIT_MODULES } from \"../utils/constants\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Runs the initialization command.\n */\nconst runInitCommand = async (options: InitOptions) => {\n // Get or create the initial configuration file\n const uiConfig: UIConfig = await getUIConfig(options);\n const spinner = ora(\"Updating nuxt.config...\").start();\n // Get nuxt config\n await updateConfig({\n cwd: process.cwd(),\n configFile: \"nuxt.config\",\n async onUpdate(config: any) {\n // Create modules array if it does not exist\n if (!config.modules) config.modules = [];\n // Create imports object if it does not exist\n if (!config.imports) config.imports = { imports: [] };\n for (const mod of INIT_MODULES) {\n if (!config.modules.includes(mod)) {\n config.modules.push(mod);\n }\n }\n // Add color mode config to nuxt.config file\n if (!config.colorMode) {\n // get the name of the folder(project name)\n const projectName = path.basename(process.cwd());\n config.colorMode = { storageKey: `${projectName}-color-mode`, classSuffix: \"\" };\n }\n // Add icon config if not present\n if (!config.icon) {\n config.icon = {\n clientBundle: { scan: true, sizeLimitKb: 0 },\n mode: \"svg\",\n class: \"shrink-0\",\n fetchTimeout: 2000,\n serverBundle: \"local\",\n };\n }\n // Add `tv` auto-import to the config file if it does not exists\n if (\n !config.imports.imports.find((i: any) => i.from === \"tailwind-variants\" && i.name === \"tv\")\n ) {\n config.imports.imports.push({ from: \"tailwind-variants\", name: \"tv\" });\n }\n // Add `VariantProps` auto-import to the config file if it does not exists\n if (\n !config.imports.imports.find(\n (i: any) => i.from === \"tailwind-variants\" && i.name === \"VariantProps\"\n )\n ) {\n config.imports.imports.push({\n from: \"tailwind-variants\",\n name: \"VariantProps\",\n type: true,\n });\n }\n // Add css path to config\n config.css ||= [];\n\n const relativeCssPath = uiConfig.tailwindCSSLocation?.split(\"app/\")[1];\n const tildePath = `~/${relativeCssPath}`;\n const atPath = `@/${relativeCssPath}`;\n\n // Only add if neither alias is present\n if (!config.css.includes(tildePath) && !config.css.includes(atPath)) {\n config.css.push(tildePath);\n }\n },\n });\n await addTailwindVitePlugin();\n spinner.succeed(\"Updated nuxt.config!\");\n spinner.start(\"Adding initial Tailwind CSS file...\");\n fse.writeFileSync(\n uiConfig.tailwindCSSLocation,\n createCSS(uiConfig.theme.toUpperCase() as any),\n \"utf-8\"\n );\n spinner.succeed(\"Added initial Tailwind CSS file!\");\n spinner.start(\"Adding Autocomplete helper...\");\n // Add Autocomplete helper\n fse.writeFileSync(uiConfig.utilsLocation + \"/tw-helper.ts\", TW_HELPER, \"utf-8\");\n spinner.succeed(\"Added Autocomplete helper!\");\n spinner.start(\"Merging VS Code settings...\");\n // Add .vscode folder with recommendations & settings\n addVSCodeFiles();\n spinner.succeed(\"Merged VS Code settings!\");\n // Install deps\n await installPackages(uiConfig.packageManager, INIT_DEPS, INIT_DEV_DEPS);\n // Add prettier config\n await addPrettierConfig();\n printFancyBoxMessage(\n \"Initialized\",\n `Feel free to start adding components with the ${kleur.bgWhite(\" add \")} command.`,\n { box: { title: \"Complete\" } }\n );\n};\n\n/**\n * Command to initialize UI Thing in a Nuxt project.\n */\nexport const init = new Command()\n .command(\"init\")\n .name(\"init\")\n .summary(\"Initialize UI Thing in your Nuxt project.\")\n .description(\n `${kleur.bold(\"Initialize UI Thing in your Nuxt project.\")}\n\n ✅ Add tailwindcss to your project\n ✅ Update your nuxt.config file\n ✅ Add the necessary dependencies\n ✅ Create a ${kleur.bold(\"ui-thing.config\")} file with the default configuration`\n )\n .option(\"-f --force\", \"Overwrite config file if it exists.\", false)\n .option(\"-y --yes\", \"Skip prompts and use default values.\", false)\n .option(\"-n --nuxtVersion <number>\", \"Specify the Nuxt version you are using.\")\n .action(runInitCommand);\n","const CSS_START = `@import \"tailwindcss\";\n@import \"tw-animate-css\";\n\n@plugin \"@tailwindcss/forms\" {\n strategy: \"class\";\n}\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --font-sans: \"Inter\", ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\",\n \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono: \"Fira Code\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --font-display--font-feature-settings: \"cv02\", \"cv03\", \"cv04\", \"cv11\";\n\n --animate-shine: shine 3s ease-out infinite;\n --animate-gradient-flow: gradientFlow 10s ease 0s infinite normal none running;\n --animate-meteor: meteor 5s linear infinite;\n --animate-background-position-spin: background-position-spin 3000ms infinite alternate;\n --animate-grid: grid 15s linear infinite;\n\n @keyframes grid {\n 0% {\n transform: translateY(-50%);\n }\n 100% {\n transform: translateY(0);\n }\n }\n\n @keyframes shine {\n 0% {\n background-position: 200% 0;\n }\n 25%,\n 100% {\n background-position: -200% 0;\n }\n }\n\n @keyframes gradientFlow {\n 50% {\n background-position: 100% 50%;\n }\n 0%,\n 100% {\n background-position: 0% 50%;\n }\n }\n\n @keyframes meteor {\n 0% {\n transform: rotate(var(--angle)) translateX(0);\n opacity: 1;\n }\n 70% {\n opacity: 1;\n }\n 100% {\n transform: rotate(var(--angle)) translateX(-500px);\n opacity: 0;\n }\n }\n\n @keyframes background-position-spin {\n 0% {\n background-position: top center;\n }\n 100% {\n background-position: bottom center;\n }\n }\n}\n\n@theme inline {\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --color-card: var(--card);\n --color-card-foreground: var(--card-foreground);\n --color-popover: var(--popover);\n --color-popover-foreground: var(--popover-foreground);\n --color-primary: var(--primary);\n --color-primary-foreground: var(--primary-foreground);\n --color-secondary: var(--secondary);\n --color-secondary-foreground: var(--secondary-foreground);\n --color-muted: var(--muted);\n --color-muted-foreground: var(--muted-foreground);\n --color-accent: var(--accent);\n --color-accent-foreground: var(--accent-foreground);\n --color-destructive: var(--destructive);\n --color-destructive-foreground: var(--destructive-foreground);\n --color-border: var(--border);\n --color-input: var(--input);\n --color-ring: var(--ring);\n\n --color-sidebar-background: var(--sidebar-background);\n --color-sidebar-foreground: var(--sidebar-foreground);\n --color-sidebar-primary: var(--sidebar-primary);\n --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);\n --color-sidebar-accent: var(--sidebar-accent);\n --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);\n --color-sidebar-border: var(--sidebar-border);\n --color-sidebar-ring: var(--sidebar-ring);\n --color-sidebar-input: var(--sidebar-input);\n\n --color-gradient-lime: var(--gradient-lime);\n --color-gradient-ocean: var(--gradient-ocean);\n --color-gradient-wine: var(--gradient-wine);\n --color-gradient-rust: var(--gradient-rust);\n}\n\n:root {\n /* Gradient slide show Colors */\n --gradient-lime: oklch(67.287% 0.1546 116.644);\n --gradient-ocean: oklch(44.56% 0.10114 242.813);\n --gradient-wine: oklch(32.332% 0.12034 5.266);\n --gradient-rust: oklch(55.695% 0.19944 34.155);\n}\n \n`;\n\nconst CSS_END = `@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n * {\n scrollbar-width: thin;\n scrollbar-color: var(--border) transparent;\n }\n html {\n @apply antialiased;\n }\n body {\n @apply bg-background text-foreground;\n }\n ::-webkit-scrollbar {\n width: 4px;\n }\n ::-webkit-scrollbar-track {\n background: transparent;\n }\n ::-webkit-scrollbar-thumb {\n background: var(--border);\n border-radius: 4px;\n }\n button:not(:disabled),\n [role=\"button\"]:not(:disabled) {\n cursor: pointer;\n }\n}\n`;\n\nexport const createCSS = (theme: keyof typeof themes) => {\n // if them is not in themes, set them to ZINC\n if (!themes[theme]) {\n theme = \"ZINC\";\n }\n return `${CSS_START}${themes[theme]}${CSS_END}`;\n};\n\nexport const ZINC_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.922 0 0);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.205 0 0);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.269 0 0);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.556 0 0);\n}\n\n`;\nconst SLATE_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.129 0.042 264.695);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.129 0.042 264.695);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.129 0.042 264.695);\n --primary: oklch(0.208 0.042 265.755);\n --primary-foreground: oklch(0.984 0.003 247.858);\n --secondary: oklch(0.968 0.007 247.896);\n --secondary-foreground: oklch(0.208 0.042 265.755);\n --muted: oklch(0.968 0.007 247.896);\n --muted-foreground: oklch(0.554 0.046 257.417);\n --accent: oklch(0.968 0.007 247.896);\n --accent-foreground: oklch(0.208 0.042 265.755);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.929 0.013 255.508);\n --input: oklch(0.929 0.013 255.508);\n --ring: oklch(0.704 0.04 256.788);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.984 0.003 247.858);\n --sidebar-foreground: oklch(0.129 0.042 264.695);\n --sidebar-primary: oklch(0.208 0.042 265.755);\n --sidebar-primary-foreground: oklch(0.984 0.003 247.858);\n --sidebar-accent: oklch(0.968 0.007 247.896);\n --sidebar-accent-foreground: oklch(0.208 0.042 265.755);\n --sidebar-border: oklch(0.929 0.013 255.508);\n --sidebar-ring: oklch(0.704 0.04 256.788);\n}\n\n.dark {\n --background: oklch(0.129 0.042 264.695);\n --foreground: oklch(0.984 0.003 247.858);\n --card: oklch(0.208 0.042 265.755);\n --card-foreground: oklch(0.984 0.003 247.858);\n --popover: oklch(0.208 0.042 265.755);\n --popover-foreground: oklch(0.984 0.003 247.858);\n --primary: oklch(0.929 0.013 255.508);\n --primary-foreground: oklch(0.208 0.042 265.755);\n --secondary: oklch(0.279 0.041 260.031);\n --secondary-foreground: oklch(0.984 0.003 247.858);\n --muted: oklch(0.279 0.041 260.031);\n --muted-foreground: oklch(0.704 0.04 256.788);\n --accent: oklch(0.279 0.041 260.031);\n --accent-foreground: oklch(0.984 0.003 247.858);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.551 0.027 264.364);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.208 0.042 265.755);\n --sidebar-foreground: oklch(0.984 0.003 247.858);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.984 0.003 247.858);\n --sidebar-accent: oklch(0.279 0.041 260.031);\n --sidebar-accent-foreground: oklch(0.984 0.003 247.858);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.551 0.027 264.364);\n}\n\n`;\n\nconst STONE_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.147 0.004 49.25);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.147 0.004 49.25);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.147 0.004 49.25);\n --primary: oklch(0.216 0.006 56.043);\n --primary-foreground: oklch(0.985 0.001 106.423);\n --secondary: oklch(0.97 0.001 106.424);\n --secondary-foreground: oklch(0.216 0.006 56.043);\n --muted: oklch(0.97 0.001 106.424);\n --muted-foreground: oklch(0.553 0.013 58.071);\n --accent: oklch(0.97 0.001 106.424);\n --accent-foreground: oklch(0.216 0.006 56.043);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.923 0.003 48.717);\n --input: oklch(0.923 0.003 48.717);\n --ring: oklch(0.709 0.01 56.259);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0.001 106.423);\n --sidebar-foreground: oklch(0.147 0.004 49.25);\n --sidebar-primary: oklch(0.216 0.006 56.043);\n --sidebar-primary-foreground: oklch(0.985 0.001 106.423);\n --sidebar-accent: oklch(0.97 0.001 106.424);\n --sidebar-accent-foreground: oklch(0.216 0.006 56.043);\n --sidebar-border: oklch(0.923 0.003 48.717);\n --sidebar-ring: oklch(0.709 0.01 56.259);\n}\n.dark {\n --background: oklch(0.147 0.004 49.25);\n --foreground: oklch(0.985 0.001 106.423);\n --card: oklch(0.216 0.006 56.043);\n --card-foreground: oklch(0.985 0.001 106.423);\n --popover: oklch(0.216 0.006 56.043);\n --popover-foreground: oklch(0.985 0.001 106.423);\n --primary: oklch(0.923 0.003 48.717);\n --primary-foreground: oklch(0.216 0.006 56.043);\n --secondary: oklch(0.268 0.007 34.298);\n --secondary-foreground: oklch(0.985 0.001 106.423);\n --muted: oklch(0.268 0.007 34.298);\n --muted-foreground: oklch(0.709 0.01 56.259);\n --accent: oklch(0.268 0.007 34.298);\n --accent-foreground: oklch(0.985 0.001 106.423);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.553 0.013 58.071);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.216 0.006 56.043);\n --sidebar-foreground: oklch(0.985 0.001 106.423);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0.001 106.423);\n --sidebar-accent: oklch(0.268 0.007 34.298);\n --sidebar-accent-foreground: oklch(0.985 0.001 106.423);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.553 0.013 58.071);\n}\n\n`;\n\nconst GRAY_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.13 0.028 261.692);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.13 0.028 261.692);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.13 0.028 261.692);\n --primary: oklch(0.21 0.034 264.665);\n --primary-foreground: oklch(0.985 0.002 247.839);\n --secondary: oklch(0.967 0.003 264.542);\n --secondary-foreground: oklch(0.21 0.034 264.665);\n --muted: oklch(0.967 0.003 264.542);\n --muted-foreground: oklch(0.551 0.027 264.364);\n --accent: oklch(0.967 0.003 264.542);\n --accent-foreground: oklch(0.21 0.034 264.665);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.928 0.006 264.531);\n --input: oklch(0.928 0.006 264.531);\n --ring: oklch(0.707 0.022 261.325);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0.002 247.839);\n --sidebar-foreground: oklch(0.13 0.028 261.692);\n --sidebar-primary: oklch(0.21 0.034 264.665);\n --sidebar-primary-foreground: oklch(0.985 0.002 247.839);\n --sidebar-accent: oklch(0.967 0.003 264.542);\n --sidebar-accent-foreground: oklch(0.21 0.034 264.665);\n --sidebar-border: oklch(0.928 0.006 264.531);\n --sidebar-ring: oklch(0.707 0.022 261.325);\n}\n\n.dark {\n --background: oklch(0.13 0.028 261.692);\n --foreground: oklch(0.985 0.002 247.839);\n --card: oklch(0.21 0.034 264.665);\n --card-foreground: oklch(0.985 0.002 247.839);\n --popover: oklch(0.21 0.034 264.665);\n --popover-foreground: oklch(0.985 0.002 247.839);\n --primary: oklch(0.928 0.006 264.531);\n --primary-foreground: oklch(0.21 0.034 264.665);\n --secondary: oklch(0.278 0.033 256.848);\n --secondary-foreground: oklch(0.985 0.002 247.839);\n --muted: oklch(0.278 0.033 256.848);\n --muted-foreground: oklch(0.707 0.022 261.325);\n --accent: oklch(0.278 0.033 256.848);\n --accent-foreground: oklch(0.985 0.002 247.839);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.551 0.027 264.364);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.034 264.665);\n --sidebar-foreground: oklch(0.985 0.002 247.839);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0.002 247.839);\n --sidebar-accent: oklch(0.278 0.033 256.848);\n --sidebar-accent-foreground: oklch(0.985 0.002 247.839);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.551 0.027 264.364);\n}\n\n`;\n\nconst NEUTRAL_THEME = `\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.922 0 0);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.205 0 0);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.488 0.243 264.376);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.269 0 0);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.556 0 0);\n}\n\n`;\n\nconst RED_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.637 0.237 25.331);\n --primary-foreground: oklch(0.971 0.013 17.38);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.637 0.237 25.331);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.637 0.237 25.331);\n --sidebar-primary-foreground: oklch(0.971 0.013 17.38);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.637 0.237 25.331);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.637 0.237 25.331);\n --primary-foreground: oklch(0.971 0.013 17.38);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.637 0.237 25.331);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.637 0.237 25.331);\n --sidebar-primary-foreground: oklch(0.971 0.013 17.38);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.637 0.237 25.331);\n}\n\n`;\n\nconst ROSE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.645 0.246 16.439);\n --primary-foreground: oklch(0.969 0.015 12.422);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.645 0.246 16.439);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.645 0.246 16.439);\n --sidebar-primary-foreground: oklch(0.969 0.015 12.422);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.645 0.246 16.439);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.645 0.246 16.439);\n --primary-foreground: oklch(0.969 0.015 12.422);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.645 0.246 16.439);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.645 0.246 16.439);\n --sidebar-primary-foreground: oklch(0.969 0.015 12.422);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.645 0.246 16.439);\n}\n\n`;\n\nconst ORANGE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.705 0.213 47.604);\n --primary-foreground: oklch(0.98 0.016 73.684);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.705 0.213 47.604);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.705 0.213 47.604);\n --sidebar-primary-foreground: oklch(0.98 0.016 73.684);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.705 0.213 47.604);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.646 0.222 41.116);\n --primary-foreground: oklch(0.98 0.016 73.684);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.646 0.222 41.116);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.646 0.222 41.116);\n --sidebar-primary-foreground: oklch(0.98 0.016 73.684);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.646 0.222 41.116);\n}\n\n`;\n\nconst GREEN_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.723 0.219 149.579);\n --primary-foreground: oklch(0.982 0.018 155.826);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.723 0.219 149.579);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.723 0.219 149.579);\n --sidebar-primary-foreground: oklch(0.982 0.018 155.826);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.723 0.219 149.579);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.696 0.17 162.48);\n --primary-foreground: oklch(0.393 0.095 152.535);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.527 0.154 150.069);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.696 0.17 162.48);\n --sidebar-primary-foreground: oklch(0.393 0.095 152.535);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.527 0.154 150.069);\n}\n\n`;\n\nexport const BLUE_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.623 0.214 259.815);\n --primary-foreground: oklch(0.97 0.014 254.604);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.623 0.214 259.815);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.623 0.214 259.815);\n --sidebar-primary-foreground: oklch(0.97 0.014 254.604);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.623 0.214 259.815);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.546 0.245 262.881);\n --primary-foreground: oklch(0.379 0.146 265.522);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.488 0.243 264.376);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.546 0.245 262.881);\n --sidebar-primary-foreground: oklch(0.379 0.146 265.522);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.488 0.243 264.376);\n}\n\n`;\n\nconst YELLOW_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.795 0.184 86.047);\n --primary-foreground: oklch(0.421 0.095 57.708);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.795 0.184 86.047);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.795 0.184 86.047);\n --sidebar-primary-foreground: oklch(0.421 0.095 57.708);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.795 0.184 86.047);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.795 0.184 86.047);\n --primary-foreground: oklch(0.421 0.095 57.708);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.554 0.135 66.442);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.795 0.184 86.047);\n --sidebar-primary-foreground: oklch(0.421 0.095 57.708);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.554 0.135 66.442);\n}\n\n`;\n\nconst VIOLET_THEME = `\n:root {\n --radius: 0.65rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.141 0.005 285.823);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.141 0.005 285.823);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.141 0.005 285.823);\n --primary: oklch(0.606 0.25 292.717);\n --primary-foreground: oklch(0.969 0.016 293.756);\n --secondary: oklch(0.967 0.001 286.375);\n --secondary-foreground: oklch(0.21 0.006 285.885);\n --muted: oklch(0.967 0.001 286.375);\n --muted-foreground: oklch(0.552 0.016 285.938);\n --accent: oklch(0.967 0.001 286.375);\n --accent-foreground: oklch(0.21 0.006 285.885);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.92 0.004 286.32);\n --input: oklch(0.92 0.004 286.32);\n --ring: oklch(0.606 0.25 292.717);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.141 0.005 285.823);\n --sidebar-primary: oklch(0.606 0.25 292.717);\n --sidebar-primary-foreground: oklch(0.969 0.016 293.756);\n --sidebar-accent: oklch(0.967 0.001 286.375);\n --sidebar-accent-foreground: oklch(0.21 0.006 285.885);\n --sidebar-border: oklch(0.92 0.004 286.32);\n --sidebar-ring: oklch(0.606 0.25 292.717);\n}\n\n.dark {\n --background: oklch(0.141 0.005 285.823);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.21 0.006 285.885);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.21 0.006 285.885);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(0.541 0.281 293.009);\n --primary-foreground: oklch(0.969 0.016 293.756);\n --secondary: oklch(0.274 0.006 286.033);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.274 0.006 286.033);\n --muted-foreground: oklch(0.705 0.015 286.067);\n --accent: oklch(0.274 0.006 286.033);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.541 0.281 293.009);\n --chart-1: oklch(0.488 0.243 264.376);\n --chart-2: oklch(0.696 0.17 162.48);\n --chart-3: oklch(0.769 0.188 70.08);\n --chart-4: oklch(0.627 0.265 303.9);\n --chart-5: oklch(0.645 0.246 16.439);\n --sidebar: oklch(0.21 0.006 285.885);\n --sidebar-foreground: oklch(0.985 0 0);\n --sidebar-primary: oklch(0.541 0.281 293.009);\n --sidebar-primary-foreground: oklch(0.969 0.016 293.756);\n --sidebar-accent: oklch(0.274 0.006 286.033);\n --sidebar-accent-foreground: oklch(0.985 0 0);\n --sidebar-border: oklch(1 0 0 / 10%);\n --sidebar-ring: oklch(0.541 0.281 293.009);\n}\n\n`;\nconst themes = {\n ZINC: ZINC_THEME,\n SLATE: SLATE_THEME,\n STONE: STONE_THEME,\n GRAY: GRAY_THEME,\n NEUTRAL: NEUTRAL_THEME,\n RED: RED_THEME,\n ROSE: ROSE_THEME,\n ORANGE: ORANGE_THEME,\n GREEN: GREEN_THEME,\n BLUE: BLUE_THEME,\n YELLOW: YELLOW_THEME,\n VIOLET: VIOLET_THEME,\n};\n","/**\n * Helper function used to get auto complete suggestions for Tailwind CSS classes.\n */\nexport const TW_HELPER = `/**\n * Utility function to return Tailwind CSS classes.\n */\nexport const tw = <T extends TemplateStringsArray | string>(tailwindClasses: T) => tailwindClasses;\n`;\n","import { join } from \"node:path\";\nimport { $ } from \"execa\";\nimport fse from \"fs-extra\";\nimport ora from \"ora\";\nimport prompts from \"prompts\";\n\nimport { PRETTIER_CONFIG } from \"../templates/prettier\";\n\n/**\n * Adds or merges a Prettier configuration into the project.\n *\n * - If `.prettierrc` doesn't exist, creates it with `PRETTIER_CONFIG`.\n * - If it exists, merges keys instead of overwriting, unless user chooses overwrite.\n *\n * @param cwd - The working directory of the project.\n * @param format - Whether to run `prettier --write .` after adding/merging.\n */\nexport const addPrettierConfig = async (cwd = process.cwd(), format: boolean = true) => {\n const prettierLocation = join(cwd, \".prettierrc\");\n let finalConfig = PRETTIER_CONFIG;\n\n if (fse.existsSync(prettierLocation)) {\n // Read existing config\n const existingRaw = await fse.readFile(prettierLocation, \"utf-8\");\n let existingConfig: Record<string, any> = {};\n\n try {\n existingConfig = JSON.parse(existingRaw);\n } catch {\n console.warn(\"⚠️ Existing .prettierrc is not valid JSON — will prompt for overwrite.\");\n }\n\n const res = await prompts({\n name: \"merge\",\n type: \"select\",\n message: \"A prettier config file already exists. What would you like to do?\",\n choices: [\n { title: \"Merge configs\", value: \"merge\" },\n { title: \"Overwrite with new config\", value: \"overwrite\" },\n { title: \"Cancel\", value: \"cancel\" },\n ],\n initial: 0,\n });\n\n if (res.merge === \"merge\") {\n // Merge existing config with PRETTIER_CONFIG\n finalConfig = {\n ...existingConfig,\n ...PRETTIER_CONFIG,\n };\n } else if (res.merge === \"overwrite\") {\n finalConfig = PRETTIER_CONFIG;\n } else {\n return false; // Cancelled\n }\n }\n\n // Save merged or new config\n await fse.writeFile(prettierLocation, JSON.stringify(finalConfig, null, 2), \"utf-8\");\n\n if (!format) return true;\n\n // Format project files\n const spinner = ora(\"Formatting files with prettier...\").start();\n await $`npx prettier --write .`;\n spinner.succeed(\"Files formatted with prettier\");\n\n return true;\n};\n","export const PRETTIER_CONFIG = {\n arrowParens: \"always\",\n endOfLine: \"lf\",\n plugins: [\"@ianvs/prettier-plugin-sort-imports\", \"prettier-plugin-tailwindcss\"],\n printWidth: 100,\n semi: true,\n singleQuote: false,\n tabWidth: 2,\n trailingComma: \"es5\",\n useTabs: false,\n vueIndentScriptAndStyle: true,\n tailwindFunctions: [\"tv\"],\n importOrder: [\"<BUILTIN_MODULES>\", \"<THIRD_PARTY_MODULES>\", \"<TYPES>\", \"\", \"^[.]\"],\n};\n","import { join } from \"node:path\";\nimport { builders, loadFile, writeFile } from \"magicast\";\nimport { getDefaultExportOptions } from \"magicast/helpers\";\n\n/**\n * Adds the Tailwind CSS Vite plugin to the Nuxt config.\n */\nexport const addTailwindVitePlugin = async () => {\n // Get the path to nuxt config\n const CONFIG_PATH = join(process.cwd(), \"nuxt.config.ts\");\n // Load the nuxt config file\n const cfg = await loadFile(CONFIG_PATH);\n // check if `tailwindcss()` is already present in the code\n\n if (!cfg.$code.includes(\"tailwindcss()\")) {\n // get the exported config object\n const defaultExport = getDefaultExportOptions(cfg);\n // ensure vite and plugins are defined\n defaultExport.vite ||= {};\n defaultExport.vite.plugins ||= [];\n // push the function to the plugins array\n defaultExport.vite.plugins.push(builders.functionCall(\"tailwindcss\"));\n }\n // check if tailwind plugin is already imported\n if (!cfg.imports.$items.find((i) => i.local === \"tailwindcss\")) {\n // prepend the import for tailwindcss\n cfg.imports.$prepend({\n from: \"@tailwindcss/vite\",\n local: \"tailwindcss\",\n imported: \"default\",\n });\n }\n // write the changes to the `nuxt.config.ts` file\n await writeFile(cfg, CONFIG_PATH);\n};\n","import fse from \"fs-extra\";\n\nimport { VS_CODE_RECOMMENDATIONS, VS_CODE_SETTINGS } from \"../templates/vs-code\";\nimport { mergeJsonFile } from \"./mergeJsonFile\";\n\n/**\n * Adds the necessary VS Code configuration files.\n */\nexport const addVSCodeFiles = (VS_CODE_FOLDER = \".vscode\") => {\n fse.ensureDirSync(VS_CODE_FOLDER);\n mergeJsonFile(`${VS_CODE_FOLDER}/extensions.json`, VS_CODE_RECOMMENDATIONS);\n mergeJsonFile(`${VS_CODE_FOLDER}/settings.json`, VS_CODE_SETTINGS);\n};\n","/**\n * VS Code extensions recommendations for Tailwind CSS development.\n */\nexport const VS_CODE_RECOMMENDATIONS = {\n recommendations: [\n \"vue.volar\",\n \"bradlc.vscode-tailwindcss\",\n \"esbenp.prettier-vscode\",\n \"antfu.iconify\",\n \"formulahendry.auto-close-tag\",\n \"formulahendry.auto-rename-tag\",\n ],\n};\n\n/**\n * VS Code settings for Tailwind CSS development.\n */\nexport const VS_CODE_SETTINGS = {\n \"editor.formatOnSave\": true,\n \"editor.quickSuggestions\": { strings: \"on\" },\n \"files.associations\": { \"*.css\": \"tailwindcss\" },\n \"tailwindCSS.classFunctions\": [\"tw\", \"clsx\", \"tw\\\\.[a-z-]+\"],\n \"tailwindCSS.experimental.classRegex\": [[\"([\\\"'`][^\\\"'`]*.*?[\\\"'`])\", \"[\\\"'`]([^\\\"'`]*)[\\\"'`]\"]],\n};\n","import { merge } from \"es-toolkit\";\nimport fse from \"fs-extra\";\n\n/**\n * Merges JSON data into a file without overwriting existing keys.\n * Creates the file if it does not exist.\n *\n * @param filePath - Path to the JSON file to update.\n * @param newData - The new JSON data to merge in.\n */\nexport function mergeJsonFile(filePath: string, newData: Record<string, any>) {\n let currentData: Record<string, any> = {};\n\n // Read current JSON if it exists\n if (fse.existsSync(filePath)) {\n try {\n currentData = fse.readJsonSync(filePath);\n } catch {\n console.warn(`⚠️ Could not parse ${filePath}, starting fresh.`);\n }\n }\n\n // Merge existing and new data\n const merged = merge(currentData, newData);\n\n // Write merged JSON with pretty formatting\n fse.writeJsonSync(filePath, merged, { spaces: 2 });\n}\n","import { Command } from \"commander\";\nimport prompts from \"prompts\";\n\nimport { addPrettierConfig } from \"../utils/addPrettierConfig\";\nimport { PACKAGE_MANAGER_CHOICES } from \"../utils/constants\";\nimport { installPackages } from \"../utils/installPackages\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\nexport const addPrettier = new Command()\n .command(\"prettier\")\n .name(\"prettier\")\n .description(\"Adds prettier config to your project.\")\n .action(async () => {\n const added = await addPrettierConfig(undefined, false);\n if (!added) {\n printFancyBoxMessage(\"Not Added\", `Prettier config was not added.`, {\n box: { title: \"Prettier Not Added\", borderColor: \"red\" },\n });\n return;\n }\n\n const { pkgManager } = await prompts({\n name: \"pkgManager\",\n type: \"select\",\n message: \"Which package manager are you using?\",\n choices: PACKAGE_MANAGER_CHOICES,\n });\n if (!pkgManager) return process.exit(0);\n\n // install prettier dep\n await installPackages(pkgManager, undefined, [\n \"prettier\",\n \"prettier-plugin-tailwindcss\",\n \"@ianvs/prettier-plugin-sort-imports\",\n ]);\n printFancyBoxMessage(\n \"All Done!\",\n `A .prettierrc file has been added to your project and the code formatted. Enjoy!`,\n { box: { title: \"Prettier Added\" } }\n );\n });\n","import { Command } from \"commander\";\nimport { execa } from \"execa\";\nimport ora from \"ora\";\nimport prompts from \"prompts\";\n\nimport { addShortcutFiles } from \"../utils/addShortcutFiles\";\nimport { PACKAGE_MANAGER_CHOICES } from \"../utils/constants\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Adds the shortcuts composables to the project.\n */\nexport const addShortcuts = new Command()\n .command(\"shortcuts\")\n .name(\"shortcuts\")\n .description(\"Add the shortcuts composables to your project.\")\n .action(async () => {\n await addShortcutFiles();\n\n const { pkgManager } = await prompts({\n name: \"pkgManager\",\n type: \"select\",\n message: \"Which package manager are you using?\",\n choices: PACKAGE_MANAGER_CHOICES,\n });\n if (!pkgManager) return process.exit(0);\n\n const spinner = ora(\"Installing vueuse module...\").start();\n // install vueuse for nuxt\n await execa`npx -y nuxi@latest module add vueuse`;\n spinner.succeed(\"VueUse module installed successfully!\");\n\n printFancyBoxMessage(\n \"All Done!\",\n `Check the composables folder for the shortcuts composables.`,\n { box: { title: \"Composable Added\" } }\n );\n });\n","import { join } from \"node:path\";\nimport fse from \"fs-extra\";\n\nimport { DEFINE_SHORTCUT } from \"../templates/shortcuts\";\nimport { UIConfig } from \"../types\";\nimport { getUIConfig } from \"./config\";\n\n/**\n * Adds shortcut files to the specified directory.\n */\nexport const addShortcutFiles = async (cwd = process.cwd()) => {\n // get config\n const userConfig: UIConfig = await getUIConfig();\n const composablesLocation = join(cwd, userConfig.composablesLocation);\n // ensure that the composable folder exists\n await fse.ensureDir(composablesLocation);\n // write the defineShortcuts composable\n await fse.writeFile(join(composablesLocation, \"shortcuts.ts\"), DEFINE_SHORTCUT, \"utf-8\");\n};\n","export const DEFINE_SHORTCUT = `import {\n createSharedComposable,\n useActiveElement,\n useDebounceFn,\n useEventListener,\n} from \"@vueuse/core\";\nimport type { MaybeRef } from \"vue\";\n\ntype KbdKeysSpecificMap = {\n meta: string;\n alt: string;\n ctrl: string;\n};\n\nexport const kbdKeysMap = {\n meta: \"\",\n ctrl: \"\",\n alt: \"\",\n win: \"⊞\",\n command: \"⌘\",\n shift: \"⇧\",\n control: \"⌃\",\n option: \"⌥\",\n enter: \"↵\",\n delete: \"⌦\",\n backspace: \"⌫\",\n escape: \"⎋\",\n tab: \"⇥\",\n capslock: \"⇪\",\n arrowup: \"↑\",\n arrowright: \"→\",\n arrowdown: \"↓\",\n arrowleft: \"←\",\n pageup: \"⇞\",\n pagedown: \"⇟\",\n home: \"↖\",\n end: \"↘\",\n};\n\nexport type KbdKey = keyof typeof kbdKeysMap;\nexport type KbdKeySpecific = keyof KbdKeysSpecificMap;\n\nconst _useKbd = () => {\n const macOS = computed(\n () =>\n import.meta.client &&\n navigator &&\n navigator.userAgent &&\n navigator.userAgent.match(/Macintosh;/)\n );\n\n const kbdKeysSpecificMap = reactive({\n meta: \" \",\n alt: \" \",\n ctrl: \" \",\n });\n\n onMounted(() => {\n kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : \"Ctrl\";\n kbdKeysSpecificMap.ctrl = macOS.value ? kbdKeysMap.control : \"Ctrl\";\n kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : \"Alt\";\n });\n\n function getKbdKey(value?: KbdKey | string) {\n if (!value) {\n return;\n }\n\n if ([\"meta\", \"alt\", \"ctrl\"].includes(value)) {\n return kbdKeysSpecificMap[value as KbdKeySpecific];\n }\n\n return kbdKeysMap[value as KbdKey] || value.toUpperCase();\n }\n\n return {\n macOS,\n getKbdKey,\n };\n};\n\nexport const useKbd = /* @__PURE__ */ createSharedComposable(_useKbd);\n\ntype Handler = (e?: any) => void;\n\nexport interface ShortcutConfig {\n handler: Handler;\n usingInput?: string | boolean;\n}\n\nexport interface ShortcutsConfig {\n [key: string]: ShortcutConfig | Handler | false | null | undefined;\n}\n\nexport interface ShortcutsOptions {\n chainDelay?: number;\n}\n\ninterface Shortcut {\n handler: Handler;\n enabled: boolean;\n chained: boolean;\n // KeyboardEvent attributes\n key: string;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n // code?: string\n // keyCode?: number\n}\n\nconst chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;\nconst combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;\n// keyboard keys which can be combined with Shift modifier (in addition to alphabet keys)\nconst shiftableKeys = [\n \"arrowleft\",\n \"arrowright\",\n \"arrowup\",\n \"arrowright\",\n \"tab\",\n \"escape\",\n \"enter\",\n \"backspace\",\n];\n\nexport function extractShortcuts(items: any[] | any[][]) {\n const shortcuts: Record<string, Handler> = {};\n\n function traverse(items: any[]) {\n items.forEach((item) => {\n if (item.kbds?.length && (item.onSelect || item.onClick)) {\n const shortcutKey = item.kbds.join(\"_\");\n shortcuts[shortcutKey] = item.onSelect || item.onClick;\n }\n if (item.children) {\n traverse(item.children.flat());\n }\n if (item.items) {\n traverse(item.items.flat());\n }\n });\n }\n\n traverse(items.flat());\n\n return shortcuts;\n}\n\nexport function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: ShortcutsOptions = {}) {\n const chainedInputs = ref<string[]>([]);\n const clearChainedInput = () => {\n chainedInputs.value.splice(0, chainedInputs.value.length);\n };\n const debouncedClearChainedInput = useDebounceFn(clearChainedInput, options.chainDelay ?? 800);\n\n const { macOS } = useKbd();\n const activeElement = useActiveElement();\n\n const onKeyDown = (e: KeyboardEvent) => {\n // Input autocomplete triggers a keydown event\n if (!e.key) {\n return;\n }\n\n const alphabetKey = /^[a-z]{1}$/i.test(e.key);\n const shiftableKey = shiftableKeys.includes(e.key.toLowerCase());\n\n let chainedKey;\n chainedInputs.value.push(e.key);\n // try matching a chained shortcut\n if (chainedInputs.value.length >= 2) {\n chainedKey = chainedInputs.value.slice(-2).join(\"-\");\n\n for (const shortcut of shortcuts.value.filter((s) => s.chained)) {\n if (shortcut.key !== chainedKey) {\n continue;\n }\n\n if (shortcut.enabled) {\n e.preventDefault();\n shortcut.handler(e);\n }\n clearChainedInput();\n return;\n }\n }\n\n // try matching a standard shortcut\n for (const shortcut of shortcuts.value.filter((s) => !s.chained)) {\n if (e.key.toLowerCase() !== shortcut.key) {\n continue;\n }\n if (e.metaKey !== shortcut.metaKey) {\n continue;\n }\n if (e.ctrlKey !== shortcut.ctrlKey) {\n continue;\n }\n // shift modifier is only checked in combination with alphabet keys and some extra keys\n // (shift with special characters would change the key)\n if ((alphabetKey || shiftableKey) && e.shiftKey !== shortcut.shiftKey) {\n continue;\n }\n // alt modifier changes the combined key anyways\n // if (e.altKey !== shortcut.altKey) { continue }\n\n if (shortcut.enabled) {\n e.preventDefault();\n shortcut.handler(e);\n }\n clearChainedInput();\n return;\n }\n\n debouncedClearChainedInput();\n };\n\n const usingInput = computed(() => {\n const tagName = activeElement.value?.tagName;\n const contentEditable = activeElement.value?.contentEditable;\n\n const usingInput = !!(\n tagName === \"INPUT\" ||\n tagName === \"TEXTAREA\" ||\n contentEditable === \"true\" ||\n contentEditable === \"plaintext-only\"\n );\n\n if (usingInput) {\n return ((activeElement.value as any)?.name as string) || true;\n }\n\n return false;\n });\n\n // Map config to full detailed shortcuts\n const shortcuts = computed<Shortcut[]>(() => {\n return Object.entries(toValue(config))\n .map(([key, shortcutConfig]) => {\n if (!shortcutConfig) {\n return null;\n }\n\n // Parse key and modifiers\n let shortcut: Partial<Shortcut>;\n\n if (\n key.includes(\"-\") &&\n key !== \"-\" &&\n !key.includes(\"_\") &&\n !key.match(chainedShortcutRegex)?.length\n ) {\n console.trace(\\`[Shortcut] Invalid key: \"\\${key}\"\\`);\n }\n\n if (key.includes(\"_\") && key !== \"_\" && !key.match(combinedShortcutRegex)?.length) {\n console.trace(\\`[Shortcut] Invalid key: \"\\${key}\"\\`);\n }\n\n const chained = key.includes(\"-\") && key !== \"-\" && !key.includes(\"_\");\n if (chained) {\n shortcut = {\n key: key.toLowerCase(),\n metaKey: false,\n ctrlKey: false,\n shiftKey: false,\n altKey: false,\n };\n } else {\n const keySplit = key\n .toLowerCase()\n .split(\"_\")\n .map((k) => k);\n shortcut = {\n key: keySplit\n .filter((k) => ![\"meta\", \"command\", \"ctrl\", \"shift\", \"alt\", \"option\"].includes(k))\n .join(\"_\"),\n metaKey: keySplit.includes(\"meta\") || keySplit.includes(\"command\"),\n ctrlKey: keySplit.includes(\"ctrl\"),\n shiftKey: keySplit.includes(\"shift\"),\n altKey: keySplit.includes(\"alt\") || keySplit.includes(\"option\"),\n };\n }\n shortcut.chained = chained;\n\n // Convert Meta to Ctrl for non-MacOS\n if (!macOS.value && shortcut.metaKey && !shortcut.ctrlKey) {\n shortcut.metaKey = false;\n shortcut.ctrlKey = true;\n }\n\n // Retrieve handler function\n if (typeof shortcutConfig === \"function\") {\n shortcut.handler = shortcutConfig;\n } else if (typeof shortcutConfig === \"object\") {\n shortcut = { ...shortcut, handler: shortcutConfig.handler };\n }\n\n if (!shortcut.handler) {\n console.trace(\"[Shortcut] Invalid value\");\n return null;\n }\n\n let enabled = true;\n if (!(shortcutConfig as ShortcutConfig).usingInput) {\n enabled = !usingInput.value;\n } else if (typeof (shortcutConfig as ShortcutConfig).usingInput === \"string\") {\n enabled = usingInput.value === (shortcutConfig as ShortcutConfig).usingInput;\n }\n shortcut.enabled = enabled;\n\n return shortcut;\n })\n .filter(Boolean) as Shortcut[];\n });\n\n return useEventListener(\"keydown\", onKeyDown);\n}\n\n`;\n","import { Command } from \"commander\";\nimport fse from \"fs-extra\";\nimport kleur from \"kleur\";\nimport _ from \"lodash\";\nimport prompts from \"prompts\";\n\nimport { createCSS } from \"../templates/css\";\nimport { compareUIConfig } from \"../utils/compareUIConfig\";\nimport { getUIConfig } from \"../utils/config\";\nimport { CSS_THEME_OPTIONS } from \"../utils/constants\";\nimport { printFancyBoxMessage } from \"../utils/printFancyBoxMessage\";\n\n/**\n * Validates if a theme name exists in the predefined options.\n */\nconst validateThemeName = (name: string) => {\n return CSS_THEME_OPTIONS.some((option) => option.value === name?.toLowerCase());\n};\n\n/**\n * Adds a new theme to the project.\n */\nexport const theme = new Command()\n .command(\"theme\")\n .name(\"theme\")\n .description(\"Add a new theme to your project.\")\n .argument(\"[themeName]\", \"The name of the theme you would like to add\")\n .action(async (themeName?: string) => {\n // Get ui config\n let uiConfig = await getUIConfig();\n const uiConfigIsCorrect = await compareUIConfig();\n if (!uiConfigIsCorrect) {\n uiConfig = await getUIConfig({ force: true });\n }\n if (_.isEmpty(uiConfig)) {\n console.log(kleur.red(\"Config file not set. Exiting...\"));\n process.exit(0);\n }\n\n let selectedTheme =\n themeName && validateThemeName(themeName) ? themeName.toLowerCase() : undefined;\n\n if (!selectedTheme) {\n // Prompt for theme if not provided or invalid\n const { theme } = await prompts([\n {\n name: \"theme\",\n type: \"autocomplete\",\n message: \"Which theme do you want to add?\",\n choices: CSS_THEME_OPTIONS,\n },\n ]);\n if (!theme) {\n console.log(kleur.red(\"No theme selected. Exiting...\"));\n process.exit(0);\n }\n selectedTheme = theme;\n }\n\n // Check if the file exists\n if (fse.existsSync(uiConfig.tailwindCSSLocation)) {\n const { force } = await prompts([\n {\n name: \"force\",\n type: \"confirm\",\n message: \"The Tailwind CSS file already exists. Overwrite?\",\n initial: false,\n },\n ]);\n if (!force) {\n console.log(\"Exiting...\");\n return process.exit(0);\n }\n }\n\n fse.writeFileSync(\n uiConfig.tailwindCSSLocation,\n createCSS(selectedTheme!.toUpperCase() as any),\n \"utf-8\"\n );\n\n printFancyBoxMessage(\n `${_.capitalize(selectedTheme!)}`,\n `${_.capitalize(selectedTheme!)} theme has been added to ${uiConfig.tailwindCSSLocation}`,\n { box: { title: \"New Theme Added\" } }\n );\n });\n"],"mappings":";AACA,OAAS,WAAAA,OAAe,YCCtB,IAAAC,EAAW,QCFb,OAAOC,MAAU,OACjB,OAAS,gBAAAC,OAAoB,aAC7B,OAAS,WAAAC,OAAe,YACxB,OAAS,WAAAC,MAAe,UACxB,OAAOC,MAAW,QAClB,OAAOC,MAAO,SACd,OAAOC,MAAa,UCNpB,OAAS,QAAAC,MAAY,OACrB,OAAS,cAAAC,OAAkB,MAC3B,OAAOC,MAAS,WAChB,OAAOC,OAAO,SACd,OAAS,YAAAC,GAAU,aAAAC,OAAiB,WACpC,OAAS,iBAAAC,OAAqB,mBAC9B,OAAOC,OAAa,UCDb,IAAMC,EAAqB,qBAMrBC,EAA2B,CACtC,MAAO,OACP,oBAAqB,0BACrB,mBAAoB,gBACpB,oBAAqB,cACrB,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,GAAM,CAAE,MAAAQ,CAAM,EAAI,MAAMF,GAAQ,CAC9B,CACE,KAAM,QACN,KAAM,UACN,QAAS,mDACT,QAAS,EACX,CACF,CAAC,EACD,GAAI,CAACE,EACH,eAAQ,IAAI,YAAY,EACjB,QAAQ,KAAK,CAAC,CAEzB,CAEAD,GAAI,cACFP,EAAS,oBACTS,EAAUJ,EAAe,YAAY,CAAQ,EAC7C,OACF,EAEAK,EACE,GAAGP,EAAE,WAAWE,CAAc,CAAC,GAC/B,GAAGF,EAAE,WAAWE,CAAc,CAAC,4BAA4BL,EAAS,mBAAmB,GACvF,CAAE,IAAK,CAAE,MAAO,iBAAkB,CAAE,CACtC,CACF,CAAC,E5B3EH,QAAQ,GAAG,SAAU,IAAM,QAAQ,KAAK,CAAC,CAAC,EAC1C,QAAQ,GAAG,UAAW,IAAM,QAAQ,KAAK,CAAC,CAAC,EAC3C,QAAQ,GAAG,UAAW,IAAM,QAAQ,KAAK,CAAC,CAAC,EAE3C,IAAMW,GAAU,IAAIC,GAEpB,QAAQ,MAAM,EAEdC,EAAqB,WAAY,OAAW,CAAE,IAAK,CAAE,MAAO,SAAU,CAAE,CAAC,EACzE,QAAQ,IAAI,EAEZF,GACG,KAAK,UAAU,EACf,YAAY,6DAA6D,EACzE,QAAQG,CAAO,EACf,WAAWC,EAAI,EACf,WAAWC,EAAG,EACd,WAAWC,EAAK,EAChB,WAAWC,EAAY,EACvB,WAAWC,EAAW,EAEzBR,GAAQ,MAAM,QAAQ,IAAI","names":["Command","version","path","updateConfig","Command","consola","kleur","_","prompts","join","loadConfig","fse","_","loadFile","writeFile","addNuxtModule","prompts","UI_CONFIG_FILENAME","DEFAULT_CONFIG","DEFAULT_CONFIG_NUXT4","INIT_DEPS","INIT_DEV_DEPS","INIT_MODULES","PACKAGE_MANAGER_CHOICES","CSS_THEME_OPTIONS","fs","detectNuxtVersion","pkg","nuxtVer","kleur","prompts","initPrompts","nuxtVersion","response","prompts","CSS_THEME_OPTIONS","_","v","PACKAGE_MANAGER_CHOICES","kleur","currentDir","getUIConfig","options","configExists","fse","UI_CONFIG_FILENAME","uiConfig","nuxtVersion","detectNuxtVersion","DEFAULT_CONFIG_NUXT4","DEFAULT_CONFIG","initPrompts","npmrcExists","shouldWrite","confirmCreateNpmrc","prompts","loadConfig","_","createConfigPaths","ensureFileOrDir","pathValue","isDir","addModuleToConfig","modules","modulesArray","proxy","loadFile","join","m","addNuxtModule","writeFile","compareUIConfig","userConfig","getUIConfig","tempConfig","missingProperties","key","axios","dotenv","ora","fetchComponents","spinner","data","fs","fileExists","path","execa","_","ora","installPackages","packageManager","deps","devDeps","depsSpinner","prompts","installValidator","packageManager","validatorPackages","validator","prompts","installPackages","boxen","figlet","createFancyBoxMessage","title","description","options","box","figletFont","asciiTitle","boxMessage","printFancyBoxMessage","prompts","promptUserForComponents","all","allComponents","c","components","fs","path","writeFile","filePath","fileContent","fileExists","folderPath","path","fs","allComponents","currentDirectory","findComponent","name","c","safeWriteFile","targetPath","content","forceOverwrite","promptMessage","fileExists","overwrite","prompts","consola","kleur","path","writeFile","writeCategoryFiles","category","items","baseDir","item","runAddCommand","components","options","uiConfig","getUIConfig","compareUIConfig","_","fetchComponents","componentNames","response","promptUserForComponents","notFound","found","comp","dep","component","file","dirPath","filePath","newDir","addSonner","addDataTable","addModuleToConfig","deps","devDeps","installPackages","confirmInstall","installValidator","printFancyBoxMessage","instructions","i","add","Command","updateConfig","config","cfg","src","path","updateConfig","Command","fse","kleur","ora","CSS_START","CSS_END","createCSS","theme","themes","ZINC_THEME","SLATE_THEME","STONE_THEME","GRAY_THEME","NEUTRAL_THEME","RED_THEME","ROSE_THEME","ORANGE_THEME","GREEN_THEME","BLUE_THEME","YELLOW_THEME","VIOLET_THEME","TW_HELPER","join","$","fse","ora","prompts","PRETTIER_CONFIG","addPrettierConfig","cwd","format","prettierLocation","join","finalConfig","PRETTIER_CONFIG","fse","existingRaw","existingConfig","res","prompts","spinner","ora","$","join","builders","loadFile","writeFile","getDefaultExportOptions","addTailwindVitePlugin","CONFIG_PATH","cfg","defaultExport","i","fse","VS_CODE_RECOMMENDATIONS","VS_CODE_SETTINGS","merge","fse","mergeJsonFile","filePath","newData","currentData","merged","addVSCodeFiles","VS_CODE_FOLDER","fse","mergeJsonFile","VS_CODE_RECOMMENDATIONS","VS_CODE_SETTINGS","runInitCommand","options","uiConfig","getUIConfig","spinner","ora","updateConfig","config","mod","INIT_MODULES","projectName","path","relativeCssPath","tildePath","atPath","addTailwindVitePlugin","fse","createCSS","TW_HELPER","addVSCodeFiles","installPackages","INIT_DEPS","INIT_DEV_DEPS","addPrettierConfig","printFancyBoxMessage","kleur","init","Command","Command","prompts","addPrettier","Command","addPrettierConfig","printFancyBoxMessage","pkgManager","prompts","PACKAGE_MANAGER_CHOICES","installPackages","Command","execa","ora","prompts","join","fse","DEFINE_SHORTCUT","addShortcutFiles","cwd","userConfig","getUIConfig","composablesLocation","join","fse","DEFINE_SHORTCUT","addShortcuts","Command","addShortcutFiles","pkgManager","prompts","PACKAGE_MANAGER_CHOICES","spinner","ora","execa","printFancyBoxMessage","Command","fse","kleur","_","prompts","validateThemeName","name","CSS_THEME_OPTIONS","option","theme","Command","themeName","uiConfig","getUIConfig","compareUIConfig","_","kleur","selectedTheme","prompts","fse","force","createCSS","printFancyBoxMessage","program","Command","printFancyBoxMessage","version","init","add","theme","addShortcuts","addPrettier"]}
|
package/eslint.config.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
|
|
6
|
+
export default defineConfig([
|
|
7
|
+
{
|
|
8
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
|
|
9
|
+
plugins: { js },
|
|
10
|
+
extends: ["js/recommended"],
|
|
11
|
+
languageOptions: { globals: globals.node },
|
|
12
|
+
},
|
|
13
|
+
tseslint.configs.recommended,
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui-thing",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "CLI used to add Nuxt components to a project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"shadcn-ui"
|
|
14
14
|
],
|
|
15
15
|
"repository": {
|
|
16
|
+
"type": "git",
|
|
16
17
|
"url": "git+https://github.com/BayBreezy/ui-thing-cli.git"
|
|
17
18
|
},
|
|
18
19
|
"license": "MIT",
|
|
@@ -35,7 +36,9 @@
|
|
|
35
36
|
"format": "npx prettier --write .",
|
|
36
37
|
"knip": "knip",
|
|
37
38
|
"knip:fix": "knip --fix",
|
|
39
|
+
"lint": "eslint src",
|
|
38
40
|
"lint-staged": "lint-staged",
|
|
41
|
+
"lint:fix": "eslint src --fix",
|
|
39
42
|
"prepare": "husky",
|
|
40
43
|
"release": "npm run build && npx changelogen@latest --release && npm publish && git push --follow-tags",
|
|
41
44
|
"start": "node dist/index.js",
|
|
@@ -52,8 +55,8 @@
|
|
|
52
55
|
"c12": "^3.2.0",
|
|
53
56
|
"commander": "^14.0.0",
|
|
54
57
|
"consola": "^3.4.2",
|
|
55
|
-
"dotenv": "^17.2.
|
|
56
|
-
"es-toolkit": "^1.39.
|
|
58
|
+
"dotenv": "^17.2.2",
|
|
59
|
+
"es-toolkit": "^1.39.10",
|
|
57
60
|
"execa": "^9.6.0",
|
|
58
61
|
"figlet": "^1.8.2",
|
|
59
62
|
"fs-extra": "^11.3.1",
|
|
@@ -64,19 +67,24 @@
|
|
|
64
67
|
"prompts": "^2.4.2"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
67
|
-
"@
|
|
70
|
+
"@eslint/js": "^9.35.0",
|
|
71
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
68
72
|
"@types/figlet": "^1.7.0",
|
|
69
73
|
"@types/fs-extra": "^11.0.4",
|
|
70
74
|
"@types/lodash": "^4.17.20",
|
|
71
|
-
"@types/node": "^24.
|
|
75
|
+
"@types/node": "^24.3.1",
|
|
72
76
|
"@types/prompts": "^2.4.9",
|
|
73
77
|
"@vitest/coverage-v8": "^3.2.4",
|
|
78
|
+
"eslint": "^9.35.0",
|
|
79
|
+
"globals": "^16.3.0",
|
|
74
80
|
"husky": "^9.1.7",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
81
|
+
"jiti": "^2.5.1",
|
|
82
|
+
"knip": "^5.63.1",
|
|
83
|
+
"lint-staged": "^16.1.6",
|
|
77
84
|
"prettier": "^3.6.2",
|
|
78
85
|
"tsup": "^8.5.0",
|
|
79
86
|
"typescript": "^5.9.2",
|
|
87
|
+
"typescript-eslint": "^8.42.0",
|
|
80
88
|
"vitest": "^3.2.4"
|
|
81
89
|
},
|
|
82
90
|
"publishConfig": {
|
package/src/commands/add.ts
CHANGED
|
@@ -109,7 +109,7 @@ const runAddCommand = async (components: string[], options: AddCommand) => {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Step 5 — Collect found components and their dependencies
|
|
112
|
-
|
|
112
|
+
const found: Component[] = componentNames
|
|
113
113
|
.map((name) => findComponent(name))
|
|
114
114
|
.filter(Boolean) as Component[];
|
|
115
115
|
|
package/src/commands/init.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { printFancyBoxMessage } from "../utils/printFancyBoxMessage";
|
|
|
21
21
|
*/
|
|
22
22
|
const runInitCommand = async (options: InitOptions) => {
|
|
23
23
|
// Get or create the initial configuration file
|
|
24
|
-
|
|
24
|
+
const uiConfig: UIConfig = await getUIConfig(options);
|
|
25
25
|
const spinner = ora("Updating nuxt.config...").start();
|
|
26
26
|
// Get nuxt config
|
|
27
27
|
await updateConfig({
|
package/src/commands/theme.ts
CHANGED
|
@@ -10,6 +10,13 @@ import { getUIConfig } from "../utils/config";
|
|
|
10
10
|
import { CSS_THEME_OPTIONS } from "../utils/constants";
|
|
11
11
|
import { printFancyBoxMessage } from "../utils/printFancyBoxMessage";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Validates if a theme name exists in the predefined options.
|
|
15
|
+
*/
|
|
16
|
+
const validateThemeName = (name: string) => {
|
|
17
|
+
return CSS_THEME_OPTIONS.some((option) => option.value === name?.toLowerCase());
|
|
18
|
+
};
|
|
19
|
+
|
|
13
20
|
/**
|
|
14
21
|
* Adds a new theme to the project.
|
|
15
22
|
*/
|
|
@@ -17,10 +24,11 @@ export const theme = new Command()
|
|
|
17
24
|
.command("theme")
|
|
18
25
|
.name("theme")
|
|
19
26
|
.description("Add a new theme to your project.")
|
|
20
|
-
.
|
|
27
|
+
.argument("[themeName]", "The name of the theme you would like to add")
|
|
28
|
+
.action(async (themeName?: string) => {
|
|
21
29
|
// Get ui config
|
|
22
30
|
let uiConfig = await getUIConfig();
|
|
23
|
-
|
|
31
|
+
const uiConfigIsCorrect = await compareUIConfig();
|
|
24
32
|
if (!uiConfigIsCorrect) {
|
|
25
33
|
uiConfig = await getUIConfig({ force: true });
|
|
26
34
|
}
|
|
@@ -28,25 +36,35 @@ export const theme = new Command()
|
|
|
28
36
|
console.log(kleur.red("Config file not set. Exiting..."));
|
|
29
37
|
process.exit(0);
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
|
|
40
|
+
let selectedTheme =
|
|
41
|
+
themeName && validateThemeName(themeName) ? themeName.toLowerCase() : undefined;
|
|
42
|
+
|
|
43
|
+
if (!selectedTheme) {
|
|
44
|
+
// Prompt for theme if not provided or invalid
|
|
45
|
+
const { theme } = await prompts([
|
|
46
|
+
{
|
|
47
|
+
name: "theme",
|
|
48
|
+
type: "autocomplete",
|
|
49
|
+
message: "Which theme do you want to add?",
|
|
50
|
+
choices: CSS_THEME_OPTIONS,
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
if (!theme) {
|
|
54
|
+
console.log(kleur.red("No theme selected. Exiting..."));
|
|
55
|
+
process.exit(0);
|
|
56
|
+
}
|
|
57
|
+
selectedTheme = theme;
|
|
42
58
|
}
|
|
59
|
+
|
|
60
|
+
// Check if the file exists
|
|
43
61
|
if (fse.existsSync(uiConfig.tailwindCSSLocation)) {
|
|
44
62
|
const { force } = await prompts([
|
|
45
63
|
{
|
|
46
64
|
name: "force",
|
|
47
65
|
type: "confirm",
|
|
48
|
-
message: "
|
|
49
|
-
initial:
|
|
66
|
+
message: "The Tailwind CSS file already exists. Overwrite?",
|
|
67
|
+
initial: false,
|
|
50
68
|
},
|
|
51
69
|
]);
|
|
52
70
|
if (!force) {
|
|
@@ -54,11 +72,16 @@ export const theme = new Command()
|
|
|
54
72
|
return process.exit(0);
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
|
-
|
|
75
|
+
|
|
76
|
+
fse.writeFileSync(
|
|
77
|
+
uiConfig.tailwindCSSLocation,
|
|
78
|
+
createCSS(selectedTheme!.toUpperCase() as any),
|
|
79
|
+
"utf-8"
|
|
80
|
+
);
|
|
58
81
|
|
|
59
82
|
printFancyBoxMessage(
|
|
60
|
-
`${_.capitalize(
|
|
61
|
-
`${_.capitalize(
|
|
83
|
+
`${_.capitalize(selectedTheme!)}`,
|
|
84
|
+
`${_.capitalize(selectedTheme!)} theme has been added to ${uiConfig.tailwindCSSLocation}`,
|
|
62
85
|
{ box: { title: "New Theme Added" } }
|
|
63
86
|
);
|
|
64
87
|
});
|
|
@@ -10,7 +10,7 @@ import { getUIConfig } from "./config";
|
|
|
10
10
|
*/
|
|
11
11
|
export const addShortcutFiles = async (cwd = process.cwd()) => {
|
|
12
12
|
// get config
|
|
13
|
-
|
|
13
|
+
const userConfig: UIConfig = await getUIConfig();
|
|
14
14
|
const composablesLocation = join(cwd, userConfig.composablesLocation);
|
|
15
15
|
// ensure that the composable folder exists
|
|
16
16
|
await fse.ensureDir(composablesLocation);
|
|
@@ -7,7 +7,7 @@ import { getUIConfig } from "./config";
|
|
|
7
7
|
*/
|
|
8
8
|
export const compareUIConfig = async () => {
|
|
9
9
|
// Get ui config
|
|
10
|
-
|
|
10
|
+
const userConfig: UIConfig = await getUIConfig();
|
|
11
11
|
const tempConfig: UIConfig = {
|
|
12
12
|
nuxtVersion: 3,
|
|
13
13
|
theme: "string",
|
package/src/utils/config.ts
CHANGED
|
@@ -70,7 +70,11 @@ export const getUIConfig = async (options?: InitOptions): Promise<UIConfig> => {
|
|
|
70
70
|
const createConfigPaths = (uiConfig: UIConfig) => {
|
|
71
71
|
const ensureFileOrDir = (pathValue?: string, isDir = false) => {
|
|
72
72
|
if (!pathValue) return;
|
|
73
|
-
|
|
73
|
+
if (isDir) {
|
|
74
|
+
fse.ensureDirSync(pathValue);
|
|
75
|
+
} else {
|
|
76
|
+
fse.ensureFileSync(pathValue);
|
|
77
|
+
}
|
|
74
78
|
};
|
|
75
79
|
|
|
76
80
|
ensureFileOrDir(uiConfig.tailwindCSSLocation);
|
package/src/utils/fileExists.ts
CHANGED