@animus-ui/theming 0.1.1-beta.15 → 0.1.1-beta.19

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,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.19](https://github.com/codecaaron/animus/compare/@animus-ui/theming@0.1.1-beta.18...@animus-ui/theming@0.1.1-beta.19) (2022-02-12)
7
+
8
+ **Note:** Version bump only for package @animus-ui/theming
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+ **Note:** Version bump only for package @animus-ui/theming
17
+
18
+
19
+
20
+
21
+
22
+ ## [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)
23
+
24
+ **Note:** Version bump only for package @animus-ui/theming
25
+
26
+
27
+
28
+
29
+
30
+ ## [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)
31
+
32
+ **Note:** Version bump only for package @animus-ui/theming
33
+
34
+
35
+
36
+
37
+
6
38
  ## [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)
7
39
 
8
40
  **Note:** Version bump only for package @animus-ui/theming
package/dist/index.js CHANGED
@@ -169,20 +169,21 @@ function flattenScale(object, path) {
169
169
  }, {});
170
170
  }
171
171
 
172
- var _excluded = ["_", "base"];
172
+ var _excluded = ["_"];
173
173
 
174
174
  var templateBreakpoints = function templateBreakpoints(value, alias, theme) {
175
175
  if (isObject(value)) {
176
176
  var _ = value._,
177
- base = value.base,
178
177
  rest = _objectWithoutProperties(value, _excluded);
179
178
 
180
- var css = _defineProperty({}, alias, _ !== null && _ !== void 0 ? _ : base);
179
+ var css = _defineProperty({}, alias, _);
181
180
 
182
181
  if (theme) {
183
182
  var breakpoints = theme.breakpoints;
184
183
  Object.keys(breakpoints).forEach(function (key) {
185
- css[breakpoints[key]] = _defineProperty({}, alias, rest[key]);
184
+ if (rest[key]) {
185
+ css[breakpoints[key]] = _defineProperty({}, alias, rest[key]);
186
+ }
186
187
  });
187
188
  }
188
189
 
@@ -196,7 +197,7 @@ var serializeTokens = function serializeTokens(tokens, prefix, theme) {
196
197
  var tokenReferences = {};
197
198
  var tokenVariables = {};
198
199
  Object.keys(tokens).forEach(function (key) {
199
- var varName = "--".concat(prefix, "-").concat(key);
200
+ var varName = "--".concat(prefix, "-").concat(key.replace('$', ''));
200
201
  tokenReferences[key] = "var(".concat(varName, ")");
201
202
  merge(tokenVariables, templateBreakpoints(tokens[key], varName, theme));
202
203
  });
@@ -235,9 +236,7 @@ var ThemeBuilder = /*#__PURE__*/function () {
235
236
  variables = _serializeTokens.variables,
236
237
  tokens = _serializeTokens.tokens;
237
238
 
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)));
239
+ _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
240
 
242
241
  return this;
243
242
  }
@@ -1,4 +1,4 @@
1
- import { CSSObject, AbstractTheme } from '@animus-ui/core';
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.15",
3
+ "version": "0.1.1-beta.19",
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.15"
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": "8563b18650d797788e8e766ff4f1c090e98fb9ea"
36
+ "gitHead": "30a2b3bfda8f7edbde50c479712aeb4f50d2e7d2"
37
37
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- // "emitDeclarationOnly": true,
4
+ "skipLibCheck": false,
5
5
  "outDir": "./dist"
6
6
  },
7
7
  "include": ["../../typings/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"],