@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 +24 -15
- package/dist/index.mjs +24 -15
- package/package.json +4 -4
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(
|
|
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(
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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(
|
|
644
|
-
acc
|
|
645
|
-
|
|
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(
|
|
862
|
-
object
|
|
863
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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(
|
|
624
|
-
acc
|
|
625
|
-
|
|
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(
|
|
842
|
-
object
|
|
843
|
-
|
|
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(
|
|
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.
|
|
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.
|
|
37
|
-
"@pandacss/
|
|
38
|
-
"@pandacss/
|
|
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",
|