@pandacss/types 0.35.0 → 0.36.1

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.
@@ -25,6 +25,7 @@ export type ArtifactId =
25
25
  | 'jsx-patterns'
26
26
  | 'jsx-patterns-index'
27
27
  | 'css-index'
28
+ | 'themes'
28
29
  | 'package.json'
29
30
  | 'types-jsx'
30
31
  | 'types-entry'
@@ -40,15 +40,13 @@ export interface ExtendableConditions {
40
40
 
41
41
  export type Condition = string
42
42
 
43
- export type Conditional<V> =
43
+ export type ConditionalValue<V> =
44
44
  | V
45
45
  | Array<V | null>
46
46
  | {
47
- [K in keyof Conditions]?: Conditional<V>
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,59 @@ 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
+ export interface ThemeVariantsMap {
131
+ [name: string]: ThemeVariant
132
+ }
133
+
134
+ interface ExtendableThemeVariantsMap {
135
+ [name: string]: ThemeVariantsMap | ThemeVariant | undefined
136
+ extend?: ThemeVariantsMap | undefined
137
+ }
138
+
82
139
  export interface ExtendableOptions {
83
140
  /**
84
141
  * The css selectors or media queries shortcuts.
@@ -105,6 +162,14 @@ export interface ExtendableOptions {
105
162
  * Common styling or layout patterns for your project.
106
163
  */
107
164
  patterns?: ExtendablePatterns
165
+ /**
166
+ * The css variables for your project.
167
+ */
168
+ globalVars?: ExtendableGlobalVars
169
+ /**
170
+ * The theme variants for your project.
171
+ */
172
+ themes?: ExtendableThemeVariantsMap
108
173
  }
109
174
 
110
175
  export interface ImportMapInput {
@@ -43,4 +43,8 @@ export interface StaticCssOptions {
43
43
  patterns?: {
44
44
  [pattern: string]: PatternRule[]
45
45
  }
46
+ /**
47
+ * The CSS themes to generate
48
+ */
49
+ themes?: string[]
46
50
  }
@@ -1,4 +1,4 @@
1
- import type { ConditionalValue, Conditions, Nested } from './conditions'
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 = SystemProperties & MinimalNested<SystemStyleObject>
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.35.0",
3
+ "version": "0.36.1",
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
- "@pandacss/extractor": "0.35.0"
33
+ "ts-morph": "21.0.1",
34
+ "@pandacss/extractor": "0.36.1"
34
35
  },
35
36
  "scripts": {
36
37
  "dev": "tsx scripts/watch.ts",