@pandacss/token-dictionary 0.0.0-dev-20240126173019 → 0.0.0-dev-20240128131310

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
@@ -82,16 +82,15 @@ function getReferences(value) {
82
82
  return [];
83
83
  return matches.map((match3) => match3.replace(curlyBracketRegex, "")).map((value2) => value2.trim());
84
84
  }
85
- function hasReference(value) {
86
- return REFERENCE_REGEX.test(value);
87
- }
85
+ var hasReference = (value) => REFERENCE_REGEX.test(value);
88
86
  var tokenFunctionRegex = /token\(([^)]+)\)/g;
89
87
  var closingParenthesisRegex = /\)$/g;
90
88
  var hasTokenReference = (str) => str.includes("token(");
91
89
  var tokenReplacer = (a, b) => b ? a.endsWith(")") ? a.replace(closingParenthesisRegex, `, ${b})`) : `var(${a}, ${b})` : a;
92
90
  var notFoundMessage = (key, value) => `Reference not found: \`${key}\` in "${value}"`;
91
+ var isTokenReference = (v) => hasReference(v) || hasTokenReference(v);
93
92
  function expandReferences(value, fn) {
94
- if (!hasReference(value) && !hasTokenReference(value))
93
+ if (!isTokenReference(value))
95
94
  return value;
96
95
  const references = getReferences(value);
97
96
  const expanded = references.reduce((valueStr, key) => {
@@ -108,7 +107,7 @@ function expandReferences(value, fn) {
108
107
  const [tokenValue, tokenFallback] = token.split(",").map((s) => s.trim());
109
108
  const result = [tokenValue, tokenFallback].filter(Boolean).map((key) => {
110
109
  const resolved = fn(key);
111
- if (!resolved) {
110
+ if (!resolved && isTokenReference(key)) {
112
111
  import_logger.logger.warn("token", notFoundMessage(key, value));
113
112
  }
114
113
  return resolved ?? (0, import_shared.esc)(key);
package/dist/index.mjs CHANGED
@@ -55,16 +55,15 @@ function getReferences(value) {
55
55
  return [];
56
56
  return matches.map((match3) => match3.replace(curlyBracketRegex, "")).map((value2) => value2.trim());
57
57
  }
58
- function hasReference(value) {
59
- return REFERENCE_REGEX.test(value);
60
- }
58
+ var hasReference = (value) => REFERENCE_REGEX.test(value);
61
59
  var tokenFunctionRegex = /token\(([^)]+)\)/g;
62
60
  var closingParenthesisRegex = /\)$/g;
63
61
  var hasTokenReference = (str) => str.includes("token(");
64
62
  var tokenReplacer = (a, b) => b ? a.endsWith(")") ? a.replace(closingParenthesisRegex, `, ${b})`) : `var(${a}, ${b})` : a;
65
63
  var notFoundMessage = (key, value) => `Reference not found: \`${key}\` in "${value}"`;
64
+ var isTokenReference = (v) => hasReference(v) || hasTokenReference(v);
66
65
  function expandReferences(value, fn) {
67
- if (!hasReference(value) && !hasTokenReference(value))
66
+ if (!isTokenReference(value))
68
67
  return value;
69
68
  const references = getReferences(value);
70
69
  const expanded = references.reduce((valueStr, key) => {
@@ -81,7 +80,7 @@ function expandReferences(value, fn) {
81
80
  const [tokenValue, tokenFallback] = token.split(",").map((s) => s.trim());
82
81
  const result = [tokenValue, tokenFallback].filter(Boolean).map((key) => {
83
82
  const resolved = fn(key);
84
- if (!resolved) {
83
+ if (!resolved && isTokenReference(key)) {
85
84
  logger.warn("token", notFoundMessage(key, value));
86
85
  }
87
86
  return resolved ?? esc(key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/token-dictionary",
3
- "version": "0.0.0-dev-20240126173019",
3
+ "version": "0.0.0-dev-20240128131310",
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.5",
36
- "@pandacss/logger": "^0.0.0-dev-20240126173019",
37
- "@pandacss/shared": "0.0.0-dev-20240126173019",
38
- "@pandacss/types": "0.0.0-dev-20240126173019"
36
+ "@pandacss/logger": "^0.0.0-dev-20240128131310",
37
+ "@pandacss/types": "0.0.0-dev-20240128131310",
38
+ "@pandacss/shared": "0.0.0-dev-20240128131310"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsup src/index.ts --format=esm,cjs --dts",