untitledui 0.1.44-beta → 0.1.44-beta.2

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.
@@ -1279,9 +1279,11 @@
1279
1279
  --text-color-placeholder_subtle: var(--color-text-placeholder_subtle);
1280
1280
  --text-color-brand-primary: var(--color-text-brand-primary);
1281
1281
  --text-color-brand-secondary: var(--color-text-brand-secondary);
1282
+ --text-color-brand-secondary_hover: var(--color-text-brand-secondary_hover);
1282
1283
  --text-color-brand-tertiary: var(--color-text-brand-tertiary);
1283
1284
  --text-color-brand-tertiary_alt: var(--color-text-brand-tertiary_alt);
1284
1285
  --text-color-error-primary: var(--color-text-error-primary);
1286
+ --text-color-error-primary_hover: var(--color-text-error-primary_hover);
1285
1287
  --text-color-warning-primary: var(--color-text-warning-primary);
1286
1288
  --text-color-success-primary: var(--color-text-success-primary);
1287
1289
  --text-color-tooltip-supporting-text: var(--color-tooltip-supporting-text);
package/dist/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import{Command as e3}from"commander";import o0 from"async-retry";import y from"chalk";import{Command as y3}from"commander";import{execa as L0}from"execa";import*as F from"fs";import q0 from"ora";import E3 from"os";import*as D from"path";import W0 from"prompts";import{Project as _3}from"ts-morph";import d0 from"node-fetch";import{Readable as K3,pipeline as V3}from"stream";import{x as L3}from"tar";import{promisify as b3}from"util";var M3=b3(V3);async function f0(Q,W){try{let z=await j3(W);await M3(z,L3({cwd:Q,strip:1}))}catch(z){throw new Error(`Failed to download or extract repository from API: ${z instanceof Error?z.message:z}`)}}async function j3(Q){let W=`https://www.untitledui.com/react/api/download-repo?template=${Q.template}`;try{let z=await d0(W,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/octet-stream"}});if(z.status===403||z.status===404)throw new Error("Repository not found");if(!z.ok)throw new Error(`Failed to download from API. Status: ${z.status} ${z.statusText}`);if(!z.body)throw new Error("Response body is empty");return K3.from(z.body)}catch(z){throw new Error(`Error downloading tarball: ${z instanceof Error?z.message:z}`)}}async function U0(Q){let W=`https://www.untitledui.com/react/api/validate-key?key=${Q}`;try{return(await d0(W)).status===200}catch{return!1}}import H3 from"node-fetch";var m0={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function K0(Q,W,z){let Z=W.map((B)=>{if(B.includes("modals/"))if(B.includes("-modal"))return B;else return B+"-modal";return B});try{let B=await H3("https://www.untitledui.com/react/api/components",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({type:Q,components:Z,key:z})});if(!B.ok)console.log(m0?.[B.statusText]||m0.no_components_found),process.exit(1);return await B.json()}catch(B){return null}}import v0 from"node-fetch";var p={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function c0(Q,W=""){let z=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${Q}`;try{let q=await v0(z),Z=await q.json();if(!q.ok)console.log(p?.[q.statusText]||p.no_components_found),process.exit(1);if(!Z?.components?.length)return null;return Z}catch(q){return console.error(q),null}}async function l0(Q,W="",z){let q=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${Q}&subfolders=${z.join(",")}`;try{let Z=await v0(q);if(!Z.ok)console.log(p?.[Z.statusText]||p.no_components_found),process.exit(1);let B=await Z.json();if(!B?.components?.length)return null;return B}catch(Z){return console.error(Z),null}}async function a0(Q=""){let W=`https://www.untitledui.com/react/api/components/list?key=${Q}`;try{let z=await v0(W);if(!z.ok)console.log(p?.[z.statusText]||p.no_components_found),process.exit(1);let q=await z.json();if(!q?.types?.length)return null;return q}catch(z){return console.error(z),null}}import i0 from"fast-glob";import*as u0 from"fs";import*as m from"path";import{Project as N1}from"ts-morph";import{loadConfig as N3}from"tsconfig-paths";import K1 from"prettier";import $0 from"fast-glob";import*as f from"fs";import*as t from"path";import{loadConfig as R3}from"tsconfig-paths";import s0 from"fs";import G3 from"path";function r0(Q=""){let W=G3.join(Q,"package.json");if(!s0.existsSync(W))return null;else return JSON.parse(s0.readFileSync(W,"utf-8"))}var O=["**/node_modules/**",".next","public","dist","build"],n0={"next-app":"Next.js (App)","next-pages":"Next.js (Pages)",vite:"Vite",other:"Other"};async function o(Q){let W=f.existsSync(t.resolve(Q,"src")),z=f.existsSync(t.resolve(Q,`${W?"src/":""}app`)),[q,Z,B,u,G]=await Promise.all([$0.glob("**/{next,vite,astro}.config.*|gatsby-config.*",{cwd:Q,deep:2,ignore:O}),I3(Q),v3(Q),u3(Q),r0(Q)]),U=f.existsSync(t.resolve(Q,"components.json")),H=null;if(U)H=JSON.parse(f.readFileSync(t.resolve(Q,"components.json"),"utf-8"));let b=$0.sync(["**/**/theme.css"],{cwd:Q,absolute:!0,onlyFiles:!0,ignore:O}),I=b?.[0]&&f.readFileSync(b[0],"utf-8").match(/(--color-brand+-\d{1,3}):\s*(rgb\([^)]+\))/g)?.[1]||void 0,K={tailwind:{config:B||void 0,brandColor:I?.replace(/--color-([^-]+(?:-[^-]+)?)-\d+:.*/,"$1")||void 0},aliases:H?.aliases||u||{},isTsx:Z,isSrcDir:W,isAppDir:z,framework:"other"};if(q.find((Y)=>Y.startsWith("next.config."))?.length)return K.framework=z?"next-app":"next-pages",K;else if(q.find((Y)=>Y.startsWith("vite.config."))?.length)return K.framework="vite",K;else if(q?.length||f.existsSync(t.resolve(Q,"package.json")))return K.framework="other",K;else if(Object.keys(G?.dependencies||{}).includes("react"))return K.framework="next-pages",K;return null}async function I3(Q){return(await $0.glob("tsconfig.*",{cwd:Q,deep:2,ignore:O})).length>0}async function v3(Q){let W=await $0.glob("tailwind.config.*",{cwd:Q,deep:2,ignore:O});if(!W.length)return null;return W[0]}async function u3(Q){let W=await R3(Q);if(console.log(W),W?.resultType==="failed"||!Object.keys(W.paths).length)return null;let z={},q={app:/\/?app\/\*$/,components:/\/?components\/\*$/,ui:/\/?ui\/\*$/,utils:/\/?utils\/\*$/,styles:/\/?styles\/\*$/,hooks:/\/?hooks\/\*$/,src:/^(?:\.\/\*|\/\*|\*|src\/\*|\/src\/\*)$/};for(let[Z,B]of Object.entries(W.paths)){let u=Z.replace(/\/\*$/,"/");for(let[G,U]of Object.entries(q))if(B.some((H)=>U.test(H))){z[G]=u;break}}return z||null}function e(Q){let W=N3(Q),z=i0.sync(["tailwind.config.*","**/globals.css","**/{layout,_app,main}.tsx","package.json"],{cwd:Q,deep:4,absolute:!0,onlyFiles:!0,ignore:O}),q={tailwindFile:z.find((Z)=>Z.includes("tailwind.config.")),cssFile:z.find((Z)=>Z.includes("globals.css")),layoutFile:z.find((Z)=>Z.includes("layout")),appFile:z.find((Z)=>Z.includes("_app")),mainFile:z.find((Z)=>Z.includes("main")),packageJson:z.find((Z)=>Z.includes("package.json")),tsConfig:W?.resultType==="success"?W?.configFileAbsolutePath:void 0};if(W.resultType==="failed")throw new Error(`Failed to load tsconfig.json. ${W.message??""}`.trim());return q}function z0(Q,W,z={},q=""){if(Q.includes("components")){if(z?.components||z?.ui)return Q.replace(/@\/components\//,m.posix.join(z?.components||z?.ui||"",W?W.replace(/components\/?/,""):"","/"));if(W){let Z=z?.src?m.posix.join(z?.src,W,"/"):q;return Q.replace(/@\/components\//,Z)}}if(Q.includes("app"))if(z.app)return Q.replace(/^@\/app\//,m.posix.join(z?.app,"/"));else return Q.replace(/^@\//,q);if(Q.includes("utils"))if(z.utils)return Q.replace(/^@\/utils\//,m.posix.join(z?.utils,"/"));else return Q.replace(/^@\//,q);if(Q.includes("hooks"))if(z.hooks)return Q.replace(/^@\/hooks\//,m.posix.join(z?.hooks,"/"));else return Q.replace(/^@\//,q);if(Q.includes("styles"))if(z.styles)return Q.replace(/^@\/styles\//,m.posix.join(z?.styles,"/"));else return Q.replace(/^@\//,q);if(z?.src)return Q.replace(/^@\//,m.posix.join(z?.src,"/"));return Q}function p0(Q){let W=i0.sync(["vite.config.*"],{cwd:Q,absolute:!0,onlyFiles:!0,ignore:O})?.[0];if(!W)return!1;try{let z=u0.readFileSync(W,"utf-8");return A3(z)}catch{return!1}}function A3(Q){let W=Q.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");if(!["tailwindcss","@tailwindcss/vite","tailwind("].some((B)=>W.includes(B)))return!1;return["plugins:","postcss:","css:"].some((B)=>W.includes(B))}function C(){if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("yarn"))return"yarn";if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("pnpm"))return"pnpm";if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("bun"))return"bun";return"npm"}function Q0(){switch(C()){case"yarn":return"yarn";case"pnpm":return"pnpx";case"bun":return"bunx";default:return"npx"}}function t0(){switch(C()){case"yarn":return"yarn dev";case"pnpm":return"pnpm dev";case"bun":return"bun dev";default:return"npm run dev"}}function V0(Q){return Q.replace(/^[ \t]*\/\/\s*(TODO:|collapse-(start|end)).*\r?\n?|[ \t]*{\s*\/\*\s*(TODO:|collapse-(start|end)).*?\*\/\s*}\r?\n?/gm,"")}var D3=D.join(E3.homedir(),".untitledui"),l=D.join(D3,"config.json"),X={components:[],path:"",type:void 0,license:""};if(F.existsSync(l)){let Q=JSON.parse(F.readFileSync(l,"utf-8"));X.license=Q.license}var B0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
3
- `),process.exit(1)},e0=new y3().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.").option("-t, --type <base|marketing|shared-assets|application|foundations>","the type of the component to add.").action(async(Q,W)=>{if(Q)X.components=Q;if(W)X.all=W.all,X.dir=W.dir,X.path=W.path,X.overwrite=W.overwrite,X.license=W.license||X.license;try{await N0(X)}catch(z){console.error(y.red(z))}});async function N0(Q){if(Q)X={...X,...Q};let W=q0().start(),z=D.posix.join(process.cwd(),X.dir||"");if(!F.existsSync(D.resolve(z,"package.json")))W.warn("This command should be run in a project directory."),process.exit(1);let Z=await o(z);if(X.license){if(!await U0(X.license))W.fail("Invalid license key"),process.exit(1);if(!F.existsSync(l)){let V=D.dirname(l);F.mkdirSync(V,{recursive:!0}),F.writeFileSync(l,JSON.stringify({license:X.license},null,2))}if(JSON.parse(F.readFileSync(l,"utf-8")).license!==X.license)F.writeFileSync(l,JSON.stringify({license:X.license},null,2),"utf-8")}if(W.stop(),!Z?.tailwind.brandColor)console.log(y.red("The project does not seem to be configured with Untitled UI Tailwind. Please follow the setup instructions in the documentation: https://www.untitledui.com/react/docs or run init command.")),process.exit(1);let B=[];if(X.components.length){let Y=await K0(X.type,X.components,X.license);if(Y&&Y.pro&&Y.pro.length>0){if(console.log(),Y.pro.length===1){let $=Y.pro[0]?.split("/")[1]||Y.pro[0];console.log(y.yellow(`\uD83D\uDD12 The ${y.cyan($)} component requires PRO access.`))}else console.log(y.yellow("\uD83D\uDD12 The following components require PRO access:")),Y.pro.forEach(($)=>{let V=$?.split("/")[1]||$;console.log(` • ${y.cyan(V)}`)});console.log(),console.log("To access PRO components:"),console.log(` ${y.green("→")} If you've already purchased: ${y.cyan(`${Q0()} untitledui@latest login`)}`),console.log(` ${y.green("→")} To purchase PRO components: ${y.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(!Y?.components.length)console.log("No components found"),process.exit(1);B.push(...Y.components)}if(!X?.type&&!X?.components.length){let Y=await a0(X.license);if(!Y)console.log("No component types found"),process.exit(1);let $=await W0({type:"select",name:"type",onState:B0,message:`What type of ${y.cyan("component")} are you adding?`,choices:Y?.types.map((V)=>({title:V,value:V}))});X.type=$.type}if(!X?.path){let Y=await W0({type:"text",name:"path",onState:B0,message:`Where would you like to add the ${y.cyan("components")}?`,initial:"components"});X.path=Y.path}if(!X?.components.length){let Y=await c0(X?.type,X.license);if(!Y)console.log("No components found"),process.exit(1);let $=await W0({type:"multiselect",name:"components",onState:B0,message:`Which ${y.cyan("components")} would you like to add?`,choices:Y?.components?.map((L)=>({title:L?.name+(L?.count?` (${L?.count} variants)`:"")||"example",value:L||"example",selected:X.components.includes(L.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!$.components||!$.components.length)console.log("No option selected. Exiting..."),process.exit(1);let V=$.components.filter((L)=>L?.type==="file").map((L)=>L.name),E=$.components.filter((L)=>L?.type==="dir").map((L)=>L.name),S=[];if(E.length){let L=await l0(X?.type,X.license,E);if(L&&L.components.length)for(let j of L.components){let[N,k]=Object.entries(j)[0]||[],T=await W0({type:"select",name:"component",onState:B0,message:`Which ${y.cyan("variant")} from ${y.cyan(N)} would you like to add?`,choices:k?.map((g)=>({title:g?.name.replace(/-modal/g,"")||"example",value:g?.name||"example",selected:X.components.includes(g.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!T.component)console.log("No variant selected for "+y.cyan(N));S.push(N+"/"+T.component)}else console.log("No variants found")}X.components=[...S,...V]}if(!X.components?.length)W.warn("No components selected. Exiting."),process.exit(1);let u=e(z),G=new Set,U=new Set,H=new Set,b=new _3({tsConfigFilePath:u?.tsConfig});if(W.start(),X.type&&X.components.length){let Y=await K0(X.type,X.components,X.license);if(!Y?.components.length)console.log("No components found"),process.exit(1);B.push(...Y.components)}let I=new Set;if(B.forEach((Y)=>{Y?.components?.forEach(($)=>{I.add({name:$.name,path:$.path})})}),W.stop(),I.size){let Y=Array.from(I).filter(($)=>!F.existsSync(D.posix.join(z,`${Z?.isSrcDir?"src":""}`,$?.path?.replace(/components\//,X.path+"/"))));if(Y?.length){let $=await W0({type:"multiselect",name:"baseComponents",onState:B0,message:"Select which base components you want to add",choices:Y.map((V)=>({title:V?.name,value:V?.name,selected:!0})),instructions:!1,hint:"- Space to select. Return to submit"});if(X.baseComponents=$.baseComponents,!Y.length&&!$.baseComponents?.length)W.warn("No components selected")}}if(W.start(),X?.baseComponents?.length){let Y=await K0("",X.baseComponents,X.license);if(!Y||!Y?.components.length)console.log("No base components found");else B.push(...Y.components)}if(W.stop(),B.forEach((Y)=>{let $=q0(`Adding ${Y.name}...`).start(),V=Y.files;Y?.dependencies?.forEach((E)=>U.add(E)),Y?.devDependencies?.forEach((E)=>H.add(E));try{if(V?.forEach(async({path:E,code:S})=>{let L=D.posix.join(z,`${Z?.isSrcDir?"src":""}`,E.replace(/components\//,X.path+"/")),j=Z?.framework==="vite"?S.replace(`"use client";
2
+ import{Command as Q1}from"commander";import Q3 from"async-retry";import y from"chalk";import{Command as _3}from"commander";import{execa as b0}from"execa";import*as F from"fs";import B0 from"ora";import E3 from"os";import*as k from"path";import s from"prompts";import{Project as T3}from"ts-morph";import d0 from"node-fetch";import{Readable as L3,pipeline as b3}from"stream";import{x as M3}from"tar";import{promisify as H3}from"util";var j3=H3(b3);async function f0(z,W){try{let Q=await G3(W);await j3(Q,M3({cwd:z,strip:1}))}catch(Q){throw new Error(`Failed to download or extract repository from API: ${Q instanceof Error?Q.message:Q}`)}}async function G3(z){let W=`https://www.untitledui.com/react/api/download-repo?template=${z.template}`;try{let Q=await d0(W,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/octet-stream"}});if(Q.status===403||Q.status===404)throw new Error("Repository not found");if(!Q.ok)throw new Error(`Failed to download from API. Status: ${Q.status} ${Q.statusText}`);if(!Q.body)throw new Error("Response body is empty");return L3.from(Q.body)}catch(Q){throw new Error(`Error downloading tarball: ${Q instanceof Error?Q.message:Q}`)}}async function K0(z){let W=`https://www.untitledui.com/react/api/validate-key?key=${z}`;try{return(await d0(W)).status===200}catch{return!1}}import v3 from"node-fetch";var m0={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function J0(z,W,Q){let $=W.map((Z)=>{if(Z.includes("modals/"))if(Z.includes("-modal"))return Z;else return Z+"-modal";return Z});try{let Z=await v3("https://www.untitledui.com/react/api/components",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({type:z,components:$,key:Q})});if(!Z.ok)console.log(m0?.[Z.statusText]||m0.no_components_found),process.exit(1);return await Z.json()}catch(Z){return null}}import R0 from"node-fetch";var e={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function l0(z,W=""){let Q=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${z}`;try{let B=await R0(Q),$=await B.json();if(!B.ok)console.log(e?.[B.statusText]||e.no_components_found),process.exit(1);if(!$?.components?.length)return null;return $}catch(B){return console.error(B),null}}async function c0(z,W="",Q){let B=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${z}&subfolders=${Q.join(",")}`;try{let $=await R0(B);if(!$.ok)console.log(e?.[$.statusText]||e.no_components_found),process.exit(1);let Z=await $.json();if(!Z?.components?.length)return null;return Z}catch($){return console.error($),null}}async function a0(z=""){let W=`https://www.untitledui.com/react/api/components/list?key=${z}`;try{let Q=await R0(W);if(!Q.ok)console.log(e?.[Q.statusText]||e.no_components_found),process.exit(1);let B=await Q.json();if(!B?.types?.length)return null;return B}catch(Q){return console.error(Q),null}}import p0 from"fast-glob";import*as V0 from"fs";import*as a from"path";import{Project as A3}from"ts-morph";import{loadConfig as t0}from"tsconfig-paths";import u3 from"prettier";async function s0(z,W="typescript"){try{return await u3.format(z,{parser:W,printWidth:160,tabWidth:4})}catch(Q){return console.error("Error formatting with Prettier:",Q),z}}import m from"fast-glob";import*as d from"fs";import*as c from"path";import{loadConfig as N0}from"tsconfig-paths";import r0 from"fs";import I3 from"path";function i0(z=""){let W=I3.join(z,"package.json");if(!r0.existsSync(W))return null;else return JSON.parse(r0.readFileSync(W,"utf-8"))}var P=["**/node_modules/**",".next","public","dist","build"],n0={"next-app":"Next.js (App)","next-pages":"Next.js (Pages)",vite:"Vite",other:"Other"};async function z0(z){let W=d.existsSync(c.resolve(z,"src")),Q=d.existsSync(c.resolve(z,`${W?"src/":""}app`)),[B,$,Z,v,j]=await Promise.all([m.glob("**/{next,vite,astro}.config.*|gatsby-config.*",{cwd:z,deep:2,ignore:P}),R3(z),N3(z),y3(z),i0(z)]),J=d.existsSync(c.resolve(z,"components.json")),b=null;if(J)b=JSON.parse(d.readFileSync(c.resolve(z,"components.json"),"utf-8"));let L=m.sync(["**/**/theme.css"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:P}),M=L?.[0]&&d.readFileSync(L[0],"utf-8").match(/(--color-brand+-\d{1,3}):\s*(rgb\([^)]+\))/g)?.[1]||void 0,K={tailwind:{config:Z||void 0,brandColor:M?.replace(/--color-([^-]+(?:-[^-]+)?)-\d+:.*/,"$1")||void 0},aliases:b?.aliases||v||{},isTsx:$,isSrcDir:W,isAppDir:Q,framework:"other"};if(B.find((Y)=>Y.startsWith("next.config."))?.length)return K.framework=Q?"next-app":"next-pages",K;else if(B.find((Y)=>Y.startsWith("vite.config."))?.length)return K.framework="vite",K;else if(B?.length||d.existsSync(c.resolve(z,"package.json")))return K.framework="other",K;else if(Object.keys(j?.dependencies||{}).includes("react"))return K.framework="next-pages",K;return null}async function R3(z){return(await m.glob("tsconfig.*",{cwd:z,deep:2,ignore:P})).length>0}async function N3(z){let W=await m.glob("tailwind.config.*",{cwd:z,deep:2,ignore:P});if(!W.length)return null;return W[0]}async function y3(z){let[W,Q]=await Promise.all([m.glob("next.config.*",{cwd:z,deep:1,ignore:P}),m.glob("vite.config.*",{cwd:z,deep:1,ignore:P})]),B=W.length>0,$=Q.length>0,Z;if(B)Z=N0(z);else if($){if(Z=N0(z),Z?.resultType==="failed"||!Object.keys(Z.paths||{}).length){let J=await m.glob(["tsconfig.app.*","*/tsconfig.app.*"],{cwd:z,deep:1,onlyFiles:!0,absolute:!0,ignore:P}),[b]=J;if(b)try{let M=function(q){return q.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*$/gm,"").replace(/,(\s*[}\]])/g,"$1")},L=d.readFileSync(b,"utf-8"),K=M(L),Y=JSON.parse(K);if(Y.compilerOptions?.paths)Z={resultType:"success",paths:Y?.compilerOptions?.paths,baseUrl:Y.compilerOptions.baseUrl||".",absoluteBaseUrl:c.resolve(z,Y.compilerOptions.baseUrl||".")}}catch{}}}else Z=N0(z);if(Z?.resultType==="failed"||!Object.keys(Z.paths).length)return null;let v={},j={app:/\/?app\/\*$/,components:/\/?components\/\*$/,utils:/\/?utils\/\*$/,styles:/\/?styles\/\*$/,hooks:/\/?hooks\/\*$/,src:/^(\.\/src\/\*|\.\/\*|\/src\/\*|src\/\*|\/\*|\*)$/};for(let[J,b]of Object.entries(Z.paths)){let L=J.replace(/\/\*$/,"/");for(let[M,K]of Object.entries(j))if(b.some((Y)=>K.test(Y))){v[M]=L;break}}return v||null}function Q0(z){let W=t0(z),Q=p0.sync(["tailwind.config.*","**/globals.css","**/{layout,_app,main}.tsx","package.json"],{cwd:z,deep:4,absolute:!0,onlyFiles:!0,ignore:P}),B={tailwindFile:Q.find(($)=>$.includes("tailwind.config.")),cssFile:Q.find(($)=>$.includes("globals.css")),layoutFile:Q.find(($)=>$.includes("layout")),appFile:Q.find(($)=>$.includes("_app")),mainFile:Q.find(($)=>$.includes("main")),packageJson:Q.find(($)=>$.includes("package.json")),tsConfig:W?.resultType==="success"?W?.configFileAbsolutePath:void 0};if(W.resultType==="failed")throw new Error(`Failed to load tsconfig.json. ${W.message??""}`.trim());return B}function W0(z,W,Q={}){if(z.includes("components")&&Q?.components)return z.replace(/@\/components\//,a.posix.join(Q?.components||"",W?W.replace(/components\/?/,""):"","/"));if(z.includes("app")&&Q?.app)return z.replace(/^@\/app\//,a.posix.join(Q?.app,"/"));if(z.includes("utils")&&Q?.utils)return z.replace(/^@\/utils\//,a.posix.join(Q?.utils,"/"));if(z.includes("hooks")&&Q?.hooks)return z.replace(/^@\/hooks\//,a.posix.join(Q?.hooks,"/"));if(z.includes("styles")&&Q?.styles)return z.replace(/^@\/styles\//,a.posix.join(Q?.styles,"/"));if(Q?.src)return z.replace(/^@\//,a.posix.join(Q?.src,"/"));return z}async function o0(z,W,Q="@/*"){let B=await t0(z);if(B?.resultType==="failed")return null;let $={};if(!Object.keys(B.paths).length){B.paths={[Q]:[`./${W?"src/":""}*`]},$.src=Q.replace(/\/\*$/,"");let Z=await V0.promises.readFile(B.configFileAbsolutePath,"utf-8"),v,j=/(?:\/\/\s*)?"paths":\s*\{(?:[^{}]|\{[^}]*\})*\}/;if(!j.test(Z))v=Z.replace(/"compilerOptions":\s*{/,`"compilerOptions": {
3
+ "paths": ${JSON.stringify(B.paths)},`);else v=Z.replace(j,`"paths": ${JSON.stringify(B.paths)}`);let b=new A3,L=await s0(v,"json");return b.createSourceFile(B.configFileAbsolutePath,L,{overwrite:!0}),await b.save(),$}return $||null}function e0(z){let W=p0.sync(["vite.config.*"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:P})?.[0];if(!W)return!1;try{let Q=V0.readFileSync(W,"utf-8");return D3(Q)}catch{return!1}}function D3(z){let W=z.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");if(!["tailwindcss","@tailwindcss/vite","tailwind("].some((Z)=>W.includes(Z)))return!1;return["plugins:","postcss:","css:"].some((Z)=>W.includes(Z))}function S(){if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("yarn"))return"yarn";if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("pnpm"))return"pnpm";if("bun/1.2.18 npm/? node/v24.3.0 darwin arm64".startsWith("bun"))return"bun";return"npm"}function Y0(){switch(S()){case"yarn":return"yarn";case"pnpm":return"pnpx";case"bun":return"bunx";default:return"npx"}}function z3(){switch(S()){case"yarn":return"yarn dev";case"pnpm":return"pnpm dev";case"bun":return"bun dev";default:return"npm run dev"}}function L0(z){return z.replace(/^[ \t]*\/\/\s*(TODO:|collapse-(start|end)).*\r?\n?|[ \t]*{\s*\/\*\s*(TODO:|collapse-(start|end)).*?\*\/\s*}\r?\n?/gm,"")}var x3=k.join(E3.homedir(),".untitledui"),r=k.join(x3,"config.json"),X={components:[],path:"",type:void 0,license:""};if(F.existsSync(r)){let z=JSON.parse(F.readFileSync(r,"utf-8"));X.license=z.license}var Z0=(z)=>{if(z.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
4
+ `),process.exit(1)},W3=new _3().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.").option("-t, --type <base|marketing|shared-assets|application|foundations>","the type of the component to add.").action(async(z,W)=>{if(z)X.components=z;if(W)X.all=W.all,X.dir=W.dir,X.path=W.path,X.overwrite=W.overwrite,X.license=W.license||X.license;try{await y0(X)}catch(Q){console.error(y.red(Q))}});async function y0(z){if(z)X={...X,...z};let W=B0().start(),Q=k.posix.join(process.cwd(),X.dir||"");if(!F.existsSync(k.resolve(Q,"package.json")))W.warn("This command should be run in a project directory."),process.exit(1);let $=await z0(Q);if(X.license){if(!await K0(X.license))W.fail("Invalid license key"),process.exit(1);if(!F.existsSync(r)){let V=k.dirname(r);F.mkdirSync(V,{recursive:!0}),F.writeFileSync(r,JSON.stringify({license:X.license},null,2))}if(JSON.parse(F.readFileSync(r,"utf-8")).license!==X.license)F.writeFileSync(r,JSON.stringify({license:X.license},null,2),"utf-8")}if(W.stop(),!$?.tailwind.brandColor)console.log(y.red("The project does not seem to be configured with Untitled UI Tailwind. Please follow the setup instructions in the documentation: https://www.untitledui.com/react/docs or run init command.")),process.exit(1);let Z=[];if(X.components.length){let Y=await J0(X.type,X.components,X.license);if(Y&&Y.pro&&Y.pro.length>0){if(console.log(),Y.pro.length===1){let q=Y.pro[0]?.split("/")[1]||Y.pro[0];console.log(y.yellow(`\uD83D\uDD12 The ${y.cyan(q)} component requires PRO access.`))}else console.log(y.yellow("\uD83D\uDD12 The following components require PRO access:")),Y.pro.forEach((q)=>{let V=q?.split("/")[1]||q;console.log(` • ${y.cyan(V)}`)});console.log(),console.log("To access PRO components:"),console.log(` ${y.green("→")} If you've already purchased: ${y.cyan(`${Y0()} untitledui@latest login`)}`),console.log(` ${y.green("→")} To purchase PRO components: ${y.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(!Y?.components.length)console.log("No components found"),process.exit(1);Z.push(...Y.components)}if(!X?.type&&!X?.components.length){let Y=await a0(X.license);if(!Y)console.log("No component types found"),process.exit(1);let q=await s({type:"select",name:"type",onState:Z0,message:`What type of ${y.cyan("component")} are you adding?`,choices:Y?.types.map((V)=>({title:V,value:V}))});X.type=q.type}if(!X?.path){let Y=await s({type:"text",name:"path",onState:Z0,message:`Where would you like to add the ${y.cyan("components")}?`,initial:"components"});X.path=Y.path}if($&&!Object.keys($?.aliases).length){let Y=/^[^*"]+\/\*\s*$/,q=await s({type:"text",name:"aliasPrefix",onState:Z0,initial:"@/*",message:`What is the ${y.cyan("import alias")} for your project?`,validate:(V)=>Y.test(V)?!0:"Import alias must follow the pattern <prefix>/*"});$.aliases=await o0(Q,$?.isSrcDir,q?.aliasPrefix)}if(!X?.components.length){let Y=await l0(X?.type,X.license);if(!Y)console.log("No components found"),process.exit(1);let q=await s({type:"multiselect",name:"components",onState:Z0,message:`Which ${y.cyan("components")} would you like to add?`,choices:Y?.components?.map((G)=>({title:G?.name+(G?.count?` (${G?.count} variants)`:"")||"example",value:G||"example",selected:X.components.includes(G.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!q.components||!q.components.length)console.log("No option selected. Exiting..."),process.exit(1);let V=q.components.filter((G)=>G?.type==="file").map((G)=>G.name),N=q.components.filter((G)=>G?.type==="dir").map((G)=>G.name),T=[];if(N.length){let G=await c0(X?.type,X.license,N);if(G&&G.components.length)for(let R of G.components){let[D,C]=Object.entries(R)[0]||[],w=await s({type:"select",name:"component",onState:Z0,message:`Which ${y.cyan("variant")} from ${y.cyan(D)} would you like to add?`,choices:C?.map((h)=>({title:h?.name.replace(/-modal/g,"")||"example",value:h?.name||"example",selected:X.components.includes(h.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!w.component)console.log("No variant selected for "+y.cyan(D));T.push(D+"/"+w.component)}else console.log("No variants found")}X.components=[...T,...V]}if(!X.components?.length)W.warn("No components selected. Exiting."),process.exit(1);let v=Q0(Q),j=new Set,J=new Set,b=new Set,L=new T3({tsConfigFilePath:v?.tsConfig});if(W.start(),X.type&&X.components.length){let Y=await J0(X.type,X.components,X.license);if(!Y?.components.length)console.log("No components found"),process.exit(1);Z.push(...Y.components)}let M=new Set;if(Z.forEach((Y)=>{Y?.components?.forEach((q)=>{M.add({name:q.name,path:q.path})})}),W.stop(),M.size){let Y=Array.from(M).filter((q)=>!F.existsSync(k.posix.join(Q,`${$?.isSrcDir?"src":""}`,q?.path?.replace(/components\//,X.path+"/"))));if(Y?.length){let q=await s({type:"multiselect",name:"baseComponents",onState:Z0,message:"Select which base components you want to add",choices:Y.map((V)=>({title:V?.name,value:V?.name,selected:!0})),instructions:!1,hint:"- Space to select. Return to submit"});if(X.baseComponents=q.baseComponents,!Y.length&&!q.baseComponents?.length)W.warn("No components selected")}}if(W.start(),X?.baseComponents?.length){let Y=await J0("",X.baseComponents,X.license);if(!Y||!Y?.components.length)console.log("No base components found");else Z.push(...Y.components)}if(W.stop(),Z.forEach((Y)=>{let q=B0(`Adding ${Y.name}...`).start(),V=Y.files;Y?.dependencies?.forEach((N)=>J.add(N)),Y?.devDependencies?.forEach((N)=>b.add(N));try{if(V?.forEach(async({path:N,code:T})=>{let G=k.posix.join(Q,`${$?.isSrcDir?"src":""}`,N.replace(/components\//,X.path+"/")),R=$?.framework==="vite"?T.replace(`"use client";
4
5
 
5
- `,""):S,N=V0(j),k=D.dirname(L);if(F.existsSync(L)&&!X.overwrite){if(F.readFileSync(L,"utf-8")!==N)G.add({code:N,path:L})}else{F.mkdirSync(k,{recursive:!0}),F.writeFileSync(L,N);let T=D.relative(D.posix.join(z,`${Z?.isSrcDir?"src":""}`),D.dirname(L)).split("/").length,g=T===1?"./":"../".repeat(T-1),P=b.addSourceFileAtPath(D.resolve(L));P.getImportDeclarations().forEach((h0)=>{let U3=h0.getModuleSpecifierValue();h0.setModuleSpecifier(z0(U3,X.path,Z?.aliases,g))}),await P.save()}}),G.size)$.warn(`Some files of ${y.yellow(Y.name)} already exist`);else $.succeed(`${y.green(Y.name)} is added successfully`)}catch(E){$.fail(`
6
- Failed to add the component ${y.red(Y.name)}`),console.error(y.red(E)),process.exit(1)}}),G.size&&!X?.overwrite)if(console.log(`
7
- Following files already exist in the directory.`),G.forEach(($)=>{console.log(y.green(`- ${D.relative(z,$.path)}`))}),(await W0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let $=q0("Overwriting files").start();G.forEach((V)=>{let E=D.relative(D.resolve(z,`${Z?.isSrcDir?"src":""}`,X.path),D.dirname(V.path)).split("/").length,S=E===1?"./":"../".repeat(E-1),L=b.addSourceFileAtPath(D.resolve(V.path));L.replaceWithText(V.code),L.getImportDeclarations().forEach((j)=>{let N=j.getModuleSpecifierValue();j.setModuleSpecifier(z0(N,X.path,Z?.aliases,S))}),L.saveSync()}),$.succeed("Files are overwritten")}else console.log(`Use ${y.cyan("--overwrite")} or ${y.cyan("-o")} to overwrite existing files, or refer to the documentation ${y.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);let K=C();if(U?.size){let Y=q0("Installing component dependencies").start();await o0(()=>L0(K,[K==="npm"?"install":"add",...U],{cwd:z}).catch(async($)=>{if($.message.includes("peer"))Y.warn("Component dependencies conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing component dependencies with --legacy-peer-deps flag"),await L0(K,[K==="npm"?"install":"add",...U,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Component dependencies are installed")}if(H?.size){let Y=q0("Installing component devDependencies").start();await o0(()=>L0(K,[K==="npm"?"install":"add","-D",...H],{cwd:z}).catch(async($)=>{if($.message.includes("peer"))Y.warn("Component devDependencies conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing component devDependencies with --legacy-peer-deps flag"),await L0(K,[K==="npm"?"install":"add","-D",...H,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Component devDependencies are installed")}if(X.message)console.log(X.message);process.exit(0)}import E0 from"chalk";import{Command as S3}from"commander";import*as d from"fs";import C3 from"http";import F3 from"open";import k3 from"ora";import P3 from"os";import*as D0 from"path";import{URL as g3}from"url";import*as b0 from"fs";import*as a from"path";import{fileURLToPath as T3}from"url";var w3=T3(import.meta.url),A0=a.dirname(w3);function x3(){let Q=[a.join(A0,"..","templates","auth-template.html"),a.join(A0,"templates","auth-template.html"),a.join(process.cwd(),"node_modules","untitledui","templates","auth-template.html"),a.join(A0,"..","..","templates","auth-template.html")];for(let W of Q)if(b0.existsSync(W))return W;throw new Error("Auth template file not found. Please ensure the CLI package is properly installed.")}function z3(){try{let Q=x3();return b0.readFileSync(Q,"utf-8")}catch(Q){return console.warn("Warning: Using fallback auth template. Some styling may be missing."),`<!doctype html>
6
+ `,""):T,D=L0(R),C=k.dirname(G);if(F.existsSync(G)&&!X.overwrite){if(F.readFileSync(G,"utf-8")!==D)j.add({code:D,path:G})}else{F.mkdirSync(C,{recursive:!0}),F.writeFileSync(G,D);let w=L.addSourceFileAtPath(k.resolve(G));w.getImportDeclarations().forEach((h)=>{let O=h.getModuleSpecifierValue();h.setModuleSpecifier(W0(O,X.path,$?.aliases))}),await w.save()}}),j.size)q.warn(`Some files of ${y.yellow(Y.name)} already exist`);else q.succeed(`${y.green(Y.name)} is added successfully`)}catch(N){q.fail(`
7
+ Failed to add the component ${y.red(Y.name)}`),console.error(y.red(N)),process.exit(1)}}),j.size&&!X?.overwrite)if(console.log(`
8
+ Following files already exist in the directory.`),j.forEach((q)=>{console.log(y.green(`- ${k.relative(Q,q.path)}`))}),(await s({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let q=B0("Overwriting files").start();j.forEach((V)=>{let N=L.addSourceFileAtPath(k.resolve(V.path));N.replaceWithText(V.code),N.getImportDeclarations().forEach((T)=>{let G=T.getModuleSpecifierValue();T.setModuleSpecifier(W0(G,X.path,$?.aliases))}),N.saveSync()}),q.succeed("Files are overwritten")}else console.log(`Use ${y.cyan("--overwrite")} or ${y.cyan("-o")} to overwrite existing files, or refer to the documentation ${y.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);let K=S();if(J?.size){let Y=B0("Installing component dependencies").start();await Q3(()=>b0(K,[K==="npm"?"install":"add",...J],{cwd:Q}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("Component dependencies conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing component dependencies with --legacy-peer-deps flag"),await b0(K,[K==="npm"?"install":"add",...J,"--legacy-peer-deps"],{cwd:Q})}),{retries:1}),Y.succeed("Component dependencies are installed")}if(b?.size){let Y=B0("Installing component devDependencies").start();await Q3(()=>b0(K,[K==="npm"?"install":"add","-D",...b],{cwd:Q}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("Component devDependencies conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing component devDependencies with --legacy-peer-deps flag"),await b0(K,[K==="npm"?"install":"add","-D",...b,"--legacy-peer-deps"],{cwd:Q})}),{retries:1}),Y.succeed("Component devDependencies are installed")}if(X.message)console.log(X.message);process.exit(0)}import _0 from"chalk";import{Command as k3}from"commander";import*as f from"fs";import C3 from"http";import P3 from"open";import O3 from"ora";import g3 from"os";import*as T0 from"path";import{URL as h3}from"url";import*as M0 from"fs";import*as i from"path";import{fileURLToPath as w3}from"url";var S3=w3(import.meta.url),A0=i.dirname(S3);function F3(){let z=[i.join(A0,"..","templates","auth-template.html"),i.join(A0,"templates","auth-template.html"),i.join(process.cwd(),"node_modules","untitledui","templates","auth-template.html"),i.join(A0,"..","..","templates","auth-template.html")];for(let W of z)if(M0.existsSync(W))return W;throw new Error("Auth template file not found. Please ensure the CLI package is properly installed.")}function Y3(){try{let z=F3();return M0.readFileSync(z,"utf-8")}catch(z){return console.warn("Warning: Using fallback auth template. Some styling may be missing."),`<!doctype html>
8
9
  <html lang="en">
9
10
  <head>
10
11
  <meta charset="UTF-8" />
@@ -50,31 +51,31 @@ Following files already exist in the directory.`),G.forEach(($)=>{console.log(y.
50
51
  {{AUTO_CLOSE_SCRIPT}}
51
52
  </div>
52
53
  </body>
53
- </html>`}}function Q3(){return z3().replace("{{TITLE}}","Authentication successful").replace("{{HEADING}}","Authentication successful").replace("{{DESCRIPTION}}","You can now close this tab and return to your terminal.").replace("{{AUTO_CLOSE_SCRIPT}}","<script>setTimeout(() => window.close(), 10000);</script>")}function M0(Q){return z3().replace("{{TITLE}}","Authentication failed").replace("{{HEADING}}","Authentication failed").replace("{{DESCRIPTION}}",Q).replace("{{AUTO_CLOSE_SCRIPT}}","")}var _0=D0.join(P3.homedir(),".untitledui"),y0=D0.join(_0,"config.json"),W3=new S3().name("login").description("authenticate with Untitled UI to access PRO components").action(async()=>{let Q=k3("Starting authentication...").start();try{await O3(Q),Q.succeed("Authentication completed successfully!"),console.log(E0.green(`
54
- ✨ You can now access PRO components with the CLI!`)),process.exit(0)}catch(W){Q.fail(`Authentication failed: ${W instanceof Error?W.message:W}`),process.exit(1)}});async function O3(Q){return new Promise((W,z)=>{let q=C3.createServer((Z,B)=>{let u=new g3(Z.url,"http://localhost");if(u.pathname==="/callback"){let G=u.searchParams.get("apiKey"),U=u.searchParams.get("error");if(U){B.writeHead(400,{"Content-Type":"text/html"}),B.end(M0(decodeURIComponent(U))),q.close(),z(new Error(decodeURIComponent(U)));return}if(!G){B.writeHead(400,{"Content-Type":"text/html"}),B.end(M0("No Access Token received")),q.close(),z(new Error("No Access Token received"));return}try{h3(G),B.writeHead(200,{"Content-Type":"text/html"}),B.end(Q3()),q.close(),W()}catch(H){B.writeHead(500,{"Content-Type":"text/html"}),B.end(M0("Failed to save authentication data")),q.close(),z(H)}}else B.writeHead(404),B.end("Not found")});q.listen(0,"localhost",()=>{let u=`https://www.untitledui.com/react/api/cli-auth?port=${q.address().port}`;Q.text="Opening browser for authentication...",F3(u).catch((G)=>{console.log(E0.yellow(`
55
- Failed to open browser automatically: ${G.message}`)),console.log(E0.cyan(`Please manually open: ${u}
56
- `))}),Q.text="Waiting for authentication in browser..."}),setTimeout(()=>{q.close(),z(new Error("Authentication timeout. Please try again."))},300000)})}function h3(Q){if(!d.existsSync(_0))d.mkdirSync(_0,{recursive:!0});let W={};if(d.existsSync(y0))try{W=JSON.parse(d.readFileSync(y0,"utf-8"))}catch{W={}}W.license=Q,d.writeFileSync(y0,JSON.stringify(W,null,2),"utf-8")}import P0 from"async-retry";import M from"chalk";import{Command as r3}from"commander";import{execa as I0}from"execa";import*as x from"fs";import J0 from"ora";import n3 from"os";import*as R from"path";import n from"prompts";import{Project as i3}from"ts-morph";import d3 from"node-fetch";async function j0(Q,W){try{let q=await d3("https://www.untitledui.com/react/api/components/example",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({example:Q,key:W})});if(!q.ok){if(q.status===401||q.status===403)return{type:"error",status:q.status,message:"PRO access required"};return console.error(`API error: ${q.status} - ${q.statusText}`),null}return await q.json()}catch(q){return console.error(q?.message||"Error fetching example data."),null}}import X0 from"async-retry";import _ from"chalk";import{Command as f3}from"commander";import{execa as s}from"execa";import C0 from"fast-glob";import w from"fs";import Y0 from"ora";import m3 from"os";import*as A from"path";import R0 from"prompts";import{Project as c3}from"ts-morph";import{fileURLToPath as l3}from"url";import*as H0 from"fs";import*as Y3 from"path";function T0(Q,W){let z=Y3.join(Q,"package.json");if(!H0.existsSync(z))return W;let q=JSON.parse(H0.readFileSync(z,"utf-8")),Z={...q.dependencies,...q.devDependencies},B=[];for(let u of W){let G=Z[u];if(!G){B.push(u);continue}if(u==="tailwindcss"){let U=G.match(/\d+/);if((U?parseInt(U[0],10):0)<4)B.push(u)}}return B}import w0 from"chalk";import*as c from"fs";import*as G0 from"path";function x0(Q){if(!c.existsSync(G0.resolve(Q)))console.log(w0.red(`Error: CSS file not found at ${Q}`)),process.exit(1);let W=c.readFileSync(G0.resolve(Q),"utf-8"),z=/(--color-[a-zA-Z-]+-\d{1,3}):\s*(rgb\([^)]+\))/g,q={},Z;while((Z=z.exec(W))!==null)if(Z[1]&&Z[2])q[Z[1]]=Z[2];return q}function S0(Q,W,z){let q=G0.resolve(z);if(!c.existsSync(q)){console.log(w0.red(`Error: CSS file not found at ${q}`));return}let Z=c.readFileSync(q,"utf-8"),B=x0(z),u={},G={};for(let[H,b]of Object.entries(B))if(H.startsWith(`--color-${Q}-`)){let I=H.replace(`--color-${Q}-`,"");u[I]=H}else if(H.startsWith(`--color-${W}-`)){let I=H.replace(`--color-${W}-`,"");G[I]=b}let U=!1;for(let[H,b]of Object.entries(u))if(G[H]){let I=G[H],K=new RegExp(`(${b}):\\s*rgb\\([^)]*\\);?`,"g");if(K.test(Z))Z=Z.replace(K,`$1: ${I};`),U=!0;else console.log(w0.yellow(`No match found for ${b}`))}if(U)c.writeFileSync(q,Z,"utf-8")}var a3=l3(import.meta.url),Z3=A.dirname(a3),s3=A.join(m3.homedir(),".untitledui"),r=A.join(s3,"config.json"),q3="vite",B3="nextjs",$3={[B3]:"Next.js",[q3]:"Vite"},h="",v={color:"",template:"",framework:void 0};if(w.existsSync(r)){let Q=JSON.parse(w.readFileSync(r,"utf-8"));v.license=Q.license}var F0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
57
- `),process.exit(1)},X3=new f3().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("--nextjs","initialize a Next.js project.",!1).option("-o, --overwrite","overwrite existing files.",!1).option("--colors-list","show the colors list.",!1).option("-c, --color <color-name>","specify a color for the project.").action(async(Q,W)=>{if(Q)h=Q;if(W){if(v.color=W.color,v.template=W.template,v.overwrite=W.overwrite,v.colorsList=W.colorsList,v.license=W.license||v.license,v.vite=W.vite,v.nextjs=W.nextjs,W.vite)v.framework=q3;if(W.nextjs)v.framework=B3}try{await k0(W),process.exit(0)}catch(z){console.error(_.red(z)),process.exit(1)}});async function k0(Q,W=null){let z=process.cwd(),q=w.existsSync(A.resolve(z,"package.json")),Z=A.resolve(A.join(Z3,"../config/styles","theme.css")),B=x0(Z??""),u=Array.from(new Set(Object.keys(B).map((b)=>b?.split("--color-")?.[1]?.replace(/-\d{1,3}/,"")))),G=Y0().start(),U=await o(z);if(v.license){if(!w.existsSync(r)){let I=A.dirname(r);w.mkdirSync(I,{recursive:!0}),w.writeFileSync(r,JSON.stringify({license:v.license},null,2))}if(JSON.parse(w.readFileSync(r,"utf-8")).license!==v.license)w.writeFileSync(r,JSON.stringify({license:v.license},null,2))}if(!q){if(G.stop(),!h){let b=await R0({onState:F0,type:"text",name:"path",message:"What is your project named?",initial:"untitled-ui"});if(typeof b.path==="string")h=b.path.trim()}if(W)W.projectPath=h;if(w.existsSync(A.resolve(A.posix.join(z,h))))G.fail(_.red("Directory already exists!")),process.exit(1);if(v.vite&&v.nextjs||!v.framework){let b=await R0({type:"select",name:"framework",onState:F0,message:`Which ${_.cyan("framework")} would you like to use?`,choices:Object.entries($3).map(([I,K])=>({title:K,value:I}))});v.framework=b.framework}G.succeed("Framework is selected: "+_.green($3[v.framework]))}else if(U?.framework==="other")G.fail("Unsupported project framework"),console.log(`Please refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for supported frameworks or proceed with manual installation.`),process.exit(1);else if(U?.framework.startsWith("next")||U?.framework.startsWith("vite"))if(!W&&!U.tailwind.brandColor)G.succeed(_.yellow(`Detected ${n0[U.framework]} project, proceeding with the setup...`));else G.stop();if(v.colorsList||!v.color&&!U?.tailwind.brandColor){let b=await R0({type:"select",name:"color",onState:F0,initial:Q.color??"",message:`Which ${_.cyan("color")} would you like to use as the ${_.cyanBright("brand")} color?`,choices:u.map((I)=>({title:I,value:I}))});if(v.color=b.color,v.colorsList&&U)U.tailwind.brandColor=b.color}let H=A.posix.join(z,h||"");if(h&&!q){let b=A.resolve(h);console.log(`
58
- Creating a new project in ${_.blue(h)}`);let I=Y0("Downloading and extracting the repository...").start();try{w.mkdirSync(b,{recursive:!0}),await X0(()=>f0(b,{template:v.framework}),{retries:2}),I.succeed("Files are downloaded and extracted successfully!");let K=Y0({text:"Installing dependencies..."}).start(),Y=C0.sync(["**/styles/theme.css"],{cwd:b,absolute:!0,onlyFiles:!0})[0];if(S0("brand",v.color||"",Y??""),await X0(()=>s(C(),["install"],{cwd:H}).catch(async($)=>{if($.message.includes("peer"))K.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),K.start("Installing dependencies with --legacy-peer-deps flag"),await s(C(),["install","--legacy-peer-deps"],{cwd:H})}),{retries:1}),await X0(()=>s("git",["init"],{cwd:H}),{retries:1}),K.succeed("Dependencies are installed"),!W)console.log(`
54
+ </html>`}}function Z3(){return Y3().replace("{{TITLE}}","Authentication successful").replace("{{HEADING}}","Authentication successful").replace("{{DESCRIPTION}}","You can now close this tab and return to your terminal.").replace("{{AUTO_CLOSE_SCRIPT}}","<script>setTimeout(() => window.close(), 10000);</script>")}function H0(z){return Y3().replace("{{TITLE}}","Authentication failed").replace("{{HEADING}}","Authentication failed").replace("{{DESCRIPTION}}",z).replace("{{AUTO_CLOSE_SCRIPT}}","")}var E0=T0.join(g3.homedir(),".untitledui"),D0=T0.join(E0,"config.json"),$3=new k3().name("login").description("authenticate with Untitled UI to access PRO components").action(async()=>{let z=O3("Starting authentication...").start();try{await d3(z),z.succeed("Authentication completed successfully!"),console.log(_0.green(`
55
+ ✨ You can now access PRO components with the CLI!`)),process.exit(0)}catch(W){z.fail(`Authentication failed: ${W instanceof Error?W.message:W}`),process.exit(1)}});async function d3(z){return new Promise((W,Q)=>{let B=C3.createServer(($,Z)=>{let v=new h3($.url,"http://localhost");if(v.pathname==="/callback"){let j=v.searchParams.get("apiKey"),J=v.searchParams.get("error");if(J){Z.writeHead(400,{"Content-Type":"text/html"}),Z.end(H0(decodeURIComponent(J))),B.close(),Q(new Error(decodeURIComponent(J)));return}if(!j){Z.writeHead(400,{"Content-Type":"text/html"}),Z.end(H0("No Access Token received")),B.close(),Q(new Error("No Access Token received"));return}try{f3(j),Z.writeHead(200,{"Content-Type":"text/html"}),Z.end(Z3()),B.close(),W()}catch(b){Z.writeHead(500,{"Content-Type":"text/html"}),Z.end(H0("Failed to save authentication data")),B.close(),Q(b)}}else Z.writeHead(404),Z.end("Not found")});B.listen(0,"localhost",()=>{let v=`https://www.untitledui.com/react/api/cli-auth?port=${B.address().port}`;z.text="Opening browser for authentication...",P3(v).catch((j)=>{console.log(_0.yellow(`
56
+ Failed to open browser automatically: ${j.message}`)),console.log(_0.cyan(`Please manually open: ${v}
57
+ `))}),z.text="Waiting for authentication in browser..."}),setTimeout(()=>{B.close(),Q(new Error("Authentication timeout. Please try again."))},300000)})}function f3(z){if(!f.existsSync(E0))f.mkdirSync(E0,{recursive:!0});let W={};if(f.existsSync(D0))try{W=JSON.parse(f.readFileSync(D0,"utf-8"))}catch{W={}}W.license=z,f.writeFileSync(D0,JSON.stringify(W,null,2),"utf-8")}import O0 from"async-retry";import H from"chalk";import{Command as n3}from"commander";import{execa as I0}from"execa";import*as x from"fs";import U0 from"ora";import p3 from"os";import*as A from"path";import t from"prompts";import{Project as t3}from"ts-morph";import m3 from"node-fetch";async function j0(z,W){try{let B=await m3("https://www.untitledui.com/react/api/components/example",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({example:z,key:W})});if(!B.ok){if(B.status===401||B.status===403)return{type:"error",status:B.status,message:"PRO access required"};return console.error(`API error: ${B.status} - ${B.statusText}`),null}return await B.json()}catch(B){return console.error(B?.message||"Error fetching example data."),null}}import X0 from"async-retry";import _ from"chalk";import{Command as l3}from"commander";import{execa as n}from"execa";import k0 from"fast-glob";import E from"fs";import $0 from"ora";import c3 from"os";import*as I from"path";import u0 from"prompts";import{Project as a3}from"ts-morph";import{fileURLToPath as s3}from"url";import*as G0 from"fs";import*as q3 from"path";function x0(z,W){let Q=q3.join(z,"package.json");if(!G0.existsSync(Q))return W;let B=JSON.parse(G0.readFileSync(Q,"utf-8")),$={...B.dependencies,...B.devDependencies},Z=[];for(let v of W){let j=$[v];if(!j){Z.push(v);continue}if(v==="tailwindcss"){let J=j.match(/\d+/);if((J?parseInt(J[0],10):0)<4)Z.push(v)}}return Z}import w0 from"chalk";import*as l from"fs";import*as v0 from"path";function S0(z){if(!l.existsSync(v0.resolve(z)))console.log(w0.red(`Error: CSS file not found at ${z}`)),process.exit(1);let W=l.readFileSync(v0.resolve(z),"utf-8"),Q=/(--color-[a-zA-Z-]+-\d{1,3}):\s*(rgb\([^)]+\))/g,B={},$;while(($=Q.exec(W))!==null)if($[1]&&$[2])B[$[1]]=$[2];return B}function F0(z,W,Q){let B=v0.resolve(Q);if(!l.existsSync(B)){console.log(w0.red(`Error: CSS file not found at ${B}`));return}let $=l.readFileSync(B,"utf-8"),Z=S0(Q),v={},j={};for(let[b,L]of Object.entries(Z))if(b.startsWith(`--color-${z}-`)){let M=b.replace(`--color-${z}-`,"");v[M]=b}else if(b.startsWith(`--color-${W}-`)){let M=b.replace(`--color-${W}-`,"");j[M]=L}let J=!1;for(let[b,L]of Object.entries(v))if(j[b]){let M=j[b],K=new RegExp(`(${L}):\\s*rgb\\([^)]*\\);?`,"g");if(K.test($))$=$.replace(K,`$1: ${M};`),J=!0;else console.log(w0.yellow(`No match found for ${L}`))}if(J)l.writeFileSync(B,$,"utf-8")}var r3=s3(import.meta.url),B3=I.dirname(r3),i3=I.join(c3.homedir(),".untitledui"),p=I.join(i3,"config.json"),U3="vite",K3="nextjs",X3={[K3]:"Next.js",[U3]:"Vite"},g="",u={color:"",template:"",framework:void 0};if(E.existsSync(p)){let z=JSON.parse(E.readFileSync(p,"utf-8"));u.license=z.license}var C0=(z)=>{if(z.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
58
+ `),process.exit(1)},J3=new l3().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("--nextjs","initialize a Next.js project.",!1).option("-o, --overwrite","overwrite existing files.",!1).option("--colors-list","show the colors list.",!1).option("-c, --color <color-name>","specify a color for the project.").action(async(z,W)=>{if(z)g=z;if(W){if(u.color=W.color,u.template=W.template,u.overwrite=W.overwrite,u.colorsList=W.colorsList,u.license=W.license||u.license,u.vite=W.vite,u.nextjs=W.nextjs,W.vite)u.framework=U3;if(W.nextjs)u.framework=K3}try{await P0(W),process.exit(0)}catch(Q){console.error(_.red(Q)),process.exit(1)}});async function P0(z,W=null){let Q=process.cwd(),B=E.existsSync(I.resolve(Q,"package.json")),$=I.resolve(I.join(B3,"../config/styles","theme.css")),Z=S0($??""),v=Array.from(new Set(Object.keys(Z).map((L)=>L?.split("--color-")?.[1]?.replace(/-\d{1,3}/,"")))),j=$0().start(),J=await z0(Q);if(u.license){if(!E.existsSync(p)){let M=I.dirname(p);E.mkdirSync(M,{recursive:!0}),E.writeFileSync(p,JSON.stringify({license:u.license},null,2))}if(JSON.parse(E.readFileSync(p,"utf-8")).license!==u.license)E.writeFileSync(p,JSON.stringify({license:u.license},null,2))}if(!B){if(j.stop(),!g){let M=await u0({onState:C0,type:"text",name:"path",message:"What is your project named?",initial:"untitled-ui"});if(typeof M.path==="string")g=M.path.trim()}if(W)W.projectPath=g;let L=E.existsSync(I.resolve(I.posix.join(Q,g,"package.json")));if(E.existsSync(I.resolve(I.posix.join(Q,g)))&&L)j.fail(_.red("Directory already exists!")),process.exit(1);if(u.vite&&u.nextjs||!u.framework){let M=await u0({type:"select",name:"framework",onState:C0,message:`Which ${_.cyan("framework")} would you like to use?`,choices:Object.entries(X3).map(([K,Y])=>({title:Y,value:K}))});u.framework=M.framework}j.succeed("Framework is selected: "+_.green(X3[u.framework]))}else if(J?.framework==="other")j.fail("Unsupported project framework"),console.log(`Please refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for supported frameworks or proceed with manual installation.`),process.exit(1);else if(J?.framework.startsWith("next")||J?.framework.startsWith("vite"))if(!W&&!J.tailwind.brandColor)j.succeed(_.yellow(`Detected ${n0[J.framework]} project, proceeding with the setup...`));else j.stop();if(u.colorsList||!u.color&&!J?.tailwind.brandColor){let L=await u0({type:"select",name:"color",onState:C0,initial:z.color??"",message:`Which ${_.cyan("color")} would you like to use as the ${_.cyanBright("brand")} color?`,choices:v.map((M)=>({title:M,value:M}))});if(u.color=L.color,u.colorsList&&J)J.tailwind.brandColor=L.color}let b=I.posix.join(Q,g||"");if(g&&!B){let L=I.resolve(g);console.log(`
59
+ Creating a new project in ${_.blue(g)}`);let M=$0("Downloading and extracting the repository...").start();try{E.mkdirSync(L,{recursive:!0}),await X0(()=>f0(L,{template:u.framework}),{retries:2}),M.succeed("Files are downloaded and extracted successfully!");let K=$0({text:"Installing dependencies..."}).start(),Y=k0.sync(["**/styles/theme.css"],{cwd:L,absolute:!0,onlyFiles:!0})[0];if(F0("brand",u.color||"",Y??""),await X0(()=>n(S(),["install"],{cwd:b}).catch(async(q)=>{if(q.message.includes("peer"))K.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),K.start("Installing dependencies with --legacy-peer-deps flag"),await n(S(),["install","--legacy-peer-deps"],{cwd:b})}),{retries:1}),await X0(()=>n("git",["init"],{cwd:b}),{retries:1}),K.succeed("Dependencies are installed"),!W)console.log(`
59
60
  Your project is ready, to get started run the following commands:
60
61
 
61
- cd ${_.cyan(h)}
62
- ${_.cyan(t0())}`)}catch(K){if(I.fail(_.red(`
62
+ cd ${_.cyan(g)}
63
+ ${_.cyan(z3())}`)}catch(K){if(M.fail(_.red(`
63
64
  Failed to download and extract the repository`)),K instanceof Error)console.error(K.message);else console.error(`
64
- `);w.rmdirSync(b,{recursive:!0}),process.exit(1)}}else{let b=Y0(),I=new Set,K=e(z),Y=A.resolve(A.join(Z3,"../config")),$=C0.sync(["**"],{cwd:Y,onlyFiles:!0,ignore:O}),V=T0(z,["tailwindcss","tailwindcss-animate","@tailwindcss/typography","tailwindcss-react-aria-components"]),E=T0(z,["@tailwindcss/postcss","postcss"]);if(!W&&!U?.tailwind.brandColor)b.start("Copying files to the project directory");if($.forEach((j)=>{let N=j.includes("postcss.config"),k=A.posix.join(A.posix.join(Y),j),T=A.posix.join(z,N?j:`${U?.isSrcDir?"src":""}/${j}`);if(w.existsSync(T)){if(v?.overwrite)w.copyFileSync(k,T);else{let g=w.readFileSync(T,"utf-8"),P=w.readFileSync(k,"utf-8");if(g!==P){if(j.endsWith("theme.css")&&U?.tailwind.brandColor)return;I.add({targetFile:T,sourceFile:k})}}return}w.mkdirSync(A.dirname(T),{recursive:!0}),w.writeFileSync(T,""),w.copyFileSync(k,T)}),b.stop(),I.size&&!v?.overwrite)if(console.log(`
65
- `),b.fail("Following files already exist in the directory."),I.forEach((N)=>{console.log(`- ${_.green(N.targetFile)}`)}),(await R0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let N=Y0("Overwriting files").start();I.forEach((k)=>{w.copyFileSync(k.sourceFile,k.targetFile)}),N.succeed("Files are overwritten")}else console.log(`Use ${_.cyan("--overwrite")} or ${_.cyan("-o")} to overwrite existing files, or refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);if(K?.tailwindFile)console.log(`
65
+ `);E.rmdirSync(L,{recursive:!0}),process.exit(1)}}else{let L=$0(),M=new Set,K=Q0(Q),Y=I.resolve(I.join(B3,"../config")),q=k0.sync(["**"],{cwd:Y,onlyFiles:!0,ignore:P}),V=x0(Q,["tailwindcss","tailwindcss-animate","@tailwindcss/typography","tailwindcss-react-aria-components"]),N=x0(Q,["@tailwindcss/postcss","postcss"]);if(!W&&!J?.tailwind.brandColor)L.start("Copying files to the project directory");if(q.forEach((R)=>{let D=R.includes("postcss.config"),C=I.posix.join(I.posix.join(Y),R),w=I.posix.join(Q,D?R:`${J?.isSrcDir?"src":""}/${R}`);if(E.existsSync(w)){if(u?.overwrite)E.copyFileSync(C,w);else{let h=E.readFileSync(w,"utf-8"),O=E.readFileSync(C,"utf-8");if(h!==O){if(R.endsWith("theme.css")&&J?.tailwind.brandColor)return;M.add({targetFile:w,sourceFile:C})}}return}E.mkdirSync(I.dirname(w),{recursive:!0}),E.writeFileSync(w,""),E.copyFileSync(C,w)}),L.stop(),M.size&&!u?.overwrite)if(console.log(`
66
+ `),L.fail("Following files already exist in the directory."),M.forEach((D)=>{console.log(`- ${_.green(D.targetFile)}`)}),(await u0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let D=$0("Overwriting files").start();M.forEach((C)=>{E.copyFileSync(C.sourceFile,C.targetFile)}),D.succeed("Files are overwritten")}else console.log(`Use ${_.cyan("--overwrite")} or ${_.cyan("-o")} to overwrite existing files, or refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);if(K?.tailwindFile)console.log(`
66
67
  Tailwind config file exists in the project directory. You can add it to your globals.css as follows:`),console.log(`
67
- ${_.cyan(`@config "../${U?.isSrcDir?"../":""}${A.relative(z,K.tailwindFile)}";`)}
68
- `);if(U?.framework==="vite"){if(!p0(z))console.log(`
68
+ ${_.cyan(`@config "../${J?.isSrcDir?"../":""}${I.relative(Q,K.tailwindFile)}";`)}
69
+ `);if(J?.framework==="vite"){if(!e0(Q))console.log(`
69
70
  Tailwind CSS is not configured in your Vite project. Please refer to the documentation ${_.cyan("https://www.untitled.com/react/integrations/vite")} for manual installation.
70
- `)}let S=K?.layoutFile||K?.appFile||U?.framework==="vite"&&K?.mainFile||"";if(!S)console.log(`Import following files to your main file:
71
- `),$.forEach((j)=>{console.log(_.cyan(j))});else{let N=new c3({tsConfigFilePath:A.resolve(K?.tsConfig||"")}).addSourceFileAtPath(A.resolve(S)),k="globals.css";N.getImportDeclarations().filter((P)=>P.getModuleSpecifierValue().includes("globals.css")).forEach((P)=>P.remove());let T=A.relative(A.resolve(z,`${U?.isSrcDir?"src":""}`),S).split("/").length,g=U?.aliases?.styles||U?.aliases?.src||(T===1?"./":"../".repeat(T-1));N.addImportDeclarations($.filter((P)=>P.includes("globals.css")).map((P)=>({moduleSpecifier:`${g}${U?.aliases?.styles?P?.split("styles/")[1]:P}`}))),N.saveSync()}let L=C0.sync(["**/styles/theme.css"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:O});if(!L?.length)return b.fail(`Failed to copy ${_.cyan("theme.css")} file.
72
- Ensure that the ${_.cyan("theme.css")} file exists in the project directory under ${_.yellow("styles/")} folder.`);if((v.color||!U?.tailwind.brandColor)&&S0("brand",v.color||"brand",L[0]??""),V.length||E.length){let j=Y0().start("Installing dependencies");V.length&&await X0(()=>s(C(),[C()==="npm"?"install":"add",...V],{cwd:H}).catch(async(N)=>{if(N.message.includes("peer"))j.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),j.start("Installing dependencies with --legacy-peer-deps flag"),await s(C(),[C()==="npm"?"install":"add",...V,"--legacy-peer-deps"],{cwd:H})}),{retries:1}),E.length&&await X0(()=>s(C(),[C()==="npm"?"install":"add","-D",...E],{cwd:H}).catch(async(N)=>{if(N.message.includes("peer"))j.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),j.start("Installing dependencies with --legacy-peer-deps flag"),await s(C(),[C()==="npm"?"install":"add","-D",...E,"--legacy-peer-deps"],{cwd:H})}),{retries:1}),j.succeed("Dependencies are installed")}if(!W&&!U?.tailwind.brandColor)b.succeed(_.green("Project setup is completed!"));if(W&&q){G.stop(),b.stop();return}else console.log(`
73
- Your project is ready, you can now start adding components.`)}}var p3=R.join(n3.homedir(),".untitledui"),i=R.join(p3,"config.json"),J={path:"",example:"",license:"",components:[]},g0={};if(x.existsSync(i)){let Q=JSON.parse(x.readFileSync(i,"utf-8"));J.license=Q.license}var Z0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
74
- `),process.exit(1)},J3=new r3().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.").action(async(Q,W)=>{if(Q)J.example=Q;if(W)J.path=W.path,J.overwrite=W.overwrite,J.examplePath=W.examplePath,J.license=W.license||J.license;try{await k0(W,g0),await t3(J)}catch(z){console.error(M.red(z))}});async function t3(Q){let W=J0().start(),z=R.posix.join(process.cwd(),g0?.projectPath||"");if(!x.existsSync(R.posix.join(R.resolve(z,"package.json"))))W.warn("This command should be run in a project directory."),process.exit(1);let Z=await o(z);if(J.license){if(!await U0(J.license))W.fail("Invalid license key"),process.exit(1);if(!x.existsSync(i)){let V=R.dirname(i);x.mkdirSync(V,{recursive:!0}),x.writeFileSync(i,JSON.stringify({license:J.license},null,2))}if(JSON.parse(x.readFileSync(i,"utf-8")).license!==J.license)x.writeFileSync(i,JSON.stringify({license:J.license},null,2),"utf-8")}if(W.stop(),!J.example){let Y=await n({type:"select",name:"example",onState:Z0,message:"Select which type of example you want to add",choices:[{title:"Application",value:"application"},{title:"Marketing",value:"marketing"}]});J.example=Y.example}let B=null;if(J.example){let Y=await j0(J.example,J.license);if(Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan(J.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${Q0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1);if(Y?.type==="directory"){let $=await n({type:"select",name:"example",onState:Z0,message:`Select a folder or file in "${J.example}"`,choices:Y.results.map((V)=>({title:V,value:V}))});if(!$.example)return;if(J.example=$.example,Y=await j0($.example,J.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan($.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${Q0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(Y?.type==="json-files"){let $=await n({type:"select",name:"example",onState:Z0,message:`Select which example you want to add from "${J.example}"`,choices:Y.results.map((V)=>({title:V,value:`${J.example}/${V}`}))});if(!$.example)return;if(J.example=$.example,Y=await j0($.example,J.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan($.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${Q0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(Y?.type==="json-file")B=Y.content}if(!B)W.fail("No example found"),process.exit(1);if(!J?.examplePath){let Y=Z?.isAppDir?"app":"pages",$=Z?.isSrcDir?R.posix.join("src",Y):Y,V=await n({type:"text",name:"examplePath",onState:Z0,message:`Where would you like to add the ${M.cyan(J?.example)} example?`,initial:$});J.examplePath=V.examplePath}else if(!x.existsSync(R.posix.join(z,J.examplePath)))x.mkdirSync(R.posix.join(z,J.examplePath),{recursive:!0}),console.log(M.green(`Created directory ${J.examplePath}`));if(!J?.path){let Y=await n({type:"text",name:"path",onState:Z0,message:`Where would you like to add the ${M.cyan("components")}?`,initial:"components"});J.path=Y.path}let u=B.components.filter((Y)=>!x.existsSync(R.posix.join(z,`${Z?.isSrcDir?"src":""}`,Y?.path?.replace(/components\//,J.path+"/"))));if(u?.length){let Y=await n({type:"multiselect",name:"components",onState:Z0,message:`Select which components you want to add from ${M.cyan(B.name)} example`,choices:u.map(($)=>({title:$?.name,value:$?.name,selected:!0})),instructions:!1,hint:"- Space to select. Return to submit"});if(J.components=Y.components,!u.length&&!Y.components?.length)W.warn("No components selected")}let G=e(z),U=new Set,H=new i3({tsConfigFilePath:G?.tsConfig}),b=J0(`Adding ${J?.example}...`).start(),I="";try{if(B.files?.forEach(async({path:Y,code:$})=>{let V=R.posix.join(z,`${Z?.isSrcDir?"src":""}`,Y.replace(/components\//,J.path+"/")),E=Z?.framework==="vite"?$.replace(`"use client";
71
+ `)}let T=K?.layoutFile||K?.appFile||J?.framework==="vite"&&K?.mainFile||"";if(!T)console.log(`Import following files to your main file:
72
+ `),q.forEach((R)=>{console.log(_.cyan(R))});else{let D=new a3({tsConfigFilePath:I.resolve(K?.tsConfig||"")}).addSourceFileAtPath(I.resolve(T)),C="globals.css";D.getImportDeclarations().filter((O)=>O.getModuleSpecifierValue().includes("globals.css")).forEach((O)=>O.remove());let w=I.relative(I.resolve(Q,`${J?.isSrcDir?"src":""}`),T).split("/").length,h=J?.aliases?.styles||J?.aliases?.src||(w===1?"./":"../".repeat(w-1));D.addImportDeclarations(q.filter((O)=>O.includes("globals.css")).map((O)=>({moduleSpecifier:`${h}${J?.aliases?.styles?O?.split("styles/")[1]:O}`}))),D.saveSync()}let G=k0.sync(["**/styles/theme.css"],{cwd:Q,absolute:!0,onlyFiles:!0,ignore:P});if(!G?.length)return L.fail(`Failed to copy ${_.cyan("theme.css")} file.
73
+ Ensure that the ${_.cyan("theme.css")} file exists in the project directory under ${_.yellow("styles/")} folder.`);if((u.color||!J?.tailwind.brandColor)&&F0("brand",u.color||"brand",G[0]??""),V.length||N.length){let R=$0().start("Installing dependencies");V.length&&await X0(()=>n(S(),[S()==="npm"?"install":"add",...V],{cwd:b}).catch(async(D)=>{if(D.message.includes("peer"))R.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),R.start("Installing dependencies with --legacy-peer-deps flag"),await n(S(),[S()==="npm"?"install":"add",...V,"--legacy-peer-deps"],{cwd:b})}),{retries:1}),N.length&&await X0(()=>n(S(),[S()==="npm"?"install":"add","-D",...N],{cwd:b}).catch(async(D)=>{if(D.message.includes("peer"))R.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),R.start("Installing dependencies with --legacy-peer-deps flag"),await n(S(),[S()==="npm"?"install":"add","-D",...N,"--legacy-peer-deps"],{cwd:b})}),{retries:1}),R.succeed("Dependencies are installed")}if(!W&&!J?.tailwind.brandColor)L.succeed(_.green("Project setup is completed!"));if(W&&B){j.stop(),L.stop();return}else console.log(`
74
+ Your project is ready, you can now start adding components.`)}}var o3=A.join(p3.homedir(),".untitledui"),o=A.join(o3,"config.json"),U={path:"",example:"",license:"",components:[]},g0={};if(x.existsSync(o)){let z=JSON.parse(x.readFileSync(o,"utf-8"));U.license=z.license}var q0=(z)=>{if(z.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
75
+ `),process.exit(1)},V3=new n3().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.").action(async(z,W)=>{if(z)U.example=z;if(W)U.path=W.path,U.overwrite=W.overwrite,U.examplePath=W.examplePath,U.license=W.license||U.license;try{await P0(W,g0),await e3(U)}catch(Q){console.error(H.red(Q))}});async function e3(z){let W=U0().start(),Q=A.posix.join(process.cwd(),g0?.projectPath||"");if(!x.existsSync(A.posix.join(A.resolve(Q,"package.json"))))W.warn("This command should be run in a project directory."),process.exit(1);let $=await z0(Q);if(U.license){if(!await K0(U.license))W.fail("Invalid license key"),process.exit(1);if(!x.existsSync(o)){let V=A.dirname(o);x.mkdirSync(V,{recursive:!0}),x.writeFileSync(o,JSON.stringify({license:U.license},null,2))}if(JSON.parse(x.readFileSync(o,"utf-8")).license!==U.license)x.writeFileSync(o,JSON.stringify({license:U.license},null,2),"utf-8")}if(W.stop(),!U.example){let Y=await t({type:"select",name:"example",onState:q0,message:"Select which type of example you want to add",choices:[{title:"Application",value:"application"},{title:"Marketing",value:"marketing"}]});U.example=Y.example}let Z=null;if(U.example){let Y=await j0(U.example,U.license);if(Y?.type==="error"&&(Y.status===401||Y.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(`${Y0()} 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(Y?.type==="directory"){let q=await t({type:"select",name:"example",onState:q0,message:`Select a folder or file in "${U.example}"`,choices:Y.results.map((V)=>({title:V,value:V}))});if(!q.example)return;if(U.example=q.example,Y=await j0(q.example,U.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(H.yellow(`\uD83D\uDD12 The ${H.cyan(q.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${H.green("→")} If you've already purchased: ${H.cyan(`${Y0()} 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(Y?.type==="json-files"){let q=await t({type:"select",name:"example",onState:q0,message:`Select which example you want to add from "${U.example}"`,choices:Y.results.map((V)=>({title:V,value:`${U.example}/${V}`}))});if(!q.example)return;if(U.example=q.example,Y=await j0(q.example,U.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(H.yellow(`\uD83D\uDD12 The ${H.cyan(q.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${H.green("→")} If you've already purchased: ${H.cyan(`${Y0()} 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(Y?.type==="json-file")Z=Y.content}if(!Z)W.fail("No example found"),process.exit(1);if(!U?.examplePath){let Y=$?.isAppDir?"app":"pages",q=$?.isSrcDir?A.posix.join("src",Y):Y,V=await t({type:"text",name:"examplePath",onState:q0,message:`Where would you like to add the ${H.cyan(U?.example)} example?`,initial:q});U.examplePath=V.examplePath}else if(!x.existsSync(A.posix.join(Q,U.examplePath)))x.mkdirSync(A.posix.join(Q,U.examplePath),{recursive:!0}),console.log(H.green(`Created directory ${U.examplePath}`));if(!U?.path){let Y=await t({type:"text",name:"path",onState:q0,message:`Where would you like to add the ${H.cyan("components")}?`,initial:"components"});U.path=Y.path}let v=Z.components.filter((Y)=>!x.existsSync(A.posix.join(Q,`${$?.isSrcDir?"src":""}`,Y?.path?.replace(/components\//,U.path+"/"))));if(v?.length){let Y=await t({type:"multiselect",name:"components",onState:q0,message:`Select which components you want to add from ${H.cyan(Z.name)} example`,choices:v.map((q)=>({title:q?.name,value:q?.name,selected:!0})),instructions:!1,hint:"- Space to select. Return to submit"});if(U.components=Y.components,!v.length&&!Y.components?.length)W.warn("No components selected")}let j=Q0(Q),J=new Set,b=new t3({tsConfigFilePath:j?.tsConfig}),L=U0(`Adding ${U?.example}...`).start(),M="";try{if(Z.files?.forEach(async({path:Y,code:q})=>{let V=A.posix.join(Q,`${$?.isSrcDir?"src":""}`,Y.replace(/components\//,U.path+"/")),N=$?.framework==="vite"?q.replace(`"use client";
75
76
 
76
- `,""):$,S=V0(E);if(Y.includes("examples")){let j=R.basename(Y);V=R.posix.join(z,J?.examplePath??"",j),I=R.posix.join(J?.examplePath??"",j)}let L=R.dirname(V);if(x.existsSync(V)&&!J.overwrite){if(x.readFileSync(V,"utf-8")!==S)U.add({code:S,path:V})}else{x.mkdirSync(L,{recursive:!0}),x.writeFileSync(V,S);let j=R.relative(R.posix.join(z,`${Z?.isSrcDir?"src":""}`),R.dirname(V)).split("/").length,N=j===1?"./":"../".repeat(j-1),k=H.addSourceFileAtPath(R.resolve(V));k.getImportDeclarations().forEach((T)=>{let g=T.getModuleSpecifierValue();T.setModuleSpecifier(z0(g,J.path,Z?.aliases,N))}),await k.save()}}),U.size)b.warn(`Some files of ${M.yellow(J?.example)} already exist`);else b.succeed(`${M.green(J?.example)} is added successfully`)}catch(Y){b.fail(`
77
- Failed to add the component ${M.red(J?.example)}`),console.error(M.red(Y)),process.exit(1)}if(U.size&&!J?.overwrite)if(console.log(`
78
- Following files already exist in the directory.`),U.forEach(($)=>{console.log(M.green(`- ${R.relative(z,$.path)}`))}),(await n({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let $=J0("Overwriting files").start();U.forEach((V)=>{let E=R.relative(R.resolve(z,`${Z?.isSrcDir?"src":""}`,J.path),R.dirname(V.path)).split("/").length,S=E===1?"./":"../".repeat(E-1),L=H.addSourceFileAtPath(R.resolve(V.path));L.replaceWithText(V.code),L.getImportDeclarations().forEach((j)=>{let N=j.getModuleSpecifierValue();j.setModuleSpecifier(z0(N,J.path,Z?.aliases,S))}),L.saveSync()}),$.succeed("Files are overwritten")}else console.log(`Use ${M.cyan("--overwrite")} or ${M.cyan("-o")} to overwrite existing files, or refer to the documentation ${M.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);let K=C();if(B?.dependencies?.length){let Y=J0("Installing example dependencies").start();await P0(()=>I0(K,[K==="npm"?"install":"add",...B.dependencies],{cwd:z}).catch(async($)=>{if($.message.includes("peer"))Y.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing dependencies with --legacy-peer-deps flag"),await I0(K,[K==="npm"?"install":"add",...B.dependencies,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Example dependencies are installed")}if(B?.devDependencies?.length){let Y=J0("Installing example devDependencies").start();await P0(()=>I0(K,[K==="npm"?"install":"add","-D",...B.devDependencies],{cwd:z}).catch(async($)=>{if($.message.includes("peer"))Y.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing devDependencies with --legacy-peer-deps flag"),await I0(K,[K==="npm"?"install":"add","-D",...B.devDependencies,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Example devDependencies are installed")}if(J?.components?.length)await P0(()=>N0({components:J.components,dir:g0?.projectPath||"",path:J.path,message:`
79
- \uD83C\uDF89 Example ${M.green(J.example)} has been added to ${M.green(I)}`}),{retries:1});console.log(`
80
- \uD83C\uDF89 Example ${M.green(J.example)} has been added to ${M.green(I)}`),process.exit(0)}var O0={name:"untitledui",version:"0.1.44-beta",main:"dist/index.mjs",description:"The Untitled UI CLI tool helps you quickly scaffold projects with Untitled UI React and add components and page examples to your existing projects with an interactive interface in seconds.",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/react/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://www.untitledui.com/react/api","publish:npm":"bun run build && npm publish --access public",start:"node dist/index.mjs"},bugs:{url:"https://github.com/untitleduico/react/issues"},homepage:"https://github.com/untitleduico/react#readme",keywords:["untitledui","untitled-ui","untitledui","untitledui-cli","untitledui-react","untitledui-components","untitledui-examples","untitledui-vite","untitledui-nextjs","cli","tailwindcss","nextjs","react","components","examples","vite"],files:["dist","config","templates","README.md"],author:{name:"Untitled UI",url:"https://www.untitledui.com/react"},contributors:[{name:"Dilshod Turobov",url:"https://x.com/deebovv"},{name:"Jordan Hughes",url:"https://x.com/jordanphughes"}],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 z1(){let Q=new e3().name(O0.name).version(O0.version);Q.addCommand(X3).addCommand(e0).addCommand(J3).addCommand(W3),Q.parse()}z1();
77
+ `,""):q,T=L0(N);if(Y.includes("examples")){let R=A.basename(Y);V=A.posix.join(Q,U?.examplePath??"",R),M=A.posix.join(U?.examplePath??"",R)}let G=A.dirname(V);if(x.existsSync(V)&&!U.overwrite){if(x.readFileSync(V,"utf-8")!==T)J.add({code:T,path:V})}else{x.mkdirSync(G,{recursive:!0}),x.writeFileSync(V,T);let R=b.addSourceFileAtPath(A.resolve(V));R.getImportDeclarations().forEach((D)=>{let C=D.getModuleSpecifierValue();D.setModuleSpecifier(W0(C,U.path,$?.aliases))}),await R.save()}}),J.size)L.warn(`Some files of ${H.yellow(U?.example)} already exist`);else L.succeed(`${H.green(U?.example)} is added successfully`)}catch(Y){L.fail(`
78
+ Failed to add the component ${H.red(U?.example)}`),console.error(H.red(Y)),process.exit(1)}if(J.size&&!U?.overwrite)if(console.log(`
79
+ Following files already exist in the directory.`),J.forEach((q)=>{console.log(H.green(`- ${A.relative(Q,q.path)}`))}),(await t({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let q=U0("Overwriting files").start();J.forEach((V)=>{let N=b.addSourceFileAtPath(A.resolve(V.path));N.replaceWithText(V.code),N.getImportDeclarations().forEach((T)=>{let G=T.getModuleSpecifierValue();T.setModuleSpecifier(W0(G,U.path,$?.aliases))}),N.saveSync()}),q.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://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);let K=S();if(Z?.dependencies?.length){let Y=U0("Installing example dependencies").start();await O0(()=>I0(K,[K==="npm"?"install":"add",...Z.dependencies],{cwd:Q}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing dependencies with --legacy-peer-deps flag"),await I0(K,[K==="npm"?"install":"add",...Z.dependencies,"--legacy-peer-deps"],{cwd:Q})}),{retries:1}),Y.succeed("Example dependencies are installed")}if(Z?.devDependencies?.length){let Y=U0("Installing example devDependencies").start();await O0(()=>I0(K,[K==="npm"?"install":"add","-D",...Z.devDependencies],{cwd:Q}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing devDependencies with --legacy-peer-deps flag"),await I0(K,[K==="npm"?"install":"add","-D",...Z.devDependencies,"--legacy-peer-deps"],{cwd:Q})}),{retries:1}),Y.succeed("Example devDependencies are installed")}if(U?.components?.length)await O0(()=>y0({components:U.components,dir:g0?.projectPath||"",path:U.path,message:`
80
+ \uD83C\uDF89 Example ${H.green(U.example)} has been added to ${H.green(M)}`}),{retries:1});console.log(`
81
+ \uD83C\uDF89 Example ${H.green(U.example)} has been added to ${H.green(M)}`),process.exit(0)}var h0={name:"untitledui",version:"0.1.44-beta.2",main:"dist/index.mjs",description:"The Untitled UI CLI tool helps you quickly scaffold projects with Untitled UI React and add components and page examples to your existing projects with an interactive interface in seconds.",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/react/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://www.untitledui.com/react/api","publish:npm":"bun run build && npm publish --access public",start:"node dist/index.mjs"},bugs:{url:"https://github.com/untitleduico/react/issues"},homepage:"https://github.com/untitleduico/react#readme",keywords:["untitledui","untitled-ui","untitledui","untitledui-cli","untitledui-react","untitledui-components","untitledui-examples","untitledui-vite","untitledui-nextjs","cli","tailwindcss","nextjs","react","components","examples","vite"],files:["dist","config","templates","README.md"],author:{name:"Untitled UI",url:"https://www.untitledui.com/react"},contributors:[{name:"Dilshod Turobov",url:"https://x.com/deebovv"},{name:"Jordan Hughes",url:"https://x.com/jordanphughes"}],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 W1(){let z=new Q1().name(h0.name).version(h0.version);z.addCommand(J3).addCommand(W3).addCommand(V3).addCommand($3),z.parse()}W1();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "untitledui",
3
- "version": "0.1.44-beta",
3
+ "version": "0.1.44-beta.2",
4
4
  "main": "dist/index.mjs",
5
5
  "description": "The Untitled UI CLI tool helps you quickly scaffold projects with Untitled UI React and add components and page examples to your existing projects with an interactive interface in seconds.",
6
6
  "type": "module",