chaincss 2.1.30 → 2.1.31
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 +397 -65
- package/dist/cli/index.js +312 -375
- package/dist/compiler/btt.d.ts +11 -72
- package/dist/compiler/component-generator.d.ts +10 -0
- package/dist/compiler/index.js +198 -331
- package/dist/compiler/recipe.d.ts +35 -0
- package/dist/compiler/scanner.d.ts +5 -0
- package/dist/compiler/timeline.d.ts +29 -0
- package/dist/index.js +253 -397
- package/dist/plugins/vite.js +110 -186
- package/package.json +1 -1
- package/src/compiler/btt.ts +126 -901
- package/src/compiler/component-generator.ts +87 -0
- package/src/compiler/recipe.ts +145 -0
- package/src/compiler/scanner.ts +46 -0
- package/src/compiler/timeline.ts +128 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface StyleDefinition {
|
|
2
|
+
selectors: string[];
|
|
3
|
+
hover?: Record<string, string | number>;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface RecipeOptions<TVariants extends Record<string, Record<string, any>>> {
|
|
7
|
+
base?: StyleDefinition | (() => StyleDefinition);
|
|
8
|
+
variants?: TVariants;
|
|
9
|
+
defaultVariants?: Partial<{
|
|
10
|
+
[K in keyof TVariants]: keyof TVariants[K];
|
|
11
|
+
}>;
|
|
12
|
+
compoundVariants?: Array<{
|
|
13
|
+
variants: Partial<{
|
|
14
|
+
[K in keyof TVariants]: keyof TVariants[K];
|
|
15
|
+
}>;
|
|
16
|
+
style: StyleDefinition | (() => StyleDefinition);
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export type Recipe<TVariants extends Record<string, Record<string, any>>> = {
|
|
20
|
+
(selection?: Partial<{
|
|
21
|
+
[K in keyof TVariants]: keyof TVariants[K];
|
|
22
|
+
}>): StyleDefinition;
|
|
23
|
+
variants: TVariants;
|
|
24
|
+
defaultVariants: Partial<{
|
|
25
|
+
[K in keyof TVariants]: keyof TVariants[K];
|
|
26
|
+
}>;
|
|
27
|
+
base: StyleDefinition;
|
|
28
|
+
getAllVariants: () => Array<Partial<{
|
|
29
|
+
[K in keyof TVariants]: keyof TVariants[K];
|
|
30
|
+
}>>;
|
|
31
|
+
compileAll: () => string;
|
|
32
|
+
getVariantClassNames: () => Record<string, string>;
|
|
33
|
+
};
|
|
34
|
+
export declare function recipe<TVariants extends Record<string, Record<string, any>>>(options: RecipeOptions<TVariants>): Recipe<TVariants>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style Timeline & Diff Viewer
|
|
3
|
+
* Tracks every style change, lets you diff versions
|
|
4
|
+
*/
|
|
5
|
+
export interface StyleSnapshot {
|
|
6
|
+
id: string;
|
|
7
|
+
timestamp: number;
|
|
8
|
+
selector: string;
|
|
9
|
+
styles: Record<string, any>;
|
|
10
|
+
source: string;
|
|
11
|
+
hash: string;
|
|
12
|
+
}
|
|
13
|
+
export interface StyleChange {
|
|
14
|
+
id: string;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
selector: string;
|
|
17
|
+
property: string;
|
|
18
|
+
oldValue: any;
|
|
19
|
+
newValue: any;
|
|
20
|
+
type: 'add' | 'remove' | 'modify';
|
|
21
|
+
}
|
|
22
|
+
export declare function enableTimeline(enable?: boolean): void;
|
|
23
|
+
export declare function getStyleHistory(): StyleSnapshot[];
|
|
24
|
+
export declare function getStyleChanges(): StyleChange[];
|
|
25
|
+
export declare function getStyleDiff(snapshotId1: string, snapshotId2: string): Record<string, any>;
|
|
26
|
+
export declare function takeSnapshot(selector: string, styles: Record<string, any>, source: string): string;
|
|
27
|
+
export declare function exportTimeline(): string;
|
|
28
|
+
export declare function clearTimeline(): void;
|
|
29
|
+
export declare function isTimelineEnabled(): boolean;
|