@pandacss/shared 0.43.0 → 0.45.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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -5
- package/dist/index.mjs +13 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -96,6 +96,8 @@ declare function normalizeStyleObject(styles: Record<string, any>, context: Norm
|
|
|
96
96
|
|
|
97
97
|
declare const omit: <T, K extends (string & {}) | keyof T>(obj: T, paths: K[]) => Omit<T, K>;
|
|
98
98
|
|
|
99
|
+
declare const PANDA_CONFIG_NAME: "__panda.config__";
|
|
100
|
+
|
|
99
101
|
declare const createRegex: (item: Array<string | RegExp>) => RegExp;
|
|
100
102
|
|
|
101
103
|
declare const stringifyJson: (config: Record<string, any>) => string;
|
|
@@ -156,4 +158,4 @@ declare function toPx(value?: string | number): string | undefined;
|
|
|
156
158
|
declare function toEm(value?: string, fontSize?: number): string | undefined;
|
|
157
159
|
declare function toRem(value?: string): string | undefined;
|
|
158
160
|
|
|
159
|
-
export { CacheMap, CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, MappedObject, PandaError, type PandaErrorCode, WalkObjectStopFn, assign, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPropertyPriority, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, mergeWith, normalizeStyleObject, omit, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
|
161
|
+
export { CacheMap, CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, MappedObject, PANDA_CONFIG_NAME, PandaError, type PandaErrorCode, WalkObjectStopFn, assign, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPropertyPriority, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, mergeWith, normalizeStyleObject, omit, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ declare function normalizeStyleObject(styles: Record<string, any>, context: Norm
|
|
|
96
96
|
|
|
97
97
|
declare const omit: <T, K extends (string & {}) | keyof T>(obj: T, paths: K[]) => Omit<T, K>;
|
|
98
98
|
|
|
99
|
+
declare const PANDA_CONFIG_NAME: "__panda.config__";
|
|
100
|
+
|
|
99
101
|
declare const createRegex: (item: Array<string | RegExp>) => RegExp;
|
|
100
102
|
|
|
101
103
|
declare const stringifyJson: (config: Record<string, any>) => string;
|
|
@@ -156,4 +158,4 @@ declare function toPx(value?: string | number): string | undefined;
|
|
|
156
158
|
declare function toEm(value?: string, fontSize?: number): string | undefined;
|
|
157
159
|
declare function toRem(value?: string): string | undefined;
|
|
158
160
|
|
|
159
|
-
export { CacheMap, CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, MappedObject, PandaError, type PandaErrorCode, WalkObjectStopFn, assign, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPropertyPriority, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, mergeWith, normalizeStyleObject, omit, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
|
161
|
+
export { CacheMap, CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, MappedObject, PANDA_CONFIG_NAME, PandaError, type PandaErrorCode, WalkObjectStopFn, assign, calc, camelCaseProperty, capitalize, createRegex, cssVar, dashCase, deepSet, entries, esc, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPropertyPriority, getUnit, isCssFunction, isCssUnit, isCssVar, isObjectOrArray, mapEntries, mapToJson, mergeWith, normalizeStyleObject, omit, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
CacheMap: () => CacheMap,
|
|
24
|
+
PANDA_CONFIG_NAME: () => PANDA_CONFIG_NAME,
|
|
24
25
|
PandaError: () => PandaError,
|
|
25
26
|
assign: () => assign,
|
|
26
27
|
astish: () => astish,
|
|
@@ -511,17 +512,15 @@ function cssVar(name, options = {}) {
|
|
|
511
512
|
var deepSet = (target, path, value) => {
|
|
512
513
|
const isValueObject = isObject(value);
|
|
513
514
|
if (!path.length && isValueObject) {
|
|
514
|
-
return
|
|
515
|
+
return mergeProps(target, value);
|
|
515
516
|
}
|
|
516
517
|
let current = target;
|
|
517
518
|
for (let i = 0; i < path.length; i++) {
|
|
518
519
|
const key = path[i];
|
|
519
|
-
|
|
520
|
-
current[key] = {};
|
|
521
|
-
}
|
|
520
|
+
current[key] ||= {};
|
|
522
521
|
if (i === path.length - 1) {
|
|
523
522
|
if (isValueObject && isObject(current[key])) {
|
|
524
|
-
current[key] =
|
|
523
|
+
current[key] = mergeProps(current[key], value);
|
|
525
524
|
} else {
|
|
526
525
|
current[key] = value;
|
|
527
526
|
}
|
|
@@ -583,11 +582,17 @@ var esc2 = (sel) => {
|
|
|
583
582
|
};
|
|
584
583
|
|
|
585
584
|
// src/flatten.ts
|
|
585
|
+
function filterDefault(path) {
|
|
586
|
+
if (path[0] === "DEFAULT")
|
|
587
|
+
return path;
|
|
588
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
589
|
+
}
|
|
586
590
|
function flatten(values, stop) {
|
|
587
591
|
const result = {};
|
|
588
592
|
walkObject(
|
|
589
593
|
values,
|
|
590
594
|
(token, paths) => {
|
|
595
|
+
paths = filterDefault(paths);
|
|
591
596
|
if (token) {
|
|
592
597
|
result[paths.join(".")] = token.value;
|
|
593
598
|
}
|
|
@@ -703,6 +708,9 @@ var omit = (obj, paths) => {
|
|
|
703
708
|
return result;
|
|
704
709
|
};
|
|
705
710
|
|
|
711
|
+
// src/panda-config-name.ts
|
|
712
|
+
var PANDA_CONFIG_NAME = "__panda.config__";
|
|
713
|
+
|
|
706
714
|
// src/pattern-fns.ts
|
|
707
715
|
var patternFns = {
|
|
708
716
|
map: mapObject,
|
|
@@ -1024,6 +1032,7 @@ function toRem(value = "") {
|
|
|
1024
1032
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1025
1033
|
0 && (module.exports = {
|
|
1026
1034
|
CacheMap,
|
|
1035
|
+
PANDA_CONFIG_NAME,
|
|
1027
1036
|
PandaError,
|
|
1028
1037
|
assign,
|
|
1029
1038
|
astish,
|
package/dist/index.mjs
CHANGED
|
@@ -420,17 +420,15 @@ function cssVar(name, options = {}) {
|
|
|
420
420
|
var deepSet = (target, path, value) => {
|
|
421
421
|
const isValueObject = isObject(value);
|
|
422
422
|
if (!path.length && isValueObject) {
|
|
423
|
-
return
|
|
423
|
+
return mergeProps(target, value);
|
|
424
424
|
}
|
|
425
425
|
let current = target;
|
|
426
426
|
for (let i = 0; i < path.length; i++) {
|
|
427
427
|
const key = path[i];
|
|
428
|
-
|
|
429
|
-
current[key] = {};
|
|
430
|
-
}
|
|
428
|
+
current[key] ||= {};
|
|
431
429
|
if (i === path.length - 1) {
|
|
432
430
|
if (isValueObject && isObject(current[key])) {
|
|
433
|
-
current[key] =
|
|
431
|
+
current[key] = mergeProps(current[key], value);
|
|
434
432
|
} else {
|
|
435
433
|
current[key] = value;
|
|
436
434
|
}
|
|
@@ -492,11 +490,17 @@ var esc2 = (sel) => {
|
|
|
492
490
|
};
|
|
493
491
|
|
|
494
492
|
// src/flatten.ts
|
|
493
|
+
function filterDefault(path) {
|
|
494
|
+
if (path[0] === "DEFAULT")
|
|
495
|
+
return path;
|
|
496
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
497
|
+
}
|
|
495
498
|
function flatten(values, stop) {
|
|
496
499
|
const result = {};
|
|
497
500
|
walkObject(
|
|
498
501
|
values,
|
|
499
502
|
(token, paths) => {
|
|
503
|
+
paths = filterDefault(paths);
|
|
500
504
|
if (token) {
|
|
501
505
|
result[paths.join(".")] = token.value;
|
|
502
506
|
}
|
|
@@ -612,6 +616,9 @@ var omit = (obj, paths) => {
|
|
|
612
616
|
return result;
|
|
613
617
|
};
|
|
614
618
|
|
|
619
|
+
// src/panda-config-name.ts
|
|
620
|
+
var PANDA_CONFIG_NAME = "__panda.config__";
|
|
621
|
+
|
|
615
622
|
// src/pattern-fns.ts
|
|
616
623
|
var patternFns = {
|
|
617
624
|
map: mapObject,
|
|
@@ -932,6 +939,7 @@ function toRem(value = "") {
|
|
|
932
939
|
}
|
|
933
940
|
export {
|
|
934
941
|
CacheMap,
|
|
942
|
+
PANDA_CONFIG_NAME,
|
|
935
943
|
PandaError,
|
|
936
944
|
assign,
|
|
937
945
|
astish,
|