@pandacss/shared 0.0.0-dev-20240201185610 → 0.0.0-dev-20240201231741
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 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -12
- package/dist/index.mjs +2 -11
- package/dist/{shared-F25j1lrb.d.mts → shared-z3agWt4M.d.mts} +1 -1
- package/dist/{shared-F25j1lrb.d.ts → shared-z3agWt4M.d.ts} +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +2 -10
- package/dist/shared.mjs +2 -10
- package/package.json +1 -1
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 { x as WalkObjectOptions, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isBoolean, b as isFunction, j as isImportant, c as isObject, i as isString, z as mapObject, m as markImportant, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, w as withoutImportant, k as withoutSpace } from './shared-
|
|
1
|
+
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-z3agWt4M.mjs';
|
|
2
|
+
export { x as WalkObjectOptions, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isBoolean, b as isFunction, j as isImportant, c as isObject, i as isString, z as mapObject, m as markImportant, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, w as withoutImportant, k as withoutSpace } from './shared-z3agWt4M.mjs';
|
|
3
3
|
export { astish } from './astish.mjs';
|
|
4
4
|
|
|
5
5
|
declare const getArbitraryValue: (_value: string) => string;
|
|
@@ -71,7 +71,6 @@ declare const isCssVar: (v: unknown) => boolean;
|
|
|
71
71
|
|
|
72
72
|
type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
|
|
73
73
|
declare function toResponsiveObject(values: string[], breakpoints: string[]): Record<string, string>;
|
|
74
|
-
declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
|
|
75
74
|
declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>;
|
|
76
75
|
|
|
77
76
|
declare const createRegex: (item: Array<string | RegExp>) => RegExp;
|
|
@@ -105,4 +104,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
|
|
|
105
104
|
|
|
106
105
|
declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
|
|
107
106
|
|
|
108
|
-
export { CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, 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,
|
|
107
|
+
export { CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, 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, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
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 { x as WalkObjectOptions, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isBoolean, b as isFunction, j as isImportant, c as isObject, i as isString, z as mapObject, m as markImportant, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, w as withoutImportant, k as withoutSpace } from './shared-
|
|
1
|
+
import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './shared-z3agWt4M.js';
|
|
2
|
+
export { x as WalkObjectOptions, f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, a as isBoolean, b as isFunction, j as isImportant, c as isObject, i as isString, z as mapObject, m as markImportant, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, w as withoutImportant, k as withoutSpace } from './shared-z3agWt4M.js';
|
|
3
3
|
export { astish } from './astish.js';
|
|
4
4
|
|
|
5
5
|
declare const getArbitraryValue: (_value: string) => string;
|
|
@@ -71,7 +71,6 @@ declare const isCssVar: (v: unknown) => boolean;
|
|
|
71
71
|
|
|
72
72
|
type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>;
|
|
73
73
|
declare function toResponsiveObject(values: string[], breakpoints: string[]): Record<string, string>;
|
|
74
|
-
declare function normalizeShorthand(styles: Record<string, any>, context: NormalizeContext): MappedObject<Record<string, any>, any>;
|
|
75
74
|
declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>;
|
|
76
75
|
|
|
77
76
|
declare const createRegex: (item: Array<string | RegExp>) => RegExp;
|
|
@@ -105,4 +104,4 @@ declare function traverse(obj: any, callback: CallbackFn, options?: {
|
|
|
105
104
|
|
|
106
105
|
declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>): string;
|
|
107
106
|
|
|
108
|
-
export { CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, 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,
|
|
107
|
+
export { CreateCssContext, type CssVar, type CssVarOptions, type MapToRecord, 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, normalizeStyleObject, parseJson, splitBy, splitDotPath, stringifyJson, toEm, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType };
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,6 @@ __export(src_exports, {
|
|
|
62
62
|
markImportant: () => markImportant,
|
|
63
63
|
memo: () => memo,
|
|
64
64
|
mergeProps: () => mergeProps,
|
|
65
|
-
normalizeShorthand: () => normalizeShorthand,
|
|
66
65
|
normalizeStyleObject: () => normalizeStyleObject,
|
|
67
66
|
parseJson: () => parseJson,
|
|
68
67
|
patternFns: () => patternFns,
|
|
@@ -282,7 +281,7 @@ function walkObject(target, predicate, options = {}) {
|
|
|
282
281
|
if (isObject(value) || Array.isArray(value)) {
|
|
283
282
|
const result = {};
|
|
284
283
|
for (const [prop, child] of Object.entries(value)) {
|
|
285
|
-
const key = getKey?.(prop) ?? prop;
|
|
284
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
286
285
|
const childPath = [...path, key];
|
|
287
286
|
if (stop?.(value, childPath)) {
|
|
288
287
|
return predicate(value, path);
|
|
@@ -316,14 +315,6 @@ function toResponsiveObject(values, breakpoints) {
|
|
|
316
315
|
return acc;
|
|
317
316
|
}, {});
|
|
318
317
|
}
|
|
319
|
-
function normalizeShorthand(styles, context) {
|
|
320
|
-
const { hasShorthand, resolveShorthand } = context.utility;
|
|
321
|
-
return walkObject(styles, (v) => v, {
|
|
322
|
-
getKey: (prop) => {
|
|
323
|
-
return hasShorthand ? resolveShorthand(prop) : prop;
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
318
|
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
328
319
|
const { utility, conditions } = context;
|
|
329
320
|
const { hasShorthand, resolveShorthand } = utility;
|
|
@@ -386,7 +377,7 @@ function createMergeCss(context) {
|
|
|
386
377
|
const allStyles = compactStyles(...styles);
|
|
387
378
|
if (allStyles.length === 1)
|
|
388
379
|
return allStyles;
|
|
389
|
-
return allStyles.map((style) =>
|
|
380
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
390
381
|
}
|
|
391
382
|
function mergeCss(...styles) {
|
|
392
383
|
return mergeProps(...resolve(styles));
|
|
@@ -810,7 +801,6 @@ var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(
|
|
|
810
801
|
markImportant,
|
|
811
802
|
memo,
|
|
812
803
|
mergeProps,
|
|
813
|
-
normalizeShorthand,
|
|
814
804
|
normalizeStyleObject,
|
|
815
805
|
parseJson,
|
|
816
806
|
patternFns,
|
package/dist/index.mjs
CHANGED
|
@@ -195,7 +195,7 @@ function walkObject(target, predicate, options = {}) {
|
|
|
195
195
|
if (isObject(value) || Array.isArray(value)) {
|
|
196
196
|
const result = {};
|
|
197
197
|
for (const [prop, child] of Object.entries(value)) {
|
|
198
|
-
const key = getKey?.(prop) ?? prop;
|
|
198
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
199
199
|
const childPath = [...path, key];
|
|
200
200
|
if (stop?.(value, childPath)) {
|
|
201
201
|
return predicate(value, path);
|
|
@@ -229,14 +229,6 @@ function toResponsiveObject(values, breakpoints) {
|
|
|
229
229
|
return acc;
|
|
230
230
|
}, {});
|
|
231
231
|
}
|
|
232
|
-
function normalizeShorthand(styles, context) {
|
|
233
|
-
const { hasShorthand, resolveShorthand } = context.utility;
|
|
234
|
-
return walkObject(styles, (v) => v, {
|
|
235
|
-
getKey: (prop) => {
|
|
236
|
-
return hasShorthand ? resolveShorthand(prop) : prop;
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
232
|
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
241
233
|
const { utility, conditions } = context;
|
|
242
234
|
const { hasShorthand, resolveShorthand } = utility;
|
|
@@ -299,7 +291,7 @@ function createMergeCss(context) {
|
|
|
299
291
|
const allStyles = compactStyles(...styles);
|
|
300
292
|
if (allStyles.length === 1)
|
|
301
293
|
return allStyles;
|
|
302
|
-
return allStyles.map((style) =>
|
|
294
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
303
295
|
}
|
|
304
296
|
function mergeCss(...styles) {
|
|
305
297
|
return mergeProps(...resolve(styles));
|
|
@@ -722,7 +714,6 @@ export {
|
|
|
722
714
|
markImportant,
|
|
723
715
|
memo,
|
|
724
716
|
mergeProps,
|
|
725
|
-
normalizeShorthand,
|
|
726
717
|
normalizeStyleObject,
|
|
727
718
|
parseJson,
|
|
728
719
|
patternFns,
|
|
@@ -56,7 +56,7 @@ type MappedObject<T, K> = {
|
|
|
56
56
|
type WalkObjectStopFn = (value: any, path: string[]) => boolean;
|
|
57
57
|
interface WalkObjectOptions {
|
|
58
58
|
stop?: WalkObjectStopFn;
|
|
59
|
-
getKey?(prop: string): string;
|
|
59
|
+
getKey?(prop: string, value: any): string;
|
|
60
60
|
}
|
|
61
61
|
declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>;
|
|
62
62
|
declare function mapObject(obj: any, fn: (value: any) => any): any;
|
|
@@ -56,7 +56,7 @@ type MappedObject<T, K> = {
|
|
|
56
56
|
type WalkObjectStopFn = (value: any, path: string[]) => boolean;
|
|
57
57
|
interface WalkObjectOptions {
|
|
58
58
|
stop?: WalkObjectStopFn;
|
|
59
|
-
getKey?(prop: string): string;
|
|
59
|
+
getKey?(prop: string, value: any): string;
|
|
60
60
|
}
|
|
61
61
|
declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>;
|
|
62
62
|
declare function mapObject(obj: any, fn: (value: any) => any): any;
|
package/dist/shared.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, c as isObject, z as mapObject, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, k as withoutSpace } from './shared-
|
|
1
|
+
export { f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, c as isObject, z as mapObject, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, k as withoutSpace } from './shared-z3agWt4M.mjs';
|
package/dist/shared.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, c as isObject, z as mapObject, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, k as withoutSpace } from './shared-
|
|
1
|
+
export { f as compact, d as createCss, e as createMergeCss, h as filterBaseConditions, q as getPatternStyles, s as getSlotCompoundVariant, r as getSlotRecipes, l as hypenateProperty, g as isBaseCondition, c as isObject, z as mapObject, n as memo, o as mergeProps, p as patternFns, u as splitProps, t as toHash, v as uniq, y as walkObject, k as withoutSpace } from './shared-z3agWt4M.js';
|
package/dist/shared.js
CHANGED
|
@@ -131,7 +131,7 @@ function walkObject(target, predicate, options = {}) {
|
|
|
131
131
|
if (isObject(value) || Array.isArray(value)) {
|
|
132
132
|
const result = {};
|
|
133
133
|
for (const [prop, child] of Object.entries(value)) {
|
|
134
|
-
const key = getKey?.(prop) ?? prop;
|
|
134
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
135
135
|
const childPath = [...path, key];
|
|
136
136
|
if (stop?.(value, childPath)) {
|
|
137
137
|
return predicate(value, path);
|
|
@@ -165,14 +165,6 @@ function toResponsiveObject(values, breakpoints) {
|
|
|
165
165
|
return acc;
|
|
166
166
|
}, {});
|
|
167
167
|
}
|
|
168
|
-
function normalizeShorthand(styles, context) {
|
|
169
|
-
const { hasShorthand, resolveShorthand } = context.utility;
|
|
170
|
-
return walkObject(styles, (v) => v, {
|
|
171
|
-
getKey: (prop) => {
|
|
172
|
-
return hasShorthand ? resolveShorthand(prop) : prop;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
168
|
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
177
169
|
const { utility, conditions } = context;
|
|
178
170
|
const { hasShorthand, resolveShorthand } = utility;
|
|
@@ -235,7 +227,7 @@ function createMergeCss(context) {
|
|
|
235
227
|
const allStyles = compactStyles(...styles);
|
|
236
228
|
if (allStyles.length === 1)
|
|
237
229
|
return allStyles;
|
|
238
|
-
return allStyles.map((style) =>
|
|
230
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
239
231
|
}
|
|
240
232
|
function mergeCss(...styles) {
|
|
241
233
|
return mergeProps(...resolve(styles));
|
package/dist/shared.mjs
CHANGED
|
@@ -87,7 +87,7 @@ function walkObject(target, predicate, options = {}) {
|
|
|
87
87
|
if (isObject(value) || Array.isArray(value)) {
|
|
88
88
|
const result = {};
|
|
89
89
|
for (const [prop, child] of Object.entries(value)) {
|
|
90
|
-
const key = getKey?.(prop) ?? prop;
|
|
90
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
91
91
|
const childPath = [...path, key];
|
|
92
92
|
if (stop?.(value, childPath)) {
|
|
93
93
|
return predicate(value, path);
|
|
@@ -121,14 +121,6 @@ function toResponsiveObject(values, breakpoints) {
|
|
|
121
121
|
return acc;
|
|
122
122
|
}, {});
|
|
123
123
|
}
|
|
124
|
-
function normalizeShorthand(styles, context) {
|
|
125
|
-
const { hasShorthand, resolveShorthand } = context.utility;
|
|
126
|
-
return walkObject(styles, (v) => v, {
|
|
127
|
-
getKey: (prop) => {
|
|
128
|
-
return hasShorthand ? resolveShorthand(prop) : prop;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
124
|
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
133
125
|
const { utility, conditions } = context;
|
|
134
126
|
const { hasShorthand, resolveShorthand } = utility;
|
|
@@ -191,7 +183,7 @@ function createMergeCss(context) {
|
|
|
191
183
|
const allStyles = compactStyles(...styles);
|
|
192
184
|
if (allStyles.length === 1)
|
|
193
185
|
return allStyles;
|
|
194
|
-
return allStyles.map((style) =>
|
|
186
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
195
187
|
}
|
|
196
188
|
function mergeCss(...styles) {
|
|
197
189
|
return mergeProps(...resolve(styles));
|