@fluentui-react-native/use-tokens 0.6.12 → 0.7.0

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.
Files changed (73) hide show
  1. package/CHANGELOG.json +1 -1
  2. package/CHANGELOG.md +38 -2
  3. package/README.md +1 -1
  4. package/lib/applyPropsToTokens.d.ts +7 -2
  5. package/lib/applyPropsToTokens.js +7 -7
  6. package/lib/applyPropsToTokens.js.map +1 -1
  7. package/lib/applyPropsToTokens.test.d.ts +1 -1
  8. package/lib/applyPropsToTokens.test.js +19 -19
  9. package/lib/applyPropsToTokens.test.js.map +1 -1
  10. package/lib/applyTokenLayers.d.ts +7 -2
  11. package/lib/applyTokenLayers.js +16 -13
  12. package/lib/applyTokenLayers.js.map +1 -1
  13. package/lib/applyTokenLayers.test.d.ts +1 -1
  14. package/lib/applyTokenLayers.test.js +42 -42
  15. package/lib/applyTokenLayers.test.js.map +1 -1
  16. package/lib/buildUseTokens.d.ts +6 -3
  17. package/lib/buildUseTokens.js +22 -22
  18. package/lib/buildUseTokens.js.map +1 -1
  19. package/lib/buildUseTokens.test.d.ts +1 -1
  20. package/lib/buildUseTokens.test.js +68 -68
  21. package/lib/buildUseTokens.test.js.map +1 -1
  22. package/lib/customizable.d.ts +9 -5
  23. package/lib/customizable.d.ts.map +1 -1
  24. package/lib/customizable.js +8 -8
  25. package/lib/customizable.js.map +1 -1
  26. package/lib/index.d.ts +1 -1
  27. package/lib/index.js +1 -1
  28. package/lib/patchTokens.d.ts +6 -2
  29. package/lib/patchTokens.js +12 -12
  30. package/lib/patchTokens.js.map +1 -1
  31. package/lib/patchTokens.test.d.ts +1 -1
  32. package/lib/patchTokens.test.js +32 -32
  33. package/lib/patchTokens.test.js.map +1 -1
  34. package/lib/useTokens.samples.test.d.ts +1 -1
  35. package/lib/useTokens.samples.test.js +134 -111
  36. package/lib/useTokens.samples.test.js.map +1 -1
  37. package/lib-commonjs/applyPropsToTokens.d.ts +7 -2
  38. package/lib-commonjs/applyPropsToTokens.js +10 -11
  39. package/lib-commonjs/applyPropsToTokens.js.map +1 -1
  40. package/lib-commonjs/applyPropsToTokens.test.d.ts +1 -1
  41. package/lib-commonjs/applyPropsToTokens.test.js +23 -23
  42. package/lib-commonjs/applyPropsToTokens.test.js.map +1 -1
  43. package/lib-commonjs/applyTokenLayers.d.ts +7 -2
  44. package/lib-commonjs/applyTokenLayers.js +20 -18
  45. package/lib-commonjs/applyTokenLayers.js.map +1 -1
  46. package/lib-commonjs/applyTokenLayers.test.d.ts +1 -1
  47. package/lib-commonjs/applyTokenLayers.test.js +46 -46
  48. package/lib-commonjs/applyTokenLayers.test.js.map +1 -1
  49. package/lib-commonjs/buildUseTokens.d.ts +6 -3
  50. package/lib-commonjs/buildUseTokens.js +30 -28
  51. package/lib-commonjs/buildUseTokens.js.map +1 -1
  52. package/lib-commonjs/buildUseTokens.test.d.ts +1 -1
  53. package/lib-commonjs/buildUseTokens.test.js +71 -71
  54. package/lib-commonjs/buildUseTokens.test.js.map +1 -1
  55. package/lib-commonjs/customizable.d.ts +9 -5
  56. package/lib-commonjs/customizable.d.ts.map +1 -1
  57. package/lib-commonjs/customizable.js +11 -12
  58. package/lib-commonjs/customizable.js.map +1 -1
  59. package/lib-commonjs/index.d.ts +1 -1
  60. package/lib-commonjs/index.js +38 -13
  61. package/lib-commonjs/index.js.map +1 -1
  62. package/lib-commonjs/patchTokens.d.ts +6 -2
  63. package/lib-commonjs/patchTokens.js +15 -16
  64. package/lib-commonjs/patchTokens.js.map +1 -1
  65. package/lib-commonjs/patchTokens.test.d.ts +1 -1
  66. package/lib-commonjs/patchTokens.test.js +36 -36
  67. package/lib-commonjs/patchTokens.test.js.map +1 -1
  68. package/lib-commonjs/useTokens.samples.test.d.ts +1 -1
  69. package/lib-commonjs/useTokens.samples.test.js +195 -141
  70. package/lib-commonjs/useTokens.samples.test.js.map +1 -1
  71. package/package.json +45 -45
  72. package/src/customizable.ts +3 -2
  73. package/src/useTokens.samples.test.tsx +24 -15
@@ -6,4 +6,4 @@ export type { GetComponentInfo, TokenSettings, TokensFromTheme, UseTokens, UseTo
6
6
  export { customizable } from './customizable';
7
7
  export type { CustomizableComponent, InjectableComponent } from './customizable';
8
8
  export { patchTokens } from './patchTokens';
9
- //# sourceMappingURL=index.d.ts.map
9
+ //# sourceMappingURL=index.d.ts.map
@@ -1,14 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.patchTokens = exports.customizable = exports.buildUseTokens = exports.applyTokenLayers = exports.applyPropsToTokens = void 0;
4
- var applyPropsToTokens_1 = require("./applyPropsToTokens");
5
- Object.defineProperty(exports, "applyPropsToTokens", { enumerable: true, get: function () { return applyPropsToTokens_1.applyPropsToTokens; } });
6
- var applyTokenLayers_1 = require("./applyTokenLayers");
7
- Object.defineProperty(exports, "applyTokenLayers", { enumerable: true, get: function () { return applyTokenLayers_1.applyTokenLayers; } });
8
- var buildUseTokens_1 = require("./buildUseTokens");
9
- Object.defineProperty(exports, "buildUseTokens", { enumerable: true, get: function () { return buildUseTokens_1.buildUseTokens; } });
10
- var customizable_1 = require("./customizable");
11
- Object.defineProperty(exports, "customizable", { enumerable: true, get: function () { return customizable_1.customizable; } });
12
- var patchTokens_1 = require("./patchTokens");
13
- Object.defineProperty(exports, "patchTokens", { enumerable: true, get: function () { return patchTokens_1.patchTokens; } });
14
- //# sourceMappingURL=index.js.map
4
+ const applyPropsToTokens_1 = require('./applyPropsToTokens');
5
+ Object.defineProperty(exports, 'applyPropsToTokens', {
6
+ enumerable: true,
7
+ get: function () {
8
+ return applyPropsToTokens_1.applyPropsToTokens;
9
+ },
10
+ });
11
+ const applyTokenLayers_1 = require('./applyTokenLayers');
12
+ Object.defineProperty(exports, 'applyTokenLayers', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return applyTokenLayers_1.applyTokenLayers;
16
+ },
17
+ });
18
+ const buildUseTokens_1 = require('./buildUseTokens');
19
+ Object.defineProperty(exports, 'buildUseTokens', {
20
+ enumerable: true,
21
+ get: function () {
22
+ return buildUseTokens_1.buildUseTokens;
23
+ },
24
+ });
25
+ const customizable_1 = require('./customizable');
26
+ Object.defineProperty(exports, 'customizable', {
27
+ enumerable: true,
28
+ get: function () {
29
+ return customizable_1.customizable;
30
+ },
31
+ });
32
+ const patchTokens_1 = require('./patchTokens');
33
+ Object.defineProperty(exports, 'patchTokens', {
34
+ enumerable: true,
35
+ get: function () {
36
+ return patchTokens_1.patchTokens;
37
+ },
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAEzB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,yDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAEzB,qDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,iDAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,+CAA4C;AAAnC,0GAAA,WAAW,OAAA"}
@@ -8,5 +8,9 @@ import type { GetTypedMemoValue } from '@fluentui-react-native/framework-base';
8
8
  * @param patchValues - new values to apply, values will be obtained via keys in the object
9
9
  * @returns - a tuple consisting of a new tokens object and a new memo-cache
10
10
  */
11
- export declare function patchTokens<TTokens>(tokens: TTokens, cache: GetTypedMemoValue<TTokens>, patchValues: TTokens): [TTokens, GetTypedMemoValue<TTokens>];
12
- //# sourceMappingURL=patchTokens.d.ts.map
11
+ export declare function patchTokens<TTokens>(
12
+ tokens: TTokens,
13
+ cache: GetTypedMemoValue<TTokens>,
14
+ patchValues: TTokens,
15
+ ): [TTokens, GetTypedMemoValue<TTokens>];
16
+ //# sourceMappingURL=patchTokens.d.ts.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchTokens = void 0;
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.patchTokens = patchTokens;
4
4
  /**
5
5
  * Take a set of tokens (and a memo-cache) and apply changes to those tokens from an additional set of tokens. Only keys which are
6
6
  * not undefined will be applied and if no changes are detected the token object will be unchanged.
@@ -11,17 +11,16 @@ exports.patchTokens = void 0;
11
11
  * @returns - a tuple consisting of a new tokens object and a new memo-cache
12
12
  */
13
13
  function patchTokens(tokens, cache, patchValues) {
14
- // reduce the patch values to the set of keys that are defined, and sort them to ensure consistent ordering
15
- const keys = Object.keys(patchValues)
16
- .filter((v) => patchValues[v] !== undefined)
17
- .sort();
18
- // for each key get an updated tokens collection based on key + value. Value alone isn't sufficient as the values
19
- // are not necessarily unique. i.e. { a: 'blue' } and { b: 'blue' } would cache to the same without the key
20
- for (const key of keys) {
21
- [tokens, cache] = cache(() => ({ ...tokens, [key]: patchValues[key] }), [key, patchValues[key]]);
22
- }
23
- // return the updated tokens and cache (if there were any keys applied)
24
- return [tokens, cache];
14
+ // reduce the patch values to the set of keys that are defined, and sort them to ensure consistent ordering
15
+ const keys = Object.keys(patchValues)
16
+ .filter((v) => patchValues[v] !== undefined)
17
+ .sort();
18
+ // for each key get an updated tokens collection based on key + value. Value alone isn't sufficient as the values
19
+ // are not necessarily unique. i.e. { a: 'blue' } and { b: 'blue' } would cache to the same without the key
20
+ for (const key of keys) {
21
+ [tokens, cache] = cache(() => ({ ...tokens, [key]: patchValues[key] }), [key, patchValues[key]]);
22
+ }
23
+ // return the updated tokens and cache (if there were any keys applied)
24
+ return [tokens, cache];
25
25
  }
26
- exports.patchTokens = patchTokens;
27
- //# sourceMappingURL=patchTokens.js.map
26
+ //# sourceMappingURL=patchTokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchTokens.js","sourceRoot":"","sources":["../src/patchTokens.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,WAAW,CACzB,MAAe,EACf,KAAiC,EACjC,WAAoB;IAEpB,2GAA2G;IAC3G,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;SAC3C,IAAI,EAAE,CAAC;IAEV,iHAAiH;IACjH,2GAA2G;IAC3G,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClG;IAED,uEAAuE;IACvE,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC;AAlBD,kCAkBC"}
1
+ {"version":3,"file":"patchTokens.js","sourceRoot":"","sources":["../src/patchTokens.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,qBACE,MAAe,EACf,KAAiC,EACjC,WAAoB,EACmB;IACvC,2GAA2G;IAC3G,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;SAC3C,IAAI,EAAE,CAAC;IAEV,iHAAiH;IACjH,2GAA2G;IAC3G,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,uEAAuE;IACvE,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAAA,CACxB"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=patchTokens.test.d.ts.map
2
+ //# sourceMappingURL=patchTokens.test.d.ts.map
@@ -1,40 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const framework_base_1 = require("@fluentui-react-native/framework-base");
4
- const patchTokens_1 = require("./patchTokens");
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
4
+ const patchTokens_1 = require('./patchTokens');
5
5
  const themeTokens = {
6
- uno: 'uno',
7
- dos: 'dos',
8
- tres: 3,
9
- quatro: 4,
10
- cinco: true,
6
+ uno: 'uno',
7
+ dos: 'dos',
8
+ tres: 3,
9
+ quatro: 4,
10
+ cinco: true,
11
11
  };
12
12
  describe('patchTokens tests', () => {
13
- test('props get copied', () => {
14
- const cache = (0, framework_base_1.getMemoCache)();
15
- const patchValues = { uno: 'one', quatro: 'quatro' };
16
- const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues);
17
- expect(tokens).not.toBe(themeTokens);
18
- for (const key in patchValues) {
19
- expect(tokens[key]).toEqual(patchValues[key]);
20
- }
21
- });
22
- test('no copied props does not change tokens', () => {
23
- const cache = (0, framework_base_1.getMemoCache)();
24
- const patchValues1 = {};
25
- const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues1);
26
- expect(tokens).toBe(themeTokens);
27
- const patchValues2 = { tres: undefined };
28
- const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues2);
29
- expect(tokens2).toBe(themeTokens);
30
- });
31
- test('patching tokens cache independent of order', () => {
32
- const cache = (0, framework_base_1.getMemoCache)();
33
- const patch1 = { uno: 'one', cinco: false };
34
- const patch2 = { cinco: false, uno: 'one' };
35
- const [tokens1] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch1);
36
- const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch2);
37
- expect(tokens1).toBe(tokens2);
38
- });
13
+ test('props get copied', () => {
14
+ const cache = (0, framework_base_1.getMemoCache)();
15
+ const patchValues = { uno: 'one', quatro: 'quatro' };
16
+ const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues);
17
+ expect(tokens).not.toBe(themeTokens);
18
+ for (const key in patchValues) {
19
+ expect(tokens[key]).toEqual(patchValues[key]);
20
+ }
21
+ });
22
+ test('no copied props does not change tokens', () => {
23
+ const cache = (0, framework_base_1.getMemoCache)();
24
+ const patchValues1 = {};
25
+ const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues1);
26
+ expect(tokens).toBe(themeTokens);
27
+ const patchValues2 = { tres: undefined };
28
+ const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues2);
29
+ expect(tokens2).toBe(themeTokens);
30
+ });
31
+ test('patching tokens cache independent of order', () => {
32
+ const cache = (0, framework_base_1.getMemoCache)();
33
+ const patch1 = { uno: 'one', cinco: false };
34
+ const patch2 = { cinco: false, uno: 'one' };
35
+ const [tokens1] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch1);
36
+ const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch2);
37
+ expect(tokens1).toBe(tokens2);
38
+ });
39
39
  });
40
- //# sourceMappingURL=patchTokens.test.js.map
40
+ //# sourceMappingURL=patchTokens.test.js.map
@@ -1 +1 @@
1
- {"version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WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAAA,CAC/B,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=useTokens.samples.test.d.ts.map
2
+ //# sourceMappingURL=useTokens.samples.test.d.ts.map
@@ -1,51 +1,79 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const React = __importStar(require("react"));
27
- const react_native_1 = require("react-native");
28
- const framework_base_1 = require("@fluentui-react-native/framework-base");
29
- const framework_base_2 = require("@fluentui-react-native/framework-base");
30
- const renderer = __importStar(require("react-test-renderer"));
31
- const buildUseTokens_1 = require("./buildUseTokens");
1
+ 'use strict';
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k];
13
+ },
14
+ };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ });
22
+ var __setModuleDefault =
23
+ (this && this.__setModuleDefault) ||
24
+ (Object.create
25
+ ? function (o, v) {
26
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
27
+ }
28
+ : function (o, v) {
29
+ o['default'] = v;
30
+ });
31
+ var __importStar =
32
+ (this && this.__importStar) ||
33
+ (function () {
34
+ var ownKeys = function (o) {
35
+ ownKeys =
36
+ Object.getOwnPropertyNames ||
37
+ function (o) {
38
+ var ar = [];
39
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
+ return ar;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ return function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
48
+ __setModuleDefault(result, mod);
49
+ return result;
50
+ };
51
+ })();
52
+ Object.defineProperty(exports, '__esModule', { value: true });
53
+ const jsx_runtime_1 = require('react/jsx-runtime');
54
+ const react_1 = require('react');
55
+ const react_native_1 = require('react-native');
56
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
57
+ const framework_base_2 = require('@fluentui-react-native/framework-base');
58
+ const renderer = __importStar(require('react-test-renderer'));
59
+ const buildUseTokens_1 = require('./buildUseTokens');
32
60
  /**
33
61
  * The default/base theme just contains base values
34
62
  */
35
63
  const baseTheme = {
36
- globals: {
37
- backgroundColor: 'white',
38
- color: 'black',
39
- borderColor: 'blue',
40
- fontFamily: 'Arial',
41
- fontSize: 12,
42
- },
43
- components: {},
64
+ globals: {
65
+ backgroundColor: 'white',
66
+ color: 'black',
67
+ borderColor: 'blue',
68
+ fontFamily: 'Arial',
69
+ fontSize: 12,
70
+ },
71
+ components: {},
44
72
  };
45
73
  const current = { theme: baseTheme };
46
74
  const useTheme = () => current.theme;
47
75
  const setActiveTheme = (theme) => {
48
- current.theme = (theme && (0, framework_base_1.immutableMerge)(baseTheme, theme)) || baseTheme;
76
+ current.theme = (theme && (0, framework_base_1.immutableMerge)(baseTheme, theme)) || baseTheme;
49
77
  };
50
78
  /**
51
79
  * Helper function used to look up a component in the theme. Having this injected allows this module to not be dependent on the shape of
@@ -53,113 +81,139 @@ const setActiveTheme = (theme) => {
53
81
  */
54
82
  const getComponentInfo = (theme, name) => theme.components[name];
55
83
  describe('useTokens samples', () => {
56
- /**
57
- * Sample #1 - Themeable text element
58
- *
59
- * This adds some default opinions for how a text element should be styled but only allows for customization
60
- * via theming
61
- */
62
- const useTokensSample1 = (0, buildUseTokens_1.buildUseTokens)(getComponentInfo,
84
+ /**
85
+ * Sample #1 - Themeable text element
86
+ *
87
+ * This adds some default opinions for how a text element should be styled but only allows for customization
88
+ * via theming
89
+ */
90
+ const useTokensSample1 = (0, buildUseTokens_1.buildUseTokens)(
91
+ getComponentInfo,
63
92
  /** first the default values should come from the global theme section */
64
93
  (t) => ({
65
- color: t.globals.color,
66
- fontFamily: t.globals.fontFamily,
67
- fontSize: t.globals.fontSize,
68
- }),
94
+ color: t.globals.color,
95
+ fontFamily: t.globals.fontFamily,
96
+ fontSize: t.globals.fontSize,
97
+ }),
69
98
  /** next we should look for a component reference to overlay */
70
- 'SampleText');
71
- const SampleText1 = (props) => {
72
- // standard props splitting
73
- const { style, children, ...rest } = props;
74
- // typically this would start with a call to retrieve the theme from the context via whatever method is appropriate
75
- const theme = useTheme();
76
- // next the tokens are resolved from the theme, a cache specific to this theme is returned as well to allow for
77
- // style objects to not be rebuilt unnecessarily
78
- const [tokens, cache] = useTokensSample1(theme);
79
- // build up the text style, or the full props as appropriate
80
- const styleFromTokens = cache(
81
- /**
82
- * first build the style object
83
- * - this executes once for every unique set of keys.
84
- * - The cache is already unique for this theme
85
- */
86
- () => ({ ...tokens }),
87
- /**
88
- * now specify the keys
89
- * - because the only changing variable is the theme
90
- * - ...and all the style properties are either constant or come from the tokens
91
- * - ...no keys need to be specified
92
- * - this means that only one style object will be created per component + theme pair
93
- */
94
- []);
95
- // merge the props from the tokens with anything passed in via style. This is internally cached via object identity
96
- // so the merged style object won't change identity unless one of the two inputs changes identity.
97
- const mergedStyle = (0, framework_base_2.mergeStyles)(styleFromTokens, style);
98
- // now just render the element, forwarding the props, setting the merged style, then passing the children as appropriate
99
- return (React.createElement(react_native_1.Text, { ...rest, style: mergedStyle }, children));
100
- };
101
- beforeEach(() => {
102
- setActiveTheme();
99
+ 'SampleText',
100
+ );
101
+ const SampleText1 = (props) => {
102
+ // standard props splitting
103
+ const { style, children, ...rest } = props;
104
+ // typically this would start with a call to retrieve the theme from the context via whatever method is appropriate
105
+ const theme = useTheme();
106
+ // next the tokens are resolved from the theme, a cache specific to this theme is returned as well to allow for
107
+ // style objects to not be rebuilt unnecessarily
108
+ const [tokens, cache] = useTokensSample1(theme);
109
+ // build up the text style, or the full props as appropriate
110
+ const [styleFromTokens] = cache(
111
+ /**
112
+ * first build the style object
113
+ * - this executes once for every unique set of keys.
114
+ * - The cache is already unique for this theme
115
+ */
116
+ () => ({ ...tokens }),
117
+ /**
118
+ * now specify the keys
119
+ * - because the only changing variable is the theme
120
+ * - ...and all the style properties are either constant or come from the tokens
121
+ * - ...no keys need to be specified
122
+ * - this means that only one style object will be created per component + theme pair
123
+ */
124
+ [],
125
+ );
126
+ // merge the props from the tokens with anything passed in via style. This is internally cached via object identity
127
+ // so the merged style object won't change identity unless one of the two inputs changes identity.
128
+ const mergedStyle = (0, framework_base_2.mergeStyles)(styleFromTokens, style);
129
+ // now just render the element, forwarding the props, setting the merged style, then passing the children as appropriate
130
+ return jsx_runtime_1.jsx(react_native_1.Text, { ...rest, style: mergedStyle, children: children });
131
+ };
132
+ beforeEach(() => {
133
+ setActiveTheme();
134
+ });
135
+ /** first render the component with no updates */
136
+ it('Sample1Text rendering with no overrides', () => {
137
+ let component;
138
+ (0, react_1.act)(() => {
139
+ component = renderer.create(jsx_runtime_1.jsx(SampleText1, { children: 'Sample1a' }));
103
140
  });
104
- /** first render the component with no updates */
105
- it('Sample1Text rendering with no overrides', () => {
106
- const tree = renderer.create(React.createElement(SampleText1, null, "Sample1a")).toJSON();
107
- expect(tree).toMatchSnapshot();
141
+ expect(component.toJSON()).toMatchSnapshot();
142
+ });
143
+ /** now re-theme the component via the components in the theme */
144
+ it('Sample1Text rendering with some custom settings in the theme', () => {
145
+ setActiveTheme({
146
+ components: {
147
+ SampleText: {
148
+ color: 'pink',
149
+ fontSize: 24,
150
+ },
151
+ },
108
152
  });
109
- /** now re-theme the component via the components in the theme */
110
- it('Sample1Text rendering with some custom settings in the theme', () => {
111
- setActiveTheme({
112
- components: {
113
- SampleText: {
114
- color: 'pink',
115
- fontSize: 24,
116
- },
117
- },
118
- });
119
- const tree = renderer.create(React.createElement(SampleText1, null, "Sample1b")).toJSON();
120
- expect(tree).toMatchSnapshot();
153
+ let component;
154
+ (0, react_1.act)(() => {
155
+ component = renderer.create(jsx_runtime_1.jsx(SampleText1, { children: 'Sample1b' }));
121
156
  });
122
- // the Sample2Text component is built the same way as sample1, just using the new hook that has been created
123
- const SampleText2 = (props) => {
124
- const { color, style, children, ...rest } = props;
125
- const theme = useTheme();
126
- // this starts the same as sample1, extract tokens from the theme and get a theme specific cache object
127
- const [tokens, cache] = useTokensSample1(theme);
128
- // now when building up the style this time, the resulting style object is based upon both the theme and the passed
129
- // in value of colors. Because the theme is already part of the cache definition, only color needs to be a key
130
- const styleFromTokens = cache(
131
- /** build the style, only patch the color if it has a value, otherwise the theme value would get stomped if color was undefined */
132
- () => ({ ...tokens, ...(color && { color }) }),
133
- /** use color as an additional key for the style */
134
- [color]);
135
- // now just render, this time merging styles inline to make it a bit shorter
136
- return (React.createElement(react_native_1.Text, { ...rest, style: (0, framework_base_2.mergeStyles)(styleFromTokens, style) }, children));
137
- };
138
- /** rendering the Sample2 component with the base theme */
139
- it('Sample2Text rendering with defaults and a color override', () => {
140
- const tree = renderer
141
- .create(React.createElement(react_native_1.View, null,
142
- React.createElement(SampleText2, null, "Sample2 with defaults"),
143
- React.createElement(SampleText2, { color: "green" }, "Sample2 with color override via prop")))
144
- .toJSON();
145
- expect(tree).toMatchSnapshot();
157
+ expect(component.toJSON()).toMatchSnapshot();
158
+ });
159
+ // the Sample2Text component is built the same way as sample1, just using the new hook that has been created
160
+ const SampleText2 = (props) => {
161
+ const { color, style, children, ...rest } = props;
162
+ const theme = useTheme();
163
+ // this starts the same as sample1, extract tokens from the theme and get a theme specific cache object
164
+ const [tokens, cache] = useTokensSample1(theme);
165
+ // now when building up the style this time, the resulting style object is based upon both the theme and the passed
166
+ // in value of colors. Because the theme is already part of the cache definition, only color needs to be a key
167
+ const styleFromTokens = cache(
168
+ /** build the style, only patch the color if it has a value, otherwise the theme value would get stomped if color was undefined */
169
+ () => ({ ...tokens, ...(color && { color }) }),
170
+ /** use color as an additional key for the style */
171
+ [color],
172
+ );
173
+ // now just render, this time merging styles inline to make it a bit shorter
174
+ return jsx_runtime_1.jsx(react_native_1.Text, {
175
+ ...rest,
176
+ style: (0, framework_base_2.mergeStyles)(styleFromTokens, style),
177
+ children: children,
146
178
  });
147
- /** now re-theme the component via the components in the theme */
148
- it('Sample2Text rendering with some custom settings in the theme', () => {
149
- setActiveTheme({
150
- components: {
151
- SampleText: {
152
- fontSize: 18,
153
- fontFamily: 'Helvetica',
154
- },
155
- },
156
- });
157
- const tree = renderer
158
- .create(React.createElement(react_native_1.View, null,
159
- React.createElement(SampleText2, null, "Sample2 with theme overrides set"),
160
- React.createElement(SampleText2, { color: "purple" }, "Sample2 with theme and color prop override")))
161
- .toJSON();
162
- expect(tree).toMatchSnapshot();
179
+ };
180
+ /** rendering the Sample2 component with the base theme */
181
+ it('Sample2Text rendering with defaults and a color override', () => {
182
+ let component;
183
+ (0, react_1.act)(() => {
184
+ component = renderer.create(
185
+ jsx_runtime_1.jsxs(react_native_1.View, {
186
+ children: [
187
+ jsx_runtime_1.jsx(SampleText2, { children: 'Sample2 with defaults' }),
188
+ jsx_runtime_1.jsx(SampleText2, { color: 'green', children: 'Sample2 with color override via prop' }),
189
+ ],
190
+ }),
191
+ );
192
+ });
193
+ expect(component.toJSON()).toMatchSnapshot();
194
+ });
195
+ /** now re-theme the component via the components in the theme */
196
+ it('Sample2Text rendering with some custom settings in the theme', () => {
197
+ setActiveTheme({
198
+ components: {
199
+ SampleText: {
200
+ fontSize: 18,
201
+ fontFamily: 'Helvetica',
202
+ },
203
+ },
204
+ });
205
+ let component;
206
+ (0, react_1.act)(() => {
207
+ component = renderer.create(
208
+ jsx_runtime_1.jsxs(react_native_1.View, {
209
+ children: [
210
+ jsx_runtime_1.jsx(SampleText2, { children: 'Sample2 with theme overrides set' }),
211
+ jsx_runtime_1.jsx(SampleText2, { color: 'purple', children: 'Sample2 with theme and color prop override' }),
212
+ ],
213
+ }),
214
+ );
163
215
  });
216
+ expect(component.toJSON()).toMatchSnapshot();
217
+ });
164
218
  });
165
- //# sourceMappingURL=useTokens.samples.test.js.map
219
+ //# sourceMappingURL=useTokens.samples.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTokens.samples.test.js","sourceRoot":"","sources":["../src/useTokens.samples.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,+CAA0C;AAE1C,0EAAuE;AACvE,0EAAoE;AACpE,8DAAgD;AAEhD,qDAAkD;AAuBlD;;GAEG;AACH,MAAM,SAAS,GAAU;IACvB,OAAO,EAAE;QACP,eAAe,EAAE,OA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