shadcn 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-BFLSSWBX.js +1 -0
- package/dist/{chunk-GCGM5V6Q.js → chunk-IBHWVXMI.js} +4 -4
- package/dist/chunk-ISTYEIAA.js +1 -0
- package/dist/chunk-JPE2JKEP.js +2 -0
- package/dist/{chunk-G3IK4LWV.js → chunk-TVMYBJXJ.js} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +75 -75
- package/dist/mcp/index.js +1 -1
- package/dist/preset/index.d.ts +1 -1
- package/dist/preset/index.js +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/schema/index.d.ts +34 -34
- package/dist/schema/index.js +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-FFSLICO3.js +0 -1
- package/dist/chunk-IMJ4D25X.js +0 -2
- package/dist/chunk-K3VKXMEA.js +0 -1
package/dist/mcp/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as server}from'../chunk-
|
|
1
|
+
export{b as server}from'../chunk-IBHWVXMI.js';import'../chunk-TVMYBJXJ.js';import'../chunk-BFLSSWBX.js';import'../chunk-JPE2JKEP.js';import'../chunk-CHWMSXYA.js';
|
package/dist/preset/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const PRESET_ICON_LIBRARIES: readonly ["lucide", "hugeicons", "tabler",
|
|
|
6
6
|
declare const PRESET_FONTS: readonly ["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"];
|
|
7
7
|
declare const PRESET_RADII: readonly ["default", "none", "small", "medium", "large"];
|
|
8
8
|
declare const PRESET_MENU_ACCENTS: readonly ["subtle", "bold"];
|
|
9
|
-
declare const PRESET_MENU_COLORS: readonly ["default", "inverted"];
|
|
9
|
+
declare const PRESET_MENU_COLORS: readonly ["default", "inverted", "default-translucent", "inverted-translucent"];
|
|
10
10
|
type PresetConfig = {
|
|
11
11
|
style: (typeof PRESET_STYLES)[number];
|
|
12
12
|
baseColor: (typeof PRESET_BASE_COLORS)[number];
|
package/dist/preset/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as DEFAULT_PRESET_CONFIG,a as PRESET_BASES,c as PRESET_BASE_COLORS,f as PRESET_FONTS,e as PRESET_ICON_LIBRARIES,h as PRESET_MENU_ACCENTS,i as PRESET_MENU_COLORS,g as PRESET_RADII,b as PRESET_STYLES,d as PRESET_THEMES,n as decodePreset,m as encodePreset,l as fromBase62,q as generateRandomConfig,r as generateRandomPreset,o as isPresetCode,p as isValidPreset,k as toBase62}from'../chunk-
|
|
1
|
+
export{j as DEFAULT_PRESET_CONFIG,a as PRESET_BASES,c as PRESET_BASE_COLORS,f as PRESET_FONTS,e as PRESET_ICON_LIBRARIES,h as PRESET_MENU_ACCENTS,i as PRESET_MENU_COLORS,g as PRESET_RADII,b as PRESET_STYLES,d as PRESET_THEMES,n as decodePreset,m as encodePreset,l as fromBase62,q as generateRandomConfig,r as generateRandomPreset,o as isPresetCode,p as isValidPreset,k as toBase62}from'../chunk-ISTYEIAA.js';
|
package/dist/registry/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{p as RegistriesIndexParseError,f as RegistryError,j as RegistryFetchError,i as RegistryForbiddenError,o as RegistryInvalidNamespaceError,l as RegistryLocalFileError,n as RegistryMissingEnvironmentVariablesError,k as RegistryNotConfiguredError,g as RegistryNotFoundError,m as RegistryParseError,h as RegistryUnauthorizedError,
|
|
1
|
+
export{p as RegistriesIndexParseError,f as RegistryError,j as RegistryFetchError,i as RegistryForbiddenError,o as RegistryInvalidNamespaceError,l as RegistryLocalFileError,n as RegistryMissingEnvironmentVariablesError,k as RegistryNotConfiguredError,g as RegistryNotFoundError,m as RegistryParseError,h as RegistryUnauthorizedError,ma as getRegistries,na as getRegistriesIndex,aa as getRegistry,ba as getRegistryItems,ca as resolveRegistryItems,va as searchRegistries}from'../chunk-TVMYBJXJ.js';import'../chunk-BFLSSWBX.js';import'../chunk-JPE2JKEP.js';import'../chunk-CHWMSXYA.js';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ declare const rawConfigSchema: z.ZodObject<{
|
|
|
52
52
|
}>;
|
|
53
53
|
iconLibrary: z.ZodOptional<z.ZodString>;
|
|
54
54
|
rtl: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
55
|
-
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>;
|
|
55
|
+
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>;
|
|
56
56
|
menuAccent: z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>;
|
|
57
57
|
aliases: z.ZodObject<{
|
|
58
58
|
components: z.ZodString;
|
|
@@ -107,7 +107,7 @@ declare const rawConfigSchema: z.ZodObject<{
|
|
|
107
107
|
$schema?: string | undefined;
|
|
108
108
|
iconLibrary?: string | undefined;
|
|
109
109
|
rtl?: boolean | undefined;
|
|
110
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
110
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
111
111
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
112
112
|
registries?: Record<string, string | {
|
|
113
113
|
url: string;
|
|
@@ -135,7 +135,7 @@ declare const rawConfigSchema: z.ZodObject<{
|
|
|
135
135
|
tsx?: boolean | undefined;
|
|
136
136
|
iconLibrary?: string | undefined;
|
|
137
137
|
rtl?: boolean | undefined;
|
|
138
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
138
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
139
139
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
140
140
|
registries?: Record<string, string | {
|
|
141
141
|
url: string;
|
|
@@ -169,7 +169,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
169
169
|
}>;
|
|
170
170
|
iconLibrary: z.ZodOptional<z.ZodString>;
|
|
171
171
|
rtl: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
172
|
-
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>;
|
|
172
|
+
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>;
|
|
173
173
|
menuAccent: z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>;
|
|
174
174
|
aliases: z.ZodObject<{
|
|
175
175
|
components: z.ZodString;
|
|
@@ -263,7 +263,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
263
263
|
$schema?: string | undefined;
|
|
264
264
|
iconLibrary?: string | undefined;
|
|
265
265
|
rtl?: boolean | undefined;
|
|
266
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
266
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
267
267
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
268
268
|
registries?: Record<string, string | {
|
|
269
269
|
url: string;
|
|
@@ -301,7 +301,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
301
301
|
tsx?: boolean | undefined;
|
|
302
302
|
iconLibrary?: string | undefined;
|
|
303
303
|
rtl?: boolean | undefined;
|
|
304
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
304
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
305
305
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
306
306
|
registries?: Record<string, string | {
|
|
307
307
|
url: string;
|
|
@@ -335,7 +335,7 @@ declare const workspaceConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
335
335
|
}>;
|
|
336
336
|
iconLibrary: z.ZodOptional<z.ZodString>;
|
|
337
337
|
rtl: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
338
|
-
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>;
|
|
338
|
+
menuColor: z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>;
|
|
339
339
|
menuAccent: z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>;
|
|
340
340
|
aliases: z.ZodObject<{
|
|
341
341
|
components: z.ZodString;
|
|
@@ -429,7 +429,7 @@ declare const workspaceConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
429
429
|
$schema?: string | undefined;
|
|
430
430
|
iconLibrary?: string | undefined;
|
|
431
431
|
rtl?: boolean | undefined;
|
|
432
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
432
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
433
433
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
434
434
|
registries?: Record<string, string | {
|
|
435
435
|
url: string;
|
|
@@ -467,7 +467,7 @@ declare const workspaceConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
467
467
|
tsx?: boolean | undefined;
|
|
468
468
|
iconLibrary?: string | undefined;
|
|
469
469
|
rtl?: boolean | undefined;
|
|
470
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
470
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
471
471
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
472
472
|
registries?: Record<string, string | {
|
|
473
473
|
url: string;
|
|
@@ -851,7 +851,7 @@ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
851
851
|
}>>;
|
|
852
852
|
iconLibrary: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
853
853
|
rtl: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
854
|
-
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>>;
|
|
854
|
+
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>>;
|
|
855
855
|
menuAccent: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>>;
|
|
856
856
|
aliases: z.ZodOptional<z.ZodObject<{
|
|
857
857
|
components: z.ZodOptional<z.ZodString>;
|
|
@@ -899,7 +899,7 @@ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
899
899
|
tsx?: boolean | undefined;
|
|
900
900
|
iconLibrary?: string | undefined;
|
|
901
901
|
rtl?: boolean | undefined;
|
|
902
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
902
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
903
903
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
904
904
|
aliases?: {
|
|
905
905
|
components?: string | undefined;
|
|
@@ -927,7 +927,7 @@ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
927
927
|
tsx?: boolean | undefined;
|
|
928
928
|
iconLibrary?: string | undefined;
|
|
929
929
|
rtl?: boolean | undefined;
|
|
930
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
930
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
931
931
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
932
932
|
aliases?: {
|
|
933
933
|
components?: string | undefined;
|
|
@@ -968,7 +968,7 @@ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
968
968
|
tsx?: boolean | undefined;
|
|
969
969
|
iconLibrary?: string | undefined;
|
|
970
970
|
rtl?: boolean | undefined;
|
|
971
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
971
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
972
972
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
973
973
|
aliases?: {
|
|
974
974
|
components?: string | undefined;
|
|
@@ -1036,7 +1036,7 @@ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
1036
1036
|
tsx?: boolean | undefined;
|
|
1037
1037
|
iconLibrary?: string | undefined;
|
|
1038
1038
|
rtl?: boolean | undefined;
|
|
1039
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
1039
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
1040
1040
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
1041
1041
|
aliases?: {
|
|
1042
1042
|
components?: string | undefined;
|
|
@@ -1578,7 +1578,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
1578
1578
|
}>>;
|
|
1579
1579
|
iconLibrary: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1580
1580
|
rtl: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
1581
|
-
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>>;
|
|
1581
|
+
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>>;
|
|
1582
1582
|
menuAccent: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>>;
|
|
1583
1583
|
aliases: z.ZodOptional<z.ZodObject<{
|
|
1584
1584
|
components: z.ZodOptional<z.ZodString>;
|
|
@@ -1626,7 +1626,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
1626
1626
|
tsx?: boolean | undefined;
|
|
1627
1627
|
iconLibrary?: string | undefined;
|
|
1628
1628
|
rtl?: boolean | undefined;
|
|
1629
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
1629
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
1630
1630
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
1631
1631
|
aliases?: {
|
|
1632
1632
|
components?: string | undefined;
|
|
@@ -1654,7 +1654,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
1654
1654
|
tsx?: boolean | undefined;
|
|
1655
1655
|
iconLibrary?: string | undefined;
|
|
1656
1656
|
rtl?: boolean | undefined;
|
|
1657
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
1657
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
1658
1658
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
1659
1659
|
aliases?: {
|
|
1660
1660
|
components?: string | undefined;
|
|
@@ -1695,7 +1695,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
1695
1695
|
tsx?: boolean | undefined;
|
|
1696
1696
|
iconLibrary?: string | undefined;
|
|
1697
1697
|
rtl?: boolean | undefined;
|
|
1698
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
1698
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
1699
1699
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
1700
1700
|
aliases?: {
|
|
1701
1701
|
components?: string | undefined;
|
|
@@ -1763,7 +1763,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
1763
1763
|
tsx?: boolean | undefined;
|
|
1764
1764
|
iconLibrary?: string | undefined;
|
|
1765
1765
|
rtl?: boolean | undefined;
|
|
1766
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
1766
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
1767
1767
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
1768
1768
|
aliases?: {
|
|
1769
1769
|
components?: string | undefined;
|
|
@@ -2210,7 +2210,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
2210
2210
|
tsx?: boolean | undefined;
|
|
2211
2211
|
iconLibrary?: string | undefined;
|
|
2212
2212
|
rtl?: boolean | undefined;
|
|
2213
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2213
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2214
2214
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2215
2215
|
aliases?: {
|
|
2216
2216
|
components?: string | undefined;
|
|
@@ -2369,7 +2369,7 @@ declare const registrySchema: z.ZodObject<{
|
|
|
2369
2369
|
tsx?: boolean | undefined;
|
|
2370
2370
|
iconLibrary?: string | undefined;
|
|
2371
2371
|
rtl?: boolean | undefined;
|
|
2372
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2372
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2373
2373
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2374
2374
|
aliases?: {
|
|
2375
2375
|
components?: string | undefined;
|
|
@@ -2615,7 +2615,7 @@ declare const registryIndexSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z
|
|
|
2615
2615
|
}>>;
|
|
2616
2616
|
iconLibrary: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
2617
2617
|
rtl: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
2618
|
-
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted"]>>>>;
|
|
2618
|
+
menuColor: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>>>>;
|
|
2619
2619
|
menuAccent: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["subtle", "bold"]>>>>;
|
|
2620
2620
|
aliases: z.ZodOptional<z.ZodObject<{
|
|
2621
2621
|
components: z.ZodOptional<z.ZodString>;
|
|
@@ -2663,7 +2663,7 @@ declare const registryIndexSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z
|
|
|
2663
2663
|
tsx?: boolean | undefined;
|
|
2664
2664
|
iconLibrary?: string | undefined;
|
|
2665
2665
|
rtl?: boolean | undefined;
|
|
2666
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2666
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2667
2667
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2668
2668
|
aliases?: {
|
|
2669
2669
|
components?: string | undefined;
|
|
@@ -2691,7 +2691,7 @@ declare const registryIndexSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z
|
|
|
2691
2691
|
tsx?: boolean | undefined;
|
|
2692
2692
|
iconLibrary?: string | undefined;
|
|
2693
2693
|
rtl?: boolean | undefined;
|
|
2694
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2694
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2695
2695
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2696
2696
|
aliases?: {
|
|
2697
2697
|
components?: string | undefined;
|
|
@@ -2732,7 +2732,7 @@ declare const registryIndexSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z
|
|
|
2732
2732
|
tsx?: boolean | undefined;
|
|
2733
2733
|
iconLibrary?: string | undefined;
|
|
2734
2734
|
rtl?: boolean | undefined;
|
|
2735
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2735
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2736
2736
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2737
2737
|
aliases?: {
|
|
2738
2738
|
components?: string | undefined;
|
|
@@ -2800,7 +2800,7 @@ declare const registryIndexSchema: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z
|
|
|
2800
2800
|
tsx?: boolean | undefined;
|
|
2801
2801
|
iconLibrary?: string | undefined;
|
|
2802
2802
|
rtl?: boolean | undefined;
|
|
2803
|
-
menuColor?: "default" | "inverted" | undefined;
|
|
2803
|
+
menuColor?: "default" | "inverted" | "default-translucent" | "inverted-translucent" | undefined;
|
|
2804
2804
|
menuAccent?: "bold" | "subtle" | undefined;
|
|
2805
2805
|
aliases?: {
|
|
2806
2806
|
components?: string | undefined;
|
|
@@ -3870,14 +3870,14 @@ declare const presetSchema: z.ZodObject<{
|
|
|
3870
3870
|
font: z.ZodString;
|
|
3871
3871
|
rtl: z.ZodDefault<z.ZodBoolean>;
|
|
3872
3872
|
menuAccent: z.ZodEnum<["subtle", "bold"]>;
|
|
3873
|
-
menuColor: z.ZodEnum<["default", "inverted"]>;
|
|
3873
|
+
menuColor: z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>;
|
|
3874
3874
|
radius: z.ZodString;
|
|
3875
3875
|
}, "strip", z.ZodTypeAny, {
|
|
3876
3876
|
style: string;
|
|
3877
3877
|
baseColor: string;
|
|
3878
3878
|
iconLibrary: string;
|
|
3879
3879
|
rtl: boolean;
|
|
3880
|
-
menuColor: "default" | "inverted";
|
|
3880
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3881
3881
|
menuAccent: "bold" | "subtle";
|
|
3882
3882
|
theme: string;
|
|
3883
3883
|
name: string;
|
|
@@ -3890,7 +3890,7 @@ declare const presetSchema: z.ZodObject<{
|
|
|
3890
3890
|
style: string;
|
|
3891
3891
|
baseColor: string;
|
|
3892
3892
|
iconLibrary: string;
|
|
3893
|
-
menuColor: "default" | "inverted";
|
|
3893
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3894
3894
|
menuAccent: "bold" | "subtle";
|
|
3895
3895
|
theme: string;
|
|
3896
3896
|
name: string;
|
|
@@ -3915,14 +3915,14 @@ declare const configJsonSchema: z.ZodObject<{
|
|
|
3915
3915
|
font: z.ZodString;
|
|
3916
3916
|
rtl: z.ZodDefault<z.ZodBoolean>;
|
|
3917
3917
|
menuAccent: z.ZodEnum<["subtle", "bold"]>;
|
|
3918
|
-
menuColor: z.ZodEnum<["default", "inverted"]>;
|
|
3918
|
+
menuColor: z.ZodEnum<["default", "inverted", "default-translucent", "inverted-translucent"]>;
|
|
3919
3919
|
radius: z.ZodString;
|
|
3920
3920
|
}, "strip", z.ZodTypeAny, {
|
|
3921
3921
|
style: string;
|
|
3922
3922
|
baseColor: string;
|
|
3923
3923
|
iconLibrary: string;
|
|
3924
3924
|
rtl: boolean;
|
|
3925
|
-
menuColor: "default" | "inverted";
|
|
3925
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3926
3926
|
menuAccent: "bold" | "subtle";
|
|
3927
3927
|
theme: string;
|
|
3928
3928
|
name: string;
|
|
@@ -3935,7 +3935,7 @@ declare const configJsonSchema: z.ZodObject<{
|
|
|
3935
3935
|
style: string;
|
|
3936
3936
|
baseColor: string;
|
|
3937
3937
|
iconLibrary: string;
|
|
3938
|
-
menuColor: "default" | "inverted";
|
|
3938
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3939
3939
|
menuAccent: "bold" | "subtle";
|
|
3940
3940
|
theme: string;
|
|
3941
3941
|
name: string;
|
|
@@ -3952,7 +3952,7 @@ declare const configJsonSchema: z.ZodObject<{
|
|
|
3952
3952
|
baseColor: string;
|
|
3953
3953
|
iconLibrary: string;
|
|
3954
3954
|
rtl: boolean;
|
|
3955
|
-
menuColor: "default" | "inverted";
|
|
3955
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3956
3956
|
menuAccent: "bold" | "subtle";
|
|
3957
3957
|
theme: string;
|
|
3958
3958
|
name: string;
|
|
@@ -3967,7 +3967,7 @@ declare const configJsonSchema: z.ZodObject<{
|
|
|
3967
3967
|
style: string;
|
|
3968
3968
|
baseColor: string;
|
|
3969
3969
|
iconLibrary: string;
|
|
3970
|
-
menuColor: "default" | "inverted";
|
|
3970
|
+
menuColor: "default" | "inverted" | "default-translucent" | "inverted-translucent";
|
|
3971
3971
|
menuAccent: "bold" | "subtle";
|
|
3972
3972
|
theme: string;
|
|
3973
3973
|
name: string;
|
package/dist/schema/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{z as configJsonSchema,d as configSchema,r as iconsSchema,y as presetSchema,c as rawConfigSchema,w as registriesIndexSchema,x as registriesSchema,s as registryBaseColorSchema,a as registryConfigItemSchema,b as registryConfigSchema,p as registryIndexSchema,m as registryItemCommonSchema,j as registryItemCssSchema,i as registryItemCssVarsSchema,k as registryItemEnvVarsSchema,g as registryItemFileSchema,l as registryItemFontSchema,n as registryItemSchema,h as registryItemTailwindSchema,f as registryItemTypeSchema,t as registryResolvedItemsTreeSchema,o as registrySchema,u as searchResultItemSchema,v as searchResultsSchema,q as stylesSchema,e as workspaceConfigSchema}from'../chunk-
|
|
1
|
+
export{z as configJsonSchema,d as configSchema,r as iconsSchema,y as presetSchema,c as rawConfigSchema,w as registriesIndexSchema,x as registriesSchema,s as registryBaseColorSchema,a as registryConfigItemSchema,b as registryConfigSchema,p as registryIndexSchema,m as registryItemCommonSchema,j as registryItemCssSchema,i as registryItemCssVarsSchema,k as registryItemEnvVarsSchema,g as registryItemFileSchema,l as registryItemFontSchema,n as registryItemSchema,h as registryItemTailwindSchema,f as registryItemTypeSchema,t as registryResolvedItemsTreeSchema,o as registrySchema,u as searchResultItemSchema,v as searchResultsSchema,q as stylesSchema,e as workspaceConfigSchema}from'../chunk-BFLSSWBX.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{e as transformDirection,c as transformIcons,f as transformMenu}from'../chunk-
|
|
1
|
+
export{e as transformDirection,c as transformIcons,f as transformMenu}from'../chunk-JPE2JKEP.js';import'../chunk-CHWMSXYA.js';import R from'postcss';import W from'postcss-selector-parser';import {z}from'zod';import {Project,ScriptKind,SyntaxKind,Node}from'ts-morph';import {twMerge}from'tailwind-merge';var b="cn-",D=z.record(z.string().startsWith(b),z.string());function k(t){let e=R.parse(t),n={};return e.walkRules(i=>{let r=i.selectors??[];if(r.length===0)return;let o=X(i);if(o)for(let c of r){let f=B(c);W(s=>{s.each(g=>{let l=_(g);if(!l)return;let p=l.value;p.startsWith(b)&&(n[p]=n[p]?`${o} ${n[p]}`:o);});}).processSync(f);}}),D.parse(n)}function B(t){return t.replace(/\s*&\s*/g,"").trim()}function X(t){let e=[];for(let n of t.nodes||[])if(n.type==="atrule"&&n.name==="apply"){let i=n.params.trim();i&&e.push(i);}return e.length===0?null:e.join(" ")}function _(t){let e=[];return t.walkClasses(n=>{n.value.startsWith(b)&&e.push(n);}),e.length===0?null:e[e.length-1]}var C=new Set(["cn-menu-target","cn-menu-translucent","cn-logical-sides","cn-rtl-flip"]);function m(t){return Node.isStringLiteral(t)||Node.isNoSubstitutionTemplateLiteral(t)}var w=async({sourceFile:t,styleMap:e})=>{let n=new Set;return G(t,e,n),H(t,e,n),Y(t,e,n),t};function O(t,e,n){let i=t.getLiteralText(),r=y(i);if(r.length===0)return;let o=r.filter(s=>!n.has(s));if(o.length===0){let s=x(i);t.setLiteralValue(s);return}let f=o.filter(s=>!C.has(s)).map(s=>e[s]).filter(s=>!!s);if(f.length>0){let s=f.join(" "),g=x(E(s,i));t.setLiteralValue(g),o.forEach(l=>n.add(l));}else {let s=x(i);t.setLiteralValue(s);}}function G(t,e,n){t.forEachDescendant(i=>{if(!Node.isCallExpression(i))return;let r=i.getExpression();if(!Node.isIdentifier(r)||r.getText()!=="cva")return;let o=i.getArguments()[0];Node.isStringLiteral(o)&&O(o,e,n);let c=i.getArguments()[1];if(!c||!Node.isObjectLiteralExpression(c))return;let f=c.getProperties().find(g=>Node.isPropertyAssignment(g)&&Node.isIdentifier(g.getNameNode())&&g.getNameNode().getText()==="variants");if(!f||!Node.isPropertyAssignment(f))return;let s=f.getInitializer();!s||!Node.isObjectLiteralExpression(s)||s.getProperties().forEach(g=>{if(!Node.isPropertyAssignment(g))return;let l=g.getInitializer();!l||!Node.isObjectLiteralExpression(l)||l.getProperties().forEach(p=>{if(!Node.isPropertyAssignment(p))return;let u=p.getInitializer();u&&Node.isStringLiteral(u)&&O(u,e,n);});});});}function H(t,e,n){t.forEachDescendant(i=>{if(!Node.isJsxAttribute(i)||i.getNameNode().getText()!=="className")return;let r=i.getInitializer();if(!r)return;let o=Q(r);if(o.length===0)return;let c=i.getParent()?.getParent();if(!c||!Node.isJsxOpeningElement(c)&&!Node.isJsxSelfClosingElement(c))return;let f=o.filter(l=>!n.has(l));if(f.length===0){$(r);return}let g=f.filter(l=>!C.has(l)).map(l=>e[l]).filter(l=>!!l);if(g.length>0){let l=g.join(" ");U(c,l);}else $(r);});}function Q(t){let e=[];if(m(t))return y(t.getLiteralText());if(!Node.isJsxExpression(t))return e;let n=t.getExpression();if(!n)return e;if(m(n))return y(n.getLiteralText());if(Node.isCallExpression(n)&&h(n))for(let i of n.getArguments())m(i)&&e.push(...y(i.getLiteralText()));return e}function $(t){if(m(t)){let n=x(t.getLiteralText());t.setLiteralValue(n);return}if(!Node.isJsxExpression(t))return;let e=t.getExpression();if(e){if(m(e)){let n=x(e.getLiteralText());e.setLiteralValue(n);return}if(Node.isCallExpression(e)&&h(e)){for(let n of e.getArguments())if(m(n)){let i=x(n.getLiteralText());n.setLiteralValue(i);}L(e);}}}function y(t){let e=t.matchAll(/\bcn-[\w-]+\b/g);return Array.from(e,n=>n[0])}function x(t){return t.replace(/\bcn-[\w-]+\b/g,e=>C.has(e)?e:"").replace(/\s+/g," ").trim()}function L(t){if(!h(t))return;let e=t.getArguments(),n=e.filter(i=>m(i)?i.getLiteralText().trim()!=="":true);if(n.length!==e.length){let i=n.map(o=>o.getText()),r=t.getParent();r&&Node.isJsxExpression(r)?r.replaceWithText(`{cn(${i.join(", ")})}`):t.replaceWithText(`cn(${i.join(", ")})`);}}function U(t,e){if(!Node.isJsxOpeningElement(t)&&!Node.isJsxSelfClosingElement(t))return;let n=t.getAttributes().find(o=>Node.isJsxAttribute(o)&&o.getNameNode().getText()==="className");if(!n||!Node.isJsxAttribute(n)){t.addAttribute({name:"className",initializer:`{cn(${JSON.stringify(e)})}`});return}let i=n.getInitializer();if(!i){n.setInitializer(`{cn(${JSON.stringify(e)})}`);return}if(m(i)){let o=i.getLiteralText(),c=x(E(e,o));i.setLiteralValue(c);return}if(!Node.isJsxExpression(i))return;let r=i.getExpression();if(!r){n.setInitializer(`{cn(${JSON.stringify(e)})}`);return}if(m(r)){let o=r.getLiteralText(),c=x(E(e,o));r.setLiteralValue(c);return}if(Node.isCallExpression(r)&&h(r)){let o=r.getArguments()[0];if(m(o)){let s=o.getLiteralText(),g=x(E(e,s));o.setLiteralValue(g);for(let l=1;l<r.getArguments().length;l++){let p=r.getArguments()[l];if(m(p)){let u=p.getLiteralText(),d=x(u);d!==u&&p.setLiteralValue(d);}}L(r);return}let c=r.getArguments().map(s=>{if(m(s)){let g=x(s.getLiteralText());return g?JSON.stringify(g):null}return s.getText()}).filter(s=>s!==null),f=[JSON.stringify(e),...c];n.setInitializer(`{cn(${f.join(", ")})}`);return}n.setInitializer(`{cn(${JSON.stringify(e)}, ${r.getText()})}`);}function E(t,e){return twMerge(t,e)}function h(t){let e=t.getExpression();return Node.isIdentifier(e)&&e.getText()==="cn"}function Y(t,e,n){t.forEachDescendant(i=>{if(!Node.isCallExpression(i))return;let r=i.getExpression();if(!(!Node.isIdentifier(r)||r.getText()!=="mergeProps"))for(let o of i.getArguments()){if(!Node.isObjectLiteralExpression(o))continue;let c=o.getProperties().find(s=>Node.isPropertyAssignment(s)&&Node.isIdentifier(s.getNameNode())&&s.getNameNode().getText()==="className");if(!c||!Node.isPropertyAssignment(c))continue;let f=c.getInitializer();if(f&&Node.isCallExpression(f)&&h(f)){let s=Z(f);if(s.length===0)continue;let g=s.filter(u=>!n.has(u));if(g.length===0){P(f);continue}let p=g.filter(u=>!C.has(u)).map(u=>e[u]).filter(u=>!!u);if(p.length>0){let u=p.join(" ");tt(f,u,n,g);}else P(f);}}});}function Z(t){let e=[];for(let n of t.getArguments())m(n)&&e.push(...y(n.getLiteralText()));return e}function P(t){for(let e of t.getArguments())if(m(e)){let n=x(e.getLiteralText());e.setLiteralValue(n);}L(t);}function tt(t,e,n,i){let r=t.getArguments()[0];if(m(r)){let s=r.getLiteralText(),g=x(E(e,s));r.setLiteralValue(g),i.forEach(l=>n.add(l));for(let l=1;l<t.getArguments().length;l++){let p=t.getArguments()[l];if(m(p)){let u=p.getLiteralText(),d=x(u);d!==u&&p.setLiteralValue(d);}}L(t);return}let o=t.getArguments().map(s=>{if(m(s)){let g=x(s.getLiteralText());return g?JSON.stringify(g):null}return s.getText()}).filter(s=>s!==null),c=[JSON.stringify(e),...o];i.forEach(s=>n.add(s)),t.getParent()&&t.replaceWithText(`cn(${c.join(", ")})`);}async function rt(t,{styleMap:e,transformers:n=[w]}){let r=new Project({useInMemoryFileSystem:true}).createSourceFile("component.tsx",t,{scriptKind:ScriptKind.TSX,overwrite:true});for(let o of n)await o({sourceFile:r,styleMap:e});return r.getText()}var st=async({sourceFile:t,config:e})=>{if(!e.style?.startsWith("base-"))return t;let n=[],i=t.getDescendantsOfKind(SyntaxKind.JsxElement);for(let r of i){let o=r.getOpeningElement(),c=o.getAttribute("render");if(!c)continue;let s=r.getJsxChildren().map(S=>S.getText()).join("").trim();if(!s||c.getKind()!==SyntaxKind.JsxAttribute)continue;let l=c.asKindOrThrow(SyntaxKind.JsxAttribute).getInitializer();if(!l||l.getKind()!==SyntaxKind.JsxExpression)continue;let u=l.asKindOrThrow(SyntaxKind.JsxExpression).getExpression();if(!u||u.getKind()!==SyntaxKind.JsxSelfClosingElement)continue;let d=u.asKindOrThrow(SyntaxKind.JsxSelfClosingElement),A=d.getTagNameNode().getText(),I=d.getAttributes().map(S=>S.getText()).join(" "),J=I?`{<${A} ${I}>${s}</${A}>}`:`{<${A}>${s}</${A}>}`,M=o.getTagNameNode().getText(),j=o.getAttributes().filter(S=>S.getKind()===SyntaxKind.JsxAttribute?S.asKindOrThrow(SyntaxKind.JsxAttribute).getNameNode().getText()!=="render":true).map(S=>S.getText()).join(" "),V=j?`${j} render=${J}`:`render=${J}`,F=`<${M} ${V} />`;n.push({elementStart:r.getStart(),elementEnd:r.getEnd(),newText:F});}for(let r of n.reverse()){let o=t.getFullText(),c=o.substring(0,r.elementStart)+r.newText+o.substring(r.elementEnd);t.replaceWithText(c);}return t};export{k as createStyleMap,st as transformRender,rt as transformStyle};
|
package/package.json
CHANGED
package/dist/chunk-FFSLICO3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {z as z$1}from'zod';var c=z$1.union([z$1.string().refine(e=>e.includes("{name}"),{message:"Registry URL must include {name} placeholder"}),z$1.object({url:z$1.string().refine(e=>e.includes("{name}"),{message:"Registry URL must include {name} placeholder"}),params:z$1.record(z$1.string(),z$1.string()).optional(),headers:z$1.record(z$1.string(),z$1.string()).optional()})]),l=z$1.record(z$1.string().refine(e=>e.startsWith("@"),{message:"Registry names must start with @ (e.g., @v0, @acme)"}),c),n=z$1.object({$schema:z$1.string().optional(),style:z$1.string(),rsc:z$1.coerce.boolean().default(false),tsx:z$1.coerce.boolean().default(true),tailwind:z$1.object({config:z$1.string().optional(),css:z$1.string(),baseColor:z$1.string(),cssVariables:z$1.boolean().default(true),prefix:z$1.string().default("").optional()}),iconLibrary:z$1.string().optional(),rtl:z$1.coerce.boolean().default(false).optional(),menuColor:z$1.enum(["default","inverted"]).default("default").optional(),menuAccent:z$1.enum(["subtle","bold"]).default("subtle").optional(),aliases:z$1.object({components:z$1.string(),utils:z$1.string(),ui:z$1.string().optional(),lib:z$1.string().optional(),hooks:z$1.string().optional()}),registries:l.optional()}).strict(),p=n.extend({resolvedPaths:z$1.object({cwd:z$1.string(),tailwindConfig:z$1.string(),tailwindCss:z$1.string(),utils:z$1.string(),components:z$1.string(),lib:z$1.string(),hooks:z$1.string(),ui:z$1.string()})}),x=z$1.record(p),s=z$1.enum(["registry:lib","registry:block","registry:component","registry:ui","registry:hook","registry:page","registry:file","registry:theme","registry:style","registry:item","registry:base","registry:font","registry:example","registry:internal"]),m=z$1.discriminatedUnion("type",[z$1.object({path:z$1.string(),content:z$1.string().optional(),type:z$1.enum(["registry:file","registry:page"]),target:z$1.string()}),z$1.object({path:z$1.string(),content:z$1.string().optional(),type:s.exclude(["registry:file","registry:page"]),target:z$1.string().optional()})]),y=z$1.object({config:z$1.object({content:z$1.array(z$1.string()).optional(),theme:z$1.record(z$1.string(),z$1.any()).optional(),plugins:z$1.array(z$1.string()).optional()}).optional()}),i=z$1.object({theme:z$1.record(z$1.string(),z$1.string()).optional(),light:z$1.record(z$1.string(),z$1.string()).optional(),dark:z$1.record(z$1.string(),z$1.string()).optional()}),o=z$1.lazy(()=>z$1.union([z$1.string(),z$1.array(z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.string())])),z$1.record(z$1.string(),o)])),d=z$1.record(z$1.string(),o),u=z$1.record(z$1.string(),z$1.string()),a=z$1.object({family:z$1.string(),provider:z$1.literal("google"),import:z$1.string(),variable:z$1.string(),weight:z$1.array(z$1.string()).optional(),subsets:z$1.array(z$1.string()).optional(),selector:z$1.string().optional()}),r=z$1.object({$schema:z$1.string().optional(),extends:z$1.string().optional(),name:z$1.string(),title:z$1.string().optional(),author:z$1.string().min(2).optional(),description:z$1.string().optional(),dependencies:z$1.array(z$1.string()).optional(),devDependencies:z$1.array(z$1.string()).optional(),registryDependencies:z$1.array(z$1.string()).optional(),files:z$1.array(m).optional(),tailwind:y.optional(),cssVars:i.optional(),css:d.optional(),envVars:u.optional(),meta:z$1.record(z$1.string(),z$1.any()).optional(),docs:z$1.string().optional(),categories:z$1.array(z$1.string()).optional()}),g=z$1.discriminatedUnion("type",[r.extend({type:z$1.literal("registry:base"),config:n.deepPartial().optional()}),r.extend({type:z$1.literal("registry:font"),font:a}),r.extend({type:s.exclude(["registry:base","registry:font"])})]),S=z$1.object({name:z$1.string(),homepage:z$1.string(),items:z$1.array(g)}),j=z$1.array(g),I=z$1.array(z$1.object({name:z$1.string(),label:z$1.string()})),C=z$1.record(z$1.string(),z$1.record(z$1.string(),z$1.string())),R=z$1.object({inlineColors:z$1.object({light:z$1.record(z$1.string(),z$1.string()),dark:z$1.record(z$1.string(),z$1.string())}),cssVars:i,cssVarsV4:i.optional(),inlineColorsTemplate:z$1.string(),cssVarsTemplate:z$1.string()}),v=r.pick({dependencies:true,devDependencies:true,files:true,tailwind:true,cssVars:true,css:true,envVars:true,docs:true}).extend({fonts:z$1.array(r.extend({type:z$1.literal("registry:font"),font:a})).optional()}),f=z$1.object({name:z$1.string(),type:z$1.string().optional(),description:z$1.string().optional(),registry:z$1.string(),addCommandArgument:z$1.string()}),V=z$1.object({pagination:z$1.object({total:z$1.number(),offset:z$1.number(),limit:z$1.number(),hasMore:z$1.boolean()}),items:z$1.array(f)}),w=z$1.record(z$1.string().regex(/^@[a-zA-Z0-9][a-zA-Z0-9-_]*$/),z$1.string()),z=z$1.array(z$1.object({name:z$1.string(),homepage:z$1.string().optional(),url:z$1.string(),description:z$1.string().optional()})),h=z$1.object({name:z$1.string(),title:z$1.string(),description:z$1.string(),base:z$1.string(),style:z$1.string(),baseColor:z$1.string(),theme:z$1.string(),iconLibrary:z$1.string(),font:z$1.string(),rtl:z$1.coerce.boolean().default(false),menuAccent:z$1.enum(["subtle","bold"]),menuColor:z$1.enum(["default","inverted"]),radius:z$1.string()}),k=z$1.object({presets:z$1.array(h)});export{c as a,l as b,n as c,p as d,x as e,s as f,m as g,y as h,i,d as j,u as k,a as l,r as m,g as n,S as o,j as p,I as q,C as r,R as s,v as t,f as u,V as v,w,z as x,h as y,k as z};
|
package/dist/chunk-IMJ4D25X.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-CHWMSXYA.js';import {SyntaxKind,Project,ScriptKind}from'ts-morph';var H=async({sourceFile:i,config:e})=>{let s=e.iconLibrary;if(!s||!(s in a))return i;let r=s,t=a[r],a$1=[];for(let l of i.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement)){if(l.getTagNameNode()?.getText()!=="IconPlaceholder")continue;let f=l.getAttributes().find(g=>g.getKind()!==SyntaxKind.JsxAttribute?false:g.asKindOrThrow(SyntaxKind.JsxAttribute).getNameNode().getText()===r);if(!f)continue;let n=f.asKindOrThrow(SyntaxKind.JsxAttribute),c=n.getInitializer()?.getText().replace(/^["']|["']$/g,"");if(!c)continue;a$1.includes(c)||a$1.push(c);let u=t.usage.match(/<(\w+)([^>]*)\s*\/>/);n.remove();for(let g of l.getAttributes()){if(g.getKind()!==SyntaxKind.JsxAttribute)continue;let x=g.asKindOrThrow(SyntaxKind.JsxAttribute);x.getNameNode().getText()in a&&x.remove();}if(!u){l.getTagNameNode()?.replaceWithText(c);continue}let[,N,A]=u;if(N==="ICON"){let g=l.getAttributes().filter(x=>x.getKind()!==SyntaxKind.JsxAttribute?true:!(x.asKindOrThrow(SyntaxKind.JsxAttribute).getNameNode().getText()in a)).map(x=>x.getText()).join(" ");g.trim()?l.replaceWithText(`<${c} ${g} />`):l.getTagNameNode()?.replaceWithText(c);}else {let g=new Set(l.getAttributes().filter(m=>m.getKind()===SyntaxKind.JsxAttribute).map(m=>m.asKindOrThrow(SyntaxKind.JsxAttribute).getNameNode().getText())),S=A.replace(/\{ICON\}/g,`{${c}}`).trim().split(/\s+(?=\w+=)/).filter(m=>m).map(m=>{let K=m.split("=")[0];return K&&!g.has(K)?m:null}).filter(Boolean),E=l.getAttributes().filter(m=>m.getKind()!==SyntaxKind.JsxAttribute?true:!(m.asKindOrThrow(SyntaxKind.JsxAttribute).getNameNode().getText()in a)).map(m=>m.getText()).join(" "),$=[...S,E].filter(Boolean).join(" ");l.replaceWithText(`<${N} ${$} />`);}}for(let l of i.getImportDeclarations()??[])if(l.getModuleSpecifier()?.getText()?.includes("icon-placeholder")){let c=(l.getNamedImports()??[]).find(d=>d.getName()==="IconPlaceholder");c&&c.remove(),l.getNamedImports()?.length===0&&l.remove();}if(a$1.length>0){let l=t.import.split(`
|
|
2
|
-
`),f=[];for(let n of l){let c=n.match(/import\s+{([^}]+)}\s+from\s+['"]([^'"]+)['"]/);if(!c)continue;let[,d,u]=c,N=d.split(",").map(g=>g.trim()).map(g=>g==="ICON"?a$1.map(x=>({name:x})):{name:g}).flat(),A=i.addImportDeclaration({moduleSpecifier:u,namedImports:N});f.push(A);}if(!L(i))for(let n of f)n.replaceWithText(n.getText().replace(";",""));}return i};function L(i){return i.getImportDeclarations()?.[0]?.getText().endsWith(";")??false}var F=async({sourceFile:i,config:e,baseColor:s})=>(e.tailwind?.cssVariables||!s?.inlineColors||i.getDescendantsOfKind(SyntaxKind.StringLiteral).forEach(r=>{let t=r.getLiteralText(),a=z(t,s.inlineColors).trim();a!==t&&r.setLiteralValue(a);}),i);function I(i){if(!i.includes("/")&&!i.includes(":"))return [null,i,null];let e=-1,s=0;for(let n=i.length-1;n>=0;n--){let c=i[n];if(c==="]")s++;else if(c==="[")s--;else if(c===":"&&s===0){e=n;break}}let r=null,t;e===-1?t=i:(r=i.slice(0,e),t=i.slice(e+1));let a=t.lastIndexOf("/");if(a===-1)return [r,t,null];let l=t.slice(0,a),f=t.slice(a+1);return [r,l,f]}var D=["bg-","text-","border-","ring-offset-","ring-"];function z(i,e){i.includes(" border ")&&(i=i.replace(" border "," border border-border "));let s=i.split(" "),r=new Set,t=new Set;for(let a of s){let[l,f,n]=I(a),c=D.find(u=>f?.startsWith(u));if(!c){r.has(a)||r.add(a);continue}let d=f?.replace(c,"");if(d&&d in e.light){r.add([l,`${c}${e.light[d]}`].filter(Boolean).join(":")+(n?`/${n}`:"")),t.add(["dark",l,`${c}${e.dark[d]}`].filter(Boolean).join(":")+(n?`/${n}`:""));continue}r.has(a)||r.add(a);}return [...Array.from(r),...Array.from(t)].join(" ").trim()}var v=[["-ml-","-ms-"],["-mr-","-me-"],["ml-","ms-"],["mr-","me-"],["pl-","ps-"],["pr-","pe-"],["-left-","-start-"],["-right-","-end-"],["left-","start-"],["right-","end-"],["inset-l-","inset-inline-start-"],["inset-r-","inset-inline-end-"],["rounded-tl-","rounded-ss-"],["rounded-tr-","rounded-se-"],["rounded-bl-","rounded-es-"],["rounded-br-","rounded-ee-"],["rounded-l-","rounded-s-"],["rounded-r-","rounded-e-"],["border-l-","border-s-"],["border-r-","border-e-"],["border-l","border-s"],["border-r","border-e"],["text-left","text-start"],["text-right","text-end"],["scroll-ml-","scroll-ms-"],["scroll-mr-","scroll-me-"],["scroll-pl-","scroll-ps-"],["scroll-pr-","scroll-pe-"],["float-left","float-start"],["float-right","float-end"],["clear-left","clear-start"],["clear-right","clear-end"],["origin-top-left","origin-top-start"],["origin-top-right","origin-top-end"],["origin-bottom-left","origin-bottom-start"],["origin-bottom-right","origin-bottom-end"],["origin-left","origin-start"],["origin-right","origin-end"]],w=[["-translate-x-","translate-x-"],["translate-x-","-translate-x-"]],M=[["space-x-","space-x-reverse"],["divide-x-","divide-x-reverse"]],R=[["cursor-w-resize","cursor-e-resize"],["cursor-e-resize","cursor-w-resize"]],j=[["data-[side=inline-start]","slide-in-from-right","slide-in-from-end"],["data-[side=inline-start]","slide-out-to-right","slide-out-to-end"],["data-[side=inline-end]","slide-in-from-left","slide-in-from-start"],["data-[side=inline-end]","slide-out-to-left","slide-out-to-start"]],J="cn-rtl-flip",P=["ContextMenuContent","ContextMenuSubContent","DropdownMenuSubContent"],y={right:"inline-end",left:"inline-start"},V=["-left-","-right-","left-","right-"],nt=async({sourceFile:i,config:e})=>(e.rtl&&C(i),i);async function st(i,e){if(!e)return i;let r=new Project({useInMemoryFileSystem:true}).createSourceFile("component.tsx",i,{scriptKind:ScriptKind.TSX,overwrite:true});return C(r),r.getText()}function b(i){return i.replace(/^["']|["']$/g,"")}function h(i){let e=b(i.getText()??"");i.replaceWithText(`"${B(e)}"`);}function B(i){return i.split(" ").flatMap(e=>{if(e.startsWith("rtl:")||e.startsWith("ltr:"))return [e];if(e===J)return ["rtl:rotate-180"];let[s,r,t]=I(e);if(!r)return [e];for(let[n,c]of w)if(r.startsWith(n)){let d=r.replace(n,c),u=s?`rtl:${s}:${d}${t?`/${t}`:""}`:`rtl:${d}${t?`/${t}`:""}`;return [e,u]}for(let[n,c]of M)if(r.startsWith(n)){let d=s?`rtl:${s}:${c}`:`rtl:${c}`;return [e,d]}for(let[n,c]of R)if(r===n){let d=s?`rtl:${s}:${c}`:`rtl:${c}`;return [e,d]}for(let[n,c,d]of j)if(s?.includes(n)&&r.startsWith(c)){let u=r.replace(c,d);return [t?`${s}:${u}/${t}`:`${s}:${u}`]}let a=s?.includes("data-[side=left]")||s?.includes("data-[side=right]"),l=r;for(let[n,c]of v)if(!(a&&V.some(d=>n.startsWith(d)))&&r.startsWith(n)){if(!n.endsWith("-")&&r!==n)continue;l=r.replace(n,c);break}let f;return s?f=t?`${s}:${l}/${t}`:`${s}:${l}`:f=t?`${l}/${t}`:l,[f]}).join(" ")}function C(i){i.getDescendantsOfKind(SyntaxKind.CallExpression).filter(e=>e.getExpression().getText()==="cva").forEach(e=>{let s=e.getArguments()[0];s?.isKind(SyntaxKind.StringLiteral)&&h(s),e.getArguments()[1]?.isKind(SyntaxKind.ObjectLiteralExpression)&&e.getArguments()[1]?.getDescendantsOfKind(SyntaxKind.PropertyAssignment).find(r=>r.getName()==="variants")?.getDescendantsOfKind(SyntaxKind.PropertyAssignment).forEach(r=>{r.getDescendantsOfKind(SyntaxKind.PropertyAssignment).forEach(t=>{let a=t.getInitializerIfKind(SyntaxKind.StringLiteral);a&&h(a);});});}),i.getDescendantsOfKind(SyntaxKind.JsxAttribute).forEach(e=>{if(e.getNameNode().getText()==="className"){let s=e.getInitializer();if(s?.isKind(SyntaxKind.StringLiteral)&&h(s),e.getInitializer()?.isKind(SyntaxKind.JsxExpression)){let r=e.getInitializer()?.getDescendantsOfKind(SyntaxKind.CallExpression).find(t=>t.getExpression().getText()==="cn");r&&r.getArguments().forEach(t=>{(t.isKind(SyntaxKind.ConditionalExpression)||t.isKind(SyntaxKind.BinaryExpression))&&t.getChildrenOfKind(SyntaxKind.StringLiteral).forEach(h),t.isKind(SyntaxKind.StringLiteral)&&h(t);});}}e.getNameNode().getText()==="classNames"&&e.getInitializer()?.isKind(SyntaxKind.JsxExpression)&&e.getDescendantsOfKind(SyntaxKind.PropertyAssignment).forEach(s=>{if(s.getInitializer()?.isKind(SyntaxKind.CallExpression)){let t=s.getInitializerIfKind(SyntaxKind.CallExpression);t&&t.getArguments().forEach(a=>{a.isKind(SyntaxKind.ConditionalExpression)&&a.getChildrenOfKind(SyntaxKind.StringLiteral).forEach(h),a.isKind(SyntaxKind.StringLiteral)&&h(a);});}let r=s.getInitializer();r?.isKind(SyntaxKind.StringLiteral)&&s.getNameNode().getText()!=="variant"&&h(r);});}),i.getDescendantsOfKind(SyntaxKind.CallExpression).filter(e=>e.getExpression().getText()==="mergeProps").forEach(e=>{let s=e.getArguments()[0];if(s?.isKind(SyntaxKind.ObjectLiteralExpression)){let r=s.getProperties().find(t=>t.isKind(SyntaxKind.PropertyAssignment)&&t.getName()==="className");if(r?.isKind(SyntaxKind.PropertyAssignment)){let t=r.getInitializer();t?.isKind(SyntaxKind.CallExpression)&&t.getExpression().getText()==="cn"&&t.getArguments().forEach(a=>{a.isKind(SyntaxKind.StringLiteral)&&h(a),(a.isKind(SyntaxKind.ConditionalExpression)||a.isKind(SyntaxKind.BinaryExpression))&&a.getChildrenOfKind(SyntaxKind.StringLiteral).forEach(h);}),t?.isKind(SyntaxKind.StringLiteral)&&h(t);}}}),[...i.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),...i.getDescendantsOfKind(SyntaxKind.JsxOpeningElement)].forEach(e=>{let s=e.getTagNameNode().getText();if(!P.includes(s))return;let r=e.getAttributes().find(f=>f.isKind(SyntaxKind.JsxAttribute)&&f.getNameNode().getText()==="side");if(!r?.isKind(SyntaxKind.JsxAttribute))return;let t=r.getInitializer();if(!t?.isKind(SyntaxKind.StringLiteral))return;let a=b(t.getText()??""),l=y[a];l&&t.replaceWithText(`"${l}"`);}),i.getDescendantsOfKind(SyntaxKind.BindingElement).forEach(e=>{if(e.getNameNode().getText()!=="side")return;let t=e.getFirstAncestorByKind(SyntaxKind.FunctionDeclaration)?.getName();if(!t||!P.includes(t))return;let a=e.getInitializer();if(!a?.isKind(SyntaxKind.StringLiteral))return;let l=b(a.getText()??""),f=y[l];f&&a.replaceWithText(`"${f}"`);});}var lt=async({sourceFile:i,config:e})=>{let r=e.menuColor==="inverted"?"dark":"";for(let t of i.getDescendantsOfKind(SyntaxKind.JsxAttribute)){if(t.getNameNode().getText()!=="className")continue;let l=t.getInitializer();if(!l)continue;let f=l.getText();if(!f.includes("cn-menu-target"))continue;let n=f.replace(/cn-menu-target/g,r);r||(n=n.replace(/\s{2,}/g," "),n=n.replace(/"\s+/g,'"'),n=n.replace(/\s+"/g,'"'),n=n.replace(/,\s*""\s*,/g,","),n=n.replace(/\(\s*""\s*,/g,"("),n=n.replace(/,\s*""\s*\)/g,")")),t.setInitializer(n);}return i};export{F as a,I as b,H as c,nt as d,st as e,lt as f};
|
package/dist/chunk-K3VKXMEA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _=["radix","base"],u=["nova","vega","maia","lyra","mira"],f=["neutral","stone","zinc","gray","mauve","olive","mist","taupe"],E=["neutral","stone","zinc","gray","amber","blue","cyan","emerald","fuchsia","green","indigo","lime","orange","pink","purple","red","rose","sky","teal","violet","yellow","mauve","olive","mist","taupe"],c=["lucide","hugeicons","tabler","phosphor","remixicon"],S=["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"],p=["default","none","small","medium","large"],m=["subtle","bold"],b=["default","inverted"],i=[{key:"menuColor",values:b,bits:3},{key:"menuAccent",values:m,bits:3},{key:"radius",values:p,bits:4},{key:"font",values:S,bits:6},{key:"iconLibrary",values:c,bits:6},{key:"theme",values:E,bits:6},{key:"baseColor",values:f,bits:6},{key:"style",values:u,bits:6}],g=Object.fromEntries(i.map(e=>[e.key,e.values[0]])),a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l="a";function y(e){if(e===0)return "0";let t="",n=e;for(;n>0;)t=a[n%62]+t,n=Math.floor(n/62);return t}function P(e){let t=0;for(let n=0;n<e.length;n++){let r=a.indexOf(e[n]);if(r===-1)return -1;t=t*62+r;}return t}function R(e){let t={...g,...e},n=0,r=0;for(let o of i){let s=o.values.indexOf(t[o.key]);n+=(s===-1?0:s)*2**r,r+=o.bits;}return l+y(n)}function d(e){if(!e||e.length<2||e[0]!==l)return null;let t=P(e.slice(1));if(t<0)return null;let n={},r=0;for(let o of i){let s=Math.floor(t/2**r)%2**o.bits;n[o.key]=s<o.values.length?o.values[s]:o.values[0],r+=o.bits;}return n}function x(e){if(!e||e.length<2||e.length>10||e[0]!==l)return false;for(let t=1;t<e.length;t++)if(a.indexOf(e[t])===-1)return false;return true}function C(e){return d(e)!==null}function T(){let e=t=>t[Math.floor(Math.random()*t.length)];return Object.fromEntries(i.map(t=>[t.key,e(t.values)]))}function h(){return R(T())}export{_ as a,u as b,f as c,E as d,c as e,S as f,p as g,m as h,b as i,g as j,y as k,P as l,R as m,d as n,x as o,C as p,T as q,h as r};
|