@pandacss/types 0.30.2 → 0.31.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/config.d.ts CHANGED
@@ -273,6 +273,17 @@ interface CssgenOptions {
273
273
  * @see https://www.npmjs.com/package/browserslist
274
274
  */
275
275
  browserslist?: string[]
276
+ /**
277
+ * Layer mappings used in the generated css.
278
+ * @default 'true'
279
+ */
280
+ layers?: Partial<CascadeLayers>
281
+ /**
282
+ * Polyfill CSS @layers at-rules for older browsers.
283
+ * @default 'false'
284
+ * @see https://www.npmjs.com/package/@csstools/postcss-cascade-layers
285
+ */
286
+ polyfill?: boolean
276
287
  }
277
288
 
278
289
  interface CodegenOptions {
@@ -310,11 +321,6 @@ interface CodegenOptions {
310
321
  * @default 'true'
311
322
  */
312
323
  shorthands?: boolean
313
- /**
314
- * Layer mappings used in the generated css.
315
- * @default 'true'
316
- */
317
- layers?: Partial<CascadeLayers>
318
324
  /**
319
325
  * File extension for generated javascript files.
320
326
  * @default 'mjs'
package/dist/recipe.d.ts CHANGED
@@ -13,10 +13,21 @@ export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends k
13
13
 
14
14
  export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
15
15
 
16
+ /**
17
+ * Extract the variant as optional props from a `cva` function.
18
+ * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.
19
+ */
16
20
  export type RecipeVariantProps<
17
21
  T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
18
22
  > = Pretty<Parameters<T>[0]>
19
23
 
24
+ /**
25
+ * Extract the variants from a `cva` function.
26
+ */
27
+ export type RecipeVariant<
28
+ T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
29
+ > = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>
30
+
20
31
  type RecipeVariantMap<T extends RecipeVariantRecord> = {
21
32
  [K in keyof T]: Array<keyof T[K]>
22
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.30.2",
3
+ "version": "0.31.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,7 @@
30
30
  "microdiff": "^1.3.2",
31
31
  "ncp": "^2.0.0",
32
32
  "pkg-types": "1.0.3",
33
- "@pandacss/extractor": "0.30.2"
33
+ "@pandacss/extractor": "0.31.0"
34
34
  },
35
35
  "scripts": {
36
36
  "dev": "tsx scripts/watch.ts",