@animus-ui/theming 0.1.1-beta.17 → 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 CHANGED
@@ -3,6 +3,14 @@
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
+
6
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)
7
15
 
8
16
  **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
  }
@@ -4,8 +4,9 @@ import { Theme } from '@emotion/react';
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.17",
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.17"
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": "f675c939172dab4202db615de2804470512f5dc6"
36
+ "gitHead": "17e860d315d6a4e1a94552cb3e0cc8f535dfdff8"
37
37
  }