shadcn 2.9.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import {z}from'zod';var s=z.enum(["registry:lib","registry:block","registry:component","registry:ui","registry:hook","registry:page","registry:file","registry:theme","registry:style","registry:item","registry:example","registry:internal"]),n=z.discriminatedUnion("type",[z.object({path:z.string(),content:z.string().optional(),type:z.enum(["registry:file","registry:page"]),target:z.string()}),z.object({path:z.string(),content:z.string().optional(),type:s.exclude(["registry:file","registry:page"]),target:z.string().optional()})]),o=z.object({config:z.object({content:z.array(z.string()).optional(),theme:z.record(z.string(),z.any()).optional(),plugins:z.array(z.string()).optional()}).optional()}),r=z.object({theme:z.record(z.string(),z.string()).optional(),light:z.record(z.string(),z.string()).optional(),dark:z.record(z.string(),z.string()).optional()}),a=z.record(z.string(),z.lazy(()=>z.union([z.string(),z.record(z.string(),z.union([z.string(),z.record(z.string(),z.string())]))]))),g=z.record(z.string(),z.string()),i=z.object({$schema:z.string().optional(),extends:z.string().optional(),name:z.string(),type:s,title:z.string().optional(),author:z.string().min(2).optional(),description:z.string().optional(),dependencies:z.array(z.string()).optional(),devDependencies:z.array(z.string()).optional(),registryDependencies:z.array(z.string()).optional(),files:z.array(n).optional(),tailwind:o.optional(),cssVars:r.optional(),css:a.optional(),envVars:g.optional(),meta:z.record(z.string(),z.any()).optional(),docs:z.string().optional(),categories:z.array(z.string()).optional()}),h=z.object({name:z.string(),homepage:z.string(),items:z.array(i)}),u=z.array(i),b=z.array(z.object({name:z.string(),label:z.string()})),f=z.record(z.string(),z.record(z.string(),z.string())),x=z.object({inlineColors:z.object({light:z.record(z.string(),z.string()),dark:z.record(z.string(),z.string())}),cssVars:r,cssVarsV4:r.optional(),inlineColorsTemplate:z.string(),cssVarsTemplate:z.string()}),S=i.pick({dependencies:true,devDependencies:true,files:true,tailwind:true,cssVars:true,css:true,envVars:true,docs:true}),c=z.union([z.string().refine(e=>e.includes("{name}"),{message:"Registry URL must include {name} placeholder"}),z.object({url:z.string().refine(e=>e.includes("{name}"),{message:"Registry URL must include {name} placeholder"}),params:z.record(z.string(),z.string()).optional(),headers:z.record(z.string(),z.string()).optional()})]),l=z.record(z.string().refine(e=>e.startsWith("@"),{message:"Registry names must start with @ (e.g., @v0, @acme)"}),c),p=z.object({$schema:z.string().optional(),style:z.string(),rsc:z.coerce.boolean().default(false),tsx:z.coerce.boolean().default(true),tailwind:z.object({config:z.string().optional(),css:z.string(),baseColor:z.string(),cssVariables:z.boolean().default(true),prefix:z.string().default("").optional()}),iconLibrary:z.string().optional(),aliases:z.object({components:z.string(),utils:z.string(),ui:z.string().optional(),lib:z.string().optional(),hooks:z.string().optional()}),registries:l.optional()}).strict(),m=p.extend({resolvedPaths:z.object({cwd:z.string(),tailwindConfig:z.string(),tailwindCss:z.string(),utils:z.string(),components:z.string(),lib:z.string(),hooks:z.string(),ui:z.string()})}),j=z.record(m),y=z.object({name:z.string(),type:z.string().optional(),description:z.string().optional(),registry:z.string(),addCommandArgument:z.string()}),C=z.object({pagination:z.object({total:z.number(),offset:z.number(),limit:z.number(),hasMore:z.boolean()}),items:z.array(y)});export{s as a,n as b,o as c,r as d,a as e,g as f,i as g,h,u as i,b as j,f as k,x as l,S as m,c as n,l as o,p,m as q,j as r,y as s,C as t};//# sourceMappingURL=chunk-VVOKVGPU.js.map
2
+ //# sourceMappingURL=chunk-VVOKVGPU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/registry/schema.ts"],"names":["registryItemTypeSchema","z","registryItemFileSchema","registryItemTailwindSchema","registryItemCssVarsSchema","registryItemCssSchema","registryItemEnvVarsSchema","registryItemSchema","registrySchema","registryIndexSchema","stylesSchema","iconsSchema","registryBaseColorSchema","registryResolvedItemsTreeSchema","registryConfigItemSchema","s","registryConfigSchema","key","rawConfigSchema","configSchema","workspaceConfigSchema","searchResultItemSchema","searchResultsSchema"],"mappings":"oBAKO,IAAMA,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AAAA,CAAE,QAAO,CACrB,GAAA,CAAKA,EAAE,MAAA,EAAO,CACd,MAAOA,CAAAA,CAAE,MAAA,GACT,EAAA,CAAIA,CAAAA,CAAE,QACR,CAAC,CACH,CAAC,CAAA,CAIYmB,EAAwBnB,CAAAA,CAAE,MAAA,CAAOkB,CAAY,CAAA,CAE7CE,CAAAA,CAAyBpB,EAAE,MAAA,CAAO,CAC7C,KAAMA,CAAAA,CAAE,MAAA,GACR,IAAA,CAAMA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAC1B,YAAaA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CACjC,SAAUA,CAAAA,CAAE,MAAA,GACZ,kBAAA,CAAoBA,CAAAA,CAAE,QACxB,CAAC,EAEYqB,CAAAA,CAAsBrB,CAAAA,CAAE,OAAO,CAC1C,UAAA,CAAYA,EAAE,MAAA,CAAO,CACnB,MAAOA,CAAAA,CAAE,MAAA,GACT,MAAA,CAAQA,CAAAA,CAAE,QAAO,CACjB,KAAA,CAAOA,EAAE,MAAA,EAAO,CAChB,QAASA,CAAAA,CAAE,OAAA,EACb,CAAC,CAAA,CACD,MAAOA,CAAAA,CAAE,KAAA,CAAMoB,CAAsB,CACvC,CAAC","file":"chunk-VVOKVGPU.js","sourcesContent":["import { z } from \"zod\"\n\n// Note: if you edit the schema here, you must also edit the schema in the\n// apps/www/public/schema/registry-item.json file.\n\nexport const registryItemTypeSchema = z.enum([\n \"registry:lib\",\n \"registry:block\",\n \"registry:component\",\n \"registry:ui\",\n \"registry:hook\",\n \"registry:page\",\n \"registry:file\",\n \"registry:theme\",\n \"registry:style\",\n \"registry:item\",\n\n // Internal use only\n \"registry:example\",\n \"registry:internal\",\n])\n\nexport const registryItemFileSchema = z.discriminatedUnion(\"type\", [\n // Target is required for registry:file and registry:page\n z.object({\n path: z.string(),\n content: z.string().optional(),\n type: z.enum([\"registry:file\", \"registry:page\"]),\n target: z.string(),\n }),\n z.object({\n path: z.string(),\n content: z.string().optional(),\n type: registryItemTypeSchema.exclude([\"registry:file\", \"registry:page\"]),\n target: z.string().optional(),\n }),\n])\n\nexport const registryItemTailwindSchema = z.object({\n config: z\n .object({\n content: z.array(z.string()).optional(),\n theme: z.record(z.string(), z.any()).optional(),\n plugins: z.array(z.string()).optional(),\n })\n .optional(),\n})\n\nexport const registryItemCssVarsSchema = z.object({\n theme: z.record(z.string(), z.string()).optional(),\n light: z.record(z.string(), z.string()).optional(),\n dark: z.record(z.string(), z.string()).optional(),\n})\n\nexport const registryItemCssSchema = z.record(\n z.string(),\n z.lazy(() =>\n z.union([\n z.string(),\n z.record(\n z.string(),\n z.union([z.string(), z.record(z.string(), z.string())])\n ),\n ])\n )\n)\n\nexport const registryItemEnvVarsSchema = z.record(z.string(), z.string())\n\nexport const registryItemSchema = z.object({\n $schema: z.string().optional(),\n extends: z.string().optional(),\n name: z.string(),\n type: registryItemTypeSchema,\n title: z.string().optional(),\n author: z.string().min(2).optional(),\n description: z.string().optional(),\n dependencies: z.array(z.string()).optional(),\n devDependencies: z.array(z.string()).optional(),\n registryDependencies: z.array(z.string()).optional(),\n files: z.array(registryItemFileSchema).optional(),\n tailwind: registryItemTailwindSchema.optional(),\n cssVars: registryItemCssVarsSchema.optional(),\n css: registryItemCssSchema.optional(),\n envVars: registryItemEnvVarsSchema.optional(),\n meta: z.record(z.string(), z.any()).optional(),\n docs: z.string().optional(),\n categories: z.array(z.string()).optional(),\n})\n\nexport type RegistryItem = z.infer<typeof registryItemSchema>\n\nexport const registrySchema = z.object({\n name: z.string(),\n homepage: z.string(),\n items: z.array(registryItemSchema),\n})\n\nexport type Registry = z.infer<typeof registrySchema>\n\nexport const registryIndexSchema = z.array(registryItemSchema)\n\nexport const stylesSchema = z.array(\n z.object({\n name: z.string(),\n label: z.string(),\n })\n)\n\nexport const iconsSchema = z.record(\n z.string(),\n z.record(z.string(), z.string())\n)\n\nexport const registryBaseColorSchema = z.object({\n inlineColors: z.object({\n light: z.record(z.string(), z.string()),\n dark: z.record(z.string(), z.string()),\n }),\n cssVars: registryItemCssVarsSchema,\n cssVarsV4: registryItemCssVarsSchema.optional(),\n inlineColorsTemplate: z.string(),\n cssVarsTemplate: z.string(),\n})\n\nexport const registryResolvedItemsTreeSchema = registryItemSchema.pick({\n dependencies: true,\n devDependencies: true,\n files: true,\n tailwind: true,\n cssVars: true,\n css: true,\n envVars: true,\n docs: true,\n})\n\nexport const registryConfigItemSchema = z.union([\n // Simple string format: \"https://example.com/{name}.json\"\n z.string().refine((s) => s.includes(\"{name}\"), {\n message: \"Registry URL must include {name} placeholder\",\n }),\n // Advanced object format with auth options\n z.object({\n url: z.string().refine((s) => s.includes(\"{name}\"), {\n message: \"Registry URL must include {name} placeholder\",\n }),\n params: z.record(z.string(), z.string()).optional(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n])\n\nexport const registryConfigSchema = z.record(\n z.string().refine((key) => key.startsWith(\"@\"), {\n message: \"Registry names must start with @ (e.g., @v0, @acme)\",\n }),\n registryConfigItemSchema\n)\n\nexport const rawConfigSchema = z\n .object({\n $schema: z.string().optional(),\n style: z.string(),\n rsc: z.coerce.boolean().default(false),\n tsx: z.coerce.boolean().default(true),\n tailwind: z.object({\n config: z.string().optional(),\n css: z.string(),\n baseColor: z.string(),\n cssVariables: z.boolean().default(true),\n prefix: z.string().default(\"\").optional(),\n }),\n iconLibrary: z.string().optional(),\n aliases: z.object({\n components: z.string(),\n utils: z.string(),\n ui: z.string().optional(),\n lib: z.string().optional(),\n hooks: z.string().optional(),\n }),\n registries: registryConfigSchema.optional(),\n })\n .strict()\n\nexport const configSchema = rawConfigSchema.extend({\n resolvedPaths: z.object({\n cwd: z.string(),\n tailwindConfig: z.string(),\n tailwindCss: z.string(),\n utils: z.string(),\n components: z.string(),\n lib: z.string(),\n hooks: z.string(),\n ui: z.string(),\n }),\n})\n\n// TODO: type the key.\n// Okay for now since I don't want a breaking change.\nexport const workspaceConfigSchema = z.record(configSchema)\n\nexport const searchResultItemSchema = z.object({\n name: z.string(),\n type: z.string().optional(),\n description: z.string().optional(),\n registry: z.string(),\n addCommandArgument: z.string(),\n})\n\nexport const searchResultsSchema = z.object({\n pagination: z.object({\n total: z.number(),\n offset: z.number(),\n limit: z.number(),\n hasMore: z.boolean(),\n }),\n items: z.array(searchResultItemSchema),\n})\n"]}
@@ -0,0 +1,308 @@
1
+ import { configSchema, registryIndexSchema, registryItemSchema } from './schema/index.js';
2
+ import { z } from 'zod';
3
+
4
+ type Config = z.infer<typeof configSchema>;
5
+
6
+ declare function getRegistry(name: string, options?: {
7
+ config?: Partial<Config>;
8
+ useCache?: boolean;
9
+ }): Promise<{
10
+ name: string;
11
+ homepage: string;
12
+ items: {
13
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
14
+ name: string;
15
+ tailwind?: {
16
+ config?: {
17
+ content?: string[] | undefined;
18
+ theme?: Record<string, any> | undefined;
19
+ plugins?: string[] | undefined;
20
+ } | undefined;
21
+ } | undefined;
22
+ $schema?: string | undefined;
23
+ extends?: string | undefined;
24
+ title?: string | undefined;
25
+ author?: string | undefined;
26
+ description?: string | undefined;
27
+ dependencies?: string[] | undefined;
28
+ devDependencies?: string[] | undefined;
29
+ registryDependencies?: string[] | undefined;
30
+ files?: ({
31
+ type: "registry:page" | "registry:file";
32
+ path: string;
33
+ target: string;
34
+ content?: string | undefined;
35
+ } | {
36
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
37
+ path: string;
38
+ content?: string | undefined;
39
+ target?: string | undefined;
40
+ })[] | undefined;
41
+ cssVars?: {
42
+ theme?: Record<string, string> | undefined;
43
+ light?: Record<string, string> | undefined;
44
+ dark?: Record<string, string> | undefined;
45
+ } | undefined;
46
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
47
+ envVars?: Record<string, string> | undefined;
48
+ meta?: Record<string, any> | undefined;
49
+ docs?: string | undefined;
50
+ categories?: string[] | undefined;
51
+ }[];
52
+ }>;
53
+ declare function getRegistryItems(items: string[], options?: {
54
+ config?: Partial<Config>;
55
+ useCache?: boolean;
56
+ }): Promise<{
57
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
58
+ name: string;
59
+ tailwind?: {
60
+ config?: {
61
+ content?: string[] | undefined;
62
+ theme?: Record<string, any> | undefined;
63
+ plugins?: string[] | undefined;
64
+ } | undefined;
65
+ } | undefined;
66
+ $schema?: string | undefined;
67
+ extends?: string | undefined;
68
+ title?: string | undefined;
69
+ author?: string | undefined;
70
+ description?: string | undefined;
71
+ dependencies?: string[] | undefined;
72
+ devDependencies?: string[] | undefined;
73
+ registryDependencies?: string[] | undefined;
74
+ files?: ({
75
+ type: "registry:page" | "registry:file";
76
+ path: string;
77
+ target: string;
78
+ content?: string | undefined;
79
+ } | {
80
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
81
+ path: string;
82
+ content?: string | undefined;
83
+ target?: string | undefined;
84
+ })[] | undefined;
85
+ cssVars?: {
86
+ theme?: Record<string, string> | undefined;
87
+ light?: Record<string, string> | undefined;
88
+ dark?: Record<string, string> | undefined;
89
+ } | undefined;
90
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
91
+ envVars?: Record<string, string> | undefined;
92
+ meta?: Record<string, any> | undefined;
93
+ docs?: string | undefined;
94
+ categories?: string[] | undefined;
95
+ }[]>;
96
+ declare function resolveRegistryItems(items: string[], options?: {
97
+ config?: Partial<Config>;
98
+ useCache?: boolean;
99
+ }): Promise<{
100
+ tailwind?: {
101
+ config?: {
102
+ content?: string[] | undefined;
103
+ theme?: Record<string, any> | undefined;
104
+ plugins?: string[] | undefined;
105
+ } | undefined;
106
+ } | undefined;
107
+ dependencies?: string[] | undefined;
108
+ devDependencies?: string[] | undefined;
109
+ files?: ({
110
+ type: "registry:page" | "registry:file";
111
+ path: string;
112
+ target: string;
113
+ content?: string | undefined;
114
+ } | {
115
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
116
+ path: string;
117
+ content?: string | undefined;
118
+ target?: string | undefined;
119
+ })[] | undefined;
120
+ cssVars?: {
121
+ theme?: Record<string, string> | undefined;
122
+ light?: Record<string, string> | undefined;
123
+ dark?: Record<string, string> | undefined;
124
+ } | undefined;
125
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
126
+ envVars?: Record<string, string> | undefined;
127
+ docs?: string | undefined;
128
+ } | null>;
129
+ declare function getRegistriesConfig(cwd: string, options?: {
130
+ useCache?: boolean;
131
+ }): Promise<{
132
+ registries: Record<string, string | {
133
+ url: string;
134
+ params?: Record<string, string> | undefined;
135
+ headers?: Record<string, string> | undefined;
136
+ }>;
137
+ }>;
138
+ declare function getShadcnRegistryIndex(): Promise<{
139
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
140
+ name: string;
141
+ tailwind?: {
142
+ config?: {
143
+ content?: string[] | undefined;
144
+ theme?: Record<string, any> | undefined;
145
+ plugins?: string[] | undefined;
146
+ } | undefined;
147
+ } | undefined;
148
+ $schema?: string | undefined;
149
+ extends?: string | undefined;
150
+ title?: string | undefined;
151
+ author?: string | undefined;
152
+ description?: string | undefined;
153
+ dependencies?: string[] | undefined;
154
+ devDependencies?: string[] | undefined;
155
+ registryDependencies?: string[] | undefined;
156
+ files?: ({
157
+ type: "registry:page" | "registry:file";
158
+ path: string;
159
+ target: string;
160
+ content?: string | undefined;
161
+ } | {
162
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
163
+ path: string;
164
+ content?: string | undefined;
165
+ target?: string | undefined;
166
+ })[] | undefined;
167
+ cssVars?: {
168
+ theme?: Record<string, string> | undefined;
169
+ light?: Record<string, string> | undefined;
170
+ dark?: Record<string, string> | undefined;
171
+ } | undefined;
172
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
173
+ envVars?: Record<string, string> | undefined;
174
+ meta?: Record<string, any> | undefined;
175
+ docs?: string | undefined;
176
+ categories?: string[] | undefined;
177
+ }[] | undefined>;
178
+ declare function getRegistryStyles(): Promise<{
179
+ name: string;
180
+ label: string;
181
+ }[]>;
182
+ declare function getRegistryIcons(): Promise<Record<string, Record<string, string>>>;
183
+ declare function getRegistryBaseColors(): Promise<readonly [{
184
+ readonly name: "neutral";
185
+ readonly label: "Neutral";
186
+ }, {
187
+ readonly name: "gray";
188
+ readonly label: "Gray";
189
+ }, {
190
+ readonly name: "zinc";
191
+ readonly label: "Zinc";
192
+ }, {
193
+ readonly name: "stone";
194
+ readonly label: "Stone";
195
+ }, {
196
+ readonly name: "slate";
197
+ readonly label: "Slate";
198
+ }]>;
199
+ declare function getRegistryBaseColor(baseColor: string): Promise<{
200
+ cssVars: {
201
+ theme?: Record<string, string> | undefined;
202
+ light?: Record<string, string> | undefined;
203
+ dark?: Record<string, string> | undefined;
204
+ };
205
+ inlineColors: {
206
+ light: Record<string, string>;
207
+ dark: Record<string, string>;
208
+ };
209
+ inlineColorsTemplate: string;
210
+ cssVarsTemplate: string;
211
+ cssVarsV4?: {
212
+ theme?: Record<string, string> | undefined;
213
+ light?: Record<string, string> | undefined;
214
+ dark?: Record<string, string> | undefined;
215
+ } | undefined;
216
+ } | undefined>;
217
+ /**
218
+ * @deprecated This function is deprecated and will be removed in a future version.
219
+ */
220
+ declare function resolveTree(index: z.infer<typeof registryIndexSchema>, names: string[]): Promise<{
221
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
222
+ name: string;
223
+ tailwind?: {
224
+ config?: {
225
+ content?: string[] | undefined;
226
+ theme?: Record<string, any> | undefined;
227
+ plugins?: string[] | undefined;
228
+ } | undefined;
229
+ } | undefined;
230
+ $schema?: string | undefined;
231
+ extends?: string | undefined;
232
+ title?: string | undefined;
233
+ author?: string | undefined;
234
+ description?: string | undefined;
235
+ dependencies?: string[] | undefined;
236
+ devDependencies?: string[] | undefined;
237
+ registryDependencies?: string[] | undefined;
238
+ files?: ({
239
+ type: "registry:page" | "registry:file";
240
+ path: string;
241
+ target: string;
242
+ content?: string | undefined;
243
+ } | {
244
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
245
+ path: string;
246
+ content?: string | undefined;
247
+ target?: string | undefined;
248
+ })[] | undefined;
249
+ cssVars?: {
250
+ theme?: Record<string, string> | undefined;
251
+ light?: Record<string, string> | undefined;
252
+ dark?: Record<string, string> | undefined;
253
+ } | undefined;
254
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
255
+ envVars?: Record<string, string> | undefined;
256
+ meta?: Record<string, any> | undefined;
257
+ docs?: string | undefined;
258
+ categories?: string[] | undefined;
259
+ }[]>;
260
+ /**
261
+ * @deprecated This function is deprecated and will be removed in a future version.
262
+ */
263
+ declare function fetchTree(style: string, tree: z.infer<typeof registryIndexSchema>): Promise<{
264
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:page" | "registry:file" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
265
+ name: string;
266
+ tailwind?: {
267
+ config?: {
268
+ content?: string[] | undefined;
269
+ theme?: Record<string, any> | undefined;
270
+ plugins?: string[] | undefined;
271
+ } | undefined;
272
+ } | undefined;
273
+ $schema?: string | undefined;
274
+ extends?: string | undefined;
275
+ title?: string | undefined;
276
+ author?: string | undefined;
277
+ description?: string | undefined;
278
+ dependencies?: string[] | undefined;
279
+ devDependencies?: string[] | undefined;
280
+ registryDependencies?: string[] | undefined;
281
+ files?: ({
282
+ type: "registry:page" | "registry:file";
283
+ path: string;
284
+ target: string;
285
+ content?: string | undefined;
286
+ } | {
287
+ type: "registry:lib" | "registry:block" | "registry:component" | "registry:ui" | "registry:hook" | "registry:theme" | "registry:style" | "registry:item" | "registry:example" | "registry:internal";
288
+ path: string;
289
+ content?: string | undefined;
290
+ target?: string | undefined;
291
+ })[] | undefined;
292
+ cssVars?: {
293
+ theme?: Record<string, string> | undefined;
294
+ light?: Record<string, string> | undefined;
295
+ dark?: Record<string, string> | undefined;
296
+ } | undefined;
297
+ css?: Record<string, string | Record<string, string | Record<string, string>>> | undefined;
298
+ envVars?: Record<string, string> | undefined;
299
+ meta?: Record<string, any> | undefined;
300
+ docs?: string | undefined;
301
+ categories?: string[] | undefined;
302
+ }[]>;
303
+ /**
304
+ * @deprecated This function is deprecated and will be removed in a future version.
305
+ */
306
+ declare function getItemTargetPath(config: Config, item: Pick<z.infer<typeof registryItemSchema>, "type">, override?: string): Promise<string | null>;
307
+
308
+ export { type Config as C, getRegistry as a, getRegistriesConfig as b, getShadcnRegistryIndex as c, getRegistryStyles as d, getRegistryIcons as e, getRegistryBaseColors as f, getRegistryItems as g, getRegistryBaseColor as h, resolveTree as i, fetchTree as j, getItemTargetPath as k, resolveRegistryItems as r };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env node
2
- export { B as BASE_COLORS, j as clearRegistryCache, i as fetchRegistry, f as fetchTree, h as getItemTargetPath, e as getRegistryBaseColor, d as getRegistryBaseColors, b as getRegistryIcons, g as getRegistryIndex, c as getRegistryItem, p as getRegistryParentMap, a as getRegistryStyles, o as getRegistryTypeAliasMap, m as isUrl, l as registryGetTheme, k as registryResolveItemsTree, n as resolveRegistryItems, r as resolveTree } from './index-4a90b588.js';
2
+ export { j as fetchTree, k as getItemTargetPath, b as getRegistriesConfig, a as getRegistry, h as getRegistryBaseColor, f as getRegistryBaseColors, e as getRegistryIcons, g as getRegistryItems, d as getRegistryStyles, c as getShadcnRegistryIndex, r as resolveRegistryItems, i as resolveTree } from './index-J2j472vm.js';
3
+ import './schema/index.js';
3
4
  import 'zod';