untitledui 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  export default {
2
2
  plugins: {
3
- "@tailwindcss/postcss": {},
4
- }
5
- }
6
-
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ };
@@ -5,23 +5,6 @@
5
5
  @plugin "@tailwindcss/typography";
6
6
  @plugin "tailwindcss-react-aria-components";
7
7
  @plugin "tailwindcss-animate";
8
- /*
9
- The default border color has changed to `currentColor` in Tailwind CSS v4,
10
- so we've added these compatibility styles to make sure everything still
11
- looks the same as it did with Tailwind CSS v3.
12
-
13
- If we ever want to remove these styles, we need to add an explicit border
14
- color utility to any element that depends on these defaults.
15
- */
16
- @layer base {
17
- *,
18
- ::after,
19
- ::before,
20
- ::backdrop,
21
- ::file-selector-button {
22
- border-color: var(--color-gray-200, currentColor);
23
- }
24
- }
25
8
 
26
9
  @custom-variant dark (&:where(.dark-mode, .dark-mode *));
27
10
  @custom-variant label (& [data-label]);
@@ -39,14 +22,6 @@
39
22
  scrollbar-width: none; /* Firefox */
40
23
  }
41
24
 
42
- @utility animation-duration-150 {
43
- animation-duration: 150ms;
44
- }
45
-
46
- @utility animation-duration-300 {
47
- animation-duration: 300ms;
48
- }
49
-
50
25
  @utility transition-inherit-all {
51
26
  transition-property: inherit;
52
27
  transition-duration: inherit;
@@ -789,10 +789,6 @@
789
789
  --color-focus-ring: var(--color-brand-500);
790
790
  --color-footer-button-fg: var(--color-brand-200);
791
791
  --color-footer-button-fg_hover: var(--color-white);
792
- --color-header-abstract-100-bg: var(--color-brand-100);
793
- --color-header-abstract-200-bg: var(--color-brand-200);
794
- --color-header-abstract-300-bg: var(--color-brand-300);
795
- --color-header-abstract-50-bg: var(--color-brand-50);
796
792
  --color-icon-fg-brand: var(--color-brand-600);
797
793
  --color-icon-fg-brand_on-brand: var(--color-brand-200);
798
794
  /* THESE NEED TO BE REMOED */
@@ -1128,7 +1124,7 @@
1128
1124
  --color-border-disabled_subtle: var(--color-gray-dark-mode-800);
1129
1125
  --color-border-tertiary: var(--color-gray-dark-mode-800);
1130
1126
  --color-border-brand_alt: var(--color-gray-dark-mode-700);
1131
- --color-border-secondary_alt: var(--color-gray-dark-mode-700);
1127
+ --color-border-secondary_alt: var(--color-gray-dark-mode-800);
1132
1128
 
1133
1129
  /* FOREGROUND COLORS */
1134
1130
  --color-fg-secondary: var(--color-gray-dark-mode-300);
@@ -1205,10 +1201,6 @@
1205
1201
  --color-focus-ring: var(--color-brand-500);
1206
1202
  --color-footer-button-fg: var(--color-gray-dark-mode-300);
1207
1203
  --color-footer-button-fg_hover: var(--color-gray-dark-mode-100);
1208
- --color-header-abstract-100-bg: var(--color-gray-dark-mode-800);
1209
- --color-header-abstract-200-bg: var(--color-gray-dark-mode-700);
1210
- --color-header-abstract-300-bg: var(--color-gray-dark-mode-600);
1211
- --color-header-abstract-50-bg: var(--color-gray-dark-mode-900);
1212
1204
  --color-icon-fg-brand: var(--color-gray-dark-mode-400);
1213
1205
  --color-icon-fg-brand_on-brand: var(--color-gray-dark-mode-400);
1214
1206
  --color-nav-item-button-icon-fg: var(--color-gray-dark-mode-400);
package/dist/index.mjs CHANGED
@@ -1,20 +1,58 @@
1
1
  #!/usr/bin/env node
2
- import{Command as Q0}from"commander";import L3 from"async-retry";import u from"chalk";import{Command as C3}from"commander";import{execa as s}from"execa";import*as E from"fs";import g from"ora";import k3 from"os";import*as R from"path";import n from"prompts";import{Project as F3}from"ts-morph";import A3 from"node-fetch";import{Readable as $0,pipeline as R3}from"stream";import{x as B0}from"tar";import{promisify as E3}from"util";var U0=E3(R3);async function h(Q){let z=`https://untitledui-docs.vercel.app/api/validate-key?key=${Q}`;try{return(await A3(z)).status===200}catch{return!1}}import _3 from"node-fetch";async function o(Q,z,W){try{return await(await _3("https://untitledui-docs.vercel.app/api/components",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({type:Q,components:z,key:W})})).json()}catch(Y){return console.error(Y),null}}import X3 from"node-fetch";async function U3(Q,z=""){let W=`https://untitledui-docs.vercel.app/api/components/list?key=${z}&type=${Q}`;try{let Y=await(await X3(W)).json();if(!Y?.components?.length)return null;return Y}catch(q){return console.error(q),null}}async function K3(Q=""){let z=`https://untitledui-docs.vercel.app/api/components/list?key=${Q}`;try{let q=await(await X3(z)).json();if(!q?.types?.length)return null;return q}catch(W){return console.error(W),null}}import T3 from"fast-glob";import*as t from"path";import{Project as _0}from"ts-morph";import{loadConfig as x3}from"tsconfig-paths";import H0 from"prettier";import f from"fast-glob";import*as m from"fs";import*as d from"path";import{loadConfig as N3}from"tsconfig-paths";var S=["**/node_modules/**",".next","public","dist","build"],V3={"next-app":"Next.js (App)","next-pages":"Next.js (Pages)",vite:"Vite",other:"Other"};async function l(Q){let z=m.existsSync(d.resolve(Q,"src")),W=m.existsSync(d.resolve(Q,`${z?"src/":""}app`)),[q,Y,V,B]=await Promise.all([f.glob("**/{next,vite,astro}.config.*|gatsby-config.*",{cwd:Q,deep:2,ignore:S}),u3(Q),D3(Q),w3(Q)]),X={framework:"other",isTsx:Y,tailwindFile:V||null,aliasPrefix:B,isSrcDir:z,isUsingAppDir:W};if(q.find((U)=>U.startsWith("next.config."))?.length)return X.framework=W?"next-app":"next-pages",X;else if(q.find((U)=>U.startsWith("vite.config."))?.length)return X.framework="vite",X;else if(q?.length||m.existsSync(d.resolve(Q,"package.json")))return X.framework="other",X;return null}async function u3(Q){return(await f.glob("tsconfig.*",{cwd:Q,deep:2,ignore:S})).length>0}async function D3(Q){let z=await f.glob("tailwind.config.*",{cwd:Q,deep:2,ignore:S});if(!z.length)return null;return z[0]}async function w3(Q){let z=await N3(Q);if(z?.resultType==="failed"||!Object.keys(z.paths).length)return null;let W={};for(let[q,Y]of Object.entries(z.paths)){let V=q.replace(/\/\*$/,"/");if(Y.some((B)=>B.includes("/app/*")))W.appPrefix=V;else if(Y.some((B)=>B.includes("/components/*")))W.componentsPrefix=V;else if(Y.some((B)=>B.includes("/utils/*")))W.utilsPrefix=V;else if(Y.some((B)=>B.includes("/styles/*")))W.stylesPrefix=V;else if(Y.some((B)=>B.includes("./*")||B.includes("/src/*")))W.srcPrefix=V}return W||null}function c(Q){let z=x3(Q),W=T3.sync(["tailwind.config.*","**/globals.css","**/{layout,_app,main}.tsx","package.json"],{cwd:Q,deep:4,absolute:!0,onlyFiles:!0,ignore:S}),q={tailwindFile:W.find((Y)=>Y.includes("tailwind.config.")),cssFile:W.find((Y)=>Y.includes("globals.css")),layoutFile:W.find((Y)=>Y.includes("layout")),appFile:W.find((Y)=>Y.includes("_app")),mainFile:W.find((Y)=>Y.includes("main")),packageJson:W.find((Y)=>Y.includes("package.json")),tsConfig:z?.resultType==="success"?z?.configFileAbsolutePath:void 0};if(z.resultType==="failed")throw new Error(`Failed to load tsconfig.json. ${z.message??""}`.trim());return q}function e(Q,z,W={},q=""){if(Q.includes("components")){if(W?.componentsPrefix)return Q.replace(/@\/components\//,t.join(W?.componentsPrefix,z?z.replace(/components\//,""):"","/"));if(z){let Y=W?.srcPrefix?t.join(W?.srcPrefix,z,"/"):q;return Q.replace(/@\/components\//,Y)}}if(Q.includes("app")&&W?.appPrefix)return Q.replace(/^@\/app\//,W?.appPrefix);if(Q.includes("utils")&&W?.utilsPrefix)return Q.replace(/^@\/utils\//,W?.utilsPrefix);if(Q.includes("styles")&&W?.stylesPrefix)return Q.replace(/^@\/styles\//,W?.stylesPrefix);if(W?.srcPrefix)return Q.replace(/^@\//,W?.srcPrefix);return Q}import y3 from"node-fetch";async function S3(){try{return await(await y3("https://untitledui-docs.vercel.app/api/get-pkg")).json()}catch(z){return console.error(z),null}}async function r({dependencies:Q,devDependencies:z,shouldThrow:W=!0}){let q=await S3();if(!q)if(W)throw new Error("package.json not found");else return null;let Y=[],V=[];if(Q)Q.forEach((B)=>{if(q.dependencies?.[B])Y.push(`${B}@${q.dependencies[B]}`)});if(z)z.forEach((B)=>{if(q.devDependencies?.[B])V.push(`${B}@${q.devDependencies[B]}`)});return{dependencies:Y,devDependencies:V}}function x(){if("bun/1.2.8 npm/? node/v22.6.0 darwin arm64".startsWith("yarn"))return"yarn";if("bun/1.2.8 npm/? node/v22.6.0 darwin arm64".startsWith("pnpm"))return"pnpm";if("bun/1.2.8 npm/? node/v22.6.0 darwin arm64".startsWith("bun"))return"bun";return"npm"}var O3=R.join(k3.homedir(),".untitledui"),k=R.join(O3,"config.json"),Z={components:[],path:"",type:void 0,license:""};if(E.existsSync(k)){let Q=JSON.parse(E.readFileSync(k,"utf-8"));Z.license=Q.license}var z3=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
3
- `),process.exit(1)},b3=new C3().name("add").description("add a component to your project").argument("[components...]","the components to add").option("-o, --overwrite","overwrite existing files.",!1).option("-a, --all","add all available components",!1).option("-p, --path <path>","the path to add the component to.").option("-t, --type <shared|marketing|shared-assets|application|foundations>","the type of the component to add.").option("-l, --license <license-key>","Add a license key for adding components.").action(async(Q,z)=>{if(Q)Z.components=Q;if(z)Z.overwrite=z.overwrite,Z.all=z.all,Z.path=z.path,Z.license=z.license||Z.license;try{await P3(Z)}catch(W){console.error(u.red(W))}});async function P3(Q){let z=g().start(),W=process.cwd();if(!E.existsSync(R.resolve(W,"package.json")))z.warn("This command should be run in a project directory."),process.exit(1);let Y=await l(W);if(Z.license){let $=await h(Z.license);if(console.log($,Z),!$)z.fail("Invalid license key"),process.exit(1);if(!E.existsSync(k)){let j=R.dirname(k);E.mkdirSync(j,{recursive:!0}),E.writeFileSync(k,JSON.stringify({license:Z.license},null,2))}if(JSON.parse(E.readFileSync(k,"utf-8")).license!==Z.license)E.writeFileSync(k,JSON.stringify({license:Z.license},null,2))}z.stop();let V=[];if(Z.components.length){let $=await o(Z.type,Z.components,Z.license);if($?.pro?.length)$?.pro?.forEach((J)=>console.log(`The ${u.yellowBright(J.split("/")[1])} component is only available for PRO users. Get access to the PRO at ${u.cyan("https://www.untitledui.com/buy/untitled-ui")}`)),process.exit(1);if(!$?.components.length)console.log("No components found"),process.exit(1);V.push(...$.components)}if(!Z?.type&&!Z?.components.length){let $=await K3(Z.license);if(!$)console.log("No component types found"),process.exit(1);let J=await n({type:"select",name:"type",onState:z3,message:`What type of ${u.cyan("component")} are you adding?`,choices:$?.types.map((j)=>({title:j,value:j}))});Z.type=J.type}if(!Z?.path){let $=await n({type:"text",name:"path",onState:z3,message:`Where would you like to add the ${u.cyan("components")}?`,initial:"components"});Z.path=$.path}if(!Z?.components.length){let $=await U3(Z?.type,Z.license);if(!$)console.log("No components found"),process.exit(1);let J=await n({type:"multiselect",name:"components",onState:z3,message:`Which ${u.cyan("components")} would you like to add?`,choices:$?.components?.map((j)=>({title:j||"example",value:j||"example",selected:Z.components.includes(j)})),instructions:!1,hint:"- Space to select. Return to submit"});if(Z.components=J.components,!J.components||J.components.length===0)console.log("No option selected. Exiting..."),process.exit(1)}if(!Z.components?.length)z.warn("No components selected. Exiting."),process.exit(1);let B=c(W),X=new Set,U=new Set,L=new Set,H=new F3({tsConfigFilePath:B?.tsConfig});if(Z.type&&Z.components.length){let $=await o(Z.type,Z.components,Z.license);if(!$?.components.length)console.log("No components found"),process.exit(1);V.push(...$.components)}if(V.forEach(($)=>{let J=g(`Adding ${$.name}...`).start(),j=$.files;$.dependencies.forEach((D)=>U.add(D)),$.devDependencies.forEach((D)=>L.add(D));try{if(j?.forEach(async({path:D,code:N})=>{let G=R.join(process.cwd(),`${Y?.isSrcDir&&"src"}`,D.replace(/components\//,Z.path+"/")),w=R.dirname(G);if(E.existsSync(G)&&!Z.overwrite){if(E.readFileSync(G,"utf-8")!==N)X.add({code:N,path:G})}else{E.mkdirSync(w,{recursive:!0}),E.writeFileSync(G,N);let _=R.relative(R.resolve(W,`${Y?.isSrcDir&&"src"}`,Z.path),G).split("/").length,P=_===1?"./":"../".repeat(_-1),T=H.addSourceFileAtPath(R.resolve(G));T.getImportDeclarations().forEach((B3)=>{let v3=B3.getModuleSpecifierValue();B3.setModuleSpecifier(e(v3,Z.path,Y?.aliasPrefix,P))}),await T.save()}}),X.size)J.warn(`Some files of ${u.yellow($.name)} already exist`);else J.succeed(`${u.green($.name)} is added successfully`)}catch(D){J.fail(`
4
- Failed to add the component ${u.red($.name)}`),console.error(u.red(D)),process.exit(1)}}),X.size&&!Z?.overwrite)if(console.log(`
5
- Following files already exist in the directory.`),X.forEach((J)=>{console.log(u.green(`- ${R.relative(process.cwd(),J.path)}`))}),(await n({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let J=g("Overwriting files").start();X.forEach(async(j)=>{E.writeFileSync(j.path,j.code);let D=R.relative(R.resolve(W,`${Y?.isSrcDir&&"src"}`,Z.path),j.path).split("/").length,N=D===1?"./":"../".repeat(D-1),G=H.addSourceFileAtPath(R.resolve(j.path));G.getImportDeclarations().forEach((w)=>{let _=w.getModuleSpecifierValue();w.setModuleSpecifier(e(_,Z.path,Y?.aliasPrefix,N))}),await G.save()}),J.succeed("Files are overwritten")}else console.log(`Use ${u.cyan("--overwrite")} or ${u.cyan("-o")} to overwrite existing files, or refer to the documentation ${u.cyan("https://untitled.xyz/docs")} for manual installation. The rest of the files are added.`),process.exit(1);let v=await r({dependencies:Array.from(U),devDependencies:Array.from(L),shouldThrow:!0}),A=x();if(v?.dependencies?.length){let $=g("Installing dependencies").start();await L3(()=>s(A,[A==="npm"?"install":"add",...Array.from(v.dependencies)]).catch(async(J)=>{if(J.message.includes("peer"))$.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),$.start("Installing dependencies with --legacy-peer-deps flag"),await s(A,[A==="npm"?"install":"add",...Array.from(v.dependencies),"--legacy-peer-deps"])}),{retries:1}),$.succeed("Dependencies are installed")}if(v?.devDependencies?.length){let $=g("Installing devDependencies").start();await L3(()=>s(A,[A==="npm"?"install":"add",...Array.from(v.devDependencies)]).catch(async(J)=>{if(J.message.includes("peer"))$.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),$.start("Installing devDependencies with --legacy-peer-deps flag"),await s(A,[A==="npm"?"install":"add",...Array.from(v.devDependencies),"--legacy-peer-deps"])}),{retries:1}),$.succeed("DevDependencies are installed")}process.exit(0)}import G3 from"async-retry";import M from"chalk";import{Command as c3}from"commander";import{execa as p}from"execa";import Z3 from"fast-glob";import I from"fs";import O from"ora";import r3 from"os";import*as b from"path";import i from"prompts";import{Project as s3}from"ts-morph";import{fileURLToPath as n3}from"url";import g3 from"node-fetch";import{posix as M3,sep as h3}from"node:path";import{Readable as m3}from"node:stream";import{pipeline as d3}from"node:stream/promises";import{x as f3}from"tar";var J3=[".DS_Store",".git","node_modules","bun.lockb","yarn.lock","package-lock.json"];async function H3(Q,{username:z,repo:W,branch:q,template:Y}){try{let V=`https://codeload.github.com/${z}/${W}/tar.gz/${q}`,B=await l3(V);await d3(B,f3({cwd:Q,strip:1,filter:(X)=>{let U=X.split(M3.sep)?.pop()||"";if(J3.includes(U))return!1;if(Y)return X.split(h3).join(M3.sep).includes(Y);return!0}}))}catch(V){if(V instanceof Error)throw new Error(`Failed to download or extract repository: ${V.message}`);throw V}}async function l3(Q){let z=await g3(Q);if(!z.ok)throw new Error(`Failed to download: ${Q} - Status: ${z.status} ${z.statusText}`);if(!z.body)throw new Error(`Failed to download: ${Q} - No response body`);let W=z.headers.get("content-type");if(W&&!W.includes("application/x-gzip")&&!W.includes("application/octet-stream"))console.warn(`Warning: Unexpected content type: ${W}. Expected application/x-gzip or application/octet-stream.`);return m3.from(z.body)}import Q3 from"chalk";import*as C from"fs";import*as a from"path";function W3(Q){if(!C.existsSync(a.resolve(Q)))console.log(Q3.red(`Error: CSS file not found at ${Q}`)),process.exit(1);let z=C.readFileSync(a.resolve(Q),"utf-8"),W=/(--color-[a-zA-Z-]+-\d{1,3}):\s*(rgb\([^)]+\))/g,q={},Y;while((Y=W.exec(z))!==null)if(Y[1]&&Y[2])q[Y[1]]=Y[2];return q}function Y3(Q,z,W){let q=a.resolve(W);if(!C.existsSync(q)){console.log(Q3.red(`Error: CSS file not found at ${q}`));return}let Y=C.readFileSync(q,"utf-8"),V=W3(W),B={},X={};for(let[L,H]of Object.entries(V))if(L.startsWith(`--color-${Q}-`)){let v=L.replace(`--color-${Q}-`,"");B[v]=L}else if(L.startsWith(`--color-${z}-`)){let v=L.replace(`--color-${z}-`,"");X[v]=H}let U=!1;for(let[L,H]of Object.entries(B))if(X[L]){let v=X[L],A=new RegExp(`(${H}):\\s*rgb\\([^)]*\\);?`,"g");if(A.test(Y))Y=Y.replace(A,`$1: ${v};`),U=!0;else console.log(Q3.yellow(`No match found for ${H}`))}if(U)C.writeFileSync(q,Y,"utf-8")}var a3=n3(import.meta.url),I3=b.dirname(a3),p3=b.join(r3.homedir(),".untitledui"),F=b.join(p3,"config.json"),i3={"nextjs-starter":"Next.js","vite-starter":"Vite"},o3="vite-starter",t3="nextjs-starter",y="",K={color:"",template:"",framework:void 0};if(I.existsSync(F)){let Q=JSON.parse(I.readFileSync(F,"utf-8"));K.license=Q.license}var $3=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
6
- `),process.exit(1)},j3=new c3().name("init").description("initialize a new project").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","Display this help message.").option("--vite","Initialize a Vite project.",!1).option("--next","Initialize a Next.js project.",!1).option("-c, --color <color-name>","Specify a color for the project.").option("-o, --overwrite","Overwrite existing files.",!1).option("-l, --license <license-key>","Add a license key to download the repository.").action(async(Q,z)=>{if(Q)y=Q;if(z){if(K.color=z.color,K.template=z.template,K.overwrite=z.overwrite,K.license=z.license||K.license,K.vite=z.vite,K.next=z.next,z.vite)K.framework=o3;if(z.next)K.framework=t3}try{await e3(z)}catch(W){console.error(M.red(W))}});async function e3(Q){let z=process.cwd(),W=I.existsSync(b.resolve(z,"package.json")),q=b.resolve(b.join(I3,"../config/styles","theme.css")),Y=W3(q??""),V=Array.from(new Set(Object.keys(Y).map((U)=>U?.split("--color-")?.[1]?.replace(/-\d{1,3}/,"")))),B=O().start(),X=await l(z);if(K.license){if(!await h(K.license))B.fail("Invalid license key"),process.exit(1);if(!I.existsSync(F)){let H=b.dirname(F);I.mkdirSync(H,{recursive:!0}),I.writeFileSync(F,JSON.stringify({license:K.license},null,2))}if(JSON.parse(I.readFileSync(F,"utf-8")).license!==K.license)I.writeFileSync(F,JSON.stringify({license:K.license},null,2))}if(!W){if(B.stop(),!y){let U=await i({onState:$3,type:"text",name:"path",message:"What is your project named?",initial:"untitled-ui"});if(typeof U.path==="string")y=U.path.trim()}if(I.existsSync(b.resolve(b.join(z,y))))B.fail(M.red("Directory already exists!")),process.exit(1);if(K.vite&&K.next||!K.framework){let U=await i({type:"select",name:"framework",onState:$3,message:`Which ${M.cyan("framework")} would you like to use?`,choices:[{title:M.cyan("Next"),value:"nextjs-starter"},{title:M.yellow("Vite"),value:"vite-starter"}]});K.framework=U.framework}B.succeed("Framework is selected: "+M.green(i3[K.framework]))}else if(X?.framework==="other")B.fail("Unsupported project framework"),console.log(`Please refer to the documentation ${M.cyan("https://untitled.xyz/docs")} for supported frameworks or proceed with manual installation.`),process.exit(1);else if(X?.framework.startsWith("next")||X?.framework.startsWith("vite"))B.succeed(M.yellow(`Detected ${V3[X.framework]} project, proceeding with the setup...`));if(!K.color){let U=await i({type:"select",name:"color",onState:$3,initial:Q.color??"",message:`Which ${M.cyan("color")} would you like to use as the ${M.cyanBright("brand")} color?`,choices:V.map((L)=>({title:L,value:L}))});K.color=U.color}if(y&&!W){let U=b.resolve(y);console.log(`
7
- Creating a new project in ${M.blue(y)}`);let L=O("Downloading and extracting the repository...").start();try{I.mkdirSync(U,{recursive:!0}),await G3(()=>H3(U,{branch:"main",username:"a-peak-works",repo:K.framework}),{retries:2}),L.succeed("Files are downloaded and extracted successfully!");let H=O({text:"Installing dependencies..."}).start(),v=Z3.sync(["**/styles/theme.css"],{cwd:U,absolute:!0,onlyFiles:!0})[0];Y3("brand",K.color,v??""),await G3(()=>p("sh",["-c",`cd ${y} && ${x()} install && git init`]).catch(async(A)=>{if(A.message.includes("peer"))H.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),H.start("Installing dependencies with --legacy-peer-deps flag"),await p("sh",["-c",`cd ${y} && ${x()==="npm"?"npm --legacy-peer-deps":x()} install && git init`])}),{retries:1}),H.succeed("Dependencies are installed"),console.log(`
8
- Your project is ready, to get staretd run the following commands:
2
+ import{Command as F3}from"commander";import x0 from"async-retry";import N from"chalk";import{Command as t0,Option as e0}from"commander";import{execa as X0}from"execa";import*as S from"fs";import B0 from"ora";import z3 from"os";import*as D from"path";import q0 from"prompts";import{Project as B3}from"ts-morph";import m0 from"node-fetch";import{Readable as d3,pipeline as c0}from"stream";import{x as f3}from"tar";import{promisify as l0}from"util";var c3=l0(c0);async function n(B){let z=`https://untitledui-docs.vercel.app/api/validate-key?key=${B}`;try{return(await m0(z)).status===200}catch{return!1}}import s0 from"node-fetch";async function K0(B,z,Q){try{return await(await s0("https://untitledui-docs.vercel.app/api/components",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({type:B,components:z,key:Q})})).json()}catch(Y){return console.error(Y),null}}import w0 from"node-fetch";async function T0(B,z=""){let Q=`https://untitledui-docs.vercel.app/api/components/list?key=${z}&type=${B}`;try{let Y=await(await w0(Q)).json();if(!Y?.components?.length)return null;return Y}catch(X){return console.error(X),null}}async function y0(B=""){let z=`https://untitledui-docs.vercel.app/api/components/list?key=${B}`;try{let X=await(await w0(z)).json();if(!X?.types?.length)return null;return X}catch(Q){return console.error(Q),null}}import p0 from"fast-glob";import*as L0 from"path";import{Project as Y1}from"ts-morph";import{loadConfig as o0}from"tsconfig-paths";import p3 from"prettier";import $0 from"fast-glob";import*as Y0 from"fs";import*as Z0 from"path";import{loadConfig as a0}from"tsconfig-paths";var h=["**/node_modules/**",".next","public","dist","build"],S0={"next-app":"Next.js (App)","next-pages":"Next.js (Pages)",vite:"Vite",other:"Other"};async function r(B){let z=Y0.existsSync(Z0.resolve(B,"src")),Q=Y0.existsSync(Z0.resolve(B,`${z?"src/":""}app`)),[X,Y,V,v]=await Promise.all([$0.glob("**/{next,vite,astro}.config.*|gatsby-config.*",{cwd:B,deep:2,ignore:h}),n0(B),r0(B),i0(B)]),M={framework:"other",isTsx:Y,tailwindFile:V||null,aliasPrefix:v,isSrcDir:z,isUsingAppDir:Q};if(X.find((L)=>L.startsWith("next.config."))?.length)return M.framework=Q?"next-app":"next-pages",M;else if(X.find((L)=>L.startsWith("vite.config."))?.length)return M.framework="vite",M;else if(X?.length||Y0.existsSync(Z0.resolve(B,"package.json")))return M.framework="other",M;return null}async function n0(B){return(await $0.glob("tsconfig.*",{cwd:B,deep:2,ignore:h})).length>0}async function r0(B){let z=await $0.glob("tailwind.config.*",{cwd:B,deep:2,ignore:h});if(!z.length)return null;return z[0]}async function i0(B){let z=await a0(B);if(z?.resultType==="failed"||!Object.keys(z.paths).length)return null;let Q={};for(let[X,Y]of Object.entries(z.paths)){let V=X.replace(/\/\*$/,"/");if(Y.some((v)=>v.includes("/app/*")))Q.appPrefix=V;else if(Y.some((v)=>v.includes("/components/*")))Q.componentsPrefix=V;else if(Y.some((v)=>v.includes("/utils/*")))Q.utilsPrefix=V;else if(Y.some((v)=>v.includes("/styles/*")))Q.stylesPrefix=V;else if(Y.some((v)=>v.includes("./*")||v.includes("/src/*")))Q.srcPrefix=V}return Q||null}function i(B){let z=o0(B),Q=p0.sync(["tailwind.config.*","**/globals.css","**/{layout,_app,main}.tsx","package.json"],{cwd:B,deep:4,absolute:!0,onlyFiles:!0,ignore:h}),X={tailwindFile:Q.find((Y)=>Y.includes("tailwind.config.")),cssFile:Q.find((Y)=>Y.includes("globals.css")),layoutFile:Q.find((Y)=>Y.includes("layout")),appFile:Q.find((Y)=>Y.includes("_app")),mainFile:Q.find((Y)=>Y.includes("main")),packageJson:Q.find((Y)=>Y.includes("package.json")),tsConfig:z?.resultType==="success"?z?.configFileAbsolutePath:void 0};if(z.resultType==="failed")throw new Error(`Failed to load tsconfig.json. ${z.message??""}`.trim());return X}function p(B,z,Q={},X=""){if(B.includes("components")){if(Q?.componentsPrefix)return B.replace(/@\/components\//,L0.posix.join(Q?.componentsPrefix,z?z.replace(/components\//,""):"","/"));if(z){let Y=Q?.srcPrefix?L0.posix.join(Q?.srcPrefix,z,"/"):X;return B.replace(/@\/components\//,Y)}}if(B.includes("app")&&Q?.appPrefix)return B.replace(/^@\/app\//,Q?.appPrefix);if(B.includes("utils")&&Q?.utilsPrefix)return B.replace(/^@\/utils\//,Q?.utilsPrefix);if(B.includes("styles")&&Q?.stylesPrefix)return B.replace(/^@\/styles\//,Q?.stylesPrefix);if(Q?.srcPrefix)return B.replace(/^@\//,Q?.srcPrefix);return B}function T(){if("bun/1.2.14 npm/? node/v22.6.0 darwin arm64".startsWith("yarn"))return"yarn";if("bun/1.2.14 npm/? node/v22.6.0 darwin arm64".startsWith("pnpm"))return"pnpm";if("bun/1.2.14 npm/? node/v22.6.0 darwin arm64".startsWith("bun"))return"bun";return"npm"}function m(){switch(T()){case"yarn":return"yarn";case"pnpm":return"pnpx";case"bun":return"bunx";default:return"npx"}}function C0(){switch(T()){case"yarn":return"yarn dev";case"pnpm":return"pnpm dev";case"bun":return"bun dev";default:return"npm run dev"}}var Q3=D.join(z3.homedir(),".untitledui"),c=D.join(Q3,"config.json"),Z={components:[],path:"",type:void 0,license:""};if(S.existsSync(c)){let B=JSON.parse(S.readFileSync(c,"utf-8"));Z.license=B.license}var M0=(B)=>{if(B.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
3
+ `),process.exit(1)},k0=new t0().name("add").description("add a component to your project").argument("[components...]","the components to add").option("-a, --all","add all available components",!1).option("-o, --overwrite","overwrite existing files.",!1).option("-p, --path <path>","the path to add the component to.").option("-d, --dir <directory>","the directory where the project is located.").addOption(new e0("-l, --license <license-key>","Add a license key for adding components.").hideHelp()).option("-t, --type <shared|marketing|shared-assets|application|foundations>","the type of the component to add.").action(async(B,z)=>{if(B)Z.components=B;if(z)Z.all=z.all,Z.dir=z.dir,Z.path=z.path,Z.overwrite=z.overwrite,Z.license=z.license||Z.license;try{await W3(Z)}catch(Q){console.error(N.red(Q))}});async function W3(B){let z=B0().start(),Q=D.posix.join(process.cwd(),Z.dir||"");if(!S.existsSync(D.resolve(Q,"package.json")))z.warn("This command should be run in a project directory."),process.exit(1);let Y=await r(Q);if(Z.license){if(!await n(Z.license))z.fail("Invalid license key"),process.exit(1);if(!S.existsSync(c)){let U=D.dirname(c);S.mkdirSync(U,{recursive:!0}),S.writeFileSync(c,JSON.stringify({license:Z.license},null,2))}if(JSON.parse(S.readFileSync(c,"utf-8")).license!==Z.license)S.writeFileSync(c,JSON.stringify({license:Z.license},null,2),"utf-8")}z.stop();let V=[];if(Z.components.length){let q=await K0(Z.type,Z.components,Z.license);if(q&&q.pro&&q.pro.length>0){if(console.log(),q.pro.length===1){let W=q.pro[0]?.split("/")[1]||q.pro[0];console.log(N.yellow(`\uD83D\uDD12 The ${N.cyan(W)} component requires PRO access.`))}else console.log(N.yellow("\uD83D\uDD12 The following components require PRO access:")),q.pro.forEach((W)=>{let U=W?.split("/")[1]||W;console.log(` • ${N.cyan(U)}`)});console.log(),console.log("To access PRO components:"),console.log(` ${N.green("→")} If you've already purchased: ${N.cyan(`${m()} untitledui@latest login`)}`),console.log(` ${N.green("→")} To purchase PRO components: ${N.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(!q?.components.length)console.log("No components found"),process.exit(1);V.push(...q.components)}if(!Z?.type&&!Z?.components.length){let q=await y0(Z.license);if(!q)console.log("No component types found"),process.exit(1);let W=await q0({type:"select",name:"type",onState:M0,message:`What type of ${N.cyan("component")} are you adding?`,choices:q?.types.map((U)=>({title:U,value:U}))});Z.type=W.type}if(!Z?.path){let q=await q0({type:"text",name:"path",onState:M0,message:`Where would you like to add the ${N.cyan("components")}?`,initial:"components"});Z.path=q.path}if(!Z?.components.length){let q=await T0(Z?.type,Z.license);if(!q)console.log("No components found"),process.exit(1);let W=await q0({type:"multiselect",name:"components",onState:M0,message:`Which ${N.cyan("components")} would you like to add?`,choices:q?.components?.map((U)=>({title:U||"example",value:U||"example",selected:Z.components.includes(U)})),instructions:!1,hint:"- Space to select. Return to submit"});if(Z.components=W.components,!W.components||W.components.length===0)console.log("No option selected. Exiting..."),process.exit(1)}if(!Z.components?.length)z.warn("No components selected. Exiting."),process.exit(1);let v=i(Q),M=new Set,L=new Set,J=new Set,R=new B3({tsConfigFilePath:v?.tsConfig});if(Z.type&&Z.components.length){let q=await K0(Z.type,Z.components,Z.license);if(!q?.components.length)console.log("No components found"),process.exit(1);V.push(...q.components)}if(V.forEach((q)=>{let W=B0(`Adding ${q.name}...`).start(),U=q.files;q.dependencies.forEach((K)=>L.add(K)),q.devDependencies.forEach((K)=>J.add(K));try{if(U?.forEach(async({path:K,code:C})=>{let E=D.posix.join(Q,`${Y?.isSrcDir&&"src"}`,K.replace(/components\//,Z.path+"/")),x=D.dirname(E);if(S.existsSync(E)&&!Z.overwrite){if(S.readFileSync(E,"utf-8")!==C)M.add({code:C,path:E})}else{S.mkdirSync(x,{recursive:!0}),S.writeFileSync(E,C);let I=D.relative(D.resolve(Q,`${Y?.isSrcDir&&"src"}`,Z.path),E).split("/").length,y=I===1?"./":"../".repeat(I-1),k=R.addSourceFileAtPath(D.resolve(E));k.getImportDeclarations().forEach((F)=>{let z0=F.getModuleSpecifierValue();F.setModuleSpecifier(p(z0,Z.path,Y?.aliasPrefix,y))}),await k.save()}}),M.size)W.warn(`Some files of ${N.yellow(q.name)} already exist`);else W.succeed(`${N.green(q.name)} is added successfully`)}catch(K){W.fail(`
4
+ Failed to add the component ${N.red(q.name)}`),console.error(N.red(K)),process.exit(1)}}),M.size&&!Z?.overwrite)if(console.log(`
5
+ Following files already exist in the directory.`),M.forEach((W)=>{console.log(N.green(`- ${D.relative(Q,W.path)}`))}),(await q0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let W=B0("Overwriting files").start();M.forEach((U)=>{let K=D.relative(D.resolve(Q,`${Y?.isSrcDir&&"src"}`,Z.path),U.path).split("/").length,C=K===1?"./":"../".repeat(K-1),E=R.addSourceFileAtPath(D.resolve(U.path));E.replaceWithText(U.code),E.getImportDeclarations().forEach((x)=>{let I=x.getModuleSpecifierValue();x.setModuleSpecifier(p(I,Z.path,Y?.aliasPrefix,C))}),E.saveSync()}),W.succeed("Files are overwritten")}else console.log(`Use ${N.cyan("--overwrite")} or ${N.cyan("-o")} to overwrite existing files, or refer to the documentation ${N.cyan("https://untitled.xyz/docs")} for manual installation. The rest of the files are added.`),process.exit(1);let b=T();if(L?.size){let q=B0("Installing dependencies").start();await x0(()=>X0("sh",["-c",`${Z?.dir?`cd ${Z?.dir} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(L).join(" ")}`]).catch(async(W)=>{if(W.message.includes("peer"))q.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),q.start("Installing dependencies with --legacy-peer-deps flag"),await X0("sh",["-c",`${Z?.dir?`cd ${Z?.dir} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(L).join(" ")} --legacy-peer-deps`])}),{retries:1}),q.succeed("Dependencies are installed")}if(J?.size){let q=B0("Installing devDependencies").start();await x0(()=>X0("sh",["-c",`${Z?.dir?`cd ${Z?.dir} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(J).join(" ")}`]).catch(async(W)=>{if(W.message.includes("peer"))q.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),q.start("Installing devDependencies with --legacy-peer-deps flag"),await X0("sh",["-c",`${Z?.dir?`cd ${Z?.dir} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(J).join(" ")} --legacy-peer-deps`])}),{retries:1}),q.succeed("DevDependencies are installed")}process.exit(0)}import H0 from"chalk";import{Command as Y3}from"commander";import*as d from"fs";import Z3 from"http";import $3 from"open";import X3 from"ora";import q3 from"os";import*as j0 from"path";import{URL as U3}from"url";var G0=j0.join(q3.homedir(),".untitledui"),v0=j0.join(G0,"config.json"),F0=new Y3().name("login").description("authenticate with Untitled UI to access PRO components").action(async()=>{let B=X3("Starting authentication...").start();try{await V3(B),B.succeed("Authentication completed successfully!"),console.log(H0.green(`
6
+ You can now access PRO components with the CLI!`)),process.exit(0)}catch(z){B.fail(`Authentication failed: ${z instanceof Error?z.message:z}`),process.exit(1)}});async function V3(B){return new Promise((z,Q)=>{let X=Z3.createServer((Y,V)=>{let v=new U3(Y.url,"http://localhost");if(v.pathname==="/callback"){let M=v.searchParams.get("apiKey"),L=v.searchParams.get("error");if(L){V.writeHead(400,{"Content-Type":"text/html"}),V.end(`
7
+ <html>
8
+ <body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-align: center; padding: 50px;">
9
+ <h1 style="color: #dc2626;">Authentication Failed</h1>
10
+ <p>${decodeURIComponent(L)}</p>
11
+ <p style="color: #6b7280;">You can close this tab and return to your terminal.</p>
12
+ </body>
13
+ </html>
14
+ `),X.close(),Q(new Error(decodeURIComponent(L)));return}if(!M){V.writeHead(400,{"Content-Type":"text/html"}),V.end(`
15
+ <html>
16
+ <body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-align: center; padding: 50px;">
17
+ <h1 style="color: #dc2626;">Authentication Failed</h1>
18
+ <p>No API key received</p>
19
+ <p style="color: #6b7280;">You can close this tab and return to your terminal.</p>
20
+ </body>
21
+ </html>
22
+ `),X.close(),Q(new Error("No API key received"));return}try{J3(M),V.writeHead(200,{"Content-Type":"text/html"}),V.end(`
23
+ <html>
24
+ <body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-align: center; padding: 50px;">
25
+ <h1 style="color: #16a34a;">Authentication Successful!</h1>
26
+ <p>Your CLI has been authenticated successfully.</p>
27
+ <p style="color: #6b7280;">You can now close this tab and return to your terminal.</p>
28
+ </body>
29
+ </html>
30
+ `),X.close(),z()}catch(J){V.writeHead(500,{"Content-Type":"text/html"}),V.end(`
31
+ <html>
32
+ <body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; text-align: center; padding: 50px;">
33
+ <h1 style="color: #dc2626;">Authentication Failed</h1>
34
+ <p>Failed to save authentication data</p>
35
+ <p style="color: #6b7280;">You can close this tab and return to your terminal.</p>
36
+ </body>
37
+ </html>
38
+ `),X.close(),Q(J)}}else V.writeHead(404),V.end("Not found")});X.listen(0,"localhost",()=>{let v=`https://untitledui-docs.vercel.app/api/cli-auth?port=${X.address().port}`;B.text="Opening browser for authentication...",$3(v).catch((M)=>{console.log(H0.yellow(`
39
+ Failed to open browser automatically: ${M.message}`)),console.log(H0.cyan(`Please manually open: ${v}
40
+ `))}),B.text="Waiting for authentication in browser..."}),setTimeout(()=>{X.close(),Q(new Error("Authentication timeout. Please try again."))},300000)})}function J3(B){if(!d.existsSync(G0))d.mkdirSync(G0,{recursive:!0});let z={};if(d.existsSync(v0))try{z=JSON.parse(d.readFileSync(v0,"utf-8"))}catch{z={}}z.license=B,d.writeFileSync(v0,JSON.stringify(z,null,2),"utf-8")}import u0 from"async-retry";import H from"chalk";import{Command as w3,Option as T3}from"commander";import{execa as Q0}from"execa";import*as w from"fs";import W0 from"ora";import y3 from"os";import*as G from"path";import s from"prompts";import{Project as S3}from"ts-morph";import b3 from"node-fetch";async function U0(B,z){try{let X=await b3("https://untitledui-docs.vercel.app/api/components/example",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({example:B,key:z})});if(!X.ok){if(X.status===401||X.status===403)return{type:"error",status:X.status,message:"PRO access required"};return console.error(`API error: ${X.status} - ${X.statusText}`),null}return await X.json()}catch(X){return console.error(X?.message||"Error fetching example data."),null}}import J0 from"async-retry";import _ from"chalk";import{Command as j3}from"commander";import{execa as o}from"execa";import I0 from"fast-glob";import u from"fs";import t from"ora";import E3 from"os";import*as A from"path";import b0 from"prompts";import{Project as A3}from"ts-morph";import{fileURLToPath as R3}from"url";import K3 from"node-fetch";import{posix as O0,sep as L3}from"node:path";import{Readable as M3}from"node:stream";import{pipeline as v3}from"node:stream/promises";import{x as H3}from"tar";var P0=[".DS_Store",".git","node_modules","bun.lockb","yarn.lock","package-lock.json"];async function g0(B,{username:z,repo:Q,branch:X,template:Y}){try{let V=`https://codeload.github.com/${z}/${Q}/tar.gz/${X}`,v=await G3(V);await v3(v,H3({cwd:B,strip:1,filter:(M)=>{let L=M.split(O0.sep)?.pop()||"";if(P0.includes(L))return!1;if(Y)return M.split(L3).join(O0.sep).includes(Y);return!0}}))}catch(V){if(V instanceof Error)throw new Error(`Failed to download or extract repository: ${V.message}`);throw V}}async function G3(B){let z=await K3(B);if(!z.ok)throw new Error(`Failed to download: ${B} - Status: ${z.status} ${z.statusText}`);if(!z.body)throw new Error(`Failed to download: ${B} - No response body`);let Q=z.headers.get("content-type");if(Q&&!Q.includes("application/x-gzip")&&!Q.includes("application/octet-stream"))console.warn(`Warning: Unexpected content type: ${Q}. Expected application/x-gzip or application/octet-stream.`);return M3.from(z.body)}import E0 from"chalk";import*as f from"fs";import*as V0 from"path";function A0(B){if(!f.existsSync(V0.resolve(B)))console.log(E0.red(`Error: CSS file not found at ${B}`)),process.exit(1);let z=f.readFileSync(V0.resolve(B),"utf-8"),Q=/(--color-[a-zA-Z-]+-\d{1,3}):\s*(rgb\([^)]+\))/g,X={},Y;while((Y=Q.exec(z))!==null)if(Y[1]&&Y[2])X[Y[1]]=Y[2];return X}function R0(B,z,Q){let X=V0.resolve(Q);if(!f.existsSync(X)){console.log(E0.red(`Error: CSS file not found at ${X}`));return}let Y=f.readFileSync(X,"utf-8"),V=A0(Q),v={},M={};for(let[J,R]of Object.entries(V))if(J.startsWith(`--color-${B}-`)){let b=J.replace(`--color-${B}-`,"");v[b]=J}else if(J.startsWith(`--color-${z}-`)){let b=J.replace(`--color-${z}-`,"");M[b]=R}let L=!1;for(let[J,R]of Object.entries(v))if(M[J]){let b=M[J],q=new RegExp(`(${R}):\\s*rgb\\([^)]*\\);?`,"g");if(q.test(Y))Y=Y.replace(q,`$1: ${b};`),L=!0;else console.log(E0.yellow(`No match found for ${R}`))}if(L)f.writeFileSync(X,Y,"utf-8")}var I3=R3(import.meta.url),d0=A.dirname(I3),_3=A.join(E3.homedir(),".untitledui"),l=A.join(_3,"config.json"),N3={"nextjs-starter":"Next.js","vite-starter":"Vite"},u3="vite-starter",D3="nextjs-starter",P="",j={color:"",template:"",framework:void 0};if(u.existsSync(l)){let B=JSON.parse(u.readFileSync(l,"utf-8"));j.license=B.license}var _0=(B)=>{if(B.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
41
+ `),process.exit(1)},h0=new j3().name("init").description("initialize a new project or adjust an existing one").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","Display this help message.").option("--vite","Initialize a Vite project.",!1).option("--next","Initialize a Next.js project.",!1).option("-c, --color <color-name>","Specify a color for the project.").option("-o, --overwrite","Overwrite existing files.",!1).option("-l, --license <license-key>","Add a license key to download the repository.").action(async(B,z)=>{if(B)P=B;if(z){if(j.color=z.color,j.template=z.template,j.overwrite=z.overwrite,j.license=z.license||j.license,j.vite=z.vite,j.next=z.next,z.vite)j.framework=u3;if(z.next)j.framework=D3}try{await N0(z),process.exit(0)}catch(Q){console.error(_.red(Q)),process.exit(1)}});async function N0(B,z=null){let Q=process.cwd(),X=u.existsSync(A.resolve(Q,"package.json")),Y=A.resolve(A.join(d0,"../config/styles","theme.css")),V=A0(Y??""),v=Array.from(new Set(Object.keys(V).map((J)=>J?.split("--color-")?.[1]?.replace(/-\d{1,3}/,"")))),M=t().start(),L=await r(Q);if(j.license){if(!await n(j.license))M.fail("Invalid license key"),process.exit(1);if(!u.existsSync(l)){let b=A.dirname(l);u.mkdirSync(b,{recursive:!0}),u.writeFileSync(l,JSON.stringify({license:j.license},null,2))}if(JSON.parse(u.readFileSync(l,"utf-8")).license!==j.license)u.writeFileSync(l,JSON.stringify({license:j.license},null,2))}if(!X){if(M.stop(),!P){let J=await b0({onState:_0,type:"text",name:"path",message:"What is your project named?",initial:"untitled-ui"});if(typeof J.path==="string")P=J.path.trim()}if(z)z.projectPath=P;if(u.existsSync(A.resolve(A.posix.join(Q,P))))M.fail(_.red("Directory already exists!")),process.exit(1);if(j.vite&&j.next||!j.framework){let J=await b0({type:"select",name:"framework",onState:_0,message:`Which ${_.cyan("framework")} would you like to use?`,choices:[{title:_.cyan("Next"),value:"nextjs-starter"},{title:_.yellow("Vite"),value:"vite-starter"}]});j.framework=J.framework}M.succeed("Framework is selected: "+_.green(N3[j.framework]))}else if(L?.framework==="other")M.fail("Unsupported project framework"),console.log(`Please refer to the documentation ${_.cyan("https://untitled.xyz/docs")} for supported frameworks or proceed with manual installation.`),process.exit(1);else if(L?.framework.startsWith("next")||L?.framework.startsWith("vite"))M.succeed(_.yellow(`Detected ${S0[L.framework]} project, proceeding with the setup...`));if(!j.color){let J=await b0({type:"select",name:"color",onState:_0,initial:B.color??"",message:`Which ${_.cyan("color")} would you like to use as the ${_.cyanBright("brand")} color?`,choices:v.map((R)=>({title:R,value:R}))});j.color=J.color}if(P&&!X){let J=A.resolve(P);console.log(`
42
+ Creating a new project in ${_.blue(P)}`);let R=t("Downloading and extracting the repository...").start();try{u.mkdirSync(J,{recursive:!0}),await J0(()=>g0(J,{branch:"main",username:"a-peak-works",repo:j.framework}),{retries:2}),R.succeed("Files are downloaded and extracted successfully!");let b=t({text:"Installing dependencies..."}).start(),q=I0.sync(["**/styles/theme.css"],{cwd:J,absolute:!0,onlyFiles:!0})[0];if(R0("brand",j.color||"",q??""),await J0(()=>o("sh",["-c",`cd ${P} && ${T()} install && git init`]).catch(async(W)=>{if(W.message.includes("peer"))b.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),b.start("Installing dependencies with --legacy-peer-deps flag"),await o("sh",["-c",`cd ${P} && ${T()==="npm"?"npm --legacy-peer-deps":T()} install && git init`])}),{retries:1}),b.succeed("Dependencies are installed"),!z)console.log(`
43
+ Your project is ready, to get started run the following commands:
9
44
 
10
- cd ${M.cyan(y)}
11
- ${M.cyan(x())} run dev`),process.exit(0)}catch(H){if(L.fail(M.red(`
12
- Failed to download and extract the repository`)),H instanceof Error)console.error(H.message);else console.error(`
13
- `);I.rmdirSync(U,{recursive:!0}),process.exit(1)}}else{let U=O("Copying files to the project directory").start(),L=new Set,H=c(z),v=b.resolve(b.join(I3,"../config")),A=Z3.sync(["**"],{cwd:v,onlyFiles:!0,ignore:S}),$=await r({dependencies:["tailwindcss","tailwindcss-animate","@tailwindcss/typography","tailwindcss-react-aria-components"],devDependencies:["@tailwindcss/postcss","postcss"]});if(A.forEach((N)=>{let G=N.includes("postcss.config"),w=b.resolve(b.join(v),N),_=b.resolve(z,G?N:`${X?.isSrcDir?"src":""}/${N}`);if(I.existsSync(_)){if(K?.overwrite)I.copyFileSync(w,_);else{let P=I.readFileSync(_,"utf-8"),T=I.readFileSync(w,"utf-8");if(P!==T)L.add({targetFile:_,sourceFile:w})}return}I.mkdirSync(b.dirname(_),{recursive:!0}),I.writeFileSync(_,""),I.copyFileSync(w,_)}),!L.size)U.succeed("Files are copied successfully!");if(L.size&&!K?.overwrite)if(console.log(`
14
- `),U.fail("Following files already exist in the directory."),L.forEach((G)=>{console.log(`- ${M.green(G.targetFile)}`)}),(await i({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let G=O("Overwriting files").start();L.forEach((w)=>{I.copyFileSync(w.sourceFile,w.targetFile)}),G.succeed("Files are overwritten"),process.exit(0)}else console.log(`Use ${M.cyan("--overwrite")} or ${M.cyan("-o")} to overwrite existing files, or refer to the documentation ${M.cyan("https://untitled.xyz/docs")} for manual installation. The rest of the files are added.`),process.exit(1);if(H?.tailwindFile)console.log(`
45
+ cd ${_.cyan(P)}
46
+ ${_.cyan(C0())}`)}catch(b){if(R.fail(_.red(`
47
+ Failed to download and extract the repository`)),b instanceof Error)console.error(b.message);else console.error(`
48
+ `);u.rmdirSync(J,{recursive:!0}),process.exit(1)}}else{let J=t("Copying files to the project directory").start(),R=new Set,b=i(Q),q=A.resolve(A.join(d0,"../config")),W=I0.sync(["**"],{cwd:q,onlyFiles:!0,ignore:h}),U=["tailwindcss","tailwindcss-animate","@tailwindcss/typography","tailwindcss-react-aria-components"],K=["@tailwindcss/postcss","postcss"];if(W.forEach((I)=>{let y=I.includes("postcss.config"),k=A.resolve(A.posix.join(q),I),F=A.resolve(Q,y?I:`${L?.isSrcDir?"src":""}/${I}`);if(u.existsSync(F)){if(j?.overwrite)u.copyFileSync(k,F);else{let z0=u.readFileSync(F,"utf-8"),g=u.readFileSync(k,"utf-8");if(z0!==g)R.add({targetFile:F,sourceFile:k})}return}u.mkdirSync(A.dirname(F),{recursive:!0}),u.writeFileSync(F,""),u.copyFileSync(k,F)}),!R.size)J.succeed("Files are copied successfully!");if(R.size&&!j?.overwrite)if(console.log(`
49
+ `),J.fail("Following files already exist in the directory."),R.forEach((y)=>{console.log(`- ${_.green(y.targetFile)}`)}),(await b0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let y=t("Overwriting files").start();R.forEach((k)=>{u.copyFileSync(k.sourceFile,k.targetFile)}),y.succeed("Files are overwritten")}else console.log(`Use ${_.cyan("--overwrite")} or ${_.cyan("-o")} to overwrite existing files, or refer to the documentation ${_.cyan("https://untitled.xyz/docs")} for manual installation. The rest of the files are added.`);if(b?.tailwindFile)console.log(`
15
50
  Tailwind config file exists in the project directory. You can add it to your globals.css as follows:`),console.log(`
16
- ${M.cyan(`@config "../${X?.isSrcDir&&"../"}${b.relative(z,H.tailwindFile)}";`)}
17
- `);let J=H?.layoutFile||H?.appFile||X?.framework==="vite"&&H?.mainFile||"";if(!J)console.log(`Import following files to your main file:
18
- `),A.forEach((N)=>{console.log(M.cyan(N))});else{let G=new s3({tsConfigFilePath:b.resolve(H?.tsConfig||"")}).addSourceFileAtPath(b.resolve(J)),w="globals.css";G.getImportDeclarations().filter((T)=>T.getModuleSpecifierValue().includes("globals.css")).forEach((T)=>T.remove());let _=b.relative(b.resolve(z,`${X?.isSrcDir&&"src"}`),J).split("/").length,P=X?.aliasPrefix?.stylesPrefix||X?.aliasPrefix?.srcPrefix||(_===1?"./":"../".repeat(_-1));G.addImportDeclarations(A.filter((T)=>T.includes("globals.css")).map((T)=>({moduleSpecifier:`${P}${X?.aliasPrefix?.stylesPrefix?T?.split("styles/")[1]:T}`}))),G.saveSync()}let j=O(),D=Z3.sync(["**/styles/theme.css"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:S});if(!D?.length)return U.fail(`Failed to copy ${M.cyan("theme.css")} file.
19
- Ensure that the ${M.cyan("theme.css")} file exists in the project directory under ${M.yellow("styles/")} folder.`);if(Y3("brand",K.color,D[0]??""),!$)j.fail("Failed to get dependencies from package.json"),process.exit(1);j.start("Installing dependencies"),await p(x(),[x()==="npm"?"install":"add",...$.dependencies]),await p(x(),[x()==="npm"?"install":"add","-D",...$.devDependencies]),j.succeed("Dependencies are installed"),U.succeed(M.green("Project setup is completed!")),console.log(`
20
- Your project is ready, you can now start adding components.`),process.exit(0)}}var q3={name:"untitledui",version:"0.1.7",main:"dist/index.mjs",description:"Untitled UI CLI",type:"module",publishConfig:{access:"public"},scripts:{test:'echo "Error: no test specified" && exit 1',dev:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=http://localhost:3000/api --watch",build:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=https://untitledui-docs.vercel.app/api","publish:npm":"bun run build && npm publish --access public",start:"node dist/index.mjs"},repository:{type:"git",url:"https://github.com/a-peak-works/untitledui-tailwind.git"},bugs:{url:"https://github.com/a-peak-works/untitledui-tailwind/issues"},homepage:"https://github.com/a-peak-works/untitledui-tailwind#readme",keywords:["untitled-ui","cli","tailwindcss","nextjs"],files:["dist","config"],author:"",license:"MIT",bin:{untitledui:"dist/index.mjs"},exports:"./dist/index.mjs",dependencies:{"async-retry":"^1.3.3",chalk:"^5.4.1",commander:"^13.1.0",execa:"^7.0.0","fast-glob":"^3.3.3","node-fetch":"^3.3.2",ora:"^8.2.0",prettier:"^3.5.3",prompts:"^2.4.2",tar:"^7.4.3","ts-morph":"^25.0.1","tsconfig-paths":"^4.2.0","update-check":"^1.5.4"},devDependencies:{"@types/async-retry":"^1.4.9","@types/prompts":"^2.4.9","@types/tar":"^6.1.13","type-fest":"^4.37.0",typescript:"^5.8.2"}};process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function W0(){let Q=new Q0().name(q3.name).version(q3.version);Q.addCommand(j3).addCommand(b3),Q.parse()}W0();
51
+ ${_.cyan(`@config "../${L?.isSrcDir&&"../"}${A.relative(Q,b.tailwindFile)}";`)}
52
+ `);let C=b?.layoutFile||b?.appFile||L?.framework==="vite"&&b?.mainFile||"";if(!C)console.log(`Import following files to your main file:
53
+ `),W.forEach((I)=>{console.log(_.cyan(I))});else{let y=new A3({tsConfigFilePath:A.resolve(b?.tsConfig||"")}).addSourceFileAtPath(A.resolve(C)),k="globals.css";y.getImportDeclarations().filter((g)=>g.getModuleSpecifierValue().includes("globals.css")).forEach((g)=>g.remove());let F=A.relative(A.resolve(Q,`${L?.isSrcDir&&"src"}`),C).split("/").length,z0=L?.aliasPrefix?.stylesPrefix||L?.aliasPrefix?.srcPrefix||(F===1?"./":"../".repeat(F-1));y.addImportDeclarations(W.filter((g)=>g.includes("globals.css")).map((g)=>({moduleSpecifier:`${z0}${L?.aliasPrefix?.stylesPrefix?g?.split("styles/")[1]:g}`}))),y.saveSync()}let E=t(),x=I0.sync(["**/styles/theme.css"],{cwd:Q,absolute:!0,onlyFiles:!0,ignore:h});if(!x?.length)return J.fail(`Failed to copy ${_.cyan("theme.css")} file.
54
+ Ensure that the ${_.cyan("theme.css")} file exists in the project directory under ${_.yellow("styles/")} folder.`);if(R0("brand",j.color||"",x[0]??""),E.start("Installing dependencies"),await J0(()=>o(T(),[T()==="npm"?"install":"add",...U]).catch(async(I)=>{if(I.message.includes("peer"))E.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),E.start("Installing dependencies with --legacy-peer-deps flag"),await o(T(),[T()==="npm"?"install":"add",...U,"--legacy-peer-deps"])}),{retries:1}),await J0(()=>o(T(),[T()==="npm"?"install":"add",...K]).catch(async(I)=>{if(I.message.includes("peer"))E.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),E.start("Installing dependencies with --legacy-peer-deps flag"),await o(T(),[T()==="npm"?"install":"add",...K,"--legacy-peer-deps"])}),{retries:1}),E.succeed("Dependencies are installed"),J.succeed(_.green("Project setup is completed!")),!z?.projectPath)console.log(`
55
+ Your project is ready, you can now start adding components.`)}}var C3=G.join(y3.homedir(),".untitledui"),a=G.join(C3,"config.json"),$={path:"",example:"",license:"",components:[]},O={};if(w.existsSync(a)){let B=JSON.parse(w.readFileSync(a,"utf-8"));$.license=B.license}var e=(B)=>{if(B.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
56
+ `),process.exit(1)},f0=new w3().name("example").description("add an example to the project").argument("[example]","the example to add").option("-o, --overwrite","overwrite existing files.",!1).option("-p, --path <path>","the path to add the component to.").option("-e, --example-path <example-path>","the path to add the example file to.").addOption(new T3("-l, --license <license-key>","Add a license key for adding components.").hideHelp()).action(async(B,z)=>{if(B)$.example=B;if(z)$.path=z.path,$.overwrite=z.overwrite,$.examplePath=z.examplePath,$.license=z.license||$.license;try{await N0(z,O),await x3($)}catch(Q){console.error(H.red(Q))}});async function x3(B){let z=W0().start(),Q=G.posix.join(process.cwd(),O?.projectPath||"");if(!w.existsSync(G.posix.join(G.resolve(Q,"package.json"))))z.warn("This command should be run in a project directory."),process.exit(1);let Y=await r(Q);if($.license){if(!await n($.license))z.fail("Invalid license key"),process.exit(1);if(!w.existsSync(a)){let K=G.dirname(a);w.mkdirSync(K,{recursive:!0}),w.writeFileSync(a,JSON.stringify({license:$.license},null,2))}if(JSON.parse(w.readFileSync(a,"utf-8")).license!==$.license)w.writeFileSync(a,JSON.stringify({license:$.license},null,2),"utf-8")}if(z.stop(),!$.example){let W=await s({type:"select",name:"example",onState:e,message:"Select which type of example you want to add",choices:[{title:"Application",value:"application"},{title:"Marketing",value:"marketing"}]});$.example=W.example}let V=null;if($.example){let W=await U0($.example,$.license);if(W?.type==="error"&&(W.status===401||W.status===403))console.log(),console.log(H.yellow(`\uD83D\uDD12 The ${H.cyan($.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${H.green("→")} If you've already purchased: ${H.cyan(`${m()} untitledui@latest login`)}`),console.log(` ${H.green("→")} To purchase PRO examples: ${H.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1);if(W?.type==="directory"){let U=await s({type:"select",name:"example",onState:e,message:`Select a folder or file in "${$.example}"`,choices:W.results.map((K)=>({title:K,value:K}))});if(!U.example)return;if($.example=U.example,W=await U0(U.example,$.license),W?.type==="error"&&(W.status===401||W.status===403))console.log(),console.log(H.yellow(`\uD83D\uDD12 The ${H.cyan(U.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${H.green("→")} If you've already purchased: ${H.cyan(`${m()} untitledui@latest login`)}`),console.log(` ${H.green("→")} To purchase PRO examples: ${H.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(W?.type==="json-files"){let U=await s({type:"select",name:"example",onState:e,message:`Select a JSON file in "${$.example}"`,choices:W.results.map((K)=>({title:K,value:`${$.example}/${K}`}))});if(!U.example)return;if($.example=U.example,W=await U0(U.example,$.license),W?.type==="error"&&(W.status===401||W.status===403))console.log(),console.log(H.yellow(`\uD83D\uDD12 The ${H.cyan(U.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${H.green("→")} If you've already purchased: ${H.cyan(`${m()} untitledui@latest login`)}`),console.log(` ${H.green("→")} To purchase PRO examples: ${H.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(W?.type==="json-file")V=W.content}if(!V)z.fail("No example found"),process.exit(1);if(!$?.examplePath){let W=Y?.isUsingAppDir?"app":"pages",U=Y?.isSrcDir?G.posix.join("src",W):W,K=await s({type:"text",name:"examplePath",onState:e,message:`Where would you like to add the ${H.cyan($?.example)} example?`,initial:U});$.examplePath=K.examplePath}else if(!w.existsSync(G.posix.join(Q,$.examplePath)))w.mkdirSync(G.posix.join(Q,$.examplePath),{recursive:!0}),console.log(H.green(`Created directory ${$.examplePath}`));if(!$?.path){let W=await s({type:"text",name:"path",onState:e,message:`Where would you like to add the ${H.cyan("components")}?`,initial:"components"});$.path=W.path}let v=V.components.filter((W)=>!w.existsSync(G.posix.join(Q,`${Y?.isSrcDir&&"src"}`,W?.path?.replace(/components\//,$.path+"/"))));if(v?.length){let W=await s({type:"multiselect",name:"components",onState:e,message:`Select which components you want to add from ${H.cyan(V.name)} example`,choices:v.map((U)=>({title:U?.name,value:U?.name})),instructions:!1,hint:"- Space to select. Return to submit"});if($.components=W.components,!v.length&&!W.components?.length)z.warn("No components selected")}let M=i(Q),L=new Set,J=new S3({tsConfigFilePath:M?.tsConfig}),R=W0(`Adding ${$?.example}...`).start();try{if(V.files?.forEach(async({path:W,code:U})=>{let K=G.posix.join(Q,`${Y?.isSrcDir&&"src"}`,W.replace(/components\//,$.path+"/"));if(W.includes("examples")){let E=G.basename(W);K=G.posix.join(Q,$?.examplePath??"",E)}let C=G.dirname(K);if(w.existsSync(K)&&!$.overwrite){if(w.readFileSync(K,"utf-8")!==U)L.add({code:U,path:K})}else{w.mkdirSync(C,{recursive:!0}),w.writeFileSync(K,U);let E=G.relative(G.resolve(Q,`${Y?.isSrcDir&&"src"}`,$.path),K).split("/").length,x=E===1?"./":"../".repeat(E-1),I=J.addSourceFileAtPath(G.resolve(K));I.getImportDeclarations().forEach((y)=>{let k=y.getModuleSpecifierValue();y.setModuleSpecifier(p(k,$.path,Y?.aliasPrefix,x))}),await I.save()}}),L.size)R.warn(`Some files of ${H.yellow($?.example)} already exist`);else R.succeed(`${H.green($?.example)} is added successfully`)}catch(W){R.fail(`
57
+ Failed to add the component ${H.red($?.example)}`),console.error(H.red(W)),process.exit(1)}if(L.size&&!$?.overwrite)if(console.log(`
58
+ Following files already exist in the directory.`),L.forEach((U)=>{console.log(H.green(`- ${G.relative(Q,U.path)}`))}),(await s({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let U=W0("Overwriting files").start();L.forEach((K)=>{let C=G.relative(G.resolve(Q,`${Y?.isSrcDir&&"src"}`,$.path),K.path).split("/").length,E=C===1?"./":"../".repeat(C-1),x=J.addSourceFileAtPath(G.resolve(K.path));x.replaceWithText(K.code),x.getImportDeclarations().forEach((I)=>{let y=I.getModuleSpecifierValue();I.setModuleSpecifier(p(y,$.path,Y?.aliasPrefix,E))}),x.saveSync()}),U.succeed("Files are overwritten")}else console.log(`Use ${H.cyan("--overwrite")} or ${H.cyan("-o")} to overwrite existing files, or refer to the documentation ${H.cyan("https://untitled.xyz/docs")} for manual installation. The rest of the files are added.`),process.exit(1);let b=T();if(V?.dependencies?.length){let W=W0("Installing example dependencies").start();await u0(()=>Q0("sh",["-c",`${O?.projectPath?`cd ${O?.projectPath} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(V.dependencies).join(" ")}`]).catch(async(U)=>{if(U.message.includes("peer"))W.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),W.start("Installing dependencies with --legacy-peer-deps flag"),await Q0("sh",["-c",`${O?.projectPath?`cd ${O?.projectPath} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(V.dependencies).join(" ")} --legacy-peer-deps`])}),{retries:1}),W.succeed("Example dependencies are installed")}if(V?.devDependencies?.length){let W=W0("Installing example devDependencies").start();await u0(()=>Q0("sh",["-c",`${O?.projectPath?`cd ${O?.projectPath} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(V.devDependencies).join(" ")}`]).catch(async(U)=>{if(U.message.includes("peer"))W.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),W.start("Installing devDependencies with --legacy-peer-deps flag"),await Q0("sh",["-c",`${O?.projectPath?`cd ${O?.projectPath} && `:""}${b} ${b==="npm"?"install":"add"} ${Array.from(V.devDependencies).join(" ")} --legacy-peer-deps`])}),{retries:1}),W.succeed("Example devDependencies are installed")}let q=m();if($?.components?.length)await u0(()=>Q0(q,["untitledui@latest","add",...$.components,"--path",$.path,"--dir",O?.projectPath||""],{stdio:"inherit"}),{retries:1});process.exit(0)}var D0={name:"untitledui",version:"0.1.9",main:"dist/index.mjs",description:"Untitled UI CLI",type:"module",publishConfig:{access:"public"},scripts:{test:'echo "Error: no test specified" && exit 1',dev:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=http://localhost:3000/api --watch",build:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=https://untitledui-docs.vercel.app/api","publish:npm":"bun run build && npm publish --access public",start:"node dist/index.mjs"},repository:{type:"git",url:"https://github.com/a-peak-works/untitledui-tailwind.git"},bugs:{url:"https://github.com/a-peak-works/untitledui-tailwind/issues"},homepage:"https://github.com/a-peak-works/untitledui-tailwind#readme",keywords:["untitled-ui","cli","tailwindcss","nextjs"],files:["dist","config"],author:"",license:"MIT",bin:{untitledui:"dist/index.mjs"},exports:"./dist/index.mjs",dependencies:{"async-retry":"^1.3.3",chalk:"^5.4.1",commander:"^13.1.0",execa:"^7.0.0","fast-glob":"^3.3.3","node-fetch":"^3.3.2",open:"^10.1.0",ora:"^8.2.0",prettier:"^3.5.3",prompts:"^2.4.2",tar:"^7.4.3","ts-morph":"^25.0.1","tsconfig-paths":"^4.2.0","update-check":"^1.5.4"},devDependencies:{"@types/async-retry":"^1.4.9","@types/prompts":"^2.4.9","@types/tar":"^6.1.13","type-fest":"^4.37.0",typescript:"^5.8.2"}};process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function P3(){let B=new F3().name(D0.name).version(D0.version);B.addCommand(h0).addCommand(k0).addCommand(f0).addCommand(F0),B.parse()}P3();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "untitledui",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "main": "dist/index.mjs",
5
5
  "description": "Untitled UI CLI",
6
6
  "type": "module",
@@ -45,6 +45,7 @@
45
45
  "execa": "^7.0.0",
46
46
  "fast-glob": "^3.3.3",
47
47
  "node-fetch": "^3.3.2",
48
+ "open": "^10.1.0",
48
49
  "ora": "^8.2.0",
49
50
  "prettier": "^3.5.3",
50
51
  "prompts": "^2.4.2",