@pandacss/types 0.0.0-dev-20230119005608 → 0.0.0-dev-20230119102953
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.ts +1 -1
- package/dist/recipe.d.ts +31 -16
- package/dist/system-types.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { Config, UserConfig } from './config'
|
|
|
3
3
|
export type { PropertyConfig, PropertyTransform, PropertyValues, UtilityConfig } from './utility'
|
|
4
4
|
export type { SystemStyleObject, CssKeyframes, GlobalStyleObject } from './system-types'
|
|
5
5
|
export type { PatternConfig, PatternProperty, PatternHelpers } from './pattern'
|
|
6
|
-
export type { RecipeConfig,
|
|
6
|
+
export type { RecipeConfig, RecipeVariantRecord } from './recipe'
|
|
7
7
|
export type { TextStyles, LayerStyles, CompositionStyles } from './composition'
|
|
8
8
|
export type { Token, TokenCategory, TokenDataTypes, Tokens, SemanticToken, SemanticTokens } from './tokens'
|
|
9
9
|
export type { Dict, RequiredBy, AnyFunction } from './shared'
|
package/dist/recipe.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { SystemStyleObject } from './system-types'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
4
|
+
|
|
5
|
+
export type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>
|
|
6
|
+
|
|
7
|
+
export type RecipeSelection<T extends RecipeVariantRecord> = {
|
|
8
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]>
|
|
5
9
|
}
|
|
6
10
|
|
|
7
|
-
type
|
|
11
|
+
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
|
|
8
12
|
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Parameters<T>[0]
|
|
14
|
+
|
|
15
|
+
export type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {
|
|
16
|
+
variants: (keyof T)[]
|
|
17
|
+
resolve: (props: RecipeSelection<T>) => SystemStyleObject
|
|
18
|
+
config: RecipeConfig<T>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type RecipeDefinition<T extends RecipeVariantRecord> = {
|
|
18
22
|
/**
|
|
19
23
|
* The base styles of the recipe.
|
|
20
24
|
*/
|
|
@@ -22,15 +26,26 @@ export type RecipeConfig<Variants extends TVariants = TVariants> = {
|
|
|
22
26
|
/**
|
|
23
27
|
* The multi-variant styles of the recipe.
|
|
24
28
|
*/
|
|
25
|
-
variants?:
|
|
29
|
+
variants?: T | RecipeVariantRecord
|
|
26
30
|
/**
|
|
27
31
|
* The default variants of the recipe.
|
|
28
32
|
*/
|
|
29
|
-
defaultVariants?:
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
defaultVariants?: RecipeSelection<T>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
|
|
37
|
+
|
|
38
|
+
export type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the recipe.
|
|
41
|
+
*/
|
|
42
|
+
name: string
|
|
32
43
|
/**
|
|
33
44
|
* The description of the recipe. This will be used in the JSDoc comment.
|
|
34
45
|
*/
|
|
35
46
|
description?: string
|
|
47
|
+
/**
|
|
48
|
+
* The jsx elements to track for this recipe.
|
|
49
|
+
*/
|
|
50
|
+
jsx?: string
|
|
36
51
|
}
|
package/dist/system-types.d.ts
CHANGED