Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pandacss/token-dictionary

Package Overview
Dependencies
Maintainers
1
Versions
1150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pandacss/token-dictionary - npm Package Compare versions

Comparing version 0.0.0-dev-20221128134624 to 0.0.0-dev-20221128144704

2

dist/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc