@pandacss/studio 0.15.2 → 0.15.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -33,19 +33,19 @@
33
33
  "react": "18.2.0",
34
34
  "react-dom": "18.2.0",
35
35
  "vite": "4.4.9",
36
- "@pandacss/config": "0.15.2",
37
- "@pandacss/logger": "0.15.2",
38
- "@pandacss/node": "0.15.2",
39
- "@pandacss/shared": "0.15.2",
40
- "@pandacss/token-dictionary": "0.15.2",
41
- "@pandacss/types": "0.15.2"
36
+ "@pandacss/config": "0.15.3",
37
+ "@pandacss/logger": "0.15.3",
38
+ "@pandacss/node": "0.15.3",
39
+ "@pandacss/shared": "0.15.3",
40
+ "@pandacss/token-dictionary": "0.15.3",
41
+ "@pandacss/types": "0.15.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/react": "18.2.22",
45
45
  "@types/react-dom": "18.2.7",
46
46
  "@vitejs/plugin-react": "4.0.4",
47
47
  "execa": "7.2.0",
48
- "@pandacss/dev": "0.15.2"
48
+ "@pandacss/dev": "0.15.3"
49
49
  },
50
50
  "scripts": {
51
51
  "codegen": "panda",
@@ -1,5 +1,5 @@
1
1
  import { createElement, forwardRef, useMemo } from 'react'
2
- import { css, cx, cva, assignCss } from '../css/index.mjs';
2
+ import { css, cx, cva } from '../css/index.mjs';
3
3
  import { splitProps, normalizeHTMLProps } from '../helpers.mjs';
4
4
  import { isCssProperty } from './is-valid-prop.mjs';
5
5
 
@@ -15,15 +15,14 @@ function styledFn(Dynamic, configOrCva = {}) {
15
15
 
16
16
  function recipeClass() {
17
17
  const { css: cssStyles, ...propStyles } = styleProps
18
- const styles = assignCss(propStyles, cssStyles)
19
- return cx(cvaFn(variantProps), css(styles), elementProps.className)
18
+ const compoundVariantStyles = cvaFn.__getCompoundVariantCss__?.(variantProps);
19
+ return cx(cvaFn(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), elementProps.className)
20
20
  }
21
21
 
22
22
  function cvaClass() {
23
23
  const { css: cssStyles, ...propStyles } = styleProps
24
24
  const cvaStyles = cvaFn.raw(variantProps)
25
- const styles = assignCss(cvaStyles, propStyles, cssStyles)
26
- return cx(css(styles), elementProps.className)
25
+ return cx(css(cvaStyles, propStyles, cssStyles), elementProps.className)
27
26
  }
28
27
 
29
28
 
@@ -38,11 +38,13 @@ export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVa
38
38
  ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
39
39
  }
40
40
 
41
- export type RecipeCompoundSelection<T extends RecipeVariantRecord> = {
42
- [K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>
41
+ type OneOrMore<T> = T | Array<T>
42
+
43
+ export type RecipeCompoundSelection<T> = {
44
+ [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>>
43
45
  }
44
46
 
45
- export type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
47
+ export type RecipeCompoundVariant<T> = T & {
46
48
  css: SystemStyleObject
47
49
  }
48
50
 
@@ -54,7 +56,7 @@ export interface RecipeDefinition<T extends RecipeVariantRecord> {
54
56
  /**
55
57
  * The multi-variant styles of the recipe.
56
58
  */
57
- variants?: T | RecipeVariantRecord
59
+ variants?: T
58
60
  /**
59
61
  * The default variants of the recipe.
60
62
  */
@@ -62,7 +64,7 @@ export interface RecipeDefinition<T extends RecipeVariantRecord> {
62
64
  /**
63
65
  * The styles to apply when a combination of variants is selected.
64
66
  */
65
- compoundVariants?: Array<RecipeCompoundVariant<T>>
67
+ compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
66
68
  }
67
69
 
68
70
  export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
@@ -109,7 +111,7 @@ export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVaria
109
111
  splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]
110
112
  }
111
113
 
112
- export type SlotRecipeCompoundVariant<S extends string, T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
114
+ export type SlotRecipeCompoundVariant<S extends string, T> = T & {
113
115
  css: SlotRecord<S, SystemStyleObject>
114
116
  }
115
117
 
@@ -125,7 +127,7 @@ export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVari
125
127
  /**
126
128
  * The multi-variant styles of the recipe.
127
129
  */
128
- variants?: T | SlotRecipeVariantRecord<S>
130
+ variants?: T
129
131
  /**
130
132
  * The default variants of the recipe.
131
133
  */
@@ -133,7 +135,7 @@ export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVari
133
135
  /**
134
136
  * The styles to apply when a combination of variants is selected.
135
137
  */
136
- compoundVariants?: Array<SlotRecipeCompoundVariant<S, T>>
138
+ compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
137
139
  }
138
140
 
139
141
  export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(