@pandacss/token-dictionary 0.32.1 → 0.33.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.js CHANGED
@@ -583,7 +583,7 @@ var transformAssets = {
583
583
  match: (token) => token.extensions.category === "assets",
584
584
  transform(token) {
585
585
  const raw = token.value;
586
- return (0, import_ts_pattern2.match)(raw).with(import_ts_pattern2.P.string, (value) => value).with({ type: "url" }, ({ value }) => `url('${value}')`).with({ type: "svg" }, ({ value }) => `url('${svgToDataUri(value)}')`).exhaustive();
586
+ return (0, import_ts_pattern2.match)(raw).with(import_ts_pattern2.P.string, (value) => value).with({ type: "url" }, ({ value }) => `url("${value}")`).with({ type: "svg" }, ({ value }) => `url("${svgToDataUri(value)}")`).exhaustive();
587
587
  }
588
588
  };
589
589
  var addCssVariables = {
@@ -633,17 +633,23 @@ var addColorPalette = {
633
633
  if (tokenPathClone.length === 0) {
634
634
  return {};
635
635
  }
636
- const colorPaletteRoots = tokenPathClone.reduce((acc, _, i, arr) => {
637
- const next = arr.slice(0, i + 1);
638
- acc.push(next);
639
- return acc;
640
- }, []);
636
+ const colorPaletteRoots = tokenPathClone.reduce(
637
+ (acc, _, i, arr) => {
638
+ const next = arr.slice(0, i + 1);
639
+ acc.push(next);
640
+ return acc;
641
+ },
642
+ []
643
+ );
641
644
  const colorPaletteRoot = tokenPathClone[0];
642
645
  const colorPalette = dict.formatTokenName(tokenPathClone);
643
- const colorPaletteTokenKeys = token.path.slice(token.path.indexOf(colorPaletteRoot) + 1).reduce((acc, _, i, arr) => {
644
- acc.push(arr.slice(i));
645
- return acc;
646
- }, []);
646
+ const colorPaletteTokenKeys = token.path.slice(token.path.indexOf(colorPaletteRoot) + 1).reduce(
647
+ (acc, _, i, arr) => {
648
+ acc.push(arr.slice(i));
649
+ return acc;
650
+ },
651
+ []
652
+ );
647
653
  if (colorPaletteTokenKeys.length === 0) {
648
654
  colorPaletteTokenKeys.push([""]);
649
655
  }
@@ -858,10 +864,13 @@ var TokenDictionary = class {
858
864
  return;
859
865
  const references = this.getReferences(token.value);
860
866
  token.setExtensions({
861
- references: references.reduce((object, reference) => {
862
- object[reference.name] = reference;
863
- return object;
864
- }, {})
867
+ references: references.reduce(
868
+ (object, reference) => {
869
+ object[reference.name] = reference;
870
+ return object;
871
+ },
872
+ {}
873
+ )
865
874
  });
866
875
  });
867
876
  return this;
@@ -1018,7 +1027,7 @@ var TokenDictionaryView = class {
1018
1027
  byCategory.set(category, /* @__PURE__ */ new Map());
1019
1028
  const value = isNegative ? token.isConditional ? token.originalValue : token.value : varRef;
1020
1029
  byCategory.get(category).set(prop, value);
1021
- flat.set([category, prop].join("."), value);
1030
+ flat.set(token.name, value);
1022
1031
  }
1023
1032
  processVars(token, group) {
1024
1033
  const { condition, isNegative, isVirtual, var: varName } = token.extensions;
package/dist/index.mjs CHANGED
@@ -563,7 +563,7 @@ var transformAssets = {
563
563
  match: (token) => token.extensions.category === "assets",
564
564
  transform(token) {
565
565
  const raw = token.value;
566
- return match(raw).with(P2.string, (value) => value).with({ type: "url" }, ({ value }) => `url('${value}')`).with({ type: "svg" }, ({ value }) => `url('${svgToDataUri(value)}')`).exhaustive();
566
+ return match(raw).with(P2.string, (value) => value).with({ type: "url" }, ({ value }) => `url("${value}")`).with({ type: "svg" }, ({ value }) => `url("${svgToDataUri(value)}")`).exhaustive();
567
567
  }
568
568
  };
569
569
  var addCssVariables = {
@@ -613,17 +613,23 @@ var addColorPalette = {
613
613
  if (tokenPathClone.length === 0) {
614
614
  return {};
615
615
  }
616
- const colorPaletteRoots = tokenPathClone.reduce((acc, _, i, arr) => {
617
- const next = arr.slice(0, i + 1);
618
- acc.push(next);
619
- return acc;
620
- }, []);
616
+ const colorPaletteRoots = tokenPathClone.reduce(
617
+ (acc, _, i, arr) => {
618
+ const next = arr.slice(0, i + 1);
619
+ acc.push(next);
620
+ return acc;
621
+ },
622
+ []
623
+ );
621
624
  const colorPaletteRoot = tokenPathClone[0];
622
625
  const colorPalette = dict.formatTokenName(tokenPathClone);
623
- const colorPaletteTokenKeys = token.path.slice(token.path.indexOf(colorPaletteRoot) + 1).reduce((acc, _, i, arr) => {
624
- acc.push(arr.slice(i));
625
- return acc;
626
- }, []);
626
+ const colorPaletteTokenKeys = token.path.slice(token.path.indexOf(colorPaletteRoot) + 1).reduce(
627
+ (acc, _, i, arr) => {
628
+ acc.push(arr.slice(i));
629
+ return acc;
630
+ },
631
+ []
632
+ );
627
633
  if (colorPaletteTokenKeys.length === 0) {
628
634
  colorPaletteTokenKeys.push([""]);
629
635
  }
@@ -838,10 +844,13 @@ var TokenDictionary = class {
838
844
  return;
839
845
  const references = this.getReferences(token.value);
840
846
  token.setExtensions({
841
- references: references.reduce((object, reference) => {
842
- object[reference.name] = reference;
843
- return object;
844
- }, {})
847
+ references: references.reduce(
848
+ (object, reference) => {
849
+ object[reference.name] = reference;
850
+ return object;
851
+ },
852
+ {}
853
+ )
845
854
  });
846
855
  });
847
856
  return this;
@@ -998,7 +1007,7 @@ var TokenDictionaryView = class {
998
1007
  byCategory.set(category, /* @__PURE__ */ new Map());
999
1008
  const value = isNegative ? token.isConditional ? token.originalValue : token.value : varRef;
1000
1009
  byCategory.get(category).set(prop, value);
1001
- flat.set([category, prop].join("."), value);
1010
+ flat.set(token.name, value);
1002
1011
  }
1003
1012
  processVars(token, group) {
1004
1013
  const { condition, isNegative, isVirtual, var: varName } = token.extensions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/token-dictionary",
3
- "version": "0.32.1",
3
+ "version": "0.33.0",
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.32.1",
37
- "@pandacss/types": "0.32.1",
38
- "@pandacss/shared": "0.32.1"
36
+ "@pandacss/logger": "^0.33.0",
37
+ "@pandacss/shared": "0.33.0",
38
+ "@pandacss/types": "0.33.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsup src/index.ts --format=esm,cjs --dts",