@pandacss/shared 0.0.0-dev-20240128131310 → 0.0.0-dev-20240128182812

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
@@ -48,6 +48,15 @@ declare function mapEntries<A, B, K extends string | number | symbol>(obj: {
48
48
  [key in K]: B;
49
49
  };
50
50
 
51
+ type PandaErrorCode = 'CONFIG_NOT_FOUND' | 'CONFIG_ERROR' | 'NOT_FOUND' | 'CONDITION' | 'MISSING_STUDIO' | 'INVALID_LAYER' | 'UNKNOWN_RECIPE' | 'INVALID_RECIPE' | 'UNKNOWN_TYPE' | 'MISSING_PARAMS' | 'NO_CONTEXT' | 'INVALID_TOKEN';
52
+ declare class PandaError extends Error {
53
+ readonly code: string;
54
+ readonly hint?: string;
55
+ constructor(code: PandaErrorCode, message: string, opts?: {
56
+ hint?: string;
57
+ });
58
+ }
59
+
51
60
  declare const esc: (sel: string) => string;
52
61
 
53
62
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
@@ -96,4 +105,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
96
105
 
97
106
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
98
107
 
99
- export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
108
+ export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, PandaError, type PandaErrorCode, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
package/dist/index.d.ts CHANGED
@@ -48,6 +48,15 @@ declare function mapEntries<A, B, K extends string | number | symbol>(obj: {
48
48
  [key in K]: B;
49
49
  };
50
50
 
51
+ type PandaErrorCode = 'CONFIG_NOT_FOUND' | 'CONFIG_ERROR' | 'NOT_FOUND' | 'CONDITION' | 'MISSING_STUDIO' | 'INVALID_LAYER' | 'UNKNOWN_RECIPE' | 'INVALID_RECIPE' | 'UNKNOWN_TYPE' | 'MISSING_PARAMS' | 'NO_CONTEXT' | 'INVALID_TOKEN';
52
+ declare class PandaError extends Error {
53
+ readonly code: string;
54
+ readonly hint?: string;
55
+ constructor(code: PandaErrorCode, message: string, opts?: {
56
+ hint?: string;
57
+ });
58
+ }
59
+
51
60
  declare const esc: (sel: string) => string;
52
61
 
53
62
  declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>;
@@ -96,4 +105,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
96
105
 
97
106
  declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
98
107
 
99
- export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
108
+ export { CreateCssContext, type CssVar, type CssVarOptions, MappedObject, PandaError, type PandaErrorCode, WalkObjectStopFn, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, normalizeShorthand, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ PandaError: () => PandaError,
23
24
  astish: () => astish,
24
25
  calc: () => calc,
25
26
  camelCaseProperty: () => camelCaseProperty,
@@ -518,6 +519,17 @@ function mapEntries(obj, f) {
518
519
  return result;
519
520
  }
520
521
 
522
+ // src/error.ts
523
+ var PandaError = class extends Error {
524
+ code;
525
+ hint;
526
+ constructor(code, message, opts) {
527
+ super(message);
528
+ this.code = `ERR_PANDA_${code}`;
529
+ this.hint = opts?.hint;
530
+ }
531
+ };
532
+
521
533
  // src/esc.ts
522
534
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
523
535
  var fcssescape = function(ch, asCodePoint) {
@@ -756,6 +768,7 @@ function unionType(values) {
756
768
  var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
757
769
  // Annotate the CommonJS export names for ESM import in node:
758
770
  0 && (module.exports = {
771
+ PandaError,
759
772
  astish,
760
773
  calc,
761
774
  camelCaseProperty,
package/dist/index.mjs CHANGED
@@ -432,6 +432,17 @@ function mapEntries(obj, f) {
432
432
  return result;
433
433
  }
434
434
 
435
+ // src/error.ts
436
+ var PandaError = class extends Error {
437
+ code;
438
+ hint;
439
+ constructor(code, message, opts) {
440
+ super(message);
441
+ this.code = `ERR_PANDA_${code}`;
442
+ this.hint = opts?.hint;
443
+ }
444
+ };
445
+
435
446
  // src/esc.ts
436
447
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
437
448
  var fcssescape = function(ch, asCodePoint) {
@@ -669,6 +680,7 @@ function unionType(values) {
669
680
  // src/uniq.ts
670
681
  var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
671
682
  export {
683
+ PandaError,
672
684
  astish,
673
685
  calc,
674
686
  camelCaseProperty,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/shared",
3
- "version": "0.0.0-dev-20240128131310",
3
+ "version": "0.0.0-dev-20240128182812",
4
4
  "description": "Shared utilities for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",