chaincss 2.0.6 → 2.1.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/CHANGELOG.md +30 -0
- package/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +28 -0
- package/README.md +454 -231
- package/demo/demo/node_modules/caniuse-db/fulldata-json/data-2.0.json +1 -0
- package/demo/index.html +16 -0
- package/demo/package.json +20 -0
- package/demo/src/App.tsx +117 -0
- package/demo/src/chaincss-barrel.ts +9 -0
- package/demo/src/main.tsx +8 -0
- package/demo/src/styles.chain.ts +300 -0
- package/demo/vite.config.ts +46 -0
- package/dist/cli/commands/build.d.ts +0 -1
- package/dist/cli/commands/cache.d.ts +1 -0
- package/dist/cli/commands/init.d.ts +6 -3
- package/dist/cli/commands/timeline.d.ts +0 -1
- package/dist/cli/commands/watch.d.ts +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +3213 -5296
- package/dist/cli/types.d.ts +51 -20
- package/dist/cli/utils/config-loader.d.ts +0 -1
- package/dist/cli/utils/file-utils.d.ts +27 -3
- package/dist/cli/utils/logger.d.ts +0 -1
- package/dist/compiler/Chain.d.ts +215 -0
- package/dist/compiler/animations.d.ts +76 -0
- package/dist/compiler/atomic-optimizer.d.ts +47 -12
- package/dist/compiler/breakpoints.d.ts +46 -0
- package/dist/compiler/btt.d.ts +36 -60
- package/dist/compiler/cache-manager.d.ts +58 -4
- package/dist/compiler/commonProps.d.ts +0 -1
- package/dist/compiler/content-addressable-cache.d.ts +78 -0
- package/dist/compiler/helpers.d.ts +54 -0
- package/dist/compiler/index.d.ts +16 -9
- package/dist/compiler/index.js +4450 -4316
- package/dist/compiler/prefixer.d.ts +17 -1
- package/dist/compiler/shorthands.d.ts +28 -0
- package/dist/compiler/suggestions.d.ts +43 -0
- package/dist/compiler/theme-contract.d.ts +16 -27
- package/dist/compiler/token-resolver.d.ts +69 -0
- package/dist/compiler/tokens.d.ts +33 -8
- package/dist/core/auto-detector.d.ts +34 -0
- package/dist/core/common-utils.d.ts +97 -0
- package/dist/core/compiler.d.ts +63 -23
- package/dist/core/constants.d.ts +137 -36
- package/dist/core/smart-chain.d.ts +3 -0
- package/dist/core/types.d.ts +122 -15
- package/dist/core/utils.d.ts +134 -17
- package/dist/index.d.ts +52 -8
- package/dist/index.js +7090 -5578
- package/dist/plugins/vite.d.ts +7 -5
- package/dist/plugins/vite.js +2964 -25641
- package/dist/plugins/webpack.d.ts +24 -1
- package/dist/plugins/webpack.js +209 -72
- package/dist/runtime/Chain.d.ts +32 -0
- package/dist/runtime/auto-hooks.d.ts +11 -0
- package/dist/runtime/hmr.d.ts +22 -2
- package/dist/runtime/index.d.ts +3 -2
- package/dist/runtime/index.js +3649 -301
- package/dist/runtime/injector.d.ts +39 -71
- package/dist/runtime/react.d.ts +17 -12
- package/dist/runtime/svelte.d.ts +15 -0
- package/dist/runtime/types.d.ts +126 -4
- package/dist/runtime/utils.d.ts +0 -1
- package/dist/runtime/vue.d.ts +34 -14
- package/package.json +59 -66
- package/src/cli/commands/build.ts +133 -0
- package/src/cli/commands/cache.ts +371 -0
- package/src/cli/commands/init.ts +230 -0
- package/src/cli/commands/timeline.ts +435 -0
- package/src/cli/commands/watch.ts +211 -0
- package/src/cli/index.ts +226 -0
- package/src/cli/types.ts +100 -0
- package/src/cli/utils/config-loader.ts +174 -0
- package/src/cli/utils/file-utils.ts +139 -0
- package/src/cli/utils/logger.ts +74 -0
- package/src/compiler/Chain.ts +831 -0
- package/src/compiler/animations.ts +517 -0
- package/src/compiler/atomic-optimizer.ts +786 -0
- package/src/compiler/breakpoints.ts +347 -0
- package/src/compiler/btt.ts +1147 -0
- package/src/compiler/cache-manager.ts +446 -0
- package/src/compiler/commonProps.ts +18 -0
- package/src/compiler/content-addressable-cache.ts +478 -0
- package/src/compiler/helpers.ts +407 -0
- package/src/compiler/index.ts +72 -0
- package/src/compiler/prefixer.ts +724 -0
- package/src/compiler/shorthands.ts +558 -0
- package/src/compiler/suggestions.ts +436 -0
- package/src/compiler/theme-contract.ts +197 -0
- package/src/compiler/token-resolver.ts +241 -0
- package/src/compiler/tokens.ts +612 -0
- package/src/core/auto-detector.ts +187 -0
- package/src/core/common-utils.ts +423 -0
- package/src/core/compiler.ts +835 -0
- package/src/core/constants.ts +424 -0
- package/src/core/index.ts +107 -0
- package/src/core/smart-chain.ts +163 -0
- package/src/core/types.ts +257 -0
- package/src/core/utils.ts +598 -0
- package/src/index.ts +208 -0
- package/src/plugins/vite.d.ts +316 -0
- package/src/plugins/vite.ts +424 -0
- package/src/plugins/webpack.d.ts +289 -0
- package/src/plugins/webpack.ts +416 -0
- package/src/runtime/Chain.ts +242 -0
- package/src/runtime/auto-hooks.tsx +127 -0
- package/src/runtime/auto-vue.ts +72 -0
- package/src/runtime/hmr.ts +212 -0
- package/src/runtime/index.ts +82 -0
- package/src/runtime/injector.ts +273 -0
- package/src/runtime/react.tsx +269 -0
- package/src/runtime/svelte.ts +15 -0
- package/src/runtime/types.ts +256 -0
- package/src/runtime/utils.ts +128 -0
- package/src/runtime/vite-env.d.ts +120 -0
- package/src/runtime/vue.ts +231 -0
- package/tsconfig.build.json +41 -0
- package/tsconfig.json +25 -0
- package/tsconfig.runtimes.json +18 -0
- package/dist/cli/cli.cjs +0 -7
- package/dist/cli/commands/build.d.ts.map +0 -1
- package/dist/cli/commands/compile.d.ts +0 -3
- package/dist/cli/commands/compile.d.ts.map +0 -1
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/timeline.d.ts.map +0 -1
- package/dist/cli/commands/watch.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/utils/config-loader.d.ts.map +0 -1
- package/dist/cli/utils/file-utils.d.ts.map +0 -1
- package/dist/cli/utils/logger.d.ts.map +0 -1
- package/dist/compiler/atomic-optimizer.d.ts.map +0 -1
- package/dist/compiler/btt.d.ts.map +0 -1
- package/dist/compiler/cache-manager.d.ts.map +0 -1
- package/dist/compiler/commonProps.d.ts.map +0 -1
- package/dist/compiler/index.d.ts.map +0 -1
- package/dist/compiler/prefixer.d.ts.map +0 -1
- package/dist/compiler/theme-contract.d.ts.map +0 -1
- package/dist/compiler/tokens.d.ts.map +0 -1
- package/dist/compiler/types.d.ts +0 -57
- package/dist/compiler/types.d.ts.map +0 -1
- package/dist/core/compiler.d.ts.map +0 -1
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/vite.d.ts.map +0 -1
- package/dist/plugins/webpack.d.ts.map +0 -1
- package/dist/runtime/hmr.d.ts.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/injector.d.ts.map +0 -1
- package/dist/runtime/react.d.ts.map +0 -1
- package/dist/runtime/react.js +0 -270
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/utils.d.ts.map +0 -1
- package/dist/runtime/vue.d.ts.map +0 -1
- package/dist/runtime/vue.js +0 -232
package/dist/compiler/btt.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DesignTokens } from './tokens.js';
|
|
2
2
|
import type { AtomicOptimizer } from './atomic-optimizer.js';
|
|
3
|
+
export { setBreakpoints } from './breakpoints.js';
|
|
4
|
+
export { chain, enableDebug } from './Chain.js';
|
|
3
5
|
interface StyleSnapshot {
|
|
4
6
|
id: string;
|
|
5
7
|
timestamp: number;
|
|
@@ -32,49 +34,21 @@ interface ComponentInfo {
|
|
|
32
34
|
}
|
|
33
35
|
export declare function generateComponentCode(info: ComponentInfo): string;
|
|
34
36
|
export declare function setSourceComments(enabled: boolean): void;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare function rem(value: number): string;
|
|
44
|
-
declare function em(value: number): string;
|
|
45
|
-
declare function px(value: number): string;
|
|
46
|
-
declare function min(...values: (string | number)[]): string;
|
|
47
|
-
declare function max(...values: (string | number)[]): string;
|
|
48
|
-
declare function clamp(min: string | number, preferred: string | number, max: string | number): string;
|
|
49
|
-
declare const helpers: {
|
|
50
|
-
calc: typeof calc;
|
|
51
|
-
add: typeof add;
|
|
52
|
-
subtract: typeof subtract;
|
|
53
|
-
sub: typeof subtract;
|
|
54
|
-
multiply: typeof multiply;
|
|
55
|
-
mul: typeof multiply;
|
|
56
|
-
divide: typeof divide;
|
|
57
|
-
div: typeof divide;
|
|
58
|
-
percent: typeof percent;
|
|
59
|
-
vw: typeof vw;
|
|
60
|
-
vh: typeof vh;
|
|
61
|
-
rem: typeof rem;
|
|
62
|
-
em: typeof em;
|
|
63
|
-
px: typeof px;
|
|
64
|
-
min: typeof min;
|
|
65
|
-
max: typeof max;
|
|
66
|
-
clamp: typeof clamp;
|
|
67
|
-
};
|
|
68
|
-
declare function enableDebug(enable?: boolean): void;
|
|
69
|
-
declare function setBreakpoints(breakpoints: Record<string, string>): void;
|
|
70
|
-
export interface StyleDefinition {
|
|
71
|
-
selectors: string[];
|
|
72
|
-
hover?: Record<string, string | number>;
|
|
73
|
-
atRules?: AtRule[];
|
|
74
|
-
nestedRules?: NestedRule[];
|
|
75
|
-
themes?: ThemeBlock[];
|
|
76
|
-
[cssProperty: string]: any;
|
|
37
|
+
export interface ChainObject {
|
|
38
|
+
cssOutput: string;
|
|
39
|
+
cachedValidProperties: string[];
|
|
40
|
+
classMap: Record<string, string>;
|
|
41
|
+
atomicStats: any;
|
|
42
|
+
componentMap?: Map<string, any>;
|
|
43
|
+
initializeProperties: () => Promise<void>;
|
|
44
|
+
getCachedProperties: () => string[] | null;
|
|
77
45
|
}
|
|
46
|
+
export declare const chains: ChainObject;
|
|
47
|
+
declare let atomicOptimizer: AtomicOptimizer | null;
|
|
48
|
+
export declare function setAtomicOptimizer(optimizer: AtomicOptimizer | null): void;
|
|
49
|
+
export declare function configureAtomic(opts: Record<string, any>): void;
|
|
50
|
+
export declare const tokens: DesignTokens;
|
|
51
|
+
export declare function createTokens(tokenValues: Record<string, any>): DesignTokens;
|
|
78
52
|
export interface AtRule {
|
|
79
53
|
type: 'media' | 'keyframes' | 'font-face' | 'supports' | 'container' | 'layer' | 'counter-style' | 'property';
|
|
80
54
|
query?: string;
|
|
@@ -95,23 +69,14 @@ export interface ThemeBlock {
|
|
|
95
69
|
tokens: any;
|
|
96
70
|
fallback: any;
|
|
97
71
|
}
|
|
98
|
-
export interface
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
initializeProperties: () => Promise<void>;
|
|
106
|
-
getCachedProperties: () => string[] | null;
|
|
72
|
+
export interface StyleDefinition {
|
|
73
|
+
selectors: string[];
|
|
74
|
+
hover?: Record<string, string | number>;
|
|
75
|
+
atRules?: AtRule[];
|
|
76
|
+
nestedRules?: NestedRule[];
|
|
77
|
+
themes?: ThemeBlock[];
|
|
78
|
+
[cssProperty: string]: any;
|
|
107
79
|
}
|
|
108
|
-
export declare const chain: ChainObject;
|
|
109
|
-
declare let atomicOptimizer: AtomicOptimizer | null;
|
|
110
|
-
export declare function setAtomicOptimizer(optimizer: AtomicOptimizer | null): void;
|
|
111
|
-
export declare function configureAtomic(opts: Record<string, any>): void;
|
|
112
|
-
export declare const tokens: DesignTokens;
|
|
113
|
-
export declare function createTokens(tokenValues: Record<string, any>): DesignTokens;
|
|
114
|
-
export declare const $: any;
|
|
115
80
|
export declare const run: (...args: any[]) => string;
|
|
116
81
|
export declare const compile: (obj: Record<string, StyleDefinition>) => string;
|
|
117
82
|
export interface RecipeOptions<TVariants extends Record<string, Record<string, any>>> {
|
|
@@ -140,7 +105,18 @@ export type Recipe<TVariants extends Record<string, Record<string, any>>> = {
|
|
|
140
105
|
[K in keyof TVariants]: keyof TVariants[K];
|
|
141
106
|
}>>;
|
|
142
107
|
compileAll: () => string;
|
|
108
|
+
getVariantClassNames: () => Record<string, string>;
|
|
143
109
|
};
|
|
144
110
|
export declare function recipe<TVariants extends Record<string, Record<string, any>>>(options: RecipeOptions<TVariants>): Recipe<TVariants>;
|
|
145
|
-
|
|
146
|
-
|
|
111
|
+
/**
|
|
112
|
+
* The "Brain": Extracts ChainCSS calls from raw text
|
|
113
|
+
*/
|
|
114
|
+
export declare const scanContent: (text: string) => string[];
|
|
115
|
+
/**
|
|
116
|
+
* The "Worker": Reads the file, uses the Brain, feeds the Optimizer
|
|
117
|
+
*/
|
|
118
|
+
export declare function scanFileForStyles(filePath: string, optimizer: any, source?: string | null): {
|
|
119
|
+
foundCount: number;
|
|
120
|
+
errors: Error[];
|
|
121
|
+
};
|
|
122
|
+
export { atomicOptimizer, chains as chainObject };
|
|
@@ -1,20 +1,74 @@
|
|
|
1
1
|
export interface CacheData {
|
|
2
2
|
version: string;
|
|
3
3
|
created: string;
|
|
4
|
+
updated: string;
|
|
4
5
|
atomic: Record<string, any>;
|
|
5
6
|
usage: Record<string, any>;
|
|
7
|
+
componentMap: Record<string, any>;
|
|
8
|
+
stats: {
|
|
9
|
+
totalStyles: number;
|
|
10
|
+
atomicStyles: number;
|
|
11
|
+
cacheHits: number;
|
|
12
|
+
cacheMisses: number;
|
|
13
|
+
};
|
|
6
14
|
[key: string]: any;
|
|
7
15
|
}
|
|
16
|
+
export interface CacheOptions {
|
|
17
|
+
maxAge?: number;
|
|
18
|
+
maxSize?: number;
|
|
19
|
+
compress?: boolean;
|
|
20
|
+
autoSave?: boolean;
|
|
21
|
+
saveInterval?: number;
|
|
22
|
+
}
|
|
8
23
|
export declare class CacheManager {
|
|
9
24
|
cachePath: string;
|
|
10
25
|
cacheDir: string;
|
|
11
26
|
cache: CacheData | Record<string, any>;
|
|
12
|
-
|
|
27
|
+
private dirty;
|
|
28
|
+
private saveTimer;
|
|
29
|
+
private stats;
|
|
30
|
+
private options;
|
|
31
|
+
constructor(cachePath?: string, options?: CacheOptions);
|
|
32
|
+
private startAutoSave;
|
|
33
|
+
private stopAutoSave;
|
|
13
34
|
load(): void;
|
|
35
|
+
private getDefaultCache;
|
|
36
|
+
private isExpired;
|
|
37
|
+
private checkAndPrune;
|
|
38
|
+
private isCompressed;
|
|
39
|
+
private compress;
|
|
40
|
+
private decompress;
|
|
14
41
|
get(key: string): any;
|
|
15
|
-
set(key: string, value: any): void;
|
|
16
|
-
|
|
42
|
+
set(key: string, value: any, ttl?: number): void;
|
|
43
|
+
has(key: string): boolean;
|
|
44
|
+
delete(key: string): boolean;
|
|
17
45
|
clear(): void;
|
|
46
|
+
prune(): void;
|
|
47
|
+
save(): void;
|
|
48
|
+
getStats(): {
|
|
49
|
+
hits: number;
|
|
50
|
+
misses: number;
|
|
51
|
+
reads: number;
|
|
52
|
+
writes: number;
|
|
53
|
+
hitRate: number;
|
|
54
|
+
size: number;
|
|
55
|
+
entryCount: number;
|
|
56
|
+
};
|
|
57
|
+
getCacheSize(): number;
|
|
58
|
+
getCacheAge(): number;
|
|
59
|
+
getKeys(): string[];
|
|
60
|
+
getSize(): number;
|
|
61
|
+
isDirty(): boolean;
|
|
62
|
+
flush(): Promise<void>;
|
|
63
|
+
destroy(): void;
|
|
64
|
+
getEntry(key: string): {
|
|
65
|
+
value: any;
|
|
66
|
+
cachedAt: number;
|
|
67
|
+
expires?: number;
|
|
68
|
+
} | undefined;
|
|
69
|
+
setWithTTL(key: string, value: any, ttlSeconds: number): void;
|
|
70
|
+
setBulk(entries: Record<string, any>): void;
|
|
71
|
+
getBulk(keys: string[]): Record<string, any>;
|
|
72
|
+
getOrCompute<T>(key: string, compute: () => Promise<T>, ttl?: number): Promise<T>;
|
|
18
73
|
}
|
|
19
74
|
export { CacheManager as default };
|
|
20
|
-
//# sourceMappingURL=cache-manager.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface PersistentCacheEntry {
|
|
2
|
+
hash: string;
|
|
3
|
+
result: any;
|
|
4
|
+
dependencies: Record<string, string>;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
version: string;
|
|
7
|
+
compilerVersion: string;
|
|
8
|
+
createdAt?: number;
|
|
9
|
+
lastAccessed?: number;
|
|
10
|
+
accessCount?: number;
|
|
11
|
+
size?: number;
|
|
12
|
+
value?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface PersistentCacheOptions {
|
|
15
|
+
cacheDir?: string;
|
|
16
|
+
maxAgeDays?: number;
|
|
17
|
+
maxSizeMB?: number;
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class PersistentCache {
|
|
22
|
+
private cacheDir;
|
|
23
|
+
private options;
|
|
24
|
+
private memoryCache;
|
|
25
|
+
private metadataPath;
|
|
26
|
+
private metadata;
|
|
27
|
+
constructor(options?: PersistentCacheOptions);
|
|
28
|
+
private hash;
|
|
29
|
+
private hashFile;
|
|
30
|
+
getByContent(source: string): Promise<any | null>;
|
|
31
|
+
getByFile(filePath: string): Promise<any | null>;
|
|
32
|
+
getByHash(hash: string): Promise<any | null>;
|
|
33
|
+
setByContent(source: string, result: any, dependencies?: string[]): Promise<string>;
|
|
34
|
+
setByFile(filePath: string, result: any, dependencies?: string[]): Promise<string>;
|
|
35
|
+
setByHash(hash: string, result: any, dependencies?: string[]): Promise<string>;
|
|
36
|
+
getByHashSync(hash: string): any | null;
|
|
37
|
+
setByHashSync(hash: string, result: any, source: any, dependencies?: string[]): void;
|
|
38
|
+
invalidateByHash(hash: string): void;
|
|
39
|
+
clear(): Promise<void>;
|
|
40
|
+
getStats(): Promise<{
|
|
41
|
+
entryCount: number;
|
|
42
|
+
totalSizeMB: number;
|
|
43
|
+
totalSizeBytes: number;
|
|
44
|
+
oldestEntry: number;
|
|
45
|
+
newestEntry: number;
|
|
46
|
+
hitRate?: number;
|
|
47
|
+
}>;
|
|
48
|
+
prune(): Promise<void>;
|
|
49
|
+
private isExpired;
|
|
50
|
+
private loadMetadata;
|
|
51
|
+
private updateMetadata;
|
|
52
|
+
private updateMetadataSync;
|
|
53
|
+
enforceSizeLimit(): Promise<void>;
|
|
54
|
+
private enforceSizeLimitSync;
|
|
55
|
+
private ensureDir;
|
|
56
|
+
/**
|
|
57
|
+
* List all cache entries
|
|
58
|
+
*/
|
|
59
|
+
listEntries(): Promise<Array<{
|
|
60
|
+
key: string;
|
|
61
|
+
size: number;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
createdAt: number;
|
|
64
|
+
lastAccessed?: number;
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a cache entry by key
|
|
68
|
+
*/
|
|
69
|
+
get(key: string): Promise<PersistentCacheEntry | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Delete a cache entry by key
|
|
72
|
+
*/
|
|
73
|
+
delete(key: string): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Validate a cache entry
|
|
76
|
+
*/
|
|
77
|
+
validate(key: string): Promise<boolean>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type Unit = 'px' | 'rem' | 'em' | '%' | 'vw' | 'vh' | 'vmin' | 'vmax' | 'ch' | 'ex';
|
|
2
|
+
export type MathOperation = 'add' | 'subtract' | 'multiply' | 'divide';
|
|
3
|
+
export interface CalcOptions {
|
|
4
|
+
precision?: number;
|
|
5
|
+
simplify?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const helpers: {
|
|
8
|
+
calc: (expr: string, options?: CalcOptions) => string;
|
|
9
|
+
add: (a: any, b: any, options?: CalcOptions) => string;
|
|
10
|
+
subtract: (a: any, b: any, options?: CalcOptions) => string;
|
|
11
|
+
sub: (a: any, b: any, options?: CalcOptions) => string;
|
|
12
|
+
multiply: (a: any, b: any, options?: CalcOptions) => string;
|
|
13
|
+
mul: (a: any, b: any, options?: CalcOptions) => string;
|
|
14
|
+
divide: (a: any, b: any, options?: CalcOptions) => string;
|
|
15
|
+
div: (a: any, b: any, options?: CalcOptions) => string;
|
|
16
|
+
sum: (...values: any[]) => string;
|
|
17
|
+
difference: (a: any, ...rest: any[]) => string;
|
|
18
|
+
product: (...values: any[]) => string;
|
|
19
|
+
quotient: (a: any, ...rest: any[]) => string;
|
|
20
|
+
mpx: (value: number | string) => string;
|
|
21
|
+
rem: (value: number | string, base?: number) => string;
|
|
22
|
+
em: (value: number | string, context?: number) => string;
|
|
23
|
+
percent: (value: number | string) => string;
|
|
24
|
+
vw: (value: number | string) => string;
|
|
25
|
+
vh: (value: number | string) => string;
|
|
26
|
+
vmin: (value: number | string) => string;
|
|
27
|
+
vmax: (value: number | string) => string;
|
|
28
|
+
ch: (value: number | string) => string;
|
|
29
|
+
ex: (value: number | string) => string;
|
|
30
|
+
convert: (value: string | number, fromUnit: Unit, toUnit: Unit, context?: number) => string;
|
|
31
|
+
min: (...values: any[]) => string;
|
|
32
|
+
max: (...values: any[]) => string;
|
|
33
|
+
clamp: (min: any, preferred: any, max: any, options?: CalcOptions) => string;
|
|
34
|
+
round: (value: number | string, precision?: number) => string;
|
|
35
|
+
ceil: (value: number | string) => string;
|
|
36
|
+
floor: (value: number | string) => string;
|
|
37
|
+
rgba: (r: number, g: number, b: number, a?: number) => string;
|
|
38
|
+
hsla: (h: number, s: number, l: number, a?: number) => string;
|
|
39
|
+
url: (path: string) => string;
|
|
40
|
+
format: (strings: TemplateStringsArray, ...values: any[]) => string;
|
|
41
|
+
if: (condition: boolean, trueValue: any, falseValue: any) => any;
|
|
42
|
+
camelToKebab: (str: string) => string;
|
|
43
|
+
kebabToCamel: (str: string) => string;
|
|
44
|
+
toPx: (value: number | string) => string;
|
|
45
|
+
toRem: (value: number | string, base?: number) => string;
|
|
46
|
+
};
|
|
47
|
+
export type MathHelpers = typeof helpers;
|
|
48
|
+
export declare function withUnit(value: number | string, unit: Unit): string;
|
|
49
|
+
export declare function extractNumeric(value: string): number;
|
|
50
|
+
export declare function extractUnit(value: string): Unit | null;
|
|
51
|
+
export declare function fluidType(minSize: number, maxSize: number, minWidth?: number, maxWidth?: number, unit?: 'px' | 'rem'): string;
|
|
52
|
+
export default helpers;
|
|
53
|
+
export declare const toPx: (v: number | string) => string;
|
|
54
|
+
export declare const toRem: (v: number | string) => string;
|
package/dist/compiler/index.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
export { chain,
|
|
1
|
+
export { chain, chains, run, compile, createTokens, configureAtomic, setAtomicOptimizer, recipe, tokens, enableDebug, setBreakpoints, enableTimeline, getStyleHistory, getStyleChanges, getStyleDiff, exportTimeline, clearTimeline, setSourceComments } from './btt.js';
|
|
2
2
|
export { AtomicOptimizer } from './atomic-optimizer.js';
|
|
3
|
+
export type { AtomicClass, AtomicOptimizerOptions, AtomicOptimizerStats, ComponentClassMapEntry, OptimizeResult } from './atomic-optimizer.js';
|
|
3
4
|
export { ChainCSSPrefixer } from './prefixer.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
5
|
+
export type { PrefixerConfig, PrefixerResult } from './prefixer.js';
|
|
6
|
+
export { DesignTokens, createTokens as createDesignTokens } from './tokens.js';
|
|
7
|
+
export type { TokensStructure, FlattenedTokens } from './tokens.js';
|
|
8
|
+
export { createThemeContract, validateTheme, createTheme, Theme } from './theme-contract.js';
|
|
9
|
+
export type { ThemeContract, ThemeTokens } from './theme-contract.js';
|
|
6
10
|
export { CacheManager } from './cache-manager.js';
|
|
7
|
-
export
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
11
|
+
export { PersistentCache } from './content-addressable-cache.js';
|
|
12
|
+
export type { CacheData, CacheOptions } from './cache-manager.js';
|
|
13
|
+
export type { PersistentCacheOptions, PersistentCacheEntry } from './content-addressable-cache.js';
|
|
14
|
+
export { shorthandMap, macros, handleShorthand, isShorthand, expandShorthand, getAvailableShorthands } from './shorthands.js';
|
|
15
|
+
export { helpers } from './helpers.js';
|
|
16
|
+
export { animationPresets, createAnimation, getAnimationPreset, hasAnimationPreset, getAnimationPresetNames } from './animations.js';
|
|
17
|
+
export { setBreakpoints as setBreakpointsUtil, getBreakpoint, getAllBreakpoints, resetBreakpoints, addBreakpoint, removeBreakpoint } from './breakpoints.js';
|
|
18
|
+
export { getSuggestion, getSuggestions, getPropertySuggestion, getShorthandSuggestion } from './suggestions.js';
|
|
19
|
+
export { resolveToken, setTokenContext, getTokenContext, clearTokenContext, TokenResolver } from './token-resolver.js';
|