@fluentui-react-native/text 0.24.20 → 0.25.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 (75) hide show
  1. package/CHANGELOG.md +54 -1
  2. package/SPEC.md +1 -1
  3. package/lib/Text.d.ts +6 -2
  4. package/lib/Text.d.ts.map +1 -1
  5. package/lib/Text.js +124 -91
  6. package/lib/Text.js.map +1 -1
  7. package/lib/Text.types.d.ts +9 -6
  8. package/lib/Text.types.js +1 -1
  9. package/lib/TextTokens.d.ts +2 -2
  10. package/lib/TextTokens.js +6 -3
  11. package/lib/Variants.android.d.ts +61 -13
  12. package/lib/Variants.android.d.ts.map +1 -1
  13. package/lib/Variants.android.js +13 -13
  14. package/lib/Variants.d.ts +86 -18
  15. package/lib/Variants.d.ts.map +1 -1
  16. package/lib/Variants.ios.d.ts +61 -13
  17. package/lib/Variants.ios.d.ts.map +1 -1
  18. package/lib/Variants.ios.js +13 -13
  19. package/lib/Variants.js +1 -1
  20. package/lib/Variants.win32.d.ts +66 -14
  21. package/lib/Variants.win32.d.ts.map +1 -1
  22. package/lib/Variants.win32.js +14 -14
  23. package/lib/Variants.windows.d.ts +66 -14
  24. package/lib/Variants.windows.d.ts.map +1 -1
  25. package/lib/Variants.windows.js +14 -14
  26. package/lib/__tests__/Text.test.d.ts +1 -1
  27. package/lib/__tests__/Text.test.js +36 -23
  28. package/lib/__tests__/Text.test.js.map +1 -1
  29. package/lib/deprecated/Text.d.ts +14 -4
  30. package/lib/deprecated/Text.js +9 -9
  31. package/lib/deprecated/Text.settings.d.ts +1 -1
  32. package/lib/deprecated/Text.settings.js +18 -18
  33. package/lib/deprecated/Text.types.d.ts +11 -9
  34. package/lib/deprecated/Text.types.js +1 -1
  35. package/lib/index.d.ts +20 -2
  36. package/lib/index.js +20 -2
  37. package/lib-commonjs/Text.d.ts +6 -2
  38. package/lib-commonjs/Text.d.ts.map +1 -1
  39. package/lib-commonjs/Text.js +142 -102
  40. package/lib-commonjs/Text.js.map +1 -1
  41. package/lib-commonjs/Text.types.d.ts +9 -6
  42. package/lib-commonjs/Text.types.js +3 -3
  43. package/lib-commonjs/TextTokens.d.ts +2 -2
  44. package/lib-commonjs/TextTokens.js +10 -7
  45. package/lib-commonjs/Variants.android.d.ts +61 -13
  46. package/lib-commonjs/Variants.android.d.ts.map +1 -1
  47. package/lib-commonjs/Variants.android.js +34 -17
  48. package/lib-commonjs/Variants.d.ts +86 -18
  49. package/lib-commonjs/Variants.d.ts.map +1 -1
  50. package/lib-commonjs/Variants.ios.d.ts +61 -13
  51. package/lib-commonjs/Variants.ios.d.ts.map +1 -1
  52. package/lib-commonjs/Variants.ios.js +34 -17
  53. package/lib-commonjs/Variants.js +22 -5
  54. package/lib-commonjs/Variants.win32.d.ts +66 -14
  55. package/lib-commonjs/Variants.win32.d.ts.map +1 -1
  56. package/lib-commonjs/Variants.win32.js +35 -18
  57. package/lib-commonjs/Variants.windows.d.ts +66 -14
  58. package/lib-commonjs/Variants.windows.d.ts.map +1 -1
  59. package/lib-commonjs/Variants.windows.js +35 -18
  60. package/lib-commonjs/__tests__/Text.test.d.ts +1 -1
  61. package/lib-commonjs/__tests__/Text.test.js +92 -50
  62. package/lib-commonjs/__tests__/Text.test.js.map +1 -1
  63. package/lib-commonjs/deprecated/Text.d.ts +14 -4
  64. package/lib-commonjs/deprecated/Text.js +17 -17
  65. package/lib-commonjs/deprecated/Text.js.map +1 -1
  66. package/lib-commonjs/deprecated/Text.settings.d.ts +1 -1
  67. package/lib-commonjs/deprecated/Text.settings.js +21 -21
  68. package/lib-commonjs/deprecated/Text.types.d.ts +11 -9
  69. package/lib-commonjs/deprecated/Text.types.js +3 -3
  70. package/lib-commonjs/index.d.ts +20 -2
  71. package/lib-commonjs/index.js +156 -30
  72. package/lib-commonjs/index.js.map +1 -1
  73. package/package.json +63 -62
  74. package/src/Text.tsx +8 -9
  75. package/src/__tests__/Text.test.tsx +25 -13
@@ -1,31 +1,157 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Text = exports.textName = exports.Display = exports.LargeTitle = exports.Title3 = exports.Title2 = exports.Title1Strong = exports.Title1 = exports.Subtitle2Strong = exports.Subtitle2 = exports.Subtitle1Strong = exports.Subtitle1 = exports.Body2Strong = exports.Body2 = exports.Body1Strong = exports.Body1 = exports.Caption2 = exports.Caption1Strong = exports.Caption1 = exports.textNameV1 = exports.TextV1 = void 0;
4
- var Text_1 = require("./Text");
5
- Object.defineProperty(exports, "TextV1", { enumerable: true, get: function () { return Text_1.Text; } });
6
- var Text_types_1 = require("./Text.types");
7
- Object.defineProperty(exports, "textNameV1", { enumerable: true, get: function () { return Text_types_1.textName; } });
8
- var Variants_1 = require("./Variants");
9
- Object.defineProperty(exports, "Caption1", { enumerable: true, get: function () { return Variants_1.Caption1; } });
10
- Object.defineProperty(exports, "Caption1Strong", { enumerable: true, get: function () { return Variants_1.Caption1Strong; } });
11
- Object.defineProperty(exports, "Caption2", { enumerable: true, get: function () { return Variants_1.Caption2; } });
12
- Object.defineProperty(exports, "Body1", { enumerable: true, get: function () { return Variants_1.Body1; } });
13
- Object.defineProperty(exports, "Body1Strong", { enumerable: true, get: function () { return Variants_1.Body1Strong; } });
14
- Object.defineProperty(exports, "Body2", { enumerable: true, get: function () { return Variants_1.Body2; } });
15
- Object.defineProperty(exports, "Body2Strong", { enumerable: true, get: function () { return Variants_1.Body2Strong; } });
16
- Object.defineProperty(exports, "Subtitle1", { enumerable: true, get: function () { return Variants_1.Subtitle1; } });
17
- Object.defineProperty(exports, "Subtitle1Strong", { enumerable: true, get: function () { return Variants_1.Subtitle1Strong; } });
18
- Object.defineProperty(exports, "Subtitle2", { enumerable: true, get: function () { return Variants_1.Subtitle2; } });
19
- Object.defineProperty(exports, "Subtitle2Strong", { enumerable: true, get: function () { return Variants_1.Subtitle2Strong; } });
20
- Object.defineProperty(exports, "Title1", { enumerable: true, get: function () { return Variants_1.Title1; } });
21
- Object.defineProperty(exports, "Title1Strong", { enumerable: true, get: function () { return Variants_1.Title1Strong; } });
22
- Object.defineProperty(exports, "Title2", { enumerable: true, get: function () { return Variants_1.Title2; } });
23
- Object.defineProperty(exports, "Title3", { enumerable: true, get: function () { return Variants_1.Title3; } });
24
- Object.defineProperty(exports, "LargeTitle", { enumerable: true, get: function () { return Variants_1.LargeTitle; } });
25
- Object.defineProperty(exports, "Display", { enumerable: true, get: function () { return Variants_1.Display; } });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.Text =
4
+ exports.textName =
5
+ exports.Display =
6
+ exports.LargeTitle =
7
+ exports.Title3 =
8
+ exports.Title2 =
9
+ exports.Title1Strong =
10
+ exports.Title1 =
11
+ exports.Subtitle2Strong =
12
+ exports.Subtitle2 =
13
+ exports.Subtitle1Strong =
14
+ exports.Subtitle1 =
15
+ exports.Body2Strong =
16
+ exports.Body2 =
17
+ exports.Body1Strong =
18
+ exports.Body1 =
19
+ exports.Caption2 =
20
+ exports.Caption1Strong =
21
+ exports.Caption1 =
22
+ exports.textNameV1 =
23
+ exports.TextV1 =
24
+ void 0;
25
+ const Text_1 = require('./Text');
26
+ Object.defineProperty(exports, 'TextV1', {
27
+ enumerable: true,
28
+ get: function () {
29
+ return Text_1.Text;
30
+ },
31
+ });
32
+ const Text_types_1 = require('./Text.types');
33
+ Object.defineProperty(exports, 'textNameV1', {
34
+ enumerable: true,
35
+ get: function () {
36
+ return Text_types_1.textName;
37
+ },
38
+ });
39
+ const Variants_1 = require('./Variants');
40
+ Object.defineProperty(exports, 'Caption1', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return Variants_1.Caption1;
44
+ },
45
+ });
46
+ Object.defineProperty(exports, 'Caption1Strong', {
47
+ enumerable: true,
48
+ get: function () {
49
+ return Variants_1.Caption1Strong;
50
+ },
51
+ });
52
+ Object.defineProperty(exports, 'Caption2', {
53
+ enumerable: true,
54
+ get: function () {
55
+ return Variants_1.Caption2;
56
+ },
57
+ });
58
+ Object.defineProperty(exports, 'Body1', {
59
+ enumerable: true,
60
+ get: function () {
61
+ return Variants_1.Body1;
62
+ },
63
+ });
64
+ Object.defineProperty(exports, 'Body1Strong', {
65
+ enumerable: true,
66
+ get: function () {
67
+ return Variants_1.Body1Strong;
68
+ },
69
+ });
70
+ Object.defineProperty(exports, 'Body2', {
71
+ enumerable: true,
72
+ get: function () {
73
+ return Variants_1.Body2;
74
+ },
75
+ });
76
+ Object.defineProperty(exports, 'Body2Strong', {
77
+ enumerable: true,
78
+ get: function () {
79
+ return Variants_1.Body2Strong;
80
+ },
81
+ });
82
+ Object.defineProperty(exports, 'Subtitle1', {
83
+ enumerable: true,
84
+ get: function () {
85
+ return Variants_1.Subtitle1;
86
+ },
87
+ });
88
+ Object.defineProperty(exports, 'Subtitle1Strong', {
89
+ enumerable: true,
90
+ get: function () {
91
+ return Variants_1.Subtitle1Strong;
92
+ },
93
+ });
94
+ Object.defineProperty(exports, 'Subtitle2', {
95
+ enumerable: true,
96
+ get: function () {
97
+ return Variants_1.Subtitle2;
98
+ },
99
+ });
100
+ Object.defineProperty(exports, 'Subtitle2Strong', {
101
+ enumerable: true,
102
+ get: function () {
103
+ return Variants_1.Subtitle2Strong;
104
+ },
105
+ });
106
+ Object.defineProperty(exports, 'Title1', {
107
+ enumerable: true,
108
+ get: function () {
109
+ return Variants_1.Title1;
110
+ },
111
+ });
112
+ Object.defineProperty(exports, 'Title1Strong', {
113
+ enumerable: true,
114
+ get: function () {
115
+ return Variants_1.Title1Strong;
116
+ },
117
+ });
118
+ Object.defineProperty(exports, 'Title2', {
119
+ enumerable: true,
120
+ get: function () {
121
+ return Variants_1.Title2;
122
+ },
123
+ });
124
+ Object.defineProperty(exports, 'Title3', {
125
+ enumerable: true,
126
+ get: function () {
127
+ return Variants_1.Title3;
128
+ },
129
+ });
130
+ Object.defineProperty(exports, 'LargeTitle', {
131
+ enumerable: true,
132
+ get: function () {
133
+ return Variants_1.LargeTitle;
134
+ },
135
+ });
136
+ Object.defineProperty(exports, 'Display', {
137
+ enumerable: true,
138
+ get: function () {
139
+ return Variants_1.Display;
140
+ },
141
+ });
26
142
  /* deprecated */
27
- var Text_types_2 = require("./deprecated/Text.types");
28
- Object.defineProperty(exports, "textName", { enumerable: true, get: function () { return Text_types_2.textName; } });
29
- var Text_2 = require("./deprecated/Text");
30
- Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_2.Text; } });
31
- //# sourceMappingURL=index.js.map
143
+ const Text_types_2 = require('./deprecated/Text.types');
144
+ Object.defineProperty(exports, 'textName', {
145
+ enumerable: true,
146
+ get: function () {
147
+ return Text_types_2.textName;
148
+ },
149
+ });
150
+ const Text_2 = require('./deprecated/Text');
151
+ Object.defineProperty(exports, 'Text', {
152
+ enumerable: true,
153
+ get: function () {
154
+ return Text_2.Text;
155
+ },
156
+ });
157
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAwC;AAA/B,8FAAA,IAAI,OAAU;AAEvB,2CAAsD;AAA7C,wGAAA,QAAQ,OAAc;AAC/B,uCAkBoB;AAjBlB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,oGAAA,QAAQ,OAAA;AACR,iGAAA,KAAK,OAAA;AACL,uGAAA,WAAW,OAAA;AACX,iGAAA,KAAK,OAAA;AACL,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,kGAAA,MAAM,OAAA;AACN,wGAAA,YAAY,OAAA;AACZ,kGAAA,MAAM,OAAA;AACN,kGAAA,MAAM,OAAA;AACN,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGT,gBAAgB;AAChB,sDAAmD;AAA1C,sGAAA,QAAQ,OAAA;AAEjB,0CAAyC;AAAhC,4FAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAA/B,8FAAA,IAAI,OAAU;AAEvB,6CAAsD;AAA7C,wGAAA,QAAQ,OAAc;AAC/B,yCAkBoB;AAjBlB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,oGAAA,QAAQ,OAAA;AACR,iGAAA,KAAK,OAAA;AACL,uGAAA,WAAW,OAAA;AACX,iGAAA,KAAK,OAAA;AACL,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,kGAAA,MAAM,OAAA;AACN,wGAAA,YAAY,OAAA;AACZ,kGAAA,MAAM,OAAA;AACN,kGAAA,MAAM,OAAA;AACN,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGT,gBAAgB;AAChB,wDAAmD;AAA1C,sGAAA,QAAQ,OAAA;AAEjB,4CAAyC;AAAhC,4FAAA,IAAI,OAAA"}
package/package.json CHANGED
@@ -1,82 +1,91 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/text",
3
- "version": "0.24.20",
3
+ "version": "0.25.0",
4
4
  "description": "A cross-platform Text component using the Fluent Design System",
5
- "main": "lib-commonjs/index.js",
6
- "module": "lib/index.js",
7
- "react-native": "src/index.ts",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/microsoft/fluentui-react-native.git",
8
+ "directory": "packages/components/text"
9
+ },
10
+ "license": "MIT",
11
+ "author": "",
8
12
  "exports": {
9
13
  ".": {
14
+ "types": "./lib/index.d.ts",
10
15
  "import": "./lib/index.js",
11
- "require": "./lib-commonjs/index.js",
12
- "types": "./lib/index.d.ts"
16
+ "require": "./lib-commonjs/index.js"
13
17
  }
14
18
  },
15
- "typings": "lib/index.d.ts",
19
+ "main": "lib-commonjs/index.js",
20
+ "module": "lib/index.js",
21
+ "types": "lib/index.d.ts",
16
22
  "scripts": {
17
23
  "build": "fluentui-scripts build",
18
- "just": "fluentui-scripts",
24
+ "build-cjs": "tsgo --outDir lib-commonjs",
25
+ "build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
19
26
  "clean": "fluentui-scripts clean",
20
27
  "depcheck": "fluentui-scripts depcheck",
21
28
  "lint": "fluentui-scripts eslint",
22
- "test": "fluentui-scripts jest",
23
- "update-snapshots": "fluentui-scripts jest -u",
29
+ "lint-package": "fluentui-scripts lint-package",
24
30
  "prettier": "fluentui-scripts prettier",
25
- "prettier-fix": "fluentui-scripts prettier --fix true"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/microsoft/fluentui-react-native.git",
30
- "directory": "packages/components/text"
31
+ "test": "fluentui-scripts jest",
32
+ "update-snapshots": "fluentui-scripts jest -u"
31
33
  },
32
34
  "dependencies": {
33
- "@fluentui-react-native/adapters": "0.13.5",
34
- "@fluentui-react-native/framework": "0.14.16",
35
- "@fluentui-react-native/interactive-hooks": "0.27.18",
36
- "@fluentui-react-native/theme-tokens": "0.27.10",
37
- "@fluentui-react-native/tokens": "0.23.10",
38
- "@uifabricshared/foundation-compose": "1.15.16"
35
+ "@fluentui-react-native/adapters": "0.14.0",
36
+ "@fluentui-react-native/framework": "0.15.0",
37
+ "@fluentui-react-native/interactive-hooks": "0.28.0",
38
+ "@fluentui-react-native/theme-tokens": "0.28.0",
39
+ "@fluentui-react-native/tokens": "0.24.0",
40
+ "@uifabricshared/foundation-compose": "1.16.0"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@babel/core": "^7.20.0",
42
44
  "@fluentui-react-native/babel-config": "0.1.1",
43
45
  "@fluentui-react-native/eslint-config-rules": "0.1.1",
46
+ "@fluentui-react-native/framework-base": "0.3.0",
44
47
  "@fluentui-react-native/jest-config": "0.1.1",
45
- "@fluentui-react-native/scripts": "0.1.1",
48
+ "@fluentui-react-native/kit-config": "0.1.2",
49
+ "@fluentui-react-native/scripts": "0.1.2",
46
50
  "@fluentui-react-native/test-tools": "0.1.1",
47
- "@react-native/babel-preset": "^0.74.0",
48
- "@react-native/metro-config": "^0.74.0",
49
- "@types/react": "~18.2.0",
50
- "@types/react-test-renderer": "^18.2.0",
51
- "react": "18.2.0",
52
- "react-native": "^0.74.0",
53
- "react-native-macos": "^0.74.0",
54
- "react-native-windows": "^0.74.0",
55
- "react-test-renderer": "18.2.0"
51
+ "@react-native-community/cli": "^20.0.0",
52
+ "@react-native-community/cli-platform-android": "^20.0.0",
53
+ "@react-native-community/cli-platform-ios": "^20.0.0",
54
+ "@react-native/babel-preset": "^0.81.0",
55
+ "@react-native/metro-config": "^0.81.0",
56
+ "@types/react": "~19.1.0",
57
+ "@types/react-test-renderer": "^19.1.0",
58
+ "react": "19.1.0",
59
+ "react-native": "^0.81.0",
60
+ "react-native-macos": "^0.81.0",
61
+ "react-native-windows": "^0.81.0",
62
+ "react-test-renderer": "19.1.0"
56
63
  },
57
64
  "peerDependencies": {
58
65
  "@office-iss/react-native-win32": "^0.74.0",
59
- "react": "18.2.0",
60
- "react-native": "^0.73.0 || ^0.74.0",
61
- "react-native-macos": "^0.73.0 || ^0.74.0",
62
- "react-native-windows": "^0.73.0 || ^0.74.0"
66
+ "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
67
+ "react": "18.2.0 || 19.0.0 || 19.1.0",
68
+ "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
69
+ "react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
70
+ "react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "@office-iss/react-native-win32": {
74
+ "optional": true
75
+ },
76
+ "@types/react": {
77
+ "optional": true
78
+ },
79
+ "react-native-macos": {
80
+ "optional": true
81
+ },
82
+ "react-native-windows": {
83
+ "optional": true
84
+ }
63
85
  },
64
- "author": "",
65
- "license": "MIT",
66
86
  "rnx-kit": {
67
87
  "kitType": "library",
68
88
  "alignDeps": {
69
- "presets": [
70
- "microsoft/react-native"
71
- ],
72
- "requirements": {
73
- "development": [
74
- "react-native@0.74"
75
- ],
76
- "production": [
77
- "react-native@0.73 || 0.74"
78
- ]
79
- },
80
89
  "capabilities": [
81
90
  "babel-preset-react-native",
82
91
  "core",
@@ -85,19 +94,11 @@
85
94
  "core-macos",
86
95
  "core-windows",
87
96
  "react",
88
- "react-test-renderer"
97
+ "react-test-renderer",
98
+ "tools-core",
99
+ "tools-jest"
89
100
  ]
90
- }
91
- },
92
- "peerDependenciesMeta": {
93
- "@office-iss/react-native-win32": {
94
- "optional": true
95
101
  },
96
- "react-native-macos": {
97
- "optional": true
98
- },
99
- "react-native-windows": {
100
- "optional": true
101
- }
102
+ "extends": "@fluentui-react-native/kit-config"
102
103
  }
103
- }
104
+ }
package/src/Text.tsx CHANGED
@@ -1,10 +1,9 @@
1
- /** @jsxRuntime classic */
2
- /** @jsx withSlots */
1
+ /** @jsxImportSource @fluentui-react-native/framework-base */
3
2
  import React from 'react';
4
3
  import { I18nManager, Platform, Text as RNText } from 'react-native';
5
4
 
6
5
  import type { UseTokens, FontWeightValue } from '@fluentui-react-native/framework';
7
- import { fontStyles, withSlots, useFluentTheme, mergeStyles, compressible, patchTokens } from '@fluentui-react-native/framework';
6
+ import { fontStyles, useFluentTheme, mergeStyles, compressible, patchTokens } from '@fluentui-react-native/framework';
8
7
  import { useKeyProps } from '@fluentui-react-native/interactive-hooks';
9
8
  import { globalTokens } from '@fluentui-react-native/theme-tokens';
10
9
 
@@ -117,15 +116,15 @@ export const Text = compressible<TextProps, TextTokens>((props: TextProps, useTo
117
116
  };
118
117
  }
119
118
 
120
- const isWinPlatform = Platform.OS === (('win32' as any) || 'windows');
119
+ const isWin32Platform = Platform.OS === ('win32' as any);
121
120
  const filteredProps = {
122
- onKeyUp: isWinPlatform ? onKeyUp : undefined,
123
- keyUpEvents: isWinPlatform ? keyUpEvents : undefined,
121
+ onKeyUp: isWin32Platform ? onKeyUp : undefined,
122
+ keyUpEvents: isWin32Platform ? keyUpEvents : undefined,
124
123
  validKeysUp: undefined,
125
- onKeyDown: isWinPlatform ? onKeyDown : undefined,
126
- keyDownEvents: isWinPlatform ? keyDownEvents : undefined,
124
+ onKeyDown: isWin32Platform ? onKeyDown : undefined,
125
+ keyDownEvents: isWin32Platform ? keyDownEvents : undefined,
127
126
  validKeysDown: undefined,
128
- onAccessibilityTap: isWinPlatform ? onAccTap : undefined,
127
+ onAccessibilityTap: isWin32Platform ? onAccTap : undefined,
129
128
  };
130
129
 
131
130
  // return a continuation function that allows this text to be compressed
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { act } from 'react';
2
2
 
3
3
  import * as renderer from 'react-test-renderer';
4
4
 
@@ -6,13 +6,19 @@ import { Text } from '../Text';
6
6
 
7
7
  describe('Text component tests', () => {
8
8
  it('Text default', () => {
9
- const tree = renderer.create(<Text>Text default</Text>).toJSON();
10
- expect(tree).toMatchSnapshot();
9
+ let component: renderer.ReactTestRenderer;
10
+ act(() => {
11
+ component = renderer.create(<Text>Text default</Text>);
12
+ });
13
+ expect(component!.toJSON()).toMatchSnapshot();
11
14
  });
12
15
 
13
16
  it('Text all props', () => {
14
- const tree = renderer.create(<Text variant="bodyStandard">All props</Text>).toJSON();
15
- expect(tree).toMatchSnapshot();
17
+ let component: renderer.ReactTestRenderer;
18
+ act(() => {
19
+ component = renderer.create(<Text variant="bodyStandard">All props</Text>);
20
+ });
21
+ expect(component!.toJSON()).toMatchSnapshot();
16
22
  });
17
23
 
18
24
  it('Text all tokens', () => {
@@ -21,8 +27,11 @@ describe('Text component tests', () => {
21
27
  fontWeight: '900',
22
28
  fontSize: 20,
23
29
  });
24
- const tree = renderer.create(<BoldText>All tokens</BoldText>).toJSON();
25
- expect(tree).toMatchSnapshot();
30
+ let component: renderer.ReactTestRenderer;
31
+ act(() => {
32
+ component = renderer.create(<BoldText>All tokens</BoldText>);
33
+ });
34
+ expect(component!.toJSON()).toMatchSnapshot();
26
35
  });
27
36
 
28
37
  it('Text variants render correctly with style', () => {
@@ -30,11 +39,14 @@ describe('Text component tests', () => {
30
39
  marginBottom: 8,
31
40
  marginTop: 4,
32
41
  };
33
- const tree = renderer.create(
34
- <Text variant="heroLargeSemibold" color="blue" style={style}>
35
- Header Text
36
- </Text>,
37
- );
38
- expect(tree).toMatchSnapshot();
42
+ let component: renderer.ReactTestRenderer;
43
+ act(() => {
44
+ component = renderer.create(
45
+ <Text variant="heroLargeSemibold" color="blue" style={style}>
46
+ Header Text
47
+ </Text>,
48
+ );
49
+ });
50
+ expect(component!.toJSON()).toMatchSnapshot();
39
51
  });
40
52
  });