@pandacss/types 0.34.3 → 0.36.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/artifact.d.ts +1 -0
- package/dist/conditions.d.ts +2 -4
- package/dist/config.d.ts +74 -1
- package/dist/hooks.d.ts +2 -0
- package/dist/parser.d.ts +7 -0
- package/dist/recipe.d.ts +5 -1
- package/dist/static-css.d.ts +4 -0
- package/dist/system-types.d.ts +2 -6
- package/package.json +3 -2
package/dist/artifact.d.ts
CHANGED
package/dist/conditions.d.ts
CHANGED
|
@@ -40,15 +40,13 @@ export interface ExtendableConditions {
|
|
|
40
40
|
|
|
41
41
|
export type Condition = string
|
|
42
42
|
|
|
43
|
-
export type
|
|
43
|
+
export type ConditionalValue<V> =
|
|
44
44
|
| V
|
|
45
45
|
| Array<V | null>
|
|
46
46
|
| {
|
|
47
|
-
[K in keyof Conditions]?:
|
|
47
|
+
[K in keyof Conditions]?: ConditionalValue<V>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export type ConditionalValue<T> = Conditional<T>
|
|
51
|
-
|
|
52
50
|
export type Nested<P> =
|
|
53
51
|
| (P & {
|
|
54
52
|
[K in Selectors]?: Nested<P>
|
package/dist/config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TSConfig } from 'pkg-types'
|
|
|
2
2
|
import type { Conditions, ExtendableConditions } from './conditions'
|
|
3
3
|
import type { PandaHooks } from './hooks'
|
|
4
4
|
import type { PatternConfig } from './pattern'
|
|
5
|
-
import type { Keys, PathIn, RequiredBy } from './shared'
|
|
5
|
+
import type { Keys, LiteralUnion, PathIn, RequiredBy } from './shared'
|
|
6
6
|
import type { StaticCssOptions } from './static-css'
|
|
7
7
|
import type { ExtendableGlobalStyleObject, GlobalStyleObject } from './system-types'
|
|
8
8
|
import type { ExtendableTheme, Theme } from './theme'
|
|
@@ -68,6 +68,10 @@ export interface PresetCore {
|
|
|
68
68
|
* Common styling or layout patterns for your project.
|
|
69
69
|
*/
|
|
70
70
|
patterns: Record<string, PatternConfig>
|
|
71
|
+
/**
|
|
72
|
+
* Multiple themes for your project.
|
|
73
|
+
*/
|
|
74
|
+
themes?: ThemeVariantsMap
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
interface ExtendablePatterns {
|
|
@@ -79,6 +83,67 @@ interface ExtendableStaticCssOptions extends StaticCssOptions {
|
|
|
79
83
|
extend?: StaticCssOptions | undefined
|
|
80
84
|
}
|
|
81
85
|
|
|
86
|
+
export type CssPropertySyntax =
|
|
87
|
+
| '<length>'
|
|
88
|
+
| '<number>'
|
|
89
|
+
| '<percentage>'
|
|
90
|
+
| '<length-percentage>'
|
|
91
|
+
| '<color>'
|
|
92
|
+
| '<image>'
|
|
93
|
+
| '<url>'
|
|
94
|
+
| '<integer>'
|
|
95
|
+
| '<angle>'
|
|
96
|
+
| '<time>'
|
|
97
|
+
| '<resolution>'
|
|
98
|
+
| '<transform-function>'
|
|
99
|
+
| '<length> | <percentage>'
|
|
100
|
+
|
|
101
|
+
export interface CssPropertyDefinition {
|
|
102
|
+
/**
|
|
103
|
+
* Controls whether the custom property registration specified by @property inherits by default.
|
|
104
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/inherits
|
|
105
|
+
*/
|
|
106
|
+
inherits: boolean
|
|
107
|
+
/**
|
|
108
|
+
* Sets the initial value for the property.
|
|
109
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/initial-value
|
|
110
|
+
*/
|
|
111
|
+
initialValue: string
|
|
112
|
+
/**
|
|
113
|
+
* Describes the allowable syntax for the property.
|
|
114
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
|
|
115
|
+
*/
|
|
116
|
+
syntax: LiteralUnion<CssPropertySyntax>
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface GlobalVarsDefinition {
|
|
120
|
+
[key: string]: string | CssPropertyDefinition
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface ExtendableGlobalVars {
|
|
124
|
+
[key: string]: string | CssPropertyDefinition | GlobalVarsDefinition | undefined
|
|
125
|
+
extend?: GlobalVarsDefinition
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ThemeVariant extends Pick<Theme, 'tokens' | 'semanticTokens'> {
|
|
129
|
+
/**
|
|
130
|
+
* Selector attribute to use for the generated theme, can be any `data-*` attribute
|
|
131
|
+
* @default 'data-panda-theme'
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
*/
|
|
135
|
+
attribute?: `data-${string}`
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface ThemeVariantsMap {
|
|
139
|
+
[name: string]: ThemeVariant
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface ExtendableThemeVariantsMap {
|
|
143
|
+
[name: string]: ThemeVariantsMap | ThemeVariant | undefined
|
|
144
|
+
extend?: ThemeVariantsMap | undefined
|
|
145
|
+
}
|
|
146
|
+
|
|
82
147
|
export interface ExtendableOptions {
|
|
83
148
|
/**
|
|
84
149
|
* The css selectors or media queries shortcuts.
|
|
@@ -105,6 +170,14 @@ export interface ExtendableOptions {
|
|
|
105
170
|
* Common styling or layout patterns for your project.
|
|
106
171
|
*/
|
|
107
172
|
patterns?: ExtendablePatterns
|
|
173
|
+
/**
|
|
174
|
+
* The css variables for your project.
|
|
175
|
+
*/
|
|
176
|
+
globalVars?: ExtendableGlobalVars
|
|
177
|
+
/**
|
|
178
|
+
* The theme variants for your project.
|
|
179
|
+
*/
|
|
180
|
+
themes?: ExtendableThemeVariantsMap
|
|
108
181
|
}
|
|
109
182
|
|
|
110
183
|
export interface ImportMapInput {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ export interface ConfigResolvedHookArgs {
|
|
|
125
125
|
path: string
|
|
126
126
|
dependencies: string[]
|
|
127
127
|
utils: ConfigResolvedHookUtils
|
|
128
|
+
original?: LoadConfigResult['config']
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
export interface ConfigChangeHookArgs {
|
|
@@ -145,6 +146,7 @@ export interface ParserResultBeforeHookArgs {
|
|
|
145
146
|
filePath: string
|
|
146
147
|
content: string
|
|
147
148
|
configure: (opts: ParserResultConfigureOptions) => void
|
|
149
|
+
original?: string
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
export interface ParserResultAfterHookArgs {
|
package/dist/parser.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export interface ParserResultInterface {
|
|
|
18
18
|
filePath: string | undefined
|
|
19
19
|
isEmpty: () => boolean
|
|
20
20
|
toArray: () => Array<ResultItem>
|
|
21
|
+
set: (name: 'cva' | 'css' | 'sva', result: ResultItem) => void
|
|
22
|
+
setCss: (result: ResultItem) => void
|
|
23
|
+
setCva: (result: ResultItem) => void
|
|
24
|
+
setSva: (result: ResultItem) => void
|
|
25
|
+
setJsx: (result: ResultItem) => void
|
|
26
|
+
setPattern: (name: string, result: ResultItem) => void
|
|
27
|
+
setRecipe: (name: string, result: ResultItem) => void
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export interface EncoderJson {
|
package/dist/recipe.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefi
|
|
|
80
80
|
|
|
81
81
|
interface RecipeConfigMeta {
|
|
82
82
|
/**
|
|
83
|
-
* The name of the recipe.
|
|
83
|
+
* The class name of the recipe.
|
|
84
84
|
*/
|
|
85
85
|
className: string
|
|
86
86
|
/**
|
|
@@ -132,6 +132,10 @@ export interface SlotRecipeDefinition<
|
|
|
132
132
|
S extends string = string,
|
|
133
133
|
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
134
134
|
> {
|
|
135
|
+
/**
|
|
136
|
+
* An optional class name that can be used to target slots in the DOM.
|
|
137
|
+
*/
|
|
138
|
+
className?: string
|
|
135
139
|
/**
|
|
136
140
|
* The parts/slots of the recipe.
|
|
137
141
|
*/
|
package/dist/static-css.d.ts
CHANGED
package/dist/system-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConditionalValue,
|
|
1
|
+
import type { ConditionalValue, Nested } from './conditions'
|
|
2
2
|
import type { PropertiesFallback } from './csstype'
|
|
3
3
|
import type { SystemProperties, CssVarProperties } from './style-props'
|
|
4
4
|
|
|
@@ -35,10 +35,6 @@ export interface CssKeyframes {
|
|
|
35
35
|
* Conditional css properties
|
|
36
36
|
* -----------------------------------------------------------------------------*/
|
|
37
37
|
|
|
38
|
-
type MinimalNested<P> = {
|
|
39
|
-
[K in keyof Conditions]?: Nested<P>
|
|
40
|
-
}
|
|
41
|
-
|
|
42
38
|
interface GenericProperties {
|
|
43
39
|
[key: string]: ConditionalValue<String | Number | boolean>
|
|
44
40
|
}
|
|
@@ -71,7 +67,7 @@ export type CompositionStyleObject<Property extends string> = Nested<FilterStyle
|
|
|
71
67
|
interface WithCss {
|
|
72
68
|
css?: SystemStyleObject
|
|
73
69
|
}
|
|
74
|
-
type StyleProps =
|
|
70
|
+
type StyleProps = SystemStyleObject & WithCss
|
|
75
71
|
|
|
76
72
|
export type JsxStyleProps = StyleProps & WithCss
|
|
77
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "The types for css panda",
|
|
5
5
|
"main": "dist/index.d.ts",
|
|
6
6
|
"author": "Segun Adebayo <joseshegs@gmail.com>",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"microdiff": "1.3.2",
|
|
31
31
|
"ncp": "2.0.0",
|
|
32
32
|
"pkg-types": "1.0.3",
|
|
33
|
-
"
|
|
33
|
+
"ts-morph": "21.0.1",
|
|
34
|
+
"@pandacss/extractor": "0.36.0"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"dev": "tsx scripts/watch.ts",
|