@pandacss/shared 0.0.0-dev-20230804140727 → 0.0.0-dev-20230806134213

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.
@@ -0,0 +1,3 @@
1
+ declare const astish: (val: string, tree?: any[]) => Record<string, any>;
2
+
3
+ export { astish };
@@ -0,0 +1,3 @@
1
+ declare const astish: (val: string, tree?: any[]) => Record<string, any>;
2
+
3
+ export { astish };
package/dist/astish.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/astish.ts
21
+ var astish_exports = {};
22
+ __export(astish_exports, {
23
+ astish: () => astish
24
+ });
25
+ module.exports = __toCommonJS(astish_exports);
26
+ var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
27
+ var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
28
+ var astish = (val, tree = [{}]) => {
29
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
30
+ if (!block)
31
+ return tree[0];
32
+ if (block[4])
33
+ tree.shift();
34
+ else if (block[3])
35
+ tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});
36
+ else
37
+ tree[0][block[1]] = block[2];
38
+ return astish(val, tree);
39
+ };
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ astish
43
+ });
@@ -0,0 +1,18 @@
1
+ // src/astish.ts
2
+ var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
3
+ var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
4
+ var astish = (val, tree = [{}]) => {
5
+ const block = newRule.exec((val ?? "").replace(ruleClean, ""));
6
+ if (!block)
7
+ return tree[0];
8
+ if (block[4])
9
+ tree.shift();
10
+ else if (block[3])
11
+ tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});
12
+ else
13
+ tree[0][block[1]] = block[2];
14
+ return astish(val, tree);
15
+ };
16
+ export {
17
+ astish
18
+ };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './split-props-6b55cbce.js';
2
- export { p as WalkObjectOptions, c as astish, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isFunction, j as isImportant, b as isObject, i as isString, r as mapObject, m as mergeProps, s as splitProps, t as toHash, q as walkObject, w as withoutImportant, k as withoutSpace } from './split-props-6b55cbce.js';
1
+ import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-2763c513.js';
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, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-2763c513.js';
3
+ export { astish } from './astish.mjs';
3
4
 
4
5
  type Operand = string | number | {
5
6
  ref: string;
@@ -34,8 +35,6 @@ declare const esc: (sel: string) => string;
34
35
 
35
36
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
36
37
 
37
- declare const memo: <T extends (...args: any[]) => any>(fn: T) => T;
38
-
39
38
  type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
40
39
  declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
41
40
  declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
@@ -54,4 +53,4 @@ declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>;
54
53
 
55
54
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
56
55
 
57
- export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, memo, normalizeShorthand, normalizeStyleObject, splitBy, splitDotPath, toEm, toPx, toRem, uncapitalize, unionType };
56
+ export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, splitBy, splitDotPath, toEm, toPx, toRem, uncapitalize, unionType };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './split-props-6b55cbce.js';
2
- export { p as WalkObjectOptions, c as astish, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isFunction, j as isImportant, b as isObject, i as isString, r as mapObject, m as mergeProps, s as splitProps, t as toHash, q as walkObject, w as withoutImportant, k as withoutSpace } from './split-props-6b55cbce.js';
1
+ import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-2763c513.js';
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, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-2763c513.js';
3
+ export { astish } from './astish.js';
3
4
 
4
5
  type Operand = string | number | {
5
6
  ref: string;
@@ -34,8 +35,6 @@ declare const esc: (sel: string) => string;
34
35
 
35
36
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
36
37
 
37
- declare const memo: <T extends (...args: any[]) => any>(fn: T) => T;
38
-
39
38
  type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
40
39
  declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
41
40
  declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
@@ -54,4 +53,4 @@ declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>;
54
53
 
55
54
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
56
55
 
57
- export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, memo, normalizeShorthand, normalizeStyleObject, splitBy, splitDotPath, toEm, toPx, toRem, uncapitalize, unionType };
56
+ export { CreateCssContext, CssVar, CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, mapToJson, normalizeShorthand, normalizeStyleObject, splitBy, splitDotPath, toEm, toPx, toRem, uncapitalize, unionType };
@@ -0,0 +1,8 @@
1
+ declare function normalizeHTMLProps(props: Record<string, any>): {
2
+ [k: string]: any;
3
+ };
4
+ declare namespace normalizeHTMLProps {
5
+ var keys: string[];
6
+ }
7
+
8
+ export { normalizeHTMLProps };
@@ -0,0 +1,8 @@
1
+ declare function normalizeHTMLProps(props: Record<string, any>): {
2
+ [k: string]: any;
3
+ };
4
+ declare namespace normalizeHTMLProps {
5
+ var keys: string[];
6
+ }
7
+
8
+ export { normalizeHTMLProps };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/normalize-html.ts
21
+ var normalize_html_exports = {};
22
+ __export(normalize_html_exports, {
23
+ normalizeHTMLProps: () => normalizeHTMLProps
24
+ });
25
+ module.exports = __toCommonJS(normalize_html_exports);
26
+ var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
27
+ function convert(key) {
28
+ return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
29
+ }
30
+ function normalizeHTMLProps(props) {
31
+ return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
32
+ }
33
+ normalizeHTMLProps.keys = htmlProps;
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ normalizeHTMLProps
37
+ });
@@ -0,0 +1,12 @@
1
+ // src/normalize-html.ts
2
+ var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
3
+ function convert(key) {
4
+ return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
5
+ }
6
+ function normalizeHTMLProps(props) {
7
+ return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
8
+ }
9
+ normalizeHTMLProps.keys = htmlProps;
10
+ export {
11
+ normalizeHTMLProps
12
+ };
@@ -3,8 +3,6 @@ type AnyFunction = (...args: any[]) => any;
3
3
  declare const isFunction: (v: any) => v is AnyFunction;
4
4
  declare function isObject(value: any): value is Record<string, any>;
5
5
 
6
- declare const astish: (val: string, tree?: any[]) => Record<string, any>;
7
-
8
6
  type CreateCssContext = {
9
7
  hash?: boolean;
10
8
  /**
@@ -61,6 +59,8 @@ declare function toHash(value: string): string;
61
59
 
62
60
  declare const hypenateProperty: (property: string) => string;
63
61
 
62
+ declare const memo: <T extends (...args: any[]) => any>(fn: T) => T;
63
+
64
64
  declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T;
65
65
 
66
66
  declare const getSlotRecipes: (recipe: any) => {
@@ -77,4 +77,4 @@ type PredicateFn = (key: string) => boolean;
77
77
  type Key = PredicateFn | string[];
78
78
  declare function splitProps(props: Dict, ...keys: Key[]): Dict[];
79
79
 
80
- export { CreateCssContext as C, MappedObject as M, WalkObjectStopFn as W, isFunction as a, isObject as b, astish as c, createCss as d, createMergeCss as e, compact as f, isBaseCondition as g, filterBaseConditions as h, isString as i, isImportant as j, withoutSpace as k, hypenateProperty as l, mergeProps as m, getSlotRecipes as n, getSlotCompoundVariant as o, WalkObjectOptions as p, walkObject as q, mapObject as r, splitProps as s, toHash as t, withoutImportant as w };
80
+ export { CreateCssContext as C, MappedObject as M, WalkObjectStopFn as W, isFunction as a, isObject as b, createCss as c, createMergeCss as d, compact as e, isBaseCondition as f, filterBaseConditions as g, isImportant as h, isString as i, withoutSpace as j, hypenateProperty as k, mergeProps as l, memo as m, getSlotRecipes as n, getSlotCompoundVariant as o, WalkObjectOptions as p, walkObject as q, mapObject as r, splitProps as s, toHash as t, withoutImportant as w };
package/dist/shared.d.mts CHANGED
@@ -1,10 +1 @@
1
- export { c as astish, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, b as isObject, r as mapObject, m as mergeProps, s as splitProps, t as toHash, q as walkObject, k as withoutSpace } from './split-props-6b55cbce.js';
2
-
3
- declare function normalizeHTMLProps(props: Record<string, any>): {
4
- [k: string]: any;
5
- };
6
- declare namespace normalizeHTMLProps {
7
- var keys: string[];
8
- }
9
-
10
- export { normalizeHTMLProps };
1
+ export { e as compact, c as createCss, d as createMergeCss, g as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, k as hypenateProperty, f as isBaseCondition, b as isObject, r as mapObject, m as memo, l as mergeProps, s as splitProps, t as toHash, q as walkObject, j as withoutSpace } from './shared-2763c513.js';
package/dist/shared.d.ts CHANGED
@@ -1,10 +1 @@
1
- export { c as astish, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, b as isObject, r as mapObject, m as mergeProps, s as splitProps, t as toHash, q as walkObject, k as withoutSpace } from './split-props-6b55cbce.js';
2
-
3
- declare function normalizeHTMLProps(props: Record<string, any>): {
4
- [k: string]: any;
5
- };
6
- declare namespace normalizeHTMLProps {
7
- var keys: string[];
8
- }
9
-
10
- export { normalizeHTMLProps };
1
+ export { e as compact, c as createCss, d as createMergeCss, g as filterBaseConditions, o as getSlotCompoundVariant, n as getSlotRecipes, k as hypenateProperty, f as isBaseCondition, b as isObject, r as mapObject, m as memo, l as mergeProps, s as splitProps, t as toHash, q as walkObject, j as withoutSpace } from './shared-2763c513.js';
package/dist/shared.js CHANGED
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/shared.ts
21
21
  var shared_exports = {};
22
22
  __export(shared_exports, {
23
- astish: () => astish,
24
23
  compact: () => compact,
25
24
  createCss: () => createCss,
26
25
  createMergeCss: () => createMergeCss,
@@ -31,8 +30,8 @@ __export(shared_exports, {
31
30
  isBaseCondition: () => isBaseCondition,
32
31
  isObject: () => isObject,
33
32
  mapObject: () => mapObject,
33
+ memo: () => memo,
34
34
  mergeProps: () => mergeProps,
35
- normalizeHTMLProps: () => normalizeHTMLProps,
36
35
  splitProps: () => splitProps,
37
36
  toHash: () => toHash,
38
37
  walkObject: () => walkObject,
@@ -45,22 +44,6 @@ function isObject(value) {
45
44
  return typeof value === "object" && value != null && !Array.isArray(value);
46
45
  }
47
46
 
48
- // src/astish.ts
49
- var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
50
- var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
51
- var astish = (val, tree = [{}]) => {
52
- const block = newRule.exec((val ?? "").replace(ruleClean, ""));
53
- if (!block)
54
- return tree[0];
55
- if (block[4])
56
- tree.shift();
57
- else if (block[3])
58
- tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});
59
- else
60
- tree[0][block[1]] = block[2];
61
- return astish(val, tree);
62
- };
63
-
64
47
  // src/compact.ts
65
48
  function compact(value) {
66
49
  return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
@@ -267,16 +250,6 @@ var hypenateProperty = memo((property) => {
267
250
  return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
268
251
  });
269
252
 
270
- // src/normalize-html.ts
271
- var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
272
- function convert(key) {
273
- return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
274
- }
275
- function normalizeHTMLProps(props) {
276
- return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
277
- }
278
- normalizeHTMLProps.keys = htmlProps;
279
-
280
253
  // src/slot.ts
281
254
  var assign = (obj, path, value) => {
282
255
  const last = path.pop();
@@ -344,7 +317,6 @@ function splitProps(props, ...keys) {
344
317
  }
345
318
  // Annotate the CommonJS export names for ESM import in node:
346
319
  0 && (module.exports = {
347
- astish,
348
320
  compact,
349
321
  createCss,
350
322
  createMergeCss,
@@ -355,8 +327,8 @@ function splitProps(props, ...keys) {
355
327
  isBaseCondition,
356
328
  isObject,
357
329
  mapObject,
330
+ memo,
358
331
  mergeProps,
359
- normalizeHTMLProps,
360
332
  splitProps,
361
333
  toHash,
362
334
  walkObject,
package/dist/shared.mjs CHANGED
@@ -3,22 +3,6 @@ function isObject(value) {
3
3
  return typeof value === "object" && value != null && !Array.isArray(value);
4
4
  }
5
5
 
6
- // src/astish.ts
7
- var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
8
- var ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;
9
- var astish = (val, tree = [{}]) => {
10
- const block = newRule.exec((val ?? "").replace(ruleClean, ""));
11
- if (!block)
12
- return tree[0];
13
- if (block[4])
14
- tree.shift();
15
- else if (block[3])
16
- tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});
17
- else
18
- tree[0][block[1]] = block[2];
19
- return astish(val, tree);
20
- };
21
-
22
6
  // src/compact.ts
23
7
  function compact(value) {
24
8
  return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
@@ -225,16 +209,6 @@ var hypenateProperty = memo((property) => {
225
209
  return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
226
210
  });
227
211
 
228
- // src/normalize-html.ts
229
- var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
230
- function convert(key) {
231
- return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
232
- }
233
- function normalizeHTMLProps(props) {
234
- return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
235
- }
236
- normalizeHTMLProps.keys = htmlProps;
237
-
238
212
  // src/slot.ts
239
213
  var assign = (obj, path, value) => {
240
214
  const last = path.pop();
@@ -301,7 +275,6 @@ function splitProps(props, ...keys) {
301
275
  return keys.map(fn).concat(split(dKeys));
302
276
  }
303
277
  export {
304
- astish,
305
278
  compact,
306
279
  createCss,
307
280
  createMergeCss,
@@ -312,8 +285,8 @@ export {
312
285
  isBaseCondition,
313
286
  isObject,
314
287
  mapObject,
288
+ memo,
315
289
  mergeProps,
316
- normalizeHTMLProps,
317
290
  splitProps,
318
291
  toHash,
319
292
  walkObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/shared",
3
- "version": "0.0.0-dev-20230804140727",
3
+ "version": "0.0.0-dev-20230806134213",
4
4
  "description": "Shared utilities for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",