@pandacss/types 1.9.0 → 1.10.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/hooks.d.ts CHANGED
@@ -61,6 +61,12 @@ export interface PandaHooks {
61
61
  * You can use it to tweak the CSS content before it's written to disk or injected through the postcss plugin.
62
62
  */
63
63
  'cssgen:done': (args: CssgenDoneHookArgs) => string | void
64
+ /**
65
+ * Called when CSS needs to be optimized. Use this hook to replace the default PostCSS-based optimizer
66
+ * with a custom one (e.g. LightningCSS).
67
+ * Return the optimized CSS string, or void to fall through to the default PostCSS optimizer.
68
+ */
69
+ 'css:optimize': (args: CssOptimizeHookArgs) => string | void
64
70
  }
65
71
 
66
72
  type MaybeAsyncReturn<T = void> = Promise<T> | T
@@ -209,6 +215,17 @@ export interface CssgenDoneHookArgs {
209
215
  original?: string
210
216
  }
211
217
 
218
+ /* -----------------------------------------------------------------------------
219
+ * CSS optimize hooks
220
+ * -----------------------------------------------------------------------------*/
221
+
222
+ export interface CssOptimizeHookArgs {
223
+ css: string
224
+ minify?: boolean
225
+ browserslist?: string[]
226
+ original?: string
227
+ }
228
+
212
229
  /* -----------------------------------------------------------------------------
213
230
  * Context hooks
214
231
  * -----------------------------------------------------------------------------*/
package/dist/logger.d.ts CHANGED
@@ -14,6 +14,11 @@ export interface LoggerInterface {
14
14
  info: (type: string, data: any) => void
15
15
  debug: (type: string, data: any) => void
16
16
  error: (type: string, data: any) => void
17
+ /**
18
+ * Log a caught error with context. Extracts the message for the error level,
19
+ * and logs the full stack at debug level.
20
+ */
21
+ caughtError: (type: string, context: string, error: unknown) => void
17
22
  log: (data: string) => void
18
23
  time: {
19
24
  info: (msg: string) => (_msg?: string) => void
package/dist/spec.d.ts CHANGED
@@ -9,6 +9,7 @@ export type SpecType =
9
9
  | 'layer-styles'
10
10
  | 'animation-styles'
11
11
  | 'color-palette'
12
+ | 'themes'
12
13
 
13
14
  interface Examples {
14
15
  functionExamples: string[]
@@ -143,6 +144,31 @@ export interface ColorPaletteSpec {
143
144
  }
144
145
  }
145
146
 
147
+ export interface ThemeTokenValue {
148
+ name: string
149
+ values: Array<{ value: string; condition?: string }>
150
+ description?: string
151
+ deprecated?: boolean | string
152
+ cssVar?: string
153
+ }
154
+
155
+ export interface ThemeTokenGroupDefinition extends Examples {
156
+ type: string
157
+ values: ThemeTokenValue[]
158
+ tokenFunctionExamples: string[]
159
+ }
160
+
161
+ export interface ThemeSpecDefinition {
162
+ name: string
163
+ tokens: ThemeTokenGroupDefinition[]
164
+ semanticTokens: ThemeTokenGroupDefinition[]
165
+ }
166
+
167
+ export interface ThemesSpec {
168
+ type: 'themes'
169
+ data: ThemeSpecDefinition[]
170
+ }
171
+
146
172
  export type SpecFile =
147
173
  | TokenSpec
148
174
  | SemanticTokenSpec
@@ -154,6 +180,7 @@ export type SpecFile =
154
180
  | LayerStyleSpec
155
181
  | AnimationStyleSpec
156
182
  | ColorPaletteSpec
183
+ | ThemesSpec
157
184
 
158
185
  export interface SpecTypeMap {
159
186
  tokens: TokenSpec
@@ -166,4 +193,5 @@ export interface SpecTypeMap {
166
193
  'layer-styles': LayerStyleSpec
167
194
  'animation-styles': AnimationStyleSpec
168
195
  'color-palette': ColorPaletteSpec
196
+ themes: ThemesSpec
169
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -31,8 +31,8 @@
31
31
  "microdiff": "1.5.0",
32
32
  "ncp": "2.0.0",
33
33
  "pkg-types": "2.3.0",
34
- "ts-morph": "27.0.2",
35
- "@pandacss/extractor": "1.9.0"
34
+ "ts-morph": "28.0.0",
35
+ "@pandacss/extractor": "1.10.0"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",