@pandacss/node 0.0.0-dev-20221125142901 → 0.0.0-dev-20221125162640

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
@@ -125,12 +125,20 @@ function generateConditions(ctx) {
125
125
  const keys = Object.keys(ctx.conditions.values).concat("_", "base");
126
126
  return {
127
127
  js: import_outdent.default`
128
+ import { withoutSpace } from '../helpers'
128
129
  const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
129
130
 
130
131
  export function isCondition(value){
131
132
  return conditions.has(value) || /^@|&|&$/.test(value)
132
133
  }
133
134
 
135
+ export function finalizeConditions(paths){
136
+ return paths.map((path) => {
137
+ if (conditions.has(path)) return path
138
+ if (/&|@/.test(path)) return \`[\${withoutSpace(path.trim())}]\`
139
+ return path
140
+ })}
141
+
134
142
  export function sortConditions(paths){
135
143
  return paths.sort((a, b) => {
136
144
  const aa = isCondition(a)
@@ -161,7 +169,7 @@ function generateCssFn(ctx) {
161
169
  `,
162
170
  js: import_outdent2.outdent`
163
171
  import { createCss, withoutSpace } from "../helpers"
164
- import { sortConditions } from "./conditions"
172
+ import { sortConditions, finalizeConditions } from "./conditions"
165
173
 
166
174
  const classNameMap = ${stringify(utility.entries())}
167
175
  const shorthands = ${stringify(utility.shorthands)}
@@ -179,7 +187,7 @@ function generateCssFn(ctx) {
179
187
 
180
188
  const context = {
181
189
  transform,
182
- conditions: { shift: sortConditions },
190
+ conditions: { shift: sortConditions, finalize: finalizeConditions },
183
191
  hash: ${hash ? "true" : "false"},
184
192
  hasShorthand,
185
193
  resolveShorthand,
package/dist/index.mjs CHANGED
@@ -80,12 +80,20 @@ function generateConditions(ctx) {
80
80
  const keys = Object.keys(ctx.conditions.values).concat("_", "base");
81
81
  return {
82
82
  js: outdent`
83
+ import { withoutSpace } from '../helpers'
83
84
  const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
84
85
 
85
86
  export function isCondition(value){
86
87
  return conditions.has(value) || /^@|&|&$/.test(value)
87
88
  }
88
89
 
90
+ export function finalizeConditions(paths){
91
+ return paths.map((path) => {
92
+ if (conditions.has(path)) return path
93
+ if (/&|@/.test(path)) return \`[\${withoutSpace(path.trim())}]\`
94
+ return path
95
+ })}
96
+
89
97
  export function sortConditions(paths){
90
98
  return paths.sort((a, b) => {
91
99
  const aa = isCondition(a)
@@ -116,7 +124,7 @@ function generateCssFn(ctx) {
116
124
  `,
117
125
  js: outdent2`
118
126
  import { createCss, withoutSpace } from "../helpers"
119
- import { sortConditions } from "./conditions"
127
+ import { sortConditions, finalizeConditions } from "./conditions"
120
128
 
121
129
  const classNameMap = ${stringify(utility.entries())}
122
130
  const shorthands = ${stringify(utility.shorthands)}
@@ -134,7 +142,7 @@ function generateCssFn(ctx) {
134
142
 
135
143
  const context = {
136
144
  transform,
137
- conditions: { shift: sortConditions },
145
+ conditions: { shift: sortConditions, finalize: finalizeConditions },
138
146
  hash: ${hash ? "true" : "false"},
139
147
  hasShorthand,
140
148
  resolveShorthand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20221125142901",
3
+ "version": "0.0.0-dev-20221125162640",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,15 +30,15 @@
30
30
  "telejson": "6.0.8",
31
31
  "ts-pattern": "4.0.6",
32
32
  "ts-morph": "17.0.1",
33
- "@pandacss/types": "0.0.0-dev-20221125142901",
34
- "@pandacss/is-valid-prop": "0.0.0-dev-20221125142901",
35
- "@pandacss/error": "0.0.0-dev-20221125142901",
36
- "@pandacss/parser": "0.0.0-dev-20221125142901",
37
- "@pandacss/shared": "0.0.0-dev-20221125142901",
38
- "@pandacss/token-dictionary": "0.0.0-dev-20221125142901",
39
- "@pandacss/logger": "0.0.0-dev-20221125142901",
40
- "@pandacss/core": "0.0.0-dev-20221125142901",
41
- "@pandacss/config": "0.0.0-dev-20221125142901"
33
+ "@pandacss/types": "0.0.0-dev-20221125162640",
34
+ "@pandacss/is-valid-prop": "0.0.0-dev-20221125162640",
35
+ "@pandacss/error": "0.0.0-dev-20221125162640",
36
+ "@pandacss/parser": "0.0.0-dev-20221125162640",
37
+ "@pandacss/shared": "0.0.0-dev-20221125162640",
38
+ "@pandacss/token-dictionary": "0.0.0-dev-20221125162640",
39
+ "@pandacss/logger": "0.0.0-dev-20221125162640",
40
+ "@pandacss/core": "0.0.0-dev-20221125162640",
41
+ "@pandacss/config": "0.0.0-dev-20221125162640"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/fs-extra": "9.0.13",
@@ -46,7 +46,7 @@
46
46
  "@types/glob-parent": "^5.1.1",
47
47
  "@types/pluralize": "0.0.29",
48
48
  "@types/lodash.merge": "4.6.7",
49
- "@pandacss/fixture": "0.0.0-dev-20221125142901"
49
+ "@pandacss/fixture": "0.0.0-dev-20221125162640"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",