@pandacss/shared 0.17.0 → 0.17.1
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 +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +11 -10
- package/dist/index.mjs +11 -10
- package/dist/{shared-e7d6e947.d.ts → shared-6d968e1d.d.ts} +7 -5
- package/dist/shared.d.mts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +11 -10
- package/dist/shared.mjs +11 -10
- package/package.json +15 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-
|
|
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, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-
|
|
1
|
+
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-6d968e1d.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, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-6d968e1d.js';
|
|
3
3
|
export { astish } from './astish.mjs';
|
|
4
4
|
|
|
5
5
|
type Operand = string | number | {
|
|
@@ -20,15 +20,15 @@ declare function toPx(value?: string | number): string | undefined;
|
|
|
20
20
|
declare function toEm(value?: string, fontSize?: number): string | undefined;
|
|
21
21
|
declare function toRem(value?: string): string | undefined;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
interface CssVar {
|
|
24
24
|
var: `--${string}`;
|
|
25
25
|
ref: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
27
|
+
interface CssVarOptions {
|
|
28
28
|
fallback?: string;
|
|
29
29
|
prefix?: string;
|
|
30
30
|
hash?: boolean;
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
declare function cssVar(name: string, options?: CssVarOptions): CssVar;
|
|
33
33
|
|
|
34
34
|
declare const esc: (sel: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-
|
|
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, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-
|
|
1
|
+
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-6d968e1d.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, u as uniq, q as walkObject, w as withoutImportant, j as withoutSpace } from './shared-6d968e1d.js';
|
|
3
3
|
export { astish } from './astish.js';
|
|
4
4
|
|
|
5
5
|
type Operand = string | number | {
|
|
@@ -20,15 +20,15 @@ declare function toPx(value?: string | number): string | undefined;
|
|
|
20
20
|
declare function toEm(value?: string, fontSize?: number): string | undefined;
|
|
21
21
|
declare function toRem(value?: string): string | undefined;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
interface CssVar {
|
|
24
24
|
var: `--${string}`;
|
|
25
25
|
ref: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
27
|
+
interface CssVarOptions {
|
|
28
28
|
fallback?: string;
|
|
29
29
|
prefix?: string;
|
|
30
30
|
hash?: boolean;
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
declare function cssVar(name: string, options?: CssVarOptions): CssVar;
|
|
33
33
|
|
|
34
34
|
declare const esc: (sel: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -187,18 +187,19 @@ function toHash(value) {
|
|
|
187
187
|
|
|
188
188
|
// src/merge-props.ts
|
|
189
189
|
function mergeProps(...sources) {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
const objects = sources.filter(Boolean);
|
|
191
|
+
return objects.reduce((prev, obj) => {
|
|
192
|
+
Object.keys(obj).forEach((key) => {
|
|
193
|
+
const prevValue = prev[key];
|
|
194
|
+
const value = obj[key];
|
|
195
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
196
|
+
prev[key] = mergeProps(prevValue, value);
|
|
196
197
|
} else {
|
|
197
|
-
|
|
198
|
+
prev[key] = value;
|
|
198
199
|
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
});
|
|
201
|
+
return prev;
|
|
202
|
+
}, {});
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
// src/walk-object.ts
|
package/dist/index.mjs
CHANGED
|
@@ -119,18 +119,19 @@ function toHash(value) {
|
|
|
119
119
|
|
|
120
120
|
// src/merge-props.ts
|
|
121
121
|
function mergeProps(...sources) {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
const objects = sources.filter(Boolean);
|
|
123
|
+
return objects.reduce((prev, obj) => {
|
|
124
|
+
Object.keys(obj).forEach((key) => {
|
|
125
|
+
const prevValue = prev[key];
|
|
126
|
+
const value = obj[key];
|
|
127
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
128
|
+
prev[key] = mergeProps(prevValue, value);
|
|
128
129
|
} else {
|
|
129
|
-
|
|
130
|
+
prev[key] = value;
|
|
130
131
|
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
});
|
|
133
|
+
return prev;
|
|
134
|
+
}, {});
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
// src/walk-object.ts
|
|
@@ -3,7 +3,7 @@ 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
|
-
|
|
6
|
+
interface CreateCssContext {
|
|
7
7
|
hash?: boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Partial properties from the Utility class
|
|
@@ -26,9 +26,11 @@ type CreateCssContext = {
|
|
|
26
26
|
shift: (paths: string[]) => string[];
|
|
27
27
|
finalize: (paths: string[]) => string[];
|
|
28
28
|
};
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
declare function createCss(context: CreateCssContext): (styleObject?: Record<string, any>) => string;
|
|
31
|
-
|
|
31
|
+
interface StyleObject {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
32
34
|
declare function createMergeCss(context: CreateCssContext): {
|
|
33
35
|
mergeCss: (...styles: StyleObject[]) => StyleObject;
|
|
34
36
|
assignCss: (...styles: StyleObject[]) => any;
|
|
@@ -48,10 +50,10 @@ type MappedObject<T, K> = {
|
|
|
48
50
|
[Prop in keyof T]: T[Prop] extends Array<any> ? MappedObject<T[Prop][number], K>[] : T[Prop] extends Record<string, unknown> ? MappedObject<T[Prop], K> : K;
|
|
49
51
|
};
|
|
50
52
|
type WalkObjectStopFn = (value: any, path: string[]) => boolean;
|
|
51
|
-
|
|
53
|
+
interface WalkObjectOptions {
|
|
52
54
|
stop?: WalkObjectStopFn;
|
|
53
55
|
getKey?(prop: string): string;
|
|
54
|
-
}
|
|
56
|
+
}
|
|
55
57
|
declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>;
|
|
56
58
|
declare function mapObject(obj: any, fn: (value: any) => any): any;
|
|
57
59
|
|
package/dist/shared.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
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, u as uniq, q as walkObject, j as withoutSpace } from './shared-
|
|
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, u as uniq, q as walkObject, j as withoutSpace } from './shared-6d968e1d.js';
|
package/dist/shared.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
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, u as uniq, q as walkObject, j as withoutSpace } from './shared-
|
|
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, u as uniq, q as walkObject, j as withoutSpace } from './shared-6d968e1d.js';
|
package/dist/shared.js
CHANGED
|
@@ -91,18 +91,19 @@ function toHash(value) {
|
|
|
91
91
|
|
|
92
92
|
// src/merge-props.ts
|
|
93
93
|
function mergeProps(...sources) {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
const objects = sources.filter(Boolean);
|
|
95
|
+
return objects.reduce((prev, obj) => {
|
|
96
|
+
Object.keys(obj).forEach((key) => {
|
|
97
|
+
const prevValue = prev[key];
|
|
98
|
+
const value = obj[key];
|
|
99
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
100
|
+
prev[key] = mergeProps(prevValue, value);
|
|
100
101
|
} else {
|
|
101
|
-
|
|
102
|
+
prev[key] = value;
|
|
102
103
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
});
|
|
105
|
+
return prev;
|
|
106
|
+
}, {});
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
// src/walk-object.ts
|
package/dist/shared.mjs
CHANGED
|
@@ -49,18 +49,19 @@ function toHash(value) {
|
|
|
49
49
|
|
|
50
50
|
// src/merge-props.ts
|
|
51
51
|
function mergeProps(...sources) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const objects = sources.filter(Boolean);
|
|
53
|
+
return objects.reduce((prev, obj) => {
|
|
54
|
+
Object.keys(obj).forEach((key) => {
|
|
55
|
+
const prevValue = prev[key];
|
|
56
|
+
const value = obj[key];
|
|
57
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
58
|
+
prev[key] = mergeProps(prevValue, value);
|
|
58
59
|
} else {
|
|
59
|
-
|
|
60
|
+
prev[key] = value;
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
});
|
|
63
|
+
return prev;
|
|
64
|
+
}, {});
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
// src/walk-object.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/shared",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Shared utilities for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -10,12 +10,24 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"source": "./src/index.ts",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/index.d.mts",
|
|
20
|
+
"default": "./dist/index.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
13
25
|
"files": [
|
|
14
26
|
"dist"
|
|
15
27
|
],
|
|
16
28
|
"scripts": {
|
|
17
|
-
"build": "tsup --dts",
|
|
29
|
+
"build": "tsup --dts && tsx scripts/postbuild.ts",
|
|
18
30
|
"build-fast": "tsup --no-dts",
|
|
19
|
-
"dev": "
|
|
31
|
+
"dev": "tsup --no-dts --watch --onSuccess=\"tsx scripts/postbuild.ts\""
|
|
20
32
|
}
|
|
21
33
|
}
|