@pandacss/generator 0.17.5 → 0.18.1

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
@@ -926,7 +926,7 @@ var helpers_mjs_default = {
926
926
 
927
927
  // src/artifacts/generated/astish.mjs.json
928
928
  var astish_mjs_default = {
929
- content: '// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/|\\s\\s+|\\n/g;\nvar astish = (val, tree = [{}]) => {\n const block = newRule.exec((val ?? "").replace(ruleClean, ""));\n if (!block)\n return tree[0];\n if (block[4])\n tree.shift();\n else if (block[3])\n tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});\n else\n tree[0][block[1]] = block[2];\n return astish(val, tree);\n};\nexport {\n astish\n};\n'
929
+ content: '// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/| +/g;\nvar ruleNewline = /\\n+/g;\nvar empty = " ";\nvar astish = (val, tree = [{}]) => {\n if (!val)\n return tree[0];\n let block, left;\n while (block = newRule.exec(val.replace(ruleClean, ""))) {\n if (block[4])\n tree.shift();\n else if (block[3]) {\n left = block[3].replace(ruleNewline, empty).trim();\n tree.unshift(tree[0][left] = tree[0][left] || {});\n } else\n tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();\n }\n return tree[0];\n};\nexport {\n astish\n};\n'
930
930
  };
931
931
 
932
932
  // src/artifacts/generated/normalize-html.mjs.json
@@ -979,12 +979,15 @@ function generateIsValidProp(ctx) {
979
979
  } else {
980
980
  content = ctx.file.import("memo", "../helpers") + "\n" + content;
981
981
  }
982
+ content = ctx.file.import("splitProps", "../helpers") + "\n" + content;
983
+ content += `export const splitCssProps = /* @__PURE__ */ (props) => splitProps(props, isCssProperty)`;
982
984
  return {
983
985
  js: content,
984
986
  dts: import_outdent9.outdent`
985
987
  declare const isCssProperty: (value: string) => boolean;
988
+ declare const splitCssProps: <TProps extends Record<string, unknown>>(props: TProps) => [Pick<TProps, CssProperty>, Omit<TProps, CssProperty>]
986
989
 
987
- export { isCssProperty };
990
+ export { isCssProperty, splitCssProps };
988
991
  `
989
992
  };
990
993
  }
@@ -1359,8 +1362,8 @@ function generateTokenJs(ctx) {
1359
1362
  const { tokens } = ctx;
1360
1363
  const map = /* @__PURE__ */ new Map();
1361
1364
  tokens.allTokens.forEach((token) => {
1362
- const { varRef } = token.extensions;
1363
- const value = token.isConditional ? varRef : token.value;
1365
+ const { varRef, isVirtual } = token.extensions;
1366
+ const value = token.isConditional || isVirtual ? varRef : token.value;
1364
1367
  map.set(token.name, { value, variable: varRef });
1365
1368
  });
1366
1369
  const obj = Object.fromEntries(map);
package/dist/index.mjs CHANGED
@@ -895,7 +895,7 @@ var helpers_mjs_default = {
895
895
 
896
896
  // src/artifacts/generated/astish.mjs.json
897
897
  var astish_mjs_default = {
898
- content: '// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/|\\s\\s+|\\n/g;\nvar astish = (val, tree = [{}]) => {\n const block = newRule.exec((val ?? "").replace(ruleClean, ""));\n if (!block)\n return tree[0];\n if (block[4])\n tree.shift();\n else if (block[3])\n tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});\n else\n tree[0][block[1]] = block[2];\n return astish(val, tree);\n};\nexport {\n astish\n};\n'
898
+ content: '// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/| +/g;\nvar ruleNewline = /\\n+/g;\nvar empty = " ";\nvar astish = (val, tree = [{}]) => {\n if (!val)\n return tree[0];\n let block, left;\n while (block = newRule.exec(val.replace(ruleClean, ""))) {\n if (block[4])\n tree.shift();\n else if (block[3]) {\n left = block[3].replace(ruleNewline, empty).trim();\n tree.unshift(tree[0][left] = tree[0][left] || {});\n } else\n tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();\n }\n return tree[0];\n};\nexport {\n astish\n};\n'
899
899
  };
900
900
 
901
901
  // src/artifacts/generated/normalize-html.mjs.json
@@ -948,12 +948,15 @@ function generateIsValidProp(ctx) {
948
948
  } else {
949
949
  content = ctx.file.import("memo", "../helpers") + "\n" + content;
950
950
  }
951
+ content = ctx.file.import("splitProps", "../helpers") + "\n" + content;
952
+ content += `export const splitCssProps = /* @__PURE__ */ (props) => splitProps(props, isCssProperty)`;
951
953
  return {
952
954
  js: content,
953
955
  dts: outdent9`
954
956
  declare const isCssProperty: (value: string) => boolean;
957
+ declare const splitCssProps: <TProps extends Record<string, unknown>>(props: TProps) => [Pick<TProps, CssProperty>, Omit<TProps, CssProperty>]
955
958
 
956
- export { isCssProperty };
959
+ export { isCssProperty, splitCssProps };
957
960
  `
958
961
  };
959
962
  }
@@ -1328,8 +1331,8 @@ function generateTokenJs(ctx) {
1328
1331
  const { tokens } = ctx;
1329
1332
  const map = /* @__PURE__ */ new Map();
1330
1333
  tokens.allTokens.forEach((token) => {
1331
- const { varRef } = token.extensions;
1332
- const value = token.isConditional ? varRef : token.value;
1334
+ const { varRef, isVirtual } = token.extensions;
1335
+ const value = token.isConditional || isVirtual ? varRef : token.value;
1333
1336
  map.set(token.name, { value, variable: varRef });
1334
1337
  });
1335
1338
  const obj = Object.fromEntries(map);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.17.5",
3
+ "version": "0.18.1",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,17 +32,17 @@
32
32
  "pluralize": "8.0.0",
33
33
  "postcss": "^8.4.31",
34
34
  "ts-pattern": "5.0.5",
35
- "@pandacss/core": "0.17.5",
36
- "@pandacss/is-valid-prop": "0.17.5",
37
- "@pandacss/logger": "0.17.5",
38
- "@pandacss/shared": "0.17.5",
39
- "@pandacss/token-dictionary": "0.17.5",
40
- "@pandacss/types": "0.17.5"
35
+ "@pandacss/core": "0.18.1",
36
+ "@pandacss/is-valid-prop": "0.18.1",
37
+ "@pandacss/logger": "0.18.1",
38
+ "@pandacss/shared": "0.18.1",
39
+ "@pandacss/token-dictionary": "0.18.1",
40
+ "@pandacss/types": "0.18.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/pluralize": "0.0.30",
44
44
  "hookable": "5.5.3",
45
- "@pandacss/fixture": "0.17.5"
45
+ "@pandacss/fixture": "0.18.1"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsup src/index.ts --format=esm,cjs --dts",