@fluentui-react-native/apple-theme 0.29.0 → 0.29.3

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 (95) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/lib/__tests__/apple-theme.test.d.ts +1 -1
  4. package/lib/__tests__/apple-theme.test.js +41 -42
  5. package/lib/appleColors.ios.d.ts +1 -1
  6. package/lib/appleColors.ios.js +174 -174
  7. package/lib/appleColors.macos.d.ts +1 -1
  8. package/lib/appleColors.macos.d.ts.map +1 -1
  9. package/lib/appleColors.macos.js +367 -369
  10. package/lib/appleColors.macos.js.map +1 -1
  11. package/lib/appleColors.types.ios.d.ts +15 -15
  12. package/lib/appleColors.types.ios.js +1 -1
  13. package/lib/appleColors.types.macos.d.ts +146 -146
  14. package/lib/appleColors.types.macos.js +1 -1
  15. package/lib/appleHighContrast.macos.d.ts +1 -1
  16. package/lib/appleHighContrast.macos.js +3 -3
  17. package/lib/appleShadows.ios.d.ts +1 -1
  18. package/lib/appleShadows.ios.js +4 -4
  19. package/lib/appleShadows.macos.d.ts +1 -1
  20. package/lib/appleShadows.macos.js +2 -2
  21. package/lib/appleTheme.ios.d.ts +1 -1
  22. package/lib/appleTheme.ios.js +122 -122
  23. package/lib/appleTheme.macos.d.ts +53 -53
  24. package/lib/appleTheme.macos.js +68 -68
  25. package/lib/appleTypography.ios.d.ts +1 -1
  26. package/lib/appleTypography.ios.js +50 -50
  27. package/lib/appleTypography.macos.d.ts +2 -2
  28. package/lib/appleTypography.macos.js +63 -63
  29. package/lib/createAppleTheme.d.ts +1 -1
  30. package/lib/createAppleTheme.ios.d.ts +1 -1
  31. package/lib/createAppleTheme.ios.js +14 -14
  32. package/lib/createAppleTheme.js +3 -3
  33. package/lib/createAppleTheme.macos.d.ts +1 -1
  34. package/lib/createAppleTheme.macos.d.ts.map +1 -1
  35. package/lib/createAppleTheme.macos.js +19 -23
  36. package/lib/createAppleTheme.macos.js.map +1 -1
  37. package/lib/createFontAliasTokens.ios.d.ts +1 -1
  38. package/lib/createFontAliasTokens.ios.js +2 -2
  39. package/lib/createMacOSAliasTokens.d.ts +1 -1
  40. package/lib/createMacOSAliasTokens.js +5 -5
  41. package/lib/createiOSAliasTokens.d.ts +1 -1
  42. package/lib/createiOSAliasTokens.js +5 -5
  43. package/lib/getMacOSTokens.d.ts +435 -443
  44. package/lib/getMacOSTokens.js +45 -35
  45. package/lib/index.d.ts +1 -1
  46. package/lib/index.js +1 -1
  47. package/lib-commonjs/__tests__/apple-theme.test.d.ts +1 -1
  48. package/lib-commonjs/__tests__/apple-theme.test.js +46 -47
  49. package/lib-commonjs/appleColors.ios.d.ts +1 -1
  50. package/lib-commonjs/appleColors.ios.js +180 -180
  51. package/lib-commonjs/appleColors.macos.d.ts +1 -1
  52. package/lib-commonjs/appleColors.macos.d.ts.map +1 -1
  53. package/lib-commonjs/appleColors.macos.js +372 -380
  54. package/lib-commonjs/appleColors.macos.js.map +1 -1
  55. package/lib-commonjs/appleColors.types.ios.d.ts +15 -15
  56. package/lib-commonjs/appleColors.types.ios.js +3 -3
  57. package/lib-commonjs/appleColors.types.macos.d.ts +146 -146
  58. package/lib-commonjs/appleColors.types.macos.js +3 -3
  59. package/lib-commonjs/appleHighContrast.macos.d.ts +1 -1
  60. package/lib-commonjs/appleHighContrast.macos.js +6 -6
  61. package/lib-commonjs/appleShadows.ios.d.ts +1 -1
  62. package/lib-commonjs/appleShadows.ios.js +9 -9
  63. package/lib-commonjs/appleShadows.macos.d.ts +1 -1
  64. package/lib-commonjs/appleShadows.macos.js +6 -6
  65. package/lib-commonjs/appleTheme.ios.d.ts +1 -1
  66. package/lib-commonjs/appleTheme.ios.js +128 -128
  67. package/lib-commonjs/appleTheme.macos.d.ts +53 -53
  68. package/lib-commonjs/appleTheme.macos.js +74 -74
  69. package/lib-commonjs/appleTypography.ios.d.ts +1 -1
  70. package/lib-commonjs/appleTypography.ios.js +53 -53
  71. package/lib-commonjs/appleTypography.macos.d.ts +2 -2
  72. package/lib-commonjs/appleTypography.macos.js +65 -65
  73. package/lib-commonjs/createAppleTheme.d.ts +1 -1
  74. package/lib-commonjs/createAppleTheme.ios.d.ts +1 -1
  75. package/lib-commonjs/createAppleTheme.ios.js +20 -20
  76. package/lib-commonjs/createAppleTheme.js +7 -7
  77. package/lib-commonjs/createAppleTheme.macos.d.ts +1 -1
  78. package/lib-commonjs/createAppleTheme.macos.d.ts.map +1 -1
  79. package/lib-commonjs/createAppleTheme.macos.js +27 -31
  80. package/lib-commonjs/createAppleTheme.macos.js.map +1 -1
  81. package/lib-commonjs/createFontAliasTokens.ios.d.ts +1 -1
  82. package/lib-commonjs/createFontAliasTokens.ios.js +10 -12
  83. package/lib-commonjs/createMacOSAliasTokens.d.ts +1 -1
  84. package/lib-commonjs/createMacOSAliasTokens.js +10 -10
  85. package/lib-commonjs/createiOSAliasTokens.d.ts +1 -1
  86. package/lib-commonjs/createiOSAliasTokens.js +10 -10
  87. package/lib-commonjs/getMacOSTokens.d.ts +435 -443
  88. package/lib-commonjs/getMacOSTokens.js +59 -51
  89. package/lib-commonjs/index.d.ts +1 -1
  90. package/lib-commonjs/index.js +10 -30
  91. package/package.json +27 -26
  92. package/src/appleColors.macos.ts +0 -2
  93. package/src/appleTypography.macos.ts +1 -1
  94. package/src/createAppleTheme.macos.ts +0 -4
  95. package/eslint.config.js +0 -3
@@ -1,57 +1,65 @@
1
- 'use strict';
2
- var __importDefault =
3
- (this && this.__importDefault) ||
4
- function (mod) {
5
- return mod && mod.__esModule ? mod : { default: mod };
6
- };
7
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
8
6
  exports.getMacOSAliasTokens = getMacOSAliasTokens;
9
7
  exports.getMacOSShadowTokens = getMacOSShadowTokens;
10
- const tokens_aliases_json_1 = __importDefault(require('@fluentui-react-native/design-tokens-macos/dark/tokens-aliases.json'));
11
- const tokens_shadow_json_1 = __importDefault(require('@fluentui-react-native/design-tokens-macos/dark/tokens-shadow.json'));
12
- const tokens_aliases_json_2 = __importDefault(require('@fluentui-react-native/design-tokens-macos/hcdark/tokens-aliases.json'));
13
- const tokens_shadow_json_2 = __importDefault(require('@fluentui-react-native/design-tokens-macos/hcdark/tokens-shadow.json'));
14
- const tokens_aliases_json_3 = __importDefault(require('@fluentui-react-native/design-tokens-macos/hclight/tokens-aliases.json'));
15
- const tokens_shadow_json_3 = __importDefault(require('@fluentui-react-native/design-tokens-macos/hclight/tokens-shadow.json'));
16
- const tokens_aliases_json_4 = __importDefault(require('@fluentui-react-native/design-tokens-macos/light/tokens-aliases.json'));
17
- const tokens_shadow_json_4 = __importDefault(require('@fluentui-react-native/design-tokens-macos/light/tokens-shadow.json'));
18
- const assert_never_1 = require('assert-never');
8
+ const tokens_aliases_json_1 = __importDefault(require("@fluentui-react-native/design-tokens-macos/dark/tokens-aliases.json"));
9
+ const tokens_shadow_json_1 = __importDefault(require("@fluentui-react-native/design-tokens-macos/dark/tokens-shadow.json"));
10
+ const tokens_aliases_json_2 = __importDefault(require("@fluentui-react-native/design-tokens-macos/hcdark/tokens-aliases.json"));
11
+ const tokens_shadow_json_2 = __importDefault(require("@fluentui-react-native/design-tokens-macos/hcdark/tokens-shadow.json"));
12
+ const tokens_aliases_json_3 = __importDefault(require("@fluentui-react-native/design-tokens-macos/hclight/tokens-aliases.json"));
13
+ const tokens_shadow_json_3 = __importDefault(require("@fluentui-react-native/design-tokens-macos/hclight/tokens-shadow.json"));
14
+ const tokens_aliases_json_4 = __importDefault(require("@fluentui-react-native/design-tokens-macos/light/tokens-aliases.json"));
15
+ const tokens_shadow_json_4 = __importDefault(require("@fluentui-react-native/design-tokens-macos/light/tokens-shadow.json"));
16
+ const assert_never_1 = require("assert-never");
19
17
  function getMacOSAliasTokens(mode, isHighContrast) {
20
- if (mode === 'light') {
21
- if (isHighContrast) {
22
- return tokens_aliases_json_3.default;
23
- } else {
24
- return tokens_aliases_json_4.default;
25
- }
26
- } else if (mode === 'dark' || mode === 'darkElevated') {
27
- if (isHighContrast) {
28
- return tokens_aliases_json_2.default;
29
- } else {
30
- return tokens_aliases_json_1.default;
31
- }
32
- } else if (mode === 'highContrast') {
33
- throw new Error('highContrast is not a valid AppearanceOptions on macOS');
34
- } else {
35
- (0, assert_never_1.assertNever)(mode);
36
- }
18
+ if (mode === 'light') {
19
+ if (isHighContrast) {
20
+ return tokens_aliases_json_3.default;
21
+ }
22
+ else {
23
+ return tokens_aliases_json_4.default;
24
+ }
25
+ }
26
+ else if (mode === 'dark' || mode === 'darkElevated') {
27
+ if (isHighContrast) {
28
+ return tokens_aliases_json_2.default;
29
+ }
30
+ else {
31
+ return tokens_aliases_json_1.default;
32
+ }
33
+ }
34
+ else if (mode === 'highContrast') {
35
+ throw new Error('highContrast is not a valid AppearanceOptions on macOS');
36
+ }
37
+ else {
38
+ (0, assert_never_1.assertNever)(mode);
39
+ }
37
40
  }
38
41
  function getMacOSShadowTokens(mode, isHighContrast) {
39
- if (mode === 'light') {
40
- if (isHighContrast) {
41
- return tokens_shadow_json_3.default;
42
- } else {
43
- return tokens_shadow_json_4.default;
44
- }
45
- } else if (mode === 'dark' || mode === 'darkElevated') {
46
- if (isHighContrast) {
47
- return tokens_shadow_json_2.default;
48
- } else {
49
- return tokens_shadow_json_1.default;
50
- }
51
- } else if (mode === 'highContrast') {
52
- throw new Error('highContrast is not a valid AppearanceOptions on macOS');
53
- } else {
54
- (0, assert_never_1.assertNever)(mode);
55
- }
42
+ if (mode === 'light') {
43
+ if (isHighContrast) {
44
+ return tokens_shadow_json_3.default;
45
+ }
46
+ else {
47
+ return tokens_shadow_json_4.default;
48
+ }
49
+ }
50
+ else if (mode === 'dark' || mode === 'darkElevated') {
51
+ if (isHighContrast) {
52
+ return tokens_shadow_json_2.default;
53
+ }
54
+ else {
55
+ return tokens_shadow_json_1.default;
56
+ }
57
+ }
58
+ else if (mode === 'highContrast') {
59
+ throw new Error('highContrast is not a valid AppearanceOptions on macOS');
60
+ }
61
+ else {
62
+ (0, assert_never_1.assertNever)(mode);
63
+ }
56
64
  }
57
- //# sourceMappingURL=getMacOSTokens.js.map
65
+ //# sourceMappingURL=getMacOSTokens.js.map
@@ -1,4 +1,4 @@
1
1
  export { createAppleTheme } from './createAppleTheme';
2
2
  export { createMacOSColorAliasTokens as createMacOSAliasTokens } from './createMacOSAliasTokens';
3
3
  export { getIsHighContrast, setIsHighContrast } from './appleHighContrast.macos';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,31 +1,11 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setIsHighContrast = exports.getIsHighContrast = exports.createMacOSAliasTokens = exports.createAppleTheme = void 0;
4
- const createAppleTheme_1 = require('./createAppleTheme');
5
- Object.defineProperty(exports, 'createAppleTheme', {
6
- enumerable: true,
7
- get: function () {
8
- return createAppleTheme_1.createAppleTheme;
9
- },
10
- });
11
- const createMacOSAliasTokens_1 = require('./createMacOSAliasTokens');
12
- Object.defineProperty(exports, 'createMacOSAliasTokens', {
13
- enumerable: true,
14
- get: function () {
15
- return createMacOSAliasTokens_1.createMacOSColorAliasTokens;
16
- },
17
- });
18
- const appleHighContrast_macos_1 = require('./appleHighContrast.macos');
19
- Object.defineProperty(exports, 'getIsHighContrast', {
20
- enumerable: true,
21
- get: function () {
22
- return appleHighContrast_macos_1.getIsHighContrast;
23
- },
24
- });
25
- Object.defineProperty(exports, 'setIsHighContrast', {
26
- enumerable: true,
27
- get: function () {
28
- return appleHighContrast_macos_1.setIsHighContrast;
29
- },
30
- });
31
- //# sourceMappingURL=index.js.map
4
+ const createAppleTheme_1 = require("./createAppleTheme");
5
+ Object.defineProperty(exports, "createAppleTheme", { enumerable: true, get: function () { return createAppleTheme_1.createAppleTheme; } });
6
+ const createMacOSAliasTokens_1 = require("./createMacOSAliasTokens");
7
+ Object.defineProperty(exports, "createMacOSAliasTokens", { enumerable: true, get: function () { return createMacOSAliasTokens_1.createMacOSColorAliasTokens; } });
8
+ const appleHighContrast_macos_1 = require("./appleHighContrast.macos");
9
+ Object.defineProperty(exports, "getIsHighContrast", { enumerable: true, get: function () { return appleHighContrast_macos_1.getIsHighContrast; } });
10
+ Object.defineProperty(exports, "setIsHighContrast", { enumerable: true, get: function () { return appleHighContrast_macos_1.setIsHighContrast; } });
11
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,74 +1,75 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/apple-theme",
3
- "version": "0.29.0",
3
+ "version": "0.29.3",
4
4
  "description": "A FluentUI React Native theme that pulls constants from FluentUI Apple",
5
5
  "homepage": "https://github.com/microsoft/fluentui-react-native",
6
+ "license": "MIT",
7
+ "author": "Microsoft <fluentuinativeowners@microsoft.com>",
6
8
  "repository": {
7
9
  "type": "git",
8
10
  "url": "https://github.com/microsoft/fluentui-react-native.git",
9
11
  "directory": "packages/theming/apple-theme"
10
12
  },
11
- "license": "MIT",
12
- "author": "Microsoft <fluentuinativeowners@microsoft.com>",
13
+ "main": "lib-commonjs/index.js",
14
+ "module": "lib/index.js",
15
+ "types": "lib/index.d.ts",
13
16
  "exports": {
14
17
  ".": {
15
18
  "types": "./lib/index.d.ts",
16
19
  "import": "./lib/index.js",
17
- "require": "./lib-commonjs/index.js"
20
+ "require": "./lib-commonjs/index.js",
21
+ "default": "./src/index.ts"
18
22
  }
19
23
  },
20
- "main": "lib-commonjs/index.js",
21
- "module": "lib/index.js",
22
- "types": "lib/index.d.ts",
23
24
  "scripts": {
24
25
  "build": "fluentui-scripts build",
25
26
  "build-cjs": "tsgo --outDir lib-commonjs",
26
- "build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
27
+ "build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
27
28
  "clean": "fluentui-scripts clean",
28
29
  "depcheck": "fluentui-scripts depcheck",
29
- "lint": "fluentui-scripts eslint",
30
+ "format": "fluentui-scripts format",
31
+ "lint": "fluentui-scripts lint",
30
32
  "lint-package": "fluentui-scripts lint-package",
31
- "prettier": "fluentui-scripts prettier",
32
33
  "start": "fluentui-scripts dev",
33
34
  "start-test": "fluentui-scripts jest-watch",
34
35
  "test": "fluentui-scripts jest",
35
36
  "update-snapshots": "fluentui-scripts jest -u"
36
37
  },
37
38
  "dependencies": {
38
- "@fluentui-react-native/default-theme": "0.27.0",
39
+ "@fluentui-react-native/default-theme": "0.27.3",
39
40
  "@fluentui-react-native/design-tokens-ios": "^0.53.0",
40
41
  "@fluentui-react-native/design-tokens-macos": "^0.53.0",
41
- "@fluentui-react-native/experimental-appearance-additions": "0.8.0",
42
- "@fluentui-react-native/framework-base": "0.3.0",
43
- "@fluentui-react-native/theme": "0.12.0",
44
- "@fluentui-react-native/theme-tokens": "0.28.0",
45
- "@fluentui-react-native/theme-types": "0.44.0",
46
- "@fluentui-react-native/theming-utils": "0.27.0",
42
+ "@fluentui-react-native/experimental-appearance-additions": "0.8.3",
43
+ "@fluentui-react-native/framework-base": "0.3.3",
44
+ "@fluentui-react-native/theme": "0.12.3",
45
+ "@fluentui-react-native/theme-tokens": "0.28.3",
46
+ "@fluentui-react-native/theme-types": "0.44.3",
47
+ "@fluentui-react-native/theming-utils": "0.27.3",
47
48
  "assert-never": "^1.2.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@babel/core": "^7.20.0",
51
52
  "@fluentui-react-native/babel-config": "0.1.1",
52
- "@fluentui-react-native/eslint-config-rules": "0.1.1",
53
- "@fluentui-react-native/jest-config": "0.1.1",
53
+ "@fluentui-react-native/jest-config": "0.1.0",
54
54
  "@fluentui-react-native/kit-config": "0.1.2",
55
- "@fluentui-react-native/scripts": "0.1.2",
55
+ "@fluentui-react-native/lint-config-rules": "0.1.3",
56
+ "@fluentui-react-native/scripts": "0.1.0",
56
57
  "@react-native-community/cli": "^20.0.0",
57
58
  "@react-native-community/cli-platform-android": "^20.0.0",
58
59
  "@react-native-community/cli-platform-ios": "^20.0.0",
59
60
  "@react-native/babel-preset": "^0.81.0",
60
61
  "@react-native/metro-config": "^0.81.0",
61
- "@types/react": "~19.1.0",
62
- "react": "19.1.0",
63
- "react-native": "^0.81.0",
62
+ "@types/react": "~19.1.4",
63
+ "react": "19.1.4",
64
+ "react-native": "^0.81.6",
64
65
  "react-native-macos": "^0.81.0",
65
66
  "react-native-windows": "^0.81.0"
66
67
  },
67
68
  "peerDependencies": {
68
69
  "@office-iss/react-native-win32": "^0.74.0",
69
- "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
70
- "react": "18.2.0 || 19.0.0 || 19.1.0",
71
- "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
70
+ "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.4",
71
+ "react": "18.2.0 || 19.0.0 || 19.1.4",
72
+ "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.6",
72
73
  "react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
73
74
  "react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
74
75
  },
@@ -1,6 +1,4 @@
1
1
  import type { ThemeColorDefinition, AppearanceOptions } from '@fluentui-react-native/theme-types';
2
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
- // @ts-ignore
4
2
  import { PlatformColor, DynamicColorMacOS, ColorWithSystemEffectMacOS } from 'react-native-macos';
5
3
 
6
4
  import type { AppleSemanticPalette, FluentUIApplePalette } from './appleColors.types.macos';
@@ -2,7 +2,7 @@ import type { FontSize, FontSizes, FontWeightValue, Typography, Variants } from
2
2
 
3
3
  /**
4
4
  * The Typography is designed to match the styles defined in the Apple HIG:
5
- * https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/typography/
5
+ * https://developer.apple.com/design/human-interface-guidelines/typography
6
6
  * These mappings and variants are subject to change as we moved to a unified cross platform Fluent typography ramp
7
7
  * Github #598 also tracks pulling these values from a Native Module rather than hardcoding the numbers in JS.
8
8
  */
@@ -19,8 +19,6 @@ export function createAppleTheme(): ThemeReference {
19
19
  // Fetch initial system settings for high contrast mode
20
20
  highContrastHandler();
21
21
  // Invalidate theme and set prop when high contrast setting changes
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
22
  AccessibilityInfo.addEventListener('highContrastChanged', () => {
25
23
  highContrastHandler();
26
24
  });
@@ -32,8 +30,6 @@ export function createAppleTheme(): ThemeReference {
32
30
  }
33
31
 
34
32
  function highContrastHandler() {
35
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
36
- // @ts-ignore
37
33
  AccessibilityInfo.isHighContrastEnabled().then((isEnabled) => {
38
34
  setIsHighContrast(isEnabled);
39
35
  appleThemeReference.invalidate();
package/eslint.config.js DELETED
@@ -1,3 +0,0 @@
1
- const baseConfig = require('@fluentui-react-native/eslint-config-rules');
2
-
3
- module.exports = baseConfig;