@codeleap/styles 7.0.0 → 7.0.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/classes/Cacher.js +170 -0
- package/dist/classes/Cacher.js.map +1 -0
- package/dist/classes/StaleControl.js +105 -0
- package/dist/classes/StaleControl.js.map +1 -0
- package/dist/classes/StyleCache.js +95 -0
- package/dist/classes/StyleCache.js.map +1 -0
- package/dist/classes/StylePersistor.js +58 -0
- package/dist/classes/StylePersistor.js.map +1 -0
- package/dist/classes/StyleRegistry.js +474 -0
- package/dist/classes/StyleRegistry.js.map +1 -0
- package/dist/classes/index.js +19 -0
- package/dist/classes/index.js.map +1 -0
- package/dist/constants.js +27 -0
- package/dist/constants.js.map +1 -0
- package/dist/hooks/index.js +21 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useCompositionStyles.js +30 -0
- package/dist/hooks/useCompositionStyles.js.map +1 -0
- package/dist/hooks/useNestedStylesByKey.js +20 -0
- package/dist/hooks/useNestedStylesByKey.js.map +1 -0
- package/dist/hooks/useStyleObserver.js +26 -0
- package/dist/hooks/useStyleObserver.js.map +1 -0
- package/dist/hooks/useTheme.js +28 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/calc.js +48 -0
- package/dist/lib/calc.js.map +1 -0
- package/dist/lib/createStyles.js +63 -0
- package/dist/lib/createStyles.js.map +1 -0
- package/dist/lib/createTheme.js +147 -0
- package/dist/lib/createTheme.js.map +1 -0
- package/dist/lib/cssVariables.js +79 -0
- package/dist/lib/cssVariables.js.map +1 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/theme/generateColorScheme.js +41 -0
- package/dist/theme/generateColorScheme.js.map +1 -0
- package/dist/theme/index.js +20 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/themeStore.d.ts +4 -4
- package/dist/theme/themeStore.d.ts.map +1 -1
- package/dist/theme/themeStore.js +143 -0
- package/dist/theme/themeStore.js.map +1 -0
- package/dist/theme/validateTheme.js +36 -0
- package/dist/theme/validateTheme.js.map +1 -0
- package/dist/tools/colors.js +147 -0
- package/dist/tools/colors.js.map +1 -0
- package/dist/tools/deepClone.js +14 -0
- package/dist/tools/deepClone.js.map +1 -0
- package/dist/tools/deepmerge.js +20 -0
- package/dist/tools/deepmerge.js.map +1 -0
- package/dist/tools/hashKey.js +20 -0
- package/dist/tools/hashKey.js.map +1 -0
- package/dist/tools/index.js +46 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/minifier.js +39 -0
- package/dist/tools/minifier.js.map +1 -0
- package/dist/tools/multiplierProperty.js +12 -0
- package/dist/tools/multiplierProperty.js.map +1 -0
- package/dist/types/cache.js +3 -0
- package/dist/types/cache.js.map +1 -0
- package/dist/types/component.js +3 -0
- package/dist/types/component.js.map +1 -0
- package/dist/types/core.js +4 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/icon.js +4 -0
- package/dist/types/icon.js.map +1 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/spacing.js +31 -0
- package/dist/types/spacing.js.map +1 -0
- package/dist/types/store.js +3 -0
- package/dist/types/store.js.map +1 -0
- package/dist/types/style.js +3 -0
- package/dist/types/style.js.map +1 -0
- package/dist/types/theme.js +3 -0
- package/dist/types/theme.js.map +1 -0
- package/dist/utils.js +105 -0
- package/dist/utils.js.map +1 -0
- package/dist/variants/borderCreator.js +30 -0
- package/dist/variants/borderCreator.js.map +1 -0
- package/dist/variants/createAppVariants.js +20 -0
- package/dist/variants/createAppVariants.js.map +1 -0
- package/dist/variants/defaultVariants.js +140 -0
- package/dist/variants/defaultVariants.js.map +1 -0
- package/dist/variants/dynamicVariants.js +93 -0
- package/dist/variants/dynamicVariants.js.map +1 -0
- package/dist/variants/index.js +23 -0
- package/dist/variants/index.js.map +1 -0
- package/dist/variants/mediaQuery.js +59 -0
- package/dist/variants/mediaQuery.js.map +1 -0
- package/dist/variants/spacing.js +84 -0
- package/dist/variants/spacing.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyleObserver = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Produces a stable string that changes only when the style value changes, suitable
|
|
7
|
+
* for use as a `useEffect`/`useMemo` dependency when the style prop is an object or
|
|
8
|
+
* array (which would otherwise trigger on every render due to referential inequality).
|
|
9
|
+
* Falsy entries are stripped from arrays before serialisation, so `[null, style]` and
|
|
10
|
+
* `[style]` yield the same string.
|
|
11
|
+
*/
|
|
12
|
+
const useStyleObserver = (style) => {
|
|
13
|
+
return (0, react_1.useMemo)(() => {
|
|
14
|
+
if (Array.isArray(style)) {
|
|
15
|
+
return JSON.stringify(style === null || style === void 0 ? void 0 : style.filter(v => !!v));
|
|
16
|
+
}
|
|
17
|
+
else if (typeof style === 'object') {
|
|
18
|
+
return JSON.stringify(style);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return style;
|
|
22
|
+
}
|
|
23
|
+
}, [style]);
|
|
24
|
+
};
|
|
25
|
+
exports.useStyleObserver = useStyleObserver;
|
|
26
|
+
//# sourceMappingURL=useStyleObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStyleObserver.js","sourceRoot":"","sources":["../../src/hooks/useStyleObserver.ts"],"names":[],"mappings":";;;AAAA,iCAA+B;AAE/B;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAU,EAAE,EAAE;IAC7C,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAChD,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAC,CAAC;YACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAC9B,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AACb,CAAC,CAAA;AAVY,QAAA,gBAAgB,oBAU5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTheme = void 0;
|
|
4
|
+
const theme_1 = require("../theme");
|
|
5
|
+
const react_1 = require("@nanostores/react");
|
|
6
|
+
/**
|
|
7
|
+
* Subscribes to the global theme state and returns either the full `ThemeState`
|
|
8
|
+
* (when called without arguments) or a derived value (when called with a selector).
|
|
9
|
+
* Uses nanostores' `useStore` under the hood, so re-renders are triggered only when
|
|
10
|
+
* the selected slice changes by reference.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Full state
|
|
14
|
+
* const { theme, colorScheme } = useTheme()
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Derived slice — component only re-renders when colorScheme changes
|
|
18
|
+
* const colorScheme = useTheme(s => s.colorScheme)
|
|
19
|
+
*/
|
|
20
|
+
const useTheme = (selector) => {
|
|
21
|
+
const state = (0, react_1.useStore)(theme_1.themeStoreComputed);
|
|
22
|
+
if (!selector) {
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
return selector(state);
|
|
26
|
+
};
|
|
27
|
+
exports.useTheme = useTheme;
|
|
28
|
+
//# sourceMappingURL=useTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":";;;AAAA,oCAAyD;AACzD,6CAA4C;AAI5C;;;;;;;;;;;;;GAaG;AACI,MAAM,QAAQ,GAAG,CACtB,QAA2B,EACxB,EAAE;IACL,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,0BAAkB,CAAC,CAAA;IAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAU,CAAA;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC,CAAA;AAVY,QAAA,QAAQ,YAUpB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("./constants");
|
|
18
|
+
require("./utils");
|
|
19
|
+
__exportStar(require("./classes"), exports);
|
|
20
|
+
__exportStar(require("./hooks"), exports);
|
|
21
|
+
__exportStar(require("./lib"), exports);
|
|
22
|
+
__exportStar(require("./theme"), exports);
|
|
23
|
+
__exportStar(require("./tools"), exports);
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
25
|
+
__exportStar(require("./variants"), exports);
|
|
26
|
+
__exportStar(require("./constants"), exports);
|
|
27
|
+
__exportStar(require("./utils"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uBAAoB;AACpB,mBAAgB;AAEhB,4CAAyB;AACzB,0CAAuB;AACvB,wCAAqB;AACrB,0CAAuB;AACvB,0CAAuB;AACvB,0CAAuB;AACvB,6CAA0B;AAC1B,8CAA2B;AAC3B,0CAAuB"}
|
package/dist/lib/calc.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calc = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Chainable builder for CSS `calc()` expressions. Each arithmetic method appends
|
|
6
|
+
* to the expression and returns `this`, so calls can be chained. Call `build()`
|
|
7
|
+
* at the end to get the final `calc(...)` string.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* calc(100, '%').sub(16).build() // → 'calc((100%) - (16px))'
|
|
11
|
+
*/
|
|
12
|
+
class CalcBuilder {
|
|
13
|
+
constructor(initial, unit = 'px') {
|
|
14
|
+
this.expression = `${initial}${unit}`;
|
|
15
|
+
}
|
|
16
|
+
wrap(value) {
|
|
17
|
+
return `(${value})`;
|
|
18
|
+
}
|
|
19
|
+
sub(value, unit = 'px') {
|
|
20
|
+
const val = `${value}${unit}`;
|
|
21
|
+
this.expression = `${this.wrap(this.expression)} - ${this.wrap(val)}`;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
add(value, unit = 'px') {
|
|
25
|
+
const val = `${value}${unit}`;
|
|
26
|
+
this.expression = `${this.wrap(this.expression)} + ${this.wrap(val)}`;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
mult(value) {
|
|
30
|
+
this.expression = `${this.wrap(this.expression)} * ${value}`;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
div(value) {
|
|
34
|
+
this.expression = `${this.wrap(this.expression)} / ${value}`;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
build() {
|
|
38
|
+
return `calc(${this.expression})`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Entry point for building CSS `calc()` expressions. Pass an initial numeric value
|
|
43
|
+
* and optional unit (default `'px'`), then chain `.add()`, `.sub()`, `.mult()`, `.div()`,
|
|
44
|
+
* and finally call `.build()` to get the complete string.
|
|
45
|
+
*/
|
|
46
|
+
const calc = (base, unit = 'px') => new CalcBuilder(base, unit);
|
|
47
|
+
exports.calc = calc;
|
|
48
|
+
//# sourceMappingURL=calc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc.js","sourceRoot":"","sources":["../../src/lib/calc.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,MAAM,WAAW;IAGf,YAAY,OAAe,EAAE,OAAa,IAAI;QAC5C,IAAI,CAAC,UAAU,GAAG,GAAG,OAAO,GAAG,IAAI,EAAE,CAAA;IACvC,CAAC;IAEO,IAAI,CAAC,KAAa;QACxB,OAAO,IAAI,KAAK,GAAG,CAAA;IACrB,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,OAAa,IAAI;QAClC,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,EAAE,CAAA;QAC7B,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;QACrE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,OAAa,IAAI;QAClC,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,EAAE,CAAA;QAC7B,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;QACrE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,EAAE,CAAA;QAC5D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,GAAG,CAAC,KAAa;QACf,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,EAAE,CAAA;QAC5D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,OAAO,QAAQ,IAAI,CAAC,UAAU,GAAG,CAAA;IACnC,CAAC;CACF;AAED;;;;GAIG;AACI,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,OAAa,IAAI,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAAvE,QAAA,IAAI,QAAmE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTEXT_FACTORY_SYMBOL = void 0;
|
|
4
|
+
exports.createStyles = createStyles;
|
|
5
|
+
exports.createStylesWithContext = createStylesWithContext;
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
/**
|
|
8
|
+
* Symbol used to attach a context-aware factory function to a styles proxy.
|
|
9
|
+
* `CodeleapStyleRegistry.registerVariants` reads this symbol from each entry to
|
|
10
|
+
* identify which variants require a `ComponentContext` at resolution time.
|
|
11
|
+
* Not intended for direct use by consumers.
|
|
12
|
+
*/
|
|
13
|
+
exports.CONTEXT_FACTORY_SYMBOL = Symbol('contextFactory');
|
|
14
|
+
/**
|
|
15
|
+
* Creates a reactive styles object that automatically updates when theme changes.
|
|
16
|
+
* Uses a proxy to re-compute styles on each access, ensuring theme changes are reflected.
|
|
17
|
+
*
|
|
18
|
+
* @template K - Style keys (extends string)
|
|
19
|
+
* @template V - Additional value type (extends AnyRecord)
|
|
20
|
+
* @param {StylesShape<K, V> | ((theme: ITheme) => StylesShape<K, V>)} styles - Static styles object or function that receives theme
|
|
21
|
+
* @returns {StylesShape<K, V>} Proxied styles object that recomputes on theme changes
|
|
22
|
+
*/
|
|
23
|
+
function createStyles(styles) {
|
|
24
|
+
const compute = () => {
|
|
25
|
+
const current = theme_1.themeStore.theme;
|
|
26
|
+
if (typeof styles === 'function') {
|
|
27
|
+
return !current ? {} : styles(current);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return styles;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
// We use a proxy here so that the color scheme is recomputed every time the
|
|
34
|
+
// theme changes. This is necessary because the theme is a singleton which does not cause
|
|
35
|
+
// a re-render when it changes. The end-user will only have to worry about remounting the root component
|
|
36
|
+
// when the theme changes in order to get the new color scheme due to this proxy.
|
|
37
|
+
return new Proxy(compute(), {
|
|
38
|
+
get(target, prop) {
|
|
39
|
+
return compute()[prop];
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Like `createStyles`, but the factory also receives a `ComponentContext` so that
|
|
45
|
+
* individual style values can vary based on runtime boolean/numeric state (e.g.,
|
|
46
|
+
* `isDisabled`, `isSelected`). The resulting proxy exposes a `CONTEXT_FACTORY_SYMBOL`
|
|
47
|
+
* getter so the registry can invoke the factory with the actual context at render time.
|
|
48
|
+
* Use this instead of `createStyles` when variant styles depend on component state.
|
|
49
|
+
*/
|
|
50
|
+
function createStylesWithContext(styles) {
|
|
51
|
+
const compute = (context = {}) => {
|
|
52
|
+
const current = theme_1.themeStore.theme;
|
|
53
|
+
return !current ? {} : styles(current, context);
|
|
54
|
+
};
|
|
55
|
+
return new Proxy(compute(), {
|
|
56
|
+
get(target, prop) {
|
|
57
|
+
if (prop === exports.CONTEXT_FACTORY_SYMBOL)
|
|
58
|
+
return styles;
|
|
59
|
+
return compute()[prop];
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=createStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStyles.js","sourceRoot":"","sources":["../../src/lib/createStyles.ts"],"names":[],"mappings":";;;AAwBA,oCAsBC;AASD,0DAcC;AApED,oCAAqC;AAMrC;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;AAE9D;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,MAAkE;IAElE,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,kBAAU,CAAC,KAAK,CAAA;QAEhC,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;YACjC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAuB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC7D,CAAC;aAAM,CAAC;YACN,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC,CAAA;IAED,4EAA4E;IAC5E,yFAAyF;IACzF,wGAAwG;IACxG,iFAAiF;IACjF,OAAO,IAAI,KAAK,CAAC,OAAO,EAAuB,EAAE;QAC/C,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,OAAQ,OAAO,EAA0B,CAAC,IAAc,CAAC,CAAA;QAC3D,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,MAAwD;IAExD,MAAM,OAAO,GAAG,CAAC,UAAa,EAAO,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,kBAAU,CAAC,KAAK,CAAA;QAChC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAuB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACtE,CAAC,CAAA;IAED,OAAO,IAAI,KAAK,CAAC,OAAO,EAAuB,EAAE;QAC/C,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,IAAI,IAAI,KAAK,8BAAsB;gBAAE,OAAO,MAAM,CAAA;YAClD,OAAQ,OAAO,EAA0B,CAAC,IAAc,CAAC,CAAA;QAC3D,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.createTheme = void 0;
|
|
15
|
+
const variants_1 = require("../variants");
|
|
16
|
+
const tools_1 = require("../tools");
|
|
17
|
+
const theme_1 = require("../theme");
|
|
18
|
+
const cssVariables_1 = require("./cssVariables");
|
|
19
|
+
const colorSchemeKey = '@styles.theme.colorScheme';
|
|
20
|
+
const alternateColorsKey = '@styles.theme.alternateColors';
|
|
21
|
+
/**
|
|
22
|
+
* Builds and registers the runtime `AppTheme<T>` object from a raw `Theme` definition.
|
|
23
|
+
*
|
|
24
|
+
* Key behaviours:
|
|
25
|
+
* - On web (`theme.isBrowser = true`), `theme.colors` is replaced with a CSS-var proxy
|
|
26
|
+
* so all color references become `var(--cl-<token>)` strings. The active scheme's
|
|
27
|
+
* real values are still accessible via `theme.currentSchemeColors`.
|
|
28
|
+
* - Persists the selected color scheme to storage and restores it on next load.
|
|
29
|
+
* Falls back to `getSystemColorScheme()` if no persisted value exists.
|
|
30
|
+
* - `alternateColors` from storage are merged with those in the theme definition
|
|
31
|
+
* (runtime-injected schemes take priority).
|
|
32
|
+
* - The constructed theme is immediately set on `themeStore` so hooks and the registry
|
|
33
|
+
* can read it synchronously during the same render pass.
|
|
34
|
+
*
|
|
35
|
+
* @param theme - Raw theme object (output of `validateTheme` or a compliant literal).
|
|
36
|
+
* @param themePersistor - Storage adapter for persisting color-scheme selection and injected schemes.
|
|
37
|
+
*/
|
|
38
|
+
const createTheme = (theme, themePersistor) => {
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
|
+
const { colors, breakpoints, presets, radius, stroke, size, effects, typography, icons, baseColors, values } = theme, otherThemeValues = __rest(theme, ["colors", "breakpoints", "presets", "radius", "stroke", "size", "effects", "typography", "icons", "baseColors", "values"]);
|
|
41
|
+
const persistor = {
|
|
42
|
+
get: (key) => {
|
|
43
|
+
const value = themePersistor.get(key);
|
|
44
|
+
if (!value)
|
|
45
|
+
return null;
|
|
46
|
+
return tools_1.minifier.decompress(value);
|
|
47
|
+
},
|
|
48
|
+
set: (key, value) => {
|
|
49
|
+
return themePersistor.set(key, !value ? '' : tools_1.minifier.compress(value));
|
|
50
|
+
},
|
|
51
|
+
getNoCompress: (key) => {
|
|
52
|
+
if (themePersistor.getNoCompress)
|
|
53
|
+
return themePersistor.getNoCompress(key);
|
|
54
|
+
if (typeof localStorage !== 'undefined')
|
|
55
|
+
return localStorage.getItem(key);
|
|
56
|
+
return null;
|
|
57
|
+
},
|
|
58
|
+
setNoCompress: (key, value) => {
|
|
59
|
+
if (themePersistor.setNoCompress)
|
|
60
|
+
return themePersistor.setNoCompress(key, value);
|
|
61
|
+
if (typeof localStorage !== 'undefined')
|
|
62
|
+
localStorage.setItem(key, value);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
theme_1.themeStore.setColorScheme((_c = (_a = persistor.get(colorSchemeKey)) !== null && _a !== void 0 ? _a : (_b = themePersistor.getSystemColorScheme) === null || _b === void 0 ? void 0 : _b.call(themePersistor)) !== null && _c !== void 0 ? _c : 'default');
|
|
66
|
+
const persistedAlternateColors = persistor.get(alternateColorsKey);
|
|
67
|
+
const alternateColors = Object.assign(Object.assign({}, (persistedAlternateColors !== null && persistedAlternateColors !== void 0 ? persistedAlternateColors : {})), otherThemeValues === null || otherThemeValues === void 0 ? void 0 : otherThemeValues.alternateColors);
|
|
68
|
+
theme_1.themeStore.setAlternateColorsScheme(alternateColors);
|
|
69
|
+
// On web: build CSS var proxy once — theme.colors returns var(--cl-X) strings.
|
|
70
|
+
// On RN (isBrowser falsy): keep raw RGBA values as before.
|
|
71
|
+
const cssVarColors = theme.isBrowser ? (0, cssVariables_1.buildCssVarProxy)(colors) : colors;
|
|
72
|
+
// Apply persisted scheme to DOM immediately (browser-only, no-op on server/RN)
|
|
73
|
+
(0, cssVariables_1.applyColorSchemeToDOM)((_d = persistor.getNoCompress(cssVariables_1.DOM_COLOR_SCHEME_KEY)) !== null && _d !== void 0 ? _d : 'default');
|
|
74
|
+
const baseSpacing = (_e = theme.baseSpacing) !== null && _e !== void 0 ? _e : 1;
|
|
75
|
+
const themeObj = Object.assign(Object.assign({}, otherThemeValues), { get alternateColors() {
|
|
76
|
+
return theme_1.themeStore.alternateColorsScheme;
|
|
77
|
+
},
|
|
78
|
+
baseColors,
|
|
79
|
+
currentColorScheme() {
|
|
80
|
+
return theme_1.themeStore.colorScheme;
|
|
81
|
+
}, breakpoints: breakpoints !== null && breakpoints !== void 0 ? breakpoints : {},
|
|
82
|
+
// On web: var(--cl-X) strings — browser CSS handles color switching.
|
|
83
|
+
// On RN: raw RGBA values, scheme-reactive as before.
|
|
84
|
+
colors: cssVarColors,
|
|
85
|
+
// Always the active scheme's real RGBA values — use when you need the actual color in JS.
|
|
86
|
+
get currentSchemeColors() {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
const colorScheme = (_a = theme_1.themeStore.colorScheme) !== null && _a !== void 0 ? _a : 'default';
|
|
89
|
+
if (colorScheme === 'default')
|
|
90
|
+
return colors;
|
|
91
|
+
const scheme = (_b = theme_1.themeStore.alternateColorsScheme) === null || _b === void 0 ? void 0 : _b[colorScheme];
|
|
92
|
+
if (!scheme) {
|
|
93
|
+
console.warn(`Color scheme ${colorScheme} not found in theme`);
|
|
94
|
+
}
|
|
95
|
+
return (scheme !== null && scheme !== void 0 ? scheme : colors);
|
|
96
|
+
},
|
|
97
|
+
getCssVariables(schemeName) {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
const map = !schemeName || schemeName === 'default'
|
|
100
|
+
? colors
|
|
101
|
+
: (_b = (_a = theme_1.themeStore.alternateColorsScheme) === null || _a === void 0 ? void 0 : _a[schemeName]) !== null && _b !== void 0 ? _b : colors;
|
|
102
|
+
return (0, cssVariables_1.flattenColorMap)(map);
|
|
103
|
+
},
|
|
104
|
+
setColorScheme(colorScheme) {
|
|
105
|
+
var _a;
|
|
106
|
+
const hasScheme = colorScheme === 'default' ? true : !!((_a = theme_1.themeStore.alternateColorsScheme) === null || _a === void 0 ? void 0 : _a[colorScheme]);
|
|
107
|
+
if (!hasScheme) {
|
|
108
|
+
console.warn(`Color scheme ${colorScheme} not found in theme`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
theme_1.themeStore.setColorScheme(colorScheme);
|
|
112
|
+
persistor.set(colorSchemeKey, colorScheme);
|
|
113
|
+
// Store uncompressed for the FOUC prevention script (lz can't run inline)
|
|
114
|
+
persistor.setNoCompress(cssVariables_1.DOM_COLOR_SCHEME_KEY, colorScheme);
|
|
115
|
+
(0, cssVariables_1.applyColorSchemeToDOM)(colorScheme);
|
|
116
|
+
},
|
|
117
|
+
injectColorScheme(name, colorMap) {
|
|
118
|
+
theme_1.themeStore.injectColorScheme(name, colorMap);
|
|
119
|
+
const persistedAlternateColors = persistor.get(alternateColorsKey);
|
|
120
|
+
const unpersistedAlternateColors = Object.assign(Object.assign({}, (persistedAlternateColors !== null && persistedAlternateColors !== void 0 ? persistedAlternateColors : {})), { [name]: colorMap });
|
|
121
|
+
persistor.set(alternateColorsKey, unpersistedAlternateColors);
|
|
122
|
+
},
|
|
123
|
+
ejectColorScheme(name) {
|
|
124
|
+
theme_1.themeStore.ejectColorScheme(name);
|
|
125
|
+
const persistedAlternateColors = persistor.get(alternateColorsKey);
|
|
126
|
+
if (name in persistedAlternateColors) {
|
|
127
|
+
delete persistedAlternateColors[name];
|
|
128
|
+
}
|
|
129
|
+
persistor.set(alternateColorsKey, persistedAlternateColors);
|
|
130
|
+
},
|
|
131
|
+
baseSpacing, value: (n = 1) => baseSpacing * n, spacing: Object.assign(Object.assign(Object.assign(Object.assign({ value: (n = 1) => baseSpacing * n, gap: (0, tools_1.multiplierProperty)(baseSpacing, 'gap') }, (0, variants_1.spacingFactory)(baseSpacing, 'padding')), (0, variants_1.spacingFactory)(baseSpacing, 'margin')), (0, variants_1.spacingFactory)(baseSpacing, 'p', true)), (0, variants_1.spacingFactory)(baseSpacing, 'm', true)), inset: {
|
|
132
|
+
top: (0, tools_1.multiplierProperty)(baseSpacing, 'top'),
|
|
133
|
+
bottom: (0, tools_1.multiplierProperty)(baseSpacing, 'bottom'),
|
|
134
|
+
left: (0, tools_1.multiplierProperty)(baseSpacing, 'left'),
|
|
135
|
+
right: (0, tools_1.multiplierProperty)(baseSpacing, 'right'),
|
|
136
|
+
}, presets: Object.assign(Object.assign({}, variants_1.defaultVariants), presets), radius: radius !== null && radius !== void 0 ? radius : {}, stroke: stroke !== null && stroke !== void 0 ? stroke : {}, size: size !== null && size !== void 0 ? size : {}, effects: effects !== null && effects !== void 0 ? effects : {}, media: (0, variants_1.createMediaQueries)(breakpoints), border: variants_1.borderCreator, typography: typography !== null && typography !== void 0 ? typography : {}, icons: icons, values: values !== null && values !== void 0 ? values : {}, sized: (size) => {
|
|
137
|
+
const value = typeof size == 'number' ? size * baseSpacing : size;
|
|
138
|
+
return {
|
|
139
|
+
width: value,
|
|
140
|
+
height: value,
|
|
141
|
+
};
|
|
142
|
+
} });
|
|
143
|
+
theme_1.themeStore.setTheme(themeObj);
|
|
144
|
+
return themeObj;
|
|
145
|
+
};
|
|
146
|
+
exports.createTheme = createTheme;
|
|
147
|
+
//# sourceMappingURL=createTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTheme.js","sourceRoot":"","sources":["../../src/lib/createTheme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,0CAAgG;AAChG,oCAAuD;AACvD,oCAAqC;AACrC,iDAA+G;AAU/G,MAAM,cAAc,GAAG,2BAA2B,CAAA;AAClD,MAAM,kBAAkB,GAAG,+BAA+B,CAAA;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,WAAW,GAAG,CAAkB,KAAQ,EAAE,cAA8B,EAAe,EAAE;;IACpG,MAAM,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,KAAK,EACL,UAAU,EACV,MAAM,KAEJ,KAAK,EADJ,gBAAgB,UACjB,KAAK,EAbH,0HAaL,CAAQ,CAAA;IAET,MAAM,SAAS,GAAG;QAChB,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE;YACnB,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACrC,IAAI,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAA;YACvB,OAAO,gBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QACnC,CAAC;QACD,GAAG,EAAE,CAAC,GAAW,EAAE,KAAU,EAAE,EAAE;YAC/B,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAA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KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;YACd,MAAM,KAAK,GAAG,OAAO,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;YAEjE,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,KAAK;aACd,CAAA;QACH,CAAC,GACa,CAAA;IAEhB,kBAAU,CAAC,QAAQ,CAAC,QAA6B,CAAC,CAAA;IAElD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AA7LY,QAAA,WAAW,eA6LvB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOM_COLOR_SCHEME_KEY = exports.CSS_VAR_PREFIX = void 0;
|
|
4
|
+
exports.flattenColorMap = flattenColorMap;
|
|
5
|
+
exports.buildCssVarProxy = buildCssVarProxy;
|
|
6
|
+
exports.applyColorSchemeToDOM = applyColorSchemeToDOM;
|
|
7
|
+
/**
|
|
8
|
+
* CSS custom-property prefix used for all codeleap design-token variables.
|
|
9
|
+
* Color tokens are injected as `--cl-<tokenPath>` on `:root` (or a scheme-specific
|
|
10
|
+
* `[data-color-scheme]` selector). Changing this value after tokens are injected
|
|
11
|
+
* will break existing CSS that references `var(--cl-*)`.
|
|
12
|
+
*/
|
|
13
|
+
exports.CSS_VAR_PREFIX = '--cl-';
|
|
14
|
+
/**
|
|
15
|
+
* Storage key used to persist the active color scheme name in an uncompressed format
|
|
16
|
+
* (plain string, not LZ-encoded). Stored separately so a lightweight inline script
|
|
17
|
+
* can read it before React hydrates and set `data-color-scheme` on `<html>` to prevent
|
|
18
|
+
* a flash of the wrong color scheme (FOUC).
|
|
19
|
+
*/
|
|
20
|
+
exports.DOM_COLOR_SCHEME_KEY = '@styles.dom.colorScheme';
|
|
21
|
+
/**
|
|
22
|
+
* Recursively flattens a nested color token object into a flat map of CSS custom-property
|
|
23
|
+
* names to their values. Nesting levels are joined with `-` (e.g., `{ primary: { solid: '#fff' } }`
|
|
24
|
+
* → `{ '--cl-primary-solid': '#fff' }`). Non-string leaf values are silently skipped.
|
|
25
|
+
*/
|
|
26
|
+
function flattenColorMap(obj, path = '', prefix = exports.CSS_VAR_PREFIX) {
|
|
27
|
+
const result = {};
|
|
28
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
29
|
+
const cssPath = path ? `${path}-${key}` : key;
|
|
30
|
+
if (typeof value === 'string') {
|
|
31
|
+
result[`${prefix}${cssPath}`] = value;
|
|
32
|
+
}
|
|
33
|
+
else if (value && typeof value === 'object') {
|
|
34
|
+
Object.assign(result, flattenColorMap(value, cssPath, prefix));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Recursively replaces every string leaf in `obj` with a `var(--cl-<path>)` reference,
|
|
41
|
+
* preserving the original object shape. Used on web to replace raw color values with
|
|
42
|
+
* CSS variable references so that color-scheme switching via `data-color-scheme` CSS
|
|
43
|
+
* selectors works without JavaScript re-renders.
|
|
44
|
+
*/
|
|
45
|
+
function buildCssVarProxy(obj, path = '', prefix = exports.CSS_VAR_PREFIX) {
|
|
46
|
+
if (typeof obj !== 'object' || obj === null)
|
|
47
|
+
return obj;
|
|
48
|
+
const result = {};
|
|
49
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
50
|
+
const cssPath = path ? `${path}-${key}` : key;
|
|
51
|
+
if (typeof value === 'string') {
|
|
52
|
+
result[key] = `var(${prefix}${cssPath})`;
|
|
53
|
+
}
|
|
54
|
+
else if (value && typeof value === 'object') {
|
|
55
|
+
result[key] = buildCssVarProxy(value, cssPath, prefix);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
result[key] = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Sets or removes `data-color-scheme` on `document.documentElement` to trigger the
|
|
65
|
+
* matching CSS selector that applies alternate-scheme custom-property overrides.
|
|
66
|
+
* The `'default'` scheme removes the attribute entirely so the `:root` base variables
|
|
67
|
+
* apply. No-ops on non-browser environments (SSR, React Native).
|
|
68
|
+
*/
|
|
69
|
+
function applyColorSchemeToDOM(colorScheme) {
|
|
70
|
+
if (typeof document === 'undefined')
|
|
71
|
+
return;
|
|
72
|
+
if (colorScheme === 'default') {
|
|
73
|
+
delete document.documentElement.dataset.colorScheme;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
document.documentElement.dataset.colorScheme = colorScheme;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=cssVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVariables.js","sourceRoot":"","sources":["../../src/lib/cssVariables.ts"],"names":[],"mappings":";;;AAqBA,0CAeC;AAQD,4CAcC;AAQD,sDAOC;AAzED;;;;;GAKG;AACU,QAAA,cAAc,GAAG,OAAO,CAAA;AAErC;;;;;GAKG;AACU,QAAA,oBAAoB,GAAG,yBAAyB,CAAA;AAE7D;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,GAAwB,EACxB,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,sBAAc;IAEvB,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,GAAG,KAAK,CAAA;QACvC,CAAC;aAAM,IAAI,KAAK,IAAI,OAAO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,CAAC,WAAW,CAAA;IACrD,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,GAAG,WAAW,CAAA;IAC5D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOM_COLOR_SCHEME_KEY = exports.CSS_VAR_PREFIX = exports.applyColorSchemeToDOM = exports.buildCssVarProxy = exports.flattenColorMap = exports.calc = exports.createTheme = exports.CONTEXT_FACTORY_SYMBOL = exports.createStylesWithContext = exports.createStyles = void 0;
|
|
4
|
+
var createStyles_1 = require("./createStyles");
|
|
5
|
+
Object.defineProperty(exports, "createStyles", { enumerable: true, get: function () { return createStyles_1.createStyles; } });
|
|
6
|
+
Object.defineProperty(exports, "createStylesWithContext", { enumerable: true, get: function () { return createStyles_1.createStylesWithContext; } });
|
|
7
|
+
Object.defineProperty(exports, "CONTEXT_FACTORY_SYMBOL", { enumerable: true, get: function () { return createStyles_1.CONTEXT_FACTORY_SYMBOL; } });
|
|
8
|
+
var createTheme_1 = require("./createTheme");
|
|
9
|
+
Object.defineProperty(exports, "createTheme", { enumerable: true, get: function () { return createTheme_1.createTheme; } });
|
|
10
|
+
var calc_1 = require("./calc");
|
|
11
|
+
Object.defineProperty(exports, "calc", { enumerable: true, get: function () { return calc_1.calc; } });
|
|
12
|
+
var cssVariables_1 = require("./cssVariables");
|
|
13
|
+
Object.defineProperty(exports, "flattenColorMap", { enumerable: true, get: function () { return cssVariables_1.flattenColorMap; } });
|
|
14
|
+
Object.defineProperty(exports, "buildCssVarProxy", { enumerable: true, get: function () { return cssVariables_1.buildCssVarProxy; } });
|
|
15
|
+
Object.defineProperty(exports, "applyColorSchemeToDOM", { enumerable: true, get: function () { return cssVariables_1.applyColorSchemeToDOM; } });
|
|
16
|
+
Object.defineProperty(exports, "CSS_VAR_PREFIX", { enumerable: true, get: function () { return cssVariables_1.CSS_VAR_PREFIX; } });
|
|
17
|
+
Object.defineProperty(exports, "DOM_COLOR_SCHEME_KEY", { enumerable: true, get: function () { return cssVariables_1.DOM_COLOR_SCHEME_KEY; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAArF,4GAAA,YAAY,OAAA;AAAE,uHAAA,uBAAuB,OAAA;AAAE,sHAAA,sBAAsB,OAAA;AACtE,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,+CAA+H;AAAtH,+GAAA,eAAe,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AAAE,qHAAA,qBAAqB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,oHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateColorScheme = generateColorScheme;
|
|
4
|
+
const tools_1 = require("../tools");
|
|
5
|
+
const lightnesses = [95, 85, 75, 60, 45, 30, 27, 21, 16, 10];
|
|
6
|
+
const defaultLightnessMap = Object.fromEntries(lightnesses.map((l, i) => {
|
|
7
|
+
const step = ((i + 1) * 100).toString();
|
|
8
|
+
return [step, l];
|
|
9
|
+
}));
|
|
10
|
+
const alphas = [0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90];
|
|
11
|
+
const defaultAlphasMap = Object.fromEntries(alphas.map((a, i) => {
|
|
12
|
+
const step = ((i + 1) * 100).toString();
|
|
13
|
+
return [step, a];
|
|
14
|
+
}));
|
|
15
|
+
/**
|
|
16
|
+
* Derives a 20-token color ramp from a single anchor hex color.
|
|
17
|
+
*
|
|
18
|
+
* Produces two groups of tokens:
|
|
19
|
+
* - **10 solid tokens** (`{prefix}Solid100` … `{prefix}Solid1000`) — vary the lightness
|
|
20
|
+
* of the anchor's hue/saturation from ~95 L (lightest) to ~10 L (darkest).
|
|
21
|
+
* - **10 transparent tokens** (`{prefix}Transparent100` … `{prefix}Transparent1000`) —
|
|
22
|
+
* keep the anchor's exact RGB channels but increase alpha from 0.05 to 0.90.
|
|
23
|
+
*
|
|
24
|
+
* Default lightness steps: `[95, 85, 75, 60, 45, 30, 27, 21, 16, 10]`.
|
|
25
|
+
* Default alpha steps: `[0.05, 0.10, …, 0.90]`.
|
|
26
|
+
* Both can be overridden by passing custom maps (step → value).
|
|
27
|
+
*/
|
|
28
|
+
function generateColorScheme(anchorHex, prefix = 'primary', lightnesses = defaultLightnessMap, alphas = defaultAlphasMap) {
|
|
29
|
+
const { h, s } = tools_1.colorTools.hexToHSL(anchorHex);
|
|
30
|
+
const baseRGB = tools_1.colorTools.hexToRGB(anchorHex);
|
|
31
|
+
const scheme = {};
|
|
32
|
+
Object.entries(lightnesses).forEach(([step, lightness]) => {
|
|
33
|
+
const rgb = tools_1.colorTools.hslToRGB(h, s, lightness);
|
|
34
|
+
scheme[`${prefix}Solid${step}`] = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 1.00)`;
|
|
35
|
+
});
|
|
36
|
+
Object.entries(alphas).forEach(([step, alpha]) => {
|
|
37
|
+
scheme[`${prefix}Transparent${step}`] = `rgba(${baseRGB.r}, ${baseRGB.g}, ${baseRGB.b}, ${alpha.toFixed(2)})`;
|
|
38
|
+
});
|
|
39
|
+
return scheme;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=generateColorScheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateColorScheme.js","sourceRoot":"","sources":["../../src/theme/generateColorScheme.ts"],"names":[],"mappings":";;AAkCA,kDAqBC;AAvDD,oCAAqC;AAGrC,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,E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AAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;QACxD,MAAM,GAAG,GAAG,kBAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;QAChD,MAAM,CAAC,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QAC/C,MAAM,CAAC,GAAG,MAAM,cAAc,IAAI,EAAE,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAA;IAC/G,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./themeStore"), exports);
|
|
18
|
+
__exportStar(require("./validateTheme"), exports);
|
|
19
|
+
__exportStar(require("./generateColorScheme"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,kDAA+B;AAC/B,wDAAqC"}
|
|
@@ -12,9 +12,9 @@ export type ThemeState = {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class ThemeStore {
|
|
14
14
|
private readonly alternateColorsSchemeStore;
|
|
15
|
-
readonly colorSchemeStore: import("nanostores").PreinitializedWritableAtom<string | null> & object;
|
|
16
|
-
readonly themeStore: import("nanostores").PreinitializedWritableAtom<ITheme | null> & object;
|
|
17
|
-
readonly variantsStore: import("nanostores").PreinitializedMapStore<IAppVariants> & object;
|
|
15
|
+
readonly colorSchemeStore: import("nanostores", { with: { "resolution-mode": "import" } }).PreinitializedWritableAtom<string | null> & object;
|
|
16
|
+
readonly themeStore: import("nanostores", { with: { "resolution-mode": "import" } }).PreinitializedWritableAtom<ITheme | null> & object;
|
|
17
|
+
readonly variantsStore: import("nanostores", { with: { "resolution-mode": "import" } }).PreinitializedMapStore<IAppVariants> & object;
|
|
18
18
|
/**
|
|
19
19
|
* Gets the current theme.
|
|
20
20
|
* @returns {ITheme | null} Current theme or null if not set
|
|
@@ -99,7 +99,7 @@ export declare const themeStore: ThemeStore;
|
|
|
99
99
|
* so they re-render only when either the theme object or the active color scheme
|
|
100
100
|
* changes — not on every `ThemeStore` method call.
|
|
101
101
|
*/
|
|
102
|
-
export declare const themeStoreComputed: import("nanostores").ReadableAtom<{
|
|
102
|
+
export declare const themeStoreComputed: import("nanostores", { with: { "resolution-mode": "import" } }).ReadableAtom<{
|
|
103
103
|
theme: AppTheme<Theme>;
|
|
104
104
|
colorScheme: string | null;
|
|
105
105
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeStore.d.ts","sourceRoot":"","sources":["../../src/theme/themeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAG1E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAuC;IAElF,SAAgB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"themeStore.d.ts","sourceRoot":"","sources":["../../src/theme/themeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAG1E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAuC;IAElF,SAAgB,gBAAgB,qHAA4B;IAE5D,SAAgB,UAAU,qHAA4B;IAEtD,SAAgB,aAAa,gHAAwC;IAErE;;;OAGG;IACH,IAAI,KAAK,kBAER;IAED;;;OAGG;IACH,IAAI,UAAU,2BAGb;IAED;;;OAGG;IACH,IAAI,WAAW,kBAEd;IAED;;;OAGG;IACH,IAAI,QAAQ,iBAEX;IAED;;;OAGG;IACH,IAAI,qBAAqB;;MAExB;IAED;;;;OAIG;IACH,WAAW,CAAC,CAAC,EAAE,QAA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