@pandacss/types 0.0.0-dev-20230413135202 → 0.0.0-dev-20230413153538

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/config.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { LayerStyles, TextStyles } from './composition'
2
2
  import type { Conditions as TConditions } from './conditions'
3
3
  import type { PatternConfig } from './pattern'
4
- import type { RecipeConfig } from './recipe'
4
+ import type { AnyRecipeConfig } from './recipe'
5
5
  import type { Extendable, RequiredBy, UnwrapExtend } from './shared'
6
6
  import type { StaticCssOptions } from './static-css'
7
7
  import type { CssKeyframes, GlobalStyleObject } from './system-types'
@@ -132,7 +132,7 @@ export type Config = {
132
132
  * Multi-variant style definitions for your project.
133
133
  * Useful for defining component styles.
134
134
  */
135
- recipes?: Record<string, RecipeConfig>
135
+ recipes?: Record<string, AnyRecipeConfig>
136
136
  }>
137
137
  /**
138
138
  * The css utility definitions.
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export type { Config, LoadConfigResult, Preset, UserConfig } from './config'
13
13
  export type { ParserResult, ResultItem } from './parser'
14
14
  export type { Part, Parts } from './parts'
15
15
  export type { PatternConfig, PatternHelpers, PatternProperty } from './pattern'
16
- export type { RecipeConfig, RecipeVariantRecord } from './recipe'
16
+ export type { AnyRecipeConfig, RecipeConfig, RecipeVariantRecord } from './recipe'
17
17
  export type { Runtime } from './runtime'
18
18
  export type { AnyFunction, Artifact, Dict, RequiredBy } from './shared'
19
19
  export type { StaticCssOptions } from './static-css'
package/dist/parser.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import type { BoxNodeMap, BoxNodeArray, Unboxed } from '@pandacss/extractor'
1
+ import type { BoxNodeMap, Unboxed } from '@pandacss/extractor'
2
2
 
3
3
  export type ResultItem = {
4
4
  name?: string
5
5
  data: Array<Unboxed['raw']>
6
- type?: string
7
- box?: BoxNodeArray | BoxNodeMap
6
+ type?: 'object' | 'cva' | 'pattern' | 'recipe' | 'jsx-factory' | 'jsx-pattern' | 'jsx-recipe' | 'jsx'
7
+ box?: BoxNodeMap
8
8
  }
9
9
 
10
10
  export type ParserResult = {
package/dist/recipe.d.ts CHANGED
@@ -18,6 +18,17 @@ export type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T>
18
18
  config: RecipeConfig<T>
19
19
  }
20
20
 
21
+ export type RecipeCompoundSelection<
22
+ T extends RecipeVariantRecord,
23
+ Key extends Exclude<keyof T, 'css'> = Exclude<keyof T, 'css'>,
24
+ > = {
25
+ [K in Key]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>
26
+ }
27
+
28
+ export type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
29
+ css: SystemStyleObject
30
+ }
31
+
21
32
  export type RecipeDefinition<T extends RecipeVariantRecord> = {
22
33
  /**
23
34
  * The base styles of the recipe.
@@ -31,11 +42,15 @@ export type RecipeDefinition<T extends RecipeVariantRecord> = {
31
42
  * The default variants of the recipe.
32
43
  */
33
44
  defaultVariants?: RecipeSelection<T>
45
+ /**
46
+ * The styles to apply when a combination of variants is selected.
47
+ */
48
+ compoundVariants?: Array<RecipeCompoundVariant<T>>
34
49
  }
35
50
 
36
51
  export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
37
52
 
38
- export type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {
53
+ export type RecipeConfig<T extends RecipeVariantRecord> = RecipeDefinition<T> & {
39
54
  /**
40
55
  * The name of the recipe.
41
56
  */
@@ -45,7 +60,11 @@ export type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> =
45
60
  */
46
61
  description?: string
47
62
  /**
48
- * The jsx elements to track for this recipe.
63
+ * The jsx elements to track for this recipe. Can be string or Regexp.
64
+ *
65
+ * @default capitalize(recipe.name)
66
+ * @example ['Button', 'Link', /Button$/]
49
67
  */
50
- jsx?: string
68
+ jsx?: Array<string | RegExp>
51
69
  }
70
+ export type AnyRecipeConfig = RecipeConfig<RecipeVariantRecord>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.0.0-dev-20230413135202",
3
+ "version": "0.0.0-dev-20230413153538",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -16,7 +16,7 @@
16
16
  "csstype": "3.1.2"
17
17
  },
18
18
  "dependencies": {
19
- "@pandacss/extractor": "0.0.0-dev-20230413135202"
19
+ "@pandacss/extractor": "0.0.0-dev-20230413153538"
20
20
  },
21
21
  "scripts": {
22
22
  "build": "tsx scripts/build.ts",