@codeleap/styles 4.2.1 → 4.2.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/dist/lib/StyleCache.js +32 -1
- package/dist/lib/StyleRegistry.d.ts +3 -2
- package/dist/lib/StyleRegistry.js +25 -11
- package/dist/types/style.d.ts +3 -2
- package/package.json +2 -2
- package/package.json.bak +1 -1
- package/src/lib/StyleCache.ts +13 -1
- package/src/lib/StyleRegistry.ts +38 -19
- package/src/types/style.ts +18 -4
package/dist/lib/StyleCache.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
2
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
28
|
exports.StyleCache = void 0;
|
|
4
29
|
var Cacher_1 = require("./Cacher");
|
|
@@ -31,7 +56,13 @@ var StyleCache = /** @class */ (function () {
|
|
|
31
56
|
StyleCache.prototype.keyFor = function (type, keyData) {
|
|
32
57
|
var _a;
|
|
33
58
|
var cache = this[type];
|
|
34
|
-
var
|
|
59
|
+
var withFunctionsHash = Object.values(keyData).map(function (value) {
|
|
60
|
+
if (typeof value === 'function') {
|
|
61
|
+
return value.toString();
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
});
|
|
65
|
+
var values = __spreadArray([this.baseKey], __read(withFunctionsHash), false);
|
|
35
66
|
var cacheKey = (0, hashKey_1.hashKey)(values);
|
|
36
67
|
var cachedValue = minifier_1.minifier.decompress((_a = cache.cache[cacheKey]) !== null && _a !== void 0 ? _a : null);
|
|
37
68
|
return {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AnyRecord, AnyStyledComponent, ICSS, ITheme, StyleProp, VariantStyleSheet } from '../types';
|
|
1
|
+
import { AnyRecord, AnyStyledComponent, ICSS, ITheme, StyleAggregator, StyleProp, VariantStyleSheet } from '../types';
|
|
2
2
|
import { MultiplierFunction } from './spacing';
|
|
3
3
|
import { StateStorage } from 'zustand/middleware';
|
|
4
4
|
export declare class CodeleapStyleRegistry {
|
|
5
5
|
stylesheets: Record<string, VariantStyleSheet>;
|
|
6
6
|
commonVariants: Record<string, ICSS | MultiplierFunction>;
|
|
7
|
+
aggregators: Record<string, StyleAggregator>;
|
|
7
8
|
components: Record<string, AnyStyledComponent>;
|
|
8
9
|
private theme;
|
|
9
10
|
private styleCache;
|
|
@@ -33,7 +34,7 @@ export declare class CodeleapStyleRegistry {
|
|
|
33
34
|
getCompositionStyle(componentName: string, composition: Record<string, any>, style: any): any;
|
|
34
35
|
styleFor<T = unknown>(componentName: string, componentStyle: StyleProp<T>, mergeWithDefaultStyle?: boolean): T;
|
|
35
36
|
registerCommonVariants(): void;
|
|
36
|
-
registerVariants(componentName: string, variants: VariantStyleSheet): void;
|
|
37
|
+
registerVariants<Composition extends string = any>(componentName: string, variants: VariantStyleSheet, aggregator?: StyleAggregator<Composition>): void;
|
|
37
38
|
registerComponent(component: AnyStyledComponent): void;
|
|
38
39
|
/**
|
|
39
40
|
* These should be overwritten by the end-user to support
|
|
@@ -63,6 +63,7 @@ var CodeleapStyleRegistry = /** @class */ (function () {
|
|
|
63
63
|
var _a, _b, _c, _d, _e;
|
|
64
64
|
this.stylesheets = {};
|
|
65
65
|
this.commonVariants = {};
|
|
66
|
+
this.aggregators = {};
|
|
66
67
|
this.components = {};
|
|
67
68
|
this.styleCache = new StyleCache_1.StyleCache(storage);
|
|
68
69
|
this.theme = themeStore_1.themeStore.getState();
|
|
@@ -118,7 +119,8 @@ var CodeleapStyleRegistry = /** @class */ (function () {
|
|
|
118
119
|
var rootElement = this.getRegisteredComponent(componentName).rootElement;
|
|
119
120
|
var component = _component !== null && _component !== void 0 ? _component : rootElement;
|
|
120
121
|
var stylesheet = minifier_1.minifier.decompress(this.stylesheets[componentName]);
|
|
121
|
-
var
|
|
122
|
+
var aggregator = this.aggregators[componentName];
|
|
123
|
+
var cache = this.styleCache.keyFor('variants', { componentName: componentName, component: component, stylesheet: stylesheet, variants: variants, aggregator: aggregator });
|
|
122
124
|
if (!!cache.value) {
|
|
123
125
|
return cache.value;
|
|
124
126
|
}
|
|
@@ -142,6 +144,9 @@ var CodeleapStyleRegistry = /** @class */ (function () {
|
|
|
142
144
|
return _this.computeCommonVariantStyle(componentName, variant, component);
|
|
143
145
|
}).filter(function (variantStyle) { return !!variantStyle; });
|
|
144
146
|
var variantStyle = (0, deepmerge_1.default)({ all: true }).apply(void 0, __spreadArray([], __read(variantStyles), false));
|
|
147
|
+
if (!!aggregator) {
|
|
148
|
+
variantStyle = aggregator(theme, variantStyle);
|
|
149
|
+
}
|
|
145
150
|
this.styleCache.cacheFor('variants', cache.key, variantStyle);
|
|
146
151
|
return variantStyle;
|
|
147
152
|
};
|
|
@@ -389,23 +394,31 @@ var CodeleapStyleRegistry = /** @class */ (function () {
|
|
|
389
394
|
if (typeof s === 'string') {
|
|
390
395
|
variants.push(s);
|
|
391
396
|
}
|
|
392
|
-
|
|
397
|
+
var isObj = typeof s === 'object';
|
|
398
|
+
if (variants.length > 0 && (idx === filteredStyle.length - 1 || isObj)) {
|
|
399
|
+
var computedVariantStyle = this.computeVariantStyle(componentName, variants);
|
|
400
|
+
styles.push(computedVariantStyle);
|
|
401
|
+
variants = [];
|
|
402
|
+
}
|
|
403
|
+
if (isObj) {
|
|
393
404
|
var _h = this.isCompositionStyle(registeredComponent, s), isComposition = _h.isComposition, composition = _h.composition;
|
|
394
|
-
|
|
405
|
+
var _j = this.isResponsiveStyle(s), isResponsive = _j.isResponsive, responsiveStyleKey = _j.responsiveStyleKey;
|
|
406
|
+
if (Array.isArray(s)) {
|
|
407
|
+
var styleComposition = this.styleFor(componentName, s, false);
|
|
408
|
+
styles.push(styleComposition);
|
|
409
|
+
}
|
|
410
|
+
else if (isComposition) {
|
|
395
411
|
var compositionStyles = this.getCompositionStyle(componentName, composition, s);
|
|
396
412
|
styles.push.apply(styles, __spreadArray([], __read(compositionStyles), false));
|
|
397
413
|
}
|
|
398
|
-
|
|
399
|
-
if (isResponsive) {
|
|
414
|
+
else if (isResponsive) {
|
|
400
415
|
var responsiveStyles = this.getResponsiveStyle(componentName, responsiveStyleKey, s);
|
|
401
416
|
styles.push(responsiveStyles);
|
|
402
417
|
delete s[responsiveStyleKey];
|
|
403
418
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
var computedVariantStyle = this.computeVariantStyle(componentName, variants);
|
|
408
|
-
styles.push(computedVariantStyle);
|
|
419
|
+
else {
|
|
420
|
+
styles.push((_d = {}, _d[rootElement] = s, _d));
|
|
421
|
+
}
|
|
409
422
|
}
|
|
410
423
|
idx++;
|
|
411
424
|
}
|
|
@@ -430,10 +443,11 @@ var CodeleapStyleRegistry = /** @class */ (function () {
|
|
|
430
443
|
var commonVariants = (0, deepmerge_1.default)({ all: true })(defaultVariants_1.defaultVariants, appVariants, dynamicVariants_1.dynamicVariants, spacingVariants, insetVariants);
|
|
431
444
|
this.commonVariants = commonVariants;
|
|
432
445
|
};
|
|
433
|
-
CodeleapStyleRegistry.prototype.registerVariants = function (componentName, variants) {
|
|
446
|
+
CodeleapStyleRegistry.prototype.registerVariants = function (componentName, variants, aggregator) {
|
|
434
447
|
if (this.stylesheets[componentName]) {
|
|
435
448
|
throw new Error("Variants for ".concat(componentName, " already registered"));
|
|
436
449
|
}
|
|
450
|
+
this.aggregators[componentName] = aggregator;
|
|
437
451
|
this.stylesheets[componentName] = minifier_1.minifier.compress(variants);
|
|
438
452
|
};
|
|
439
453
|
CodeleapStyleRegistry.prototype.registerComponent = function (component) {
|
package/dist/types/style.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { DynamicVariants } from '../lib/dynamicVariants';
|
|
2
2
|
import { DefaultVariants } from '../lib/defaultVariants';
|
|
3
|
-
import { AnyRecord, IAppVariants, IBreakpoints, ICSS, IEffects } from './core';
|
|
3
|
+
import { AnyRecord, IAppVariants, IBreakpoints, ICSS, IEffects, ITheme } from './core';
|
|
4
4
|
import { Multiplier, Spacing } from './spacing';
|
|
5
5
|
type Inset = `top:${Multiplier}` | `bottom:${Multiplier}` | `left:${Multiplier}` | `right:${Multiplier}`;
|
|
6
6
|
export type CommonVariants = Spacing | Inset | DynamicVariants | keyof DefaultVariants | keyof IAppVariants | `effect:${keyof IEffects}`;
|
|
7
7
|
type StyleAtom<Composition = AnyRecord, Variants = string, HasBreakpoints = string, HasComposition = string> = ICSS | Variants | CommonVariants | boolean | null | '' | (HasBreakpoints extends string ? {
|
|
8
8
|
'breakpoints': Partial<Record<keyof IBreakpoints, StyleAtom<Composition, Variants, boolean, string> | StyleAtom<Composition, Variants, boolean, string>[]>>;
|
|
9
|
-
} : null) | (HasComposition extends string ? Partial<Record<keyof Composition, StyleAtom<AnyRecord, Variants, boolean, boolean> | StyleAtom<AnyRecord, Variants, boolean, boolean>[]>> : null);
|
|
9
|
+
} : null) | (HasComposition extends string ? Partial<Record<keyof Composition, StyleAtom<AnyRecord, Variants, boolean, boolean> | StyleAtom<AnyRecord, Variants, boolean, boolean>[]>> : null) | StyleAtom<Composition, Variants, string, string>[];
|
|
10
10
|
export type StyleProp<Composition = AnyRecord, Variants = string> = StyleAtom<Composition, Variants> | StyleAtom<Composition, Variants>[];
|
|
11
11
|
export type VariantStyleSheet = Record<string, any>;
|
|
12
12
|
export type StyledProp<T extends string> = StyleProp<Record<T, ICSS>>;
|
|
13
|
+
export type StyleAggregator<T extends string = any> = (theme: ITheme, style: Record<T, ICSS>) => Record<T, ICSS>;
|
|
13
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/styles",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"directory": "packages/styles"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@codeleap/config": "4.2.
|
|
13
|
+
"@codeleap/config": "4.2.2",
|
|
14
14
|
"ts-node-dev": "1.1.8"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
package/package.json.bak
CHANGED
package/src/lib/StyleCache.ts
CHANGED
|
@@ -9,11 +9,15 @@ export class StyleCache {
|
|
|
9
9
|
baseKey: string
|
|
10
10
|
|
|
11
11
|
styles = new Cache('styles')
|
|
12
|
+
|
|
12
13
|
compositions = new Cache('compositions')
|
|
14
|
+
|
|
13
15
|
responsive = new Cache('responsive')
|
|
14
16
|
|
|
15
17
|
variants: Cache
|
|
18
|
+
|
|
16
19
|
common: Cache
|
|
20
|
+
|
|
17
21
|
components: Cache
|
|
18
22
|
|
|
19
23
|
constructor(storage: StateStorage) {
|
|
@@ -44,7 +48,15 @@ export class StyleCache {
|
|
|
44
48
|
keyFor(type: CacheType, keyData: Array<any> | any) {
|
|
45
49
|
const cache = this[type]
|
|
46
50
|
|
|
47
|
-
const
|
|
51
|
+
const withFunctionsHash = Object.values(keyData).map((value) => {
|
|
52
|
+
if (typeof value === 'function') {
|
|
53
|
+
return value.toString()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return value
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const values = [this.baseKey, ...withFunctionsHash]
|
|
48
60
|
|
|
49
61
|
const cacheKey = hashKey(values)
|
|
50
62
|
const cachedValue = minifier.decompress(cache.cache[cacheKey] ?? null)
|
package/src/lib/StyleRegistry.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable dot-notation */
|
|
2
|
-
import { AnyRecord, AnyStyledComponent, ICSS, ITheme, StyleProp, VariantStyleSheet } from '../types'
|
|
2
|
+
import { AnyRecord, AnyStyledComponent, ICSS, ITheme, StyleAggregator, StyleProp, VariantStyleSheet } from '../types'
|
|
3
3
|
import { ThemeStore, themeStore } from './themeStore'
|
|
4
4
|
import deepmerge from '@fastify/deepmerge'
|
|
5
5
|
import { MultiplierFunction } from './spacing'
|
|
@@ -15,6 +15,8 @@ export class CodeleapStyleRegistry {
|
|
|
15
15
|
|
|
16
16
|
commonVariants: Record<string, ICSS | MultiplierFunction> = {}
|
|
17
17
|
|
|
18
|
+
aggregators: Record<string, StyleAggregator> = {}
|
|
19
|
+
|
|
18
20
|
components: Record<string, AnyStyledComponent> = {}
|
|
19
21
|
|
|
20
22
|
private theme: ThemeStore
|
|
@@ -91,8 +93,9 @@ export class CodeleapStyleRegistry {
|
|
|
91
93
|
const component = _component ?? rootElement
|
|
92
94
|
|
|
93
95
|
const stylesheet = minifier.decompress(this.stylesheets[componentName])
|
|
96
|
+
const aggregator = this.aggregators[componentName]
|
|
94
97
|
|
|
95
|
-
const cache = this.styleCache.keyFor('variants', { componentName, component, stylesheet, variants })
|
|
98
|
+
const cache = this.styleCache.keyFor('variants', { componentName, component, stylesheet, variants, aggregator })
|
|
96
99
|
|
|
97
100
|
if (!!cache.value) {
|
|
98
101
|
return cache.value
|
|
@@ -102,6 +105,7 @@ export class CodeleapStyleRegistry {
|
|
|
102
105
|
|
|
103
106
|
const variantStyles = variants.map((variant) => {
|
|
104
107
|
if (!!stylesheet[variant]) {
|
|
108
|
+
|
|
105
109
|
return stylesheet[variant]
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -122,7 +126,11 @@ export class CodeleapStyleRegistry {
|
|
|
122
126
|
return this.computeCommonVariantStyle(componentName, variant, component)
|
|
123
127
|
}).filter(variantStyle => !!variantStyle)
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
let variantStyle = deepmerge({ all: true })(...variantStyles)
|
|
130
|
+
|
|
131
|
+
if (!!aggregator) {
|
|
132
|
+
variantStyle = aggregator(theme, variantStyle)
|
|
133
|
+
}
|
|
126
134
|
|
|
127
135
|
this.styleCache.cacheFor('variants', cache.key, variantStyle)
|
|
128
136
|
|
|
@@ -402,40 +410,50 @@ export class CodeleapStyleRegistry {
|
|
|
402
410
|
if (isStyleArray) {
|
|
403
411
|
const filteredStyle = (style as Array<any>)?.filter(s => !!s)
|
|
404
412
|
|
|
405
|
-
|
|
413
|
+
let variants: string[] = []
|
|
406
414
|
const styles: ICSS[] = [defaultStyle]
|
|
407
415
|
let idx = 0
|
|
408
416
|
|
|
409
417
|
for (const s of filteredStyle) {
|
|
418
|
+
|
|
410
419
|
if (typeof s === 'string') {
|
|
420
|
+
|
|
411
421
|
variants.push(s)
|
|
412
422
|
}
|
|
413
423
|
|
|
414
|
-
|
|
415
|
-
const { isComposition, composition } = this.isCompositionStyle(registeredComponent, s)
|
|
424
|
+
const isObj = typeof s === 'object'
|
|
416
425
|
|
|
417
|
-
|
|
418
|
-
|
|
426
|
+
if (variants.length > 0 && (idx === filteredStyle.length - 1 || isObj)) {
|
|
427
|
+
const computedVariantStyle = this.computeVariantStyle(componentName, variants)
|
|
419
428
|
|
|
420
|
-
|
|
421
|
-
}
|
|
429
|
+
styles.push(computedVariantStyle)
|
|
422
430
|
|
|
431
|
+
variants = []
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (isObj) {
|
|
435
|
+
const { isComposition, composition } = this.isCompositionStyle(registeredComponent, s)
|
|
423
436
|
const { isResponsive, responsiveStyleKey } = this.isResponsiveStyle(s)
|
|
424
437
|
|
|
425
|
-
if (
|
|
438
|
+
if (Array.isArray(s)) {
|
|
439
|
+
const styleComposition = this.styleFor(componentName, s, false)
|
|
440
|
+
|
|
441
|
+
styles.push(styleComposition)
|
|
442
|
+
} else if (isComposition) {
|
|
443
|
+
const compositionStyles = this.getCompositionStyle(componentName, composition, s)
|
|
444
|
+
|
|
445
|
+
styles.push(...compositionStyles)
|
|
446
|
+
} else if (isResponsive) {
|
|
426
447
|
const responsiveStyles = this.getResponsiveStyle(componentName, responsiveStyleKey, s)
|
|
427
448
|
|
|
428
449
|
styles.push(responsiveStyles)
|
|
429
450
|
|
|
430
451
|
delete s[responsiveStyleKey]
|
|
431
|
-
}
|
|
452
|
+
} else {
|
|
432
453
|
|
|
433
|
-
|
|
434
|
-
|
|
454
|
+
styles.push({ [rootElement]: s })
|
|
455
|
+
}
|
|
435
456
|
|
|
436
|
-
if (idx === filteredStyle.length - 1 && variants.length > 0) {
|
|
437
|
-
const computedVariantStyle = this.computeVariantStyle(componentName, variants)
|
|
438
|
-
styles.push(computedVariantStyle)
|
|
439
457
|
}
|
|
440
458
|
|
|
441
459
|
idx++
|
|
@@ -467,10 +485,11 @@ export class CodeleapStyleRegistry {
|
|
|
467
485
|
this.commonVariants = commonVariants
|
|
468
486
|
}
|
|
469
487
|
|
|
470
|
-
registerVariants(componentName: string, variants: VariantStyleSheet) {
|
|
488
|
+
registerVariants<Composition extends string = any>(componentName: string, variants: VariantStyleSheet, aggregator?: StyleAggregator<Composition>) {
|
|
471
489
|
if (this.stylesheets[componentName]) {
|
|
472
490
|
throw new Error(`Variants for ${componentName} already registered`)
|
|
473
491
|
}
|
|
492
|
+
this.aggregators[componentName] = aggregator
|
|
474
493
|
|
|
475
494
|
this.stylesheets[componentName] = minifier.compress(variants)
|
|
476
495
|
}
|
|
@@ -507,7 +526,7 @@ export class CodeleapStyleRegistry {
|
|
|
507
526
|
if (Array.isArray(style)) {
|
|
508
527
|
copiedStyle = [...style]
|
|
509
528
|
} else if (typeof style == 'object') {
|
|
510
|
-
copiedStyle = {...style}
|
|
529
|
+
copiedStyle = { ...style }
|
|
511
530
|
} else {
|
|
512
531
|
copiedStyle = style
|
|
513
532
|
}
|
package/src/types/style.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicVariants } from '../lib/dynamicVariants'
|
|
2
2
|
import { Queries } from '../lib/mediaQuery'
|
|
3
3
|
import { DefaultVariants } from '../lib/defaultVariants'
|
|
4
|
-
import { AnyRecord, IAppVariants, IBreakpoints, ICSS, IEffects } from './core'
|
|
4
|
+
import { AnyRecord, IAppVariants, IBreakpoints, ICSS, IEffects, ITheme } from './core'
|
|
5
5
|
import { Multiplier, Spacing } from './spacing'
|
|
6
6
|
|
|
7
7
|
type Inset =
|
|
@@ -25,11 +25,23 @@ type StyleAtom<Composition = AnyRecord, Variants = string, HasBreakpoints = stri
|
|
|
25
25
|
boolean |
|
|
26
26
|
null |
|
|
27
27
|
'' |
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
(HasBreakpoints extends string ? {
|
|
30
|
-
'breakpoints': Partial<
|
|
30
|
+
'breakpoints': Partial<
|
|
31
|
+
Record<keyof IBreakpoints,
|
|
32
|
+
StyleAtom<Composition, Variants, boolean, string> |
|
|
33
|
+
StyleAtom<Composition, Variants, boolean, string>[]>
|
|
34
|
+
>
|
|
31
35
|
} : null) |
|
|
32
|
-
(HasComposition extends string ?
|
|
36
|
+
(HasComposition extends string ?
|
|
37
|
+
Partial<Record<
|
|
38
|
+
keyof Composition,
|
|
39
|
+
StyleAtom<AnyRecord, Variants, boolean, boolean> |
|
|
40
|
+
StyleAtom<AnyRecord, Variants, boolean, boolean>[]
|
|
41
|
+
>>
|
|
42
|
+
: null
|
|
43
|
+
)
|
|
44
|
+
| StyleAtom<Composition, Variants, string, string>[]
|
|
33
45
|
|
|
34
46
|
export type StyleProp<
|
|
35
47
|
Composition = AnyRecord,
|
|
@@ -39,3 +51,5 @@ export type StyleProp<
|
|
|
39
51
|
export type VariantStyleSheet = Record<string, any>
|
|
40
52
|
|
|
41
53
|
export type StyledProp<T extends string> = StyleProp<Record<T, ICSS>>
|
|
54
|
+
|
|
55
|
+
export type StyleAggregator<T extends string = any> = (theme: ITheme, style: Record< T, ICSS>) => Record< T, ICSS>
|