@pandacss/token-dictionary
Advanced tools
Comparing version 0.0.0-dev-20221128134624 to 0.0.0-dev-20221128144704
@@ -198,3 +198,3 @@ type TokenStatus$1 = 'deprecated' | 'experimental' | 'new'; | ||
get values(): Map<string, Map<string, string>>; | ||
get palettes(): { | ||
get colorPalettes(): { | ||
clear: never; | ||
@@ -201,0 +201,0 @@ delete: never; |
@@ -376,10 +376,10 @@ "use strict"; | ||
}, | ||
groupByPalette(dictionary) { | ||
groupByColorPalette(dictionary) { | ||
const grouped = /* @__PURE__ */ new Map(); | ||
dictionary.allTokens.forEach((token) => { | ||
const { palette } = token.extensions; | ||
if (!palette || token.extensions.isVirtual) | ||
const { colorPalette } = token.extensions; | ||
if (!colorPalette || token.extensions.isVirtual) | ||
return; | ||
grouped.get(palette) || grouped.set(palette, /* @__PURE__ */ new Map()); | ||
const virtualName = token.name.replace(palette, "palette"); | ||
grouped.get(colorPalette) || grouped.set(colorPalette, /* @__PURE__ */ new Map()); | ||
const virtualName = token.name.replace(colorPalette, "colorPalette"); | ||
const virtualToken = dictionary.getByName(virtualName); | ||
@@ -389,3 +389,3 @@ if (!virtualToken) | ||
const virtualVar = virtualToken.extensions.var; | ||
grouped.get(palette).set(virtualVar, token.extensions.varRef); | ||
grouped.get(colorPalette).set(virtualVar, token.extensions.varRef); | ||
}); | ||
@@ -437,9 +437,9 @@ return grouped; | ||
}, | ||
getPaletteValues(dictionary) { | ||
getColorPaletteValues(dictionary) { | ||
const values = /* @__PURE__ */ new Set(); | ||
dictionary.allTokens.forEach((token) => { | ||
const { palette } = token.extensions; | ||
if (!palette || token.extensions.isVirtual) | ||
const { colorPalette } = token.extensions; | ||
if (!colorPalette || token.extensions.isVirtual) | ||
return; | ||
values.add(palette); | ||
values.add(colorPalette); | ||
}); | ||
@@ -486,21 +486,21 @@ return values; | ||
const keys = /* @__PURE__ */ new Set(); | ||
const palettes = /* @__PURE__ */ new Map(); | ||
const colorPalettes = /* @__PURE__ */ new Map(); | ||
tokens.forEach((token) => { | ||
const palette = token.extensions.palette; | ||
if (!palette) | ||
const { colorPalette } = token.extensions; | ||
if (!colorPalette) | ||
return; | ||
const list = palettes.get(palette) || []; | ||
const list = colorPalettes.get(colorPalette) || []; | ||
keys.add(token.path.at(-1)); | ||
list.push(token); | ||
palettes.set(palette, list); | ||
colorPalettes.set(colorPalette, list); | ||
}); | ||
keys.forEach((key) => { | ||
const node = new Token({ | ||
name: `colors.palette.${key}`, | ||
value: `{colors.palette.${key}}`, | ||
path: ["colors", "palette", key] | ||
name: `colors.colorPalette.${key}`, | ||
value: `{colors.colorPalette.${key}}`, | ||
path: ["colors", "colorPalette", key] | ||
}); | ||
node.setExtensions({ | ||
category: "colors", | ||
prop: `palette.${key}`, | ||
prop: `colorPalette.${key}`, | ||
isVirtual: true | ||
@@ -633,3 +633,3 @@ }); | ||
}; | ||
function getPaletteName(path) { | ||
function getColorPaletteName(path) { | ||
if (path.includes("colorPalette")) | ||
@@ -642,5 +642,5 @@ return ""; | ||
} | ||
var addPalette = { | ||
var addColorPalette = { | ||
type: "extensions", | ||
name: "tokens/colors/palette", | ||
name: "tokens/colors/colorPalette", | ||
match(token) { | ||
@@ -650,3 +650,3 @@ return token.extensions.category === "colors"; | ||
transform(token) { | ||
return { palette: getPaletteName(token.path) }; | ||
return { colorPalette: getColorPaletteName(token.path) }; | ||
} | ||
@@ -662,3 +662,3 @@ }; | ||
addConditionalCssVariables, | ||
addPalette | ||
addColorPalette | ||
]; | ||
@@ -686,4 +686,4 @@ | ||
} | ||
get palettes() { | ||
return (0, import_shared7.mapToJson)(formats.groupByPalette(this)); | ||
get colorPalettes() { | ||
return (0, import_shared7.mapToJson)(formats.groupByColorPalette(this)); | ||
} | ||
@@ -690,0 +690,0 @@ get vars() { |
{ | ||
"name": "@pandacss/token-dictionary", | ||
"version": "0.0.0-dev-20221128134624", | ||
"version": "0.0.0-dev-20221128144704", | ||
"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-20221128134624" | ||
"@pandacss/shared": "0.0.0-dev-20221128144704" | ||
}, | ||
"devDependencies": { | ||
"@pandacss/fixture": "0.0.0-dev-20221128134624" | ||
"@pandacss/fixture": "0.0.0-dev-20221128144704" | ||
}, | ||
@@ -24,0 +24,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
47476
+ Added@pandacss/shared@0.0.0-dev-20221128144704(transitive)
- Removed@pandacss/shared@0.0.0-dev-20221128134624(transitive)