shadcn-svelte 1.6.1 → 1.7.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.
- package/dist/index.mjs +2 -2
- package/dist/tailwind.css +322 -325
- package/dist/utils/transformers/transform-menu.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-vhuhCA1g.mjs";import{S as r,d as i,f as a,g as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p,x as m,y as h}from"./libraries-PjOl23P1.mjs";import{a as g,i as _,n as v,r as y,t as b}from"./constants-C6-IIYiv.mjs";import{a as x,d as S,l as C,m as w,n as ee,p as te,t as ne,u as re,y as T}from"./preset-B-yTr9bY.mjs";import{a as ie,d as E,f as D,g as ae,h as oe,l as se,m as ce,p as le,u as ue}from"./schema-BYC5U6AO.mjs";import{i as O,n as de,r as fe,t as pe}from"./transform-icons-Dcl0yvKG.mjs";import{shadcnSvelteTailwindCssImport as me}from"./utils/css.mjs";import{t as he}from"./src-XFr9g_CF.mjs";import{t as ge}from"./transform-strip-types-U0vVtPXN.mjs";import{transformImports as _e}from"./utils/transformers/transform-imports.mjs";import{transformMenu as ve}from"./utils/transformers/transform-menu.mjs";import{i as ye,n as be,r as xe}from"./transform-font-IGOflNQ0.mjs";import{transform as Se}from"./utils/transformers/index.mjs";import Ce,{createRequire as we}from"node:module";import k,{cwd as Te,stdin as Ee,stdout as De}from"node:process";import{Command as Oe,Option as ke}from"commander";import A,{basename as Ae,delimiter as je,dirname as Me,isAbsolute as Ne,join as Pe,normalize as Fe,resolve as Ie}from"node:path";import j,{closeSync as Le,existsSync as M,openSync as Re,promises as N,readSync as ze,statSync as Be}from"node:fs";import{promisify as Ve,styleText as P}from"node:util";import*as He from"node:readline";import Ue from"node:readline";import{ReadStream as We}from"node:tty";import Ge from"fs";import Ke from"os";import qe from"path";import Je,{constants as Ye}from"node:fs/promises";import Xe,{execFile as Ze,spawn as Qe}from"node:child_process";import{pipeline as $e}from"node:stream/promises";import{PassThrough as et,Writable as tt}from"node:stream";import{fileURLToPath as nt,pathToFileURL as rt}from"node:url";import{fetch as it}from"node-fetch-native";import{createProxy as at}from"node-fetch-native/proxy";import F,{parse as ot}from"postcss";import{twMerge as st}from"tailwind-merge";import*as ct from"svelte/compiler";import lt from"node:os";import{Buffer as ut}from"node:buffer";var I=n(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}))();function dt(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a].disabled?dt(a,t<0?-1:1,n):a}const ft=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,pt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,mt=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ht=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,gt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,_t=/\t{1,1000}/y,vt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,yt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,bt=/\p{M}+/gu,xt={limit:1/0,ellipsis:``},St=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?St(i,xt,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(bt,``)){let t=e.codePointAt(0)||0;if(w=pt(t)?d:mt(t)?p:l!==f&&ft(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(yt.lastIndex=h,yt.test(e)){if(_=yt.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=yt.lastIndex;continue}if(ht.lastIndex=h,ht.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ht.lastIndex;continue}if(gt.lastIndex=h,gt.test(e)){if(_=gt.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=gt.lastIndex;continue}if(_t.lastIndex=h,_t.test(e)){if(_=_t.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=_t.lastIndex;continue}if(vt.lastIndex=h,vt.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=vt.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Ct={limit:1/0,ellipsis:``,ellipsisWidth:0},wt=(e,t={})=>St(e,Ct,t).width,Tt=`]8;;`,Et=RegExp(`(?:\\[(?<code>\\d+)m|\\${Tt}(?<uri>.*))`,`y`),Dt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ot=e=>`[${e}m`,kt=e=>`${Tt}${e}`,At=e=>e.map(e=>wt(e)),jt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:wt(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=wt(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Tt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Mt=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(wt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Nt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=At(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=wt(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),jt(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){jt(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){jt(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Mt(e)));let l=c.join(`
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-vhuhCA1g.mjs";import{S as r,d as i,f as a,g as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p,x as m,y as h}from"./libraries-PjOl23P1.mjs";import{a as g,i as _,n as v,r as y,t as b}from"./constants-C6-IIYiv.mjs";import{a as x,d as S,l as C,m as w,n as ee,p as te,t as ne,u as re,y as T}from"./preset-B-yTr9bY.mjs";import{a as ie,d as E,f as D,g as ae,h as oe,l as se,m as ce,p as le,u as ue}from"./schema-BYC5U6AO.mjs";import{i as O,n as de,r as fe,t as pe}from"./transform-icons-Dcl0yvKG.mjs";import{shadcnSvelteTailwindCssImport as me}from"./utils/css.mjs";import{t as he}from"./src-XFr9g_CF.mjs";import{t as ge}from"./transform-strip-types-U0vVtPXN.mjs";import{transformImports as _e}from"./utils/transformers/transform-imports.mjs";import{transformMenu as ve}from"./utils/transformers/transform-menu.mjs";import{i as ye,n as be,r as xe}from"./transform-font-IGOflNQ0.mjs";import{transform as Se}from"./utils/transformers/index.mjs";import Ce,{createRequire as we}from"node:module";import k,{cwd as Te,stdin as Ee,stdout as De}from"node:process";import{Command as Oe,Option as ke}from"commander";import A,{basename as Ae,delimiter as je,dirname as Me,isAbsolute as Ne,join as Pe,normalize as Fe,resolve as Ie}from"node:path";import j,{closeSync as Le,existsSync as M,openSync as Re,promises as N,readSync as ze,statSync as Be}from"node:fs";import{promisify as Ve,styleText as P}from"node:util";import*as He from"node:readline";import Ue from"node:readline";import{ReadStream as We}from"node:tty";import Ge from"fs";import Ke from"os";import qe from"path";import Je,{constants as Ye}from"node:fs/promises";import Xe,{execFile as Ze,spawn as Qe}from"node:child_process";import{pipeline as $e}from"node:stream/promises";import{PassThrough as et,Writable as tt}from"node:stream";import{fileURLToPath as nt,pathToFileURL as rt}from"node:url";import{fetch as it}from"node-fetch-native";import{createProxy as at}from"node-fetch-native/proxy";import F,{parse as ot}from"postcss";import{twMerge as st}from"cn";import*as ct from"svelte/compiler";import lt from"node:os";import{Buffer as ut}from"node:buffer";var I=n(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}))();function dt(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a].disabled?dt(a,t<0?-1:1,n):a}const ft=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,pt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,mt=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ht=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,gt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,_t=/\t{1,1000}/y,vt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,yt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,bt=/\p{M}+/gu,xt={limit:1/0,ellipsis:``},St=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?St(i,xt,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(bt,``)){let t=e.codePointAt(0)||0;if(w=pt(t)?d:mt(t)?p:l!==f&&ft(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(yt.lastIndex=h,yt.test(e)){if(_=yt.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=yt.lastIndex;continue}if(ht.lastIndex=h,ht.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ht.lastIndex;continue}if(gt.lastIndex=h,gt.test(e)){if(_=gt.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=gt.lastIndex;continue}if(_t.lastIndex=h,_t.test(e)){if(_=_t.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=_t.lastIndex;continue}if(vt.lastIndex=h,vt.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=vt.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Ct={limit:1/0,ellipsis:``,ellipsisWidth:0},wt=(e,t={})=>St(e,Ct,t).width,Tt=`]8;;`,Et=RegExp(`(?:\\[(?<code>\\d+)m|\\${Tt}(?<uri>.*))`,`y`),Dt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ot=e=>`[${e}m`,kt=e=>`${Tt}${e}`,At=e=>e.map(e=>wt(e)),jt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:wt(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=wt(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Tt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Mt=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(wt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Nt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=At(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=wt(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),jt(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){jt(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){jt(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Mt(e)));let l=c.join(`
|
|
3
3
|
`),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===``){Et.lastIndex=p+1;let e=Et.exec(l)?.groups;if(e?.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e?.uri!==void 0&&(a=e.uri.length===0?void 0:e.uri)}let n=i?Dt(i):void 0;t===`
|
|
4
4
|
`?(a&&(r+=kt(``)),i&&n&&(r+=Ot(n))):e===`
|
|
5
5
|
`&&(i&&n&&(r+=Ot(i)),a&&(r+=kt(a))),p+=e.length,d=f,f=u.next()}return r};function Pt(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
@@ -133,4 +133,4 @@ ${t?P(`cyan`,an):``}
|
|
|
133
133
|
This CLI version requires Tailwind v4 and Svelte v5 for the ${K(`init`)} command.\n\nYou have two options:\n1. Update Tailwind CSS to v4 and try again.\n2. Use ${K(`shadcn-svelte@1.0.0-next.10`)} that supports initializing projects with Tailwind v3.\n\nReferences:\nTailwind v4 Guide: ${H.default.underline(`${_}/docs/migration/tailwind-v4`)}\nLegacy Tailwind v3 Docs: ${H.default.underline(`${g}/docs`)}\n\n`)}:t&&r?{ok:!1,error:O(`Initializing a project with Tailwind v3 and Svelte v4 is not supported.\n\nThis CLI version requires Tailwind v4 and Svelte v5 for the ${K(`init`)} command.\n\nPlease use ${K(`shadcn-svelte@0.14`)} that supports Tailwind v3 + Svelte v4.\n\n`)}:!n||!i?{ok:!1,error:O(`This CLI version requires Tailwind CSS v4 and Svelte v5 to initialize a project.
|
|
134
134
|
`)}:{ok:!0}}const ic=[`font`,`theme`],ac=o({cwd:h(),preset:h().optional(),only:i(c(ic)).optional(),yes:a(),silent:a(),skipPreflight:a(),proxy:h().optional(),depsInstall:a()}),oc=new Oe().command(`apply`).description(`apply a preset to an existing project`).argument(`[preset]`,`the preset to apply`).option(`--preset <preset>`,`the preset to use`).addOption(new ke(`--only <parts...>`,`apply only parts of a preset: theme, font`).choices(ic)).option(`-c, --cwd <path>`,`the working directory`,k.cwd()).option(`-y, --yes`,`skip confirmation prompt`,!1).option(`-s, --silent`,`mute output`,!1).option(`--no-deps-install`,`add dependencies to package.json without running install`).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).option(`--proxy <proxy>`,`fetch items from registry using a proxy`,io()).action(async(e,t)=>{t.silent||Pa();let n=ac.parse(t),r=A.resolve(n.cwd);try{if(!M(r))throw O(`The path ${H.default.cyan(r)} does not exist. Please try again.`);let t=n.preset||e;if(t===void 0)throw O(`${H.default.bold(`--preset`)} is required.`);let i=te(t);if(i===null)throw O(`${H.default.bold(`--preset ${t}`)} is not a valid preset.`);nc(r,{skipPreflight:n.skipPreflight});let a=await Ja(r);if(!a)throw new fe(`Configuration file is missing. Please run ${H.default.green(`init`)} to create a ${K(`components.json`)} file.`);await sc({cwd:r,config:a,decidedPresets:i,options:n}),n.silent||Zn(`Preset ${H.default.bold(t)} applied successfully.`)}catch(e){Ia(e)}});async function sc({cwd:e,config:t,decidedPresets:n,options:r}){r.proxy!==void 0&&(k.env.HTTP_PROXY=r.proxy,V.info(`You are using the provided proxy: ${H.default.green(r.proxy)}`));let i=r.only&&r.only.length>0?r.only:void 0,a=i===void 0||i.includes(`theme`),o=i?.includes(`theme`);if(a){t.iconLibrary=n.iconLibrary,t.menuColor=n.menuColor,t.menuAccent=n.menuAccent,t.style=n.style,t.tailwind.baseColor=n.baseColor;let i=ir();r.silent||i.start(`Applying preset ${H.default.bold(r.preset)} to config file`),no(e,t),r.silent||i.stop(`Applied preset ${H.default.bold(r.preset)} to config file`)}let s=ao(t),c=w(n),l=await zo({selectedItems:[new URL(`/init?preset=${c}`,s).toString()],config:t,deps:!0,overwrite:r.yes,silent:r.silent,only:i,skipExisting:!0,forceStylesheet:!0});o||await Vs({cwd:e,prompt:!1,dependencies:Array.from(l.dependencies),devDependencies:Array.from(l.devDependencies),silent:r.silent,install:r.depsInstall})}let cc;function lc(){try{return j.statSync(`/.dockerenv`),!0}catch{return!1}}function uc(){try{return j.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}function dc(){return cc===void 0&&(cc=lc()||uc()),cc}let fc;const pc=()=>{try{return j.statSync(`/run/.containerenv`),!0}catch{return!1}};function mc(){return fc===void 0&&(fc=pc()||dc()),fc}const hc=()=>{if(k.platform!==`linux`)return!1;if(lt.release().toLowerCase().includes(`microsoft`))return!mc();try{if(j.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`))return!mc()}catch{}return j.existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)||j.existsSync(`/run/WSL`)?!mc():!1};var gc=k.env.__IS_WSL_TEST__?hc:hc();const _c=Ve(Xe.execFile),vc=()=>`${k.env.SYSTEMROOT||k.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,$=async(e,t={})=>{let{powerShellPath:n,...r}=t,i=$.encodeCommand(e);return _c(n??vc(),[...$.argumentsPrefix,i],{encoding:`utf8`,...r})};$.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],$.encodeCommand=e=>ut.from(e,`utf16le`).toString(`base64`),$.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function yc(e){for(let t of e.split(`
|
|
135
135
|
`)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}const bc=Ve(Xe.execFile),xc=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await Je.access(n,Ye.F_OK),r=!0}catch{}if(!r)return e;let i=yc(await Je.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),Sc=gc?async()=>`${await xc()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:vc;let Cc;const wc=async()=>(Cc??=(async()=>{try{let e=await Sc();return await Je.access(e,Ye.X_OK),!0}catch{return!1}})(),Cc),Tc=async()=>{let e=await Sc(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:n}=await $(t,{powerShellPath:e});return n.trim()},Ec=async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await bc(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}};function Dc(e,t,n){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let e=n();return r(e),e},set(e){r(e)}}),e}const Oc=Ve(Ze);async function kc(){if(k.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await Oc(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}const Ac=Ve(Ze);async function jc(e,{humanReadableOutput:t=!0,signal:n}={}){if(k.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await Ac(`osascript`,[`-e`,e,r],i);return a.trim()}async function Mc(e){return jc(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const Nc=Ve(Ze),Pc={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},Fc=new Map(Object.entries(Pc));var Ic=class extends Error{};async function Lc(e=Nc){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new Ic(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=r.lastIndexOf(`.`),a=r.lastIndexOf(`-`),o=i===-1?void 0:r.slice(0,i),s=a===-1?void 0:r.slice(0,a);return Pc[r]??Pc[o]??Pc[s]??{name:r,id:r}}const Rc=Ve(Ze),zc=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function Bc(){if(k.platform===`darwin`){let e=await kc();return{name:await Mc(e),id:e}}if(k.platform===`linux`){let{stdout:e}=await Rc(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:zc(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(k.platform===`win32`)return Lc();throw Error(`Only macOS, Linux, and Windows are supported`)}const Vc=!!(k.env.SSH_CONNECTION||k.env.SSH_CLIENT||k.env.SSH_TTY),Hc=Symbol(`fallbackAttempt`),Uc=import.meta.url?A.dirname(nt(import.meta.url)):``,Wc=A.join(Uc,`xdg-open`),{platform:Gc,arch:Kc}=k,qc=async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},Jc=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[Hc]===!0;if(delete e[Hc],Array.isArray(e.app))return qc(e.app,t=>Jc({...e,app:t,[Hc]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return qc(n,t=>Jc({...e,app:{name:t,arguments:r},[Hc]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(gc){let e=await Tc();a=Fc.get(e)??{}}else a=await Bc();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return Jc({...e,app:{name:Qc[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let i,a=[],o={},s=!1;if(gc&&!mc()&&!Vc&&!n&&(s=await wc()),Gc===`darwin`)i=`open`,e.wait&&a.push(`--wait-apps`),e.background&&a.push(`--background`),e.newInstance&&a.push(`--new`),n&&a.push(`-a`,n);else if(Gc===`win32`||s){i=await Sc(),a.push(...$.argumentsPrefix),gc||(o.windowsVerbatimArguments=!0),gc&&e.target&&(e.target=await Ec(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push($.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push($.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>$.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=$.encodeCommand(t.join(` `)),e.wait||(o.stdio=`ignore`)}else{if(n)i=n;else{let e=!Uc||Uc===`/`,t=!1;try{await Je.access(Wc,Ye.X_OK),t=!0}catch{}i=k.versions.electron??(Gc===`android`||e||!t)?`xdg-open`:Wc}r.length>0&&a.push(...r),e.wait||(o.stdio=`ignore`,o.detached=!0)}Gc===`darwin`&&r.length>0&&a.push(`--args`,...r),e.target&&a.push(e.target);let c=Xe.spawn(i,a,o);return e.wait?new Promise((t,n)=>{c.once(`error`,n),c.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(c)})}):t?new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.once(`close`,n=>{if(c.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}c.unref(),e(c)})})}):(c.unref(),new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.off(`error`,t),e(c)})}))},Yc=(e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return Jc({...t,target:e})};function Xc(e){if(typeof e==`string`||Array.isArray(e))return e;let{[Kc]:t}=e;if(!t)throw Error(`${Kc} is not supported`);return t}function Zc({[Gc]:e},{wsl:t}={}){if(t&&gc)return Xc(t);if(!e)throw Error(`${Gc} is not supported`);return Xc(e)}const Qc={browser:`browser`,browserPrivate:`browserPrivate`};Dc(Qc,`chrome`,()=>Zc({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),Dc(Qc,`brave`,()=>Zc({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),Dc(Qc,`firefox`,()=>Zc({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),Dc(Qc,`edge`,()=>Zc({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),Dc(Qc,`safari`,()=>Zc({darwin:`Safari`}));const $c={nova:{title:`Nova`,description:`Lucide / Geist`,hint:`Reduced spacing for compact layouts.`,style:`nova`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`geist`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},vega:{title:`Vega`,description:`Lucide / Inter`,hint:`The classic shadcn/ui look.`,style:`vega`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`inter`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},maia:{title:`Maia`,description:`Hugeicons / Figtree`,hint:`Soft and rounded, with generous spacing.`,style:`maia`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`figtree`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},lyra:{title:`Lyra`,description:`Phosphor / JetBrains Mono`,hint:`Boxy and sharp. Pairs well with mono fonts.`,style:`lyra`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`phosphor`,font:`jetbrains-mono`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},mira:{title:`Mira`,description:`Hugeicons / Inter`,hint:`Compact. Made for dense interfaces.`,style:`mira`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`inter`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},luma:{title:`Luma`,description:`Lucide / Inter`,hint:`Rounded geometry. Soft elevation. Breathable layouts.`,style:`luma`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`inter`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},sera:{title:`Sera`,description:`Lucide / Noto Sans + Playfair Display`,hint:`Editorial and typographic.`,style:`sera`,baseColor:`taupe`,theme:`taupe`,iconLibrary:`lucide`,font:`noto-sans`,fontHeading:`playfair-display`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},rhea:{title:`Rhea`,description:`Lucide / Inter`,hint:`Like Luma but compact.`,style:`rhea`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`inter`,fontHeading:`inherit`,menuAccent:`subtle`,menuColor:`default`,radius:`default`}};async function el(e){let t=await or({message:`You didn't provide a preset for the design system, how would you like to continue?`,initialValue:e?.style===void 0?`presets`:`prompt`,options:Object.entries(tl).map(([e,t])=>({label:t.label,value:e}))});return R(t)&&q(),await tl[t].select(e)}const tl={presets:{label:`Choose from a list of pre-configured presets`,select:e=>rl(e)},customize:{label:`Create my own preset at ${H.default.bold(`shadcn-svelte.com/create`)}`,select:e=>nl(e)},prompt:{label:`Prompt me for the preset`,select:e=>il(e)}};async function nl(e){let t=oo(e??D),n=new URL(`/create`,t).toString(),r=ir();r.start(`Opening ${H.default.bold(n)} in your browser`),await Yc(n),r.stop(`Opened ${H.default.bold(n)} in your browser`);let i=e=>(e.startsWith(`--preset `)&&(e=e.slice(9)),e),a=await ur({message:`When you're done, paste the code back here and we'll use it to configure your project.`,placeholder:"Click on the `--preset <code>` button and paste the code here",validate:e=>{let t=i(e??``);if(!T(t))return`Invalid preset code`}});return R(a)&&q(),te(i(a))}async function rl(e){let t=await or({message:`Choose from a list of pre-configured presets`,initialValue:e?.style??`vega`,options:l($c).map(([e,t])=>({label:`${t.title} - ${t.description}`,value:e,hint:t.hint}))});return R(t)&&q(),$c[t]}async function il(e){let t=await Jn({style:()=>or({message:`Choose a style`,initialValue:e?.style??D.style,options:l($c).map(([e,t])=>({label:t.title,value:e,hint:t.hint}))}),radius:()=>or({message:`Choose a radius`,initialValue:`default`,options:l(C).map(([e,t])=>({label:`${t.label} ${t.value}`,value:e}))}),baseColor:()=>or({message:`Choose a base color`,initialValue:e?.tailwind.baseColor??D.tailwind.baseColor,options:l(ee).map(([e,t])=>({label:`${Ma(t.color)(`■`)} ${t.name}`,value:e}))}),theme:({results:e})=>or({message:`Choose a theme`,initialValue:e.baseColor,options:l(S).map(([e,t])=>({label:`${Ma(t.color)(`■`)} ${t.name}`,value:e}))}),iconLibrary:()=>or({message:`Choose an icon library`,initialValue:e?.iconLibrary??D.iconLibrary,options:l(p).map(([e,t])=>({label:t.title,value:t.name,hint:t.packages.join(`, `)}))}),font:()=>or({message:`Choose a font`,initialValue:`inter`,options:x.map(e=>({label:s(e),value:e}))})},{onCancel:()=>q()});return{style:t.style,baseColor:t.baseColor,theme:t.theme,iconLibrary:t.iconLibrary,font:t.font,fontHeading:`inherit`,radius:t.radius,menuColor:e?.menuColor??D.menuColor,menuAccent:e?.menuAccent??D.menuAccent}}const al=co(),ol=o({cwd:h(),baseColor:h().optional(),preset:h().optional(),css:h().optional(),componentsAlias:h().optional(),utilsAlias:h().optional(),libAlias:h().optional(),hooksAlias:h().optional(),uiAlias:h().optional(),deps:a(),depsInstall:a(),overwrite:a(),proxy:h().optional(),skipPreflight:a(),reinstall:a().optional()}),sl=new Oe().command(`init`).description(`initialize your project and install dependencies`).option(`--preset <preset>`,`the preset to use`).option(`-c, --cwd <path>`,`the working directory`,k.cwd()).addOption(new ke(`-o, --overwrite`,`deprecated: use --reinstall`).default(!1).hideHelp()).addOption(new ke(`--no-deps`,`disable adding & installing dependencies`).hideHelp()).option(`--no-deps-install`,`add dependencies to package.json without running install`).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).option(`--reinstall`,`reinstall existing components when style changes`).option(`--no-reinstall`,`skip reinstalling existing components when style changes`).addOption(new ke(`--base-color <name>`,`the base color for the components`).choices(al.map(e=>e.name))).option(`--css <path>`,`path to the global CSS file`).option(`--components-alias <path>`,`import alias for components`).option(`--lib-alias <path>`,`import alias for lib`).option(`--utils-alias <path>`,`import alias for utils`).option(`--hooks-alias <path>`,`import alias for hooks`).option(`--ui-alias <path>`,`import alias for ui`).option(`--proxy <proxy>`,`fetch items from registry using a proxy`,io()).action(async e=>{Pa();let t=ol.parse(e),n=A.resolve(t.cwd);try{if(!M(n))throw O(`The path ${H.default.cyan(n)} does not exist. Please try again.`);let e=null;t.preset!==void 0&&(e=te(t.preset),e===null&&V.warn(`${H.default.dim(`--preset ${t.preset}`)} is not a valid preset.`)),nc(n,{skipPreflight:t.skipPreflight});let r=Xa(n);r&&=Zs({cwd:n,config:r,skipPreflight:t.skipPreflight});let{resolvedConfig:i,decidedPresets:a,styleChanged:o}=await ll({cwd:n,presetConfig:e,existingConfig:r,options:t});await ul({cwd:n,config:i,decidedPresets:a,options:t,styleChanged:o}),Zn(`${H.default.green(`Success!`)} Project initialization completed.`)}catch(e){Ia(e)}}).on(`option:overwrite`,()=>{console.warn(H.default.yellow(`Warning: ${H.default.bold(`--overwrite`)} is deprecated. Use ${H.default.bold(`--reinstall`)} instead.\n`))});function cl(e,t,n){if(t.css&&!M(A.resolve(e,t.css)))throw O(`The provided global CSS file path ${H.default.cyan(t.css)} does not exist. Please enter a valid path.`);for(let[r,i]of Object.entries(t)){if(!r.endsWith(`Alias`))continue;let t=$a({cwd:e,importPath:i,tsconfig:n});if(t)throw O(t)}}async function ll({cwd:e,presetConfig:t,existingConfig:n,options:r}){let i=n??structuredClone(D);await Oa(e);let{cssPath:a,tsconfigPath:o,packageImportAlias:s}=Ps(e,{relative:!0}),c;if(n)c=ro(e,n);else{if(o)i.typescript=o.includes(`tsconfig`);else{let t=await ur({message:`Where is your ${K(`tsconfig/jsconfig`)} file?`,placeholder:`tsconfig.json`,validate:t=>{let n=A.resolve(e,t??``);if(!(t&&M(n)))return`"${H.default.bold(t)}" does not exist. Please enter a valid path.`}});R(t)&&q(),i.typescript={config:t}}c=ro(e,i)}cl(e,r,c);let l=t??await el(n),u=r.css;if(u===void 0){let t=D.tailwind.css,r=await ur({message:`Where is your ${K(`global CSS`)} file? ${H.default.gray(`(this file will be overwritten)`)}`,initialValue:n?.tailwind.css??a??t,placeholder:a??t,validate:t=>{if(!(t&&M(A.resolve(e,t))))return`"${H.default.bold(t)}" does not exist. Please enter a valid path.`}});R(r)&&q(),u=r}let{utilsAlias:d,libAlias:f,componentAlias:p,hooksAlias:m,uiAlias:h}=await eo({...r,libAliasDefault:s,tsconfig:c,cwd:e,existingConfig:n}),g=Za({...i,tailwind:{css:u,baseColor:l.baseColor},aliases:{utils:d,lib:f,components:p,hooks:m,ui:h},style:l.style,iconLibrary:l.iconLibrary,menuColor:l.menuColor,menuAccent:l.menuAccent}),_;return _=n?n.style!==l.style||n.menuColor!==l.menuColor||n.menuAccent!==l.menuAccent:!1,{resolvedConfig:await Ya(e,g),decidedPresets:l,styleChanged:_}}async function ul({cwd:e,config:t,decidedPresets:n,options:r,styleChanged:i}){r.proxy!==void 0&&(k.env.HTTP_PROXY=r.proxy,V.info(`You are using the provided proxy: ${H.default.green(r.proxy)}`));let a=[];a.push({title:`Creating config file`,async task(){return no(e,t),`Config file ${K(`components.json`)} created`}}),a.push({title:`Validating alias paths`,async task(){for(let[e,n]of Object.entries(t.resolvedPaths)){let t=A.extname(n)?A.dirname(n):n;e===`utils`&&n.endsWith(`/utils`)&&(t=t.replace(/\/utils$/,``)),!M(t)&&e!==`utils`&&await N.mkdir(t,{recursive:!0})}return`Alias paths validated`}}),await sr(a);let o=ao(t),s=w(n),c=new URL(`/init?preset=${s}`,o).toString(),l=[],u=r.overwrite||r.reinstall===!0;if(i&&r.reinstall!==!1&&(l=(await Da({registryIndex:await so(o),config:t})).filter(e=>e.name!==`utils`).map(e=>e.name),l.length>0&&!u)){V.warn(`The registry style has changed to ${H.default.bold(H.default.yellow(n.style))}.`);let e=await qn({message:`Would you like to ${H.default.bold(H.default.red(`overwrite`))} your existing components?`,initialValue:!0});R(e)&&q(),u=e}let d=await zo({selectedItems:[c,...l],config:t,deps:r.deps,overwrite:u});if(r.deps)await Vs({cwd:e,prompt:r.deps,dependencies:Array.from(d.dependencies),devDependencies:Array.from(d.devDependencies),install:r.depsInstall});else if(d.skippedDeps.size){let e=Fa([...d.skippedDeps],7);V.warn(`shadcn-svelte has been initialized ${H.default.bold(H.default.red(`without`))} the following ${K(`dependencies`)}:\n${H.default.gray(e)}`)}}const dl=o({all:a(),components:h().array().optional(),cwd:h(),proxy:h().optional(),yes:a(),skipPreflight:a(),deps:a(),depsInstall:a()}),fl=new Oe().command(`update`,{hidden:!0}).description(`update components in your project`).argument(`[components...]`,`name of components`).option(`-c, --cwd <path>`,`the working directory`,k.cwd()).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).addOption(new ke(`--no-deps`,`skips adding & installing package dependencies`).hideHelp()).option(`--no-deps-install`,`add dependencies to package.json without running install`).option(`-a, --all`,`update all existing components`,!1).option(`-y, --yes`,`skip confirmation prompt`,!1).option(`--proxy <proxy>`,`fetch components from registry using a proxy`,io()).action(async(e,t)=>{Pa();try{let n=dl.parse({components:e,...t}),r=A.resolve(n.cwd);if(!M(r))throw O(`The path ${H.default.cyan(r)} does not exist. Please try again.`);let i=await Ja(r);if(!i)throw O(`Configuration file is missing. Please run ${H.default.green(`init`)} to create a ${K(`components.json`)} file.`);await pl(r,Zs({config:i,cwd:r,skipPreflight:n.skipPreflight}),n),Zn(`${H.default.green(`Success!`)} Component update completed.`)}catch(e){Ia(e)}});async function pl(e,t,n){n.proxy!==void 0&&(k.env.HTTP_PROXY=n.proxy,V.info(`You are using the provided proxy: ${H.default.green(n.proxy)}`));let r=n.components,i=ao(t),a=await so(i),o=await Da({registryIndex:a,config:t}),s=n.all?o:[];if(s.length===0&&r!==void 0&&(s=o.filter(e=>r.includes(e.name))),s.length===0){let e=await $n({message:`Which components would you like to update?`,maxItems:10,options:o.map(e=>({label:e.name,value:e,hint:e.registryDependencies?.length?`also updates: ${e.registryDependencies.join(`, `)}`:void 0}))});R(e)&&q(),s=e}else{let e=Fa(s.map(({name:e})=>e));V.step(`Components to update:\n${H.default.gray(e)}`)}if(n.yes===!1){let e=await qn({message:`Ready to update ${K(`components`)}? ${H.default.gray(`(Make sure you have committed your changes before proceeding!)`)}`,initialValue:!0});(R(e)||e===!1)&&q()}let c=[],l=await uo({baseUrl:i,items:await lo({registryUrl:i,registryIndex:a,items:s.map(e=>e.name)})});l.sort((e,t)=>e.name.localeCompare(t.name));let u=[];for(let e of l)e.cssVars&&u.push({cssVars:e.cssVars}),e.type===`registry:font`&&e.font&&u.push({fonts:[{font:e.font}]});let d=vo(u),f={},p=new Set,m=new Set,h=[],g={},_={};for(let e of l){let r=po(t,e.type);e.dependencies?.forEach(e=>p.add(e)),e.devDependencies?.forEach(e=>m.add(e)),e.type===`registry:font`&&h.push({name:e.name,...e.font}),c.push({title:`Updating ${K(e.name)}`,async task(){for(let n of e.files??[]){let r=mo(t,e,n),{content:i,dependencies:a,devDependencies:o,filePath:s}=await Se({content:n.content,filePath:r,config:t,supportedFontMarkers:d},[_e,pe,ve,be,!t.typescript&&ge]);a?.forEach(e=>p.add(e)),o?.forEach(e=>m.add(e));let c=A.parse(s).dir;M(c)||await N.mkdir(c,{recursive:!0}),await N.writeFile(s,i,`utf8`)}e.css&&(_=(0,ho.default)(_,e.css)),e.cssVars&&(g=(0,ho.default)(g,e.cssVars));let i=A.resolve(r,e.name);if(e.files&&e.files?.length>1){let n=e.files.map(n=>{let r=mo(t,e,n);return!t.typescript&&r.endsWith(`.ts`)?r.replace(`.ts`,`.js`):r}),r=(await N.readdir(i,{withFileTypes:!0})).map(e=>A.resolve(e.parentPath,e.name)).filter(e=>!n.includes(e));r.length>0&&(f[e.name]=r)}let a=A.relative(n.cwd,i);return`${K(e.name)} updated at ${H.default.gray(a)}`}})}let{css:v,cssVars:y,dependencies:b}=yo(h);if(_=(0,ho.default)(_,v),g=(0,ho.default)(g,y),b.forEach(e=>m.add(e)),(Object.keys(g).length>0||Object.keys(_).length>0)&&(_=(0,ho.default)(_,me),c.push({title:`Updating stylesheet`,async task(){let n=t.resolvedPaths.tailwindCss,r=Lo(await N.readFile(n,`utf8`),{css:_,cssVars:g});await N.writeFile(n,r,`utf8`);let i=A.relative(e,n);return`${K(`Stylesheet`)} updated at ${H.default.dim(i)}`}})),await sr(c),n.deps)await Vs({cwd:e,dependencies:Array.from(p),devDependencies:Array.from(m),prompt:!0,install:n.depsInstall});else if(p.size>0||m.size>0){let e=Fa([...p,...m],7);V.warn(`Components have been updated ${H.default.bold(H.default.red(`without`))} the following ${K(`dependencies`)}:\n${H.default.gray(e)}`)}for(let[t,n]of Object.entries(f))V.warn(`The ${K(t)} component does not use the following files:\n${n.map(t=>H.default.white(`- ${H.default.gray(A.relative(e,t))}`)).join(`
|
|
136
|
-
`)}`);Object.keys(f).length>0&&V.message(H.default.bold(`You may want to delete them.`))}const ml=ye.extend(xe());function hl(e){let t=Aa(e),n=gl({dependencies:yl(t.dependencies,e),devDependencies:yl(t.devDependencies,e)});return n=_l(n),n}function gl(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.versions)){let i=t.deps[r],a=`@types/${n.replace(/^@(.*)\/(.*)/,`$1__$2`)}`;(e.dependencies.versions[a]??e.devDependencies.versions[a])&&i.push(a)}return e}function _l(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.deps))t.deps[n]=r.map(t=>e.dependencies.versions[t]||e.devDependencies.versions[t]).filter(e=>e!==void 0);return e}const vl=[`svelte`,`@sveltejs/kit`,`tailwindcss`,`vite`,`sv`,`shadcn-svelte`];function yl(e,t){let n={},r={};for(let[i,a]of Object.entries(e??{})){let e=a?`${i}@${a}`:i,o=n[e]??=[];r[i]=e;let s=Ea(t,i)?.pkg;if(!s)continue;let{peerDependencies:c={},peerDependenciesMeta:l={}}=s;for(let[e]of Object.entries(c))vl.includes(e)||l[e]?.optional||o.push(e)}return{deps:n,versions:r}}async function bl(e){let{filename:t,source:n}=e,r,i;if(t.endsWith(`.svelte`)){let{code:e}=await ct.preprocess(n,[],{filename:t}),a=ct.parse(e,{filename:t});r=a.instance,a.module&&(i=a.module)}else if(t.endsWith(`.ts`)||t.endsWith(`.js`))r=ml.parse(n,{ecmaVersion:`latest`,sourceType:`module`,sourceFile:t});else return{};let a=new Set,o=new Set,s=t=>{if(t.type!==`ImportDeclaration
|
|
136
|
+
`)}`);Object.keys(f).length>0&&V.message(H.default.bold(`You may want to delete them.`))}const ml=ye.extend(xe());function hl(e){let t=Aa(e),n=gl({dependencies:yl(t.dependencies,e),devDependencies:yl(t.devDependencies,e)});return n=_l(n),n}function gl(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.versions)){let i=t.deps[r],a=`@types/${n.replace(/^@(.*)\/(.*)/,`$1__$2`)}`;(e.dependencies.versions[a]??e.devDependencies.versions[a])&&i.push(a)}return e}function _l(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.deps))t.deps[n]=r.map(t=>e.dependencies.versions[t]||e.devDependencies.versions[t]).filter(e=>e!==void 0);return e}const vl=[`svelte`,`@sveltejs/kit`,`tailwindcss`,`vite`,`sv`,`shadcn-svelte`];function yl(e,t){let n={},r={};for(let[i,a]of Object.entries(e??{})){let e=a?`${i}@${a}`:i,o=n[e]??=[];r[i]=e;let s=Ea(t,i)?.pkg;if(!s)continue;let{peerDependencies:c={},peerDependenciesMeta:l={}}=s;for(let[e]of Object.entries(c))vl.includes(e)||l[e]?.optional||o.push(e)}return{deps:n,versions:r}}async function bl(e){let{filename:t,source:n}=e,r,i;if(t.endsWith(`.svelte`)){let{code:e}=await ct.preprocess(n,[],{filename:t}),a=ct.parse(e,{filename:t});r=a.instance,a.module&&(i=a.module)}else if(t.endsWith(`.ts`)||t.endsWith(`.js`))r=ml.parse(n,{ecmaVersion:`latest`,sourceType:`module`,sourceFile:t});else return{};let a=new Set,o=new Set,s=t=>{if(t.type!==`ImportDeclaration`&&t.type!==`ExportNamedDeclaration`&&t.type!==`ExportAllDeclaration`||!t.source)return;let n=t.source.value;xl(n,e.dependencies).forEach(e=>a.add(e)),xl(n,e.devDependencies).forEach(e=>o.add(e))};return he(r,{enter:s}),i&&he(i,{enter:s}),{dependencies:f(a),devDependencies:f(o)}}function xl(e,t){let n=[],r=(t.versions[e]?e:void 0)??Object.keys(t.versions).find(t=>e===t||e.startsWith(`${t}/`));if(r&&!vl.includes(r)){let e=t.versions[r],i=t.deps[e];n.push(e),i?.forEach(e=>n.push(e))}return n}const Sl=o({registry:h(),cwd:h(),output:h()}),Cl=new Oe().command(`build`).description(`build components for a shadcn-svelte registry`).argument(`[registry]`,`path to registry.json file`,`./registry.json`).option(`-c, --cwd <path>`,`the working directory`,k.cwd()).option(`-o, --output <path>`,`destination directory for json files`,`./static/r`).action(async(e,t)=>{try{Pa();let n=Sl.parse({registry:e,...t}),r=A.resolve(n.cwd),i=A.resolve(n.cwd,n.output),a=A.resolve(n.cwd,n.registry);for(let[e,t]of Object.entries({cwd:r,registry:a}))if(!M(t))throw O(`The '${e}' path ${H.default.cyan(t)} does not exist.`);await wl({cwd:r,output:i,registry:a}),Zn(`${H.default.green(`Success!`)} Registry build completed.`)}catch(e){Ia(e)}});async function wl(e){let t=ir();t.start(`Parsing registry schema`);let n=await N.readFile(e.registry,`utf8`),r=ue.parse(JSON.parse(n));t.stop(`Parsed registry schema at ${H.default.dim(A.relative(e.cwd,e.registry))}`);let i=r.items.map(e=>({...e,relativeUrl:`${e.name}.json`}));M(e.output)||await N.mkdir(e.output,{recursive:!0});let a=[];a.push({title:`Building registry index`,async task(){let t=A.resolve(e.output,`index.json`),n=ie.parse(i);await N.writeFile(t,JSON.stringify(n,null,` `),`utf8`);let r=A.relative(e.cwd,t);return`Registry index written to ${H.default.dim(r)}`}}),a.push({title:`Building registry items`,async task(t){let n=hl(e.cwd);if(r.overrideDependencies){let e=(e,t)=>{let{name:n}=Xs(e),r=t.versions[n];if(r){let i=t.deps[r];delete t.deps[r],t.versions[n]=e,t.deps[e]=i??[]}};for(let t of r.overrideDependencies)e(t,n.dependencies),e(t,n.devDependencies)}for(let i of r.items){t(`Building item ${H.default.cyan(i.name)}`);let a=i.files.length===1,o=[`registry:page`,`registry:ui`,`registry:file`],s=i.files.map(async e=>{let t=await N.readFile(e.path,`utf8`);t=El(r.aliases??={},t);let n=A.basename(e.path),s;return s=a?n:o.includes(e.type)?`${i.name}/${n}`:n,{content:t,name:n,target:s,...e}}),c=await Promise.all(s),l=new Set(i.dependencies),u=new Set(i.devDependencies),d=new Set(i.registryDependencies.map(Tl));if(!(l.size>0&&u.size>0))for(let e of c){let t=await bl({...n,filename:e.name,source:e.content});i.dependencies||t.dependencies?.forEach(e=>{e.startsWith(`@types/`)?u.add(e):l.add(e)}),i.devDependencies||t.devDependencies?.forEach(e=>u.add(e))}let p=se.parse({...i,$schema:`${_}/schema/registry-item.json`,registryDependencies:f(d),dependencies:f(l),devDependencies:f(u),files:c},{jitless:!0}),m=A.resolve(e.output,`${i.name}.json`);await N.writeFile(m,JSON.stringify(p,null,` `),`utf8`)}let i=A.relative(e.cwd,e.output);return`Registry items written to ${H.default.dim(i)}`}}),await sr(a)}function Tl(e){return e.startsWith(`local:`)?e.replace(/^local:(.*)/,`./$1.json`):e}function El(e,t){for(let n of b){let r=v[n],i=e[n]??=r.defaultPath;t=t.replaceAll(i,r.placeholder)}return t}const Dl=new Oe().command(`registry`).addCommand(Cl);var Ol=e({add:()=>ec,apply:()=>oc,init:()=>sl,registry:()=>Dl,update:()=>fl});k.on(`SIGINT`,()=>k.exit(0)),k.on(`SIGTERM`,()=>k.exit(0));const kl=k.versions.node;Number.parseInt(kl.split(`.`).at(0))<20&&(console.error(`Node.js v${kl} is out of date and unsupported!`),console.error(`Please use Node.js v20 or higher.`),k.exit(1));async function Al(){let e=Ca(),t=new Oe().name(`shadcn-svelte`).description(`Add shadcn-svelte components to your project`).version(e.version||`0.0.0`,`-v, --version`,`display the version number`);for(let e of Object.values(Ol))t.addCommand(e);t.parse()}Al();export{};
|
package/dist/tailwind.css
CHANGED
|
@@ -93,77 +93,89 @@
|
|
|
93
93
|
syntax: "<length-percentage>";
|
|
94
94
|
inherits: false;
|
|
95
95
|
initial-value: 0px;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
}
|
|
97
|
+
@property --scroll-fade-b {
|
|
98
98
|
syntax: "<length-percentage>";
|
|
99
99
|
inherits: false;
|
|
100
100
|
initial-value: 0px;
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
}
|
|
102
|
+
@property --scroll-fade-s {
|
|
103
103
|
syntax: "<length-percentage>";
|
|
104
104
|
inherits: false;
|
|
105
105
|
initial-value: 0px;
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
}
|
|
107
|
+
@property --scroll-fade-e {
|
|
108
108
|
syntax: "<length-percentage>";
|
|
109
109
|
inherits: false;
|
|
110
110
|
initial-value: 0px;
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
}
|
|
112
|
+
@property --scroll-fade-mask {
|
|
113
113
|
syntax: "*";
|
|
114
114
|
inherits: false;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@theme inline {
|
|
118
118
|
@keyframes scroll-fade-reveal-t {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
from {
|
|
120
|
+
--scroll-fade-t: 0px;
|
|
121
|
+
}
|
|
122
|
+
to {
|
|
123
|
+
--scroll-fade-t: var(
|
|
124
|
+
--_scroll-fade-size-t,
|
|
125
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
126
|
+
);
|
|
127
|
+
}
|
|
125
128
|
}
|
|
126
129
|
@keyframes scroll-fade-reveal-b {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
from {
|
|
131
|
+
--scroll-fade-b: var(
|
|
132
|
+
--_scroll-fade-size-b,
|
|
133
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
to {
|
|
137
|
+
--scroll-fade-b: 0px;
|
|
138
|
+
}
|
|
133
139
|
}
|
|
134
140
|
@keyframes scroll-fade-reveal-s {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
from {
|
|
142
|
+
--scroll-fade-s: 0px;
|
|
143
|
+
}
|
|
144
|
+
to {
|
|
145
|
+
--scroll-fade-s: var(
|
|
146
|
+
--_scroll-fade-size-s,
|
|
147
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
148
|
+
);
|
|
149
|
+
}
|
|
141
150
|
}
|
|
142
151
|
@keyframes scroll-fade-reveal-e {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
from {
|
|
153
|
+
--scroll-fade-e: var(
|
|
154
|
+
--_scroll-fade-size-e,
|
|
155
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
to {
|
|
159
|
+
--scroll-fade-e: 0px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@utility scroll-fade {
|
|
153
165
|
--_scroll-fade-size-t: var(
|
|
154
|
-
|
|
155
|
-
|
|
166
|
+
--scroll-fade-t-size,
|
|
167
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
156
168
|
);
|
|
157
169
|
--_scroll-fade-size-b: var(
|
|
158
|
-
|
|
159
|
-
|
|
170
|
+
--scroll-fade-b-size,
|
|
171
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
160
172
|
);
|
|
161
173
|
--scroll-fade-block: linear-gradient(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
174
|
+
to bottom,
|
|
175
|
+
transparent 0,
|
|
176
|
+
#000 var(--scroll-fade-t, 0px),
|
|
177
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
178
|
+
transparent 100%
|
|
167
179
|
);
|
|
168
180
|
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
169
181
|
mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
@@ -171,39 +183,39 @@
|
|
|
171
183
|
mask-composite: intersect;
|
|
172
184
|
-webkit-mask-repeat: no-repeat;
|
|
173
185
|
mask-repeat: no-repeat;
|
|
174
|
-
|
|
186
|
+
|
|
175
187
|
@supports (animation-timeline: scroll()) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
188
|
+
animation:
|
|
189
|
+
scroll-fade-reveal-t 1ms ease-in-out,
|
|
190
|
+
scroll-fade-reveal-b 1ms ease-in-out;
|
|
191
|
+
animation-timeline: scroll(self y), scroll(self y);
|
|
192
|
+
animation-range:
|
|
193
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
194
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
195
|
+
animation-fill-mode: both;
|
|
196
|
+
}
|
|
197
|
+
|
|
186
198
|
@supports not (animation-timeline: scroll()) {
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
200
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
189
201
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@utility scroll-fade-y {
|
|
193
205
|
--_scroll-fade-size-t: var(
|
|
194
|
-
|
|
195
|
-
|
|
206
|
+
--scroll-fade-t-size,
|
|
207
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
196
208
|
);
|
|
197
209
|
--_scroll-fade-size-b: var(
|
|
198
|
-
|
|
199
|
-
|
|
210
|
+
--scroll-fade-b-size,
|
|
211
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
200
212
|
);
|
|
201
213
|
--scroll-fade-block: linear-gradient(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
to bottom,
|
|
215
|
+
transparent 0,
|
|
216
|
+
#000 var(--scroll-fade-t, 0px),
|
|
217
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
218
|
+
transparent 100%
|
|
207
219
|
);
|
|
208
220
|
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
209
221
|
mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
@@ -211,48 +223,48 @@
|
|
|
211
223
|
mask-composite: intersect;
|
|
212
224
|
-webkit-mask-repeat: no-repeat;
|
|
213
225
|
mask-repeat: no-repeat;
|
|
214
|
-
|
|
226
|
+
|
|
215
227
|
@supports (animation-timeline: scroll()) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
228
|
+
animation:
|
|
229
|
+
scroll-fade-reveal-t 1ms ease-in-out,
|
|
230
|
+
scroll-fade-reveal-b 1ms ease-in-out;
|
|
231
|
+
animation-timeline: scroll(self y), scroll(self y);
|
|
232
|
+
animation-range:
|
|
233
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
234
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
235
|
+
animation-fill-mode: both;
|
|
236
|
+
}
|
|
237
|
+
|
|
226
238
|
@supports not (animation-timeline: scroll()) {
|
|
227
|
-
|
|
228
|
-
|
|
239
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
240
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
229
241
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@utility scroll-fade-x {
|
|
233
245
|
--_scroll-fade-size-s: var(
|
|
234
|
-
|
|
235
|
-
|
|
246
|
+
--scroll-fade-s-size,
|
|
247
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
236
248
|
);
|
|
237
249
|
--_scroll-fade-size-e: var(
|
|
238
|
-
|
|
239
|
-
|
|
250
|
+
--scroll-fade-e-size,
|
|
251
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
240
252
|
);
|
|
241
253
|
--scroll-fade-inline: linear-gradient(
|
|
242
|
-
|
|
243
|
-
transparent 0,
|
|
244
|
-
#000 var(--scroll-fade-s, 0px),
|
|
245
|
-
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
246
|
-
transparent 100%
|
|
247
|
-
);
|
|
248
|
-
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
249
|
-
--scroll-fade-inline: linear-gradient(
|
|
250
|
-
to left,
|
|
254
|
+
to right,
|
|
251
255
|
transparent 0,
|
|
252
256
|
#000 var(--scroll-fade-s, 0px),
|
|
253
257
|
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
254
258
|
transparent 100%
|
|
255
|
-
|
|
259
|
+
);
|
|
260
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
261
|
+
--scroll-fade-inline: linear-gradient(
|
|
262
|
+
to left,
|
|
263
|
+
transparent 0,
|
|
264
|
+
#000 var(--scroll-fade-s, 0px),
|
|
265
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
266
|
+
transparent 100%
|
|
267
|
+
);
|
|
256
268
|
}
|
|
257
269
|
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
|
|
258
270
|
mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
|
|
@@ -260,34 +272,34 @@
|
|
|
260
272
|
mask-composite: intersect;
|
|
261
273
|
-webkit-mask-repeat: no-repeat;
|
|
262
274
|
mask-repeat: no-repeat;
|
|
263
|
-
|
|
275
|
+
|
|
264
276
|
@supports (animation-timeline: scroll()) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
277
|
+
animation:
|
|
278
|
+
scroll-fade-reveal-s 1ms ease-in-out,
|
|
279
|
+
scroll-fade-reveal-e 1ms ease-in-out;
|
|
280
|
+
animation-timeline: scroll(self inline), scroll(self inline);
|
|
281
|
+
animation-range:
|
|
282
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
283
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
284
|
+
animation-fill-mode: both;
|
|
285
|
+
}
|
|
286
|
+
|
|
275
287
|
@supports not (animation-timeline: scroll()) {
|
|
276
|
-
|
|
277
|
-
|
|
288
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
289
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
278
290
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@utility scroll-fade-t {
|
|
282
294
|
--_scroll-fade-size-t: var(
|
|
283
|
-
|
|
284
|
-
|
|
295
|
+
--scroll-fade-t-size,
|
|
296
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
285
297
|
);
|
|
286
298
|
--scroll-fade-mask: linear-gradient(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
to bottom,
|
|
300
|
+
transparent 0,
|
|
301
|
+
#000 var(--scroll-fade-t, 0px),
|
|
302
|
+
#000 100%
|
|
291
303
|
);
|
|
292
304
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
293
305
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -295,29 +307,29 @@
|
|
|
295
307
|
mask-composite: intersect;
|
|
296
308
|
-webkit-mask-repeat: no-repeat;
|
|
297
309
|
mask-repeat: no-repeat;
|
|
298
|
-
|
|
310
|
+
|
|
299
311
|
@supports (animation-timeline: scroll()) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
312
|
+
animation: scroll-fade-reveal-t 1ms ease-in-out;
|
|
313
|
+
animation-timeline: scroll(self y);
|
|
314
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
315
|
+
animation-fill-mode: both;
|
|
304
316
|
}
|
|
305
|
-
|
|
317
|
+
|
|
306
318
|
@supports not (animation-timeline: scroll()) {
|
|
307
|
-
|
|
319
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
308
320
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@utility scroll-fade-b {
|
|
312
324
|
--_scroll-fade-size-b: var(
|
|
313
|
-
|
|
314
|
-
|
|
325
|
+
--scroll-fade-b-size,
|
|
326
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
315
327
|
);
|
|
316
328
|
--scroll-fade-mask: linear-gradient(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
329
|
+
to bottom,
|
|
330
|
+
#000 0,
|
|
331
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
332
|
+
transparent 100%
|
|
321
333
|
);
|
|
322
334
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
323
335
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -325,32 +337,29 @@
|
|
|
325
337
|
mask-composite: intersect;
|
|
326
338
|
-webkit-mask-repeat: no-repeat;
|
|
327
339
|
mask-repeat: no-repeat;
|
|
328
|
-
|
|
340
|
+
|
|
329
341
|
@supports (animation-timeline: scroll()) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
)
|
|
335
|
-
100%;
|
|
336
|
-
animation-fill-mode: both;
|
|
342
|
+
animation: scroll-fade-reveal-b 1ms ease-in-out;
|
|
343
|
+
animation-timeline: scroll(self y);
|
|
344
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
345
|
+
animation-fill-mode: both;
|
|
337
346
|
}
|
|
338
|
-
|
|
347
|
+
|
|
339
348
|
@supports not (animation-timeline: scroll()) {
|
|
340
|
-
|
|
349
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
341
350
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@utility scroll-fade-l {
|
|
345
354
|
--_scroll-fade-size-s: var(
|
|
346
|
-
|
|
347
|
-
|
|
355
|
+
--scroll-fade-s-size,
|
|
356
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
348
357
|
);
|
|
349
358
|
--scroll-fade-mask: linear-gradient(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
359
|
+
to right,
|
|
360
|
+
transparent 0,
|
|
361
|
+
#000 var(--scroll-fade-s, 0px),
|
|
362
|
+
#000 100%
|
|
354
363
|
);
|
|
355
364
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
356
365
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -358,29 +367,29 @@
|
|
|
358
367
|
mask-composite: intersect;
|
|
359
368
|
-webkit-mask-repeat: no-repeat;
|
|
360
369
|
mask-repeat: no-repeat;
|
|
361
|
-
|
|
370
|
+
|
|
362
371
|
@supports (animation-timeline: scroll()) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
372
|
+
animation: scroll-fade-reveal-s 1ms ease-in-out;
|
|
373
|
+
animation-timeline: scroll(self x);
|
|
374
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
375
|
+
animation-fill-mode: both;
|
|
367
376
|
}
|
|
368
|
-
|
|
377
|
+
|
|
369
378
|
@supports not (animation-timeline: scroll()) {
|
|
370
|
-
|
|
379
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
371
380
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@utility scroll-fade-r {
|
|
375
384
|
--_scroll-fade-size-e: var(
|
|
376
|
-
|
|
377
|
-
|
|
385
|
+
--scroll-fade-e-size,
|
|
386
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
378
387
|
);
|
|
379
388
|
--scroll-fade-mask: linear-gradient(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
389
|
+
to right,
|
|
390
|
+
#000 0,
|
|
391
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
392
|
+
transparent 100%
|
|
384
393
|
);
|
|
385
394
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
386
395
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -388,40 +397,37 @@
|
|
|
388
397
|
mask-composite: intersect;
|
|
389
398
|
-webkit-mask-repeat: no-repeat;
|
|
390
399
|
mask-repeat: no-repeat;
|
|
391
|
-
|
|
400
|
+
|
|
392
401
|
@supports (animation-timeline: scroll()) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
)
|
|
398
|
-
100%;
|
|
399
|
-
animation-fill-mode: both;
|
|
402
|
+
animation: scroll-fade-reveal-e 1ms ease-in-out;
|
|
403
|
+
animation-timeline: scroll(self x);
|
|
404
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
405
|
+
animation-fill-mode: both;
|
|
400
406
|
}
|
|
401
|
-
|
|
407
|
+
|
|
402
408
|
@supports not (animation-timeline: scroll()) {
|
|
403
|
-
|
|
409
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
404
410
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
@utility scroll-fade-s {
|
|
408
414
|
--_scroll-fade-size-s: var(
|
|
409
|
-
|
|
410
|
-
|
|
415
|
+
--scroll-fade-s-size,
|
|
416
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
411
417
|
);
|
|
412
418
|
--scroll-fade-mask: linear-gradient(
|
|
413
|
-
|
|
414
|
-
transparent 0,
|
|
415
|
-
#000 var(--scroll-fade-s, 0px),
|
|
416
|
-
#000 100%
|
|
417
|
-
);
|
|
418
|
-
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
419
|
-
--scroll-fade-mask: linear-gradient(
|
|
420
|
-
to left,
|
|
419
|
+
to right,
|
|
421
420
|
transparent 0,
|
|
422
421
|
#000 var(--scroll-fade-s, 0px),
|
|
423
422
|
#000 100%
|
|
424
|
-
|
|
423
|
+
);
|
|
424
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
425
|
+
--scroll-fade-mask: linear-gradient(
|
|
426
|
+
to left,
|
|
427
|
+
transparent 0,
|
|
428
|
+
#000 var(--scroll-fade-s, 0px),
|
|
429
|
+
#000 100%
|
|
430
|
+
);
|
|
425
431
|
}
|
|
426
432
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
427
433
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -429,37 +435,37 @@
|
|
|
429
435
|
mask-composite: intersect;
|
|
430
436
|
-webkit-mask-repeat: no-repeat;
|
|
431
437
|
mask-repeat: no-repeat;
|
|
432
|
-
|
|
438
|
+
|
|
433
439
|
@supports (animation-timeline: scroll()) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
440
|
+
animation: scroll-fade-reveal-s 1ms ease-in-out;
|
|
441
|
+
animation-timeline: scroll(self inline);
|
|
442
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
443
|
+
animation-fill-mode: both;
|
|
438
444
|
}
|
|
439
|
-
|
|
445
|
+
|
|
440
446
|
@supports not (animation-timeline: scroll()) {
|
|
441
|
-
|
|
447
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
442
448
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
@utility scroll-fade-e {
|
|
446
452
|
--_scroll-fade-size-e: var(
|
|
447
|
-
|
|
448
|
-
|
|
453
|
+
--scroll-fade-e-size,
|
|
454
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
449
455
|
);
|
|
450
456
|
--scroll-fade-mask: linear-gradient(
|
|
451
|
-
|
|
452
|
-
#000 0,
|
|
453
|
-
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
454
|
-
transparent 100%
|
|
455
|
-
);
|
|
456
|
-
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
457
|
-
--scroll-fade-mask: linear-gradient(
|
|
458
|
-
to left,
|
|
457
|
+
to right,
|
|
459
458
|
#000 0,
|
|
460
459
|
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
461
460
|
transparent 100%
|
|
462
|
-
|
|
461
|
+
);
|
|
462
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
463
|
+
--scroll-fade-mask: linear-gradient(
|
|
464
|
+
to left,
|
|
465
|
+
#000 0,
|
|
466
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
467
|
+
transparent 100%
|
|
468
|
+
);
|
|
463
469
|
}
|
|
464
470
|
-webkit-mask-image: var(--scroll-fade-mask);
|
|
465
471
|
mask-image: var(--scroll-fade-mask);
|
|
@@ -467,97 +473,89 @@
|
|
|
467
473
|
mask-composite: intersect;
|
|
468
474
|
-webkit-mask-repeat: no-repeat;
|
|
469
475
|
mask-repeat: no-repeat;
|
|
470
|
-
|
|
476
|
+
|
|
471
477
|
@supports (animation-timeline: scroll()) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
)
|
|
477
|
-
100%;
|
|
478
|
-
animation-fill-mode: both;
|
|
478
|
+
animation: scroll-fade-reveal-e 1ms ease-in-out;
|
|
479
|
+
animation-timeline: scroll(self inline);
|
|
480
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
481
|
+
animation-fill-mode: both;
|
|
479
482
|
}
|
|
480
|
-
|
|
483
|
+
|
|
481
484
|
@supports not (animation-timeline: scroll()) {
|
|
482
|
-
|
|
485
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
483
486
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
@utility scroll-fade-* {
|
|
487
490
|
--scroll-fade-size: calc(var(--spacing) * --value(integer));
|
|
488
491
|
--scroll-fade-size: --value([length], [percentage]);
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
@utility scroll-fade-t-* {
|
|
492
495
|
--scroll-fade-t-size: calc(var(--spacing) * --value(integer));
|
|
493
496
|
--scroll-fade-t-size: --value([length], [percentage]);
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
@utility scroll-fade-b-* {
|
|
497
500
|
--scroll-fade-b-size: calc(var(--spacing) * --value(integer));
|
|
498
501
|
--scroll-fade-b-size: --value([length], [percentage]);
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
@utility scroll-fade-s-* {
|
|
502
505
|
--scroll-fade-s-size: calc(var(--spacing) * --value(integer));
|
|
503
506
|
--scroll-fade-s-size: --value([length], [percentage]);
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
@utility scroll-fade-e-* {
|
|
507
510
|
--scroll-fade-e-size: calc(var(--spacing) * --value(integer));
|
|
508
511
|
--scroll-fade-e-size: --value([length], [percentage]);
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
@utility scroll-fade-none {
|
|
512
515
|
--scroll-fade-mask: none;
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* shimmer */
|
|
519
|
+
@property --shimmer-angle {
|
|
517
520
|
syntax: "<angle>";
|
|
518
521
|
inherits: true;
|
|
519
522
|
initial-value: 20deg;
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
}
|
|
524
|
+
@property --shimmer-image {
|
|
522
525
|
syntax: "*";
|
|
523
526
|
inherits: false;
|
|
524
|
-
|
|
525
|
-
|
|
527
|
+
}
|
|
528
|
+
@property --shimmer-text-fill {
|
|
526
529
|
syntax: "*";
|
|
527
530
|
inherits: false;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
@theme inline {
|
|
531
534
|
@keyframes tw-shimmer {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
from {
|
|
536
|
+
background-position: 100% 0;
|
|
537
|
+
}
|
|
538
|
+
to {
|
|
539
|
+
background-position: 0 0;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
@utility shimmer {
|
|
542
545
|
--_spread: var(--shimmer-spread, calc(3ch + 40px));
|
|
543
546
|
--_base: currentColor;
|
|
544
|
-
--_highlight: var(
|
|
545
|
-
|
|
546
|
-
oklch(from currentColor l c h / calc(alpha* 0.2))
|
|
547
|
-
);
|
|
548
|
-
|
|
547
|
+
--_highlight: var(--shimmer-color, oklch(from currentColor l c h / calc(alpha* 0.2)));
|
|
548
|
+
|
|
549
549
|
background-image: var(
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
var(--_base) calc(50% + var(--_spread))
|
|
560
|
-
)
|
|
550
|
+
--shimmer-image,
|
|
551
|
+
linear-gradient(
|
|
552
|
+
calc(90deg + var(--shimmer-angle)),
|
|
553
|
+
var(--_base) calc(50% - var(--_spread)),
|
|
554
|
+
color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * 0.5),
|
|
555
|
+
var(--_highlight) 50%,
|
|
556
|
+
color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * 0.5),
|
|
557
|
+
var(--_base) calc(50% + var(--_spread))
|
|
558
|
+
)
|
|
561
559
|
);
|
|
562
560
|
background-repeat: no-repeat;
|
|
563
561
|
background-size: calc(200% + var(--_spread) * 2) 100%;
|
|
@@ -566,59 +564,58 @@
|
|
|
566
564
|
-webkit-background-clip: text;
|
|
567
565
|
-webkit-text-fill-color: var(--shimmer-text-fill, transparent);
|
|
568
566
|
animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
|
|
569
|
-
|
|
567
|
+
|
|
570
568
|
@variant dark {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
569
|
+
--_highlight: var(
|
|
570
|
+
--shimmer-color,
|
|
571
|
+
oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4))
|
|
572
|
+
);
|
|
575
573
|
}
|
|
576
|
-
|
|
574
|
+
|
|
577
575
|
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
578
|
-
|
|
576
|
+
animation-direction: reverse;
|
|
579
577
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
@utility shimmer-once {
|
|
583
581
|
animation-iteration-count: 1;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
@utility shimmer-reverse {
|
|
587
585
|
animation-direction: reverse;
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
@utility shimmer-none {
|
|
591
589
|
--shimmer-image: none;
|
|
592
590
|
--shimmer-text-fill: currentColor;
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
@utility shimmer-color-* {
|
|
596
594
|
--shimmer-color: --value(--color, [color]);
|
|
597
595
|
--shimmer-color: color-mix(
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
596
|
+
in oklch,
|
|
597
|
+
--value(--color, [color]) calc(--modifier(integer) * 1%),
|
|
598
|
+
transparent
|
|
601
599
|
);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
@utility shimmer-duration-* {
|
|
605
603
|
--shimmer-duration: calc(--value(integer) * 1ms);
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
@utility shimmer-spread-* {
|
|
609
607
|
--shimmer-spread: calc(var(--spacing) * --value(integer));
|
|
610
608
|
--shimmer-spread: --value([length], [percentage]);
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@utility shimmer-angle-* {
|
|
614
612
|
--shimmer-angle: calc(--value(integer) * 1deg);
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
@media (prefers-reduced-motion: reduce) {
|
|
618
616
|
.shimmer {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
617
|
+
animation: none;
|
|
618
|
+
background-image: none;
|
|
619
|
+
-webkit-text-fill-color: currentColor;
|
|
622
620
|
}
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../magic-string.es-DOSk4bYL.mjs";import{twMerge as t}from"
|
|
1
|
+
import{t as e}from"../../magic-string.es-DOSk4bYL.mjs";import{twMerge as t}from"cn";import{parse as n}from"svelte/compiler";function r(e,n,r){let i=e;return i=n===`inverted`||n===`inverted-translucent`?i.replace(/cn-menu-target/g,`dark`):i.replace(/cn-menu-target/g,``),i=r?t(i,`animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`).replace(/\s*\bcn-menu-translucent\b\s*/g,` `).trim():i.replace(/cn-menu-translucent/g,``),i=i.replace(/\s{2,}/g,` `).replace(/^\s+|\s+$/g,``),{newText:i}}function i(e,t){if(e)for(let n of e)t(n),i(n.fragment?.nodes??n.nodes,t)}const a=async({content:t,filePath:a,config:o})=>{let s=o.menuColor??`default`,c=s===`default-translucent`||s===`inverted-translucent`;if(!t.includes(`cn-menu-target`)&&!t.includes(`cn-menu-translucent`)||!a.endsWith(`.svelte`))return{content:t};let l;try{l=n(t,{filename:a,modern:!0})}catch{return{content:t}}let u=new e(t);i(l.fragment?.nodes,e=>{for(let n of e.attributes??[]){if(n.name!==`class`)continue;let e=n.value;if(e){if(Array.isArray(e)){let t=e.filter(e=>typeof e==`object`&&!!e&&`data`in e).map(e=>e.data??``).join(``);if(!t.includes(`cn-menu-target`)&&!t.includes(`cn-menu-translucent`))continue;let{newText:n}=r(t,s,c);for(let t of e)if(t.start!=null&&t.end!=null){u.overwrite(t.start,t.end,n);break}continue}if(typeof e==`object`&&e&&`expression`in e){let n=e.expression;if(!n||n.type!==`CallExpression`)continue;let i=n.arguments;if(!i)continue;let a=n.start,o=n.end;if(a==null||o==null)continue;let l=t.slice(a,o);if(!l.includes(`cn-menu-target`)&&!l.includes(`cn-menu-translucent`))continue;let d=[];for(let e of i){if(e.type!==`Literal`||typeof e.value!=`string`)continue;let t=e.value;if(!t.includes(`cn-menu-target`)&&!t.includes(`cn-menu-translucent`))continue;let{newText:n}=r(t,s,c);if(e.start!=null&&e.end!=null){let r=(e.raw??JSON.stringify(t)).startsWith(`'`)?`'`:`"`;d.push({start:e.start,end:e.end,replacement:n===``?`""`:`${r}${n}${r}`})}}for(let e of d)u.overwrite(e.start,e.end,e.replacement)}}}});let d=u.toString();return d=d.replace(/,\s*""\s*,/g,`,`),d=d.replace(/\(\s*""\s*,\s*/g,`(`),d=d.replace(/,\s*""\s*\)/g,`)`),d=d.replace(/cn\s*\(\s*\)/g,`cn()`),{content:d}};export{a as transformMenu};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shadcn-svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Add components to your apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"commander": "^14.0.0",
|
|
80
80
|
"node-fetch-native": "^1.6.4",
|
|
81
81
|
"postcss": "^8.5.10",
|
|
82
|
-
"
|
|
82
|
+
"cn": "^0.3.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@clack/prompts": "^1.1.0",
|