lovdacn 0.0.3 → 1.0.0-beta.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/README.md CHANGED
@@ -1,72 +1,15 @@
1
- # lovdacn
1
+ # lovda
2
2
 
3
- > ⚠️ **Beta.** The CLI is under active development. APIs and components may change.
3
+ To install dependencies:
4
4
 
5
- `lovdacn` is the CLI for **lovdaCN** — premium, responsive, customizable UI components for
6
- **Expo & React Native**, built for Tailwind-based styling systems (**NativeWind** and **Uniwind**).
7
-
8
- Inspired by `shadcn/ui`: components are copied into your codebase, so you own the code and can
9
- customize everything.
10
-
11
- ## Usage
12
-
13
- You don't need to install anything — run it with your package manager's runner.
14
-
15
- ### Initialize a project
16
-
17
- Sets up configuration (`lvcn.json`), theme, and the required files.
18
-
19
- ```sh
20
- npx lovdacn@latest init
21
- # pnpm
22
- pnpm dlx lovdacn@latest init
23
- # bun
24
- bunx lovdacn@latest init
5
+ ```bash
6
+ bun install
25
7
  ```
26
8
 
27
- During beta you can also pin the beta tag explicitly:
28
-
29
- ```sh
30
- npx lovdacn@beta init
31
- ```
32
-
33
- > `lvcn` is a shorthand alias for the same CLI, e.g. `npx lvcn@latest init`.
34
-
35
- ### Add components
36
-
37
- ```sh
38
- # a single component
39
- npx lovdacn@latest add button
9
+ To run:
40
10
 
41
- # multiple components
42
- npx lovdacn@latest add input select checkbox
11
+ ```bash
12
+ bun run index.ts
43
13
  ```
44
14
 
45
- Running `add` with no arguments opens an interactive multi-select of all available components.
46
-
47
- ## What it does
48
-
49
- - **`init`** — scaffolds/configures an Expo + NativeWind or Uniwind project (theme, `lvcn.json`,
50
- metro/tailwind config, global CSS, portal host for overlays, etc.).
51
- - **`add`** — resolves a component and its dependencies from the registry, rewrites import
52
- aliases to match your project, installs npm dependencies (via `expo install` for Expo
53
- projects), and writes the files into your components directory.
54
- - **`preset`** — manage theme/color presets.
55
-
56
- ## Configuration
57
-
58
- Components are resolved from the registry at `https://lovdacn.vercel.app/r`. You can point the CLI at a
59
- different registry (a URL, or a local folder for development) with:
60
-
61
- ```sh
62
- LOVDA_REGISTRY_URL=https://your-registry/r npx lovdacn@latest add button
63
- ```
64
-
65
- ## Links
66
-
67
- - Documentation: https://lovdacn.vercel.app
68
- - Repository: https://github.com/lovdacn-ui/ui
69
-
70
- ## License
71
-
72
- MIT
15
+ This project was created using `bun init` in bun v1.3.14. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import {Command}from'commander';import b from'path';import {fileURLToPath}from'url';import h from'fs-extra';import U from'prompts';import {execa}from'execa';import f from'picocolors';import {z as z$1}from'zod';var X=process.env.LOVDA_REGISTRY_URL||"https://lovdacn.vercel.app/r";var z=["new-york","default","luma","lyra","maia","mira","nova","rhea","sera","vega"],le=["zinc","slate","stone","gray","neutral","taupe","mauve","olive","mist"],ee=["zinc","slate","stone","gray","neutral","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],de=ee,ue=["inter","dm-sans","nunito-sans","figtree","outfit","manrope","space-grotesk","montserrat","roboto","raleway","public-sans","source-sans-3","lora","merriweather","playfair-display","jetbrains-mono","space-mono","fira-code","noto-serif","roboto-slab","instrument-sans","instrument-serif","geist"],pe=["lucide","phosphor","tabler","expo","heroicons"],ge=["default","none","small","medium","large","full"],fe=[{key:"style",values:z,bits:4},{key:"baseColor",values:le,bits:4},{key:"theme",values:ee,bits:5},{key:"chartColor",values:de,bits:5},{key:"font",values:ue,bits:5},{key:"iconLibrary",values:pe,bits:3},{key:"radius",values:ge,bits:3}],he={style:"new-york",baseColor:"zinc",theme:"zinc",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},oe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",_e="a",me=["a"];function ye(e){if(e===0)return "0";let r="",n=e;for(;n>0;)r=oe.charAt(n%62)+r,n=Math.floor(n/62);return r}function ke(e){let r=0;for(let n=0;n<e.length;n++){let a=oe.indexOf(e.charAt(n));if(a===-1)return -1;r=r*62+a;}return r}function J(e){let r={...he,...e},n=0,a=0;for(let s of fe){let o=s.values.indexOf(r[s.key]);n+=(o===-1?0:o)*2**a,a+=s.bits;}return _e+ye(n)}function L(e){if(!e||e.length<2)return null;let r=e.charAt(0);if(!me.includes(r))return null;let n=fe,a=ke(e.slice(1));if(a<0)return null;let s={},o=0;for(let t of n){let i=Math.floor(a/2**o)%2**t.bits,d=t.values;s[t.key]=i<d.length?d[i]:d[0],o+=t.bits;}return s}function G(e){if(!e||e.length<2||e.length>8||!me.includes(e.charAt(0)))return false;for(let r=1;r<e.length;r++)if(oe.indexOf(e.charAt(r))===-1)return false;return true}var H={inter:"@expo-google-fonts/inter","dm-sans":"@expo-google-fonts/dm-sans","nunito-sans":"@expo-google-fonts/nunito-sans",figtree:"@expo-google-fonts/figtree",outfit:"@expo-google-fonts/outfit",manrope:"@expo-google-fonts/manrope","space-grotesk":"@expo-google-fonts/space-grotesk",montserrat:"@expo-google-fonts/montserrat",roboto:"@expo-google-fonts/roboto",raleway:"@expo-google-fonts/raleway","public-sans":"@expo-google-fonts/public-sans","source-sans-3":"@expo-google-fonts/source-sans-3",lora:"@expo-google-fonts/lora",merriweather:"@expo-google-fonts/merriweather","playfair-display":"@expo-google-fonts/playfair-display","jetbrains-mono":"@expo-google-fonts/jetbrains-mono","space-mono":"@expo-google-fonts/space-mono","fira-code":"@expo-google-fonts/fira-code","noto-serif":"@expo-google-fonts/noto-serif","roboto-slab":"@expo-google-fonts/roboto-slab","instrument-sans":"@expo-google-fonts/instrument-sans","instrument-serif":"@expo-google-fonts/instrument-serif",geist:"@expo-google-fonts/geist"},M={inter:"Inter","dm-sans":"DM Sans","nunito-sans":"Nunito Sans",figtree:"Figtree",outfit:"Outfit",manrope:"Manrope","space-grotesk":"Space Grotesk",montserrat:"Montserrat",roboto:"Roboto",raleway:"Raleway","public-sans":"Public Sans","source-sans-3":"Source Sans 3",lora:"Lora",merriweather:"Merriweather","playfair-display":"Playfair Display","jetbrains-mono":"JetBrains Mono","space-mono":"Space Mono","fira-code":"Fira Code","noto-serif":"Noto Serif","roboto-slab":"Roboto Slab","instrument-sans":"Instrument Sans","instrument-serif":"Instrument Serif",geist:"Geist"},I={lucide:"lucide-react-native",phosphor:"phosphor-react-native",tabler:"@tabler/icons-react-native",expo:"@expo/vector-icons",heroicons:"react-native-heroicons"};var N={default:"0.5rem",none:"0rem",small:"0.125rem",medium:"0.625rem",large:"0.75rem",full:"1.5rem"};var A={"new-york":{title:"New York",description:"Lucide / Inter / Classic",style:"new-york",baseColor:"zinc",theme:"zinc",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},default:{title:"Default",description:"Lucide / Inter / Standard",style:"default",baseColor:"slate",theme:"slate",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},luma:{title:"Luma",description:"Lucide / Inter / Rounded",style:"luma",baseColor:"neutral",theme:"blue",chartColor:"sky",font:"inter",iconLibrary:"lucide",radius:"large"},lyra:{title:"Lyra",description:"Phosphor / JetBrains Mono / Tight",style:"lyra",baseColor:"stone",theme:"amber",chartColor:"orange",font:"jetbrains-mono",iconLibrary:"phosphor",radius:"small"},maia:{title:"Maia",description:"Tabler / Figtree / Rounded",style:"maia",baseColor:"neutral",theme:"violet",chartColor:"purple",font:"figtree",iconLibrary:"tabler",radius:"large"},mira:{title:"Mira",description:"Phosphor / Inter / Full",style:"mira",baseColor:"zinc",theme:"emerald",chartColor:"red",font:"inter",iconLibrary:"phosphor",radius:"full"},nova:{title:"Nova",description:"Lucide / Inter / Tight",style:"nova",baseColor:"neutral",theme:"neutral",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"small"},rhea:{title:"Rhea",description:"Lucide / DM Sans / Full",style:"rhea",baseColor:"neutral",theme:"rose",chartColor:"pink",font:"dm-sans",iconLibrary:"lucide",radius:"full"},sera:{title:"Sera",description:"Lucide / Playfair Display / None",style:"sera",baseColor:"taupe",theme:"amber",chartColor:"amber",font:"playfair-display",iconLibrary:"lucide",radius:"none"},vega:{title:"Vega",description:"Lucide / Space Grotesk / Medium",style:"vega",baseColor:"neutral",theme:"cyan",chartColor:"teal",font:"space-grotesk",iconLibrary:"lucide",radius:"medium"}};var Y={zinc:{300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",grayscale:true},slate:{300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",grayscale:true},stone:{300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",grayscale:true},gray:{300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",grayscale:true},neutral:{300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",grayscale:true},red:{300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)"},orange:{300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)"},amber:{300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",darkForeground:true},yellow:{300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",darkForeground:true},lime:{300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",darkForeground:true},green:{300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)"},emerald:{300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)"},teal:{300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)"},cyan:{300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)"},sky:{300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)"},blue:{300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)"},indigo:{300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)"},violet:{300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)"},purple:{300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)"},fuchsia:{300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)"},pink:{300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)"},rose:{300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)"}},Te="oklch(0.985 0 0)",ve="oklch(0.205 0 0)";function be(e){let r=e.match(/oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)/);if(!r)return "0 0% 0%";let n=parseFloat(r[1]),a=parseFloat(r[2]),o=parseFloat(r[3])*Math.PI/180,t=a*Math.cos(o),i=a*Math.sin(o),d=n+.3963377774*t+.2158037573*i,c=n-.1055613458*t-.0638541728*i,p=n-.0894841775*t-1.291485548*i,x=d**3,y=c**3,g=p**3,u=4.0767416621*x-3.3077115913*y+.2309699292*g,m=-1.2684380046*x+2.6097574011*y-.3413193965*g,l=-0.0041960863*x-.7034186147*y+1.707614701*g,v=V=>V<=.0031308?12.92*V:1.055*Math.pow(V,1/2.4)-.055;u=Math.min(1,Math.max(0,v(u))),m=Math.min(1,Math.max(0,v(m))),l=Math.min(1,Math.max(0,v(l)));let w=Math.max(u,m,l),C=Math.min(u,m,l),O=(w+C)/2,j=0,B=0,T=w-C;if(T!==0){switch(B=T/(1-Math.abs(2*O-1)),w){case u:j=(m-l)/T%6;break;case m:j=(l-u)/T+2;break;default:j=(u-m)/T+4;}j*=60,j<0&&(j+=360);}return `${j.toFixed(1)} ${(B*100).toFixed(1)}% ${(O*100).toFixed(1)}%`}function re(e,r="oklch"){let n=Y[e];if(!n||n.grayscale)return null;let a=o=>r==="hsl"?be(o):o,s=n.darkForeground?ve:Te;return {light:{primary:a(n[600]),foreground:a(s)},dark:{primary:a(n[500]),foreground:a(ve)}}}function ne(e,r="oklch"){let n=Y[e]??Y.blue,a=t=>r==="hsl"?be(t):t,s=[n[500],n[400],n[600],n[300],n[700]].map(a),o=[n[400],n[300],n[500],n[300],n[600]].map(a);return {light:s,dark:o}}var Ae=fileURLToPath(import.meta.url),xe=b.dirname(Ae),Fe=z$1.object({cwd:z$1.string(),name:z$1.string().optional(),yes:z$1.boolean().default(false),force:z$1.boolean().default(false),packageManager:z$1.enum(["npm","yarn","pnpm","bun"]).optional(),preset:z$1.string().optional(),engine:z$1.enum(["nativewind","uniwind"]).optional()}),Ce=new Command().name("init").description("initialize your project and install dependencies").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-n, --name <name>","the name for the new project.").option("-y, --yes","skip confirmation prompt.",false).option("-f, --force","force overwrite of existing files.",false).option("-p, --package-manager <package-manager>","the package manager to use. (npm, yarn, pnpm, bun)").option("--preset <preset>","use a preset configuration (code, named preset, or style name)").option("--engine <engine>","the style engine to use (nativewind, uniwind)").action(async e=>{try{let r=Fe.parse({...e,cwd:b.resolve(e.cwd)});await Oe(r);}catch(r){console.error(f.red(`
3
- Initialization failed:`)),console.error(r),process.exit(1);}});async function Oe(e){let r=e.cwd,n=h.existsSync(b.join(r,"package.json")),a=e.name,s=e.packageManager,o,t="nativewind",i="new-york",d="zinc",c=null;if(e.preset){let l=A[e.preset];if(l){let{title:v,description:w,...C}=l;c=C;}else G(e.preset)?(c=L(e.preset),c||(console.error(f.red(`Invalid preset code: ${e.preset}`)),process.exit(1))):(console.error(f.red(`Unknown preset: ${e.preset}`)),console.error(f.dim(`Available: ${Object.keys(A).join(", ")}, or a preset code.`)),process.exit(1));i=c.style,d=c.baseColor,console.log(f.blue(`Using preset: ${f.cyan(e.preset)}`)),console.log(f.dim(` style: ${i}, base: ${d}, theme: ${c.theme}, chart: ${c.chartColor}, font: ${M[c.font]}, icons: ${c.iconLibrary}, radius: ${N[c.radius]}`));}if(n){o=r,s||(s=e.packageManager||te(r));let l=b.join(r,"package.json"),v={};try{v=h.readJsonSync(l);}catch{}let w={...v.dependencies||{},...v.devDependencies||{}};if(w.uniwind)t="uniwind";else if(w.nativewind)t="nativewind";else if(e.engine)t=e.engine;else if(e.yes)t="nativewind";else {let C=await U({type:"select",name:"styleEngine",message:"Which style engine would you like to use?",choices:[{title:"NativeWind (default/reusables compatible)",value:"nativewind"},{title:"Uniwind",value:"uniwind"}],initial:0});C.styleEngine||process.exit(0),t=C.styleEngine;}}else {if(e.yes)a=a||"nativewind-app",s=s||te(r),t=e.engine||"nativewind",i=c?c.style:"new-york",d=c?c.baseColor:"zinc";else {let l=te(r),v=[];if(e.engine||v.push({type:"select",name:"styleEngine",message:"Which style engine would you like to use?",choices:[{title:"NativeWind (default/reusables compatible)",value:"nativewind"},{title:"Uniwind",value:"uniwind"}],initial:0}),c||(v.push({type:"select",name:"style",message:"Which style would you like to use?",choices:[{title:"Default",value:"default"},{title:"New York",value:"new-york"},{title:"Luma",value:"luma"},{title:"Lyra",value:"lyra"},{title:"Maia",value:"maia"},{title:"Mira",value:"mira"},{title:"Nova",value:"nova"},{title:"Rhea",value:"rhea"},{title:"Sera",value:"sera"},{title:"Vega",value:"vega"}],initial:1}),v.push({type:"select",name:"baseColor",message:"Which color would you like to use as the base color?",choices:[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Mauve",value:"mauve"},{title:"Olive",value:"olive"},{title:"Mist",value:"mist"},{title:"Taupe",value:"taupe"}],initial:0})),a||v.push({type:"text",name:"projectName",message:"What is your project named?",initial:(C,O)=>O.styleEngine==="uniwind"?"uniwind-app":"nativewind-app",validate:C=>C.trim().length===0?"Project name cannot be empty.":true}),!s){let C=async V=>{try{return await execa(V,["--version"]),!0}catch{return false}},[O,j,B,T]=await Promise.all([C("npm"),C("yarn"),C("pnpm"),C("bun")]);v.push({type:"select",name:"packageManager",message:"Which package manager would you like to use?",choices:[{title:"npm"+(O?"":" (not installed)"),value:"npm",disabled:!O},{title:"yarn"+(j?"":" (not installed)"),value:"yarn",disabled:!j},{title:"pnpm"+(B?"":" (not installed)"),value:"pnpm",disabled:!B},{title:"bun"+(T?"":" (not installed)"),value:"bun",disabled:!T}],initial:["npm","yarn","pnpm","bun"].indexOf(l)!==-1?["npm","yarn","pnpm","bun"].indexOf(l):0});}let w=await U(v);(!a&&!w.projectName||!s&&!w.packageManager||!e.engine&&!w.styleEngine||!c&&(!w.style||!w.baseColor))&&process.exit(0),a=a||w.projectName.trim(),s=s||w.packageManager,t=e.engine||w.styleEngine,i=c?c.style:w.style,d=c?c.baseColor:w.baseColor;}if(!s)throw new Error("Package manager is required.");if(o=b.join(r,a),h.existsSync(o)&&h.readdirSync(o).length>0&&!e.force){if(e.yes)throw new Error(`Directory ${o} is not empty. Use --force to overwrite.`);if(!(await U({type:"confirm",name:"overwrite",message:`The directory ${f.cyan(a)} is not empty. Would you like to overwrite it?`,initial:false})).overwrite){console.log(f.yellow("Aborted."));return}}}let p=null,x=b.join(o,"lvcn.json");if(h.existsSync(x)){if(!e.force&&!e.yes&&!(await U({type:"confirm",name:"overwrite",message:`Configuration file ${f.cyan("lvcn.json")} already exists. Overwrite?`,initial:false})).overwrite){console.log(f.yellow("Aborted."));return}try{p=h.readJsonSync(x);}catch{}}if(p&&p.style)i=p.style;else if(c)i=c.style;else if(e.yes)i="new-york";else if(n){let l=await U({type:"select",name:"style",message:"Which style would you like to use?",choices:[{title:"Default",value:"default"},{title:"New York",value:"new-york"},{title:"Luma",value:"luma"},{title:"Lyra",value:"lyra"},{title:"Maia",value:"maia"},{title:"Mira",value:"mira"},{title:"Nova",value:"nova"},{title:"Rhea",value:"rhea"},{title:"Sera",value:"sera"},{title:"Vega",value:"vega"}],initial:1});l.style||process.exit(0),i=l.style;}if(p&&p.tailwind?.baseColor)d=p.tailwind.baseColor;else if(c)d=c.baseColor;else if(e.yes)d="zinc";else if(n){let l=await U({type:"select",name:"baseColor",message:"Which color would you like to use as the base color?",choices:[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Mauve",value:"mauve"},{title:"Olive",value:"olive"},{title:"Mist",value:"mist"},{title:"Taupe",value:"taupe"}],initial:0});l.baseColor||process.exit(0),d=l.baseColor;}let y=process.env.LOVDA_TEMPLATE_DIR;if(!y){let l=b.resolve(xe,`../../templates/${t}`),v=b.resolve(xe,`../../../templates/${t}`);y=h.existsSync(l)?l:v;}if(!h.existsSync(y))throw new Error(`Template directory not found at ${y}`);let g=n?h.existsSync(b.join(o,"src")):h.existsSync(b.join(y,"src")),u=g?"./src/global.css":"./global.css";if(n){if(console.log(f.blue("Initializing configurations in existing project...")),h.writeJsonSync(x,{$schema:"https://lovdacn.vercel.app/schema.json",style:i,styleEngine:t,tsx:true,tailwind:{config:"tailwind.config.js",css:u,baseColor:d},aliases:{components:"@/components",utils:"@/lib/utils",ui:"@/components/ui"},components:[]},{spaces:2}),await se(o,t,u,i,d,c?.theme,c?.chartColor),Se(o,d),t==="nativewind"){let l=b.join(y,"tailwind.config.js");Ue(o,l);}De(o,t,u,g),t==="nativewind"&&Ve(o),Ge(o,u),He(o);}else {console.log(f.blue(`Initializing project in ${f.cyan(o)}...`)),h.ensureDirSync(o),h.copySync(y,o,{filter:v=>{let w=b.basename(v);return !v.includes("node_modules")&&w!==".git"&&w!==".expo"&&w!==".claude"}});let l=b.join(o,"package.json");if(h.existsSync(l)){let v=h.readJsonSync(l);v.name=a,h.writeJsonSync(l,v,{spaces:2});}We(o,s),await se(o,t,u,i,d,c?.theme,c?.chartColor),Se(o,d);}if(h.existsSync(x)){let l=h.readJsonSync(x),v={...l,style:i,styleEngine:t,...p||{},baseColor:d,...c?{theme:c.theme,chartColor:c.chartColor,font:c.font,iconLibrary:c.iconLibrary,radius:c.radius}:{},aliases:{...l.aliases,...p&&p.aliases||{}},tailwind:{...l.tailwind,baseColor:d,...p&&p.tailwind||{}},components:Array.from(new Set([...l.components||[],...p&&p.components||[]]))};h.writeJsonSync(x,v,{spaces:2});}if(console.log(f.blue(`Installing dependencies using ${f.cyan(s)}...`)),n?await execa(s,["install",...t==="uniwind"?["uniwind","tailwindcss","class-variance-authority","@rn-primitives/portal","react-native-gesture-handler"]:["nativewind","tailwindcss","class-variance-authority","@rn-primitives/portal","react-native-gesture-handler"]],{cwd:o,stdio:"inherit"}):await execa(s,["install"],{cwd:o,stdio:"inherit"}),c){let l=[],v=H[c.font];if(v&&l.push(v),c.iconLibrary!=="expo"){let w=I[c.iconLibrary];w&&(l.push(w),l.push("react-native-svg"));}if(l.length>0){console.log(f.blue(`Installing preset packages: ${f.cyan(l.join(", "))}...`));try{await execa(s,["install",...l],{cwd:o,stdio:"inherit"});}catch{console.log(f.yellow(`\u26A0 Could not install some preset packages. Install manually: ${l.join(" ")}`));}}}console.log(f.green(`
2
+ import {Command}from'commander';import b from'path';import {fileURLToPath}from'url';import h from'fs-extra';import U from'prompts';import {execa}from'execa';import f from'picocolors';import {z as z$1}from'zod';var X=process.env.LOVDA_REGISTRY_URL||"https://lvcn.dev/r";var z=["new-york","default","luma","lyra","maia","mira","nova","rhea","sera","vega"],le=["zinc","slate","stone","gray","neutral","taupe","mauve","olive","mist"],ee=["zinc","slate","stone","gray","neutral","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],de=ee,ue=["inter","dm-sans","nunito-sans","figtree","outfit","manrope","space-grotesk","montserrat","roboto","raleway","public-sans","source-sans-3","lora","merriweather","playfair-display","jetbrains-mono","space-mono","fira-code","noto-serif","roboto-slab","instrument-sans","instrument-serif","geist"],pe=["lucide","phosphor","tabler","expo","heroicons"],ge=["default","none","small","medium","large","full"],fe=[{key:"style",values:z,bits:4},{key:"baseColor",values:le,bits:4},{key:"theme",values:ee,bits:5},{key:"chartColor",values:de,bits:5},{key:"font",values:ue,bits:5},{key:"iconLibrary",values:pe,bits:3},{key:"radius",values:ge,bits:3}],he={style:"new-york",baseColor:"zinc",theme:"zinc",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},oe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",_e="a",me=["a"];function ye(e){if(e===0)return "0";let r="",n=e;for(;n>0;)r=oe.charAt(n%62)+r,n=Math.floor(n/62);return r}function ke(e){let r=0;for(let n=0;n<e.length;n++){let i=oe.indexOf(e.charAt(n));if(i===-1)return -1;r=r*62+i;}return r}function J(e){let r={...he,...e},n=0,i=0;for(let s of fe){let o=s.values.indexOf(r[s.key]);n+=(o===-1?0:o)*2**i,i+=s.bits;}return _e+ye(n)}function L(e){if(!e||e.length<2)return null;let r=e.charAt(0);if(!me.includes(r))return null;let n=fe,i=ke(e.slice(1));if(i<0)return null;let s={},o=0;for(let t of n){let a=Math.floor(i/2**o)%2**t.bits,d=t.values;s[t.key]=a<d.length?d[a]:d[0],o+=t.bits;}return s}function G(e){if(!e||e.length<2||e.length>8||!me.includes(e.charAt(0)))return false;for(let r=1;r<e.length;r++)if(oe.indexOf(e.charAt(r))===-1)return false;return true}var H={inter:"@expo-google-fonts/inter","dm-sans":"@expo-google-fonts/dm-sans","nunito-sans":"@expo-google-fonts/nunito-sans",figtree:"@expo-google-fonts/figtree",outfit:"@expo-google-fonts/outfit",manrope:"@expo-google-fonts/manrope","space-grotesk":"@expo-google-fonts/space-grotesk",montserrat:"@expo-google-fonts/montserrat",roboto:"@expo-google-fonts/roboto",raleway:"@expo-google-fonts/raleway","public-sans":"@expo-google-fonts/public-sans","source-sans-3":"@expo-google-fonts/source-sans-3",lora:"@expo-google-fonts/lora",merriweather:"@expo-google-fonts/merriweather","playfair-display":"@expo-google-fonts/playfair-display","jetbrains-mono":"@expo-google-fonts/jetbrains-mono","space-mono":"@expo-google-fonts/space-mono","fira-code":"@expo-google-fonts/fira-code","noto-serif":"@expo-google-fonts/noto-serif","roboto-slab":"@expo-google-fonts/roboto-slab","instrument-sans":"@expo-google-fonts/instrument-sans","instrument-serif":"@expo-google-fonts/instrument-serif",geist:"@expo-google-fonts/geist"},M={inter:"Inter","dm-sans":"DM Sans","nunito-sans":"Nunito Sans",figtree:"Figtree",outfit:"Outfit",manrope:"Manrope","space-grotesk":"Space Grotesk",montserrat:"Montserrat",roboto:"Roboto",raleway:"Raleway","public-sans":"Public Sans","source-sans-3":"Source Sans 3",lora:"Lora",merriweather:"Merriweather","playfair-display":"Playfair Display","jetbrains-mono":"JetBrains Mono","space-mono":"Space Mono","fira-code":"Fira Code","noto-serif":"Noto Serif","roboto-slab":"Roboto Slab","instrument-sans":"Instrument Sans","instrument-serif":"Instrument Serif",geist:"Geist"},I={lucide:"lucide-react-native",phosphor:"phosphor-react-native",tabler:"@tabler/icons-react-native",expo:"@expo/vector-icons",heroicons:"react-native-heroicons"};var N={default:"0.5rem",none:"0rem",small:"0.125rem",medium:"0.625rem",large:"0.75rem",full:"1.5rem"};var A={"new-york":{title:"New York",description:"Lucide / Inter / Classic",style:"new-york",baseColor:"zinc",theme:"zinc",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},default:{title:"Default",description:"Lucide / Inter / Standard",style:"default",baseColor:"slate",theme:"slate",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"default"},luma:{title:"Luma",description:"Lucide / Inter / Rounded",style:"luma",baseColor:"neutral",theme:"blue",chartColor:"sky",font:"inter",iconLibrary:"lucide",radius:"large"},lyra:{title:"Lyra",description:"Phosphor / JetBrains Mono / Tight",style:"lyra",baseColor:"stone",theme:"amber",chartColor:"orange",font:"jetbrains-mono",iconLibrary:"phosphor",radius:"small"},maia:{title:"Maia",description:"Tabler / Figtree / Rounded",style:"maia",baseColor:"neutral",theme:"violet",chartColor:"purple",font:"figtree",iconLibrary:"tabler",radius:"large"},mira:{title:"Mira",description:"Phosphor / Inter / Full",style:"mira",baseColor:"zinc",theme:"emerald",chartColor:"red",font:"inter",iconLibrary:"phosphor",radius:"full"},nova:{title:"Nova",description:"Lucide / Inter / Tight",style:"nova",baseColor:"neutral",theme:"neutral",chartColor:"blue",font:"inter",iconLibrary:"lucide",radius:"small"},rhea:{title:"Rhea",description:"Lucide / DM Sans / Full",style:"rhea",baseColor:"neutral",theme:"rose",chartColor:"pink",font:"dm-sans",iconLibrary:"lucide",radius:"full"},sera:{title:"Sera",description:"Lucide / Playfair Display / None",style:"sera",baseColor:"taupe",theme:"amber",chartColor:"amber",font:"playfair-display",iconLibrary:"lucide",radius:"none"},vega:{title:"Vega",description:"Lucide / Space Grotesk / Medium",style:"vega",baseColor:"neutral",theme:"cyan",chartColor:"teal",font:"space-grotesk",iconLibrary:"lucide",radius:"medium"}};var Y={zinc:{300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",grayscale:true},slate:{300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",grayscale:true},stone:{300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",grayscale:true},gray:{300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",grayscale:true},neutral:{300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",grayscale:true},red:{300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)"},orange:{300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)"},amber:{300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",darkForeground:true},yellow:{300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",darkForeground:true},lime:{300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",darkForeground:true},green:{300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)"},emerald:{300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)"},teal:{300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)"},cyan:{300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)"},sky:{300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)"},blue:{300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)"},indigo:{300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)"},violet:{300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)"},purple:{300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)"},fuchsia:{300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)"},pink:{300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)"},rose:{300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)"}},Te="oklch(0.985 0 0)",ve="oklch(0.205 0 0)";function be(e){let r=e.match(/oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)/);if(!r)return "0 0% 0%";let n=parseFloat(r[1]),i=parseFloat(r[2]),o=parseFloat(r[3])*Math.PI/180,t=i*Math.cos(o),a=i*Math.sin(o),d=n+.3963377774*t+.2158037573*a,c=n-.1055613458*t-.0638541728*a,p=n-.0894841775*t-1.291485548*a,x=d**3,y=c**3,g=p**3,u=4.0767416621*x-3.3077115913*y+.2309699292*g,m=-1.2684380046*x+2.6097574011*y-.3413193965*g,l=-0.0041960863*x-.7034186147*y+1.707614701*g,v=V=>V<=.0031308?12.92*V:1.055*Math.pow(V,1/2.4)-.055;u=Math.min(1,Math.max(0,v(u))),m=Math.min(1,Math.max(0,v(m))),l=Math.min(1,Math.max(0,v(l)));let w=Math.max(u,m,l),C=Math.min(u,m,l),O=(w+C)/2,j=0,B=0,T=w-C;if(T!==0){switch(B=T/(1-Math.abs(2*O-1)),w){case u:j=(m-l)/T%6;break;case m:j=(l-u)/T+2;break;default:j=(u-m)/T+4;}j*=60,j<0&&(j+=360);}return `${j.toFixed(1)} ${(B*100).toFixed(1)}% ${(O*100).toFixed(1)}%`}function re(e,r="oklch"){let n=Y[e];if(!n||n.grayscale)return null;let i=o=>r==="hsl"?be(o):o,s=n.darkForeground?ve:Te;return {light:{primary:i(n[600]),foreground:i(s)},dark:{primary:i(n[500]),foreground:i(ve)}}}function ne(e,r="oklch"){let n=Y[e]??Y.blue,i=t=>r==="hsl"?be(t):t,s=[n[500],n[400],n[600],n[300],n[700]].map(i),o=[n[400],n[300],n[500],n[300],n[600]].map(i);return {light:s,dark:o}}var Ae=fileURLToPath(import.meta.url),xe=b.dirname(Ae),Fe=z$1.object({cwd:z$1.string(),name:z$1.string().optional(),yes:z$1.boolean().default(false),force:z$1.boolean().default(false),packageManager:z$1.enum(["npm","yarn","pnpm","bun"]).optional(),preset:z$1.string().optional(),engine:z$1.enum(["nativewind","uniwind"]).optional()}),Ce=new Command().name("init").description("initialize your project and install dependencies").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-n, --name <name>","the name for the new project.").option("-y, --yes","skip confirmation prompt.",false).option("-f, --force","force overwrite of existing files.",false).option("-p, --package-manager <package-manager>","the package manager to use. (npm, yarn, pnpm, bun)").option("--preset <preset>","use a preset configuration (code, named preset, or style name)").option("--engine <engine>","the style engine to use (nativewind, uniwind)").action(async e=>{try{let r=Fe.parse({...e,cwd:b.resolve(e.cwd)});await Oe(r);}catch(r){console.error(f.red(`
3
+ Initialization failed:`)),console.error(r),process.exit(1);}});async function Oe(e){let r=e.cwd,n=h.existsSync(b.join(r,"package.json")),i=e.name,s=e.packageManager,o,t="nativewind",a="new-york",d="zinc",c=null;if(e.preset){let l=A[e.preset];if(l){let{title:v,description:w,...C}=l;c=C;}else G(e.preset)?(c=L(e.preset),c||(console.error(f.red(`Invalid preset code: ${e.preset}`)),process.exit(1))):(console.error(f.red(`Unknown preset: ${e.preset}`)),console.error(f.dim(`Available: ${Object.keys(A).join(", ")}, or a preset code.`)),process.exit(1));a=c.style,d=c.baseColor,console.log(f.blue(`Using preset: ${f.cyan(e.preset)}`)),console.log(f.dim(` style: ${a}, base: ${d}, theme: ${c.theme}, chart: ${c.chartColor}, font: ${M[c.font]}, icons: ${c.iconLibrary}, radius: ${N[c.radius]}`));}if(n){o=r,s||(s=e.packageManager||te(r));let l=b.join(r,"package.json"),v={};try{v=h.readJsonSync(l);}catch{}let w={...v.dependencies||{},...v.devDependencies||{}};if(w.uniwind)t="uniwind";else if(w.nativewind)t="nativewind";else if(e.engine)t=e.engine;else if(e.yes)t="nativewind";else {let C=await U({type:"select",name:"styleEngine",message:"Which style engine would you like to use?",choices:[{title:"NativeWind (default/reusables compatible)",value:"nativewind"},{title:"Uniwind",value:"uniwind"}],initial:0});C.styleEngine||process.exit(0),t=C.styleEngine;}}else {if(e.yes)i=i||"nativewind-app",s=s||te(r),t=e.engine||"nativewind",a=c?c.style:"new-york",d=c?c.baseColor:"zinc";else {let l=te(r),v=[];if(e.engine||v.push({type:"select",name:"styleEngine",message:"Which style engine would you like to use?",choices:[{title:"NativeWind (default/reusables compatible)",value:"nativewind"},{title:"Uniwind",value:"uniwind"}],initial:0}),c||(v.push({type:"select",name:"style",message:"Which style would you like to use?",choices:[{title:"Default",value:"default"},{title:"New York",value:"new-york"},{title:"Luma",value:"luma"},{title:"Lyra",value:"lyra"},{title:"Maia",value:"maia"},{title:"Mira",value:"mira"},{title:"Nova",value:"nova"},{title:"Rhea",value:"rhea"},{title:"Sera",value:"sera"},{title:"Vega",value:"vega"}],initial:1}),v.push({type:"select",name:"baseColor",message:"Which color would you like to use as the base color?",choices:[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Mauve",value:"mauve"},{title:"Olive",value:"olive"},{title:"Mist",value:"mist"},{title:"Taupe",value:"taupe"}],initial:0})),i||v.push({type:"text",name:"projectName",message:"What is your project named?",initial:(C,O)=>O.styleEngine==="uniwind"?"uniwind-app":"nativewind-app",validate:C=>C.trim().length===0?"Project name cannot be empty.":true}),!s){let C=async V=>{try{return await execa(V,["--version"]),!0}catch{return false}},[O,j,B,T]=await Promise.all([C("npm"),C("yarn"),C("pnpm"),C("bun")]);v.push({type:"select",name:"packageManager",message:"Which package manager would you like to use?",choices:[{title:"npm"+(O?"":" (not installed)"),value:"npm",disabled:!O},{title:"yarn"+(j?"":" (not installed)"),value:"yarn",disabled:!j},{title:"pnpm"+(B?"":" (not installed)"),value:"pnpm",disabled:!B},{title:"bun"+(T?"":" (not installed)"),value:"bun",disabled:!T}],initial:["npm","yarn","pnpm","bun"].indexOf(l)!==-1?["npm","yarn","pnpm","bun"].indexOf(l):0});}let w=await U(v);(!i&&!w.projectName||!s&&!w.packageManager||!e.engine&&!w.styleEngine||!c&&(!w.style||!w.baseColor))&&process.exit(0),i=i||w.projectName.trim(),s=s||w.packageManager,t=e.engine||w.styleEngine,a=c?c.style:w.style,d=c?c.baseColor:w.baseColor;}if(!s)throw new Error("Package manager is required.");if(o=b.join(r,i),h.existsSync(o)&&h.readdirSync(o).length>0&&!e.force){if(e.yes)throw new Error(`Directory ${o} is not empty. Use --force to overwrite.`);if(!(await U({type:"confirm",name:"overwrite",message:`The directory ${f.cyan(i)} is not empty. Would you like to overwrite it?`,initial:false})).overwrite){console.log(f.yellow("Aborted."));return}}}let p=null,x=b.join(o,"lvcn.json");if(h.existsSync(x)){if(!e.force&&!e.yes&&!(await U({type:"confirm",name:"overwrite",message:`Configuration file ${f.cyan("lvcn.json")} already exists. Overwrite?`,initial:false})).overwrite){console.log(f.yellow("Aborted."));return}try{p=h.readJsonSync(x);}catch{}}if(p&&p.style)a=p.style;else if(c)a=c.style;else if(e.yes)a="new-york";else if(n){let l=await U({type:"select",name:"style",message:"Which style would you like to use?",choices:[{title:"Default",value:"default"},{title:"New York",value:"new-york"},{title:"Luma",value:"luma"},{title:"Lyra",value:"lyra"},{title:"Maia",value:"maia"},{title:"Mira",value:"mira"},{title:"Nova",value:"nova"},{title:"Rhea",value:"rhea"},{title:"Sera",value:"sera"},{title:"Vega",value:"vega"}],initial:1});l.style||process.exit(0),a=l.style;}if(p&&p.tailwind?.baseColor)d=p.tailwind.baseColor;else if(c)d=c.baseColor;else if(e.yes)d="zinc";else if(n){let l=await U({type:"select",name:"baseColor",message:"Which color would you like to use as the base color?",choices:[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Mauve",value:"mauve"},{title:"Olive",value:"olive"},{title:"Mist",value:"mist"},{title:"Taupe",value:"taupe"}],initial:0});l.baseColor||process.exit(0),d=l.baseColor;}let y=process.env.LOVDA_TEMPLATE_DIR;if(!y){let l=b.resolve(xe,`../../templates/${t}`),v=b.resolve(xe,`../../../templates/${t}`);y=h.existsSync(l)?l:v;}if(!h.existsSync(y))throw new Error(`Template directory not found at ${y}`);let g=n?h.existsSync(b.join(o,"src")):h.existsSync(b.join(y,"src")),u=g?"./src/global.css":"./global.css";if(n){if(console.log(f.blue("Initializing configurations in existing project...")),h.writeJsonSync(x,{$schema:"https://lvcn.dev/schema.json",style:a,styleEngine:t,tsx:true,tailwind:{config:"tailwind.config.js",css:u,baseColor:d},aliases:{components:"@/components",utils:"@/lib/utils",ui:"@/components/ui"},components:[]},{spaces:2}),await se(o,t,u,a,d,c?.theme,c?.chartColor),Se(o,d),t==="nativewind"){let l=b.join(y,"tailwind.config.js");Ue(o,l);}De(o,t,u,g),t==="nativewind"&&Ve(o),Ge(o,u),He(o);}else {console.log(f.blue(`Initializing project in ${f.cyan(o)}...`)),h.ensureDirSync(o),h.copySync(y,o,{filter:v=>{let w=b.basename(v);return !v.includes("node_modules")&&w!==".git"&&w!==".expo"&&w!==".claude"}});let l=b.join(o,"package.json");if(h.existsSync(l)){let v=h.readJsonSync(l);v.name=i,h.writeJsonSync(l,v,{spaces:2});}We(o,s),await se(o,t,u,a,d,c?.theme,c?.chartColor),Se(o,d);}if(h.existsSync(x)){let l=h.readJsonSync(x),v={...l,style:a,styleEngine:t,...p||{},baseColor:d,...c?{theme:c.theme,chartColor:c.chartColor,font:c.font,iconLibrary:c.iconLibrary,radius:c.radius}:{},aliases:{...l.aliases,...p&&p.aliases||{}},tailwind:{...l.tailwind,baseColor:d,...p&&p.tailwind||{}},components:Array.from(new Set([...l.components||[],...p&&p.components||[]]))};h.writeJsonSync(x,v,{spaces:2});}if(console.log(f.blue(`Installing dependencies using ${f.cyan(s)}...`)),n?await execa(s,["install",...t==="uniwind"?["uniwind","tailwindcss","class-variance-authority","@rn-primitives/portal","react-native-gesture-handler"]:["nativewind","tailwindcss","class-variance-authority","@rn-primitives/portal","react-native-gesture-handler"]],{cwd:o,stdio:"inherit"}):await execa(s,["install"],{cwd:o,stdio:"inherit"}),c){let l=[],v=H[c.font];if(v&&l.push(v),c.iconLibrary!=="expo"){let w=I[c.iconLibrary];w&&(l.push(w),l.push("react-native-svg"));}if(l.length>0){console.log(f.blue(`Installing preset packages: ${f.cyan(l.join(", "))}...`));try{await execa(s,["install",...l],{cwd:o,stdio:"inherit"});}catch{console.log(f.yellow(`\u26A0 Could not install some preset packages. Install manually: ${l.join(" ")}`));}}}console.log(f.green(`
4
4
  Project initialized successfully! \u{1F389}`));let m=Me(s);console.log(f.dim(`
5
- Now add components with:`)),!n&&a&&console.log(` ${f.cyan(`cd ${a}`)}`),console.log(` ${f.cyan(`${m} lovdacn add`)} ${f.dim("[...components]")}`);}function Me(e){switch(e){case "pnpm":return "pnpm dlx";case "bun":return "bunx";case "yarn":return "yarn dlx";default:return "npx"}}function te(e){if(h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock")))return "bun";if(h.existsSync(b.join(e,"pnpm-lock.yaml")))return "pnpm";if(h.existsSync(b.join(e,"yarn.lock")))return "yarn";if(h.existsSync(b.join(e,"package-lock.json")))return "npm";let r=process.env.npm_config_user_agent||"";return r.startsWith("pnpm")?"pnpm":r.startsWith("bun")?"bun":r.startsWith("yarn")?"yarn":"npm"}var K={zinc:{hsl:{light:{background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%","card-foreground":"240 10% 3.9%",popover:"0 0% 100%","popover-foreground":"240 10% 3.9%",primary:"240 5.9% 10%","primary-foreground":"0 0% 98%",secondary:"240 4.8% 95.9%","secondary-foreground":"240 5.9% 10%",muted:"240 4.8% 95.9%","muted-foreground":"240 3.8% 46.1%",accent:"240 4.8% 95.9%","accent-foreground":"240 5.9% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"240 5.9% 90%",input:"240 5.9% 90%",ring:"240 5.9% 10%"},dark:{background:"240 10% 3.9%",foreground:"0 0% 98%",card:"240 10% 3.9%","card-foreground":"0 0% 98%",popover:"240 10% 3.9%","popover-foreground":"0 0% 98%",primary:"0 0% 98%","primary-foreground":"240 5.9% 10%",secondary:"240 3.7% 15.9%","secondary-foreground":"0 0% 98%",muted:"240 3.7% 15.9%","muted-foreground":"240 5% 64.9%",accent:"240 3.7% 15.9%","accent-foreground":"0 0% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"0 0% 98%",border:"240 3.7% 15.9%",input:"240 3.7% 15.9%",ring:"240 4.9% 83.9%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",primary:"oklch(0.205 0 0)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.205 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.145 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.145 0 0)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.985 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.269 0 0)",input:"oklch(0.269 0 0)",ring:"oklch(0.87 0 0)"}}},neutral:{hsl:{light:{background:"0 0% 100%",foreground:"0 0% 3.9%",card:"0 0% 100%","card-foreground":"0 0% 3.9%",popover:"0 0% 100%","popover-foreground":"0 0% 3.9%",primary:"0 0% 9%","primary-foreground":"0 0% 98%",secondary:"0 0% 96.1%","secondary-foreground":"0 0% 9%",muted:"0 0% 96.1%","muted-foreground":"0 0% 45.1%",accent:"0 0% 96.1%","accent-foreground":"0 0% 9%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"0 0% 89.8%",input:"0 0% 89.8%",ring:"0 0% 3.9%"},dark:{background:"0 0% 3.9%",foreground:"0 0% 98%",card:"0 0% 3.9%","card-foreground":"0 0% 98%",popover:"0 0% 3.9%","popover-foreground":"0 0% 98%",primary:"0 0% 98%","primary-foreground":"0 0% 9%",secondary:"0 0% 14.9%","secondary-foreground":"0 0% 98%",muted:"0 0% 14.9%","muted-foreground":"0 0% 63.9%",accent:"0 0% 14.9%","accent-foreground":"0 0% 98%",destructive:"0 70.9% 59.4%","destructive-foreground":"0 0% 98%",border:"0 0% 14.9%",input:"0 0% 14.9%",ring:"0 0% 83.1%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",primary:"oklch(0.205 0 0)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.205 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.145 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.145 0 0)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.985 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.269 0 0)",input:"oklch(0.269 0 0)",ring:"oklch(0.87 0 0)"}}},slate:{hsl:{light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%","card-foreground":"222.2 84% 4.9%",popover:"0 0% 100%","popover-foreground":"222.2 84% 4.9%",primary:"222.2 47.4% 11.2%","primary-foreground":"210 40% 98%",secondary:"210 40% 96.1%","secondary-foreground":"222.2 47.4% 11.2%",muted:"210 40% 96.1%","muted-foreground":"215.4 16.3% 46.9%",accent:"210 40% 96.1%","accent-foreground":"222.2 47.4% 11.2%",destructive:"0 84.2% 60.2%","destructive-foreground":"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"222.2 84% 4.9%"},dark:{background:"222.2 84% 4.9%",foreground:"210 40% 98%",card:"222.2 84% 4.9%","card-foreground":"210 40% 98%",popover:"222.2 84% 4.9%","popover-foreground":"210 40% 98%",primary:"210 40% 98%","primary-foreground":"222.2 47.4% 11.2%",secondary:"217.2 32.6% 17.5%","secondary-foreground":"210 40% 98%",muted:"217.2 32.6% 17.5%","muted-foreground":"215 20.2% 65.1%",accent:"217.2 32.6% 17.5%","accent-foreground":"210 40% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"210 40% 98%",border:"217.2 32.6% 17.5%",input:"217.2 32.6% 17.5%",ring:"224.3 76.3% 48%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.129 0.042 264.695)",card:"oklch(1 0 0)","card-foreground":"oklch(0.129 0.042 264.695)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.129 0.042 264.695)",primary:"oklch(0.208 0.042 265.755)","primary-foreground":"oklch(0.968 0.007 247.896)",secondary:"oklch(0.968 0.007 247.896)","secondary-foreground":"oklch(0.208 0.042 265.755)",muted:"oklch(0.968 0.007 247.896)","muted-foreground":"oklch(0.554 0.046 257.417)",accent:"oklch(0.968 0.007 247.896)","accent-foreground":"oklch(0.208 0.042 265.755)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.968 0.007 247.896)",border:"oklch(0.929 0.013 255.508)",input:"oklch(0.929 0.013 255.508)",ring:"oklch(0.129 0.042 264.695)"},dark:{background:"oklch(0.129 0.042 264.695)",foreground:"oklch(0.968 0.007 247.896)",card:"oklch(0.129 0.042 264.695)","card-foreground":"oklch(0.968 0.007 247.896)",popover:"oklch(0.129 0.042 264.695)","popover-foreground":"oklch(0.968 0.007 247.896)",primary:"oklch(0.968 0.007 247.896)","primary-foreground":"oklch(0.208 0.042 265.755)",secondary:"oklch(0.279 0.041 260.031)","secondary-foreground":"oklch(0.968 0.007 247.896)",muted:"oklch(0.279 0.041 260.031)","muted-foreground":"oklch(0.704 0.04 256.788)",accent:"oklch(0.279 0.041 260.031)","accent-foreground":"oklch(0.968 0.007 247.896)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.968 0.007 247.896)",border:"oklch(0.279 0.041 260.031)",input:"oklch(0.279 0.041 260.031)",ring:"oklch(0.87 0 0)"}}},stone:{hsl:{light:{background:"0 0% 100%",foreground:"24 9.8% 10%",card:"0 0% 100%","card-foreground":"24 9.8% 10%",popover:"0 0% 100%","popover-foreground":"24 9.8% 10%",primary:"24 9.8% 10%","primary-foreground":"60 9.1% 97.8%",secondary:"60 4.8% 95.9%","secondary-foreground":"24 9.8% 10%",muted:"60 4.8% 95.9%","muted-foreground":"25 5.3% 44.7%",accent:"60 4.8% 95.9%","accent-foreground":"24 9.8% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"60 9.1% 97.8%",border:"20 5.9% 90%",input:"20 5.9% 90%",ring:"24 9.8% 10%"},dark:{background:"24 9.8% 10%",foreground:"60 9.1% 97.8%",card:"24 9.8% 10%","card-foreground":"60 9.1% 97.8%",popover:"24 9.8% 10%","popover-foreground":"60 9.1% 97.8%",primary:"60 9.1% 97.8%","primary-foreground":"24 9.8% 10%",secondary:"12 6.5% 15.1%","secondary-foreground":"60 9.1% 97.8%",muted:"12 6.5% 15.1%","muted-foreground":"24 5.4% 63.9%",accent:"12 6.5% 15.1%","accent-foreground":"60 9.1% 97.8%",destructive:"0 62.8% 30.6%","destructive-foreground":"60 9.1% 97.8%",border:"12 6.5% 15.1%",input:"12 6.5% 15.1%",ring:"24 9.8% 10%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.147 0.004 49.25)",card:"oklch(1 0 0)","card-foreground":"oklch(0.147 0.004 49.25)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.147 0.004 49.25)",primary:"oklch(0.216 0.006 56.043)","primary-foreground":"oklch(0.97 0.001 106.424)",secondary:"oklch(0.97 0.001 106.424)","secondary-foreground":"oklch(0.216 0.006 56.043)",muted:"oklch(0.97 0.001 106.424)","muted-foreground":"oklch(0.553 0.013 58.071)",accent:"oklch(0.97 0.001 106.424)","accent-foreground":"oklch(0.216 0.006 56.043)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0.001 106.424)",border:"oklch(0.923 0.003 48.717)",input:"oklch(0.923 0.003 48.717)",ring:"oklch(0.216 0.006 56.043)"},dark:{background:"oklch(0.147 0.004 49.25)",foreground:"oklch(0.97 0.001 106.424)",card:"oklch(0.147 0.004 49.25)","card-foreground":"oklch(0.97 0.001 106.424)",popover:"oklch(0.147 0.004 49.25)","popover-foreground":"oklch(0.97 0.001 106.424)",primary:"oklch(0.97 0.001 106.424)","primary-foreground":"oklch(0.216 0.006 56.043)",secondary:"oklch(0.268 0.007 34.298)","secondary-foreground":"oklch(0.97 0.001 106.424)",muted:"oklch(0.268 0.007 34.298)","muted-foreground":"oklch(0.709 0.01 56.259)",accent:"oklch(0.268 0.007 34.298)","accent-foreground":"oklch(0.97 0.001 106.424)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.97 0.001 106.424)",border:"oklch(0.268 0.007 34.298)",input:"oklch(0.268 0.007 34.298)",ring:"oklch(0.87 0 0)"}}},gray:{hsl:{light:{background:"0 0% 100%",foreground:"224 71.4% 4.1%",card:"0 0% 100%","card-foreground":"224 71.4% 4.1%",popover:"0 0% 100%","popover-foreground":"224 71.4% 4.1%",primary:"220 9% 18%","primary-foreground":"220 14.3% 95.9%",secondary:"220 14.3% 95.9%","secondary-foreground":"220 9% 18%",muted:"220 14.3% 95.9%","muted-foreground":"220 8.9% 46.1%",accent:"220 14.3% 95.9%","accent-foreground":"220 9% 18%",destructive:"0 84.2% 60.2%","destructive-foreground":"220 14.3% 95.9%",border:"220 13% 91%",input:"220 13% 91%",ring:"224 71.4% 4.1%"},dark:{background:"224 71.4% 4.1%",foreground:"220 14.3% 95.9%",card:"224 71.4% 4.1%","card-foreground":"220 14.3% 95.9%",popover:"224 71.4% 4.1%","popover-foreground":"220 14.3% 95.9%",primary:"220 14.3% 95.9%","primary-foreground":"220 9% 18%",secondary:"220 9% 18%","secondary-foreground":"220 14.3% 95.9%",muted:"220 9% 18%","muted-foreground":"220 10% 64.9%",accent:"220 9% 18%","accent-foreground":"220 14.3% 95.9%",destructive:"0 62.8% 30.6%","destructive-foreground":"220 14.3% 95.9%",border:"220 9% 18%",input:"220 9% 18%",ring:"220 14.3% 95.9%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.13 0.028 261.692)",card:"oklch(1 0 0)","card-foreground":"oklch(0.13 0.028 261.692)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.13 0.028 261.692)",primary:"oklch(0.21 0.034 264.665)","primary-foreground":"oklch(0.967 0.003 264.542)",secondary:"oklch(0.967 0.003 264.542)","secondary-foreground":"oklch(0.21 0.034 264.665)",muted:"oklch(0.967 0.003 264.542)","muted-foreground":"oklch(0.551 0.027 264.364)",accent:"oklch(0.967 0.003 264.542)","accent-foreground":"oklch(0.21 0.034 264.665)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.967 0.003 264.542)",border:"oklch(0.928 0.006 264.531)",input:"oklch(0.928 0.006 264.531)",ring:"oklch(0.13 0.028 261.692)"},dark:{background:"oklch(0.13 0.028 261.692)",foreground:"oklch(0.967 0.003 264.542)",card:"oklch(0.13 0.028 261.692)","card-foreground":"oklch(0.967 0.003 264.542)",popover:"oklch(0.13 0.028 261.692)","popover-foreground":"oklch(0.967 0.003 264.542)",primary:"oklch(0.967 0.003 264.542)","primary-foreground":"oklch(0.21 0.034 264.665)",secondary:"oklch(0.278 0.033 256.848)","secondary-foreground":"oklch(0.967 0.003 264.542)",muted:"oklch(0.278 0.033 256.848)","muted-foreground":"oklch(0.707 0.022 261.325)",accent:"oklch(0.278 0.033 256.848)","accent-foreground":"oklch(0.967 0.003 264.542)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.967 0.003 264.542)",border:"oklch(0.278 0.033 256.848)",input:"oklch(0.278 0.033 256.848)",ring:"oklch(0.87 0 0)"}}},taupe:{hsl:{light:{background:"30 20% 98%",foreground:"30 10% 5%",card:"30 20% 98%","card-foreground":"30 10% 5%",popover:"30 20% 98%","popover-foreground":"30 10% 5%",primary:"30 10% 12%","primary-foreground":"30 20% 98%",secondary:"30 10% 92%","secondary-foreground":"30 10% 12%",muted:"30 10% 92%","muted-foreground":"30 5% 45%",accent:"30 10% 92%","accent-foreground":"30 10% 12%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"30 10% 88%",input:"30 10% 88%",ring:"30 10% 12%"},dark:{background:"30 10% 5%",foreground:"30 20% 98%",card:"30 10% 5%","card-foreground":"30 20% 98%",popover:"30 10% 5%","popover-foreground":"30 20% 98%",primary:"30 20% 98%","primary-foreground":"30 10% 12%",secondary:"30 10% 18%","secondary-foreground":"30 20% 98%",muted:"30 10% 18%","muted-foreground":"30 5% 65%",accent:"30 10% 18%","accent-foreground":"30 20% 98%",destructive:"0 70.9% 59.4%","destructive-foreground":"30 20% 98%",border:"30 10% 18%",input:"30 10% 18%",ring:"30 10% 84%"}},oklch:{light:{background:"oklch(0.986 0.002 67.8)",foreground:"oklch(0.147 0.004 49.3)",card:"oklch(0.986 0.002 67.8)","card-foreground":"oklch(0.147 0.004 49.3)",popover:"oklch(0.986 0.002 67.8)","popover-foreground":"oklch(0.147 0.004 49.3)",primary:"oklch(0.214 0.009 43.1)","primary-foreground":"oklch(0.986 0.002 67.8)",secondary:"oklch(0.922 0.005 34.3)","secondary-foreground":"oklch(0.214 0.009 43.1)",muted:"oklch(0.922 0.005 34.3)","muted-foreground":"oklch(0.547 0.021 43.1)",accent:"oklch(0.922 0.005 34.3)","accent-foreground":"oklch(0.214 0.009 43.1)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.868 0.007 39.5)",input:"oklch(0.868 0.007 39.5)",ring:"oklch(0.214 0.009 43.1)"},dark:{background:"oklch(0.147 0.004 49.3)",foreground:"oklch(0.986 0.002 67.8)",card:"oklch(0.147 0.004 49.3)","card-foreground":"oklch(0.986 0.002 67.8)",popover:"oklch(0.147 0.004 49.3)","popover-foreground":"oklch(0.986 0.002 67.8)",primary:"oklch(0.986 0.002 67.8)","primary-foreground":"oklch(0.214 0.009 43.1)",secondary:"oklch(0.268 0.011 36.5)","secondary-foreground":"oklch(0.986 0.002 67.8)",muted:"oklch(0.268 0.011 36.5)","muted-foreground":"oklch(0.714 0.014 41.2)",accent:"oklch(0.268 0.011 36.5)","accent-foreground":"oklch(0.986 0.002 67.8)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.986 0.002 67.8)",border:"oklch(0.268 0.011 36.5)",input:"oklch(0.268 0.011 36.5)",ring:"oklch(0.868 0.007 39.5)"}}},mauve:{hsl:{light:{background:"0 0% 100%",foreground:"326 5% 5%",card:"0 0% 100%","card-foreground":"326 5% 5%",popover:"0 0% 100%","popover-foreground":"326 5% 5%",primary:"322 10% 13%","primary-foreground":"0 0% 98%",secondary:"325 5% 95%","secondary-foreground":"322 10% 13%",muted:"325 5% 95%","muted-foreground":"322 8% 45%",accent:"325 5% 95%","accent-foreground":"322 10% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"325 5% 91%",input:"325 5% 91%",ring:"322 10% 13%"},dark:{background:"326 5% 5%",foreground:"0 0% 98%",card:"322 10% 13%","card-foreground":"0 0% 98%",popover:"322 10% 13%","popover-foreground":"0 0% 98%",primary:"325 5% 91%","primary-foreground":"322 10% 13%",secondary:"320 6% 17%","secondary-foreground":"0 0% 98%",muted:"320 6% 17%","muted-foreground":"323 6% 65%",accent:"320 6% 17%","accent-foreground":"0 0% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"0 0% 98%",border:"320 6% 17%",input:"320 6% 17%",ring:"322 8% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0.008 326)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0.008 326)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0.008 326)",primary:"oklch(0.212 0.019 322.12)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.96 0.003 325.6)","secondary-foreground":"oklch(0.212 0.019 322.12)",muted:"oklch(0.96 0.003 325.6)","muted-foreground":"oklch(0.542 0.034 322.5)",accent:"oklch(0.96 0.003 325.6)","accent-foreground":"oklch(0.212 0.019 322.12)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.922 0.005 325.62)",input:"oklch(0.922 0.005 325.62)",ring:"oklch(0.711 0.019 323.02)"},dark:{background:"oklch(0.145 0.008 326)",foreground:"oklch(0.985 0 0)",card:"oklch(0.212 0.019 322.12)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.212 0.019 322.12)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.922 0.005 325.62)","primary-foreground":"oklch(0.212 0.019 322.12)",secondary:"oklch(0.263 0.024 320.12)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.263 0.024 320.12)","muted-foreground":"oklch(0.711 0.019 323.02)",accent:"oklch(0.263 0.024 320.12)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.263 0.024 320.12)",input:"oklch(0.263 0.024 320.12)",ring:"oklch(0.542 0.034 322.5)"}}},olive:{hsl:{light:{background:"0 0% 100%",foreground:"107 3% 5%",card:"0 0% 100%","card-foreground":"107 3% 5%",popover:"0 0% 100%","popover-foreground":"107 3% 5%",primary:"107 6% 13%","primary-foreground":"107 4% 98%",secondary:"107 4% 95%","secondary-foreground":"107 6% 13%",muted:"107 4% 95%","muted-foreground":"107 9% 45%",accent:"107 4% 95%","accent-foreground":"107 6% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"107 4% 98%",border:"107 5% 91%",input:"107 5% 91%",ring:"107 6% 13%"},dark:{background:"107 3% 5%",foreground:"107 4% 98%",card:"107 6% 13%","card-foreground":"107 4% 98%",popover:"107 6% 13%","popover-foreground":"107 4% 98%",primary:"107 5% 91%","primary-foreground":"107 6% 13%",secondary:"107 4% 17%","secondary-foreground":"107 4% 98%",muted:"107 4% 17%","muted-foreground":"107 6% 65%",accent:"107 4% 17%","accent-foreground":"107 4% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"107 4% 98%",border:"107 4% 17%",input:"107 4% 17%",ring:"107 9% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.153 0.006 107.1)",card:"oklch(1 0 0)","card-foreground":"oklch(0.153 0.006 107.1)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.153 0.006 107.1)",primary:"oklch(0.228 0.013 107.4)","primary-foreground":"oklch(0.988 0.003 106.5)",secondary:"oklch(0.966 0.005 106.5)","secondary-foreground":"oklch(0.228 0.013 107.4)",muted:"oklch(0.966 0.005 106.5)","muted-foreground":"oklch(0.58 0.031 107.3)",accent:"oklch(0.966 0.005 106.5)","accent-foreground":"oklch(0.228 0.013 107.4)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.988 0.003 106.5)",border:"oklch(0.93 0.007 106.5)",input:"oklch(0.93 0.007 106.5)",ring:"oklch(0.737 0.021 106.9)"},dark:{background:"oklch(0.153 0.006 107.1)",foreground:"oklch(0.988 0.003 106.5)",card:"oklch(0.228 0.013 107.4)","card-foreground":"oklch(0.988 0.003 106.5)",popover:"oklch(0.228 0.013 107.4)","popover-foreground":"oklch(0.988 0.003 106.5)",primary:"oklch(0.93 0.007 106.5)","primary-foreground":"oklch(0.228 0.013 107.4)",secondary:"oklch(0.286 0.016 107.4)","secondary-foreground":"oklch(0.988 0.003 106.5)",muted:"oklch(0.286 0.016 107.4)","muted-foreground":"oklch(0.737 0.021 106.9)",accent:"oklch(0.286 0.016 107.4)","accent-foreground":"oklch(0.988 0.003 106.5)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.988 0.003 106.5)",border:"oklch(0.286 0.016 107.4)",input:"oklch(0.286 0.016 107.4)",ring:"oklch(0.58 0.031 107.3)"}}},mist:{hsl:{light:{background:"0 0% 100%",foreground:"228 4% 5%",card:"0 0% 100%","card-foreground":"228 4% 5%",popover:"0 0% 100%","popover-foreground":"228 4% 5%",primary:"223 6% 13%","primary-foreground":"197 2% 98%",secondary:"197 2% 95%","secondary-foreground":"223 6% 13%",muted:"197 2% 95%","muted-foreground":"213 7% 45%",accent:"197 2% 95%","accent-foreground":"223 6% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"197 2% 98%",border:"214 5% 91%",input:"214 5% 91%",ring:"223 6% 13%"},dark:{background:"228 4% 5%",foreground:"197 2% 98%",card:"223 6% 13%","card-foreground":"197 2% 98%",popover:"223 6% 13%","popover-foreground":"197 2% 98%",primary:"214 5% 91%","primary-foreground":"223 6% 13%",secondary:"216 4% 17%","secondary-foreground":"197 2% 98%",muted:"216 4% 17%","muted-foreground":"214 6% 65%",accent:"216 4% 17%","accent-foreground":"197 2% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"197 2% 98%",border:"216 4% 17%",input:"216 4% 17%",ring:"213 7% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.148 0.004 228.8)",card:"oklch(1 0 0)","card-foreground":"oklch(0.148 0.004 228.8)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.148 0.004 228.8)",primary:"oklch(0.218 0.008 223.9)","primary-foreground":"oklch(0.987 0.002 197.1)",secondary:"oklch(0.963 0.002 197.1)","secondary-foreground":"oklch(0.218 0.008 223.9)",muted:"oklch(0.963 0.002 197.1)","muted-foreground":"oklch(0.56 0.021 213.5)",accent:"oklch(0.963 0.002 197.1)","accent-foreground":"oklch(0.218 0.008 223.9)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.987 0.002 197.1)",border:"oklch(0.925 0.005 214.3)",input:"oklch(0.925 0.005 214.3)",ring:"oklch(0.723 0.014 214.4)"},dark:{background:"oklch(0.148 0.004 228.8)",foreground:"oklch(0.987 0.002 197.1)",card:"oklch(0.218 0.008 223.9)","card-foreground":"oklch(0.987 0.002 197.1)",popover:"oklch(0.218 0.008 223.9)","popover-foreground":"oklch(0.987 0.002 197.1)",primary:"oklch(0.925 0.005 214.3)","primary-foreground":"oklch(0.218 0.008 223.9)",secondary:"oklch(0.275 0.011 216.9)","secondary-foreground":"oklch(0.987 0.002 197.1)",muted:"oklch(0.275 0.011 216.9)","muted-foreground":"oklch(0.723 0.014 214.4)",accent:"oklch(0.275 0.011 216.9)","accent-foreground":"oklch(0.987 0.002 197.1)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.987 0.002 197.1)",border:"oklch(0.275 0.011 216.9)",input:"oklch(0.275 0.011 216.9)",ring:"oklch(0.56 0.021 213.5)"}}}},we={default:{radius:"0.5rem",fontSans:"Inter",defaultBaseColor:"slate"},"new-york":{radius:"0.5rem",fontSans:"Inter",defaultBaseColor:"zinc"},luma:{radius:"0.75rem",fontSans:"Inter",defaultBaseColor:"neutral"},lyra:{radius:"0.125rem",fontSans:"JetBrains Mono",defaultBaseColor:"stone"},maia:{radius:"1rem",fontSans:"Inter",defaultBaseColor:"neutral"},mira:{radius:"1.5rem",fontSans:"Inter",defaultBaseColor:"zinc"},nova:{radius:"0.125rem",fontSans:"Inter",defaultBaseColor:"neutral"},rhea:{radius:"1.5rem",fontSans:"Inter",defaultBaseColor:"neutral"},sera:{radius:"0rem",fontSans:"Instrument Serif",defaultBaseColor:"taupe"},vega:{radius:"0.625rem",fontSans:"Inter",defaultBaseColor:"neutral"}};function Ne(e,r,n,a,s){let o=we[e]??we["new-york"],t="zinc";n in K?t=n:t=o.defaultBaseColor;let i=K[t],d=o.radius,c=r==="uniwind"?"oklch":"hsl",p=a?re(a,c):null,x=ne(s??a??"blue",c),y=`:root {
5
+ Now add components with:`)),!n&&i&&console.log(` ${f.cyan(`cd ${i}`)}`),console.log(` ${f.cyan(`${m} lovdacn add`)} ${f.dim("[...components]")}`);}function Me(e){switch(e){case "pnpm":return "pnpm dlx";case "bun":return "bunx";case "yarn":return "yarn dlx";default:return "npx"}}function te(e){if(h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock")))return "bun";if(h.existsSync(b.join(e,"pnpm-lock.yaml")))return "pnpm";if(h.existsSync(b.join(e,"yarn.lock")))return "yarn";if(h.existsSync(b.join(e,"package-lock.json")))return "npm";let r=process.env.npm_config_user_agent||"";return r.startsWith("pnpm")?"pnpm":r.startsWith("bun")?"bun":r.startsWith("yarn")?"yarn":"npm"}var K={zinc:{hsl:{light:{background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%","card-foreground":"240 10% 3.9%",popover:"0 0% 100%","popover-foreground":"240 10% 3.9%",primary:"240 5.9% 10%","primary-foreground":"0 0% 98%",secondary:"240 4.8% 95.9%","secondary-foreground":"240 5.9% 10%",muted:"240 4.8% 95.9%","muted-foreground":"240 3.8% 46.1%",accent:"240 4.8% 95.9%","accent-foreground":"240 5.9% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"240 5.9% 90%",input:"240 5.9% 90%",ring:"240 5.9% 10%"},dark:{background:"240 10% 3.9%",foreground:"0 0% 98%",card:"240 10% 3.9%","card-foreground":"0 0% 98%",popover:"240 10% 3.9%","popover-foreground":"0 0% 98%",primary:"0 0% 98%","primary-foreground":"240 5.9% 10%",secondary:"240 3.7% 15.9%","secondary-foreground":"0 0% 98%",muted:"240 3.7% 15.9%","muted-foreground":"240 5% 64.9%",accent:"240 3.7% 15.9%","accent-foreground":"0 0% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"0 0% 98%",border:"240 3.7% 15.9%",input:"240 3.7% 15.9%",ring:"240 4.9% 83.9%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",primary:"oklch(0.205 0 0)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.205 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.145 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.145 0 0)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.985 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.269 0 0)",input:"oklch(0.269 0 0)",ring:"oklch(0.87 0 0)"}}},neutral:{hsl:{light:{background:"0 0% 100%",foreground:"0 0% 3.9%",card:"0 0% 100%","card-foreground":"0 0% 3.9%",popover:"0 0% 100%","popover-foreground":"0 0% 3.9%",primary:"0 0% 9%","primary-foreground":"0 0% 98%",secondary:"0 0% 96.1%","secondary-foreground":"0 0% 9%",muted:"0 0% 96.1%","muted-foreground":"0 0% 45.1%",accent:"0 0% 96.1%","accent-foreground":"0 0% 9%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"0 0% 89.8%",input:"0 0% 89.8%",ring:"0 0% 3.9%"},dark:{background:"0 0% 3.9%",foreground:"0 0% 98%",card:"0 0% 3.9%","card-foreground":"0 0% 98%",popover:"0 0% 3.9%","popover-foreground":"0 0% 98%",primary:"0 0% 98%","primary-foreground":"0 0% 9%",secondary:"0 0% 14.9%","secondary-foreground":"0 0% 98%",muted:"0 0% 14.9%","muted-foreground":"0 0% 63.9%",accent:"0 0% 14.9%","accent-foreground":"0 0% 98%",destructive:"0 70.9% 59.4%","destructive-foreground":"0 0% 98%",border:"0 0% 14.9%",input:"0 0% 14.9%",ring:"0 0% 83.1%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",primary:"oklch(0.205 0 0)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.205 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.145 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.145 0 0)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.985 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.269 0 0)",input:"oklch(0.269 0 0)",ring:"oklch(0.87 0 0)"}}},slate:{hsl:{light:{background:"0 0% 100%",foreground:"222.2 84% 4.9%",card:"0 0% 100%","card-foreground":"222.2 84% 4.9%",popover:"0 0% 100%","popover-foreground":"222.2 84% 4.9%",primary:"222.2 47.4% 11.2%","primary-foreground":"210 40% 98%",secondary:"210 40% 96.1%","secondary-foreground":"222.2 47.4% 11.2%",muted:"210 40% 96.1%","muted-foreground":"215.4 16.3% 46.9%",accent:"210 40% 96.1%","accent-foreground":"222.2 47.4% 11.2%",destructive:"0 84.2% 60.2%","destructive-foreground":"210 40% 98%",border:"214.3 31.8% 91.4%",input:"214.3 31.8% 91.4%",ring:"222.2 84% 4.9%"},dark:{background:"222.2 84% 4.9%",foreground:"210 40% 98%",card:"222.2 84% 4.9%","card-foreground":"210 40% 98%",popover:"222.2 84% 4.9%","popover-foreground":"210 40% 98%",primary:"210 40% 98%","primary-foreground":"222.2 47.4% 11.2%",secondary:"217.2 32.6% 17.5%","secondary-foreground":"210 40% 98%",muted:"217.2 32.6% 17.5%","muted-foreground":"215 20.2% 65.1%",accent:"217.2 32.6% 17.5%","accent-foreground":"210 40% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"210 40% 98%",border:"217.2 32.6% 17.5%",input:"217.2 32.6% 17.5%",ring:"224.3 76.3% 48%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.129 0.042 264.695)",card:"oklch(1 0 0)","card-foreground":"oklch(0.129 0.042 264.695)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.129 0.042 264.695)",primary:"oklch(0.208 0.042 265.755)","primary-foreground":"oklch(0.968 0.007 247.896)",secondary:"oklch(0.968 0.007 247.896)","secondary-foreground":"oklch(0.208 0.042 265.755)",muted:"oklch(0.968 0.007 247.896)","muted-foreground":"oklch(0.554 0.046 257.417)",accent:"oklch(0.968 0.007 247.896)","accent-foreground":"oklch(0.208 0.042 265.755)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.968 0.007 247.896)",border:"oklch(0.929 0.013 255.508)",input:"oklch(0.929 0.013 255.508)",ring:"oklch(0.129 0.042 264.695)"},dark:{background:"oklch(0.129 0.042 264.695)",foreground:"oklch(0.968 0.007 247.896)",card:"oklch(0.129 0.042 264.695)","card-foreground":"oklch(0.968 0.007 247.896)",popover:"oklch(0.129 0.042 264.695)","popover-foreground":"oklch(0.968 0.007 247.896)",primary:"oklch(0.968 0.007 247.896)","primary-foreground":"oklch(0.208 0.042 265.755)",secondary:"oklch(0.279 0.041 260.031)","secondary-foreground":"oklch(0.968 0.007 247.896)",muted:"oklch(0.279 0.041 260.031)","muted-foreground":"oklch(0.704 0.04 256.788)",accent:"oklch(0.279 0.041 260.031)","accent-foreground":"oklch(0.968 0.007 247.896)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.968 0.007 247.896)",border:"oklch(0.279 0.041 260.031)",input:"oklch(0.279 0.041 260.031)",ring:"oklch(0.87 0 0)"}}},stone:{hsl:{light:{background:"0 0% 100%",foreground:"24 9.8% 10%",card:"0 0% 100%","card-foreground":"24 9.8% 10%",popover:"0 0% 100%","popover-foreground":"24 9.8% 10%",primary:"24 9.8% 10%","primary-foreground":"60 9.1% 97.8%",secondary:"60 4.8% 95.9%","secondary-foreground":"24 9.8% 10%",muted:"60 4.8% 95.9%","muted-foreground":"25 5.3% 44.7%",accent:"60 4.8% 95.9%","accent-foreground":"24 9.8% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"60 9.1% 97.8%",border:"20 5.9% 90%",input:"20 5.9% 90%",ring:"24 9.8% 10%"},dark:{background:"24 9.8% 10%",foreground:"60 9.1% 97.8%",card:"24 9.8% 10%","card-foreground":"60 9.1% 97.8%",popover:"24 9.8% 10%","popover-foreground":"60 9.1% 97.8%",primary:"60 9.1% 97.8%","primary-foreground":"24 9.8% 10%",secondary:"12 6.5% 15.1%","secondary-foreground":"60 9.1% 97.8%",muted:"12 6.5% 15.1%","muted-foreground":"24 5.4% 63.9%",accent:"12 6.5% 15.1%","accent-foreground":"60 9.1% 97.8%",destructive:"0 62.8% 30.6%","destructive-foreground":"60 9.1% 97.8%",border:"12 6.5% 15.1%",input:"12 6.5% 15.1%",ring:"24 9.8% 10%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.147 0.004 49.25)",card:"oklch(1 0 0)","card-foreground":"oklch(0.147 0.004 49.25)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.147 0.004 49.25)",primary:"oklch(0.216 0.006 56.043)","primary-foreground":"oklch(0.97 0.001 106.424)",secondary:"oklch(0.97 0.001 106.424)","secondary-foreground":"oklch(0.216 0.006 56.043)",muted:"oklch(0.97 0.001 106.424)","muted-foreground":"oklch(0.553 0.013 58.071)",accent:"oklch(0.97 0.001 106.424)","accent-foreground":"oklch(0.216 0.006 56.043)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0.001 106.424)",border:"oklch(0.923 0.003 48.717)",input:"oklch(0.923 0.003 48.717)",ring:"oklch(0.216 0.006 56.043)"},dark:{background:"oklch(0.147 0.004 49.25)",foreground:"oklch(0.97 0.001 106.424)",card:"oklch(0.147 0.004 49.25)","card-foreground":"oklch(0.97 0.001 106.424)",popover:"oklch(0.147 0.004 49.25)","popover-foreground":"oklch(0.97 0.001 106.424)",primary:"oklch(0.97 0.001 106.424)","primary-foreground":"oklch(0.216 0.006 56.043)",secondary:"oklch(0.268 0.007 34.298)","secondary-foreground":"oklch(0.97 0.001 106.424)",muted:"oklch(0.268 0.007 34.298)","muted-foreground":"oklch(0.709 0.01 56.259)",accent:"oklch(0.268 0.007 34.298)","accent-foreground":"oklch(0.97 0.001 106.424)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.97 0.001 106.424)",border:"oklch(0.268 0.007 34.298)",input:"oklch(0.268 0.007 34.298)",ring:"oklch(0.87 0 0)"}}},gray:{hsl:{light:{background:"0 0% 100%",foreground:"224 71.4% 4.1%",card:"0 0% 100%","card-foreground":"224 71.4% 4.1%",popover:"0 0% 100%","popover-foreground":"224 71.4% 4.1%",primary:"220 9% 18%","primary-foreground":"220 14.3% 95.9%",secondary:"220 14.3% 95.9%","secondary-foreground":"220 9% 18%",muted:"220 14.3% 95.9%","muted-foreground":"220 8.9% 46.1%",accent:"220 14.3% 95.9%","accent-foreground":"220 9% 18%",destructive:"0 84.2% 60.2%","destructive-foreground":"220 14.3% 95.9%",border:"220 13% 91%",input:"220 13% 91%",ring:"224 71.4% 4.1%"},dark:{background:"224 71.4% 4.1%",foreground:"220 14.3% 95.9%",card:"224 71.4% 4.1%","card-foreground":"220 14.3% 95.9%",popover:"224 71.4% 4.1%","popover-foreground":"220 14.3% 95.9%",primary:"220 14.3% 95.9%","primary-foreground":"220 9% 18%",secondary:"220 9% 18%","secondary-foreground":"220 14.3% 95.9%",muted:"220 9% 18%","muted-foreground":"220 10% 64.9%",accent:"220 9% 18%","accent-foreground":"220 14.3% 95.9%",destructive:"0 62.8% 30.6%","destructive-foreground":"220 14.3% 95.9%",border:"220 9% 18%",input:"220 9% 18%",ring:"220 14.3% 95.9%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.13 0.028 261.692)",card:"oklch(1 0 0)","card-foreground":"oklch(0.13 0.028 261.692)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.13 0.028 261.692)",primary:"oklch(0.21 0.034 264.665)","primary-foreground":"oklch(0.967 0.003 264.542)",secondary:"oklch(0.967 0.003 264.542)","secondary-foreground":"oklch(0.21 0.034 264.665)",muted:"oklch(0.967 0.003 264.542)","muted-foreground":"oklch(0.551 0.027 264.364)",accent:"oklch(0.967 0.003 264.542)","accent-foreground":"oklch(0.21 0.034 264.665)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.967 0.003 264.542)",border:"oklch(0.928 0.006 264.531)",input:"oklch(0.928 0.006 264.531)",ring:"oklch(0.13 0.028 261.692)"},dark:{background:"oklch(0.13 0.028 261.692)",foreground:"oklch(0.967 0.003 264.542)",card:"oklch(0.13 0.028 261.692)","card-foreground":"oklch(0.967 0.003 264.542)",popover:"oklch(0.13 0.028 261.692)","popover-foreground":"oklch(0.967 0.003 264.542)",primary:"oklch(0.967 0.003 264.542)","primary-foreground":"oklch(0.21 0.034 264.665)",secondary:"oklch(0.278 0.033 256.848)","secondary-foreground":"oklch(0.967 0.003 264.542)",muted:"oklch(0.278 0.033 256.848)","muted-foreground":"oklch(0.707 0.022 261.325)",accent:"oklch(0.278 0.033 256.848)","accent-foreground":"oklch(0.967 0.003 264.542)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.967 0.003 264.542)",border:"oklch(0.278 0.033 256.848)",input:"oklch(0.278 0.033 256.848)",ring:"oklch(0.87 0 0)"}}},taupe:{hsl:{light:{background:"30 20% 98%",foreground:"30 10% 5%",card:"30 20% 98%","card-foreground":"30 10% 5%",popover:"30 20% 98%","popover-foreground":"30 10% 5%",primary:"30 10% 12%","primary-foreground":"30 20% 98%",secondary:"30 10% 92%","secondary-foreground":"30 10% 12%",muted:"30 10% 92%","muted-foreground":"30 5% 45%",accent:"30 10% 92%","accent-foreground":"30 10% 12%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"30 10% 88%",input:"30 10% 88%",ring:"30 10% 12%"},dark:{background:"30 10% 5%",foreground:"30 20% 98%",card:"30 10% 5%","card-foreground":"30 20% 98%",popover:"30 10% 5%","popover-foreground":"30 20% 98%",primary:"30 20% 98%","primary-foreground":"30 10% 12%",secondary:"30 10% 18%","secondary-foreground":"30 20% 98%",muted:"30 10% 18%","muted-foreground":"30 5% 65%",accent:"30 10% 18%","accent-foreground":"30 20% 98%",destructive:"0 70.9% 59.4%","destructive-foreground":"30 20% 98%",border:"30 10% 18%",input:"30 10% 18%",ring:"30 10% 84%"}},oklch:{light:{background:"oklch(0.986 0.002 67.8)",foreground:"oklch(0.147 0.004 49.3)",card:"oklch(0.986 0.002 67.8)","card-foreground":"oklch(0.147 0.004 49.3)",popover:"oklch(0.986 0.002 67.8)","popover-foreground":"oklch(0.147 0.004 49.3)",primary:"oklch(0.214 0.009 43.1)","primary-foreground":"oklch(0.986 0.002 67.8)",secondary:"oklch(0.922 0.005 34.3)","secondary-foreground":"oklch(0.214 0.009 43.1)",muted:"oklch(0.922 0.005 34.3)","muted-foreground":"oklch(0.547 0.021 43.1)",accent:"oklch(0.922 0.005 34.3)","accent-foreground":"oklch(0.214 0.009 43.1)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.97 0 0)",border:"oklch(0.868 0.007 39.5)",input:"oklch(0.868 0.007 39.5)",ring:"oklch(0.214 0.009 43.1)"},dark:{background:"oklch(0.147 0.004 49.3)",foreground:"oklch(0.986 0.002 67.8)",card:"oklch(0.147 0.004 49.3)","card-foreground":"oklch(0.986 0.002 67.8)",popover:"oklch(0.147 0.004 49.3)","popover-foreground":"oklch(0.986 0.002 67.8)",primary:"oklch(0.986 0.002 67.8)","primary-foreground":"oklch(0.214 0.009 43.1)",secondary:"oklch(0.268 0.011 36.5)","secondary-foreground":"oklch(0.986 0.002 67.8)",muted:"oklch(0.268 0.011 36.5)","muted-foreground":"oklch(0.714 0.014 41.2)",accent:"oklch(0.268 0.011 36.5)","accent-foreground":"oklch(0.986 0.002 67.8)",destructive:"oklch(0.396 0.141 25.723)","destructive-foreground":"oklch(0.986 0.002 67.8)",border:"oklch(0.268 0.011 36.5)",input:"oklch(0.268 0.011 36.5)",ring:"oklch(0.868 0.007 39.5)"}}},mauve:{hsl:{light:{background:"0 0% 100%",foreground:"326 5% 5%",card:"0 0% 100%","card-foreground":"326 5% 5%",popover:"0 0% 100%","popover-foreground":"326 5% 5%",primary:"322 10% 13%","primary-foreground":"0 0% 98%",secondary:"325 5% 95%","secondary-foreground":"322 10% 13%",muted:"325 5% 95%","muted-foreground":"322 8% 45%",accent:"325 5% 95%","accent-foreground":"322 10% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"325 5% 91%",input:"325 5% 91%",ring:"322 10% 13%"},dark:{background:"326 5% 5%",foreground:"0 0% 98%",card:"322 10% 13%","card-foreground":"0 0% 98%",popover:"322 10% 13%","popover-foreground":"0 0% 98%",primary:"325 5% 91%","primary-foreground":"322 10% 13%",secondary:"320 6% 17%","secondary-foreground":"0 0% 98%",muted:"320 6% 17%","muted-foreground":"323 6% 65%",accent:"320 6% 17%","accent-foreground":"0 0% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"0 0% 98%",border:"320 6% 17%",input:"320 6% 17%",ring:"322 8% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0.008 326)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0.008 326)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0.008 326)",primary:"oklch(0.212 0.019 322.12)","primary-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.96 0.003 325.6)","secondary-foreground":"oklch(0.212 0.019 322.12)",muted:"oklch(0.96 0.003 325.6)","muted-foreground":"oklch(0.542 0.034 322.5)",accent:"oklch(0.96 0.003 325.6)","accent-foreground":"oklch(0.212 0.019 322.12)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.922 0.005 325.62)",input:"oklch(0.922 0.005 325.62)",ring:"oklch(0.711 0.019 323.02)"},dark:{background:"oklch(0.145 0.008 326)",foreground:"oklch(0.985 0 0)",card:"oklch(0.212 0.019 322.12)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.212 0.019 322.12)","popover-foreground":"oklch(0.985 0 0)",primary:"oklch(0.922 0.005 325.62)","primary-foreground":"oklch(0.212 0.019 322.12)",secondary:"oklch(0.263 0.024 320.12)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.263 0.024 320.12)","muted-foreground":"oklch(0.711 0.019 323.02)",accent:"oklch(0.263 0.024 320.12)","accent-foreground":"oklch(0.985 0 0)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.985 0 0)",border:"oklch(0.263 0.024 320.12)",input:"oklch(0.263 0.024 320.12)",ring:"oklch(0.542 0.034 322.5)"}}},olive:{hsl:{light:{background:"0 0% 100%",foreground:"107 3% 5%",card:"0 0% 100%","card-foreground":"107 3% 5%",popover:"0 0% 100%","popover-foreground":"107 3% 5%",primary:"107 6% 13%","primary-foreground":"107 4% 98%",secondary:"107 4% 95%","secondary-foreground":"107 6% 13%",muted:"107 4% 95%","muted-foreground":"107 9% 45%",accent:"107 4% 95%","accent-foreground":"107 6% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"107 4% 98%",border:"107 5% 91%",input:"107 5% 91%",ring:"107 6% 13%"},dark:{background:"107 3% 5%",foreground:"107 4% 98%",card:"107 6% 13%","card-foreground":"107 4% 98%",popover:"107 6% 13%","popover-foreground":"107 4% 98%",primary:"107 5% 91%","primary-foreground":"107 6% 13%",secondary:"107 4% 17%","secondary-foreground":"107 4% 98%",muted:"107 4% 17%","muted-foreground":"107 6% 65%",accent:"107 4% 17%","accent-foreground":"107 4% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"107 4% 98%",border:"107 4% 17%",input:"107 4% 17%",ring:"107 9% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.153 0.006 107.1)",card:"oklch(1 0 0)","card-foreground":"oklch(0.153 0.006 107.1)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.153 0.006 107.1)",primary:"oklch(0.228 0.013 107.4)","primary-foreground":"oklch(0.988 0.003 106.5)",secondary:"oklch(0.966 0.005 106.5)","secondary-foreground":"oklch(0.228 0.013 107.4)",muted:"oklch(0.966 0.005 106.5)","muted-foreground":"oklch(0.58 0.031 107.3)",accent:"oklch(0.966 0.005 106.5)","accent-foreground":"oklch(0.228 0.013 107.4)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.988 0.003 106.5)",border:"oklch(0.93 0.007 106.5)",input:"oklch(0.93 0.007 106.5)",ring:"oklch(0.737 0.021 106.9)"},dark:{background:"oklch(0.153 0.006 107.1)",foreground:"oklch(0.988 0.003 106.5)",card:"oklch(0.228 0.013 107.4)","card-foreground":"oklch(0.988 0.003 106.5)",popover:"oklch(0.228 0.013 107.4)","popover-foreground":"oklch(0.988 0.003 106.5)",primary:"oklch(0.93 0.007 106.5)","primary-foreground":"oklch(0.228 0.013 107.4)",secondary:"oklch(0.286 0.016 107.4)","secondary-foreground":"oklch(0.988 0.003 106.5)",muted:"oklch(0.286 0.016 107.4)","muted-foreground":"oklch(0.737 0.021 106.9)",accent:"oklch(0.286 0.016 107.4)","accent-foreground":"oklch(0.988 0.003 106.5)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.988 0.003 106.5)",border:"oklch(0.286 0.016 107.4)",input:"oklch(0.286 0.016 107.4)",ring:"oklch(0.58 0.031 107.3)"}}},mist:{hsl:{light:{background:"0 0% 100%",foreground:"228 4% 5%",card:"0 0% 100%","card-foreground":"228 4% 5%",popover:"0 0% 100%","popover-foreground":"228 4% 5%",primary:"223 6% 13%","primary-foreground":"197 2% 98%",secondary:"197 2% 95%","secondary-foreground":"223 6% 13%",muted:"197 2% 95%","muted-foreground":"213 7% 45%",accent:"197 2% 95%","accent-foreground":"223 6% 13%",destructive:"0 84.2% 60.2%","destructive-foreground":"197 2% 98%",border:"214 5% 91%",input:"214 5% 91%",ring:"223 6% 13%"},dark:{background:"228 4% 5%",foreground:"197 2% 98%",card:"223 6% 13%","card-foreground":"197 2% 98%",popover:"223 6% 13%","popover-foreground":"197 2% 98%",primary:"214 5% 91%","primary-foreground":"223 6% 13%",secondary:"216 4% 17%","secondary-foreground":"197 2% 98%",muted:"216 4% 17%","muted-foreground":"214 6% 65%",accent:"216 4% 17%","accent-foreground":"197 2% 98%",destructive:"0 62.8% 30.6%","destructive-foreground":"197 2% 98%",border:"216 4% 17%",input:"216 4% 17%",ring:"213 7% 45%"}},oklch:{light:{background:"oklch(1 0 0)",foreground:"oklch(0.148 0.004 228.8)",card:"oklch(1 0 0)","card-foreground":"oklch(0.148 0.004 228.8)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.148 0.004 228.8)",primary:"oklch(0.218 0.008 223.9)","primary-foreground":"oklch(0.987 0.002 197.1)",secondary:"oklch(0.963 0.002 197.1)","secondary-foreground":"oklch(0.218 0.008 223.9)",muted:"oklch(0.963 0.002 197.1)","muted-foreground":"oklch(0.56 0.021 213.5)",accent:"oklch(0.963 0.002 197.1)","accent-foreground":"oklch(0.218 0.008 223.9)",destructive:"oklch(0.577 0.245 27.325)","destructive-foreground":"oklch(0.987 0.002 197.1)",border:"oklch(0.925 0.005 214.3)",input:"oklch(0.925 0.005 214.3)",ring:"oklch(0.723 0.014 214.4)"},dark:{background:"oklch(0.148 0.004 228.8)",foreground:"oklch(0.987 0.002 197.1)",card:"oklch(0.218 0.008 223.9)","card-foreground":"oklch(0.987 0.002 197.1)",popover:"oklch(0.218 0.008 223.9)","popover-foreground":"oklch(0.987 0.002 197.1)",primary:"oklch(0.925 0.005 214.3)","primary-foreground":"oklch(0.218 0.008 223.9)",secondary:"oklch(0.275 0.011 216.9)","secondary-foreground":"oklch(0.987 0.002 197.1)",muted:"oklch(0.275 0.011 216.9)","muted-foreground":"oklch(0.723 0.014 214.4)",accent:"oklch(0.275 0.011 216.9)","accent-foreground":"oklch(0.987 0.002 197.1)",destructive:"oklch(0.704 0.191 22.216)","destructive-foreground":"oklch(0.987 0.002 197.1)",border:"oklch(0.275 0.011 216.9)",input:"oklch(0.275 0.011 216.9)",ring:"oklch(0.56 0.021 213.5)"}}}},we={default:{radius:"0.5rem",fontSans:"Inter",defaultBaseColor:"slate"},"new-york":{radius:"0.5rem",fontSans:"Inter",defaultBaseColor:"zinc"},luma:{radius:"0.75rem",fontSans:"Inter",defaultBaseColor:"neutral"},lyra:{radius:"0.125rem",fontSans:"JetBrains Mono",defaultBaseColor:"stone"},maia:{radius:"1rem",fontSans:"Inter",defaultBaseColor:"neutral"},mira:{radius:"1.5rem",fontSans:"Inter",defaultBaseColor:"zinc"},nova:{radius:"0.125rem",fontSans:"Inter",defaultBaseColor:"neutral"},rhea:{radius:"1.5rem",fontSans:"Inter",defaultBaseColor:"neutral"},sera:{radius:"0rem",fontSans:"Instrument Serif",defaultBaseColor:"taupe"},vega:{radius:"0.625rem",fontSans:"Inter",defaultBaseColor:"neutral"}};function Ne(e,r,n,i,s){let o=we[e]??we["new-york"],t="zinc";n in K?t=n:t=o.defaultBaseColor;let a=K[t],d=o.radius,c=r==="uniwind"?"oklch":"hsl",p=i?re(i,c):null,x=ne(s??i??"blue",c),y=`:root {
6
6
  --font-sans: ${o.fontSans}, ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji,
7
7
  Segoe UI Symbol, Noto Color Emoji;
8
8
  --font-display:
@@ -13,11 +13,11 @@ Now add components with:`)),!n&&a&&console.log(` ${f.cyan(`cd ${a}`)}`),console
13
13
  --font-rounded: 'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif;
14
14
  --font-serif: Georgia, 'Times New Roman', serif;
15
15
  }
16
- `;if(r==="uniwind"){let g="";for(let[m,l]of Object.entries(i.oklch.light)){if(p&&m==="primary"){g+=` --primary: ${p.light.primary};
16
+ `;if(r==="uniwind"){let g="";for(let[m,l]of Object.entries(a.oklch.light)){if(p&&m==="primary"){g+=` --primary: ${p.light.primary};
17
17
  `;continue}if(p&&m==="primary-foreground"){g+=` --primary-foreground: ${p.light.foreground};
18
18
  `;continue}g+=` --${m}: ${l};
19
19
  `;}x.light.forEach((m,l)=>{g+=` --chart-${l+1}: ${m};
20
- `;});let u="";for(let[m,l]of Object.entries(i.oklch.dark)){if(p&&m==="primary"){u+=` --primary: ${p.dark.primary};
20
+ `;});let u="";for(let[m,l]of Object.entries(a.oklch.dark)){if(p&&m==="primary"){u+=` --primary: ${p.dark.primary};
21
21
  `;continue}if(p&&m==="primary-foreground"){u+=` --primary-foreground: ${p.dark.foreground};
22
22
  `;continue}u+=` --${m}: ${l};
23
23
  `;}return x.dark.forEach((m,l)=>{u+=` --chart-${l+1}: ${m};
@@ -67,11 +67,11 @@ ${g}}
67
67
  .dark {
68
68
  ${u}}
69
69
 
70
- ${y}`}else {let g="";for(let[m,l]of Object.entries(i.hsl.light)){if(p&&m==="primary"){g+=` --primary: ${p.light.primary};
70
+ ${y}`}else {let g="";for(let[m,l]of Object.entries(a.hsl.light)){if(p&&m==="primary"){g+=` --primary: ${p.light.primary};
71
71
  `;continue}if(p&&m==="primary-foreground"){g+=` --primary-foreground: ${p.light.foreground};
72
72
  `;continue}g+=` --${m}: ${l};
73
73
  `;}x.light.forEach((m,l)=>{g+=` --chart-${l+1}: ${m};
74
- `;});let u="";for(let[m,l]of Object.entries(i.hsl.dark)){if(p&&m==="primary"){u+=` --primary: ${p.dark.primary};
74
+ `;});let u="";for(let[m,l]of Object.entries(a.hsl.dark)){if(p&&m==="primary"){u+=` --primary: ${p.dark.primary};
75
75
  `;continue}if(p&&m==="primary-foreground"){u+=` --primary-foreground: ${p.dark.foreground};
76
76
  `;continue}u+=` --${m}: ${l};
77
77
  `;}return x.dark.forEach((m,l)=>{u+=` --chart-${l+1}: ${m};
@@ -84,49 +84,49 @@ ${g} }
84
84
  ${u} }
85
85
  }
86
86
 
87
- ${y}`}}async function se(e,r,n,a,s,o,t){let i=b.join(e,n);h.ensureDirSync(b.dirname(i));let d="";r==="uniwind"?(d+=`@import "tailwindcss";
87
+ ${y}`}}async function se(e,r,n,i,s,o,t){let a=b.join(e,n);h.ensureDirSync(b.dirname(a));let d="";r==="uniwind"?(d+=`@import "tailwindcss";
88
88
  `,d+=`@import "uniwind";
89
89
  `):(d+=`@tailwind base;
90
90
  `,d+=`@tailwind components;
91
91
  `,d+=`@tailwind utilities;
92
92
  `),d+=`
93
- `+Ne(a,r,s,o,t)+`
94
- `,h.writeFileSync(i,d,"utf8"),console.log(f.green(`\u2714 Configured global CSS for style ${f.cyan(a)}`));}async function $e(e){await se(e.projectPath,e.styleEngine,e.cssRelativePath,e.style,e.baseColor,e.theme,e.chartColor);}function De(e,r,n,a){let s=["metro.config.js","metro.config.ts","metro.config.cjs","metro.config.mjs"],o=null;for(let t of s)if(h.existsSync(b.join(e,t))){o=t;break}if(o){let t=b.join(e,o),i=h.readFileSync(t,"utf8");r==="uniwind"&&!i.includes("withUniwindConfig")?(i=`const { withUniwindConfig } = require('uniwind/metro');
95
- `+i,i.includes("module.exports = ")&&(i=i.replace(/module\.exports\s*=\s*(.+?)(;?\s*$)/s,`module.exports = withUniwindConfig($1, {
93
+ `+Ne(i,r,s,o,t)+`
94
+ `,h.writeFileSync(a,d,"utf8"),console.log(f.green(`\u2714 Configured global CSS for style ${f.cyan(i)}`));}async function $e(e){await se(e.projectPath,e.styleEngine,e.cssRelativePath,e.style,e.baseColor,e.theme,e.chartColor);}function De(e,r,n,i){let s=["metro.config.js","metro.config.ts","metro.config.cjs","metro.config.mjs"],o=null;for(let t of s)if(h.existsSync(b.join(e,t))){o=t;break}if(o){let t=b.join(e,o),a=h.readFileSync(t,"utf8");r==="uniwind"&&!a.includes("withUniwindConfig")?(a=`const { withUniwindConfig } = require('uniwind/metro');
95
+ `+a,a.includes("module.exports = ")&&(a=a.replace(/module\.exports\s*=\s*(.+?)(;?\s*$)/s,`module.exports = withUniwindConfig($1, {
96
96
  cssEntryFile: '${n}',
97
- dtsFile: '${a?"./src/uniwind-types.d.ts":"./uniwind-types.d.ts"}'
98
- })$2`)),h.writeFileSync(t,i,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(o)}`))):r==="nativewind"&&!i.includes("withNativeWind")&&(i=`const { withNativeWind } = require('nativewind/metro');
99
- `+i,i.includes("module.exports = ")&&(i=i.replace(/module\.exports\s*=\s*(.+?)(;?\s*$)/s,`module.exports = withNativeWind($1, { input: '${n}' })$2`)),h.writeFileSync(t,i,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(o)}`)));}else {let t=b.join(e,"metro.config.js"),i="";r==="uniwind"?i=`const { getDefaultConfig } = require('expo/metro-config');
97
+ dtsFile: '${i?"./src/uniwind-types.d.ts":"./uniwind-types.d.ts"}'
98
+ })$2`)),h.writeFileSync(t,a,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(o)}`))):r==="nativewind"&&!a.includes("withNativeWind")&&(a=`const { withNativeWind } = require('nativewind/metro');
99
+ `+a,a.includes("module.exports = ")&&(a=a.replace(/module\.exports\s*=\s*(.+?)(;?\s*$)/s,`module.exports = withNativeWind($1, { input: '${n}' })$2`)),h.writeFileSync(t,a,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(o)}`)));}else {let t=b.join(e,"metro.config.js"),a="";r==="uniwind"?a=`const { getDefaultConfig } = require('expo/metro-config');
100
100
  const { withUniwindConfig } = require('uniwind/metro');
101
101
 
102
102
  const config = getDefaultConfig(__dirname);
103
103
 
104
104
  module.exports = withUniwindConfig(config, {
105
105
  cssEntryFile: '${n}',
106
- dtsFile: '${a?"./src/uniwind-types.d.ts":"./uniwind-types.d.ts"}'
106
+ dtsFile: '${i?"./src/uniwind-types.d.ts":"./uniwind-types.d.ts"}'
107
107
  });
108
- `:i=`const { getDefaultConfig } = require("expo/metro-config");
108
+ `:a=`const { getDefaultConfig } = require("expo/metro-config");
109
109
  const { withNativeWind } = require('nativewind/metro');
110
110
 
111
111
  const config = getDefaultConfig(__dirname);
112
112
 
113
113
  module.exports = withNativeWind(config, { input: '${n}' });
114
- `,h.writeFileSync(t,i,"utf8"),console.log(f.green(`\u2714 Created ${f.cyan("metro.config.js")}`));}}function Ue(e,r){let n=["tailwind.config.js","tailwind.config.ts","tailwind.config.cjs","tailwind.config.mjs"],a=null;for(let g of n)if(h.existsSync(b.join(e,g))){a=g;break}if(!a){if(h.existsSync(r)){let g=b.join(e,"tailwind.config.js");h.copySync(r,g),console.log(f.green(`\u2714 Created ${f.cyan("tailwind.config.js")}`));}return}let s=b.join(e,a),o=h.readFileSync(s,"utf8"),t=o,i=[],d=/require\(\s*["']nativewind\/theme["']\s*\)/.test(o),c=/\bhairlineWidth\b/.test(o);d||(o=`const { hairlineWidth } = require("nativewind/theme");
115
- `+o,i.push("nativewind/theme import")),/darkMode\s*:/.test(o)||(o=o.replace(/module\.exports\s*=\s*\{/,`module.exports = {
116
- darkMode: "class",`),i.push("darkMode"));let p=!/colors\s*:\s*\{[^}]*hsl\(var\(--background\)\)/s.test(o),x=!/borderRadius\s*:\s*\{[^}]*var\(--radius\)/s.test(o),y=!/["']accordion-down["']\s*:/.test(o);if(p||x||y){let g=Be({includeColors:p,includeBorderRadius:x,includeBorderWidth:c?!/borderWidth\s*:/.test(o):false,includeKeyframes:y});/theme\s*:\s*\{\s*extend\s*:\s*\{\s*\}/.test(o)?o=o.replace(/theme\s*:\s*\{\s*extend\s*:\s*\{\s*\}\s*,?\s*\}/,`theme: {
114
+ `,h.writeFileSync(t,a,"utf8"),console.log(f.green(`\u2714 Created ${f.cyan("metro.config.js")}`));}}function Ue(e,r){let n=["tailwind.config.js","tailwind.config.ts","tailwind.config.cjs","tailwind.config.mjs"],i=null;for(let g of n)if(h.existsSync(b.join(e,g))){i=g;break}if(!i){if(h.existsSync(r)){let g=b.join(e,"tailwind.config.js");h.copySync(r,g),console.log(f.green(`\u2714 Created ${f.cyan("tailwind.config.js")}`));}return}let s=b.join(e,i),o=h.readFileSync(s,"utf8"),t=o,a=[],d=/require\(\s*["']nativewind\/theme["']\s*\)/.test(o),c=/\bhairlineWidth\b/.test(o);d||(o=`const { hairlineWidth } = require("nativewind/theme");
115
+ `+o,a.push("nativewind/theme import")),/darkMode\s*:/.test(o)||(o=o.replace(/module\.exports\s*=\s*\{/,`module.exports = {
116
+ darkMode: "class",`),a.push("darkMode"));let p=!/colors\s*:\s*\{[^}]*hsl\(var\(--background\)\)/s.test(o),x=!/borderRadius\s*:\s*\{[^}]*var\(--radius\)/s.test(o),y=!/["']accordion-down["']\s*:/.test(o);if(p||x||y){let g=Be({includeColors:p,includeBorderRadius:x,includeBorderWidth:c?!/borderWidth\s*:/.test(o):false,includeKeyframes:y});/theme\s*:\s*\{\s*extend\s*:\s*\{\s*\}/.test(o)?o=o.replace(/theme\s*:\s*\{\s*extend\s*:\s*\{\s*\}\s*,?\s*\}/,`theme: {
117
117
  extend: ${g}
118
118
  }`):/theme\s*:\s*\{\s*extend\s*:\s*\{/.test(o)?o=o.replace(/theme\s*:\s*\{\s*extend\s*:\s*\{/,u=>`${u}
119
119
  ...${g},`):/theme\s*:\s*\{/.test(o)?o=o.replace(/theme\s*:\s*\{/,`theme: {
120
120
  extend: ${g},`):o=o.replace(/module\.exports\s*=\s*\{/,`module.exports = {
121
121
  theme: {
122
122
  extend: ${g},
123
- },`),i.push("theme.extend (colors/borderRadius/keyframes)");}/["']?chart-1["']?\s*:/.test(o)||/card:\s*\{[^}]*hsl\(var\(--card-foreground\)\)[^}]*\},/s.test(o)&&(o=o.replace(/(card:\s*\{[^}]*hsl\(var\(--card-foreground\)\)[^}]*\},)/s,`$1
123
+ },`),a.push("theme.extend (colors/borderRadius/keyframes)");}/["']?chart-1["']?\s*:/.test(o)||/card:\s*\{[^}]*hsl\(var\(--card-foreground\)\)[^}]*\},/s.test(o)&&(o=o.replace(/(card:\s*\{[^}]*hsl\(var\(--card-foreground\)\)[^}]*\},)/s,`$1
124
124
  "chart-1": "hsl(var(--chart-1))",
125
125
  "chart-2": "hsl(var(--chart-2))",
126
126
  "chart-3": "hsl(var(--chart-3))",
127
127
  "chart-4": "hsl(var(--chart-4))",
128
- "chart-5": "hsl(var(--chart-5))",`),i.push("chart colors")),/tailwindcss-animate/.test(o)||(/plugins\s*:\s*\[\s*\]/.test(o)?o=o.replace(/plugins\s*:\s*\[\s*\]/,'plugins: [require("tailwindcss-animate")]'):/plugins\s*:\s*\[/.test(o)?o=o.replace(/plugins\s*:\s*\[/,'plugins: [require("tailwindcss-animate"), '):o=o.replace(/module\.exports\s*=\s*\{/,`module.exports = {
129
- plugins: [require("tailwindcss-animate")],`),i.push("tailwindcss-animate plugin")),o!==t&&(h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(a)} (${i.join(", ")})`)));}function Be(e){let r=[];return e.includeColors&&r.push(` colors: {
128
+ "chart-5": "hsl(var(--chart-5))",`),a.push("chart colors")),/tailwindcss-animate/.test(o)||(/plugins\s*:\s*\[\s*\]/.test(o)?o=o.replace(/plugins\s*:\s*\[\s*\]/,'plugins: [require("tailwindcss-animate")]'):/plugins\s*:\s*\[/.test(o)?o=o.replace(/plugins\s*:\s*\[/,'plugins: [require("tailwindcss-animate"), '):o=o.replace(/module\.exports\s*=\s*\{/,`module.exports = {
129
+ plugins: [require("tailwindcss-animate")],`),a.push("tailwindcss-animate plugin")),o!==t&&(h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(i)} (${a.join(", ")})`)));}function Be(e){let r=[];return e.includeColors&&r.push(` colors: {
130
130
  border: "hsl(var(--border))",
131
131
  input: "hsl(var(--input))",
132
132
  ring: "hsl(var(--ring))",
@@ -190,14 +190,14 @@ module.exports = withNativeWind(config, { input: '${n}' });
190
190
  }`)),`{
191
191
  ${r.join(`,
192
192
  `)},
193
- }`}function Ve(e){let r=["babel.config.js","babel.config.cjs"],n=null;for(let a of r)if(h.existsSync(b.join(e,a))){n=a;break}if(n){let a=b.join(e,n),s=h.readFileSync(a,"utf8");s.includes("nativewind/babel")||(s=s.replace(/presets:\s*\[\s*(['"])babel-preset-expo\1\s*\]/,'presets: [["babel-preset-expo", { jsxImportSource: "nativewind" }], "nativewind/babel"]'),h.writeFileSync(a,s,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(n)}`)));}}function Ge(e,r){let n=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],a=null;for(let s of n)if(h.existsSync(b.join(e,s))){a=s;break}if(a){let s=b.join(e,a),o=h.readFileSync(s,"utf8"),t=b.dirname(b.join(e,a)),i=b.resolve(e,r),d=b.relative(t,i).replace(/\\/g,"/");d.startsWith(".")||(d="./"+d),o.includes("global.css")||o.includes("globals.css")||(o=`import "${d}";
194
- `+o,h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(a)}`)));}}function He(e){let r=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],n=null;for(let i of r)if(h.existsSync(b.join(e,i))){n=i;break}if(!n)return;let a=b.join(e,n),o=h.readFileSync(a,"utf8"),t=[];if(o.includes("PortalHost")||(o.includes("</ThemeProvider>")?(o=o.replace(/(\s*)<\/ThemeProvider>/,`$1 <PortalHost />
193
+ }`}function Ve(e){let r=["babel.config.js","babel.config.cjs"],n=null;for(let i of r)if(h.existsSync(b.join(e,i))){n=i;break}if(n){let i=b.join(e,n),s=h.readFileSync(i,"utf8");s.includes("nativewind/babel")||(s=s.replace(/presets:\s*\[\s*(['"])babel-preset-expo\1\s*\]/,'presets: [["babel-preset-expo", { jsxImportSource: "nativewind" }], "nativewind/babel"]'),h.writeFileSync(i,s,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(n)}`)));}}function Ge(e,r){let n=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],i=null;for(let s of n)if(h.existsSync(b.join(e,s))){i=s;break}if(i){let s=b.join(e,i),o=h.readFileSync(s,"utf8"),t=b.dirname(b.join(e,i)),a=b.resolve(e,r),d=b.relative(t,a).replace(/\\/g,"/");d.startsWith(".")||(d="./"+d),o.includes("global.css")||o.includes("globals.css")||(o=`import "${d}";
194
+ `+o,h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Updated ${f.cyan(i)}`)));}}function He(e){let r=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],n=null;for(let a of r)if(h.existsSync(b.join(e,a))){n=a;break}if(!n)return;let i=b.join(e,n),o=h.readFileSync(i,"utf8"),t=[];if(o.includes("PortalHost")||(o.includes("</ThemeProvider>")?(o=o.replace(/(\s*)<\/ThemeProvider>/,`$1 <PortalHost />
195
195
  $1</ThemeProvider>`),t.push("PortalHost")):o.includes("</>")&&(o=o.replace(/(\s*)<\/>/,`$1 <PortalHost />
196
196
  $1</>`),t.push("PortalHost")),t.includes("PortalHost")&&(o=`import { PortalHost } from "@rn-primitives/portal";
197
- ${o}`)),!o.includes("GestureHandlerRootView")){let i=o.indexOf("<ThemeProvider"),d="</ThemeProvider>",c=o.lastIndexOf(d);if(i!==-1&&c!==-1&&c>i){let p=o.slice(0,i),x=o.slice(i,c+d.length),y=o.slice(c+d.length);o=p+`<GestureHandlerRootView style={{ flex: 1 }}>
197
+ ${o}`)),!o.includes("GestureHandlerRootView")){let a=o.indexOf("<ThemeProvider"),d="</ThemeProvider>",c=o.lastIndexOf(d);if(a!==-1&&c!==-1&&c>a){let p=o.slice(0,a),x=o.slice(a,c+d.length),y=o.slice(c+d.length);o=p+`<GestureHandlerRootView style={{ flex: 1 }}>
198
198
  `+x+`
199
199
  </GestureHandlerRootView>`+y,o=`import { GestureHandlerRootView } from "react-native-gesture-handler";
200
- ${o}`,t.push("GestureHandlerRootView");}}t.length!==0&&(h.writeFileSync(a,o,"utf8"),console.log(f.green(`Updated ${f.cyan(n)} with ${t.join(" + ")}`)));}function We(e,r){let n={npm:["package-lock.json"],yarn:["yarn.lock"],pnpm:["pnpm-lock.yaml"],bun:["bun.lock","bun.lockb"]};for(let[s,o]of Object.entries(n))if(s!==r)for(let t of o){let i=b.join(e,t);h.existsSync(i)&&h.removeSync(i);}let a=b.join(e,"package.json");if(h.existsSync(a))try{let s=h.readJsonSync(a);delete s.packageManager,h.writeJsonSync(a,s,{spaces:2});}catch{}}function R(e){let r=e.split(/\s+/);if(r.length<3)return "#ffffff";let[n="0",a="0%",s="0%"]=r,o=parseFloat(n),t=parseFloat(a.replace("%",""))/100,i=parseFloat(s.replace("%",""))/100,d=x=>(x+o/30)%12,c=t*Math.min(i,1-i),p=x=>{let y=i-c*Math.max(-1,Math.min(d(x)-3,9-d(x),1));return Math.round(255*y).toString(16).padStart(2,"0")};return `#${p(0)}${p(8)}${p(4)}`}function Se(e,r){let n=["src/constants/theme.ts","constants/theme.ts","src/constants/theme.js","constants/theme.js"],a=null;for(let C of n)if(h.existsSync(b.join(e,C))){a=C;break}if(!a)return;let s=b.join(e,a),o=h.readFileSync(s,"utf8"),t="zinc";r in K?t=r:t="neutral";let i=K[t],d=R(i.hsl.light.background),c=R(i.hsl.light.foreground),p=R(i.hsl.light.muted),x=R(i.hsl.light.accent),y=R(i.hsl.light["muted-foreground"]),g=R(i.hsl.dark.background),u=R(i.hsl.dark.foreground),m=R(i.hsl.dark.muted),l=R(i.hsl.dark.accent),v=R(i.hsl.dark["muted-foreground"]),w=`export const Colors = {
200
+ ${o}`,t.push("GestureHandlerRootView");}}t.length!==0&&(h.writeFileSync(i,o,"utf8"),console.log(f.green(`Updated ${f.cyan(n)} with ${t.join(" + ")}`)));}function We(e,r){let n={npm:["package-lock.json"],yarn:["yarn.lock"],pnpm:["pnpm-lock.yaml"],bun:["bun.lock","bun.lockb"]};for(let[s,o]of Object.entries(n))if(s!==r)for(let t of o){let a=b.join(e,t);h.existsSync(a)&&h.removeSync(a);}let i=b.join(e,"package.json");if(h.existsSync(i))try{let s=h.readJsonSync(i);delete s.packageManager,h.writeJsonSync(i,s,{spaces:2});}catch{}}function R(e){let r=e.split(/\s+/);if(r.length<3)return "#ffffff";let[n="0",i="0%",s="0%"]=r,o=parseFloat(n),t=parseFloat(i.replace("%",""))/100,a=parseFloat(s.replace("%",""))/100,d=x=>(x+o/30)%12,c=t*Math.min(a,1-a),p=x=>{let y=a-c*Math.max(-1,Math.min(d(x)-3,9-d(x),1));return Math.round(255*y).toString(16).padStart(2,"0")};return `#${p(0)}${p(8)}${p(4)}`}function Se(e,r){let n=["src/constants/theme.ts","constants/theme.ts","src/constants/theme.js","constants/theme.js"],i=null;for(let C of n)if(h.existsSync(b.join(e,C))){i=C;break}if(!i)return;let s=b.join(e,i),o=h.readFileSync(s,"utf8"),t="zinc";r in K?t=r:t="neutral";let a=K[t],d=R(a.hsl.light.background),c=R(a.hsl.light.foreground),p=R(a.hsl.light.muted),x=R(a.hsl.light.accent),y=R(a.hsl.light["muted-foreground"]),g=R(a.hsl.dark.background),u=R(a.hsl.dark.foreground),m=R(a.hsl.dark.muted),l=R(a.hsl.dark.accent),v=R(a.hsl.dark["muted-foreground"]),w=`export const Colors = {
201
201
  light: {
202
202
  text: '${c}',
203
203
  background: '${d}',
@@ -212,13 +212,13 @@ ${o}`,t.push("GestureHandlerRootView");}}t.length!==0&&(h.writeFileSync(a,o,"utf
212
212
  backgroundSelected: '${l}',
213
213
  textSecondary: '${v}',
214
214
  },
215
- } as const;`;o=o.replace(/export\s+const\s+Colors\s*=\s*\{[\s\S]*?\}\s*as\s+const;/g,w),h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Configured theme colors in ${f.cyan(a)}`));}var qe=fileURLToPath(import.meta.url),W=b.dirname(qe),Ke=new Set(["alert-dialog","context-menu","dialog","dropdown-menu","hover-card","popover","select","tooltip"]),Ze="@rn-primitives/portal@^1.5.2",Qe="react-native-gesture-handler";function Xe(e){try{let r=h.readJsonSync(b.join(e,"package.json"));return !!(r?.dependencies?.expo||r?.devDependencies?.expo)}catch{return false}}function eo(e,r,n){if(!n)return {cmd:e,args:["install",...r]};switch(e){case "pnpm":return {cmd:"pnpm",args:["exec","expo","install",...r]};case "yarn":return {cmd:"yarn",args:["expo","install",...r]};case "bun":return {cmd:"bunx",args:["expo","install",...r]};default:return {cmd:"npx",args:["expo","install",...r]}}}var oo=z$1.object({components:z$1.array(z$1.string()).optional(),yes:z$1.boolean().default(false),overwrite:z$1.boolean().default(false),cwd:z$1.string(),packageManager:z$1.enum(["npm","yarn","pnpm","bun"]).optional()}),Ee=new Command().name("add").description("add components to your project").argument("[components...]","the components to add").option("-y, --yes","skip confirmation prompt.",false).option("-o, --overwrite","overwrite existing files.",false).option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-p, --package-manager <package-manager>","the package manager to use. (npm, yarn, pnpm, bun)").action(async(e,r)=>{try{let n=oo.parse({components:e,...r,cwd:b.resolve(r.cwd)});await ie(n);}catch(n){console.error(f.red(`
216
- Component installation failed:`)),console.error(n),process.exit(1);}});async function ie(e){let r=e.cwd,n=b.join(r,"lvcn.json");if(!h.existsSync(n))throw new Error("Configuration file 'lvcn.json' not found. Please run 'init' first to configure your project.");let a=h.readJsonSync(n),s=e.components||[];if(s.length===0){let g=await U({type:"multiselect",name:"components",message:"Which components would you like to add?",choices:["accordion","alert","alert-dialog","aspect-ratio","avatar","badge","button","card","checkbox","collapsible","context-menu","dialog","dropdown-menu","hover-card","icon","input","label","menubar","native-only-animated-view","popover","progress","radio-group","select","separator","skeleton","switch","tabs","text","textarea","toggle","toggle-group","tooltip"].map(u=>({title:u,value:u})),instructions:"Space to select. A to toggle all. Enter to submit."});(!g.components||g.components.length===0)&&process.exit(0),s=g.components;}let o=a.style||"default",t=a.styleEngine||"nativewind",i=e.packageManager||to(r),d=[...s],c=new Set,p=new Set,x=[];for(;d.length>0;){let y=d.shift();if(c.has(y))continue;console.log(f.blue(`Resolving ${f.cyan(y)}...`));let g;try{g=await ao(y,o,t);}catch(u){throw new Error(`Component '${y}' not found in registry under style '${o}' and engine '${t}': ${u.message}`)}c.add(y),g.dependencies&&g.dependencies.forEach(u=>p.add(u)),g.registryDependencies&&g.registryDependencies.forEach(u=>{c.has(u)||d.push(u);}),g.files&&x.push(...g.files);}if(Array.from(c).some(y=>Ke.has(y))&&(p.add(Ze),p.add(Qe),ro(r)),p.size>0){let y=Array.from(p);console.log(f.blue(`Installing npm dependencies: ${f.cyan(y.join(", "))}...`));let{cmd:g,args:u}=eo(i,y,Xe(r));await execa(g,u,{cwd:r,stdio:"inherit"});}for(let y of x){let g=a.aliases||{},u=y.path,m;if(u.startsWith("components/ui/")){let v=b.basename(u),w=ae(r,g.ui||"@/components/ui");m=b.join(w,v);}else if(u.startsWith("components/")){let v=b.basename(u),w=ae(r,g.components||"@/components");m=b.join(w,v);}else if(u.includes("utils")){let v=ae(r,g.utils||"@/lib/utils");m=v.endsWith(".ts")||v.endsWith(".js")?v:v+(a.tsx?".ts":".js");}else m=b.join(r,u);if(h.ensureDirSync(b.dirname(m)),h.existsSync(m)&&!e.overwrite&&!e.yes&&!(await U({type:"confirm",name:"overwrite",message:`File ${f.cyan(b.relative(r,m))} already exists. Overwrite?`,initial:false})).overwrite){console.log(f.yellow(`Skipped ${b.relative(r,m)}`));continue}let l=no(y.content,g);h.writeFileSync(m,l,"utf8"),console.log(f.green(`\u2714 Created ${f.cyan(b.relative(r,m))}`));}a.components||(a.components=[]);for(let y of c)a.components.includes(y)||a.components.push(y);h.writeJsonSync(n,a,{spaces:2}),console.log(f.green(`
217
- Component(s) added successfully! \u{1F389}`));}function ro(e){let r=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],n=null;for(let i of r)if(h.existsSync(b.join(e,i))){n=i;break}if(!n)return;let a=b.join(e,n),o=h.readFileSync(a,"utf8"),t=[];if(o.includes("PortalHost")||(o.includes("</ThemeProvider>")?(o=o.replace(/(\s*)<\/ThemeProvider>/,`$1 <PortalHost />
215
+ } as const;`;o=o.replace(/export\s+const\s+Colors\s*=\s*\{[\s\S]*?\}\s*as\s+const;/g,w),h.writeFileSync(s,o,"utf8"),console.log(f.green(`\u2714 Configured theme colors in ${f.cyan(i)}`));}var qe=fileURLToPath(import.meta.url),W=b.dirname(qe),Ke=new Set(["alert-dialog","context-menu","dialog","dropdown-menu","hover-card","popover","select","tooltip"]),Ze="@rn-primitives/portal@^1.5.2",Qe="react-native-gesture-handler";function Xe(e){try{let r=h.readJsonSync(b.join(e,"package.json"));return !!(r?.dependencies?.expo||r?.devDependencies?.expo)}catch{return false}}function eo(e,r,n){if(!n)return {cmd:e,args:["install",...r]};switch(e){case "pnpm":return {cmd:"pnpm",args:["exec","expo","install",...r]};case "yarn":return {cmd:"yarn",args:["expo","install",...r]};case "bun":return {cmd:"bunx",args:["expo","install",...r]};default:return {cmd:"npx",args:["expo","install",...r]}}}var oo=z$1.object({components:z$1.array(z$1.string()).optional(),yes:z$1.boolean().default(false),overwrite:z$1.boolean().default(false),cwd:z$1.string(),packageManager:z$1.enum(["npm","yarn","pnpm","bun"]).optional()}),Ee=new Command().name("add").description("add components to your project").argument("[components...]","the components to add").option("-y, --yes","skip confirmation prompt.",false).option("-o, --overwrite","overwrite existing files.",false).option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-p, --package-manager <package-manager>","the package manager to use. (npm, yarn, pnpm, bun)").action(async(e,r)=>{try{let n=oo.parse({components:e,...r,cwd:b.resolve(r.cwd)});await ae(n);}catch(n){console.error(f.red(`
216
+ Component installation failed:`)),console.error(n),process.exit(1);}});async function ae(e){let r=e.cwd,n=b.join(r,"lvcn.json");if(!h.existsSync(n))throw new Error("Configuration file 'lvcn.json' not found. Please run 'init' first to configure your project.");let i=h.readJsonSync(n),s=e.components||[];if(s.length===0){let g=await U({type:"multiselect",name:"components",message:"Which components would you like to add?",choices:["accordion","alert","alert-dialog","aspect-ratio","avatar","badge","button","card","checkbox","collapsible","context-menu","dialog","dropdown-menu","hover-card","icon","input","label","menubar","native-only-animated-view","popover","progress","radio-group","select","separator","skeleton","switch","tabs","text","textarea","toggle","toggle-group","tooltip"].map(u=>({title:u,value:u})),instructions:"Space to select. A to toggle all. Enter to submit."});(!g.components||g.components.length===0)&&process.exit(0),s=g.components;}let o=i.style||"default",t=i.styleEngine||"nativewind",a=e.packageManager||to(r),d=[...s],c=new Set,p=new Set,x=[];for(;d.length>0;){let y=d.shift();if(c.has(y))continue;console.log(f.blue(`Resolving ${f.cyan(y)}...`));let g;try{g=await io(y,o,t);}catch(u){throw new Error(`Component '${y}' not found in registry under style '${o}' and engine '${t}': ${u.message}`)}c.add(y),g.dependencies&&g.dependencies.forEach(u=>p.add(u)),g.registryDependencies&&g.registryDependencies.forEach(u=>{c.has(u)||d.push(u);}),g.files&&x.push(...g.files);}if(Array.from(c).some(y=>Ke.has(y))&&(p.add(Ze),p.add(Qe),ro(r)),p.size>0){let y=Array.from(p);console.log(f.blue(`Installing npm dependencies: ${f.cyan(y.join(", "))}...`));let{cmd:g,args:u}=eo(a,y,Xe(r));await execa(g,u,{cwd:r,stdio:"inherit"});}for(let y of x){let g=i.aliases||{},u=y.path,m;if(u.startsWith("components/ui/")){let v=b.basename(u),w=ie(r,g.ui||"@/components/ui");m=b.join(w,v);}else if(u.startsWith("components/")){let v=b.basename(u),w=ie(r,g.components||"@/components");m=b.join(w,v);}else if(u.includes("utils")){let v=ie(r,g.utils||"@/lib/utils");m=v.endsWith(".ts")||v.endsWith(".js")?v:v+(i.tsx?".ts":".js");}else m=b.join(r,u);if(h.ensureDirSync(b.dirname(m)),h.existsSync(m)&&!e.overwrite&&!e.yes&&!(await U({type:"confirm",name:"overwrite",message:`File ${f.cyan(b.relative(r,m))} already exists. Overwrite?`,initial:false})).overwrite){console.log(f.yellow(`Skipped ${b.relative(r,m)}`));continue}let l=no(y.content,g);h.writeFileSync(m,l,"utf8"),console.log(f.green(`\u2714 Created ${f.cyan(b.relative(r,m))}`));}i.components||(i.components=[]);for(let y of c)i.components.includes(y)||i.components.push(y);h.writeJsonSync(n,i,{spaces:2}),console.log(f.green(`
217
+ Component(s) added successfully! \u{1F389}`));}function ro(e){let r=["src/app/_layout.tsx","app/_layout.tsx","src/app/_layout.jsx","app/_layout.jsx","src/app/_layout.js","app/_layout.js","App.tsx","App.jsx","App.js","src/App.tsx","src/App.js"],n=null;for(let a of r)if(h.existsSync(b.join(e,a))){n=a;break}if(!n)return;let i=b.join(e,n),o=h.readFileSync(i,"utf8"),t=[];if(o.includes("PortalHost")||(o.includes("</ThemeProvider>")?(o=o.replace(/(\s*)<\/ThemeProvider>/,`$1 <PortalHost />
218
218
  $1</ThemeProvider>`),t.push("PortalHost")):o.includes("</>")&&(o=o.replace(/(\s*)<\/>/,`$1 <PortalHost />
219
219
  $1</>`),t.push("PortalHost")),t.includes("PortalHost")&&(o=`import { PortalHost } from "@rn-primitives/portal";
220
- ${o}`)),!o.includes("GestureHandlerRootView")){let i=o.indexOf("<ThemeProvider"),d="</ThemeProvider>",c=o.lastIndexOf(d);if(i!==-1&&c!==-1&&c>i){let p=o.slice(0,i),x=o.slice(i,c+d.length),y=o.slice(c+d.length);o=p+`<GestureHandlerRootView style={{ flex: 1 }}>
220
+ ${o}`)),!o.includes("GestureHandlerRootView")){let a=o.indexOf("<ThemeProvider"),d="</ThemeProvider>",c=o.lastIndexOf(d);if(a!==-1&&c!==-1&&c>a){let p=o.slice(0,a),x=o.slice(a,c+d.length),y=o.slice(c+d.length);o=p+`<GestureHandlerRootView style={{ flex: 1 }}>
221
221
  `+x+`
222
222
  </GestureHandlerRootView>`+y,o=`import { GestureHandlerRootView } from "react-native-gesture-handler";
223
- ${o}`,t.push("GestureHandlerRootView");}}t.length!==0&&(h.writeFileSync(a,o,"utf8"),console.log(f.green(`Updated ${f.cyan(n)} with ${t.join(" + ")}`)));}function ae(e,r){let n=r.replace(/^([@~]\/)/,"");return h.existsSync(b.join(e,"src"))&&!n.startsWith("src/")?b.resolve(e,"src",n):b.resolve(e,n)}function no(e,r){let n=c=>c.replace(/\/+$/,""),a=n(r.ui||"@/components/ui"),s=n(r.components||"@/components"),o=n(r.utils||"@/lib/utils"),t="__LOVDA_UI_ALIAS__",i="__LOVDA_UTILS_ALIAS__",d=e.replace(/@\/registry\/(?:nativewind|uniwind)\//g,"@/").replace(/~\/components\/ui\//g,"@/components/ui/").replace(/~\/components\//g,"@/components/").replace(/~\/lib\/utils/g,"@/lib/utils");return d=d.replace(/@\/components\/ui\//g,`${t}/`).replace(/@\/lib\/utils/g,i).replace(/@\/components\//g,`${s}/`).replace(new RegExp(`${t}/`,"g"),`${a}/`).replace(new RegExp(i,"g"),o),d}function to(e){if(h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock")))return "bun";if(h.existsSync(b.join(e,"pnpm-lock.yaml")))return "pnpm";if(h.existsSync(b.join(e,"yarn.lock")))return "yarn";if(h.existsSync(b.join(e,"package-lock.json")))return "npm";let r=process.env.npm_config_user_agent||"";return r.startsWith("pnpm")?"pnpm":r.startsWith("bun")?"bun":r.startsWith("yarn")?"yarn":"npm"}function so(){if(process.env.LOVDA_REGISTRY_URL)return process.env.LOVDA_REGISTRY_URL;let e=[b.resolve(W,"../../../apps/v2/public/r"),b.resolve(W,"../../../../apps/v2/public/r"),b.resolve(W,"../../apps/v2/public/r"),b.resolve(W,"../../../../../apps/v2/public/r"),b.resolve(W,"../../../../../../apps/v2/public/r")];for(let r of e)if(h.existsSync(r))return r;return X}async function ao(e,r,n){let a=so();if(a.startsWith("file://")||!a.startsWith("http")){let s=a.replace("file://",""),o=b.resolve(s,`styles/${n}/${r}/${e}.json`);return await h.readJson(o)}else {let s=await fetch(`${a}/styles/${n}/${r}/${e}.json`);if(!s.ok)throw new Error(`Failed to fetch component from registry: ${s.statusText}`);return await s.json()}}var co=new Command().name("decode").description("decode a preset code into its values").argument("<code>","the preset code to decode").option("--json","output as JSON",false).action((e,r)=>{let n=L(e);if(n||(console.error(f.red(`Invalid preset code: ${e}`)),process.exit(1)),r.json){console.log(JSON.stringify({code:e,values:n},null,2));return}console.log(),console.log(` ${f.bold("Preset Code:")} ${f.cyan(e)}`),console.log(),console.log(` ${f.dim("style:")} ${n.style}`),console.log(` ${f.dim("baseColor:")} ${n.baseColor}`),console.log(` ${f.dim("theme:")} ${n.theme}`),console.log(` ${f.dim("chartColor:")} ${n.chartColor}`),console.log(` ${f.dim("font:")} ${n.font} (${M[n.font]})`),console.log(` ${f.dim("iconLibrary:")} ${n.iconLibrary} (${I[n.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${n.radius} (${N[n.radius]})`),console.log();}),lo=new Command().name("resolve").description("resolve the current preset from your project's lvcn.json").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("--json","output as JSON",false).action(async e=>{let r=b.resolve(e.cwd),n=b.join(r,"lvcn.json");h.existsSync(n)||(console.error(f.red("No lvcn.json found. Run 'init' first.")),process.exit(1));let a=h.readJsonSync(n),s={style:a.style,baseColor:a.baseColor,theme:a.theme,chartColor:a.chartColor,font:a.font,iconLibrary:a.iconLibrary,radius:a.radius};for(let i of Object.keys(s))s[i]===void 0&&delete s[i];let o=J(s),t=L(o);if(e.json){console.log(JSON.stringify({code:o,values:t},null,2));return}console.log(),console.log(` ${f.bold("Current Preset:")} ${f.cyan(o)}`),console.log(),console.log(` ${f.dim("style:")} ${t.style}`),console.log(` ${f.dim("baseColor:")} ${t.baseColor}`),console.log(` ${f.dim("theme:")} ${t.theme}`),console.log(` ${f.dim("chartColor:")} ${t.chartColor}`),console.log(` ${f.dim("font:")} ${t.font} (${M[t.font]})`),console.log(` ${f.dim("iconLibrary:")} ${t.iconLibrary} (${I[t.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${t.radius} (${N[t.radius]})`),console.log(),console.log(` ${f.dim("Run with:")} ${f.green(`npx lovdacn init --preset ${o}`)}`),console.log();}),uo=new Command().name("apply").description("apply a preset to your existing project").argument("<preset>","preset code or named preset (e.g., nova, sera, a3Kx)").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-y, --yes","skip confirmation prompt",false).option("-p, --package-manager <pm>","package manager to use (npm, yarn, pnpm, bun)").action(async(e,r)=>{let n=b.resolve(r.cwd),a=b.join(n,"lvcn.json");h.existsSync(a)||(console.error(f.red("No lvcn.json found. Run 'init' first.")),process.exit(1));let s,o=A[e];if(o){let{title:u,description:m,...l}=o;s=l;}else if(G(e)){let u=L(e);u||(console.error(f.red(`Invalid preset code: ${e}`)),process.exit(1)),s=u;}else if(z.includes(e)){let u=A[e];if(u){let{title:m,description:l,...v}=u;s=v;}else s={...L(J({style:e}))};}else console.error(f.red(`Unknown preset: ${e}`)),console.error(f.dim(`Use a named preset (${Object.keys(A).join(", ")}), a preset code, or a style name.`)),process.exit(1);let t=h.readJsonSync(a),i=t.styleEngine||"nativewind";if(console.log(),console.log(` ${f.bold("Applying preset:")} ${f.cyan(e)}`),console.log(),console.log(` ${f.dim("style:")} ${t.style||"\u2014"} \u2192 ${f.green(s.style)}`),console.log(` ${f.dim("baseColor:")} ${t.baseColor||"\u2014"} \u2192 ${f.green(s.baseColor)}`),console.log(` ${f.dim("theme:")} ${t.theme||"\u2014"} \u2192 ${f.green(s.theme)}`),console.log(` ${f.dim("chartColor:")} ${t.chartColor||"\u2014"} \u2192 ${f.green(s.chartColor)}`),console.log(` ${f.dim("font:")} ${t.font||"\u2014"} \u2192 ${f.green(s.font)} (${M[s.font]})`),console.log(` ${f.dim("iconLibrary:")} ${t.iconLibrary||"\u2014"} \u2192 ${f.green(s.iconLibrary)} (${I[s.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${t.radius||"\u2014"} \u2192 ${f.green(s.radius)} (${N[s.radius]})`),console.log(` ${f.dim("engine:")} ${i} (unchanged)`),console.log(),!r.yes){let{proceed:u}=await U({type:"confirm",name:"proceed",message:"Apply this preset? (will overwrite styles and re-install components)",initial:true});u||process.exit(0);}t.style=s.style,t.baseColor=s.baseColor,t.theme=s.theme,t.chartColor=s.chartColor,t.font=s.font,t.iconLibrary=s.iconLibrary,t.radius=s.radius,h.writeJsonSync(a,t,{spaces:2}),console.log(f.green("\u2714 Updated lvcn.json"));let d=t.tailwind?.css||"src/global.css",c=b.join(n,d);h.existsSync(c)&&await $e({projectPath:n,styleEngine:i,cssRelativePath:d,style:s.style,baseColor:s.baseColor,theme:s.theme,chartColor:s.chartColor});let p=r.packageManager||po(n),x=H[s.font];if(x){console.log(f.blue(`Installing font: ${f.cyan(x)}...`));try{await execa(p,["install",x],{cwd:n,stdio:"inherit"});}catch{console.log(f.yellow(`\u26A0 Could not install ${x}. Install manually.`));}}let y=I[s.iconLibrary];if(y&&s.iconLibrary!=="expo"){let u=[y,"react-native-svg"];console.log(f.blue(`Installing icons: ${f.cyan(u.join(", "))}...`));try{await execa(p,["install",...u],{cwd:n,stdio:"inherit"});}catch{console.log(f.yellow("\u26A0 Could not install icon packages. Install manually."));}}let g=t.components||[];g.length>0&&(console.log(f.blue(`
224
- Re-installing ${g.length} component(s) with ${f.cyan(s.style)} style...`)),await ie({components:g,yes:true,overwrite:true,cwd:n,packageManager:p})),console.log(),console.log(f.green(`\u2714 Preset ${f.cyan(e)} applied successfully! \u{1F389}`)),console.log();}),ce=new Command().name("preset").description("manage design presets").addCommand(co).addCommand(lo).addCommand(uo).action(()=>{ce.outputHelp();});function po(e){return h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock"))?"bun":h.existsSync(b.join(e,"pnpm-lock.yaml"))?"pnpm":h.existsSync(b.join(e,"yarn.lock"))?"yarn":(h.existsSync(b.join(e,"package-lock.json")),"npm")}var Re="0.0.3";var Q=new Command().name("lovdacn").description("A CLI to initialize and manage Expo/NativeWind projects").version(Re);Q.addCommand(Ce);Q.addCommand(Ee);Q.addCommand(ce);Q.parse(process.argv);
223
+ ${o}`,t.push("GestureHandlerRootView");}}t.length!==0&&(h.writeFileSync(i,o,"utf8"),console.log(f.green(`Updated ${f.cyan(n)} with ${t.join(" + ")}`)));}function ie(e,r){let n=r.replace(/^([@~]\/)/,"");return h.existsSync(b.join(e,"src"))&&!n.startsWith("src/")?b.resolve(e,"src",n):b.resolve(e,n)}function no(e,r){let n=c=>c.replace(/\/+$/,""),i=n(r.ui||"@/components/ui"),s=n(r.components||"@/components"),o=n(r.utils||"@/lib/utils"),t="__LOVDA_UI_ALIAS__",a="__LOVDA_UTILS_ALIAS__",d=e.replace(/@\/registry\/(?:nativewind|uniwind)\//g,"@/").replace(/~\/components\/ui\//g,"@/components/ui/").replace(/~\/components\//g,"@/components/").replace(/~\/lib\/utils/g,"@/lib/utils");return d=d.replace(/@\/components\/ui\//g,`${t}/`).replace(/@\/lib\/utils/g,a).replace(/@\/components\//g,`${s}/`).replace(new RegExp(`${t}/`,"g"),`${i}/`).replace(new RegExp(a,"g"),o),d}function to(e){if(h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock")))return "bun";if(h.existsSync(b.join(e,"pnpm-lock.yaml")))return "pnpm";if(h.existsSync(b.join(e,"yarn.lock")))return "yarn";if(h.existsSync(b.join(e,"package-lock.json")))return "npm";let r=process.env.npm_config_user_agent||"";return r.startsWith("pnpm")?"pnpm":r.startsWith("bun")?"bun":r.startsWith("yarn")?"yarn":"npm"}function so(){if(process.env.LOVDA_REGISTRY_URL)return process.env.LOVDA_REGISTRY_URL;let e=[b.resolve(W,"../../../apps/v2/public/r"),b.resolve(W,"../../../../apps/v2/public/r"),b.resolve(W,"../../apps/v2/public/r"),b.resolve(W,"../../../../../apps/v2/public/r"),b.resolve(W,"../../../../../../apps/v2/public/r")];for(let r of e)if(h.existsSync(r))return r;return X}async function io(e,r,n){let i=so();if(i.startsWith("file://")||!i.startsWith("http")){let s=i.replace("file://",""),o=b.resolve(s,`styles/${n}/${r}/${e}.json`);return await h.readJson(o)}else {let s=await fetch(`${i}/styles/${n}/${r}/${e}.json`);if(!s.ok)throw new Error(`Failed to fetch component from registry: ${s.statusText}`);return await s.json()}}var co=new Command().name("decode").description("decode a preset code into its values").argument("<code>","the preset code to decode").option("--json","output as JSON",false).action((e,r)=>{let n=L(e);if(n||(console.error(f.red(`Invalid preset code: ${e}`)),process.exit(1)),r.json){console.log(JSON.stringify({code:e,values:n},null,2));return}console.log(),console.log(` ${f.bold("Preset Code:")} ${f.cyan(e)}`),console.log(),console.log(` ${f.dim("style:")} ${n.style}`),console.log(` ${f.dim("baseColor:")} ${n.baseColor}`),console.log(` ${f.dim("theme:")} ${n.theme}`),console.log(` ${f.dim("chartColor:")} ${n.chartColor}`),console.log(` ${f.dim("font:")} ${n.font} (${M[n.font]})`),console.log(` ${f.dim("iconLibrary:")} ${n.iconLibrary} (${I[n.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${n.radius} (${N[n.radius]})`),console.log();}),lo=new Command().name("resolve").description("resolve the current preset from your project's lvcn.json").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("--json","output as JSON",false).action(async e=>{let r=b.resolve(e.cwd),n=b.join(r,"lvcn.json");h.existsSync(n)||(console.error(f.red("No lvcn.json found. Run 'init' first.")),process.exit(1));let i=h.readJsonSync(n),s={style:i.style,baseColor:i.baseColor,theme:i.theme,chartColor:i.chartColor,font:i.font,iconLibrary:i.iconLibrary,radius:i.radius};for(let a of Object.keys(s))s[a]===void 0&&delete s[a];let o=J(s),t=L(o);if(e.json){console.log(JSON.stringify({code:o,values:t},null,2));return}console.log(),console.log(` ${f.bold("Current Preset:")} ${f.cyan(o)}`),console.log(),console.log(` ${f.dim("style:")} ${t.style}`),console.log(` ${f.dim("baseColor:")} ${t.baseColor}`),console.log(` ${f.dim("theme:")} ${t.theme}`),console.log(` ${f.dim("chartColor:")} ${t.chartColor}`),console.log(` ${f.dim("font:")} ${t.font} (${M[t.font]})`),console.log(` ${f.dim("iconLibrary:")} ${t.iconLibrary} (${I[t.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${t.radius} (${N[t.radius]})`),console.log(),console.log(` ${f.dim("Run with:")} ${f.green(`npx lovdacn init --preset ${o}`)}`),console.log();}),uo=new Command().name("apply").description("apply a preset to your existing project").argument("<preset>","preset code or named preset (e.g., nova, sera, a3Kx)").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-y, --yes","skip confirmation prompt",false).option("-p, --package-manager <pm>","package manager to use (npm, yarn, pnpm, bun)").action(async(e,r)=>{let n=b.resolve(r.cwd),i=b.join(n,"lvcn.json");h.existsSync(i)||(console.error(f.red("No lvcn.json found. Run 'init' first.")),process.exit(1));let s,o=A[e];if(o){let{title:u,description:m,...l}=o;s=l;}else if(G(e)){let u=L(e);u||(console.error(f.red(`Invalid preset code: ${e}`)),process.exit(1)),s=u;}else if(z.includes(e)){let u=A[e];if(u){let{title:m,description:l,...v}=u;s=v;}else s={...L(J({style:e}))};}else console.error(f.red(`Unknown preset: ${e}`)),console.error(f.dim(`Use a named preset (${Object.keys(A).join(", ")}), a preset code, or a style name.`)),process.exit(1);let t=h.readJsonSync(i),a=t.styleEngine||"nativewind";if(console.log(),console.log(` ${f.bold("Applying preset:")} ${f.cyan(e)}`),console.log(),console.log(` ${f.dim("style:")} ${t.style||"\u2014"} \u2192 ${f.green(s.style)}`),console.log(` ${f.dim("baseColor:")} ${t.baseColor||"\u2014"} \u2192 ${f.green(s.baseColor)}`),console.log(` ${f.dim("theme:")} ${t.theme||"\u2014"} \u2192 ${f.green(s.theme)}`),console.log(` ${f.dim("chartColor:")} ${t.chartColor||"\u2014"} \u2192 ${f.green(s.chartColor)}`),console.log(` ${f.dim("font:")} ${t.font||"\u2014"} \u2192 ${f.green(s.font)} (${M[s.font]})`),console.log(` ${f.dim("iconLibrary:")} ${t.iconLibrary||"\u2014"} \u2192 ${f.green(s.iconLibrary)} (${I[s.iconLibrary]})`),console.log(` ${f.dim("radius:")} ${t.radius||"\u2014"} \u2192 ${f.green(s.radius)} (${N[s.radius]})`),console.log(` ${f.dim("engine:")} ${a} (unchanged)`),console.log(),!r.yes){let{proceed:u}=await U({type:"confirm",name:"proceed",message:"Apply this preset? (will overwrite styles and re-install components)",initial:true});u||process.exit(0);}t.style=s.style,t.baseColor=s.baseColor,t.theme=s.theme,t.chartColor=s.chartColor,t.font=s.font,t.iconLibrary=s.iconLibrary,t.radius=s.radius,h.writeJsonSync(i,t,{spaces:2}),console.log(f.green("\u2714 Updated lvcn.json"));let d=t.tailwind?.css||"src/global.css",c=b.join(n,d);h.existsSync(c)&&await $e({projectPath:n,styleEngine:a,cssRelativePath:d,style:s.style,baseColor:s.baseColor,theme:s.theme,chartColor:s.chartColor});let p=r.packageManager||po(n),x=H[s.font];if(x){console.log(f.blue(`Installing font: ${f.cyan(x)}...`));try{await execa(p,["install",x],{cwd:n,stdio:"inherit"});}catch{console.log(f.yellow(`\u26A0 Could not install ${x}. Install manually.`));}}let y=I[s.iconLibrary];if(y&&s.iconLibrary!=="expo"){let u=[y,"react-native-svg"];console.log(f.blue(`Installing icons: ${f.cyan(u.join(", "))}...`));try{await execa(p,["install",...u],{cwd:n,stdio:"inherit"});}catch{console.log(f.yellow("\u26A0 Could not install icon packages. Install manually."));}}let g=t.components||[];g.length>0&&(console.log(f.blue(`
224
+ Re-installing ${g.length} component(s) with ${f.cyan(s.style)} style...`)),await ae({components:g,yes:true,overwrite:true,cwd:n,packageManager:p})),console.log(),console.log(f.green(`\u2714 Preset ${f.cyan(e)} applied successfully! \u{1F389}`)),console.log();}),ce=new Command().name("preset").description("manage design presets").addCommand(co).addCommand(lo).addCommand(uo).action(()=>{ce.outputHelp();});function po(e){return h.existsSync(b.join(e,"bun.lockb"))||h.existsSync(b.join(e,"bun.lock"))?"bun":h.existsSync(b.join(e,"pnpm-lock.yaml"))?"pnpm":h.existsSync(b.join(e,"yarn.lock"))?"yarn":(h.existsSync(b.join(e,"package-lock.json")),"npm")}var Re="1.0.0-beta.5";var Q=new Command().name("lovdacn").description("A CLI to initialize and manage Expo/NativeWind projects").version(Re);Q.addCommand(Ce);Q.addCommand(Ee);Q.addCommand(ce);Q.parse(process.argv);
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "lovdacn",
3
- "type": "module",
4
- "version": "0.0.3",
5
- "private": false,
6
- "license": "MIT",
7
- "files": [
8
- "dist",
9
- "templates"
10
- ],
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "exports": {
15
- ".": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
18
- }
19
- },
20
- "bin": {
21
- "lovdacn": "./dist/index.js",
22
- "lvcn": "./dist/index.js"
23
- },
24
- "scripts": {
25
- "test": "vitest run",
26
- "build": "tsup && node -e \"const fs=require('fs-extra'); fs.removeSync('./templates'); fs.copySync('../templates', './templates', {filter: (src) => !src.includes('node_modules') && !src.includes('.expo') && !src.includes('.git') && !src.includes('package-lock.json') && !src.includes('bun.lock') && !src.includes('bun.lockb') && !src.includes('styles')})\"",
27
- "dev": "tsup --watch",
28
- "start": "node dist/index.js",
29
- "clean": "rimraf dist templates"
30
- },
31
- "devDependencies": {
32
- "@types/fs-extra": "^11.0.4",
33
- "@types/node": "^22",
34
- "@types/prompts": "^2.4.9",
35
- "rimraf": "^6.0.1",
36
- "tailwind-merge": "^3.6.0",
37
- "tsup": "^8.5.0",
38
- "vitest": "^3.0.0"
39
- },
40
- "peerDependencies": {
41
- "typescript": "^5"
42
- },
43
- "dependencies": {
44
- "commander": "^15.0.0",
45
- "execa": "^9.6.0",
46
- "fs-extra": "^11.3.1",
47
- "picocolors": "^1.1.1",
48
- "prompts": "^2.4.2",
49
- "zod": "^3.24.1"
50
- },
51
- "module": "src/index.ts"
52
- }
1
+ {
2
+ "name": "lovdacn",
3
+ "type": "module",
4
+ "version": "1.0.0-beta.5",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "files": [
8
+ "dist",
9
+ "templates"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "bin": {
21
+ "lovdacn": "./dist/index.js",
22
+ "lvcn": "./dist/index.js"
23
+ },
24
+ "devDependencies": {
25
+ "@types/fs-extra": "^11.0.4",
26
+ "@types/node": "^22",
27
+ "@types/prompts": "^2.4.9",
28
+ "rimraf": "^6.0.1",
29
+ "tailwind-merge": "^3.6.0",
30
+ "tsup": "^8.5.0",
31
+ "vitest": "^3.0.0"
32
+ },
33
+ "peerDependencies": {
34
+ "typescript": "^5"
35
+ },
36
+ "dependencies": {
37
+ "commander": "^15.0.0",
38
+ "execa": "^9.6.0",
39
+ "fs-extra": "^11.3.1",
40
+ "picocolors": "^1.1.1",
41
+ "prompts": "^2.4.2",
42
+ "zod": "^3.24.1"
43
+ },
44
+ "module": "src/index.ts",
45
+ "scripts": {
46
+ "test": "vitest run",
47
+ "build": "tsup && node -e \"const fs=require('fs-extra'); fs.removeSync('./templates'); fs.copySync('../templates', './templates', {filter: (src) => !src.includes('node_modules') && !src.includes('.expo') && !src.includes('.git') && !src.includes('package-lock.json') && !src.includes('bun.lock') && !src.includes('bun.lockb') && !src.includes('styles')})\"",
48
+ "dev": "tsup --watch",
49
+ "start": "node dist/index.js",
50
+ "clean": "rimraf dist templates"
51
+ }
52
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://lovdacn.vercel.app/schema.json",
2
+ "$schema": "https://lvcn.dev/schema.json",
3
3
  "style": "new-york",
4
4
  "styleEngine": "nativewind",
5
5
  "tsx": true,
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://lovdacn.vercel.app/schema.json",
2
+ "$schema": "https://lvcn.dev/schema.json",
3
3
  "style": "new-york",
4
4
  "styleEngine": "uniwind",
5
5
  "tsx": true,