@pandacss/shared 0.20.1 → 0.21.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.d.mts CHANGED
@@ -2,6 +2,8 @@ import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from
2
2
  export { p as WalkObjectOptions, e as compact, c as createCss, d as createMergeCss, g as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, k as hypenateProperty, f as isBaseCondition, a as isFunction, h as isImportant, b as isObject, i as isString, r as mapObject, m as memo, l as mergeProps, s as splitProps, t as toHash, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-6d968e1d.js';
3
3
  export { astish } from './astish.mjs';
4
4
 
5
+ declare const getArbitraryValue: (value: string) => string;
6
+
5
7
  type Operand = string | number | {
6
8
  ref: string;
7
9
  };
@@ -37,7 +39,7 @@ declare function flatten(values: Record<string, Record<string, any>>, stop?: Wal
37
39
 
38
40
  type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
39
41
  declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
40
- declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
42
+ declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>;
41
43
 
42
44
  declare const createRegex: (item: Array<string | RegExp>) => RegExp;
43
45
 
@@ -56,4 +58,4 @@ declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>;
56
58
 
57
59
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
58
60
 
59
- export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, uncapitalize, unionType };
61
+ export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getArbitraryValue, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, uncapitalize, unionType };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from
2
2
  export { p as WalkObjectOptions, e as compact, c as createCss, d as createMergeCss, g as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, k as hypenateProperty, f as isBaseCondition, a as isFunction, h as isImportant, b as isObject, i as isString, r as mapObject, m as memo, l as mergeProps, s as splitProps, t as toHash, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-6d968e1d.js';
3
3
  export { astish } from './astish.js';
4
4
 
5
+ declare const getArbitraryValue: (value: string) => string;
6
+
5
7
  type Operand = string | number | {
6
8
  ref: string;
7
9
  };
@@ -37,7 +39,7 @@ declare function flatten(values: Record<string, Record<string, any>>, stop?: Wal
37
39
 
38
40
  type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
39
41
  declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
40
- declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
42
+ declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>;
41
43
 
42
44
  declare const createRegex: (item: Array<string | RegExp>) => RegExp;
43
45
 
@@ -56,4 +58,4 @@ declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>;
56
58
 
57
59
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
58
60
 
59
- export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, uncapitalize, unionType };
61
+ export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getArbitraryValue, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, uncapitalize, unionType };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
33
33
  esc: () => esc2,
34
34
  filterBaseConditions: () => filterBaseConditions,
35
35
  flatten: () => flatten,
36
+ getArbitraryValue: () => getArbitraryValue,
36
37
  getDotPath: () => getDotPath,
37
38
  getNegativePath: () => getNegativePath,
38
39
  getSlotCompoundVariant: () => getSlotCompoundVariant,
@@ -68,6 +69,16 @@ __export(src_exports, {
68
69
  });
69
70
  module.exports = __toCommonJS(src_exports);
70
71
 
72
+ // src/arbitrary-value.ts
73
+ var getArbitraryValue = (value) => {
74
+ if (!value)
75
+ return value;
76
+ if (value[0] === "[" && value[value.length - 1] === "]") {
77
+ return value.slice(1, -1);
78
+ }
79
+ return value;
80
+ };
81
+
71
82
  // src/assert.ts
72
83
  var isString = (v) => typeof v === "string";
73
84
  var isFunction = (v) => typeof v === "function";
@@ -257,7 +268,7 @@ function normalizeShorthand(styles, context) {
257
268
  }
258
269
  });
259
270
  }
260
- function normalizeStyleObject(styles, context) {
271
+ function normalizeStyleObject(styles, context, shorthand = true) {
261
272
  const { utility, conditions } = context;
262
273
  const { hasShorthand, resolveShorthand } = utility;
263
274
  return walkObject(
@@ -267,9 +278,7 @@ function normalizeStyleObject(styles, context) {
267
278
  },
268
279
  {
269
280
  stop: (value) => Array.isArray(value),
270
- getKey: (prop) => {
271
- return hasShorthand ? resolveShorthand(prop) : prop;
272
- }
281
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
273
282
  }
274
283
  );
275
284
  }
@@ -594,6 +603,7 @@ var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(
594
603
  esc,
595
604
  filterBaseConditions,
596
605
  flatten,
606
+ getArbitraryValue,
597
607
  getDotPath,
598
608
  getNegativePath,
599
609
  getSlotCompoundVariant,
package/dist/index.mjs CHANGED
@@ -1,3 +1,13 @@
1
+ // src/arbitrary-value.ts
2
+ var getArbitraryValue = (value) => {
3
+ if (!value)
4
+ return value;
5
+ if (value[0] === "[" && value[value.length - 1] === "]") {
6
+ return value.slice(1, -1);
7
+ }
8
+ return value;
9
+ };
10
+
1
11
  // src/assert.ts
2
12
  var isString = (v) => typeof v === "string";
3
13
  var isFunction = (v) => typeof v === "function";
@@ -187,7 +197,7 @@ function normalizeShorthand(styles, context) {
187
197
  }
188
198
  });
189
199
  }
190
- function normalizeStyleObject(styles, context) {
200
+ function normalizeStyleObject(styles, context, shorthand = true) {
191
201
  const { utility, conditions } = context;
192
202
  const { hasShorthand, resolveShorthand } = utility;
193
203
  return walkObject(
@@ -197,9 +207,7 @@ function normalizeStyleObject(styles, context) {
197
207
  },
198
208
  {
199
209
  stop: (value) => Array.isArray(value),
200
- getKey: (prop) => {
201
- return hasShorthand ? resolveShorthand(prop) : prop;
202
- }
210
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
203
211
  }
204
212
  );
205
213
  }
@@ -523,6 +531,7 @@ export {
523
531
  esc2 as esc,
524
532
  filterBaseConditions,
525
533
  flatten,
534
+ getArbitraryValue,
526
535
  getDotPath,
527
536
  getNegativePath,
528
537
  getSlotCompoundVariant,
package/dist/shared.js CHANGED
@@ -154,7 +154,7 @@ function normalizeShorthand(styles, context) {
154
154
  }
155
155
  });
156
156
  }
157
- function normalizeStyleObject(styles, context) {
157
+ function normalizeStyleObject(styles, context, shorthand = true) {
158
158
  const { utility, conditions } = context;
159
159
  const { hasShorthand, resolveShorthand } = utility;
160
160
  return walkObject(
@@ -164,9 +164,7 @@ function normalizeStyleObject(styles, context) {
164
164
  },
165
165
  {
166
166
  stop: (value) => Array.isArray(value),
167
- getKey: (prop) => {
168
- return hasShorthand ? resolveShorthand(prop) : prop;
169
- }
167
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
170
168
  }
171
169
  );
172
170
  }
package/dist/shared.mjs CHANGED
@@ -112,7 +112,7 @@ function normalizeShorthand(styles, context) {
112
112
  }
113
113
  });
114
114
  }
115
- function normalizeStyleObject(styles, context) {
115
+ function normalizeStyleObject(styles, context, shorthand = true) {
116
116
  const { utility, conditions } = context;
117
117
  const { hasShorthand, resolveShorthand } = utility;
118
118
  return walkObject(
@@ -122,9 +122,7 @@ function normalizeStyleObject(styles, context) {
122
122
  },
123
123
  {
124
124
  stop: (value) => Array.isArray(value),
125
- getKey: (prop) => {
126
- return hasShorthand ? resolveShorthand(prop) : prop;
127
- }
125
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
128
126
  }
129
127
  );
130
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/shared",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "Shared utilities for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",