@pandacss/studio 0.0.0-dev-20240402192619 → 0.0.0-dev-20240402215554
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.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20240402215554",
|
|
4
4
|
"description": "The automated token documentation for Panda CSS",
|
|
5
5
|
"main": "dist/studio.js",
|
|
6
6
|
"module": "dist/studio.mjs",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"react": "18.2.0",
|
|
49
49
|
"react-dom": "18.2.0",
|
|
50
50
|
"vite": "5.1.3",
|
|
51
|
-
"@pandacss/config": "0.0.0-dev-
|
|
52
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
53
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
54
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
55
|
-
"@pandacss/types": "0.0.0-dev-
|
|
56
|
-
"@pandacss/astro-plugin-studio": "0.0.0-dev-
|
|
51
|
+
"@pandacss/config": "0.0.0-dev-20240402215554",
|
|
52
|
+
"@pandacss/logger": "0.0.0-dev-20240402215554",
|
|
53
|
+
"@pandacss/shared": "0.0.0-dev-20240402215554",
|
|
54
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20240402215554",
|
|
55
|
+
"@pandacss/types": "0.0.0-dev-20240402215554",
|
|
56
|
+
"@pandacss/astro-plugin-studio": "0.0.0-dev-20240402215554"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/react": "18.2.55",
|
|
@@ -11,9 +11,10 @@ const defaults = (conf) => ({
|
|
|
11
11
|
|
|
12
12
|
export function cva(config) {
|
|
13
13
|
const { base, variants, defaultVariants, compoundVariants } = defaults(config)
|
|
14
|
+
const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
|
|
14
15
|
|
|
15
16
|
function resolve(props = {}) {
|
|
16
|
-
const computedVariants =
|
|
17
|
+
const computedVariants = getVariantProps(props)
|
|
17
18
|
let variantCss = { ...base }
|
|
18
19
|
for (const [key, value] of Object.entries(computedVariants)) {
|
|
19
20
|
if (variants[key]?.[value]) {
|
|
@@ -57,6 +58,7 @@ export function cva(config) {
|
|
|
57
58
|
config,
|
|
58
59
|
merge,
|
|
59
60
|
splitVariantProps,
|
|
61
|
+
getVariantProps
|
|
60
62
|
})
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -46,6 +46,7 @@ export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVa
|
|
|
46
46
|
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
47
47
|
props: Props,
|
|
48
48
|
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
49
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
type OneOrMore<T> = T | Array<T>
|
|
@@ -122,7 +123,7 @@ export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVaria
|
|
|
122
123
|
raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>
|
|
123
124
|
variantKeys: (keyof T)[]
|
|
124
125
|
variantMap: RecipeVariantMap<T>
|
|
125
|
-
|
|
126
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
export type SlotRecipeCompoundVariant<S extends string, T> = T & {
|