@pandacss/preset-base 1.9.0 → 1.9.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.d.mts CHANGED
@@ -270,7 +270,7 @@ declare const preset: {
270
270
  [x: string]: any;
271
271
  [x: number]: any;
272
272
  [x: string & Record<never, never>]: any;
273
- }, { map }: _pandacss_types.PatternHelpers): {
273
+ }, { map, isCssUnit, isCssVar }: _pandacss_types.PatternHelpers): {
274
274
  alignSelf: "stretch";
275
275
  justifySelf: "stretch";
276
276
  flex: any;
package/dist/index.d.ts CHANGED
@@ -270,7 +270,7 @@ declare const preset: {
270
270
  [x: string]: any;
271
271
  [x: number]: any;
272
272
  [x: string & Record<never, never>]: any;
273
- }, { map }: _pandacss_types.PatternHelpers): {
273
+ }, { map, isCssUnit, isCssVar }: _pandacss_types.PatternHelpers): {
274
274
  alignSelf: "stretch";
275
275
  justifySelf: "stretch";
276
276
  flex: any;
package/dist/index.js CHANGED
@@ -279,12 +279,16 @@ var spacer = definePattern({
279
279
  properties: {
280
280
  size: { type: "token", value: "spacing" }
281
281
  },
282
- transform(props, { map }) {
282
+ transform(props, { map, isCssUnit, isCssVar }) {
283
283
  const { size, ...rest } = props;
284
284
  return {
285
285
  alignSelf: "stretch",
286
286
  justifySelf: "stretch",
287
- flex: map(size, (v) => v == null ? "1" : `0 0 ${v}`),
287
+ flex: map(size, (v) => {
288
+ if (v == null) return "1";
289
+ const val = isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
290
+ return `0 0 ${val}`;
291
+ }),
288
292
  ...rest
289
293
  };
290
294
  }
package/dist/index.mjs CHANGED
@@ -252,12 +252,16 @@ var spacer = definePattern({
252
252
  properties: {
253
253
  size: { type: "token", value: "spacing" }
254
254
  },
255
- transform(props, { map }) {
255
+ transform(props, { map, isCssUnit, isCssVar }) {
256
256
  const { size, ...rest } = props;
257
257
  return {
258
258
  alignSelf: "stretch",
259
259
  justifySelf: "stretch",
260
- flex: map(size, (v) => v == null ? "1" : `0 0 ${v}`),
260
+ flex: map(size, (v) => {
261
+ if (v == null) return "1";
262
+ const val = isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
263
+ return `0 0 ${val}`;
264
+ }),
261
265
  ...rest
262
266
  };
263
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/preset-base",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "The base preset for Panda CSS that contains the conditions and utilities",
5
5
  "author": "Segun Adebayo <joseshegs@gmail.com>",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@pandacss/types": "1.9.0"
36
+ "@pandacss/types": "1.9.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsup src/index.ts --format=esm,cjs --dts",