shadcn 4.13.1 → 4.14.0

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.
@@ -0,0 +1,2 @@
1
+ var f=/^import\s+{([^}]+)}\s+from\s+['"]([^'"]+)['"]/;function d(e){let n=[];for(let t of e.split(`
2
+ `)){let i=t.trim().match(f);i&&n.push({moduleSpecifier:i[2],namedImports:i[1].split(",").map(r=>r.trim())});}return n}function g(e){return d(e).find(n=>n.namedImports.includes("ICON"))?.moduleSpecifier}function I(e){let n=e.indexOf("<"),t=e.indexOf("/>",n);if(n===-1||t===-1)return {componentName:"ICON",attributes:{}};let i=e.slice(n+1,t).trim(),r=i.search(/[^\w]/),s=r===-1?i:i.slice(0,r),c=r===-1?"":i.slice(r);if(!s)return {componentName:"ICON",attributes:{}};let o={},m;for(let[p,a]of l(c)){if(a==="{ICON}"){m=p;continue}o[p]=a;}return {componentName:s,iconAttribute:m,attributes:o}}var u=/[\w-]/;function l(e){let n=[],t=0;for(;t<e.length;){if(!u.test(e[t])){t++;continue}let i=t;for(;t<e.length&&u.test(e[t]);)t++;let r=e.slice(i,t);if(e[t]!=="=")continue;t++;let s=e[t],c=s==="{"?"}":s==='"'||s==="'"?s:"";if(!c)continue;let o=e.indexOf(c,t+1);if(o===-1)break;n.push([r,e.slice(t,o+1)]),t=o+1;}return n}export{d as a,g as b,I as c};
@@ -91,7 +91,7 @@ Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something
91
91
  `}renderOption(a,h,l,u){let d=(h.selected?e.green(n.radioOn):n.radioOff)+" "+u+" ",f;return h.disabled?f=a===l?e.gray().underline(h.title):e.strikethrough().gray(h.title):f=a===l?e.cyan().underline(h.title):h.title,d+f}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");let a=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&a.push(e.yellow(this.warn)),a.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let a=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(a+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),a+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+a),this.clear=s(a,this.out.columns);}}return Br=o,Br}var Jr,Ln;function Lu(){if(Ln)return Jr;Ln=1;let e=B(),t=we(),{style:r,clear:s}=X(),{erase:i,cursor:n}=J();class o extends t{constructor(a={}){super(a),this.msg=a.message,this.value=a.initial,this.initialValue=!!a.initial,this.yesMsg=a.yes||"yes",this.yesOption=a.yesOption||"(Y/n)",this.noMsg=a.no||"no",this.noOption=a.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
92
92
  `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
93
93
  `),this.close();}_(a,h){return a.toLowerCase()==="y"?(this.value=true,this.submit()):a.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+n.to(0)+this.outputText));}}return Jr=o,Jr}var Yr,Fn;function Fu(){return Fn||(Fn=1,Yr={TextPrompt:bu(),SelectPrompt:Ru(),TogglePrompt:Eu(),DatePrompt:ju(),NumberPrompt:_u(),MultiselectPrompt:to(),AutocompletePrompt:Nu(),AutocompleteMultiselectPrompt:Mu(),ConfirmPrompt:Lu()}),Yr}var Dn;function Du(){return Dn||(Dn=1,(function(e){let t=e,r=Fu(),s=o=>o;function i(o,c,a={}){return new Promise((h,l)=>{let u=new r[o](c),d=a.onAbort||s,f=a.onSubmit||s,p=a.onExit||s;u.on("state",c.onState||s),u.on("submit",y=>h(f(y))),u.on("exit",y=>h(p(y))),u.on("abort",y=>l(d(y)));})}t.text=o=>i("TextPrompt",o),t.password=o=>(o.style="password",t.text(o)),t.invisible=o=>(o.style="invisible",t.text(o)),t.number=o=>i("NumberPrompt",o),t.date=o=>i("DatePrompt",o),t.confirm=o=>i("ConfirmPrompt",o),t.list=o=>{let c=o.separator||",";return i("TextPrompt",o,{onSubmit:a=>a.split(c).map(h=>h.trim())})},t.toggle=o=>i("TogglePrompt",o),t.select=o=>i("SelectPrompt",o),t.multiselect=o=>{o.choices=[].concat(o.choices||[]);let c=a=>a.filter(h=>h.selected).map(h=>h.value);return i("MultiselectPrompt",o,{onAbort:c,onSubmit:c})},t.autocompleteMultiselect=o=>{o.choices=[].concat(o.choices||[]);let c=a=>a.filter(h=>h.selected).map(h=>h.value);return i("AutocompleteMultiselectPrompt",o,{onAbort:c,onSubmit:c})};let n=(o,c)=>Promise.resolve(c.filter(a=>a.title.slice(0,o.length).toLowerCase()===o.toLowerCase()));t.autocomplete=o=>(o.suggest=o.suggest||n,o.choices=[].concat(o.choices||[]),i("AutocompletePrompt",o));})(wr)),wr}var Zr,Wn;function Wu(){if(Wn)return Zr;Wn=1;let e=Du(),t=["suggest","format","onState","validate","onRender","type"],r=()=>{};async function s(c=[],{onSubmit:a=r,onCancel:h=r}={}){let l={},u=s._override||{};c=[].concat(c);let d,f,p,y,m,x,g=async(w,v,b=false)=>{if(!(!b&&w.validate&&w.validate(v)!==true))return w.format?await w.format(v,l):v};for(f of c)if({name:y,type:m}=f,typeof m=="function"&&(m=await m(d,{...l},f),f.type=m),!!m){for(let w in f){if(t.includes(w))continue;let v=f[w];f[w]=typeof v=="function"?await v(d,{...l},x):v;}if(x=f,typeof f.message!="string")throw new Error("prompt message is required");if({name:y,type:m}=f,e[m]===void 0)throw new Error(`prompt type (${m}) is not defined`);if(u[f.name]!==void 0&&(d=await g(f,u[f.name]),d!==void 0)){l[y]=d;continue}try{d=s._injected?i(s._injected,f.initial):await e[m](f),l[y]=d=await g(f,d,!0),p=await a(f,d,l);}catch{p=!await h(f,l);}if(p)return l}return l}function i(c,a){let h=c.shift();if(h instanceof Error)throw h;return h===void 0?a:h}function n(c){s._injected=(s._injected||[]).concat(c);}function o(c){s._override=Object.assign({},c);}return Zr=Object.assign(s,{prompt:s,prompts:e,inject:n,override:o}),Zr}var Xr,Hn;function Hu(){return Hn||(Hn=1,Xr=Wu()),Xr}var zu=Hu(),Uu=is(zu),os=globalThis.window?.document!==void 0;globalThis.process?.versions?.node;globalThis.process?.versions?.bun;globalThis.Deno?.version?.deno;globalThis.process?.versions?.electron;globalThis.navigator?.userAgent?.includes("jsdom");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope;typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope;typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope;var Gt=globalThis.navigator?.userAgentData?.platform;Gt==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===true||globalThis.process?.platform;Gt==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform;Gt==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===true||globalThis.navigator?.userAgent?.includes(" Linux ")===true||globalThis.process?.platform;Gt==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===true||globalThis.process?.platform;var zn="\x1B]",Un="\x07",Vt=";";!os&&Z.env.TERM_PROGRAM;!os&&Z.platform;os||Z.cwd;var Vu=(e,t)=>[zn,"8",Vt,Vt,t,Un,e,zn,"8",Vt,Vt,Un].join(""),Qr,Vn;function ro(){return Vn||(Vn=1,Qr=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",s=t.indexOf(r+e),i=t.indexOf("--");return s!==-1&&(i===-1||s<i)}),Qr}var es,Gn;function Gu(){if(Gn)return es;Gn=1;let e=uu,t=hu,r=ro(),{env:s}=process,i;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?i=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(i=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?i=1:s.FORCE_COLOR==="false"?i=0:i=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function n(a){return a===0?false:{level:a,hasBasic:true,has256:a>=2,has16m:a>=3}}function o(a,h){if(i===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(a&&!h&&i===void 0)return 0;let l=i||0;if(s.TERM==="dumb")return l;if(process.platform==="win32"){let u=e.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in s)return ["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(u=>u in s)||s.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in s)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let u=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case "iTerm.app":return u>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:l}function c(a){let h=o(a,a&&a.isTTY);return n(h)}return es={supportsColor:c,stdout:n(o(true,t.isatty(1))),stderr:n(o(true,t.isatty(2)))},es}var ts,Kn;function Ku(){if(Kn)return ts;Kn=1;let e=Gu(),t=ro();function r(i){if(/^\d{3,4}$/.test(i)){let o=/(\d{1,2})(\d{2})/.exec(i)||[];return {major:0,minor:parseInt(o[1],10),patch:parseInt(o[2],10)}}let n=(i||"").split(".").map(o=>parseInt(o,10));return {major:n[0],minor:n[1],patch:n[2]}}function s(i){let{CI:n,FORCE_HYPERLINK:o,NETLIFY:c,TEAMCITY_VERSION:a,TERM_PROGRAM:h,TERM_PROGRAM_VERSION:l,VTE_VERSION:u,TERM:d}=process.env;if(o)return !(o.length>0&&parseInt(o,10)===0);if(t("no-hyperlink")||t("no-hyperlinks")||t("hyperlink=false")||t("hyperlink=never"))return false;if(t("hyperlink=true")||t("hyperlink=always")||c)return true;if(!e.supportsColor(i)||i&&!i.isTTY)return false;if("WT_SESSION"in process.env)return true;if(process.platform==="win32"||n||a)return false;if(h){let f=r(l||"");switch(h){case "iTerm.app":return f.major===3?f.minor>=1:f.major>3;case "WezTerm":return f.major>=20200620;case "vscode":return f.major>1||f.major===1&&f.minor>=72;case "ghostty":return true}}if(u){if(u==="0.50.0")return false;let f=r(u);return f.major>0||f.minor>=50}switch(d){case "alacritty":return true}return false}return ts={supportsHyperlink:s,stdout:s(process.stdout),stderr:s(process.stderr)},ts}var qu=Ku(),as=is(qu);function it(e,t,{target:r="stdout",...s}={}){return as[r]?Vu(e,t):s.fallback===false?e:typeof s.fallback=="function"?s.fallback(e,t):`${e} (\u200B${t}\u200B)`}it.isSupported=as.stdout;it.stderr=(e,t,r={})=>it(e,t,{target:"stderr",...r});it.stderr.isSupported=as.stderr;var q={},Ce={},qn;function Bu(){if(qn)return Ce;qn=1,Object.defineProperty(Ce,"__esModule",{value:true}),Ce.sync=Ce.isexe=void 0;let e=Xn,t=en__default,r=async(o,c={})=>{let{ignoreErrors:a=false}=c;try{return i(await(0,t.stat)(o),c)}catch(h){let l=h;if(a||l.code==="EACCES")return false;throw l}};Ce.isexe=r;let s=(o,c={})=>{let{ignoreErrors:a=false}=c;try{return i((0,e.statSync)(o),c)}catch(h){let l=h;if(a||l.code==="EACCES")return false;throw l}};Ce.sync=s;let i=(o,c)=>o.isFile()&&n(o,c),n=(o,c)=>{let a=c.uid??process.getuid?.(),h=c.groups??process.getgroups?.()??[],l=c.gid??process.getgid?.()??h[0];if(a===void 0||l===void 0)throw new Error("cannot get uid or gid");let u=new Set([l,...h]),d=o.mode,f=o.uid,p=o.gid,y=parseInt("100",8),m=parseInt("010",8),x=parseInt("001",8),g=y|m;return !!(d&x||d&m&&u.has(p)||d&y&&f===a||d&g&&a===0)};return Ce}var $e={},Bn;function Ju(){if(Bn)return $e;Bn=1,Object.defineProperty($e,"__esModule",{value:true}),$e.sync=$e.isexe=void 0;let e=Xn,t=en__default,r=async(o,c={})=>{let{ignoreErrors:a=false}=c;try{return n(await(0,t.stat)(o),o,c)}catch(h){let l=h;if(a||l.code==="EACCES")return false;throw l}};$e.isexe=r;let s=(o,c={})=>{let{ignoreErrors:a=false}=c;try{return n((0,e.statSync)(o),o,c)}catch(h){let l=h;if(a||l.code==="EACCES")return false;throw l}};$e.sync=s;let i=(o,c)=>{let{pathExt:a=process.env.PATHEXT||""}=c,h=a.split(";");if(h.indexOf("")!==-1)return true;for(let l=0;l<h.length;l++){let u=h[l].toLowerCase(),d=o.substring(o.length-u.length).toLowerCase();if(u&&d===u)return true}return false},n=(o,c,a)=>o.isFile()&&i(c,a);return $e}var rs={},Jn;function Yu(){return Jn||(Jn=1,Object.defineProperty(rs,"__esModule",{value:true})),rs}var Yn;function Zu(){return Yn||(Yn=1,(function(e){var t=q&&q.__createBinding||(Object.create?(function(h,l,u,d){d===void 0&&(d=u);var f=Object.getOwnPropertyDescriptor(l,u);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:true,get:function(){return l[u]}}),Object.defineProperty(h,d,f);}):(function(h,l,u,d){d===void 0&&(d=u),h[d]=l[u];})),r=q&&q.__setModuleDefault||(Object.create?(function(h,l){Object.defineProperty(h,"default",{enumerable:true,value:l});}):function(h,l){h.default=l;}),s=q&&q.__importStar||function(h){if(h&&h.__esModule)return h;var l={};if(h!=null)for(var u in h)u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)&&t(l,h,u);return r(l,h),l},i=q&&q.__exportStar||function(h,l){for(var u in h)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&t(l,h,u);};Object.defineProperty(e,"__esModule",{value:true}),e.sync=e.isexe=e.posix=e.win32=void 0;let n=s(Bu());e.posix=n;let o=s(Ju());e.win32=o,i(Yu(),e);let a=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?o:n;e.isexe=a.isexe,e.sync=a.sync;})(q)),q}var ss,Zn;function Xu(){if(Zn)return ss;Zn=1;let{isexe:e,sync:t}=Zu(),{join:r,delimiter:s,sep:i,posix:n}=R__default,o=process.platform==="win32",c=new RegExp(`[${n.sep}${i===n.sep?"":i}]`.replace(/(\\)/g,"\\$1")),a=new RegExp(`^\\.${c.source}`),h=p=>Object.assign(new Error(`not found: ${p}`),{code:"ENOENT"}),l=(p,{path:y=process.env.PATH,pathExt:m=process.env.PATHEXT,delimiter:x=s})=>{let g=p.match(c)?[""]:[...o?[process.cwd()]:[],...(y||"").split(x)];if(o){let w=m||[".EXE",".CMD",".BAT",".COM"].join(x),v=w.split(x).flatMap(b=>[b,b.toLowerCase()]);return p.includes(".")&&v[0]!==""&&v.unshift(""),{pathEnv:g,pathExt:v,pathExtExe:w}}return {pathEnv:g,pathExt:[""]}},u=(p,y)=>{let m=/^".*"$/.test(p)?p.slice(1,-1):p;return (!m&&a.test(y)?y.slice(0,2):"")+r(m,y)},d=async(p,y={})=>{let{pathEnv:m,pathExt:x,pathExtExe:g}=l(p,y),w=[];for(let v of m){let b=u(v,p);for(let E of x){let P=b+E;if(await e(P,{pathExt:g,ignoreErrors:true})){if(!y.all)return P;w.push(P);}}}if(y.all&&w.length)return w;if(y.nothrow)return null;throw h(p)},f=(p,y={})=>{let{pathEnv:m,pathExt:x,pathExtExe:g}=l(p,y),w=[];for(let v of m){let b=u(v,p);for(let E of x){let P=b+E;if(t(P,{pathExt:g,ignoreErrors:true})){if(!y.all)return P;w.push(P);}}}if(y.all&&w.length)return w;if(y.nothrow)return null;throw h(p)};return ss=d,d.sync=f,ss}var Qu=Xu(),eh=is(Qu);join(uu.tmpdir(),"antfu-ni");function so(e){return eh.sync(e,{nothrow:true})!==null}async function cs({autoInstall:e,programmatic:t,cwd:r}={}){let{name:s,agent:i,version:n}=await mr({cwd:r,onUnknown:o=>{t||console.warn("[ni] Unknown packageManager:",o);}})||{};if(s&&!so(s)&&!t){if(!e){console.warn(`[ni] Detected ${s} but it doesn't seem to be installed.
94
- `),Z.env.CI&&Z.exit(1);let o=it(s,Xi[s]),{tryInstall:c}=await Uu({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${o}?`});c||Z.exit(1);}await gr("npm",["i","-g",`${s}${n?`@${n}`:""}`],{nodeOptions:{stdio:"inherit",cwd:r},throwOnError:true});}return i}Z.env.NI_CONFIG_FILE;var rh=Z.platform==="win32"?Z.env.USERPROFILE:Z.env.HOME;R__default.join(rh||"~/",".nirc");async function sh(e,{withFallback:t}={withFallback:false}){let r=await cs({programmatic:true,cwd:e});return r==="yarn@berry"?"yarn":r==="pnpm@6"?"pnpm":r==="bun"?"bun":r==="deno"?"deno":t?ls()??"npm":r??"npm"}function ls(e=process.env.npm_config_user_agent||""){return e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":e.startsWith("deno")?"deno":e.startsWith("npm")?"npm":null}function us(e){return e==="pnpm"?"pnpm dlx":e==="bun"?"bunx":"npx"}async function Ky(e){let t=await sh(e);return us(t)}var io={name:"shadcn",version:"4.13.1",description:"Add components to your apps.",publishConfig:{access:"public"},license:"MIT",author:{name:"shadcn",url:"https://twitter.com/shadcn"},repository:{type:"git",url:"https://github.com/shadcn-ui/ui.git",directory:"packages/shadcn"},files:["dist"],keywords:["components","ui","tailwind","radix-ui","base-ui","shadcn"],type:"module",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./registry":{types:"./dist/registry/index.d.ts",default:"./dist/registry/index.js"},"./schema":{types:"./dist/schema/index.d.ts",default:"./dist/schema/index.js"},"./mcp":{types:"./dist/mcp/index.d.ts",default:"./dist/mcp/index.js"},"./utils":{types:"./dist/utils/index.d.ts",default:"./dist/utils/index.js"},"./icons":{types:"./dist/icons/index.d.ts",default:"./dist/icons/index.js"},"./preset":{types:"./dist/preset/index.d.ts",default:"./dist/preset/index.js"},"./tailwind.css":"./dist/tailwind.css"},sideEffects:["./dist/tailwind.css"],bin:"./dist/index.js",engines:{node:">=20.18.1"},scripts:{dev:"tsup --watch",build:"tsup",typecheck:"tsc --noEmit",clean:"rimraf dist && rimraf components","start:dev":"cross-env REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates node dist/index.js","start:prod":"cross-env REGISTRY_URL=https://ui.shadcn.com/r node dist/index.js",start:"node dist/index.js","format:write":'prettier --write "**/*.{ts,tsx,mdx}" --cache',"format:check":'prettier --check "**/*.{ts,tsx,mdx}" --cache',release:"changeset version","pub:beta":"pnpm build && pnpm publish --no-git-checks --access public --tag beta","pub:rc":"pnpm build && pnpm publish --no-git-checks --access public --tag rc","pub:next":"pnpm build && pnpm publish --no-git-checks --access public --tag next","pub:release":"pnpm build && pnpm publish --access public",test:"vitest run","test:dev":"REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates vitest run","mcp:inspect":"pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp"},dependencies:{"@babel/core":"^7.28.0","@babel/parser":"^7.28.0","@babel/plugin-transform-typescript":"^7.28.0","@babel/preset-typescript":"^7.27.1","@dotenvx/dotenvx":"^1.48.4","@modelcontextprotocol/sdk":"^1.26.0","@types/validate-npm-package-name":"^4.0.2",browserslist:"^4.26.2",commander:"^14.0.0",cosmiconfig:"^9.0.0",dedent:"^1.6.0",deepmerge:"^4.3.1",diff:"^8.0.2",execa:"^9.6.0","fast-glob":"^3.3.3","fs-extra":"^11.3.1",fuzzysort:"^3.1.0",kleur:"^4.1.5",open:"^11.0.0",ora:"^8.2.0",postcss:"^8.5.6","postcss-selector-parser":"^7.1.0",prompts:"^2.4.2",recast:"^0.23.11","stringify-object":"^5.0.0","tailwind-merge":"^3.0.1","ts-morph":"^26.0.0","tsconfig-paths":"^4.2.0",undici:"^7.27.2","validate-npm-package-name":"^7.0.1",zod:"^3.24.1","zod-to-json-schema":"^3.24.6"},devDependencies:{"@antfu/ni":"^25.0.0","@types/babel__core":"^7.20.5","@types/fs-extra":"^11.0.4","@types/prompts":"^2.4.9","@types/stringify-object":"^4.0.5",msw:"^2.10.4",rimraf:"^6.0.1",tsup:"^8.5.0","type-fest":"^4.41.0",typescript:"^5.9.2"}};function Fe(e){if(I.break(),I.error("Something went wrong. Please check the error below for more details."),I.error("If the problem persists, please open an issue on GitHub."),I.error(""),typeof e=="string"&&(I.error(e),nt()),e instanceof j&&(e.message&&(I.error(e.cause?"Error:":"Message:"),I.error(e.message)),e.cause&&(I.error(`
94
+ `),Z.env.CI&&Z.exit(1);let o=it(s,Xi[s]),{tryInstall:c}=await Uu({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${o}?`});c||Z.exit(1);}await gr("npm",["i","-g",`${s}${n?`@${n}`:""}`],{nodeOptions:{stdio:"inherit",cwd:r},throwOnError:true});}return i}Z.env.NI_CONFIG_FILE;var rh=Z.platform==="win32"?Z.env.USERPROFILE:Z.env.HOME;R__default.join(rh||"~/",".nirc");async function sh(e,{withFallback:t}={withFallback:false}){let r=await cs({programmatic:true,cwd:e});return r==="yarn@berry"?"yarn":r==="pnpm@6"?"pnpm":r==="bun"?"bun":r==="deno"?"deno":t?ls()??"npm":r??"npm"}function ls(e=process.env.npm_config_user_agent||""){return e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":e.startsWith("deno")?"deno":e.startsWith("npm")?"npm":null}function us(e){return e==="pnpm"?"pnpm dlx":e==="bun"?"bunx":"npx"}async function Ky(e){let t=await sh(e);return us(t)}var io={name:"shadcn",version:"4.14.0",description:"Add components to your apps.",publishConfig:{access:"public"},license:"MIT",author:{name:"shadcn",url:"https://twitter.com/shadcn"},repository:{type:"git",url:"https://github.com/shadcn-ui/ui.git",directory:"packages/shadcn"},files:["dist"],keywords:["components","ui","tailwind","radix-ui","base-ui","shadcn"],type:"module",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./registry":{types:"./dist/registry/index.d.ts",default:"./dist/registry/index.js"},"./schema":{types:"./dist/schema/index.d.ts",default:"./dist/schema/index.js"},"./mcp":{types:"./dist/mcp/index.d.ts",default:"./dist/mcp/index.js"},"./utils":{types:"./dist/utils/index.d.ts",default:"./dist/utils/index.js"},"./icons":{types:"./dist/icons/index.d.ts",default:"./dist/icons/index.js"},"./preset":{types:"./dist/preset/index.d.ts",default:"./dist/preset/index.js"},"./tailwind.css":"./dist/tailwind.css"},sideEffects:["./dist/tailwind.css"],bin:"./dist/index.js",engines:{node:">=20.18.1"},scripts:{dev:"tsup --watch",build:"tsup",typecheck:"tsc --noEmit",clean:"rimraf dist && rimraf components","start:dev":"cross-env REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates node dist/index.js","start:prod":"cross-env REGISTRY_URL=https://ui.shadcn.com/r node dist/index.js",start:"node dist/index.js","format:write":'prettier --write "**/*.{ts,tsx,mdx}" --cache',"format:check":'prettier --check "**/*.{ts,tsx,mdx}" --cache',release:"changeset version","pub:beta":"pnpm build && pnpm publish --no-git-checks --access public --tag beta","pub:rc":"pnpm build && pnpm publish --no-git-checks --access public --tag rc","pub:next":"pnpm build && pnpm publish --no-git-checks --access public --tag next","pub:release":"pnpm build && pnpm publish --access public",test:"vitest run","test:dev":"REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates vitest run","mcp:inspect":"pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp"},dependencies:{"@babel/core":"^7.28.0","@babel/parser":"^7.28.0","@babel/plugin-transform-typescript":"^7.28.0","@babel/preset-typescript":"^7.27.1","@dotenvx/dotenvx":"^1.48.4","@modelcontextprotocol/sdk":"^1.26.0","@types/validate-npm-package-name":"^4.0.2",browserslist:"^4.26.2",commander:"^14.0.0",cosmiconfig:"^9.0.0",dedent:"^1.6.0",deepmerge:"^4.3.1",diff:"^8.0.2",execa:"^9.6.0","fast-glob":"^3.3.3","fs-extra":"^11.3.1",fuzzysort:"^3.1.0",kleur:"^4.1.5",open:"^11.0.0",ora:"^8.2.0",postcss:"^8.5.6","postcss-selector-parser":"^7.1.0",prompts:"^2.4.2",recast:"^0.23.11","stringify-object":"^5.0.0","tailwind-merge":"^3.0.1","ts-morph":"^26.0.0","tsconfig-paths":"^4.2.0",undici:"^7.27.2","validate-npm-package-name":"^7.0.1",zod:"^3.24.1","zod-to-json-schema":"^3.24.6"},devDependencies:{"@antfu/ni":"^25.0.0","@types/babel__core":"^7.20.5","@types/fs-extra":"^11.0.4","@types/prompts":"^2.4.9","@types/stringify-object":"^4.0.5",msw:"^2.10.4",rimraf:"^6.0.1",tsup:"^8.5.0","type-fest":"^4.41.0",typescript:"^5.9.2"}};function Fe(e){if(I.break(),I.error("Something went wrong. Please check the error below for more details."),I.error("If the problem persists, please open an issue on GitHub."),I.error(""),typeof e=="string"&&(I.error(e),nt()),e instanceof j&&(e.message&&(I.error(e.cause?"Error:":"Message:"),I.error(e.message)),e.cause&&(I.error(`
95
95
  Message:`),I.error(e.cause)),e.suggestion&&(I.error(`
96
96
  Suggestion:`),I.error(e.suggestion)),nt()),e instanceof z$1.ZodError){I.error("Validation failed:");for(let[t,r]of Object.entries(e.flatten().fieldErrors))I.error(`- ${T.info(t)}: ${r}`);nt();}e instanceof Error&&(I.error(e.message),nt()),nt();}function oh(e){let t=e.match(/^(\d+)\.(\d+)\.\d+/);if(!t)return null;let r=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);return s===0?null:`${r}.${s-1}.0`}function ah(e=io.version,t=process.argv.slice(2)){let r=oh(e);return r?[...us(ls()).split(" "),`shadcn@${r}`,...t].map(ch).join(" "):null}function nt(){let e=ah();e&&(I.error(""),I.error("You can also try a previous version to see if that works:"),I.error(e)),I.break(),process.exit(1);}function ch(e){return /^[a-zA-Z0-9_./:@%+=,-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}async function hs(e,t){let{config:r,useCache:s}=t||{};if(_(e)){let[a]=await L([e],{useCache:s});return no(e,a)}let i=Ze(e);if(i)return Ui(i,{useCache:s});if(!e.startsWith("@"))throw new Ve(e);let n=e;n.endsWith("/registry")||(n=`${n}/registry`);let o=je(n,Oe(r));if(!o?.url)throw new ve(n);o.headers&&Object.keys(o.headers).length>0&&et({[o.url]:o.headers});let[c]=await L([o.url],{useCache:s});return no(n,c)}function no(e,t){try{let r=p.parse(t);if(r.include?.length)throw new C(`Registry catalog "${e}" uses "include", but consumer registry endpoints must serve a resolved registry catalog. Run "npx shadcn build" and serve the built registry.json, or use loadRegistry() in a dynamic route.`,{context:{registry:e,include:r.include},suggestion:"Serve a flattened registry.json for CLI consumers. Source registry.json files with include are supported by shadcn build and loadRegistry()."});return r}catch(r){throw r instanceof C?r:new M(e,r,{subject:"registry catalog",suggestion:"The registry catalog may be corrupted or have an invalid format. Please make sure it returns a valid registry.json object. See https://ui.shadcn.com/schema/registry.json."})}}async function uh(e,t){let{config:r,useCache:s=false}=t||{};return Se(),me(e,Oe(r),{useCache:s})}async function hh(e,t){let{config:r,useCache:s=false}=t||{};return Se(),Zi(e,Oe(r),{useCache:s})}async function vw(e,t){let{useCache:r=true}=t||{};r||Et.clearCaches();let s=await Et.search(e);if(!s)return {registries:D};let i=z$1.object({registries:b$1.optional()}).safeParse(s.config);if(!i.success)throw new mt(e,i.error);return {registries:{...D,...i.data.registries||{}}}}async function It(){try{let[e]=await L(["index.json"]);return q$1.parse(e)}catch(e){I.error(`
97
97
  `),Fe(e);}}async function bw(){try{let[e]=await L(["styles/index.json"]);return r.parse(e)}catch(e){return I.error(`
@@ -1,4 +1,4 @@
1
- import {Qa,Oa,Pa,qa,k,ma,sa,Ra}from'./chunk-UBIN4IG2.js';import {Server}from'@modelcontextprotocol/sdk/server/index.js';import {ListToolsRequestSchema,CallToolRequestSchema}from'@modelcontextprotocol/sdk/types.js';import m from'dedent';import {z}from'zod';import {zodToJsonSchema}from'zod-to-json-schema';var R="shadcn@latest";async function u(r){return `${await ma(process.cwd())} ${R} ${r}`}async function d(r=process.cwd()){return {registries:(await sa(r,{useCache:false})).registries}}function _(r,t){let{query:n,registries:i}=t||{},o=r.items.map(c=>{let g=[`- ${c.name}`];return c.type&&g.push(`(${c.type})`),c.description&&g.push(`- ${c.description}`),c.registry&&g.push(`[${c.registry}]`),g.push(`
1
+ import {Qa,Oa,Pa,qa,k,ma,sa,Ra}from'./chunk-JHQYUTIO.js';import {Server}from'@modelcontextprotocol/sdk/server/index.js';import {ListToolsRequestSchema,CallToolRequestSchema}from'@modelcontextprotocol/sdk/types.js';import m from'dedent';import {z}from'zod';import {zodToJsonSchema}from'zod-to-json-schema';var R="shadcn@latest";async function u(r){return `${await ma(process.cwd())} ${R} ${r}`}async function d(r=process.cwd()){return {registries:(await sa(r,{useCache:false})).registries}}function _(r,t){let{query:n,registries:i}=t||{},o=r.items.map(c=>{let g=[`- ${c.name}`];return c.type&&g.push(`(${c.type})`),c.description&&g.push(`- ${c.description}`),c.registry&&g.push(`[${c.registry}]`),g.push(`
2
2
  Add command: \`${u(`add ${c.addCommandArgument}`)}\``),g.join(" ")}),a=`Found ${r.pagination.total} items`;n&&(a+=` matching "${n}"`),i&&i.length>0&&(a+=` in registries ${i.join(", ")}`),a+=":";let s=`Showing items ${r.pagination.offset+1}-${Math.min(r.pagination.offset+r.pagination.limit,r.pagination.total)} of ${r.pagination.total}:`,p=`${a}
3
3
 
4
4
  ${s}
@@ -44,4 +44,17 @@ type IconLibraries = typeof iconLibraries;
44
44
  type IconLibrary = IconLibraries[keyof IconLibraries];
45
45
  type IconLibraryName = keyof IconLibraries;
46
46
 
47
- export { type IconLibraries, type IconLibrary, type IconLibraryName, iconLibraries };
47
+ interface ParsedImport {
48
+ moduleSpecifier: string;
49
+ namedImports: string[];
50
+ }
51
+ interface ParsedUsage {
52
+ componentName: string;
53
+ iconAttribute?: string;
54
+ attributes: Record<string, string>;
55
+ }
56
+ declare function parseImportTemplate(template: string): ParsedImport[];
57
+ declare function getIconModuleSpecifier(template: string): string | undefined;
58
+ declare function parseUsageTemplate(usage: string): ParsedUsage;
59
+
60
+ export { type IconLibraries, type IconLibrary, type IconLibraryName, type ParsedImport, type ParsedUsage, getIconModuleSpecifier, iconLibraries, parseImportTemplate, parseUsageTemplate };
@@ -1 +1 @@
1
- export{a as iconLibraries}from'../chunk-CHWMSXYA.js';
1
+ export{b as getIconModuleSpecifier,a as parseImportTemplate,c as parseUsageTemplate}from'../chunk-3W6BGJGE.js';export{a as iconLibraries}from'../chunk-CHWMSXYA.js';