@pandacss/token-dictionary 0.3.2 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -33,6 +33,10 @@ declare class Token {
33
33
  description?: string;
34
34
  extensions: TokenExtensions;
35
35
  constructor(data: ExtendedToken);
36
+ /**
37
+ * The unique identifier of the token.
38
+ */
39
+ get id(): string;
36
40
  /**
37
41
  * Whether the token is a conditional token.
38
42
  * Conditional tokens are tokens that have multiple values based on a condition.
package/dist/index.js CHANGED
@@ -94,6 +94,12 @@ var Token = class {
94
94
  this.extensions.condition = data.extensions?.condition ?? "base";
95
95
  this.setType();
96
96
  }
97
+ /**
98
+ * The unique identifier of the token.
99
+ */
100
+ get id() {
101
+ return (0, import_shared2.toHash)(`${this.name}-${this.extensions.condition}-${this.value}`);
102
+ }
97
103
  /**
98
104
  * Whether the token is a conditional token.
99
105
  * Conditional tokens are tokens that have multiple values based on a condition.
@@ -517,6 +523,9 @@ var addNegativeTokens = {
517
523
  tokens.forEach((token) => {
518
524
  const originalPath = [...token.path];
519
525
  const originalVar = (0, import_shared5.cssVar)(originalPath.join("-"), { prefix, hash });
526
+ if (token.value === "0rem") {
527
+ return;
528
+ }
520
529
  const node = token.clone();
521
530
  node.setExtensions({
522
531
  isNegative: true,
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { compact, isString, mapObject, memo, walkObject as walkObject2 } from "@
6
6
  import { isMatching, match } from "ts-pattern";
7
7
 
8
8
  // src/token.ts
9
- import { isBaseCondition, isObject as isObject2, walkObject } from "@pandacss/shared";
9
+ import { isBaseCondition, isObject as isObject2, toHash, walkObject } from "@pandacss/shared";
10
10
 
11
11
  // src/utils.ts
12
12
  import { isObject } from "@pandacss/shared";
@@ -67,6 +67,12 @@ var Token = class {
67
67
  this.extensions.condition = data.extensions?.condition ?? "base";
68
68
  this.setType();
69
69
  }
70
+ /**
71
+ * The unique identifier of the token.
72
+ */
73
+ get id() {
74
+ return toHash(`${this.name}-${this.extensions.condition}-${this.value}`);
75
+ }
70
76
  /**
71
77
  * Whether the token is a conditional token.
72
78
  * Conditional tokens are tokens that have multiple values based on a condition.
@@ -490,6 +496,9 @@ var addNegativeTokens = {
490
496
  tokens.forEach((token) => {
491
497
  const originalPath = [...token.path];
492
498
  const originalVar = cssVar(originalPath.join("-"), { prefix, hash });
499
+ if (token.value === "0rem") {
500
+ return;
501
+ }
493
502
  const node = token.clone();
494
503
  node.setExtensions({
495
504
  isNegative: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/token-dictionary",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Common error messages for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -15,11 +15,11 @@
15
15
  ],
16
16
  "dependencies": {
17
17
  "ts-pattern": "4.3.0",
18
- "@pandacss/types": "0.3.2",
19
- "@pandacss/shared": "0.3.2"
18
+ "@pandacss/types": "0.4.0",
19
+ "@pandacss/shared": "0.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@pandacss/fixture": "0.3.2"
22
+ "@pandacss/fixture": "0.4.0"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsup src/index.ts --format=esm,cjs --dts",