11import { Context , type StyleDecoder , type Stylesheet } from '@pandacss/core'
22import { dashCase , PandaError } from '@pandacss/shared'
3- import type { ArtifactId , CssArtifactType , LoadConfigResult } from '@pandacss/types'
3+ import type { ArtifactId , CssArtifactType , LoadConfigResult , SpecType } from '@pandacss/types'
44import { match } from 'ts-pattern'
55import { generateArtifacts } from './artifacts'
66import { generateGlobalCss } from './artifacts/css/global-css'
@@ -10,6 +10,15 @@ import { generateResetCss } from './artifacts/css/reset-css'
1010import { generateStaticCss } from './artifacts/css/static-css'
1111import { generateTokenCss } from './artifacts/css/token-css'
1212import { getThemeCss } from './artifacts/js/themes'
13+ import { generateAnimationStylesSpec } from './spec/animation-styles'
14+ import { generateColorPaletteSpec } from './spec/color-palette'
15+ import { generateConditionsSpec } from './spec/conditions'
16+ import { generateKeyframesSpec } from './spec/keyframes'
17+ import { generateLayerStylesSpec } from './spec/layer-styles'
18+ import { generatePatternsSpec } from './spec/patterns'
19+ import { generateRecipesSpec } from './spec/recipes'
20+ import { generateSemanticTokensSpec , generateTokensSpec } from './spec/tokens'
21+ import { generateTextStylesSpec } from './spec/text-styles'
1322
1423export interface SplitCssArtifact {
1524 type : 'layer' | 'recipe' | 'theme'
@@ -195,4 +204,34 @@ export class Generator extends Context {
195204 index : imports . join ( '\n' ) ,
196205 }
197206 }
207+
208+ getSpecOfType = ( type : SpecType ) => {
209+ return match ( type )
210+ . with ( 'tokens' , ( ) => generateTokensSpec ( this ) )
211+ . with ( 'recipes' , ( ) => generateRecipesSpec ( this ) )
212+ . with ( 'patterns' , ( ) => generatePatternsSpec ( this ) )
213+ . with ( 'conditions' , ( ) => generateConditionsSpec ( this ) )
214+ . with ( 'keyframes' , ( ) => generateKeyframesSpec ( this ) )
215+ . with ( 'semantic-tokens' , ( ) => generateSemanticTokensSpec ( this ) )
216+ . with ( 'text-styles' , ( ) => generateTextStylesSpec ( this ) )
217+ . with ( 'layer-styles' , ( ) => generateLayerStylesSpec ( this ) )
218+ . with ( 'animation-styles' , ( ) => generateAnimationStylesSpec ( this ) )
219+ . with ( 'color-palette' , ( ) => generateColorPaletteSpec ( this ) )
220+ . exhaustive ( )
221+ }
222+
223+ getSpec = ( ) => {
224+ return {
225+ tokens : generateTokensSpec ( this ) ,
226+ recipes : generateRecipesSpec ( this ) ,
227+ patterns : generatePatternsSpec ( this ) ,
228+ conditions : generateConditionsSpec ( this ) ,
229+ keyframes : generateKeyframesSpec ( this ) ,
230+ 'semantic-tokens' : generateSemanticTokensSpec ( this ) ,
231+ 'text-styles' : generateTextStylesSpec ( this ) ,
232+ 'layer-styles' : generateLayerStylesSpec ( this ) ,
233+ 'animation-styles' : generateAnimationStylesSpec ( this ) ,
234+ 'color-palette' : generateColorPaletteSpec ( this ) ,
235+ }
236+ }
198237}
0 commit comments