@pandacss/token-dictionary
Advanced tools
Comparing version 0.0.0-dev-20221125165251 to 0.0.0-dev-20221126091729
@@ -86,6 +86,9 @@ type TokenStatus$1 = 'deprecated' | 'experimental' | 'new'; | ||
}; | ||
type Conditional<C extends string, V> = V | { | ||
[K in C]?: Conditional<C, V>; | ||
}; | ||
type SemanticTokenEntry<V = string, C extends string = string> = { | ||
description?: string; | ||
type?: string; | ||
value: V | Record<C, V>; | ||
value: Conditional<C, V>; | ||
extensions?: { | ||
@@ -92,0 +95,0 @@ [key: string]: any; |
@@ -139,7 +139,11 @@ "use strict"; | ||
const conditions = this.extensions.conditions ?? {}; | ||
const conditionalTokens = Object.entries(conditions).filter(([key]) => key !== "base").map(([key, value]) => { | ||
const conditionalTokens = []; | ||
(0, import_shared2.walkObject)(conditions, (value, path) => { | ||
const newPath = path.filter((v) => !(0, import_shared2.isBaseCondition)(v)); | ||
if (!newPath.length) | ||
return; | ||
const token = this.clone(); | ||
token.value = value; | ||
token.extensions.condition = key; | ||
return token; | ||
token.extensions.condition = newPath.join(":"); | ||
conditionalTokens.push(token); | ||
}); | ||
@@ -146,0 +150,0 @@ return conditionalTokens; |
{ | ||
"name": "@pandacss/token-dictionary", | ||
"version": "0.0.0-dev-20221125165251", | ||
"version": "0.0.0-dev-20221126091729", | ||
"description": "Common error messages for css panda", | ||
@@ -18,6 +18,6 @@ "main": "dist/index.js", | ||
"ts-pattern": "4.0.6", | ||
"@pandacss/shared": "0.0.0-dev-20221125165251" | ||
"@pandacss/shared": "0.0.0-dev-20221126091729" | ||
}, | ||
"devDependencies": { | ||
"@pandacss/fixture": "0.0.0-dev-20221125165251" | ||
"@pandacss/fixture": "0.0.0-dev-20221126091729" | ||
}, | ||
@@ -24,0 +24,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
47169
1564
+ Added@pandacss/shared@0.0.0-dev-20221126091729(transitive)
- Removed@pandacss/shared@0.0.0-dev-20221125165251(transitive)