@pandacss/generator 0.53.6 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +24 -6
- package/dist/index.mjs +24 -6
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -595,8 +595,17 @@ function generatePattern(ctx, filters) {
|
|
|
595
595
|
}).join("\n ")}
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
${strict ? import_outdent10.outdent`
|
|
598
|
+
${strict ? import_outdent10.outdent`
|
|
599
|
+
interface ${upperName}Styles extends ${upperName}Properties {}
|
|
599
600
|
|
|
601
|
+
interface ${upperName}PatternFn {
|
|
602
|
+
(styles?: ${upperName}Styles): string
|
|
603
|
+
raw: (styles?: ${upperName}Styles) => SystemStyleObject
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
607
|
+
export declare const ${baseName}: ${upperName}PatternFn;
|
|
608
|
+
` : import_outdent10.outdent`
|
|
600
609
|
interface ${upperName}Styles extends ${upperName}Properties, DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}> {}
|
|
601
610
|
|
|
602
611
|
interface ${upperName}PatternFn {
|
|
@@ -3825,7 +3834,7 @@ var categories = [
|
|
|
3825
3834
|
function generateTokenTypes(ctx) {
|
|
3826
3835
|
const { tokens } = ctx;
|
|
3827
3836
|
const set = /* @__PURE__ */ new Set();
|
|
3828
|
-
|
|
3837
|
+
const tokenSet = /* @__PURE__ */ new Set();
|
|
3829
3838
|
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
3830
3839
|
if (tokens.isEmpty) {
|
|
3831
3840
|
result.add("[token: string]: string");
|
|
@@ -3836,14 +3845,23 @@ function generateTokenTypes(ctx) {
|
|
|
3836
3845
|
}
|
|
3837
3846
|
for (const [key, value] of tokens.view.categoryMap.entries()) {
|
|
3838
3847
|
const typeName = (0, import_shared4.capitalize)(import_pluralize.default.singular(key));
|
|
3839
|
-
|
|
3840
|
-
|
|
3848
|
+
const categoryName = `${typeName}Token`;
|
|
3849
|
+
set.add(`export type ${categoryName} = ${(0, import_shared4.unionType)(value.keys())}`);
|
|
3850
|
+
tokenSet.add(`${key}.\${${categoryName}}`);
|
|
3851
|
+
result.add(` ${key}: ${categoryName}`);
|
|
3841
3852
|
}
|
|
3842
3853
|
}
|
|
3843
3854
|
result.add("} & { [token: string]: never }");
|
|
3844
3855
|
set.add(Array.from(result).join("\n"));
|
|
3845
3856
|
set.add(`export type TokenCategory = ${(0, import_shared4.unionType)(categories)}`);
|
|
3846
|
-
|
|
3857
|
+
const arr = Array.from(set);
|
|
3858
|
+
arr.unshift(
|
|
3859
|
+
`export type Token = ${(0, import_shared4.unionType)(tokenSet, {
|
|
3860
|
+
stringify: (t) => `\`${t}\``,
|
|
3861
|
+
fallback: "string"
|
|
3862
|
+
})}`
|
|
3863
|
+
);
|
|
3864
|
+
return import_outdent42.outdent.string(arr.join("\n\n"));
|
|
3847
3865
|
}
|
|
3848
3866
|
|
|
3849
3867
|
// src/artifacts/js/themes.ts
|
|
@@ -3868,7 +3886,7 @@ function generateTokenCss(ctx, sheet) {
|
|
|
3868
3886
|
const themeConds = themeVariants.map((key) => conditions.getThemeName(key));
|
|
3869
3887
|
const themePrefix = ctx.conditions.getThemeName("");
|
|
3870
3888
|
for (const [key, values] of tokens.view.vars.entries()) {
|
|
3871
|
-
const isThemeSkipped = key.startsWith(themePrefix) && !themeConds.some((condName) => key.startsWith(condName));
|
|
3889
|
+
const isThemeSkipped = key.startsWith(themePrefix) && !themeConds.some((condName) => key === condName || key.startsWith(condName + ":"));
|
|
3872
3890
|
if (isThemeSkipped) {
|
|
3873
3891
|
continue;
|
|
3874
3892
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -559,8 +559,17 @@ function generatePattern(ctx, filters) {
|
|
|
559
559
|
}).join("\n ")}
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
${strict ? outdent10`
|
|
562
|
+
${strict ? outdent10`
|
|
563
|
+
interface ${upperName}Styles extends ${upperName}Properties {}
|
|
563
564
|
|
|
565
|
+
interface ${upperName}PatternFn {
|
|
566
|
+
(styles?: ${upperName}Styles): string
|
|
567
|
+
raw: (styles?: ${upperName}Styles) => SystemStyleObject
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
${ctx.file.jsDocComment(description, { deprecated })}
|
|
571
|
+
export declare const ${baseName}: ${upperName}PatternFn;
|
|
572
|
+
` : outdent10`
|
|
564
573
|
interface ${upperName}Styles extends ${upperName}Properties, DistributiveOmit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}> {}
|
|
565
574
|
|
|
566
575
|
interface ${upperName}PatternFn {
|
|
@@ -3789,7 +3798,7 @@ var categories = [
|
|
|
3789
3798
|
function generateTokenTypes(ctx) {
|
|
3790
3799
|
const { tokens } = ctx;
|
|
3791
3800
|
const set = /* @__PURE__ */ new Set();
|
|
3792
|
-
|
|
3801
|
+
const tokenSet = /* @__PURE__ */ new Set();
|
|
3793
3802
|
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
3794
3803
|
if (tokens.isEmpty) {
|
|
3795
3804
|
result.add("[token: string]: string");
|
|
@@ -3800,14 +3809,23 @@ function generateTokenTypes(ctx) {
|
|
|
3800
3809
|
}
|
|
3801
3810
|
for (const [key, value] of tokens.view.categoryMap.entries()) {
|
|
3802
3811
|
const typeName = capitalize(pluralize.singular(key));
|
|
3803
|
-
|
|
3804
|
-
|
|
3812
|
+
const categoryName = `${typeName}Token`;
|
|
3813
|
+
set.add(`export type ${categoryName} = ${unionType4(value.keys())}`);
|
|
3814
|
+
tokenSet.add(`${key}.\${${categoryName}}`);
|
|
3815
|
+
result.add(` ${key}: ${categoryName}`);
|
|
3805
3816
|
}
|
|
3806
3817
|
}
|
|
3807
3818
|
result.add("} & { [token: string]: never }");
|
|
3808
3819
|
set.add(Array.from(result).join("\n"));
|
|
3809
3820
|
set.add(`export type TokenCategory = ${unionType4(categories)}`);
|
|
3810
|
-
|
|
3821
|
+
const arr = Array.from(set);
|
|
3822
|
+
arr.unshift(
|
|
3823
|
+
`export type Token = ${unionType4(tokenSet, {
|
|
3824
|
+
stringify: (t) => `\`${t}\``,
|
|
3825
|
+
fallback: "string"
|
|
3826
|
+
})}`
|
|
3827
|
+
);
|
|
3828
|
+
return outdent42.string(arr.join("\n\n"));
|
|
3811
3829
|
}
|
|
3812
3830
|
|
|
3813
3831
|
// src/artifacts/js/themes.ts
|
|
@@ -3832,7 +3850,7 @@ function generateTokenCss(ctx, sheet) {
|
|
|
3832
3850
|
const themeConds = themeVariants.map((key) => conditions.getThemeName(key));
|
|
3833
3851
|
const themePrefix = ctx.conditions.getThemeName("");
|
|
3834
3852
|
for (const [key, values] of tokens.view.vars.entries()) {
|
|
3835
|
-
const isThemeSkipped = key.startsWith(themePrefix) && !themeConds.some((condName) => key.startsWith(condName));
|
|
3853
|
+
const isThemeSkipped = key.startsWith(themePrefix) && !themeConds.some((condName) => key === condName || key.startsWith(condName + ":"));
|
|
3836
3854
|
if (isThemeSkipped) {
|
|
3837
3855
|
continue;
|
|
3838
3856
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"postcss": "8.4.49",
|
|
39
39
|
"ts-pattern": "5.0.8",
|
|
40
|
-
"@pandacss/core": "0.
|
|
41
|
-
"@pandacss/is-valid-prop": "^0.
|
|
42
|
-
"@pandacss/logger": "0.
|
|
43
|
-
"@pandacss/shared": "0.
|
|
44
|
-
"@pandacss/token-dictionary": "0.
|
|
45
|
-
"@pandacss/types": "0.
|
|
40
|
+
"@pandacss/core": "0.54.0",
|
|
41
|
+
"@pandacss/is-valid-prop": "^0.54.0",
|
|
42
|
+
"@pandacss/logger": "0.54.0",
|
|
43
|
+
"@pandacss/shared": "0.54.0",
|
|
44
|
+
"@pandacss/token-dictionary": "0.54.0",
|
|
45
|
+
"@pandacss/types": "0.54.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33"
|