@pandacss/token-dictionary 0.45.0 → 0.45.2

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/dist/index.js CHANGED
@@ -640,25 +640,25 @@ var addConditionalCssVariables = {
640
640
  const refs = getReferences(token.value);
641
641
  if (!refs.length)
642
642
  return token.value;
643
- refs.forEach((ref) => {
644
- if (!ref.includes("/")) {
643
+ const modifier = refs.some((ref) => ref.includes("/"));
644
+ if (!modifier) {
645
+ refs.forEach((ref) => {
645
646
  const variable = dictionary.formatCssVar(ref.split("."), { prefix, hash }).ref;
646
647
  token.value = token.value.replace(`{${ref}}`, variable);
647
- return;
648
- }
649
- const expanded = expandReferences(token.value, (path) => {
650
- const tokenFn = (tokenPath) => {
651
- const token2 = dictionary.getByName(tokenPath);
652
- return token2?.extensions.varRef;
653
- };
648
+ });
649
+ } else {
650
+ const tokenFn = (name) => {
651
+ const token2 = dictionary.getByName(name);
652
+ return token2?.extensions.varRef;
653
+ };
654
+ token.value = expandReferences(token.value, (path) => {
654
655
  const mix = dictionary.colorMix(path, tokenFn);
655
656
  if (mix.invalid) {
656
657
  throw new Error("Invalid color mix at " + path + ": " + mix.value);
657
658
  }
658
659
  return mix.value;
659
660
  });
660
- token.value = token.value.replace(`{${ref}}`, expanded);
661
- });
661
+ }
662
662
  return token.value;
663
663
  }
664
664
  };
package/dist/index.mjs CHANGED
@@ -616,25 +616,25 @@ var addConditionalCssVariables = {
616
616
  const refs = getReferences(token.value);
617
617
  if (!refs.length)
618
618
  return token.value;
619
- refs.forEach((ref) => {
620
- if (!ref.includes("/")) {
619
+ const modifier = refs.some((ref) => ref.includes("/"));
620
+ if (!modifier) {
621
+ refs.forEach((ref) => {
621
622
  const variable = dictionary.formatCssVar(ref.split("."), { prefix, hash }).ref;
622
623
  token.value = token.value.replace(`{${ref}}`, variable);
623
- return;
624
- }
625
- const expanded = expandReferences(token.value, (path) => {
626
- const tokenFn = (tokenPath) => {
627
- const token2 = dictionary.getByName(tokenPath);
628
- return token2?.extensions.varRef;
629
- };
624
+ });
625
+ } else {
626
+ const tokenFn = (name) => {
627
+ const token2 = dictionary.getByName(name);
628
+ return token2?.extensions.varRef;
629
+ };
630
+ token.value = expandReferences(token.value, (path) => {
630
631
  const mix = dictionary.colorMix(path, tokenFn);
631
632
  if (mix.invalid) {
632
633
  throw new Error("Invalid color mix at " + path + ": " + mix.value);
633
634
  }
634
635
  return mix.value;
635
636
  });
636
- token.value = token.value.replace(`{${ref}}`, expanded);
637
- });
637
+ }
638
638
  return token.value;
639
639
  }
640
640
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/token-dictionary",
3
- "version": "0.45.0",
3
+ "version": "0.45.2",
4
4
  "description": "Common error messages for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,9 +33,9 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "ts-pattern": "5.0.8",
36
- "@pandacss/logger": "^0.45.0",
37
- "@pandacss/shared": "0.45.0",
38
- "@pandacss/types": "0.45.0"
36
+ "@pandacss/logger": "^0.45.2",
37
+ "@pandacss/shared": "0.45.2",
38
+ "@pandacss/types": "0.45.2"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsup src/index.ts --format=esm,cjs --dts",