shadcn-svelte
Advanced tools
| const e=`https://shadcn-svelte.com`,t=`https://tw3.shadcn-svelte.com`,n=`${e}/registry`,r=[`components`,`ui`,`hooks`,`utils`,`lib`],i=r.reduce((e,t)=>(e[t]={placeholder:`$${t.toUpperCase()}$`,defaultPath:t===`utils`?`$lib/utils`:`$lib/registry/${t}`},e),{});export{t as a,e as i,i as n,n as r,r as t}; |
| function e(){return` | ||
| @import "tailwindcss"; | ||
| @custom-variant dark (&:is(.dark *)); | ||
| `}const t={"@custom-variant data-open":{'&:where([data-state="open"]), &:where([data-open]:not([data-open="false"]))':{"@slot":{}}},"@custom-variant data-closed":{'&:where([data-state="closed"]), &:where([data-closed]:not([data-closed="false"]))':{"@slot":{}}},"@custom-variant data-checked":{'&:where([data-state="checked"]), &:where([data-checked]:not([data-checked="false"]))':{"@slot":{}}},"@custom-variant data-unchecked":{'&:where([data-state="unchecked"]), &:where([data-unchecked]:not([data-unchecked="false"]))':{"@slot":{}}},"@custom-variant data-selected":{"&:where([data-selected])":{"@slot":{}}},"@custom-variant data-disabled":{'&:where([data-disabled="true"]), &:where([data-disabled]:not([data-disabled="false"]))':{"@slot":{}}},"@custom-variant data-active":{'&:where([data-state="active"]), &:where([data-active]:not([data-active="false"]))':{"@slot":{}}},"@custom-variant data-horizontal":{'&:where([data-orientation="horizontal"])':{"@slot":{}}},"@custom-variant data-vertical":{'&:where([data-orientation="vertical"])':{"@slot":{}}},"@utility no-scrollbar":{"-ms-overflow-style":`none`,"scrollbar-width":`none`,"&::-webkit-scrollbar":{display:`none`}}};export{e as n,t}; |
| import { z } from "zod"; | ||
| //#region src/utils/config/schema.d.ts | ||
| type ResolvedConfig = z.infer<typeof resolvedConfigSchema>; | ||
| declare const resolvedConfigSchema: z.ZodObject<{ | ||
| aliases: z.ZodObject<{ | ||
| components: z.ZodString; | ||
| utils: z.ZodString; | ||
| ui: z.ZodDefault<z.ZodString>; | ||
| hooks: z.ZodDefault<z.ZodString>; | ||
| lib: z.ZodDefault<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| $schema: z.ZodOptional<z.ZodString>; | ||
| tailwind: z.ZodObject<{ | ||
| css: z.ZodString; | ||
| baseColor: z.ZodString; | ||
| }, z.core.$strip>; | ||
| typescript: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ | ||
| config: z.ZodString; | ||
| }, z.core.$strip>]>>; | ||
| registry: z.ZodDefault<z.ZodString>; | ||
| sveltekit: z.ZodBoolean; | ||
| resolvedPaths: z.ZodObject<{ | ||
| cwd: z.ZodString; | ||
| tailwindCss: z.ZodString; | ||
| utils: z.ZodString; | ||
| components: z.ZodString; | ||
| hooks: z.ZodString; | ||
| ui: z.ZodString; | ||
| lib: z.ZodString; | ||
| }, z.core.$strip>; | ||
| style: z.ZodDefault<z.ZodString>; | ||
| iconLibrary: z.ZodDefault<z.ZodEnum<{ | ||
| lucide: "lucide"; | ||
| tabler: "tabler"; | ||
| hugeicons: "hugeicons"; | ||
| phosphor: "phosphor"; | ||
| remixicon: "remixicon"; | ||
| }>>; | ||
| menuColor: z.ZodDefault<z.ZodEnum<{ | ||
| default: "default"; | ||
| inverted: "inverted"; | ||
| "default-translucent": "default-translucent"; | ||
| "inverted-translucent": "inverted-translucent"; | ||
| }>>; | ||
| menuAccent: z.ZodDefault<z.ZodEnum<{ | ||
| bold: "bold"; | ||
| subtle: "subtle"; | ||
| }>>; | ||
| }, z.core.$strip>; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-strip-types.d.ts | ||
| declare const transformStripTypes: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-icons.d.ts | ||
| declare const transformIcons: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-imports.d.ts | ||
| declare const transformImports: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-menu.d.ts | ||
| /** | ||
| * Transforms cn-menu-target and cn-menu-translucent classes based on config.menuColor. | ||
| * If menuColor is "inverted", replaces cn-menu-target with "dark" and removes cn-menu-translucent. | ||
| * If menuColor is "default-translucent", removes cn-menu-target and inlines cn-menu-translucent styles. | ||
| * If menuColor is "inverted-translucent", replaces cn-menu-target with "dark" and inlines cn-menu-translucent styles. | ||
| * Otherwise, removes both cn-menu-target and cn-menu-translucent. | ||
| */ | ||
| declare const transformMenu: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/index.d.ts | ||
| type TransformOptions = { | ||
| content: string; | ||
| filePath: string; | ||
| config: ResolvedConfig; | ||
| }; | ||
| type TransformerResult = { | ||
| content: string; | ||
| dependencies: string[]; | ||
| devDependencies: string[]; | ||
| filePath: string; | ||
| }; | ||
| type Transformer = (opts: TransformOptions) => Promise<Partial<TransformerResult>>; | ||
| declare function transform(opts: TransformOptions, transformers: (Transformer | false | undefined)[]): Promise<TransformerResult>; | ||
| //#endregion | ||
| export { transformMenu as a, transformStripTypes as c, transform as i, Transformer as n, transformImports as o, TransformerResult as r, transformIcons as s, TransformOptions as t }; |
Sorry, the diff of this file is too big to display
| var e=44,t=59,n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,r=new Uint8Array(64),i=new Uint8Array(128);for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r[e]=t,i[t]=e}function a(e,t,n){let i=t-n;i=i<0?-i<<1|1:i<<1;do{let t=i&31;i>>>=5,i>0&&(t|=32),e.write(r[t])}while(i>0);return t}var o=1024*16,s=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},c=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(o)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===o&&(this.out+=s.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+s.decode(e.subarray(0,n)):t}};function l(n){let r=new c,i=0,o=0,s=0,l=0;for(let c=0;c<n.length;c++){let u=n[c];if(c>0&&r.write(t),u.length===0)continue;let d=0;for(let t=0;t<u.length;t++){let n=u[t];t>0&&r.write(e),d=a(r,n[0],d),n.length!==1&&(i=a(r,n[1],i),o=a(r,n[2],o),s=a(r,n[3],s),n.length!==4&&(l=a(r,n[4],l)))}}return r.flush()}var u=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}},d=class e{constructor(e,t,n){this.start=e,this.end=t,this.original=n,this.intro=``,this.outro=``,this.content=n,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro+=e}clone(){let t=new e(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;for(;t;)e(t),t=t.next}eachPrevious(e){let t=this;for(;t;)e(t),t=t.previous}edit(e,t,n){return this.content=e,n||(this.intro=``,this.outro=``),this.storeName=t,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro=``,this.outro=``,this.edited&&=(this.content=this.original,this.storeName=!1,!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let a=new e(t,this.end,i);return a.outro=this.outro,this.outro=``,this.end=t,this.edited?(a.edit(``,!1),this.content=``):this.content=r,a.next=this.next,a.next&&(a.next.previous=a),a.previous=this,this.next=a,a}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,``),this.outro.length)return!0;let t=this.content.replace(e,``);if(t.length)return t!==this.content&&(this.split(this.start+t.length).edit(``,void 0,!0),this.edited&&this.edit(t,this.storeName,!0)),!0;if(this.edit(``,void 0,!0),this.intro=this.intro.replace(e,``),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,``),this.intro.length)return!0;let t=this.content.replace(e,``);if(t.length){if(t!==this.content){let e=this.split(this.end-t.length);this.edited&&e.edit(t,this.storeName,!0),this.edit(``,void 0,!0)}return!0}else if(this.edit(``,void 0,!0),this.outro=this.outro.replace(e,``),this.outro.length)return!0}};function f(){return typeof globalThis<`u`&&typeof globalThis.btoa==`function`?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer==`function`?e=>Buffer.from(e,`utf-8`).toString(`base64`):()=>{throw Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}const p=f();var m=class{constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=l(e.mappings),e.x_google_ignoreList!==void 0&&(this.x_google_ignoreList=e.x_google_ignoreList),e.debugId!==void 0&&(this.debugId=e.debugId)}toString(){return JSON.stringify(this)}toUrl(){return`data:application/json;charset=utf-8;base64,`+p(this.toString())}};function h(e){let t=e.split(` | ||
| `),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return` `;let i=r.reduce((e,t)=>{let n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return Array(i+1).join(` `)}function g(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let e=n.length;for(;e--;)n[e]=`..`}return n.concat(r).join(`/`)}const _=Object.prototype.toString;function v(e){return _.call(e)===`[object Object]`}function y(e){let t=e.split(` | ||
| `),n=[];for(let e=0,r=0;e<t.length;e++)n.push(r),r+=t[e].length+1;return function(e){let t=0,r=n.length;for(;t<r;){let i=t+r>>1;e<n[i]?r=i:t=i+1}let i=t-1;return{line:i,column:e-n[i]}}}const b=/\w/;var x=class{constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,t,n,r){if(t.length){let i=t.length-1,a=t.indexOf(` | ||
| `,0),o=-1;for(;a>=0&&i>a;){let i=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&i.push(r),this.rawSegments.push(i),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=a,a=t.indexOf(` | ||
| `,a+1)}let s=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&s.push(r),this.rawSegments.push(s),this.advance(t.slice(o+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(t));this.pending=null}addUneditedChunk(e,t,n,r,i){let a=t.start,o=!0,s=!1;for(;a<t.end;){if(n[a]===` | ||
| `)r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=!0,s=!1;else{if(this.hires||o||i.has(a)){let t=[this.generatedCodeColumn,e,r.line,r.column];this.hires===`boundary`?b.test(n[a])?s||=(this.rawSegments.push(t),!0):(this.rawSegments.push(t),s=!1):this.rawSegments.push(t)}r.column+=1,this.generatedCodeColumn+=1,o=!1}a+=1}this.pending=null}advance(e){if(!e)return;let t=e.split(` | ||
| `);if(t.length>1){for(let e=0;e<t.length-1;e++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}};const S={insertLeft:!1,insertRight:!1,storeName:!1};var C=class e{constructor(e,t={}){let n=new d(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:``},intro:{writable:!0,value:``},firstChunk:{writable:!0,value:n},lastChunk:{writable:!0,value:n},lastSearchedChunk:{writable:!0,value:n},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:t.filename},indentExclusionRanges:{writable:!0,value:t.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new u},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:t.ignoreList},offset:{writable:!0,value:t.offset||0}}),this.byStart[0]=n,this.byEnd[e.length]=n}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.outro+=e,this}appendLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.appendLeft(t):this.intro+=t,this}appendRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.appendRight(t):this.outro+=t,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let e=n.next,i=e&&e.clone();i&&(r.next=i,i.previous=r,r=i),n=e}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new u(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(e){e||={};let t=Object.keys(this.storedNames),n=new x(e.hires),r=y(this.original);return this.intro&&n.advance(this.intro),this.firstChunk.eachNext(e=>{let i=r(e.start);e.intro.length&&n.advance(e.intro),e.edited?n.addEdit(0,e.content,i,e.storeName?t.indexOf(e.original):-1):n.addUneditedChunk(0,e,this.original,i,this.sourcemapLocations),e.outro.length&&n.advance(e.outro)}),this.outro&&n.advance(this.outro),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?g(e.file||``,e.source):e.file||``],sourcesContent:e.includeContent?[this.original]:void 0,names:t,mappings:n.raw,x_google_ignoreList:this.ignoreList?[0]:void 0}}generateMap(e){return new m(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=h(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?` `:this.indentStr}indent(e,t){let n=/^[^\r\n]/gm;if(v(e)&&(t=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||` `),e===``)return this;t||={};let r={};t.exclude&&(typeof t.exclude[0]==`number`?[t.exclude]:t.exclude).forEach(e=>{for(let t=e[0];t<e[1];t+=1)r[t]=!0});let i=t.indentStart!==!1,a=t=>i?`${e}${t}`:(i=!0,t);this.intro=this.intro.replace(n,a);let o=0,s=this.firstChunk;for(;s;){let t=s.end;if(s.edited)r[o]||(s.content=s.content.replace(n,a),s.content.length&&(i=s.content[s.content.length-1]===` | ||
| `));else for(o=s.start;o<t;){if(!r[o]){let t=this.original[o];t===` | ||
| `?i=!0:t!==`\r`&&i&&(i=!1,o===s.start?s.prependRight(e):(this._splitChunk(s,o),s=s.next,s.prependRight(e)))}o+=1}o=s.end,s=s.next}return this.outro=this.outro.replace(n,a),this}insert(){throw Error(`magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)`)}insertLeft(e,t){return S.insertLeft||=(console.warn(`magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead`),!0),this.appendLeft(e,t)}insertRight(e,t){return S.insertRight||=(console.warn(`magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead`),!0),this.prependRight(e,t)}move(e,t,n){if(e+=this.offset,t+=this.offset,n+=this.offset,n>=e&&n<=t)throw Error(`Cannot move a selection inside itself`);this._split(e),this._split(t),this._split(n);let r=this.byStart[e],i=this.byEnd[t],a=r.previous,o=i.next,s=this.byStart[n];if(!s&&i===this.lastChunk)return this;let c=s?s.previous:this.lastChunk;return a&&(a.next=o),o&&(o.previous=a),c&&(c.next=r),s&&(s.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,i.next=s||null,c||(this.firstChunk=r),s||(this.lastChunk=i),this}overwrite(e,t,n,r){return r||={},this.update(e,t,n,{...r,overwrite:!r.contentOnly})}update(e,t,n,r){if(e+=this.offset,t+=this.offset,typeof n!=`string`)throw TypeError(`replacement content must be a string`);if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(t>this.original.length)throw Error(`end is out of bounds`);if(e===t)throw Error(`Cannot overwrite a zero-length range – use appendLeft or prependRight instead`);this._split(e),this._split(t),r===!0&&(S.storeName||=(console.warn(`The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string`),!0),r={storeName:!0});let i=r===void 0?!1:r.storeName,a=r===void 0?!1:r.overwrite;if(i){let n=this.original.slice(e,t);Object.defineProperty(this.storedNames,n,{writable:!0,value:!0,enumerable:!0})}let o=this.byStart[e],s=this.byEnd[t];if(o){let e=o;for(;e!==s;){if(e.next!==this.byStart[e.end])throw Error(`Cannot overwrite across a split point`);e=e.next,e.edit(``,!1)}o.edit(n,i,!a)}else{let r=new d(e,t,``).edit(n,i);s.next=r,r.previous=s}return this}prepend(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.intro=e+this.intro,this}prependLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this}remove(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.intro=``,n.outro=``,n.edit(``),n=t>n.end?this.byStart[n.end]:null;return this}reset(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.reset(),n=t>n.end?this.byStart[n.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:``}lastLine(){let e=this.outro.lastIndexOf(` | ||
| `);if(e!==-1)return this.outro.substr(e+1);let t=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(e=n.outro.lastIndexOf(` | ||
| `),e!==-1)return n.outro.substr(e+1)+t;t=n.outro+t}if(n.content.length>0){if(e=n.content.lastIndexOf(` | ||
| `),e!==-1)return n.content.substr(e+1)+t;t=n.content+t}if(n.intro.length>0){if(e=n.intro.lastIndexOf(` | ||
| `),e!==-1)return n.intro.substr(e+1)+t;t=n.intro+t}}while(n=n.previous);return e=this.intro.lastIndexOf(` | ||
| `),e===-1?this.intro+t:this.intro.substr(e+1)+t}slice(e=0,t=this.original.length-this.offset){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}let n=``,r=this.firstChunk;for(;r&&(r.start>e||r.end<=e);){if(r.start<t&&r.end>=t)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw Error(`Cannot use replaced character ${e} as slice start anchor.`);let i=r;for(;r;){r.intro&&(i!==r||r.start===e)&&(n+=r.intro);let a=r.start<t&&r.end>=t;if(a&&r.edited&&r.end!==t)throw Error(`Cannot use replaced character ${t} as slice end anchor.`);let o=i===r?e-r.start:0,s=a?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,s),r.outro&&(!a||r.end===t)&&(n+=r.outro),a)break;r=r.next}return n}snip(e,t){let n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk,n=t,r=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);if(t=r?this.byStart[t.end]:this.byEnd[t.start],t===n)return;n=t}}_splitChunk(e,t){if(e.edited&&e.content.length){let n=y(this.original)(t);throw Error(`Cannot split a chunk that has already been edited (${n.line}:${n.column} – "${e.original}")`)}let n=e.split(t);return this.byEnd[t]=e,this.byStart[t]=n,this.byEnd[n.end]=n,e===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1;while(e=e.next);return!0}length(){let e=this.firstChunk,t=0;do t+=e.intro.length+e.content.length+e.outro.length;while(e=e.next);return t}trimLines(){return this.trim(`[\\r\\n]`)}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){let t=RegExp((e||`\\s`)+`+$`);if(this.outro=this.outro.replace(t,``),this.outro.length)return!0;let n=this.lastChunk;do{let e=n.end,r=n.trimEnd(t);if(n.end!==e&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.previous}while(n);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){let t=RegExp(`^`+(e||`\\s`)+`+`);if(this.intro=this.intro.replace(t,``),this.intro.length)return!0;let n=this.firstChunk;do{let e=n.end,r=n.trimStart(t);if(n.end!==e&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.next}while(n);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function n(e,n){return typeof t==`string`?t.replace(/\$(\$|&|\d+)/g,(t,n)=>n===`$`?`$`:n===`&`?e[0]:+n<e.length?e[+n]:`$${n}`):t(...e,e.index,n,e.groups)}function r(e,t){let n,r=[];for(;n=e.exec(t);)r.push(n);return r}if(e.global)r(e,this.original).forEach(e=>{if(e.index!=null){let t=n(e,this.original);t!==e[0]&&this.overwrite(e.index,e.index+e[0].length,t)}});else{let t=this.original.match(e);if(t&&t.index!=null){let e=n(t,this.original);e!==t[0]&&this.overwrite(t.index,t.index+t[0].length,e)}}return this}_replaceString(e,t){let{original:n}=this,r=n.indexOf(e);return r!==-1&&(typeof t==`function`&&(t=t(e,r,n)),e!==t&&this.overwrite(r,r+e.length,t)),this}replace(e,t){return typeof e==`string`?this._replaceString(e,t):this._replaceRegexp(e,t)}_replaceAllString(e,t){let{original:n}=this,r=e.length;for(let i=n.indexOf(e);i!==-1;i=n.indexOf(e,i+r)){let e=n.slice(i,i+r),a=t;typeof t==`function`&&(a=t(e,i,n)),e!==a&&this.overwrite(i,i+r,a)}return this}replaceAll(e,t){if(typeof e==`string`)return this._replaceAllString(e,t);if(!e.global)throw TypeError(`MagicString.prototype.replaceAll called with a non-global RegExp argument`);return this._replaceRegexp(e,t)}};export{C as t}; |
| import{a as e,t}from"./libraries-UukRrwOg.mjs";const n=[`nova`,`vega`,`maia`,`lyra`,`mira`],r={neutral:{name:`Neutral`,color:`#737373`},stone:{name:`Stone`,color:`#79716B`},zinc:{name:`Zinc`,color:`#71717B`},mauve:{name:`Mauve`,color:`#79697B`},olive:{name:`Olive`,color:`#7C7C67`},mist:{name:`Mist`,color:`#67787C`},taupe:{name:`Taupe`,color:`#7C6D67`}},i=e(r),a={neutral:{name:`Neutral`,color:`#737373`},stone:{name:`Stone`,color:`#78716c`},zinc:{name:`Zinc`,color:`#71717a`},amber:{name:`Amber`,color:`#FD9A00`},blue:{name:`Blue`,color:`#2B7FFF`},cyan:{name:`Cyan`,color:`#00B8DB`},emerald:{name:`Emerald`,color:`#00BC7D`},fuchsia:{name:`Fuchsia`,color:`#E12AFB`},green:{name:`Green`,color:`#00C950`},indigo:{name:`Indigo`,color:`#615FFF`},lime:{name:`Lime`,color:`#7CCF00`},orange:{name:`Orange`,color:`#FF6900`},pink:{name:`Pink`,color:`#F6339A`},purple:{name:`Purple`,color:`#AD46FF`},red:{name:`Red`,color:`#FB2C36`},rose:{name:`Rose`,color:`#FF2056`},sky:{name:`Sky`,color:`#00A6F4`},teal:{name:`Teal`,color:`#00BBA7`},violet:{name:`Violet`,color:`#8E51FF`},yellow:{name:`Yellow`,color:`#EFB100`},mauve:{name:`Mauve`,color:`#79697b`},olive:{name:`Olive`,color:`#7c7c67`},mist:{name:`Mist`,color:`#67787c`},taupe:{name:`Taupe`,color:`#7c6d67`}},o=e(a),s=e(t),c=[`inter`,`noto-sans`,`nunito-sans`,`figtree`,`roboto`,`raleway`,`dm-sans`,`public-sans`,`outfit`,`jetbrains-mono`,`geist`,`geist-mono`,`lora`,`merriweather`,`playfair-display`,`noto-serif`,`roboto-slab`],l={default:{name:`default`,label:`Default`,value:`0.5rem`},none:{name:`none`,label:`None`,value:`0rem`},small:{name:`small`,label:`Small`,value:`0.45rem`},medium:{name:`medium`,label:`Medium`,value:`0.625rem`},large:{name:`large`,label:`Large`,value:`0.875rem`}},u=e(l),d=[`subtle`,`bold`],f=[`default`,`inverted`,`default-translucent`,`inverted-translucent`],p=[{key:`menuColor`,values:f,bits:3},{key:`menuAccent`,values:d,bits:3},{key:`radius`,values:u,bits:4},{key:`font`,values:c,bits:6},{key:`iconLibrary`,values:s,bits:6},{key:`theme`,values:o,bits:6},{key:`baseColor`,values:i,bits:6},{key:`style`,values:n,bits:6}],m=Object.fromEntries(p.map(e=>[e.key,e.values[0]])),h=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function g(e){if(e===0)return`0`;let t=``,n=e;for(;n>0;)t=h[n%62]+t,n=Math.floor(n/62);return t}function _(e){let t=0;for(let n=0;n<e.length;n++){let r=h.indexOf(e[n]);if(r===-1)return-1;t=t*62+r}return t}function v(e){let t={...m,...e},n=0,r=0;for(let e of p){let i=e.values.indexOf(t[e.key]);n+=(i===-1?0:i)*2**r,r+=e.bits}return`a`+g(n)}function y(e){if(!e||e.length<2||e[0]!==`a`)return null;let t=_(e.slice(1));if(t<0)return null;let n={},r=0;for(let e of p){let i=Math.floor(t/2**r)%2**e.bits;n[e.key]=i<e.values.length?e.values[i]:e.values[0],r+=e.bits}return n}function b(e){if(!e||e.length<2||e.length>10||e[0]!==`a`)return!1;for(let t=1;t<e.length;t++)if(h.indexOf(e[t])===-1)return!1;return!0}function x(e){return y(e)!==null}function S(){let e=e=>e[Math.floor(Math.random()*e.length)];return Object.fromEntries(p.map(t=>[t.key,e(t.values)]))}function C(){return v(S())}export{b as _,s as a,l as c,o as d,y as f,C as g,S as h,c as i,n as l,_ as m,r as n,d as o,v as p,i as r,f as s,m as t,a as u,x as v,g as y}; |
| import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,p as l,u,v as d,y as f}from"./libraries-UukRrwOg.mjs";import{i as p}from"./constants-Cg45v4Km.mjs";import{a as m,o as h,r as g,s as _}from"./preset-Ccv1xFuI.mjs";const v=g,y=h,b=_,x={$schema:`${p}/schema.json`,aliases:{lib:`$lib`,utils:`$lib/utils`,hooks:`$lib/hooks`,components:`$lib/components`,ui:`$lib/components/ui`},tailwind:{baseColor:`slate`,css:`src/app.css`},typescript:!0,registry:`${p}/registry`,style:`nova`,iconLibrary:`lucide`,menuColor:`default`,menuAccent:`subtle`},S=e=>e.endsWith(`/`)?e.slice(0,-1):e,C=e=>f(`Missing aliases.${e} alias`),w=a({$schema:f().optional(),tailwind:a({css:f(`Missing tailwind.css path`),baseColor:f(`Missing tailwind.baseColor field`)},`Missing tailwind object`),aliases:a({components:C(`components`),utils:C(`utils`)},`Missing aliases object`),typescript:t([i(),a({config:f()})],`Invalid typescript field. Must either be 'true', 'false', or '{ "config": "path/to/tsconfig.json" }'`).default(x.typescript)}),T=w.extend({style:f().optional()}),E=w.extend({aliases:w.shape.aliases.extend({ui:C(`ui`).default(x.aliases.ui),hooks:C(`hooks`).default(x.aliases.hooks),lib:C(`lib`).default(x.aliases.lib)}),registry:f().default(x.registry),style:f().optional(),iconLibrary:s(m).optional(),menuColor:s(b).optional(),menuAccent:s(y).optional()}),D=a({...T.shape,...E.shape,aliases:a({...T.shape.aliases.shape,...E.shape.aliases.shape})}),O=D.extend({sveltekit:i(),resolvedPaths:a({cwd:f(),tailwindCss:f(),utils:f(),components:f(),hooks:f(),ui:f(),lib:f()}),style:f().default(x.style),iconLibrary:s(m).default(x.iconLibrary),menuColor:s(b).default(x.menuColor),menuAccent:s(y).default(x.menuAccent)}),k=[`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:base`,`registry:font`],A=[`registry:block`],j=[`registry:example`,`registry:internal`],M=s([...k,...A,...j]).describe(`The type of the item. Used to determine the type and target path of the item when resolved for a project.`),N=s(k).describe(`The type of the file. Used to resolve the file's path for a project.`),P=a({content:f().describe(`The content of the file.`),type:N,target:f().describe(`The target path of the file. This is where the file will be installed.`)}).describe(`The main payload of the registry item. This is an array of files that are part of the registry item. Each file is an object with a target, type, and content.`),F=f().array().describe(`An array of registry items that this item depends on. Use the name of the item to reference shadcn/ui components and urls to reference other registries.`),I=a({name:f().describe(`The name of the item. Used to identify the item in the registry. It should be unique for your registry.`),title:f().optional().describe(`The human-readable title for your registry item. Keep it short and descriptive.`),type:M,author:f().min(2,`Author name must be at least 2 characters`).optional().describe(`The author of the item. Recommended format: username <url>`),description:f().optional().describe(`The description of the item. Used to provide a brief overview of the item.`),dependencies:f().array().optional().describe(`An array of NPM dependencies required by the registry item.`),devDependencies:f().array().optional().describe(`An array of NPM dev dependencies required by the registry item.`),registryDependencies:e(F),meta:d(f(),u()).optional().describe(`Additional metadata for the registry item. This is an object with any key value pairs.`)}),L=I.extend({relativeUrl:f()}),R=r(L),z=d(f(),f()),B=a({cssVars:a({light:z,dark:z})}),V=a({theme:e(z).describe(`CSS variables for the @theme directive. For Tailwind v4 projects only. Use tailwind for older projects.`),light:e(z).describe(`CSS variables for the light theme.`),dark:e(z).describe(`CSS variables for the dark theme.`)}).describe(`The css variables for the registry item. This will be merged with the project's css variables.`),H=d(f().describe(`Direct CSS string (e.g., 'font-family: sans-serif; line-height: 1.5;')`),c(()=>t([f().describe(`CSS property value (e.g., 'blue', 'var(--color-primary)')`),H.describe(`CSS property value for nested rule`)])).describe(`CSS properties or nested selectors`)).describe(`CSS definitions to be added to the project's CSS file. Supports at-rules, selectors, nested rules, utilities, layers, and more.`),U=a({$schema:f().optional(),...I.shape,docs:f().optional().describe(`The documentation for the registry item. This is a markdown string.`),categories:f().array().optional().describe(`The categories of the registry item. This is an array of strings.`),css:e(H),cssVars:e(V),files:r(P).optional()}),W=a({family:f(),provider:o(`google`),import:f(),variable:f(),weight:r(f()).optional(),subsets:r(f()).optional(),selector:f().optional(),dependency:f().optional()}),G=l(`type`,[U.extend({type:o(`registry:base`),config:J(D).optional()}),U.extend({type:o(`registry:font`),font:W}),U.extend({type:M.exclude([`registry:base`,`registry:font`])})]),K=a({$schema:f().optional(),name:f().describe(`The name of the registry.`),homepage:f().describe(`The homepage of the registry.`),overrideDependencies:f().array().optional().describe("An array of NPM dependencies that should have their versions overridden during registry `build`."),aliases:a({lib:f().optional(),ui:f().optional(),components:f().optional(),utils:f().optional(),hooks:f().optional()}).optional().describe("Defines which internal import paths should be transformed during registry `build`."),items:I.extend({files:P.partial().extend({path:f().describe(`The path to the file relative to the registry root.`),type:N}).array().describe("An array of files that instructs the `build` command on how to locate and parse the registry files."),registryDependencies:F,cssVars:e(V),css:e(H),font:e(W)}).array().describe(`Defines a custom component registry.`)}),q=a({$schema:f().optional(),style:f().optional().describe(`DEPRECATED IN TAILWIND v4! The style for your components. This cannot be changed after initialization.`),tailwind:a({css:f().describe(`Path to the CSS file that imports Tailwind CSS into your project.`),baseColor:f().describe(`Used to generate the default color palette for your components. This cannot be changed after initialization.`),config:f().optional().describe("DEPRECATED IN TAILWIND v4! The path to your `tailwind.config.[js|ts]` file.")}),aliases:a({components:f().describe(`Import alias for your components.`),utils:f().describe(`Import alias for your utility functions.`),ui:f().optional().describe("Import alias for your UI components. Defaults to `$lib/components/ui`."),hooks:f().optional().describe("Import alias for your hooks. Defaults to `$lib/hooks`."),lib:f().optional().describe("Import alias for your library, which is typically where you store your components, utils, hooks, etc. Defaults to `$lib`.")}).describe("The CLI uses these values and the `alias` config from your `svelte.config.js` file to place generated components in the correct location."),registry:f().optional().describe(`The registry URL tells the CLI where to fetch the shadcn-svelte components/registry from. You can pin this to a specific preview release or your own fork of the registry.`),typescript:t([i(),a({config:f().describe(`Path to the tsconfig/jsconfig file.`)})]).optional().describe("Used to determine if Typescript is used for this project. When set to `false`, `.js` files will be installed instead. Defaults to `true`.")});function J(t){let r={};return Object.entries(t.shape).forEach(([t,i])=>{i instanceof n?r[t]=J(i).optional():r[t]=e(i)}),a(r)}export{R as a,W as c,v as d,x as f,S as g,O as h,L as i,G as l,D as m,J as n,U as o,E as p,B as r,P as s,q as t,K as u}; |
| var e=class{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,t,n,r){e&&t&&(n==null?e[t]=r:e[t][n]=r)}remove(e,t,n){e&&t&&(n==null?delete e[t]:e[t].splice(n,1))}},t=class extends e{constructor(e,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e},this.enter=e,this.leave=t}visit(e,t,r,i){if(e){if(this.enter){let n=this.should_skip,a=this.should_remove,o=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,t,r,i),this.replacement&&(e=this.replacement,this.replace(t,r,i,e)),this.should_remove&&this.remove(t,r,i);let s=this.should_skip,c=this.should_remove;if(this.should_skip=n,this.should_remove=a,this.replacement=o,s)return e;if(c)return null}let a;for(a in e){let t=e[a];if(t&&typeof t==`object`)if(Array.isArray(t)){let r=t;for(let t=0;t<r.length;t+=1){let i=r[t];n(i)&&(this.visit(i,e,a,t)||t--)}}else n(t)&&this.visit(t,e,a,null)}if(this.leave){let n=this.replacement,a=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,t,r,i),this.replacement&&(e=this.replacement,this.replace(t,r,i,e)),this.should_remove&&this.remove(t,r,i);let o=this.should_remove;if(this.replacement=n,this.should_remove=a,o)return null}}return e}};function n(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function r(e,{enter:n,leave:r}){return new t(n,r).visit(e,null)}export{r as t}; |
| import{t as e}from"./libraries-UukRrwOg.mjs";import{t}from"./src-BM2HK-cR.mjs";import{t as n}from"./magic-string.es-DSnmfwqI.mjs";import{parse as r}from"svelte/compiler";function i(e,t){return new a(e,{cause:t})}var a=class extends Error{constructor(...e){super(...e),this.name=`CLI Error`}},o=class extends Error{constructor(...e){super(...e),this.name=`Config Error`}};const s=async({content:a,filePath:o,config:s})=>{if(!o.endsWith(`.svelte`))return{};let c=new n(a),l=r(a,{filename:o,modern:!0}),u=e[s.iconLibrary],d=[],f=null;if(t(l,{enter:t=>{if(t.type===`Component`&&t.name===`IconPlaceholder`){let n=t.attributes.filter(t=>!Object.keys(e).includes(t.name)),r=t.attributes.find(e=>e.name===s.iconLibrary)?.value[0]?.data;if(!r)throw i(`Couldn't find icon name attribute for ${s.iconLibrary} in ${o}. This is a bug please report it here: https://github.com/huntabyte/shadcn-svelte/issues`);let a=n.map(e=>c.slice(e.start,e.end)).join(` `),l=u.usage({name:r},a);c.overwrite(t.start,t.end,l),d.push({name:r})}else if(t.type===`ImportDeclaration`){let e=t.specifiers[0];e?.type===`ImportDefaultSpecifier`&&e.local.name===`IconPlaceholder`&&(f=t)}}}),f){let e=u.getAdditionalImports?.()??[];for(let t of d)e.push(u.import(t));c.overwrite(f.start,f.end,e.join(` | ||
| `))}return{content:c.toString(),devDependencies:f===null?[]:[...u.packages]}};export{i,a as n,o as r,s as t}; |
| import{n as e,t}from"./constants-Cg45v4Km.mjs";const n=async({content:n,config:r})=>{for(let i of t)n=n.replaceAll(e[i].placeholder,r.aliases[i]);return{content:n}};export{n as t}; |
| import{t as e}from"./magic-string.es-DSnmfwqI.mjs";import{twMerge as t}from"tailwind-merge";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 t}; |
Sorry, the diff of this file is too big to display
| async function e(e,t){let n={content:e.content,dependencies:new Set,devDependencies:new Set,filePath:e.filePath};for(let r of t.filter(e=>e!==void 0&&e!==!1)){let{content:t,dependencies:i,devDependencies:a,filePath:o}=await r({config:e.config,content:n.content,filePath:n.filePath});n.content=t??n.content,i?.forEach(e=>n.dependencies.add(e)),a?.forEach(e=>n.devDependencies.add(e)),n.filePath=o??n.filePath}return{content:n.content,dependencies:Array.from(n.dependencies),devDependencies:Array.from(n.devDependencies),filePath:n.filePath}}export{e as t}; |
| //#region src/utils/css.d.ts | ||
| declare function createGlobalCssFile(): string; | ||
| /** | ||
| * these are the styles that `@import "shadcn/tailwind.css"` adds | ||
| * but that seems like the wrong solution so for the time being we'll add them on init | ||
| */ | ||
| declare const TAILWIND_UTILS: { | ||
| "@custom-variant data-open": { | ||
| '&:where([data-state="open"]), &:where([data-open]:not([data-open="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-closed": { | ||
| '&:where([data-state="closed"]), &:where([data-closed]:not([data-closed="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-checked": { | ||
| '&:where([data-state="checked"]), &:where([data-checked]:not([data-checked="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-unchecked": { | ||
| '&:where([data-state="unchecked"]), &:where([data-unchecked]:not([data-unchecked="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-selected": { | ||
| "&:where([data-selected])": { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-disabled": { | ||
| '&:where([data-disabled="true"]), &:where([data-disabled]:not([data-disabled="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-active": { | ||
| '&:where([data-state="active"]), &:where([data-active]:not([data-active="false"]))': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-horizontal": { | ||
| '&:where([data-orientation="horizontal"])': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@custom-variant data-vertical": { | ||
| '&:where([data-orientation="vertical"])': { | ||
| "@slot": {}; | ||
| }; | ||
| }; | ||
| "@utility no-scrollbar": { | ||
| "-ms-overflow-style": string; | ||
| "scrollbar-width": string; | ||
| "&::-webkit-scrollbar": { | ||
| display: string; | ||
| }; | ||
| }; | ||
| }; | ||
| //#endregion | ||
| export { TAILWIND_UTILS, createGlobalCssFile }; |
| import{n as e,t}from"../css-CKUFqkB9.mjs";export{t as TAILWIND_UTILS,e as createGlobalCssFile}; |
@@ -1,1 +0,1 @@ | ||
| import{t as e}from"../libraries-CCQwMxcx.mjs";export{e as iconLibraries}; | ||
| import{t as e}from"../libraries-UukRrwOg.mjs";export{e as iconLibraries}; |
@@ -162,3 +162,3 @@ //#region src/preset/preset.d.ts | ||
| }; | ||
| declare const PRESET_RADII_KEYS: ("default" | "none" | "small" | "medium" | "large")[]; | ||
| declare const PRESET_RADII_KEYS: ("none" | "default" | "small" | "medium" | "large")[]; | ||
| declare const PRESET_MENU_ACCENTS: readonly ["subtle", "bold"]; | ||
@@ -165,0 +165,0 @@ declare const PRESET_MENU_COLORS: readonly ["default", "inverted", "default-translucent", "inverted-translucent"]; |
@@ -1,1 +0,1 @@ | ||
| import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,v as _,y as v}from"../preset-OLkSDPn4.mjs";export{h as DEFAULT_PRESET_CONFIG,u as PRESET_BASE_COLORS,p as PRESET_BASE_COLOR_KEYS,s as PRESET_FONTS,t as PRESET_ICON_LIBRARIES,d as PRESET_MENU_ACCENTS,m as PRESET_MENU_COLORS,n as PRESET_RADII,c as PRESET_STYLES,g as PRESET_THEMES,r as PRESET_THEME_KEYS,i as decodePreset,f as encodePreset,l as fromBase62,o as generateRandomConfig,a as generateRandomPreset,e as isPresetCode,_ as isValidPreset,v as toBase62}; | ||
| import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,v as _,y as v}from"../preset-Ccv1xFuI.mjs";export{h as DEFAULT_PRESET_CONFIG,u as PRESET_BASE_COLORS,p as PRESET_BASE_COLOR_KEYS,s as PRESET_FONTS,t as PRESET_ICON_LIBRARIES,d as PRESET_MENU_ACCENTS,m as PRESET_MENU_COLORS,n as PRESET_RADII,c as PRESET_STYLES,g as PRESET_THEMES,r as PRESET_THEME_KEYS,i as decodePreset,f as encodePreset,l as fromBase62,o as generateRandomConfig,a as generateRandomPreset,e as isPresetCode,_ as isValidPreset,v as toBase62}; |
@@ -1,1 +0,1 @@ | ||
| import"../constants-Cd6CLVj2.mjs";import"../preset-OLkSDPn4.mjs";import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"../schema-q9HuPqcG.mjs";export{c as componentsJsonSchema,i as naiveDeepPartialify,o as registryBaseColorSchema,n as registryIndexItemSchema,e as registryIndexSchema,a as registryItemCommonSchema,s as registryItemFileSchema,t as registryItemFontSchema,r as registryItemSchema,l as registrySchema}; | ||
| import"../constants-Cg45v4Km.mjs";import"../preset-Ccv1xFuI.mjs";import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"../schema-pOs-GJu0.mjs";export{c as componentsJsonSchema,i as naiveDeepPartialify,o as registryBaseColorSchema,n as registryIndexItemSchema,e as registryIndexSchema,a as registryItemCommonSchema,s as registryItemFileSchema,t as registryItemFontSchema,r as registryItemSchema,l as registrySchema}; |
@@ -1,2 +0,2 @@ | ||
| import { a as transformMenu, c as transformStripTypes, i as transform, n as Transformer, o as transformImports, r as TransformerResult, s as transformIcons, t as TransformOptions } from "../../index-Z2_wxLiz.mjs"; | ||
| import { a as transformMenu, c as transformStripTypes, i as transform, n as Transformer, o as transformImports, r as TransformerResult, s as transformIcons, t as TransformOptions } from "../../index-D4bXUN-E.mjs"; | ||
| export { TransformOptions, Transformer, TransformerResult, transform, transformIcons, transformImports, transformMenu, transformStripTypes }; |
@@ -1,1 +0,1 @@ | ||
| import{t as e}from"../../transform-strip-types-CusS3slj.mjs";import{t}from"../../transform-icons-BU4ryD5X.mjs";import"../../constants-Cd6CLVj2.mjs";import"../../magic-string.es-I1ELJdqB.mjs";import{t as n}from"../../transform-imports-DCifnAhQ.mjs";import{t as r}from"../../transform-menu-BVkdVu8j.mjs";import{t as i}from"../../transformers-rC9mXwMn.mjs";export{i as transform,t as transformIcons,n as transformImports,r as transformMenu,e as transformStripTypes}; | ||
| import{t as e}from"../../transform-strip-types-KwOgC14N.mjs";import{t}from"../../transform-icons-BU5XJbBV.mjs";import"../../constants-Cg45v4Km.mjs";import"../../magic-string.es-DSnmfwqI.mjs";import{t as n}from"../../transform-imports-plkbH-jB.mjs";import{t as r}from"../../transform-menu-h3XyTjqb.mjs";import{t as i}from"../../transformers-Cr-KcpKk.mjs";export{i as transform,t as transformIcons,n as transformImports,r as transformMenu,e as transformStripTypes}; |
@@ -1,2 +0,2 @@ | ||
| import { s as transformIcons } from "../../index-Z2_wxLiz.mjs"; | ||
| import { s as transformIcons } from "../../index-D4bXUN-E.mjs"; | ||
| export { transformIcons }; |
@@ -1,1 +0,1 @@ | ||
| import{t as e}from"../../transform-icons-BU4ryD5X.mjs";import"../../magic-string.es-I1ELJdqB.mjs";export{e as transformIcons}; | ||
| import{t as e}from"../../transform-icons-BU5XJbBV.mjs";import"../../magic-string.es-DSnmfwqI.mjs";export{e as transformIcons}; |
@@ -1,2 +0,2 @@ | ||
| import { o as transformImports } from "../../index-Z2_wxLiz.mjs"; | ||
| import { o as transformImports } from "../../index-D4bXUN-E.mjs"; | ||
| export { transformImports }; |
@@ -1,1 +0,1 @@ | ||
| import"../../constants-Cd6CLVj2.mjs";import{t as e}from"../../transform-imports-DCifnAhQ.mjs";export{e as transformImports}; | ||
| import"../../constants-Cg45v4Km.mjs";import{t as e}from"../../transform-imports-plkbH-jB.mjs";export{e as transformImports}; |
@@ -1,2 +0,2 @@ | ||
| import { a as transformMenu } from "../../index-Z2_wxLiz.mjs"; | ||
| import { a as transformMenu } from "../../index-D4bXUN-E.mjs"; | ||
| export { transformMenu }; |
@@ -1,1 +0,1 @@ | ||
| import"../../magic-string.es-I1ELJdqB.mjs";import{t as e}from"../../transform-menu-BVkdVu8j.mjs";export{e as transformMenu}; | ||
| import"../../magic-string.es-DSnmfwqI.mjs";import{t as e}from"../../transform-menu-h3XyTjqb.mjs";export{e as transformMenu}; |
@@ -1,2 +0,2 @@ | ||
| import { c as transformStripTypes } from "../../index-Z2_wxLiz.mjs"; | ||
| import { c as transformStripTypes } from "../../index-D4bXUN-E.mjs"; | ||
| export { transformStripTypes }; |
@@ -1,1 +0,1 @@ | ||
| import{t as e}from"../../transform-strip-types-CusS3slj.mjs";import"../../magic-string.es-I1ELJdqB.mjs";export{e as transformStripTypes}; | ||
| import{t as e}from"../../transform-strip-types-KwOgC14N.mjs";import"../../magic-string.es-DSnmfwqI.mjs";export{e as transformStripTypes}; |
+5
-1
| { | ||
| "name": "shadcn-svelte", | ||
| "version": "1.2.3", | ||
| "version": "1.2.4", | ||
| "description": "Add components to your apps.", | ||
@@ -30,2 +30,6 @@ "license": "MIT", | ||
| }, | ||
| "./utils/css": { | ||
| "types": "./dist/utils/css.d.mts", | ||
| "default": "./dist/utils/css.mjs" | ||
| }, | ||
| "./transformers": { | ||
@@ -32,0 +36,0 @@ "types": "./dist/utils/transformers/index.d.mts", |
| const e=`https://shadcn-svelte.com`,t=`https://tw3.shadcn-svelte.com`,n=`${e}/registry`,r=[`components`,`ui`,`hooks`,`utils`,`lib`],i=r.reduce((e,t)=>(e[t]={placeholder:`$${t.toUpperCase()}$`,defaultPath:t===`utils`?`$lib/utils`:`$lib/registry/${t}`},e),{});export{t as a,e as i,i as n,n as r,r as t}; |
| import { z } from "zod"; | ||
| //#region src/utils/config/schema.d.ts | ||
| type ResolvedConfig = z.infer<typeof resolvedConfigSchema>; | ||
| declare const resolvedConfigSchema: z.ZodObject<{ | ||
| aliases: z.ZodObject<{ | ||
| components: z.ZodString; | ||
| utils: z.ZodString; | ||
| ui: z.ZodDefault<z.ZodString>; | ||
| hooks: z.ZodDefault<z.ZodString>; | ||
| lib: z.ZodDefault<z.ZodString>; | ||
| }, z.core.$strip>; | ||
| $schema: z.ZodOptional<z.ZodString>; | ||
| tailwind: z.ZodObject<{ | ||
| css: z.ZodString; | ||
| baseColor: z.ZodString; | ||
| }, z.core.$strip>; | ||
| typescript: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{ | ||
| config: z.ZodString; | ||
| }, z.core.$strip>]>>; | ||
| registry: z.ZodDefault<z.ZodString>; | ||
| sveltekit: z.ZodBoolean; | ||
| resolvedPaths: z.ZodObject<{ | ||
| cwd: z.ZodString; | ||
| tailwindCss: z.ZodString; | ||
| utils: z.ZodString; | ||
| components: z.ZodString; | ||
| hooks: z.ZodString; | ||
| ui: z.ZodString; | ||
| lib: z.ZodString; | ||
| }, z.core.$strip>; | ||
| style: z.ZodDefault<z.ZodString>; | ||
| iconLibrary: z.ZodDefault<z.ZodEnum<{ | ||
| lucide: "lucide"; | ||
| tabler: "tabler"; | ||
| hugeicons: "hugeicons"; | ||
| phosphor: "phosphor"; | ||
| remixicon: "remixicon"; | ||
| }>>; | ||
| menuColor: z.ZodDefault<z.ZodEnum<{ | ||
| default: "default"; | ||
| inverted: "inverted"; | ||
| "default-translucent": "default-translucent"; | ||
| "inverted-translucent": "inverted-translucent"; | ||
| }>>; | ||
| menuAccent: z.ZodDefault<z.ZodEnum<{ | ||
| subtle: "subtle"; | ||
| bold: "bold"; | ||
| }>>; | ||
| }, z.core.$strip>; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-strip-types.d.ts | ||
| declare const transformStripTypes: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-icons.d.ts | ||
| declare const transformIcons: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-imports.d.ts | ||
| declare const transformImports: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/transform-menu.d.ts | ||
| /** | ||
| * Transforms cn-menu-target and cn-menu-translucent classes based on config.menuColor. | ||
| * If menuColor is "inverted", replaces cn-menu-target with "dark" and removes cn-menu-translucent. | ||
| * If menuColor is "default-translucent", removes cn-menu-target and inlines cn-menu-translucent styles. | ||
| * If menuColor is "inverted-translucent", replaces cn-menu-target with "dark" and inlines cn-menu-translucent styles. | ||
| * Otherwise, removes both cn-menu-target and cn-menu-translucent. | ||
| */ | ||
| declare const transformMenu: Transformer; | ||
| //#endregion | ||
| //#region src/utils/transformers/index.d.ts | ||
| type TransformOptions = { | ||
| content: string; | ||
| filePath: string; | ||
| config: ResolvedConfig; | ||
| }; | ||
| type TransformerResult = { | ||
| content: string; | ||
| dependencies: string[]; | ||
| devDependencies: string[]; | ||
| filePath: string; | ||
| }; | ||
| type Transformer = (opts: TransformOptions) => Promise<Partial<TransformerResult>>; | ||
| declare function transform(opts: TransformOptions, transformers: (Transformer | false | undefined)[]): Promise<TransformerResult>; | ||
| //#endregion | ||
| export { transformMenu as a, transformStripTypes as c, transform as i, Transformer as n, transformImports as o, TransformerResult as r, transformIcons as s, TransformOptions as t }; |
Sorry, the diff of this file is too big to display
| var e=44,t=59,n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,r=new Uint8Array(64),i=new Uint8Array(128);for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r[e]=t,i[t]=e}function a(e,t,n){let i=t-n;i=i<0?-i<<1|1:i<<1;do{let t=i&31;i>>>=5,i>0&&(t|=32),e.write(r[t])}while(i>0);return t}var o=1024*16,s=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},c=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(o)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===o&&(this.out+=s.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+s.decode(e.subarray(0,n)):t}};function l(n){let r=new c,i=0,o=0,s=0,l=0;for(let c=0;c<n.length;c++){let u=n[c];if(c>0&&r.write(t),u.length===0)continue;let d=0;for(let t=0;t<u.length;t++){let n=u[t];t>0&&r.write(e),d=a(r,n[0],d),n.length!==1&&(i=a(r,n[1],i),o=a(r,n[2],o),s=a(r,n[3],s),n.length!==4&&(l=a(r,n[4],l)))}}return r.flush()}var u=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}},d=class e{constructor(e,t,n){this.start=e,this.end=t,this.original=n,this.intro=``,this.outro=``,this.content=n,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro+=e}clone(){let t=new e(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;for(;t;)e(t),t=t.next}eachPrevious(e){let t=this;for(;t;)e(t),t=t.previous}edit(e,t,n){return this.content=e,n||(this.intro=``,this.outro=``),this.storeName=t,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro=``,this.outro=``,this.edited&&=(this.content=this.original,this.storeName=!1,!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let a=new e(t,this.end,i);return a.outro=this.outro,this.outro=``,this.end=t,this.edited?(a.edit(``,!1),this.content=``):this.content=r,a.next=this.next,a.next&&(a.next.previous=a),a.previous=this,this.next=a,a}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,``),this.outro.length)return!0;let t=this.content.replace(e,``);if(t.length)return t!==this.content&&(this.split(this.start+t.length).edit(``,void 0,!0),this.edited&&this.edit(t,this.storeName,!0)),!0;if(this.edit(``,void 0,!0),this.intro=this.intro.replace(e,``),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,``),this.intro.length)return!0;let t=this.content.replace(e,``);if(t.length){if(t!==this.content){let e=this.split(this.end-t.length);this.edited&&e.edit(t,this.storeName,!0),this.edit(``,void 0,!0)}return!0}else if(this.edit(``,void 0,!0),this.outro=this.outro.replace(e,``),this.outro.length)return!0}};function f(){return typeof globalThis<`u`&&typeof globalThis.btoa==`function`?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer==`function`?e=>Buffer.from(e,`utf-8`).toString(`base64`):()=>{throw Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}const p=f();var m=class{constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=l(e.mappings),e.x_google_ignoreList!==void 0&&(this.x_google_ignoreList=e.x_google_ignoreList),e.debugId!==void 0&&(this.debugId=e.debugId)}toString(){return JSON.stringify(this)}toUrl(){return`data:application/json;charset=utf-8;base64,`+p(this.toString())}};function h(e){let t=e.split(` | ||
| `),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return` `;let i=r.reduce((e,t)=>{let n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return Array(i+1).join(` `)}function g(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let e=n.length;for(;e--;)n[e]=`..`}return n.concat(r).join(`/`)}const _=Object.prototype.toString;function v(e){return _.call(e)===`[object Object]`}function y(e){let t=e.split(` | ||
| `),n=[];for(let e=0,r=0;e<t.length;e++)n.push(r),r+=t[e].length+1;return function(e){let t=0,r=n.length;for(;t<r;){let i=t+r>>1;e<n[i]?r=i:t=i+1}let i=t-1;return{line:i,column:e-n[i]}}}const b=/\w/;var x=class{constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,t,n,r){if(t.length){let i=t.length-1,a=t.indexOf(` | ||
| `,0),o=-1;for(;a>=0&&i>a;){let i=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&i.push(r),this.rawSegments.push(i),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=a,a=t.indexOf(` | ||
| `,a+1)}let s=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&s.push(r),this.rawSegments.push(s),this.advance(t.slice(o+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(t));this.pending=null}addUneditedChunk(e,t,n,r,i){let a=t.start,o=!0,s=!1;for(;a<t.end;){if(n[a]===` | ||
| `)r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=!0,s=!1;else{if(this.hires||o||i.has(a)){let t=[this.generatedCodeColumn,e,r.line,r.column];this.hires===`boundary`?b.test(n[a])?s||=(this.rawSegments.push(t),!0):(this.rawSegments.push(t),s=!1):this.rawSegments.push(t)}r.column+=1,this.generatedCodeColumn+=1,o=!1}a+=1}this.pending=null}advance(e){if(!e)return;let t=e.split(` | ||
| `);if(t.length>1){for(let e=0;e<t.length-1;e++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}};const S={insertLeft:!1,insertRight:!1,storeName:!1};var C=class e{constructor(e,t={}){let n=new d(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:``},intro:{writable:!0,value:``},firstChunk:{writable:!0,value:n},lastChunk:{writable:!0,value:n},lastSearchedChunk:{writable:!0,value:n},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:t.filename},indentExclusionRanges:{writable:!0,value:t.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new u},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:t.ignoreList},offset:{writable:!0,value:t.offset||0}}),this.byStart[0]=n,this.byEnd[e.length]=n}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.outro+=e,this}appendLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.appendLeft(t):this.intro+=t,this}appendRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.appendRight(t):this.outro+=t,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let e=n.next,i=e&&e.clone();i&&(r.next=i,i.previous=r,r=i),n=e}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new u(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(e){e||={};let t=Object.keys(this.storedNames),n=new x(e.hires),r=y(this.original);return this.intro&&n.advance(this.intro),this.firstChunk.eachNext(e=>{let i=r(e.start);e.intro.length&&n.advance(e.intro),e.edited?n.addEdit(0,e.content,i,e.storeName?t.indexOf(e.original):-1):n.addUneditedChunk(0,e,this.original,i,this.sourcemapLocations),e.outro.length&&n.advance(e.outro)}),this.outro&&n.advance(this.outro),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?g(e.file||``,e.source):e.file||``],sourcesContent:e.includeContent?[this.original]:void 0,names:t,mappings:n.raw,x_google_ignoreList:this.ignoreList?[0]:void 0}}generateMap(e){return new m(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=h(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?` `:this.indentStr}indent(e,t){let n=/^[^\r\n]/gm;if(v(e)&&(t=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||` `),e===``)return this;t||={};let r={};t.exclude&&(typeof t.exclude[0]==`number`?[t.exclude]:t.exclude).forEach(e=>{for(let t=e[0];t<e[1];t+=1)r[t]=!0});let i=t.indentStart!==!1,a=t=>i?`${e}${t}`:(i=!0,t);this.intro=this.intro.replace(n,a);let o=0,s=this.firstChunk;for(;s;){let t=s.end;if(s.edited)r[o]||(s.content=s.content.replace(n,a),s.content.length&&(i=s.content[s.content.length-1]===` | ||
| `));else for(o=s.start;o<t;){if(!r[o]){let t=this.original[o];t===` | ||
| `?i=!0:t!==`\r`&&i&&(i=!1,o===s.start?s.prependRight(e):(this._splitChunk(s,o),s=s.next,s.prependRight(e)))}o+=1}o=s.end,s=s.next}return this.outro=this.outro.replace(n,a),this}insert(){throw Error(`magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)`)}insertLeft(e,t){return S.insertLeft||=(console.warn(`magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead`),!0),this.appendLeft(e,t)}insertRight(e,t){return S.insertRight||=(console.warn(`magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead`),!0),this.prependRight(e,t)}move(e,t,n){if(e+=this.offset,t+=this.offset,n+=this.offset,n>=e&&n<=t)throw Error(`Cannot move a selection inside itself`);this._split(e),this._split(t),this._split(n);let r=this.byStart[e],i=this.byEnd[t],a=r.previous,o=i.next,s=this.byStart[n];if(!s&&i===this.lastChunk)return this;let c=s?s.previous:this.lastChunk;return a&&(a.next=o),o&&(o.previous=a),c&&(c.next=r),s&&(s.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,i.next=s||null,c||(this.firstChunk=r),s||(this.lastChunk=i),this}overwrite(e,t,n,r){return r||={},this.update(e,t,n,{...r,overwrite:!r.contentOnly})}update(e,t,n,r){if(e+=this.offset,t+=this.offset,typeof n!=`string`)throw TypeError(`replacement content must be a string`);if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(t>this.original.length)throw Error(`end is out of bounds`);if(e===t)throw Error(`Cannot overwrite a zero-length range – use appendLeft or prependRight instead`);this._split(e),this._split(t),r===!0&&(S.storeName||=(console.warn(`The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string`),!0),r={storeName:!0});let i=r===void 0?!1:r.storeName,a=r===void 0?!1:r.overwrite;if(i){let n=this.original.slice(e,t);Object.defineProperty(this.storedNames,n,{writable:!0,value:!0,enumerable:!0})}let o=this.byStart[e],s=this.byEnd[t];if(o){let e=o;for(;e!==s;){if(e.next!==this.byStart[e.end])throw Error(`Cannot overwrite across a split point`);e=e.next,e.edit(``,!1)}o.edit(n,i,!a)}else{let r=new d(e,t,``).edit(n,i);s.next=r,r.previous=s}return this}prepend(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.intro=e+this.intro,this}prependLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this}remove(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.intro=``,n.outro=``,n.edit(``),n=t>n.end?this.byStart[n.end]:null;return this}reset(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.reset(),n=t>n.end?this.byStart[n.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:``}lastLine(){let e=this.outro.lastIndexOf(` | ||
| `);if(e!==-1)return this.outro.substr(e+1);let t=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(e=n.outro.lastIndexOf(` | ||
| `),e!==-1)return n.outro.substr(e+1)+t;t=n.outro+t}if(n.content.length>0){if(e=n.content.lastIndexOf(` | ||
| `),e!==-1)return n.content.substr(e+1)+t;t=n.content+t}if(n.intro.length>0){if(e=n.intro.lastIndexOf(` | ||
| `),e!==-1)return n.intro.substr(e+1)+t;t=n.intro+t}}while(n=n.previous);return e=this.intro.lastIndexOf(` | ||
| `),e===-1?this.intro+t:this.intro.substr(e+1)+t}slice(e=0,t=this.original.length-this.offset){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}let n=``,r=this.firstChunk;for(;r&&(r.start>e||r.end<=e);){if(r.start<t&&r.end>=t)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw Error(`Cannot use replaced character ${e} as slice start anchor.`);let i=r;for(;r;){r.intro&&(i!==r||r.start===e)&&(n+=r.intro);let a=r.start<t&&r.end>=t;if(a&&r.edited&&r.end!==t)throw Error(`Cannot use replaced character ${t} as slice end anchor.`);let o=i===r?e-r.start:0,s=a?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,s),r.outro&&(!a||r.end===t)&&(n+=r.outro),a)break;r=r.next}return n}snip(e,t){let n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk,n=t,r=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);if(t=r?this.byStart[t.end]:this.byEnd[t.start],t===n)return;n=t}}_splitChunk(e,t){if(e.edited&&e.content.length){let n=y(this.original)(t);throw Error(`Cannot split a chunk that has already been edited (${n.line}:${n.column} – "${e.original}")`)}let n=e.split(t);return this.byEnd[t]=e,this.byStart[t]=n,this.byEnd[n.end]=n,e===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1;while(e=e.next);return!0}length(){let e=this.firstChunk,t=0;do t+=e.intro.length+e.content.length+e.outro.length;while(e=e.next);return t}trimLines(){return this.trim(`[\\r\\n]`)}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){let t=RegExp((e||`\\s`)+`+$`);if(this.outro=this.outro.replace(t,``),this.outro.length)return!0;let n=this.lastChunk;do{let e=n.end,r=n.trimEnd(t);if(n.end!==e&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.previous}while(n);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){let t=RegExp(`^`+(e||`\\s`)+`+`);if(this.intro=this.intro.replace(t,``),this.intro.length)return!0;let n=this.firstChunk;do{let e=n.end,r=n.trimStart(t);if(n.end!==e&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.next}while(n);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function n(e,n){return typeof t==`string`?t.replace(/\$(\$|&|\d+)/g,(t,n)=>n===`$`?`$`:n===`&`?e[0]:+n<e.length?e[+n]:`$${n}`):t(...e,e.index,n,e.groups)}function r(e,t){let n,r=[];for(;n=e.exec(t);)r.push(n);return r}if(e.global)r(e,this.original).forEach(e=>{if(e.index!=null){let t=n(e,this.original);t!==e[0]&&this.overwrite(e.index,e.index+e[0].length,t)}});else{let t=this.original.match(e);if(t&&t.index!=null){let e=n(t,this.original);e!==t[0]&&this.overwrite(t.index,t.index+t[0].length,e)}}return this}_replaceString(e,t){let{original:n}=this,r=n.indexOf(e);return r!==-1&&(typeof t==`function`&&(t=t(e,r,n)),e!==t&&this.overwrite(r,r+e.length,t)),this}replace(e,t){return typeof e==`string`?this._replaceString(e,t):this._replaceRegexp(e,t)}_replaceAllString(e,t){let{original:n}=this,r=e.length;for(let i=n.indexOf(e);i!==-1;i=n.indexOf(e,i+r)){let e=n.slice(i,i+r),a=t;typeof t==`function`&&(a=t(e,i,n)),e!==a&&this.overwrite(i,i+r,a)}return this}replaceAll(e,t){if(typeof e==`string`)return this._replaceAllString(e,t);if(!e.global)throw TypeError(`MagicString.prototype.replaceAll called with a non-global RegExp argument`);return this._replaceRegexp(e,t)}};export{C as t}; |
| import{a as e,t}from"./libraries-CCQwMxcx.mjs";const n=[`nova`,`vega`,`maia`,`lyra`,`mira`],r={neutral:{name:`Neutral`,color:`#737373`},stone:{name:`Stone`,color:`#79716B`},zinc:{name:`Zinc`,color:`#71717B`},mauve:{name:`Mauve`,color:`#79697B`},olive:{name:`Olive`,color:`#7C7C67`},mist:{name:`Mist`,color:`#67787C`},taupe:{name:`Taupe`,color:`#7C6D67`}},i=e(r),a={neutral:{name:`Neutral`,color:`#737373`},stone:{name:`Stone`,color:`#78716c`},zinc:{name:`Zinc`,color:`#71717a`},amber:{name:`Amber`,color:`#FD9A00`},blue:{name:`Blue`,color:`#2B7FFF`},cyan:{name:`Cyan`,color:`#00B8DB`},emerald:{name:`Emerald`,color:`#00BC7D`},fuchsia:{name:`Fuchsia`,color:`#E12AFB`},green:{name:`Green`,color:`#00C950`},indigo:{name:`Indigo`,color:`#615FFF`},lime:{name:`Lime`,color:`#7CCF00`},orange:{name:`Orange`,color:`#FF6900`},pink:{name:`Pink`,color:`#F6339A`},purple:{name:`Purple`,color:`#AD46FF`},red:{name:`Red`,color:`#FB2C36`},rose:{name:`Rose`,color:`#FF2056`},sky:{name:`Sky`,color:`#00A6F4`},teal:{name:`Teal`,color:`#00BBA7`},violet:{name:`Violet`,color:`#8E51FF`},yellow:{name:`Yellow`,color:`#EFB100`},mauve:{name:`Mauve`,color:`#79697b`},olive:{name:`Olive`,color:`#7c7c67`},mist:{name:`Mist`,color:`#67787c`},taupe:{name:`Taupe`,color:`#7c6d67`}},o=e(a),s=e(t),c=[`inter`,`noto-sans`,`nunito-sans`,`figtree`,`roboto`,`raleway`,`dm-sans`,`public-sans`,`outfit`,`jetbrains-mono`,`geist`,`geist-mono`,`lora`,`merriweather`,`playfair-display`,`noto-serif`,`roboto-slab`],l={default:{name:`default`,label:`Default`,value:`0.5rem`},none:{name:`none`,label:`None`,value:`0rem`},small:{name:`small`,label:`Small`,value:`0.45rem`},medium:{name:`medium`,label:`Medium`,value:`0.625rem`},large:{name:`large`,label:`Large`,value:`0.875rem`}},u=e(l),d=[`subtle`,`bold`],f=[`default`,`inverted`,`default-translucent`,`inverted-translucent`],p=[{key:`menuColor`,values:f,bits:3},{key:`menuAccent`,values:d,bits:3},{key:`radius`,values:u,bits:4},{key:`font`,values:c,bits:6},{key:`iconLibrary`,values:s,bits:6},{key:`theme`,values:o,bits:6},{key:`baseColor`,values:i,bits:6},{key:`style`,values:n,bits:6}],m=Object.fromEntries(p.map(e=>[e.key,e.values[0]])),h=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function g(e){if(e===0)return`0`;let t=``,n=e;for(;n>0;)t=h[n%62]+t,n=Math.floor(n/62);return t}function _(e){let t=0;for(let n=0;n<e.length;n++){let r=h.indexOf(e[n]);if(r===-1)return-1;t=t*62+r}return t}function v(e){let t={...m,...e},n=0,r=0;for(let e of p){let i=e.values.indexOf(t[e.key]);n+=(i===-1?0:i)*2**r,r+=e.bits}return`a`+g(n)}function y(e){if(!e||e.length<2||e[0]!==`a`)return null;let t=_(e.slice(1));if(t<0)return null;let n={},r=0;for(let e of p){let i=Math.floor(t/2**r)%2**e.bits;n[e.key]=i<e.values.length?e.values[i]:e.values[0],r+=e.bits}return n}function b(e){if(!e||e.length<2||e.length>10||e[0]!==`a`)return!1;for(let t=1;t<e.length;t++)if(h.indexOf(e[t])===-1)return!1;return!0}function x(e){return y(e)!==null}function S(){let e=e=>e[Math.floor(Math.random()*e.length)];return Object.fromEntries(p.map(t=>[t.key,e(t.values)]))}function C(){return v(S())}export{b as _,s as a,l as c,o as d,y as f,C as g,S as h,c as i,n as l,_ as m,r as n,d as o,v as p,i as r,f as s,m as t,a as u,x as v,g as y}; |
| import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,p as l,u,v as d,y as f}from"./libraries-CCQwMxcx.mjs";import{i as p}from"./constants-Cd6CLVj2.mjs";import{a as m,o as h,r as g,s as _}from"./preset-OLkSDPn4.mjs";const v=g,y=h,b=_,x={$schema:`${p}/schema.json`,aliases:{lib:`$lib`,utils:`$lib/utils`,hooks:`$lib/hooks`,components:`$lib/components`,ui:`$lib/components/ui`},tailwind:{baseColor:`slate`,css:`src/app.css`},typescript:!0,registry:`${p}/registry`,style:`nova`,iconLibrary:`lucide`,menuColor:`default`,menuAccent:`subtle`},S=e=>e.endsWith(`/`)?e.slice(0,-1):e,C=e=>f(`Missing aliases.${e} alias`),w=a({$schema:f().optional(),tailwind:a({css:f(`Missing tailwind.css path`),baseColor:f(`Missing tailwind.baseColor field`)},`Missing tailwind object`),aliases:a({components:C(`components`),utils:C(`utils`)},`Missing aliases object`),typescript:t([i(),a({config:f()})],`Invalid typescript field. Must either be 'true', 'false', or '{ "config": "path/to/tsconfig.json" }'`).default(x.typescript)}),T=w.extend({style:f().optional()}),E=w.extend({aliases:w.shape.aliases.extend({ui:C(`ui`).default(x.aliases.ui),hooks:C(`hooks`).default(x.aliases.hooks),lib:C(`lib`).default(x.aliases.lib)}),registry:f().default(x.registry),style:f().optional(),iconLibrary:s(m).optional(),menuColor:s(b).optional(),menuAccent:s(y).optional()}),D=a({...T.shape,...E.shape,aliases:a({...T.shape.aliases.shape,...E.shape.aliases.shape})}),O=D.extend({sveltekit:i(),resolvedPaths:a({cwd:f(),tailwindCss:f(),utils:f(),components:f(),hooks:f(),ui:f(),lib:f()}),style:f().default(x.style),iconLibrary:s(m).default(x.iconLibrary),menuColor:s(b).default(x.menuColor),menuAccent:s(y).default(x.menuAccent)}),k=[`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:base`,`registry:font`],A=[`registry:block`],j=[`registry:example`,`registry:internal`],M=s([...k,...A,...j]).describe(`The type of the item. Used to determine the type and target path of the item when resolved for a project.`),N=s(k).describe(`The type of the file. Used to resolve the file's path for a project.`),P=a({content:f().describe(`The content of the file.`),type:N,target:f().describe(`The target path of the file. This is where the file will be installed.`)}).describe(`The main payload of the registry item. This is an array of files that are part of the registry item. Each file is an object with a target, type, and content.`),F=f().array().describe(`An array of registry items that this item depends on. Use the name of the item to reference shadcn/ui components and urls to reference other registries.`),I=a({name:f().describe(`The name of the item. Used to identify the item in the registry. It should be unique for your registry.`),title:f().optional().describe(`The human-readable title for your registry item. Keep it short and descriptive.`),type:M,author:f().min(2,`Author name must be at least 2 characters`).optional().describe(`The author of the item. Recommended format: username <url>`),description:f().optional().describe(`The description of the item. Used to provide a brief overview of the item.`),dependencies:f().array().optional().describe(`An array of NPM dependencies required by the registry item.`),devDependencies:f().array().optional().describe(`An array of NPM dev dependencies required by the registry item.`),registryDependencies:e(F),meta:d(f(),u()).optional().describe(`Additional metadata for the registry item. This is an object with any key value pairs.`)}),L=I.extend({relativeUrl:f()}),R=r(L),z=d(f(),f()),B=a({cssVars:a({light:z,dark:z})}),V=a({theme:e(z).describe(`CSS variables for the @theme directive. For Tailwind v4 projects only. Use tailwind for older projects.`),light:e(z).describe(`CSS variables for the light theme.`),dark:e(z).describe(`CSS variables for the dark theme.`)}).describe(`The css variables for the registry item. This will be merged with the project's css variables.`),H=d(f().describe(`Direct CSS string (e.g., 'font-family: sans-serif; line-height: 1.5;')`),c(()=>t([f().describe(`CSS property value (e.g., 'blue', 'var(--color-primary)')`),H.describe(`CSS property value for nested rule`)])).describe(`CSS properties or nested selectors`)).describe(`CSS definitions to be added to the project's CSS file. Supports at-rules, selectors, nested rules, utilities, layers, and more.`),U=a({$schema:f().optional(),...I.shape,docs:f().optional().describe(`The documentation for the registry item. This is a markdown string.`),categories:f().array().optional().describe(`The categories of the registry item. This is an array of strings.`),css:e(H),cssVars:e(V),files:r(P).optional()}),W=a({family:f(),provider:o(`google`),import:f(),variable:f(),weight:r(f()).optional(),subsets:r(f()).optional(),selector:f().optional(),dependency:f().optional()}),G=l(`type`,[U.extend({type:o(`registry:base`),config:J(D).optional()}),U.extend({type:o(`registry:font`),font:W}),U.extend({type:M.exclude([`registry:base`,`registry:font`])})]),K=a({$schema:f().optional(),name:f().describe(`The name of the registry.`),homepage:f().describe(`The homepage of the registry.`),overrideDependencies:f().array().optional().describe("An array of NPM dependencies that should have their versions overridden during registry `build`."),aliases:a({lib:f().optional(),ui:f().optional(),components:f().optional(),utils:f().optional(),hooks:f().optional()}).optional().describe("Defines which internal import paths should be transformed during registry `build`."),items:I.extend({files:P.partial().extend({path:f().describe(`The path to the file relative to the registry root.`),type:N}).array().describe("An array of files that instructs the `build` command on how to locate and parse the registry files."),registryDependencies:F,cssVars:e(V),css:e(H),font:e(W)}).array().describe(`Defines a custom component registry.`)}),q=a({$schema:f().optional(),style:f().optional().describe(`DEPRECATED IN TAILWIND v4! The style for your components. This cannot be changed after initialization.`),tailwind:a({css:f().describe(`Path to the CSS file that imports Tailwind CSS into your project.`),baseColor:f().describe(`Used to generate the default color palette for your components. This cannot be changed after initialization.`),config:f().optional().describe("DEPRECATED IN TAILWIND v4! The path to your `tailwind.config.[js|ts]` file.")}),aliases:a({components:f().describe(`Import alias for your components.`),utils:f().describe(`Import alias for your utility functions.`),ui:f().optional().describe("Import alias for your UI components. Defaults to `$lib/components/ui`."),hooks:f().optional().describe("Import alias for your hooks. Defaults to `$lib/hooks`."),lib:f().optional().describe("Import alias for your library, which is typically where you store your components, utils, hooks, etc. Defaults to `$lib`.")}).describe("The CLI uses these values and the `alias` config from your `svelte.config.js` file to place generated components in the correct location."),registry:f().optional().describe(`The registry URL tells the CLI where to fetch the shadcn-svelte components/registry from. You can pin this to a specific preview release or your own fork of the registry.`),typescript:t([i(),a({config:f().describe(`Path to the tsconfig/jsconfig file.`)})]).optional().describe("Used to determine if Typescript is used for this project. When set to `false`, `.js` files will be installed instead. Defaults to `true`.")});function J(t){let r={};return Object.entries(t.shape).forEach(([t,i])=>{i instanceof n?r[t]=J(i).optional():r[t]=e(i)}),a(r)}export{R as a,W as c,v as d,x as f,S as g,O as h,L as i,G as l,D as m,J as n,U as o,E as p,B as r,P as s,q as t,K as u}; |
| var e=class{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,t,n,r){e&&t&&(n==null?e[t]=r:e[t][n]=r)}remove(e,t,n){e&&t&&(n==null?delete e[t]:e[t].splice(n,1))}},t=class extends e{constructor(e,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e},this.enter=e,this.leave=t}visit(e,t,r,i){if(e){if(this.enter){let n=this.should_skip,a=this.should_remove,o=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,t,r,i),this.replacement&&(e=this.replacement,this.replace(t,r,i,e)),this.should_remove&&this.remove(t,r,i);let s=this.should_skip,c=this.should_remove;if(this.should_skip=n,this.should_remove=a,this.replacement=o,s)return e;if(c)return null}let a;for(a in e){let t=e[a];if(t&&typeof t==`object`)if(Array.isArray(t)){let r=t;for(let t=0;t<r.length;t+=1){let i=r[t];n(i)&&(this.visit(i,e,a,t)||t--)}}else n(t)&&this.visit(t,e,a,null)}if(this.leave){let n=this.replacement,a=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,t,r,i),this.replacement&&(e=this.replacement,this.replace(t,r,i,e)),this.should_remove&&this.remove(t,r,i);let o=this.should_remove;if(this.replacement=n,this.should_remove=a,o)return null}}return e}};function n(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function r(e,{enter:n,leave:r}){return new t(n,r).visit(e,null)}export{r as t}; |
| import{t as e}from"./libraries-CCQwMxcx.mjs";import{t}from"./src-Bryu0SVv.mjs";import{t as n}from"./magic-string.es-I1ELJdqB.mjs";import{parse as r}from"svelte/compiler";function i(e,t){return new a(e,{cause:t})}var a=class extends Error{constructor(...e){super(...e),this.name=`CLI Error`}},o=class extends Error{constructor(...e){super(...e),this.name=`Config Error`}};const s=async({content:a,filePath:o,config:s})=>{if(!o.endsWith(`.svelte`))return{};let c=new n(a),l=r(a,{filename:o,modern:!0}),u=e[s.iconLibrary],d=[],f=null;if(t(l,{enter:t=>{if(t.type===`Component`&&t.name===`IconPlaceholder`){let n=t.attributes.filter(t=>!Object.keys(e).includes(t.name)),r=t.attributes.find(e=>e.name===s.iconLibrary)?.value[0]?.data;if(!r)throw i(`Couldn't find icon name attribute for ${s.iconLibrary} in ${o}. This is a bug please report it here: https://github.com/huntabyte/shadcn-svelte/issues`);let a=n.map(e=>c.slice(e.start,e.end)).join(` `),l=u.usage({name:r},a);c.overwrite(t.start,t.end,l),d.push({name:r})}else if(t.type===`ImportDeclaration`){let e=t.specifiers[0];e?.type===`ImportDefaultSpecifier`&&e.local.name===`IconPlaceholder`&&(f=t)}}}),f){let e=u.getAdditionalImports?.()??[];for(let t of d)e.push(u.import(t));c.overwrite(f.start,f.end,e.join(` | ||
| `))}return{content:c.toString(),devDependencies:f===null?[]:[...u.packages]}};export{i,a as n,o as r,s as t}; |
| import{n as e,t}from"./constants-Cd6CLVj2.mjs";const n=async({content:n,config:r})=>{for(let i of t)n=n.replaceAll(e[i].placeholder,r.aliases[i]);return{content:n}};export{n as t}; |
| import{t as e}from"./magic-string.es-I1ELJdqB.mjs";import{twMerge as t}from"tailwind-merge";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 t}; |
Sorry, the diff of this file is too big to display
| async function e(e,t){let n={content:e.content,dependencies:new Set,devDependencies:new Set,filePath:e.filePath};for(let r of t.filter(e=>e!==void 0&&e!==!1)){let{content:t,dependencies:i,devDependencies:a,filePath:o}=await r({config:e.config,content:n.content,filePath:n.filePath});n.content=t??n.content,i?.forEach(e=>n.dependencies.add(e)),a?.forEach(e=>n.devDependencies.add(e)),n.filePath=o??n.filePath}return{content:n.content,dependencies:Array.from(n.dependencies),devDependencies:Array.from(n.devDependencies),filePath:n.filePath}}export{e as t}; |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 9 instances in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 9 instances in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
816943
0.41%36
9.09%2711
0.11%16
6.67%14
7.69%