@bamboocss/shared 1.11.2 → 1.11.3
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.cjs +377 -53
- package/dist/index.d.cts +116 -5
- package/dist/index.d.mts +116 -5
- package/dist/index.mjs +326 -2
- package/dist/shared.cjs +303 -20
- package/dist/shared.d.cts +101 -1
- package/dist/shared.d.mts +101 -1
- package/dist/shared.mjs +284 -1
- package/package.json +1 -1
- package/dist/uniq-DRfJ796t.mjs +0 -310
- package/dist/uniq-DcY1asOl.d.mts +0 -112
- package/dist/uniq-i0QQ2OJM.d.cts +0 -112
- package/dist/uniq-xizdZz1Z.cjs +0 -501
package/dist/uniq-DcY1asOl.d.mts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
//#region src/assert.d.ts
|
|
2
|
-
declare const isString: (v: any) => v is string;
|
|
3
|
-
declare const isBoolean: (v: any) => v is boolean;
|
|
4
|
-
type AnyFunction = (...args: any[]) => any;
|
|
5
|
-
declare const isFunction: (v: any) => v is AnyFunction;
|
|
6
|
-
declare function isObject(value: any): value is Record<string, any>;
|
|
7
|
-
declare const isSymbol: (v: any) => v is symbol;
|
|
8
|
-
declare const isObjectOrArray: (obj: unknown) => obj is object;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/classname.d.ts
|
|
11
|
-
interface CreateCssContext {
|
|
12
|
-
hash?: boolean;
|
|
13
|
-
grouped?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Partial properties from the Utility class
|
|
16
|
-
*/
|
|
17
|
-
utility: {
|
|
18
|
-
prefix: string;
|
|
19
|
-
hasShorthand: boolean;
|
|
20
|
-
resolveShorthand: (prop: string) => string;
|
|
21
|
-
transform: (prop: string, value: any) => {
|
|
22
|
-
className: string;
|
|
23
|
-
};
|
|
24
|
-
toHash: (path: string[], toHash: (str: string) => string) => string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Partial properties from the Condition class
|
|
28
|
-
*/
|
|
29
|
-
conditions?: {
|
|
30
|
-
breakpoints: {
|
|
31
|
-
keys: string[];
|
|
32
|
-
};
|
|
33
|
-
shift: (paths: string[]) => string[];
|
|
34
|
-
finalize: (paths: string[]) => string[];
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
declare function createCss(context: CreateCssContext): ({
|
|
38
|
-
base,
|
|
39
|
-
...styles
|
|
40
|
-
}?: Record<string, any>) => string;
|
|
41
|
-
interface StyleObject {
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}
|
|
44
|
-
declare function createMergeCss(context: CreateCssContext): {
|
|
45
|
-
mergeCss: (...styles: StyleObject[]) => StyleObject;
|
|
46
|
-
assignCss: (...styles: StyleObject[]) => any;
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/compact.d.ts
|
|
50
|
-
declare function compact<T extends Record<string, any>>(value: T): T;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/condition.d.ts
|
|
53
|
-
declare const isBaseCondition: (v: string) => v is "base";
|
|
54
|
-
declare function filterBaseConditions(c: string[]): string[];
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/walk-object.d.ts
|
|
57
|
-
type Predicate<R = any> = (value: any, path: string[]) => R;
|
|
58
|
-
type MappedObject<T, K> = { [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 };
|
|
59
|
-
type WalkObjectStopFn = (value: any, path: string[]) => boolean;
|
|
60
|
-
interface WalkObjectOptions {
|
|
61
|
-
stop?: WalkObjectStopFn;
|
|
62
|
-
getKey?(prop: string, value: any): string;
|
|
63
|
-
}
|
|
64
|
-
declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>;
|
|
65
|
-
declare function mapObject(obj: any, fn: (value: any) => any): any;
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/hash.d.ts
|
|
68
|
-
declare function toHash(value: string): string;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/hypenate-property.d.ts
|
|
71
|
-
declare const hypenateProperty: (property: string) => string;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/important.d.ts
|
|
74
|
-
declare function isImportant<T extends string | number | boolean>(value: T): boolean;
|
|
75
|
-
declare function withoutImportant<T extends string | number | boolean>(value: T): string | T;
|
|
76
|
-
declare function withoutSpace<T extends string | number | boolean>(str: T): string | T;
|
|
77
|
-
type Dict$1 = Record<string, unknown>;
|
|
78
|
-
declare function markImportant(obj: Dict$1): {};
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/memo.d.ts
|
|
81
|
-
declare const memo: <T extends (...args: any[]) => any>(fn: T) => T;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/merge-props.d.ts
|
|
84
|
-
declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/pattern-fns.d.ts
|
|
87
|
-
declare const patternFns: {
|
|
88
|
-
map: typeof mapObject;
|
|
89
|
-
isCssFunction: (v: unknown) => boolean;
|
|
90
|
-
isCssVar: (v: unknown) => boolean;
|
|
91
|
-
isCssUnit: (v: unknown) => boolean;
|
|
92
|
-
};
|
|
93
|
-
declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/slot.d.ts
|
|
96
|
-
declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>;
|
|
97
|
-
declare const getSlotCompoundVariant: <T extends {
|
|
98
|
-
css: any;
|
|
99
|
-
}>(compoundVariants: T[], slotName: string) => (T & {
|
|
100
|
-
css: any;
|
|
101
|
-
})[];
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/split-props.d.ts
|
|
104
|
-
type Dict = Record<string, unknown>;
|
|
105
|
-
type PredicateFn = (key: string) => boolean;
|
|
106
|
-
type Key = PredicateFn | string[];
|
|
107
|
-
declare function splitProps(props: Dict, ...keys: Key[]): Dict[];
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/uniq.d.ts
|
|
110
|
-
declare const uniq: <T>(...items: T[][]) => T[];
|
|
111
|
-
//#endregion
|
|
112
|
-
export { isString as A, CreateCssContext as C, isFunction as D, isBoolean as E, isObject as O, compact as S, createMergeCss as T, WalkObjectStopFn as _, getPatternStyles as a, filterBaseConditions as b, memo as c, withoutImportant as d, withoutSpace as f, WalkObjectOptions as g, MappedObject as h, getSlotRecipes as i, isSymbol as j, isObjectOrArray as k, isImportant as l, toHash as m, splitProps as n, patternFns as o, hypenateProperty as p, getSlotCompoundVariant as r, mergeProps as s, uniq as t, markImportant as u, mapObject as v, createCss as w, isBaseCondition as x, walkObject as y };
|
package/dist/uniq-i0QQ2OJM.d.cts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
//#region src/assert.d.ts
|
|
2
|
-
declare const isString: (v: any) => v is string;
|
|
3
|
-
declare const isBoolean: (v: any) => v is boolean;
|
|
4
|
-
type AnyFunction = (...args: any[]) => any;
|
|
5
|
-
declare const isFunction: (v: any) => v is AnyFunction;
|
|
6
|
-
declare function isObject(value: any): value is Record<string, any>;
|
|
7
|
-
declare const isSymbol: (v: any) => v is symbol;
|
|
8
|
-
declare const isObjectOrArray: (obj: unknown) => obj is object;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/classname.d.ts
|
|
11
|
-
interface CreateCssContext {
|
|
12
|
-
hash?: boolean;
|
|
13
|
-
grouped?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Partial properties from the Utility class
|
|
16
|
-
*/
|
|
17
|
-
utility: {
|
|
18
|
-
prefix: string;
|
|
19
|
-
hasShorthand: boolean;
|
|
20
|
-
resolveShorthand: (prop: string) => string;
|
|
21
|
-
transform: (prop: string, value: any) => {
|
|
22
|
-
className: string;
|
|
23
|
-
};
|
|
24
|
-
toHash: (path: string[], toHash: (str: string) => string) => string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Partial properties from the Condition class
|
|
28
|
-
*/
|
|
29
|
-
conditions?: {
|
|
30
|
-
breakpoints: {
|
|
31
|
-
keys: string[];
|
|
32
|
-
};
|
|
33
|
-
shift: (paths: string[]) => string[];
|
|
34
|
-
finalize: (paths: string[]) => string[];
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
declare function createCss(context: CreateCssContext): ({
|
|
38
|
-
base,
|
|
39
|
-
...styles
|
|
40
|
-
}?: Record<string, any>) => string;
|
|
41
|
-
interface StyleObject {
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}
|
|
44
|
-
declare function createMergeCss(context: CreateCssContext): {
|
|
45
|
-
mergeCss: (...styles: StyleObject[]) => StyleObject;
|
|
46
|
-
assignCss: (...styles: StyleObject[]) => any;
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/compact.d.ts
|
|
50
|
-
declare function compact<T extends Record<string, any>>(value: T): T;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/condition.d.ts
|
|
53
|
-
declare const isBaseCondition: (v: string) => v is "base";
|
|
54
|
-
declare function filterBaseConditions(c: string[]): string[];
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/walk-object.d.ts
|
|
57
|
-
type Predicate<R = any> = (value: any, path: string[]) => R;
|
|
58
|
-
type MappedObject<T, K> = { [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 };
|
|
59
|
-
type WalkObjectStopFn = (value: any, path: string[]) => boolean;
|
|
60
|
-
interface WalkObjectOptions {
|
|
61
|
-
stop?: WalkObjectStopFn;
|
|
62
|
-
getKey?(prop: string, value: any): string;
|
|
63
|
-
}
|
|
64
|
-
declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>;
|
|
65
|
-
declare function mapObject(obj: any, fn: (value: any) => any): any;
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/hash.d.ts
|
|
68
|
-
declare function toHash(value: string): string;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/hypenate-property.d.ts
|
|
71
|
-
declare const hypenateProperty: (property: string) => string;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/important.d.ts
|
|
74
|
-
declare function isImportant<T extends string | number | boolean>(value: T): boolean;
|
|
75
|
-
declare function withoutImportant<T extends string | number | boolean>(value: T): string | T;
|
|
76
|
-
declare function withoutSpace<T extends string | number | boolean>(str: T): string | T;
|
|
77
|
-
type Dict$1 = Record<string, unknown>;
|
|
78
|
-
declare function markImportant(obj: Dict$1): {};
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/memo.d.ts
|
|
81
|
-
declare const memo: <T extends (...args: any[]) => any>(fn: T) => T;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/merge-props.d.ts
|
|
84
|
-
declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/pattern-fns.d.ts
|
|
87
|
-
declare const patternFns: {
|
|
88
|
-
map: typeof mapObject;
|
|
89
|
-
isCssFunction: (v: unknown) => boolean;
|
|
90
|
-
isCssVar: (v: unknown) => boolean;
|
|
91
|
-
isCssUnit: (v: unknown) => boolean;
|
|
92
|
-
};
|
|
93
|
-
declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/slot.d.ts
|
|
96
|
-
declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>;
|
|
97
|
-
declare const getSlotCompoundVariant: <T extends {
|
|
98
|
-
css: any;
|
|
99
|
-
}>(compoundVariants: T[], slotName: string) => (T & {
|
|
100
|
-
css: any;
|
|
101
|
-
})[];
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/split-props.d.ts
|
|
104
|
-
type Dict = Record<string, unknown>;
|
|
105
|
-
type PredicateFn = (key: string) => boolean;
|
|
106
|
-
type Key = PredicateFn | string[];
|
|
107
|
-
declare function splitProps(props: Dict, ...keys: Key[]): Dict[];
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/uniq.d.ts
|
|
110
|
-
declare const uniq: <T>(...items: T[][]) => T[];
|
|
111
|
-
//#endregion
|
|
112
|
-
export { isString as A, CreateCssContext as C, isFunction as D, isBoolean as E, isObject as O, compact as S, createMergeCss as T, WalkObjectStopFn as _, getPatternStyles as a, filterBaseConditions as b, memo as c, withoutImportant as d, withoutSpace as f, WalkObjectOptions as g, MappedObject as h, getSlotRecipes as i, isSymbol as j, isObjectOrArray as k, isImportant as l, toHash as m, splitProps as n, patternFns as o, hypenateProperty as p, getSlotCompoundVariant as r, mergeProps as s, uniq as t, markImportant as u, mapObject as v, createCss as w, isBaseCondition as x, walkObject as y };
|