@pandacss/token-dictionary 0.0.0-dev-20231106183456 → 0.0.0-dev-20231106202246

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
@@ -622,13 +622,13 @@ var addVirtualPalette = {
622
622
  });
623
623
  keys.forEach((key) => {
624
624
  const node = new Token({
625
- name: `colors.colorPalette.${key}`,
626
- value: `{colors.colorPalette.${key}}`,
625
+ name: ["colors.colorPalette", key].filter(Boolean).join("."),
626
+ value: ["colors.colorPalette", key].filter(Boolean).join("."),
627
627
  path: ["colors", "colorPalette", ...key.split(".")]
628
628
  });
629
629
  node.setExtensions({
630
630
  category: "colors",
631
- prop: `colorPalette.${key}`,
631
+ prop: ["colorPalette", key].filter(Boolean).join("."),
632
632
  isVirtual: true
633
633
  });
634
634
  dictionary.allTokens.push(node);
@@ -839,7 +839,7 @@ var addCssVariables = {
839
839
  transform(token, { prefix, hash }) {
840
840
  const { isNegative, originalPath } = token.extensions;
841
841
  const pathValue = isNegative ? originalPath : token.path;
842
- const variable = (0, import_shared6.cssVar)(pathValue.join("-"), { prefix, hash });
842
+ const variable = (0, import_shared6.cssVar)(pathValue.filter(Boolean).join("-"), { prefix, hash });
843
843
  return {
844
844
  var: variable.var,
845
845
  varRef: variable.ref
@@ -867,14 +867,20 @@ var addColorPalette = {
867
867
  return token.extensions.category === "colors" && !token.extensions.isVirtual;
868
868
  },
869
869
  transform(token) {
870
- const tokenPathClone = [...token.path];
870
+ let tokenPathClone = [...token.path];
871
871
  tokenPathClone.pop();
872
872
  tokenPathClone.shift();
873
+ if (tokenPathClone.length === 0) {
874
+ const newPath = [...token.path];
875
+ newPath.shift();
876
+ tokenPathClone = newPath;
877
+ }
873
878
  if (tokenPathClone.length === 0) {
874
879
  return {};
875
880
  }
876
881
  const colorPaletteRoots = tokenPathClone.reduce((acc, _, i, arr) => {
877
- acc.push(arr.slice(0, i + 1).join("."));
882
+ const next = arr.slice(0, i + 1).join(".");
883
+ acc.push(next);
878
884
  return acc;
879
885
  }, []);
880
886
  const colorPaletteRoot = tokenPathClone[0];
@@ -883,6 +889,9 @@ var addColorPalette = {
883
889
  acc.push(arr.slice(i).join("."));
884
890
  return acc;
885
891
  }, []);
892
+ if (colorPaletteTokenKeys.length === 0) {
893
+ colorPaletteTokenKeys.push("");
894
+ }
886
895
  return {
887
896
  colorPalette,
888
897
  colorPaletteRoots,
package/dist/index.mjs CHANGED
@@ -595,13 +595,13 @@ var addVirtualPalette = {
595
595
  });
596
596
  keys.forEach((key) => {
597
597
  const node = new Token({
598
- name: `colors.colorPalette.${key}`,
599
- value: `{colors.colorPalette.${key}}`,
598
+ name: ["colors.colorPalette", key].filter(Boolean).join("."),
599
+ value: ["colors.colorPalette", key].filter(Boolean).join("."),
600
600
  path: ["colors", "colorPalette", ...key.split(".")]
601
601
  });
602
602
  node.setExtensions({
603
603
  category: "colors",
604
- prop: `colorPalette.${key}`,
604
+ prop: ["colorPalette", key].filter(Boolean).join("."),
605
605
  isVirtual: true
606
606
  });
607
607
  dictionary.allTokens.push(node);
@@ -812,7 +812,7 @@ var addCssVariables = {
812
812
  transform(token, { prefix, hash }) {
813
813
  const { isNegative, originalPath } = token.extensions;
814
814
  const pathValue = isNegative ? originalPath : token.path;
815
- const variable = cssVar2(pathValue.join("-"), { prefix, hash });
815
+ const variable = cssVar2(pathValue.filter(Boolean).join("-"), { prefix, hash });
816
816
  return {
817
817
  var: variable.var,
818
818
  varRef: variable.ref
@@ -840,14 +840,20 @@ var addColorPalette = {
840
840
  return token.extensions.category === "colors" && !token.extensions.isVirtual;
841
841
  },
842
842
  transform(token) {
843
- const tokenPathClone = [...token.path];
843
+ let tokenPathClone = [...token.path];
844
844
  tokenPathClone.pop();
845
845
  tokenPathClone.shift();
846
+ if (tokenPathClone.length === 0) {
847
+ const newPath = [...token.path];
848
+ newPath.shift();
849
+ tokenPathClone = newPath;
850
+ }
846
851
  if (tokenPathClone.length === 0) {
847
852
  return {};
848
853
  }
849
854
  const colorPaletteRoots = tokenPathClone.reduce((acc, _, i, arr) => {
850
- acc.push(arr.slice(0, i + 1).join("."));
855
+ const next = arr.slice(0, i + 1).join(".");
856
+ acc.push(next);
851
857
  return acc;
852
858
  }, []);
853
859
  const colorPaletteRoot = tokenPathClone[0];
@@ -856,6 +862,9 @@ var addColorPalette = {
856
862
  acc.push(arr.slice(i).join("."));
857
863
  return acc;
858
864
  }, []);
865
+ if (colorPaletteTokenKeys.length === 0) {
866
+ colorPaletteTokenKeys.push("");
867
+ }
859
868
  return {
860
869
  colorPalette,
861
870
  colorPaletteRoots,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/token-dictionary",
3
- "version": "0.0.0-dev-20231106183456",
3
+ "version": "0.0.0-dev-20231106202246",
4
4
  "description": "Common error messages for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,11 +27,11 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "ts-pattern": "5.0.5",
30
- "@pandacss/shared": "0.0.0-dev-20231106183456",
31
- "@pandacss/types": "0.0.0-dev-20231106183456"
30
+ "@pandacss/shared": "0.0.0-dev-20231106202246",
31
+ "@pandacss/types": "0.0.0-dev-20231106202246"
32
32
  },
33
33
  "devDependencies": {
34
- "@pandacss/fixture": "0.0.0-dev-20231106183456"
34
+ "@pandacss/fixture": "0.0.0-dev-20231106202246"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsup src/index.ts --format=esm,cjs --dts",