@fluentui-react-native/apple-theme 0.13.3 → 0.14.1

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.json CHANGED
@@ -2,7 +2,55 @@
2
2
  "name": "@fluentui-react-native/apple-theme",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 29 Aug 2022 23:19:48 GMT",
5
+ "date": "Fri, 16 Sep 2022 01:50:50 GMT",
6
+ "tag": "@fluentui-react-native/apple-theme_v0.14.1",
7
+ "version": "0.14.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui-react-native/apple-theme",
13
+ "comment": "Bump @fluentui-react-native/default-theme to v0.15.1",
14
+ "commit": "379d866e6ec5a3d954b5e945949467345f815513"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui-react-native/apple-theme",
19
+ "comment": "Bump @fluentui-react-native/theme to v0.7.1",
20
+ "commit": "379d866e6ec5a3d954b5e945949467345f815513"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui-react-native/apple-theme",
25
+ "comment": "Bump @fluentui-react-native/theme-types to v0.19.0",
26
+ "commit": "379d866e6ec5a3d954b5e945949467345f815513"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui-react-native/apple-theme",
31
+ "comment": "Bump @fluentui-react-native/theming-utils to v0.15.1",
32
+ "commit": "379d866e6ec5a3d954b5e945949467345f815513"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Thu, 01 Sep 2022 17:00:15 GMT",
39
+ "tag": "@fluentui-react-native/apple-theme_v0.14.0",
40
+ "version": "0.14.0",
41
+ "comments": {
42
+ "minor": [
43
+ {
44
+ "author": "nkhalil942@gmail.com",
45
+ "package": "@fluentui-react-native/apple-theme",
46
+ "commit": "567d1903113eede5db9b04f1e93b9599fdfdaabd",
47
+ "comment": "Added unit tests"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Mon, 29 Aug 2022 23:21:44 GMT",
6
54
  "tag": "@fluentui-react-native/apple-theme_v0.13.3",
7
55
  "version": "0.13.3",
8
56
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,31 @@
1
1
  # Change Log - @fluentui-react-native/apple-theme
2
2
 
3
- This log was last generated on Mon, 29 Aug 2022 23:19:48 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 16 Sep 2022 01:50:50 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.14.1
8
+
9
+ Fri, 16 Sep 2022 01:50:50 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/default-theme to v0.15.1
14
+ - Bump @fluentui-react-native/theme to v0.7.1
15
+ - Bump @fluentui-react-native/theme-types to v0.19.0
16
+ - Bump @fluentui-react-native/theming-utils to v0.15.1
17
+
18
+ ## 0.14.0
19
+
20
+ Thu, 01 Sep 2022 17:00:15 GMT
21
+
22
+ ### Minor changes
23
+
24
+ - Added unit tests (nkhalil942@gmail.com)
25
+
7
26
  ## 0.13.3
8
27
 
9
- Mon, 29 Aug 2022 23:19:48 GMT
28
+ Mon, 29 Aug 2022 23:21:44 GMT
10
29
 
11
30
  ### Patches
12
31
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=apple-theme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-theme.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/apple-theme.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { createAppleTheme } from '../createAppleTheme';
38
+ import { createMacOSColorAliasTokens, createMacOSShadowAliasTokens } from '../createMacOSAliasTokens';
39
+ import { getIsHighContrast, setIsHighContrast } from '../appleHighContrast.macos';
40
+ var macOsAliasTokensTable = [
41
+ ['light', true],
42
+ ['light', false],
43
+ ['dark', true],
44
+ ['dark', false],
45
+ ['highContrast', null],
46
+ ];
47
+ it('createAppleTheme test', function () {
48
+ var appleTheme = createAppleTheme().theme;
49
+ expect(appleTheme).toMatchSnapshot();
50
+ });
51
+ it('IsHighContrast test', function () {
52
+ setIsHighContrast(false);
53
+ expect(getIsHighContrast()).toBe(false);
54
+ setIsHighContrast(true);
55
+ expect(getIsHighContrast()).toBe(true);
56
+ });
57
+ it.concurrent.each(macOsAliasTokensTable)('createMacOSColorAliasTokens test mode: %s, isHighContrast: %p', function (mode, isHighContrast) { return __awaiter(void 0, void 0, void 0, function () {
58
+ return __generator(this, function (_a) {
59
+ if (mode === 'highContrast') {
60
+ expect(function () { return createMacOSColorAliasTokens(mode, isHighContrast); }).toThrow();
61
+ }
62
+ else {
63
+ expect(createMacOSColorAliasTokens(mode, isHighContrast)).toMatchSnapshot();
64
+ }
65
+ return [2 /*return*/];
66
+ });
67
+ }); });
68
+ it.concurrent.each(macOsAliasTokensTable)('createMacOSShadowAliasTokens test mode: %s, isHighContrast: %p', function (mode, isHighContrast) { return __awaiter(void 0, void 0, void 0, function () {
69
+ return __generator(this, function (_a) {
70
+ if (mode === 'highContrast') {
71
+ expect(function () { return createMacOSShadowAliasTokens(mode, isHighContrast); }).toThrow();
72
+ }
73
+ else {
74
+ expect(createMacOSShadowAliasTokens(mode, isHighContrast)).toMatchSnapshot();
75
+ }
76
+ return [2 /*return*/];
77
+ });
78
+ }); });
79
+ //# sourceMappingURL=apple-theme.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-theme.test.js","sourceRoot":"","sources":["../../src/__tests__/apple-theme.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,E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vC,gEAAgE,EAChE,UAAO,IAAuB,EAAE,cAAuB;;QACrD,IAAI,IAAI,KAAK,cAAc,EAAE;YAC3B,MAAM,CAAC,cAAM,OAAA,4BAA4B,CAAC,IAAI,EAAE,cAAc,CAAC,EAAlD,CAAkD,CAAC,CAAC,OAAO,EAAE,CAAC;SAC5E;aAAM;YACL,MAAM,CAAC,4BAA4B,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;SAC9E;;;KACF,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=apple-theme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-theme.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/apple-theme.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var createAppleTheme_1 = require("../createAppleTheme");
40
+ var createMacOSAliasTokens_1 = require("../createMacOSAliasTokens");
41
+ var appleHighContrast_macos_1 = require("../appleHighContrast.macos");
42
+ var macOsAliasTokensTable = [
43
+ ['light', true],
44
+ ['light', false],
45
+ ['dark', true],
46
+ ['dark', false],
47
+ ['highContrast', null],
48
+ ];
49
+ it('createAppleTheme test', function () {
50
+ var appleTheme = (0, createAppleTheme_1.createAppleTheme)().theme;
51
+ expect(appleTheme).toMatchSnapshot();
52
+ });
53
+ it('IsHighContrast test', function () {
54
+ (0, appleHighContrast_macos_1.setIsHighContrast)(false);
55
+ expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(false);
56
+ (0, appleHighContrast_macos_1.setIsHighContrast)(true);
57
+ expect((0, appleHighContrast_macos_1.getIsHighContrast)()).toBe(true);
58
+ });
59
+ it.concurrent.each(macOsAliasTokensTable)('createMacOSColorAliasTokens test mode: %s, isHighContrast: %p', function (mode, isHighContrast) { return __awaiter(void 0, void 0, void 0, function () {
60
+ return __generator(this, function (_a) {
61
+ if (mode === 'highContrast') {
62
+ expect(function () { return (0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast); }).toThrow();
63
+ }
64
+ else {
65
+ expect((0, createMacOSAliasTokens_1.createMacOSColorAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
66
+ }
67
+ return [2 /*return*/];
68
+ });
69
+ }); });
70
+ it.concurrent.each(macOsAliasTokensTable)('createMacOSShadowAliasTokens test mode: %s, isHighContrast: %p', function (mode, isHighContrast) { return __awaiter(void 0, void 0, void 0, function () {
71
+ return __generator(this, function (_a) {
72
+ if (mode === 'highContrast') {
73
+ expect(function () { return (0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast); }).toThrow();
74
+ }
75
+ else {
76
+ expect((0, createMacOSAliasTokens_1.createMacOSShadowAliasTokens)(mode, isHighContrast)).toMatchSnapshot();
77
+ }
78
+ return [2 /*return*/];
79
+ });
80
+ }); });
81
+ //# sourceMappingURL=apple-theme.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-theme.test.js","sourceRoot":"","sources":["../../src/__tests__/apple-theme.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAuD;AACvD,oEAAsG;AACtG,sEAAkF;AAGlF,IAAM,qBAAqB,GAAmC;IAC5D,CAAC,OAAO,EAAE,IAAI,CAAC;IACf,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,MAAM,EAAE,KAAK,CAAC;IACf,CAAC,cAAc,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,EAAE,CAAC,uBAAuB,EAAE;IAC1B,IAAM,UAAU,GAAG,IAAA,mCAAgB,GAAE,CAAC,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name": "@fluentui-react-native/apple-theme",
3
- "version": "0.13.3",
3
+ "version": "0.14.1",
4
4
  "description": "A FluentUI React Native theme that pulls constants from FluentUI Apple",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft <fluentuinativeowners@microsoft.com>",
@@ -27,12 +27,12 @@
27
27
  "directory": "packages/theming/apple-theme"
28
28
  },
29
29
  "dependencies": {
30
- "@fluentui-react-native/default-theme": ">=0.15.0 <1.0.0",
30
+ "@fluentui-react-native/default-theme": ">=0.15.1 <1.0.0",
31
31
  "@fluentui-react-native/design-tokens-macos": "^0.13.0",
32
32
  "@fluentui-react-native/memo-cache": "^1.1.7",
33
- "@fluentui-react-native/theme": ">=0.7.0 <1.0.0",
34
- "@fluentui-react-native/theme-types": ">=0.18.0 <1.0.0",
35
- "@fluentui-react-native/theming-utils": "^0.15.0",
33
+ "@fluentui-react-native/theme": ">=0.7.1 <1.0.0",
34
+ "@fluentui-react-native/theme-types": ">=0.19.0 <1.0.0",
35
+ "@fluentui-react-native/theming-utils": "^0.15.1",
36
36
  "assert-never": "^1.2.1"
37
37
  },
38
38
  "devDependencies": {