@pandacss/generator 0.19.0 → 0.21.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.d.mts CHANGED
@@ -1,58 +1,23 @@
1
+ import * as _pandacss_types from '@pandacss/types';
2
+ import { PatternConfig, UserConfig, Dict, ArtifactFilters, ConfigResultWithHooks, RequiredBy, StudioOptions, CascadeLayers, HashOptions, PrefixOptions, Theme, TSConfig, ArtifactId, ParserResultType } from '@pandacss/types';
1
3
  import { Utility, Recipes, Conditions, StylesheetContext, StylesheetOptions, Stylesheet, RecipeNode } from '@pandacss/core';
2
4
  import { TokenDictionary } from '@pandacss/token-dictionary';
3
- import { ConfigResultWithHooks, RequiredBy, HashOptions, PrefixOptions, CascadeLayers, UserConfig, PatternConfig, Dict, TSConfig, Artifact, ParserResultType } from '@pandacss/types';
4
5
 
5
- interface PandaBaseEngine extends ConfigResultWithHooks {
6
- isTemplateLiteralSyntax: boolean;
7
- studio: RequiredBy<NonNullable<ConfigResultWithHooks['config']['studio']>, 'outdir'>;
8
- hash: HashOptions;
9
- prefix: PrefixOptions;
10
- tokens: TokenDictionary;
11
- utility: Utility;
12
- properties: string[];
13
- isValidProperty: (key: string) => boolean;
14
- recipes: Recipes;
15
- conditions: Conditions;
16
- createSheetContext: () => StylesheetContext;
17
- createSheet: (options?: Pick<StylesheetOptions, 'content'>) => Stylesheet;
18
- layers: CascadeLayers;
19
- isValidLayerRule: (layerRule: string) => boolean;
20
- layerString: string;
21
- layerNames: string[];
22
- }
23
-
24
- interface PandaJsxEngine {
25
- factoryName: string;
26
- upperName: string;
27
- typeName: string;
28
- variantName: string;
29
- componentName: string;
30
- framework: UserConfig['jsxFramework'];
31
- styleProps: Exclude<UserConfig['jsxStyleProps'], undefined>;
32
- }
33
-
34
- interface PandaPathEngine {
35
- get: (file?: string) => string[];
36
- root: string[];
37
- css: string[];
38
- token: string[];
39
- types: string[];
40
- recipe: string[];
41
- pattern: string[];
42
- chunk: string[];
43
- outCss: string[];
44
- jsx: string[];
45
- }
46
-
47
- interface PandaPatternEngine {
48
- keys: string[];
49
- getConfig: (name: string) => PatternConfig;
50
- transform: (name: string, data: Dict) => Dict;
51
- getNames: (name: string) => PatternNames;
6
+ declare class Patterns {
7
+ patterns: Record<string, PatternConfig>;
52
8
  details: PatternDetail[];
9
+ constructor(config: UserConfig);
10
+ private createDetail;
11
+ get keys(): string[];
12
+ getConfig(name: string): PatternConfig;
13
+ transform(name: string, data: Dict): Dict;
14
+ getNames(name: string): PatternNames;
53
15
  find: (jsxName: string) => string;
54
16
  filter: (jsxName: string) => PatternDetail[];
55
- isEmpty: () => boolean;
17
+ isEmpty(): boolean;
18
+ saveOne(name: string, pattern: PatternConfig): void;
19
+ remove(name: string): void;
20
+ filterDetails(filters?: ArtifactFilters): PatternDetail[];
56
21
  }
57
22
  interface PatternNames {
58
23
  upperName: string;
@@ -70,10 +35,45 @@ interface PatternDetail extends PatternNames {
70
35
  jsx: NonNullable<PatternConfig['jsx']>;
71
36
  }
72
37
 
73
- interface PandaFileEngine {
38
+ declare class JsxEngine {
39
+ private config;
40
+ constructor(config: UserConfig);
41
+ private get jsxFactory();
42
+ get styleProps(): "all" | "none" | "minimal";
43
+ get framework(): ("solid" | "react" | "preact" | "vue" | "qwik") | undefined;
44
+ get factoryName(): string;
45
+ get upperName(): string;
46
+ get typeName(): string;
47
+ get variantName(): string;
48
+ get componentName(): string;
49
+ }
50
+
51
+ declare class PathEngine {
52
+ private config;
53
+ constructor(config: UserConfig);
54
+ private get cwd();
55
+ private get emitPackage();
56
+ private get outdir();
57
+ private getFilePath;
58
+ get root(): string[];
59
+ get css(): string[];
60
+ get token(): string[];
61
+ get types(): string[];
62
+ get recipe(): string[];
63
+ get pattern(): string[];
64
+ get chunk(): string[];
65
+ get outCss(): string[];
66
+ get jsx(): string[];
67
+ }
68
+
69
+ declare class FileEngine {
70
+ private config;
71
+ constructor(config: UserConfig);
72
+ private get forceConsistentTypeExtension();
73
+ private get outExtension();
74
74
  ext(file: string): string;
75
75
  extDts(file: string): string;
76
- __extDts(file: string): string;
76
+ private __extDts;
77
77
  import(mod: string, file: string): string;
78
78
  importType(mod: string, file: string): string;
79
79
  exportType(mod: string, file: string): string;
@@ -82,11 +82,38 @@ interface PandaFileEngine {
82
82
  isTypeFile(file: string): boolean;
83
83
  }
84
84
 
85
- interface Context extends PandaBaseEngine {
86
- patterns: PandaPatternEngine;
87
- jsx: PandaJsxEngine;
88
- paths: PandaPathEngine;
89
- file: PandaFileEngine;
85
+ declare class Context {
86
+ conf: ConfigResultWithHooks;
87
+ studio: RequiredBy<NonNullable<StudioOptions['studio']>, 'outdir'>;
88
+ tokens: TokenDictionary;
89
+ utility: Utility;
90
+ recipes: Recipes;
91
+ conditions: Conditions;
92
+ patterns: Patterns;
93
+ jsx: JsxEngine;
94
+ paths: PathEngine;
95
+ file: FileEngine;
96
+ properties: Set<string>;
97
+ isValidProperty: (key: string) => boolean;
98
+ layers: CascadeLayers;
99
+ isValidLayerRule: (layerRule: string) => boolean;
100
+ layerString: string;
101
+ layerNames: string[];
102
+ constructor(conf: ConfigResultWithHooks);
103
+ get config(): UserConfig;
104
+ get hooks(): _pandacss_types.PandaHookable;
105
+ get isTemplateLiteralSyntax(): boolean;
106
+ get hash(): HashOptions;
107
+ get prefix(): PrefixOptions;
108
+ createTokenDictionary(theme: Theme): TokenDictionary;
109
+ createUtility(config: UserConfig): Utility;
110
+ createConditions(config: UserConfig): Conditions;
111
+ setupCompositions(theme: Theme): void;
112
+ setupLayers(layers: CascadeLayers): void;
113
+ setupProperties(): void;
114
+ createSheetContext(): StylesheetContext;
115
+ createSheet(options?: Pick<StylesheetOptions, 'content'>): Stylesheet;
116
+ createRecipes(theme: Theme, context: StylesheetContext): Recipes;
90
117
  }
91
118
 
92
119
  declare const artifactsGenerated: (ctx: Context) => () => string;
@@ -160,18 +187,18 @@ interface ParserOptions {
160
187
  tsOptions: ConfigResultWithHooks['tsOptions'];
161
188
  }
162
189
 
163
- declare const createGenerator: (conf: ConfigResultWithHooks) => Generator;
164
- interface Generator extends Context {
165
- getArtifacts: () => Artifact[];
166
- getStaticCss: (ctx: Context) => string;
167
- getResetCss: (ctx: Context) => string;
168
- getTokenCss: (ctx: Context) => string;
169
- getKeyframeCss: (ctx: Context) => string;
170
- getGlobalCss: (ctx: Context) => string;
171
- getCss: (options: FlattenedCssOptions) => string;
172
- getParserCss: (result: ParserResultType) => string | undefined;
190
+ declare class Generator extends Context {
173
191
  messages: ReturnType<typeof getMessages>;
174
192
  parserOptions: ParserOptions;
193
+ constructor(conf: ConfigResultWithHooks);
194
+ getArtifacts(ids?: ArtifactId[] | undefined): _pandacss_types.Artifact[];
195
+ getStaticCss(): string;
196
+ getResetCss(): string;
197
+ getTokenCss(): string;
198
+ getKeyframeCss(): string;
199
+ getGlobalCss(): string;
200
+ getCss(options: FlattenedCssOptions): string;
201
+ getParserCss(result: ParserResultType): string | undefined;
175
202
  }
176
203
 
177
- export { Generator, createGenerator, messages };
204
+ export { Generator, messages };
package/dist/index.d.ts CHANGED
@@ -1,58 +1,23 @@
1
+ import * as _pandacss_types from '@pandacss/types';
2
+ import { PatternConfig, UserConfig, Dict, ArtifactFilters, ConfigResultWithHooks, RequiredBy, StudioOptions, CascadeLayers, HashOptions, PrefixOptions, Theme, TSConfig, ArtifactId, ParserResultType } from '@pandacss/types';
1
3
  import { Utility, Recipes, Conditions, StylesheetContext, StylesheetOptions, Stylesheet, RecipeNode } from '@pandacss/core';
2
4
  import { TokenDictionary } from '@pandacss/token-dictionary';
3
- import { ConfigResultWithHooks, RequiredBy, HashOptions, PrefixOptions, CascadeLayers, UserConfig, PatternConfig, Dict, TSConfig, Artifact, ParserResultType } from '@pandacss/types';
4
5
 
5
- interface PandaBaseEngine extends ConfigResultWithHooks {
6
- isTemplateLiteralSyntax: boolean;
7
- studio: RequiredBy<NonNullable<ConfigResultWithHooks['config']['studio']>, 'outdir'>;
8
- hash: HashOptions;
9
- prefix: PrefixOptions;
10
- tokens: TokenDictionary;
11
- utility: Utility;
12
- properties: string[];
13
- isValidProperty: (key: string) => boolean;
14
- recipes: Recipes;
15
- conditions: Conditions;
16
- createSheetContext: () => StylesheetContext;
17
- createSheet: (options?: Pick<StylesheetOptions, 'content'>) => Stylesheet;
18
- layers: CascadeLayers;
19
- isValidLayerRule: (layerRule: string) => boolean;
20
- layerString: string;
21
- layerNames: string[];
22
- }
23
-
24
- interface PandaJsxEngine {
25
- factoryName: string;
26
- upperName: string;
27
- typeName: string;
28
- variantName: string;
29
- componentName: string;
30
- framework: UserConfig['jsxFramework'];
31
- styleProps: Exclude<UserConfig['jsxStyleProps'], undefined>;
32
- }
33
-
34
- interface PandaPathEngine {
35
- get: (file?: string) => string[];
36
- root: string[];
37
- css: string[];
38
- token: string[];
39
- types: string[];
40
- recipe: string[];
41
- pattern: string[];
42
- chunk: string[];
43
- outCss: string[];
44
- jsx: string[];
45
- }
46
-
47
- interface PandaPatternEngine {
48
- keys: string[];
49
- getConfig: (name: string) => PatternConfig;
50
- transform: (name: string, data: Dict) => Dict;
51
- getNames: (name: string) => PatternNames;
6
+ declare class Patterns {
7
+ patterns: Record<string, PatternConfig>;
52
8
  details: PatternDetail[];
9
+ constructor(config: UserConfig);
10
+ private createDetail;
11
+ get keys(): string[];
12
+ getConfig(name: string): PatternConfig;
13
+ transform(name: string, data: Dict): Dict;
14
+ getNames(name: string): PatternNames;
53
15
  find: (jsxName: string) => string;
54
16
  filter: (jsxName: string) => PatternDetail[];
55
- isEmpty: () => boolean;
17
+ isEmpty(): boolean;
18
+ saveOne(name: string, pattern: PatternConfig): void;
19
+ remove(name: string): void;
20
+ filterDetails(filters?: ArtifactFilters): PatternDetail[];
56
21
  }
57
22
  interface PatternNames {
58
23
  upperName: string;
@@ -70,10 +35,45 @@ interface PatternDetail extends PatternNames {
70
35
  jsx: NonNullable<PatternConfig['jsx']>;
71
36
  }
72
37
 
73
- interface PandaFileEngine {
38
+ declare class JsxEngine {
39
+ private config;
40
+ constructor(config: UserConfig);
41
+ private get jsxFactory();
42
+ get styleProps(): "all" | "none" | "minimal";
43
+ get framework(): ("solid" | "react" | "preact" | "vue" | "qwik") | undefined;
44
+ get factoryName(): string;
45
+ get upperName(): string;
46
+ get typeName(): string;
47
+ get variantName(): string;
48
+ get componentName(): string;
49
+ }
50
+
51
+ declare class PathEngine {
52
+ private config;
53
+ constructor(config: UserConfig);
54
+ private get cwd();
55
+ private get emitPackage();
56
+ private get outdir();
57
+ private getFilePath;
58
+ get root(): string[];
59
+ get css(): string[];
60
+ get token(): string[];
61
+ get types(): string[];
62
+ get recipe(): string[];
63
+ get pattern(): string[];
64
+ get chunk(): string[];
65
+ get outCss(): string[];
66
+ get jsx(): string[];
67
+ }
68
+
69
+ declare class FileEngine {
70
+ private config;
71
+ constructor(config: UserConfig);
72
+ private get forceConsistentTypeExtension();
73
+ private get outExtension();
74
74
  ext(file: string): string;
75
75
  extDts(file: string): string;
76
- __extDts(file: string): string;
76
+ private __extDts;
77
77
  import(mod: string, file: string): string;
78
78
  importType(mod: string, file: string): string;
79
79
  exportType(mod: string, file: string): string;
@@ -82,11 +82,38 @@ interface PandaFileEngine {
82
82
  isTypeFile(file: string): boolean;
83
83
  }
84
84
 
85
- interface Context extends PandaBaseEngine {
86
- patterns: PandaPatternEngine;
87
- jsx: PandaJsxEngine;
88
- paths: PandaPathEngine;
89
- file: PandaFileEngine;
85
+ declare class Context {
86
+ conf: ConfigResultWithHooks;
87
+ studio: RequiredBy<NonNullable<StudioOptions['studio']>, 'outdir'>;
88
+ tokens: TokenDictionary;
89
+ utility: Utility;
90
+ recipes: Recipes;
91
+ conditions: Conditions;
92
+ patterns: Patterns;
93
+ jsx: JsxEngine;
94
+ paths: PathEngine;
95
+ file: FileEngine;
96
+ properties: Set<string>;
97
+ isValidProperty: (key: string) => boolean;
98
+ layers: CascadeLayers;
99
+ isValidLayerRule: (layerRule: string) => boolean;
100
+ layerString: string;
101
+ layerNames: string[];
102
+ constructor(conf: ConfigResultWithHooks);
103
+ get config(): UserConfig;
104
+ get hooks(): _pandacss_types.PandaHookable;
105
+ get isTemplateLiteralSyntax(): boolean;
106
+ get hash(): HashOptions;
107
+ get prefix(): PrefixOptions;
108
+ createTokenDictionary(theme: Theme): TokenDictionary;
109
+ createUtility(config: UserConfig): Utility;
110
+ createConditions(config: UserConfig): Conditions;
111
+ setupCompositions(theme: Theme): void;
112
+ setupLayers(layers: CascadeLayers): void;
113
+ setupProperties(): void;
114
+ createSheetContext(): StylesheetContext;
115
+ createSheet(options?: Pick<StylesheetOptions, 'content'>): Stylesheet;
116
+ createRecipes(theme: Theme, context: StylesheetContext): Recipes;
90
117
  }
91
118
 
92
119
  declare const artifactsGenerated: (ctx: Context) => () => string;
@@ -160,18 +187,18 @@ interface ParserOptions {
160
187
  tsOptions: ConfigResultWithHooks['tsOptions'];
161
188
  }
162
189
 
163
- declare const createGenerator: (conf: ConfigResultWithHooks) => Generator;
164
- interface Generator extends Context {
165
- getArtifacts: () => Artifact[];
166
- getStaticCss: (ctx: Context) => string;
167
- getResetCss: (ctx: Context) => string;
168
- getTokenCss: (ctx: Context) => string;
169
- getKeyframeCss: (ctx: Context) => string;
170
- getGlobalCss: (ctx: Context) => string;
171
- getCss: (options: FlattenedCssOptions) => string;
172
- getParserCss: (result: ParserResultType) => string | undefined;
190
+ declare class Generator extends Context {
173
191
  messages: ReturnType<typeof getMessages>;
174
192
  parserOptions: ParserOptions;
193
+ constructor(conf: ConfigResultWithHooks);
194
+ getArtifacts(ids?: ArtifactId[] | undefined): _pandacss_types.Artifact[];
195
+ getStaticCss(): string;
196
+ getResetCss(): string;
197
+ getTokenCss(): string;
198
+ getKeyframeCss(): string;
199
+ getGlobalCss(): string;
200
+ getCss(options: FlattenedCssOptions): string;
201
+ getParserCss(result: ParserResultType): string | undefined;
175
202
  }
176
203
 
177
- export { Generator, createGenerator, messages };
204
+ export { Generator, messages };