@pandacss/generator 0.0.0-dev-20240108181940 → 0.0.0-dev-20240109102643
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 +96 -25
- package/dist/index.mjs +96 -25
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
36
36
|
|
|
37
37
|
// src/generator.ts
|
|
38
38
|
var import_core4 = require("@pandacss/core");
|
|
39
|
-
var
|
|
39
|
+
var import_ts_pattern12 = require("ts-pattern");
|
|
40
40
|
|
|
41
41
|
// src/artifacts/setup-artifacts.ts
|
|
42
42
|
var import_outdent43 = __toESM(require("outdent"));
|
|
@@ -2818,6 +2818,7 @@ var generateTypesEntry = (ctx, isJsxRequired) => {
|
|
|
2818
2818
|
|
|
2819
2819
|
// src/artifacts/types/prop-types.ts
|
|
2820
2820
|
var import_outdent40 = require("outdent");
|
|
2821
|
+
var import_ts_pattern11 = require("ts-pattern");
|
|
2821
2822
|
function generatePropTypes(ctx) {
|
|
2822
2823
|
const {
|
|
2823
2824
|
config: { strictTokens },
|
|
@@ -2850,40 +2851,110 @@ function generatePropTypes(ctx) {
|
|
|
2850
2851
|
return import_outdent40.outdent`
|
|
2851
2852
|
${result.join("\n")}
|
|
2852
2853
|
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2854
|
+
type StrictableProps =
|
|
2855
|
+
| 'alignContent'
|
|
2856
|
+
| 'alignItems'
|
|
2857
|
+
| 'alignSelf'
|
|
2858
|
+
| 'all'
|
|
2859
|
+
| 'animationComposition'
|
|
2860
|
+
| 'animationDirection'
|
|
2861
|
+
| 'animationFillMode'
|
|
2862
|
+
| 'appearance'
|
|
2863
|
+
| 'backfaceVisibility'
|
|
2864
|
+
| 'backgroundAttachment'
|
|
2865
|
+
| 'backgroundClip'
|
|
2866
|
+
| 'borderCollapse'
|
|
2867
|
+
| 'border'
|
|
2868
|
+
| 'borderBlock'
|
|
2869
|
+
| 'borderBlockEnd'
|
|
2870
|
+
| 'borderBlockStart'
|
|
2871
|
+
| 'borderBottom'
|
|
2872
|
+
| 'borderInline'
|
|
2873
|
+
| 'borderInlineEnd'
|
|
2874
|
+
| 'borderInlineStart'
|
|
2875
|
+
| 'borderLeft'
|
|
2876
|
+
| 'borderRight'
|
|
2877
|
+
| 'borderTop'
|
|
2878
|
+
| 'borderBlockEndStyle'
|
|
2879
|
+
| 'borderBlockStartStyle'
|
|
2880
|
+
| 'borderBlockStyle'
|
|
2881
|
+
| 'borderBottomStyle'
|
|
2882
|
+
| 'borderInlineEndStyle'
|
|
2883
|
+
| 'borderInlineStartStyle'
|
|
2884
|
+
| 'borderInlineStyle'
|
|
2885
|
+
| 'borderLeftStyle'
|
|
2886
|
+
| 'borderRightStyle'
|
|
2887
|
+
| 'borderTopStyle'
|
|
2888
|
+
| 'boxDecorationBreak'
|
|
2889
|
+
| 'boxSizing'
|
|
2890
|
+
| 'breakAfter'
|
|
2891
|
+
| 'breakBefore'
|
|
2892
|
+
| 'breakInside'
|
|
2893
|
+
| 'captionSide'
|
|
2894
|
+
| 'clear'
|
|
2895
|
+
| 'columnFill'
|
|
2896
|
+
| 'columnRuleStyle'
|
|
2897
|
+
| 'contentVisibility'
|
|
2898
|
+
| 'direction'
|
|
2899
|
+
| 'display'
|
|
2900
|
+
| 'emptyCells'
|
|
2901
|
+
| 'flexDirection'
|
|
2902
|
+
| 'flexWrap'
|
|
2903
|
+
| 'float'
|
|
2904
|
+
| 'fontKerning'
|
|
2905
|
+
| 'forcedColorAdjust'
|
|
2906
|
+
| 'isolation'
|
|
2907
|
+
| 'lineBreak'
|
|
2908
|
+
| 'mixBlendMode'
|
|
2909
|
+
| 'objectFit'
|
|
2910
|
+
| 'outlineStyle'
|
|
2911
|
+
| 'overflow'
|
|
2912
|
+
| 'overflowX'
|
|
2913
|
+
| 'overflowY'
|
|
2914
|
+
| 'overflowBlock'
|
|
2915
|
+
| 'overflowInline'
|
|
2916
|
+
| 'overflowWrap'
|
|
2917
|
+
| 'pointerEvents'
|
|
2918
|
+
| 'position'
|
|
2919
|
+
| 'resize'
|
|
2920
|
+
| 'scrollBehavior'
|
|
2921
|
+
| 'touchAction'
|
|
2922
|
+
| 'transformBox'
|
|
2923
|
+
| 'transformStyle'
|
|
2924
|
+
| 'userSelect'
|
|
2925
|
+
| 'visibility'
|
|
2926
|
+
| 'wordBreak'
|
|
2927
|
+
| 'writingMode'
|
|
2928
|
+
type WithEscapeHatch<T> = T | \`[\${string}]\`
|
|
2929
|
+
type FilterVagueString<Key, Value> = Value extends boolean
|
|
2930
|
+
? Value
|
|
2931
|
+
: Key extends StrictableProps
|
|
2932
|
+
? Value extends \`\${infer _}\` ? Value : never
|
|
2933
|
+
: Value
|
|
2934
|
+
type PropOrCondition<Key, Value> = ${(0, import_ts_pattern11.match)(ctx.config).with(
|
|
2935
|
+
{ strictTokens: true, strictPropertyValues: true },
|
|
2936
|
+
() => "ConditionalValue<WithEscapeHatch<FilterVagueString<Key, Value>>>"
|
|
2937
|
+
).with({ strictTokens: true }, () => "ConditionalValue<WithEscapeHatch<Value>>").with({ strictPropertyValues: true }, () => "ConditionalValue<WithEscapeHatch<FilterVagueString<Key, Value>>>").otherwise(() => "ConditionalValue<Value | (string & {})>")}
|
|
2872
2938
|
|
|
2873
2939
|
type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
|
|
2874
|
-
?
|
|
2940
|
+
? PropOrCondition<T, ${(0, import_ts_pattern11.match)(ctx.config).with(
|
|
2941
|
+
{ strictPropertyValues: true, strictTokens: true },
|
|
2942
|
+
() => "T extends StrictableProps ? PropertyTypes[T] : PropertyTypes[T]"
|
|
2943
|
+
).with({ strictTokens: true }, () => "PropertyTypes[T]").with(
|
|
2944
|
+
{ strictPropertyValues: true },
|
|
2945
|
+
() => "T extends StrictableProps ? PropertyTypes[T] : PropertyTypes[T] | CssValue<T>"
|
|
2946
|
+
).otherwise(() => "PropertyTypes[T] | CssValue<T>")}>
|
|
2875
2947
|
: never;
|
|
2876
2948
|
|
|
2877
2949
|
type CssPropertyValue<T extends string> = T extends keyof CssProperties
|
|
2878
|
-
?
|
|
2950
|
+
? PropOrCondition<T, CssProperties[T]>
|
|
2879
2951
|
: never;
|
|
2880
2952
|
|
|
2881
2953
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
2882
2954
|
? PropertyTypeValue<T>
|
|
2883
2955
|
: T extends keyof CssProperties
|
|
2884
2956
|
? CssPropertyValue<T>
|
|
2885
|
-
:
|
|
2886
|
-
`}
|
|
2957
|
+
: PropOrCondition<T, string | number>
|
|
2887
2958
|
`;
|
|
2888
2959
|
}
|
|
2889
2960
|
|
|
@@ -3795,7 +3866,7 @@ var Generator = class extends import_core4.Context {
|
|
|
3795
3866
|
return generateArtifacts(this, ids);
|
|
3796
3867
|
};
|
|
3797
3868
|
appendCssOfType = (type, sheet) => {
|
|
3798
|
-
(0,
|
|
3869
|
+
(0, import_ts_pattern12.match)(type).with("preflight", () => generateResetCss(this, sheet)).with("tokens", () => generateTokenCss(this, sheet)).with("static", () => generateStaticCss(this, sheet)).with("global", () => generateGlobalCss(this, sheet)).with("keyframes", () => generateKeyframeCss(this, sheet)).otherwise(() => {
|
|
3799
3870
|
throw new Error(`Unknown css artifact type <${type}>`);
|
|
3800
3871
|
});
|
|
3801
3872
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/generator.ts
|
|
2
2
|
import { Context } from "@pandacss/core";
|
|
3
|
-
import { match as
|
|
3
|
+
import { match as match12 } from "ts-pattern";
|
|
4
4
|
|
|
5
5
|
// src/artifacts/setup-artifacts.ts
|
|
6
6
|
import outdent43 from "outdent";
|
|
@@ -2782,6 +2782,7 @@ var generateTypesEntry = (ctx, isJsxRequired) => {
|
|
|
2782
2782
|
|
|
2783
2783
|
// src/artifacts/types/prop-types.ts
|
|
2784
2784
|
import { outdent as outdent40 } from "outdent";
|
|
2785
|
+
import { match as match11 } from "ts-pattern";
|
|
2785
2786
|
function generatePropTypes(ctx) {
|
|
2786
2787
|
const {
|
|
2787
2788
|
config: { strictTokens },
|
|
@@ -2814,40 +2815,110 @@ function generatePropTypes(ctx) {
|
|
|
2814
2815
|
return outdent40`
|
|
2815
2816
|
${result.join("\n")}
|
|
2816
2817
|
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2818
|
+
type StrictableProps =
|
|
2819
|
+
| 'alignContent'
|
|
2820
|
+
| 'alignItems'
|
|
2821
|
+
| 'alignSelf'
|
|
2822
|
+
| 'all'
|
|
2823
|
+
| 'animationComposition'
|
|
2824
|
+
| 'animationDirection'
|
|
2825
|
+
| 'animationFillMode'
|
|
2826
|
+
| 'appearance'
|
|
2827
|
+
| 'backfaceVisibility'
|
|
2828
|
+
| 'backgroundAttachment'
|
|
2829
|
+
| 'backgroundClip'
|
|
2830
|
+
| 'borderCollapse'
|
|
2831
|
+
| 'border'
|
|
2832
|
+
| 'borderBlock'
|
|
2833
|
+
| 'borderBlockEnd'
|
|
2834
|
+
| 'borderBlockStart'
|
|
2835
|
+
| 'borderBottom'
|
|
2836
|
+
| 'borderInline'
|
|
2837
|
+
| 'borderInlineEnd'
|
|
2838
|
+
| 'borderInlineStart'
|
|
2839
|
+
| 'borderLeft'
|
|
2840
|
+
| 'borderRight'
|
|
2841
|
+
| 'borderTop'
|
|
2842
|
+
| 'borderBlockEndStyle'
|
|
2843
|
+
| 'borderBlockStartStyle'
|
|
2844
|
+
| 'borderBlockStyle'
|
|
2845
|
+
| 'borderBottomStyle'
|
|
2846
|
+
| 'borderInlineEndStyle'
|
|
2847
|
+
| 'borderInlineStartStyle'
|
|
2848
|
+
| 'borderInlineStyle'
|
|
2849
|
+
| 'borderLeftStyle'
|
|
2850
|
+
| 'borderRightStyle'
|
|
2851
|
+
| 'borderTopStyle'
|
|
2852
|
+
| 'boxDecorationBreak'
|
|
2853
|
+
| 'boxSizing'
|
|
2854
|
+
| 'breakAfter'
|
|
2855
|
+
| 'breakBefore'
|
|
2856
|
+
| 'breakInside'
|
|
2857
|
+
| 'captionSide'
|
|
2858
|
+
| 'clear'
|
|
2859
|
+
| 'columnFill'
|
|
2860
|
+
| 'columnRuleStyle'
|
|
2861
|
+
| 'contentVisibility'
|
|
2862
|
+
| 'direction'
|
|
2863
|
+
| 'display'
|
|
2864
|
+
| 'emptyCells'
|
|
2865
|
+
| 'flexDirection'
|
|
2866
|
+
| 'flexWrap'
|
|
2867
|
+
| 'float'
|
|
2868
|
+
| 'fontKerning'
|
|
2869
|
+
| 'forcedColorAdjust'
|
|
2870
|
+
| 'isolation'
|
|
2871
|
+
| 'lineBreak'
|
|
2872
|
+
| 'mixBlendMode'
|
|
2873
|
+
| 'objectFit'
|
|
2874
|
+
| 'outlineStyle'
|
|
2875
|
+
| 'overflow'
|
|
2876
|
+
| 'overflowX'
|
|
2877
|
+
| 'overflowY'
|
|
2878
|
+
| 'overflowBlock'
|
|
2879
|
+
| 'overflowInline'
|
|
2880
|
+
| 'overflowWrap'
|
|
2881
|
+
| 'pointerEvents'
|
|
2882
|
+
| 'position'
|
|
2883
|
+
| 'resize'
|
|
2884
|
+
| 'scrollBehavior'
|
|
2885
|
+
| 'touchAction'
|
|
2886
|
+
| 'transformBox'
|
|
2887
|
+
| 'transformStyle'
|
|
2888
|
+
| 'userSelect'
|
|
2889
|
+
| 'visibility'
|
|
2890
|
+
| 'wordBreak'
|
|
2891
|
+
| 'writingMode'
|
|
2892
|
+
type WithEscapeHatch<T> = T | \`[\${string}]\`
|
|
2893
|
+
type FilterVagueString<Key, Value> = Value extends boolean
|
|
2894
|
+
? Value
|
|
2895
|
+
: Key extends StrictableProps
|
|
2896
|
+
? Value extends \`\${infer _}\` ? Value : never
|
|
2897
|
+
: Value
|
|
2898
|
+
type PropOrCondition<Key, Value> = ${match11(ctx.config).with(
|
|
2899
|
+
{ strictTokens: true, strictPropertyValues: true },
|
|
2900
|
+
() => "ConditionalValue<WithEscapeHatch<FilterVagueString<Key, Value>>>"
|
|
2901
|
+
).with({ strictTokens: true }, () => "ConditionalValue<WithEscapeHatch<Value>>").with({ strictPropertyValues: true }, () => "ConditionalValue<WithEscapeHatch<FilterVagueString<Key, Value>>>").otherwise(() => "ConditionalValue<Value | (string & {})>")}
|
|
2836
2902
|
|
|
2837
2903
|
type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
|
|
2838
|
-
?
|
|
2904
|
+
? PropOrCondition<T, ${match11(ctx.config).with(
|
|
2905
|
+
{ strictPropertyValues: true, strictTokens: true },
|
|
2906
|
+
() => "T extends StrictableProps ? PropertyTypes[T] : PropertyTypes[T]"
|
|
2907
|
+
).with({ strictTokens: true }, () => "PropertyTypes[T]").with(
|
|
2908
|
+
{ strictPropertyValues: true },
|
|
2909
|
+
() => "T extends StrictableProps ? PropertyTypes[T] : PropertyTypes[T] | CssValue<T>"
|
|
2910
|
+
).otherwise(() => "PropertyTypes[T] | CssValue<T>")}>
|
|
2839
2911
|
: never;
|
|
2840
2912
|
|
|
2841
2913
|
type CssPropertyValue<T extends string> = T extends keyof CssProperties
|
|
2842
|
-
?
|
|
2914
|
+
? PropOrCondition<T, CssProperties[T]>
|
|
2843
2915
|
: never;
|
|
2844
2916
|
|
|
2845
2917
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
2846
2918
|
? PropertyTypeValue<T>
|
|
2847
2919
|
: T extends keyof CssProperties
|
|
2848
2920
|
? CssPropertyValue<T>
|
|
2849
|
-
:
|
|
2850
|
-
`}
|
|
2921
|
+
: PropOrCondition<T, string | number>
|
|
2851
2922
|
`;
|
|
2852
2923
|
}
|
|
2853
2924
|
|
|
@@ -3759,7 +3830,7 @@ var Generator = class extends Context {
|
|
|
3759
3830
|
return generateArtifacts(this, ids);
|
|
3760
3831
|
};
|
|
3761
3832
|
appendCssOfType = (type, sheet) => {
|
|
3762
|
-
|
|
3833
|
+
match12(type).with("preflight", () => generateResetCss(this, sheet)).with("tokens", () => generateTokenCss(this, sheet)).with("static", () => generateStaticCss(this, sheet)).with("global", () => generateGlobalCss(this, sheet)).with("keyframes", () => generateKeyframeCss(this, sheet)).otherwise(() => {
|
|
3763
3834
|
throw new Error(`Unknown css artifact type <${type}>`);
|
|
3764
3835
|
});
|
|
3765
3836
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20240109102643",
|
|
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.31",
|
|
39
39
|
"ts-pattern": "5.0.5",
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/is-valid-prop": "^0.0.0-dev-
|
|
42
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
43
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
44
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
45
|
-
"@pandacss/types": "0.0.0-dev-
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20240109102643",
|
|
41
|
+
"@pandacss/is-valid-prop": "^0.0.0-dev-20240109102643",
|
|
42
|
+
"@pandacss/logger": "0.0.0-dev-20240109102643",
|
|
43
|
+
"@pandacss/shared": "0.0.0-dev-20240109102643",
|
|
44
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20240109102643",
|
|
45
|
+
"@pandacss/types": "0.0.0-dev-20240109102643"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33",
|