@pandacss/config 0.0.0-dev-20240222185959 → 0.0.0-dev-20240222232733

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
@@ -577,7 +577,7 @@ async function getResolvedConfig(config, cwd) {
577
577
 
578
578
  // src/resolve-config.ts
579
579
  var import_logger4 = require("@pandacss/logger");
580
- var import_shared8 = require("@pandacss/shared");
580
+ var import_shared9 = require("@pandacss/shared");
581
581
 
582
582
  // src/bundled-preset.ts
583
583
  var import_preset_base = require("@pandacss/preset-base");
@@ -595,7 +595,7 @@ var getBundledPreset = (preset) => {
595
595
 
596
596
  // src/validate-config.ts
597
597
  var import_logger3 = require("@pandacss/logger");
598
- var import_shared7 = require("@pandacss/shared");
598
+ var import_shared8 = require("@pandacss/shared");
599
599
 
600
600
  // src/validation/validate-artifact.ts
601
601
  var validateArtifactNames = (names, addError) => {
@@ -631,13 +631,22 @@ var validateBreakpoints = (breakpoints, addError) => {
631
631
  };
632
632
 
633
633
  // src/validation/validate-condition.ts
634
+ var import_shared6 = require("@pandacss/shared");
634
635
  var validateConditions = (conditions, addError) => {
635
636
  if (!conditions)
636
637
  return;
637
638
  Object.values(conditions).forEach((condition) => {
638
- if (!condition.startsWith("@") && !condition.includes("&")) {
639
- addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);
639
+ if ((0, import_shared6.isString)(condition)) {
640
+ if (!condition.startsWith("@") && !condition.includes("&")) {
641
+ addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);
642
+ }
643
+ return;
640
644
  }
645
+ condition.forEach((c) => {
646
+ if (!c.startsWith("@") && !c.includes("&")) {
647
+ addError("conditions", `Selectors should contain the \`&\` character: \`${c}\``);
648
+ }
649
+ });
641
650
  });
642
651
  };
643
652
 
@@ -672,7 +681,7 @@ var validateRecipes = (options) => {
672
681
  };
673
682
 
674
683
  // src/validation/validate-tokens.ts
675
- var import_shared6 = require("@pandacss/shared");
684
+ var import_shared7 = require("@pandacss/shared");
676
685
 
677
686
  // src/validation/utils.ts
678
687
  var isValidToken = (token) => Object.hasOwnProperty.call(token, "value");
@@ -725,7 +734,7 @@ var validateTokens = (options) => {
725
734
  const { tokenNames, semanticTokenNames, valueAtPath, refsByPath } = tokens2;
726
735
  if (theme.tokens) {
727
736
  const tokenPaths = /* @__PURE__ */ new Set();
728
- (0, import_shared6.walkObject)(
737
+ (0, import_shared7.walkObject)(
729
738
  theme.tokens,
730
739
  (value, paths) => {
731
740
  const path2 = paths.join(SEP);
@@ -751,7 +760,7 @@ var validateTokens = (options) => {
751
760
  }
752
761
  if (theme.semanticTokens) {
753
762
  const tokenPaths = /* @__PURE__ */ new Set();
754
- (0, import_shared6.walkObject)(
763
+ (0, import_shared7.walkObject)(
755
764
  theme.semanticTokens,
756
765
  (value, paths) => {
757
766
  const path2 = paths.join(SEP);
@@ -760,7 +769,7 @@ var validateTokens = (options) => {
760
769
  tokenPaths.add(path2);
761
770
  if (!isValidToken(value))
762
771
  return;
763
- (0, import_shared6.walkObject)(value, (itemValue) => {
772
+ (0, import_shared7.walkObject)(value, (itemValue) => {
764
773
  if (isTokenReference(itemValue)) {
765
774
  const formattedPath = formatPath(path2);
766
775
  if (!refsByPath.has(formattedPath)) {
@@ -781,7 +790,7 @@ var validateTokens = (options) => {
781
790
  tokenPaths.forEach((path2) => {
782
791
  const formattedPath = formatPath(path2);
783
792
  const value = valueAtPath.get(path2);
784
- if (!(0, import_shared6.isObject)(value) && !path2.includes("value")) {
793
+ if (!(0, import_shared7.isObject)(value) && !path2.includes("value")) {
785
794
  addError("tokens", `Token must contain 'value': \`theme.semanticTokens.${formattedPath}\``);
786
795
  }
787
796
  });
@@ -821,7 +830,7 @@ var validateConfig = (config) => {
821
830
  ${Array.from(warnings).map((err) => "- " + err).join("\n")}
822
831
  `;
823
832
  if (config.validation === "error") {
824
- throw new import_shared7.PandaError("CONFIG_ERROR", errors);
833
+ throw new import_shared8.PandaError("CONFIG_ERROR", errors);
825
834
  }
826
835
  import_logger3.logger.warn("config", errors);
827
836
  return warnings;
@@ -863,8 +872,8 @@ async function resolveConfig(result, cwd) {
863
872
  loadConfigResult.config = result2;
864
873
  }
865
874
  }
866
- const serialized = (0, import_shared8.stringifyJson)(loadConfigResult.config);
867
- const deserialize = () => (0, import_shared8.parseJson)(serialized);
875
+ const serialized = (0, import_shared9.stringifyJson)(loadConfigResult.config);
876
+ const deserialize = () => (0, import_shared9.parseJson)(serialized);
868
877
  return { ...loadConfigResult, serialized, deserialize, hooks };
869
878
  }
870
879
 
package/dist/index.mjs CHANGED
@@ -269,13 +269,22 @@ var validateBreakpoints = (breakpoints, addError) => {
269
269
  };
270
270
 
271
271
  // src/validation/validate-condition.ts
272
+ import { isString } from "@pandacss/shared";
272
273
  var validateConditions = (conditions, addError) => {
273
274
  if (!conditions)
274
275
  return;
275
276
  Object.values(conditions).forEach((condition) => {
276
- if (!condition.startsWith("@") && !condition.includes("&")) {
277
- addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);
277
+ if (isString(condition)) {
278
+ if (!condition.startsWith("@") && !condition.includes("&")) {
279
+ addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);
280
+ }
281
+ return;
278
282
  }
283
+ condition.forEach((c) => {
284
+ if (!c.startsWith("@") && !c.includes("&")) {
285
+ addError("conditions", `Selectors should contain the \`&\` character: \`${c}\``);
286
+ }
287
+ });
279
288
  });
280
289
  };
281
290
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/config",
3
- "version": "0.0.0-dev-20240222185959",
3
+ "version": "0.0.0-dev-20240222232733",
4
4
  "description": "Find and load panda config",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -64,11 +64,11 @@
64
64
  "merge-anything": "5.1.7",
65
65
  "microdiff": "1.3.2",
66
66
  "typescript": "5.3.3",
67
- "@pandacss/logger": "0.0.0-dev-20240222185959",
68
- "@pandacss/preset-base": "0.0.0-dev-20240222185959",
69
- "@pandacss/preset-panda": "0.0.0-dev-20240222185959",
70
- "@pandacss/shared": "0.0.0-dev-20240222185959",
71
- "@pandacss/types": "0.0.0-dev-20240222185959"
67
+ "@pandacss/logger": "0.0.0-dev-20240222232733",
68
+ "@pandacss/preset-base": "0.0.0-dev-20240222232733",
69
+ "@pandacss/preset-panda": "0.0.0-dev-20240222232733",
70
+ "@pandacss/shared": "0.0.0-dev-20240222232733",
71
+ "@pandacss/types": "0.0.0-dev-20240222232733"
72
72
  },
73
73
  "devDependencies": {
74
74
  "pkg-types": "1.0.3"