@pandacss/shared 0.0.0-dev-20240107203500 → 0.0.0-dev-20240108091559

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
@@ -33,6 +33,18 @@ interface CssVarOptions {
33
33
  }
34
34
  declare function cssVar(name: string, options?: CssVarOptions): CssVar;
35
35
 
36
+ declare function fromEntries<A extends symbol | string | number, B>(entries: [A, B][]): {
37
+ [key in A]: B;
38
+ };
39
+ declare function entries<A extends symbol | string | number, B>(obj: {
40
+ [key in A]: B;
41
+ }): [A, B][];
42
+ declare function mapEntries<A, B, K extends string | number | symbol>(obj: {
43
+ [key in K]: A;
44
+ }, f: (key: K, val: A) => [K, B]): {
45
+ [key in K]: B;
46
+ };
47
+
36
48
  declare const esc: (sel: string) => string;
37
49
 
38
50
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
@@ -75,4 +87,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
75
87
 
76
88
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
77
89
 
78
- export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isObjectOrArray, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
90
+ export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
package/dist/index.d.ts CHANGED
@@ -33,6 +33,18 @@ interface CssVarOptions {
33
33
  }
34
34
  declare function cssVar(name: string, options?: CssVarOptions): CssVar;
35
35
 
36
+ declare function fromEntries<A extends symbol | string | number, B>(entries: [A, B][]): {
37
+ [key in A]: B;
38
+ };
39
+ declare function entries<A extends symbol | string | number, B>(obj: {
40
+ [key in A]: B;
41
+ }): [A, B][];
42
+ declare function mapEntries<A, B, K extends string | number | symbol>(obj: {
43
+ [key in K]: A;
44
+ }, f: (key: K, val: A) => [K, B]): {
45
+ [key in K]: B;
46
+ };
47
+
36
48
  declare const esc: (sel: string) => string;
37
49
 
38
50
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
@@ -75,4 +87,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
75
87
 
76
88
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
77
89
 
78
- export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, esc, flatten, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isObjectOrArray, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
90
+ export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
package/dist/index.js CHANGED
@@ -30,9 +30,11 @@ __export(src_exports, {
30
30
  createRegex: () => createRegex,
31
31
  cssVar: () => cssVar,
32
32
  dashCase: () => dashCase,
33
+ entries: () => entries,
33
34
  esc: () => esc2,
34
35
  filterBaseConditions: () => filterBaseConditions,
35
36
  flatten: () => flatten,
37
+ fromEntries: () => fromEntries,
36
38
  getArbitraryValue: () => getArbitraryValue,
37
39
  getDotPath: () => getDotPath,
38
40
  getNegativePath: () => getNegativePath,
@@ -48,6 +50,7 @@ __export(src_exports, {
48
50
  isObject: () => isObject,
49
51
  isObjectOrArray: () => isObjectOrArray,
50
52
  isString: () => isString,
53
+ mapEntries: () => mapEntries,
51
54
  mapObject: () => mapObject,
52
55
  mapToJson: () => mapToJson,
53
56
  markImportant: () => markImportant,
@@ -459,6 +462,30 @@ function cssVar(name, options = {}) {
459
462
  return result;
460
463
  }
461
464
 
465
+ // src/entries.ts
466
+ function fromEntries(entries2) {
467
+ const result = {};
468
+ entries2.forEach((kv) => {
469
+ result[kv[0]] = kv[1];
470
+ });
471
+ return result;
472
+ }
473
+ function entries(obj) {
474
+ const result = [];
475
+ for (const key in obj) {
476
+ result.push([key, obj[key]]);
477
+ }
478
+ return result;
479
+ }
480
+ function mapEntries(obj, f) {
481
+ const result = {};
482
+ for (const key in obj) {
483
+ const kv = f(key, obj[key]);
484
+ result[kv[0]] = kv[1];
485
+ }
486
+ return result;
487
+ }
488
+
462
489
  // src/esc.ts
463
490
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
464
491
  var fcssescape = function(ch, asCodePoint) {
@@ -679,9 +706,11 @@ var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(
679
706
  createRegex,
680
707
  cssVar,
681
708
  dashCase,
709
+ entries,
682
710
  esc,
683
711
  filterBaseConditions,
684
712
  flatten,
713
+ fromEntries,
685
714
  getArbitraryValue,
686
715
  getDotPath,
687
716
  getNegativePath,
@@ -697,6 +726,7 @@ var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(
697
726
  isObject,
698
727
  isObjectOrArray,
699
728
  isString,
729
+ mapEntries,
700
730
  mapObject,
701
731
  mapToJson,
702
732
  markImportant,
package/dist/index.mjs CHANGED
@@ -382,6 +382,30 @@ function cssVar(name, options = {}) {
382
382
  return result;
383
383
  }
384
384
 
385
+ // src/entries.ts
386
+ function fromEntries(entries2) {
387
+ const result = {};
388
+ entries2.forEach((kv) => {
389
+ result[kv[0]] = kv[1];
390
+ });
391
+ return result;
392
+ }
393
+ function entries(obj) {
394
+ const result = [];
395
+ for (const key in obj) {
396
+ result.push([key, obj[key]]);
397
+ }
398
+ return result;
399
+ }
400
+ function mapEntries(obj, f) {
401
+ const result = {};
402
+ for (const key in obj) {
403
+ const kv = f(key, obj[key]);
404
+ result[kv[0]] = kv[1];
405
+ }
406
+ return result;
407
+ }
408
+
385
409
  // src/esc.ts
386
410
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
387
411
  var fcssescape = function(ch, asCodePoint) {
@@ -601,9 +625,11 @@ export {
601
625
  createRegex,
602
626
  cssVar,
603
627
  dashCase,
628
+ entries,
604
629
  esc2 as esc,
605
630
  filterBaseConditions,
606
631
  flatten,
632
+ fromEntries,
607
633
  getArbitraryValue,
608
634
  getDotPath,
609
635
  getNegativePath,
@@ -619,6 +645,7 @@ export {
619
645
  isObject,
620
646
  isObjectOrArray,
621
647
  isString,
648
+ mapEntries,
622
649
  mapObject,
623
650
  mapToJson,
624
651
  markImportant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/shared",
3
- "version": "0.0.0-dev-20240107203500",
3
+ "version": "0.0.0-dev-20240108091559",
4
4
  "description": "Shared utilities for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",