@pandacss/core
Advanced tools
Comparing version 0.0.0-dev-20221121175259 to 0.0.0-dev-20221122153914
@@ -214,12 +214,15 @@ import { RawCondition, Dict as Dict$1, UtilityConfig, PropertyConfig, TransformHelpers, RecipeConfig } from '@pandacss/types'; | ||
type StyleObject = Record<string, any>; | ||
declare class Recipe { | ||
private context; | ||
config: RecipeConfig; | ||
name: string; | ||
values: Map<string, Set<{ | ||
className: string; | ||
value: string; | ||
}>>; | ||
constructor(config: RecipeConfig, context: StylesheetContext); | ||
walk: (styleObject: StyleObject) => StyleObject; | ||
transform: (prop: string, value: string) => { | ||
className: string; | ||
styles: any; | ||
}; | ||
private setValues; | ||
private getClassName; | ||
private walk; | ||
private transform; | ||
process: (options: ProcessOptions) => void; | ||
@@ -226,0 +229,0 @@ toCss: () => string; |
@@ -762,2 +762,3 @@ "use strict"; | ||
const { name, base = {}, variants = {}, defaultVariants = {}, description = "" } = config; | ||
this.name = name; | ||
const recipe = { | ||
@@ -772,4 +773,7 @@ name, | ||
for (const [key, variant] of Object.entries(variants)) { | ||
for (const [value, styles] of Object.entries(variant)) { | ||
(0, import_lodash2.default)(recipe.variants, { [key]: { [value]: this.walk(styles) } }); | ||
for (const [variantKey, styles] of Object.entries(variant)) { | ||
this.setValues(key, variantKey); | ||
(0, import_lodash2.default)(recipe.variants, { | ||
[key]: { [variantKey]: this.walk(styles) } | ||
}); | ||
} | ||
@@ -780,2 +784,15 @@ } | ||
config; | ||
name; | ||
values = /* @__PURE__ */ new Map(); | ||
setValues = (key, value) => { | ||
this.values.get(key) || this.values.set(key, /* @__PURE__ */ new Set()); | ||
this.values.get(key).add({ | ||
className: this.getClassName(key, value), | ||
value | ||
}); | ||
}; | ||
getClassName = (key, value) => { | ||
const { separator } = this.context.utility; | ||
return `${this.name}--${key}${separator}${value}`; | ||
}; | ||
walk = (styleObject) => { | ||
@@ -799,3 +816,2 @@ const { utility, conditions } = this.context; | ||
transform = (prop, value) => { | ||
const { separator } = this.context.utility; | ||
const { name, base = {}, variants = {} } = this.config; | ||
@@ -809,3 +825,3 @@ if (value === "__ignore__") { | ||
return { | ||
className: `${name}--${prop}${separator}${value}`, | ||
className: this.getClassName(prop, value), | ||
styles: variants[prop]?.[value] ?? {} | ||
@@ -812,0 +828,0 @@ }; |
{ | ||
"name": "@pandacss/core", | ||
"version": "0.0.0-dev-20221121175259", | ||
"version": "0.0.0-dev-20221122153914", | ||
"description": "core functions for extract-it", | ||
@@ -26,11 +26,11 @@ "main": "dist/index.js", | ||
"lodash.merge": "4.6.2", | ||
"@pandacss/error": "0.0.0-dev-20221121175259", | ||
"@pandacss/types": "0.0.0-dev-20221121175259", | ||
"@pandacss/shared": "0.0.0-dev-20221121175259", | ||
"@pandacss/logger": "0.0.0-dev-20221121175259", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20221121175259" | ||
"@pandacss/error": "0.0.0-dev-20221122153914", | ||
"@pandacss/types": "0.0.0-dev-20221122153914", | ||
"@pandacss/shared": "0.0.0-dev-20221122153914", | ||
"@pandacss/logger": "0.0.0-dev-20221122153914", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20221122153914" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.merge": "4.6.7", | ||
"@pandacss/fixture": "0.0.0-dev-20221121175259" | ||
"@pandacss/fixture": "0.0.0-dev-20221122153914" | ||
}, | ||
@@ -37,0 +37,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74017
2441
+ Added@pandacss/error@0.0.0-dev-20221122153914(transitive)
+ Added@pandacss/logger@0.0.0-dev-20221122153914(transitive)
+ Added@pandacss/shared@0.0.0-dev-20221122153914(transitive)
+ Added@pandacss/token-dictionary@0.0.0-dev-20221122153914(transitive)
+ Added@pandacss/types@0.0.0-dev-20221122153914(transitive)
- Removed@pandacss/error@0.0.0-dev-20221121175259(transitive)
- Removed@pandacss/logger@0.0.0-dev-20221121175259(transitive)
- Removed@pandacss/shared@0.0.0-dev-20221121175259(transitive)
- Removed@pandacss/token-dictionary@0.0.0-dev-20221121175259(transitive)
- Removed@pandacss/types@0.0.0-dev-20221121175259(transitive)