@kong/design-tokens 1.18.3-pr.613.cb30259.0 → 1.18.3-pr.613.d9d2a3d.0

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.
@@ -35,25 +35,25 @@ const findAllTokenOccurrences = (value, token) => {
35
35
  // Check if token at given position is properly wrapped in var()
36
36
  // Enforces exact format: var(--token, $token) with exactly one space before comma
37
37
  const isTokenProperlyWrapped = (value, tokenIndex, token, cssToken) => {
38
- // Calculate exact positions based on enforced format: var(--token, $token)
39
- // var(-- = 6 chars, token name = cssToken.length - 2, , = 2 chars (comma + space)
40
- const charactersBack = cssToken.length + 6 // 6 + (cssToken.length - 2) + 2
41
- const charactersForward = token.length + 1 // token + )
42
-
43
- const startIndex = tokenIndex - charactersBack
44
- const endIndex = tokenIndex + charactersForward
45
-
46
- // Check bounds
47
- if (startIndex < 0 || endIndex > value.length) {
48
- return false
38
+ // Use regex to find all var(--token, $token) patterns
39
+ // Escape regex metacharacters in token so it is treated literally in the pattern
40
+ const escapedToken = token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
41
+ const pattern = new RegExp(`var\\(${cssToken}, ${escapedToken}\\)`, 'g')
42
+
43
+ // Find all matches
44
+ let match
45
+ while ((match = pattern.exec(value)) !== null) {
46
+ const matchStart = match.index
47
+ const matchEnd = matchStart + match[0].length
48
+
49
+ // Check if our token at tokenIndex is inside this match
50
+ const tokenEndIndex = tokenIndex + token.length
51
+ if (tokenIndex >= matchStart && tokenEndIndex <= matchEnd) {
52
+ return true
53
+ }
49
54
  }
50
55
 
51
- // Extract the substring that should match the exact pattern
52
- const substring = value.substring(startIndex, endIndex)
53
-
54
- // Check if it matches the exact pattern: var(--token, $token)
55
- const expectedPattern = new RegExp(`^var\\(${cssToken}, ${token}\\)$`)
56
- return expectedPattern.test(substring)
56
+ return false
57
57
  }
58
58
 
59
59
  const ruleFunction = () => {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Mon, 05 Jan 2026 20:13:00 GMT
3
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  *
5
5
  * Kong Design Tokens
6
6
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Mon, 05 Jan 2026 20:12:59 GMT
3
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  *
5
5
  * Kong Design Tokens
6
6
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Mon, 05 Jan 2026 20:12:59 GMT
3
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  *
5
5
  * Kong Design Tokens
6
6
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Mon, 05 Jan 2026 20:12:59 GMT
3
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  *
5
5
  * Kong Design Tokens
6
6
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Mon, 05 Jan 2026 20:12:59 GMT
3
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  *
5
5
  * Kong Design Tokens
6
6
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly, this file was auto-generated.
3
- // Generated on Mon, 05 Jan 2026 20:13:00 GMT
3
+ // Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  //
5
5
  // Kong Design Tokens
6
6
  // GitHub: https://github.com/Kong/design-tokens
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly, this file was auto-generated.
4
- * Generated on Mon, 05 Jan 2026 20:13:00 GMT
4
+ * Generated on Mon, 05 Jan 2026 21:19:36 GMT
5
5
  *
6
6
  * Kong Design Tokens
7
7
  * GitHub: https://github.com/Kong/design-tokens
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly, this file was auto-generated.
3
- // Generated on Mon, 05 Jan 2026 20:13:00 GMT
3
+ // Generated on Mon, 05 Jan 2026 21:19:36 GMT
4
4
  //
5
5
  // Kong Design Tokens
6
6
  // GitHub: https://github.com/Kong/design-tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong/design-tokens",
3
- "version": "1.18.3-pr.613.cb30259.0",
3
+ "version": "1.18.3-pr.613.d9d2a3d.0",
4
4
  "description": "Kong UI Design Tokens and style dictionary",
5
5
  "type": "module",
6
6
  "scripts": {