@pandacss/shared 0.53.7 → 1.0.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/astish.js CHANGED
@@ -28,19 +28,15 @@ var ruleClean = /\/\*[^]*?\*\/| +/g;
28
28
  var ruleNewline = /\n+/g;
29
29
  var empty = " ";
30
30
  var astish = (val, tree = [{}]) => {
31
- if (!val)
32
- return tree[0];
31
+ if (!val) return tree[0];
33
32
  let block, left;
34
33
  while (block = newRule.exec(val.replace(ruleClean, ""))) {
35
- if (block[4])
36
- tree.shift();
34
+ if (block[4]) tree.shift();
37
35
  else if (block[3]) {
38
36
  left = block[3].replace(ruleNewline, empty).trim();
39
- if (!left.includes("&") && !left.startsWith("@"))
40
- left = "& " + left;
37
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
41
38
  tree.unshift(tree[0][left] = tree[0][left] || {});
42
- } else
43
- tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
39
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
44
40
  }
45
41
  return tree[0];
46
42
  };
package/dist/astish.mjs CHANGED
@@ -4,19 +4,15 @@ var ruleClean = /\/\*[^]*?\*\/| +/g;
4
4
  var ruleNewline = /\n+/g;
5
5
  var empty = " ";
6
6
  var astish = (val, tree = [{}]) => {
7
- if (!val)
8
- return tree[0];
7
+ if (!val) return tree[0];
9
8
  let block, left;
10
9
  while (block = newRule.exec(val.replace(ruleClean, ""))) {
11
- if (block[4])
12
- tree.shift();
10
+ if (block[4]) tree.shift();
13
11
  else if (block[3]) {
14
12
  left = block[3].replace(ruleNewline, empty).trim();
15
- if (!left.includes("&") && !left.startsWith("@"))
16
- left = "& " + left;
13
+ if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
17
14
  tree.unshift(tree[0][left] = tree[0][left] || {});
18
- } else
19
- tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
15
+ } else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
20
16
  }
21
17
  return tree[0];
22
18
  };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-DTGzt6ot.mjs';
1
+ import { W as WalkObjectStopFn, C as CreateCssContext, M as MappedObject } from './shared-DTGzt6ot.mjs';
2
2
  export { y as WalkObjectOptions, g as compact, e as createCss, f as createMergeCss, j as filterBaseConditions, r as getPatternStyles, u as getSlotCompoundVariant, s as getSlotRecipes, k as hypenateProperty, h as isBaseCondition, a as isBoolean, b as isFunction, l as isImportant, c as isObject, d as isObjectOrArray, i as isString, A as mapObject, n as markImportant, o as memo, p as mergeProps, q as patternFns, v as splitProps, t as toHash, x as uniq, z as walkObject, w as withoutImportant, m as withoutSpace } from './shared-DTGzt6ot.mjs';
3
3
  export { astish } from './astish.mjs';
4
4
 
@@ -98,32 +98,13 @@ declare const omit: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) =
98
98
 
99
99
  declare const PANDA_CONFIG_NAME: "__panda.config__";
100
100
 
101
+ declare function getPropertyPriority(key: string): number;
102
+
101
103
  declare const createRegex: (item: Array<string | RegExp>) => RegExp;
102
104
 
103
105
  declare const stringifyJson: (config: Record<string, any>) => string;
104
106
  declare const parseJson: (config: string) => any;
105
107
 
106
- /**
107
- * Get the property priority: the higher the priority, the higher the resulting
108
- * specificity of the atom. For example, if we had:
109
- *
110
- * ```tsx
111
- * import { css } from '@pandacss/dev';
112
- *
113
- * css({
114
- * backgroundColor: 'blue',
115
- * background: 'red',
116
- * })
117
- *
118
- * ```
119
- *
120
- * and so the more specific selector would win
121
- *
122
- * Taken from
123
- * @see https://github.com/callstack/linaria/blob/049a4ccb77e29f3628353352db21bd446fa04a2e/packages/atomic/src/processors/helpers/propertyPriority.ts
124
- */
125
- declare function getPropertyPriority(property: string): 0 | 1 | 2;
126
-
127
108
  declare function splitBy(value: string, separator?: string): any[];
128
109
  declare function splitDotPath(path: string): string[];
129
110
  declare function getNegativePath(path: string[]): string[];
@@ -150,7 +131,10 @@ interface TraverseOptions {
150
131
  }
151
132
  declare function traverse(obj: any, callback: CallbackFn, options?: TraverseOptions): void;
152
133
 
153
- declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
134
+ declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>, opts?: {
135
+ fallback?: string;
136
+ stringify?: (value: string) => string;
137
+ }): string;
154
138
 
155
139
  declare function getUnit(value?: string): string | undefined;
156
140
  declare function toPx(value?: string | number): string | undefined;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-DTGzt6ot.js';
1
+ import { W as WalkObjectStopFn, C as CreateCssContext, M as MappedObject } from './shared-DTGzt6ot.js';
2
2
  export { y as WalkObjectOptions, g as compact, e as createCss, f as createMergeCss, j as filterBaseConditions, r as getPatternStyles, u as getSlotCompoundVariant, s as getSlotRecipes, k as hypenateProperty, h as isBaseCondition, a as isBoolean, b as isFunction, l as isImportant, c as isObject, d as isObjectOrArray, i as isString, A as mapObject, n as markImportant, o as memo, p as mergeProps, q as patternFns, v as splitProps, t as toHash, x as uniq, z as walkObject, w as withoutImportant, m as withoutSpace } from './shared-DTGzt6ot.js';
3
3
  export { astish } from './astish.js';
4
4
 
@@ -98,32 +98,13 @@ declare const omit: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) =
98
98
 
99
99
  declare const PANDA_CONFIG_NAME: "__panda.config__";
100
100
 
101
+ declare function getPropertyPriority(key: string): number;
102
+
101
103
  declare const createRegex: (item: Array<string | RegExp>) => RegExp;
102
104
 
103
105
  declare const stringifyJson: (config: Record<string, any>) => string;
104
106
  declare const parseJson: (config: string) => any;
105
107
 
106
- /**
107
- * Get the property priority: the higher the priority, the higher the resulting
108
- * specificity of the atom. For example, if we had:
109
- *
110
- * ```tsx
111
- * import { css } from '@pandacss/dev';
112
- *
113
- * css({
114
- * backgroundColor: 'blue',
115
- * background: 'red',
116
- * })
117
- *
118
- * ```
119
- *
120
- * and so the more specific selector would win
121
- *
122
- * Taken from
123
- * @see https://github.com/callstack/linaria/blob/049a4ccb77e29f3628353352db21bd446fa04a2e/packages/atomic/src/processors/helpers/propertyPriority.ts
124
- */
125
- declare function getPropertyPriority(property: string): 0 | 1 | 2;
126
-
127
108
  declare function splitBy(value: string, separator?: string): any[];
128
109
  declare function splitDotPath(path: string): string[];
129
110
  declare function getNegativePath(path: string[]): string[];
@@ -150,7 +131,10 @@ interface TraverseOptions {
150
131
  }
151
132
  declare function traverse(obj: any, callback: CallbackFn, options?: TraverseOptions): void;
152
133
 
153
- declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
134
+ declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>, opts?: {
135
+ fallback?: string;
136
+ stringify?: (value: string) => string;
137
+ }): string;
154
138
 
155
139
  declare function getUnit(value?: string): string | undefined;
156
140
  declare function toPx(value?: string | number): string | undefined;