@melcanz85/chaincss 1.11.0 → 1.11.2
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/README.md +114 -45
- package/browser/index.js +1 -1
- package/browser/react-hooks.jsx +1 -63
- package/browser/rtt.js +47 -68
- package/node/atomic-optimizer.js +2 -67
- package/node/btt.js +348 -84
- package/node/cache-manager.js +0 -12
- package/node/chaincss.js +14 -99
- package/node/index.js +2 -13
- package/node/prefixer.js +2 -61
- package/node/strVal.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +0 -26
package/types.d.ts
CHANGED
|
@@ -6,49 +6,37 @@ declare module '@melcanz85/chaincss' {
|
|
|
6
6
|
selectors: string[];
|
|
7
7
|
[cssProperty: string]: any;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
export const createTokens: any;
|
|
11
10
|
export const responsive: any;
|
|
12
|
-
|
|
13
11
|
// Base interface for CSS properties (dynamic)
|
|
14
12
|
export interface CSSPropertyBuilder {
|
|
15
13
|
[key: string]: (value: string | number) => ChainBuilder;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
// Special methods interface
|
|
19
16
|
export interface SpecialMethods {
|
|
20
17
|
block(...selectors: string[]): StyleDefinition;
|
|
21
18
|
token?(path: string): ChainBuilder;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
// ChainBuilder is the intersection of both
|
|
25
21
|
export type ChainBuilder = CSSPropertyBuilder & SpecialMethods;
|
|
26
|
-
|
|
27
22
|
// The main $ function
|
|
28
23
|
export function $(): ChainBuilder;
|
|
29
|
-
|
|
30
24
|
// Run function for inline styles
|
|
31
25
|
export function run(...styles: StyleDefinition[]): string;
|
|
32
|
-
|
|
33
26
|
// Compile function for objects
|
|
34
27
|
export function compile(styles: Record<string, StyleDefinition>): void;
|
|
35
|
-
|
|
36
28
|
// Get function for importing (VM-safe version)
|
|
37
29
|
export function get(filename: string): any;
|
|
38
|
-
|
|
39
30
|
// Chain object (internal state)
|
|
40
31
|
export const chain: {
|
|
41
32
|
cssOutput: string;
|
|
42
33
|
catcher: any;
|
|
43
34
|
cachedValidProperties: string[];
|
|
44
35
|
};
|
|
45
|
-
|
|
46
36
|
// Processor function
|
|
47
37
|
export function processor(inputFile: string, outputFile: string): Promise<void>;
|
|
48
|
-
|
|
49
38
|
// Watch function
|
|
50
39
|
export function watch(inputFile: string, outputFile: string): void;
|
|
51
|
-
|
|
52
40
|
// Atomic optimizer configuration
|
|
53
41
|
export interface AtomicConfig {
|
|
54
42
|
enabled?: boolean;
|
|
@@ -58,7 +46,6 @@ declare module '@melcanz85/chaincss' {
|
|
|
58
46
|
cachePath?: string;
|
|
59
47
|
minify?: boolean;
|
|
60
48
|
}
|
|
61
|
-
|
|
62
49
|
// Prefixer configuration
|
|
63
50
|
export interface PrefixerConfig {
|
|
64
51
|
mode?: 'auto' | 'full';
|
|
@@ -67,17 +54,14 @@ declare module '@melcanz85/chaincss' {
|
|
|
67
54
|
sourceMap?: boolean;
|
|
68
55
|
sourceMapInline?: boolean;
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
// ChainCSS configuration
|
|
72
58
|
export interface ChainCSSConfig {
|
|
73
59
|
atomic?: AtomicConfig;
|
|
74
60
|
prefixer?: PrefixerConfig;
|
|
75
61
|
sourceMaps?: boolean;
|
|
76
62
|
}
|
|
77
|
-
|
|
78
63
|
// Function to configure ChainCSS
|
|
79
64
|
export function configure(config: ChainCSSConfig): void;
|
|
80
|
-
|
|
81
65
|
// Atomic optimizer instance
|
|
82
66
|
export const atomicOptimizer: {
|
|
83
67
|
optimize(styles: Record<string, StyleDefinition>): string;
|
|
@@ -88,7 +72,6 @@ declare module '@melcanz85/chaincss' {
|
|
|
88
72
|
savings?: string;
|
|
89
73
|
};
|
|
90
74
|
};
|
|
91
|
-
|
|
92
75
|
// Token system types
|
|
93
76
|
export interface Tokens {
|
|
94
77
|
colors: Record<string, string | Record<string, string>>;
|
|
@@ -104,48 +87,39 @@ declare module '@melcanz85/chaincss' {
|
|
|
104
87
|
shadows: Record<string, string>;
|
|
105
88
|
borderRadius: Record<string, string>;
|
|
106
89
|
}
|
|
107
|
-
|
|
108
90
|
export class DesignTokens {
|
|
109
91
|
constructor(tokens: Partial<Tokens>);
|
|
110
92
|
get(path: string, defaultValue?: string): string;
|
|
111
93
|
toCSSVariables(prefix?: string): string;
|
|
112
94
|
createTheme(name: string, overrides: Record<string, any>): DesignTokens;
|
|
113
95
|
}
|
|
114
|
-
|
|
115
96
|
export const tokens: DesignTokens;
|
|
116
97
|
export function createTokens(customTokens: Partial<Tokens>): DesignTokens;
|
|
117
98
|
export function responsive(values: Record<string, string> | string): string;
|
|
118
|
-
|
|
119
99
|
// React hooks types (add to your existing declare module)
|
|
120
100
|
export interface UseChainStylesOptions {
|
|
121
101
|
cache?: boolean;
|
|
122
102
|
namespace?: string;
|
|
123
103
|
watch?: boolean;
|
|
124
104
|
}
|
|
125
|
-
|
|
126
105
|
export function useChainStyles(
|
|
127
106
|
styles: Record<string, any> | (() => Record<string, any>),
|
|
128
107
|
options?: UseChainStylesOptions
|
|
129
108
|
): Record<string, string>;
|
|
130
|
-
|
|
131
109
|
export function useDynamicChainStyles(
|
|
132
110
|
styleFactory: () => Record<string, any>,
|
|
133
111
|
deps?: any[],
|
|
134
112
|
options?: UseChainStylesOptions
|
|
135
113
|
): Record<string, string>;
|
|
136
|
-
|
|
137
114
|
export function useThemeChainStyles(
|
|
138
115
|
styles: Record<string, any> | ((theme: any) => Record<string, any>),
|
|
139
116
|
theme: any,
|
|
140
117
|
options?: UseChainStylesOptions
|
|
141
118
|
): Record<string, string>;
|
|
142
|
-
|
|
143
119
|
export const ChainCSSGlobal: React.FC<{ styles: Record<string, any> }>;
|
|
144
|
-
|
|
145
120
|
export function withChainStyles(
|
|
146
121
|
styles: Record<string, any> | ((props: any) => Record<string, any>),
|
|
147
122
|
options?: UseChainStylesOptions
|
|
148
123
|
): <P extends object>(Component: React.ComponentType<P>) => React.FC<P & { chainStyles?: Record<string, string> }>;
|
|
149
|
-
|
|
150
124
|
export function cx(...classes: (string | undefined | null | false)[]): string;
|
|
151
125
|
}
|