@animus-ui/theming 0.1.1-beta.14 → 0.1.1-beta.18
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 +32 -0
- package/dist/index.js +2 -4
- package/dist/utils/createTheme.d.ts +1 -1
- package/dist/utils/serializeTokens.d.ts +3 -2
- package/package.json +3 -3
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.1.1-beta.18](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.17...@animus-ui/theming@0.1.1-beta.18) (2022-02-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @animus-ui/theming
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.1.1-beta.17](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.16...@animus-ui/theming@0.1.1-beta.17) (2022-02-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @animus-ui/theming
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.1.1-beta.16](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.15...@animus-ui/theming@0.1.1-beta.16) (2022-02-02)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @animus-ui/theming
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.1.1-beta.15](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.14...@animus-ui/theming@0.1.1-beta.15) (2022-01-26)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @animus-ui/theming
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [0.1.1-beta.14](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.13...@animus-ui/theming@0.1.1-beta.14) (2022-01-24)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @animus-ui/theming
|
package/dist/index.js
CHANGED
|
@@ -196,7 +196,7 @@ var serializeTokens = function serializeTokens(tokens, prefix, theme) {
|
|
|
196
196
|
var tokenReferences = {};
|
|
197
197
|
var tokenVariables = {};
|
|
198
198
|
Object.keys(tokens).forEach(function (key) {
|
|
199
|
-
var varName = "--".concat(prefix, "-").concat(key);
|
|
199
|
+
var varName = "--".concat(prefix, "-").concat(key.replace('$', ''));
|
|
200
200
|
tokenReferences[key] = "var(".concat(varName, ")");
|
|
201
201
|
merge(tokenVariables, templateBreakpoints(tokens[key], varName, theme));
|
|
202
202
|
});
|
|
@@ -235,9 +235,7 @@ var ThemeBuilder = /*#__PURE__*/function () {
|
|
|
235
235
|
variables = _serializeTokens.variables,
|
|
236
236
|
tokens = _serializeTokens.tokens;
|
|
237
237
|
|
|
238
|
-
_classPrivateFieldSet(this, _theme, merge({}, _classPrivateFieldGet(this, _theme), (_merge = {}, _defineProperty(_merge, key, tokens), _defineProperty(_merge, "_variables", {
|
|
239
|
-
root: variables
|
|
240
|
-
}), _defineProperty(_merge, "_tokens", _defineProperty({}, key, _classPrivateFieldGet(this, _theme)[key])), _merge)));
|
|
238
|
+
_classPrivateFieldSet(this, _theme, merge({}, _classPrivateFieldGet(this, _theme), (_merge = {}, _defineProperty(_merge, key, tokens), _defineProperty(_merge, "_variables", _defineProperty({}, key, variables)), _defineProperty(_merge, "_tokens", _defineProperty({}, key, _classPrivateFieldGet(this, _theme)[key])), _merge)));
|
|
241
239
|
|
|
242
240
|
return this;
|
|
243
241
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractTheme, CSSObject } from '@animus-ui/core';
|
|
2
2
|
import { LiteralPaths } from './flattenScale';
|
|
3
3
|
import { KeyAsVariable } from './serializeTokens';
|
|
4
4
|
import { ColorModeConfig, Merge, MergeTheme, PrivateThemeKeys } from './types';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Theme } from '@emotion/react';
|
|
2
1
|
import { CSSObject } from '@animus-ui/core';
|
|
2
|
+
import { Theme } from '@emotion/react';
|
|
3
3
|
/**
|
|
4
4
|
* Returns an type of any object with { key: 'var(--key) }
|
|
5
5
|
*/
|
|
6
6
|
export declare type KeyAsVariable<T extends Record<string, any>, Prefix extends string> = {
|
|
7
|
-
[V in keyof T]: `var(--${Prefix}-${Extract<V, string
|
|
7
|
+
[V in keyof T]: `var(--${Prefix}-${SanitizeKey<Extract<V, string>>})`;
|
|
8
8
|
};
|
|
9
|
+
export declare type SanitizeKey<T extends string> = T extends `${'$'}${infer Y}` ? Y : T;
|
|
9
10
|
declare type SerializedTokensInput = Record<string, string | number | CSSObject | SerializedTokensInputRecursive>;
|
|
10
11
|
interface SerializedTokensInputRecursive {
|
|
11
12
|
[i: number]: SerializedTokensInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/theming",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.18",
|
|
4
4
|
"description": "Theming Utilities",
|
|
5
5
|
"author": "Aaron Robb <airrobb@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/codecaaron/animus#readme",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/codecaaron/animus/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@animus-ui/core": "^0.1.1-beta.
|
|
28
|
+
"@animus-ui/core": "^0.1.1-beta.18"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@emotion/react": ">=11.0.0",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"lodash": "*",
|
|
34
34
|
"typescript": ">=4.3.5"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "17e860d315d6a4e1a94552cb3e0cc8f535dfdff8"
|
|
37
37
|
}
|