@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.
- package/CHANGELOG.md +54 -1
- package/SPEC.md +1 -1
- package/lib/Text.d.ts +6 -2
- package/lib/Text.d.ts.map +1 -1
- package/lib/Text.js +124 -91
- package/lib/Text.js.map +1 -1
- package/lib/Text.types.d.ts +9 -6
- package/lib/Text.types.js +1 -1
- package/lib/TextTokens.d.ts +2 -2
- package/lib/TextTokens.js +6 -3
- package/lib/Variants.android.d.ts +61 -13
- package/lib/Variants.android.d.ts.map +1 -1
- package/lib/Variants.android.js +13 -13
- package/lib/Variants.d.ts +86 -18
- package/lib/Variants.d.ts.map +1 -1
- package/lib/Variants.ios.d.ts +61 -13
- package/lib/Variants.ios.d.ts.map +1 -1
- package/lib/Variants.ios.js +13 -13
- package/lib/Variants.js +1 -1
- package/lib/Variants.win32.d.ts +66 -14
- package/lib/Variants.win32.d.ts.map +1 -1
- package/lib/Variants.win32.js +14 -14
- package/lib/Variants.windows.d.ts +66 -14
- package/lib/Variants.windows.d.ts.map +1 -1
- package/lib/Variants.windows.js +14 -14
- package/lib/__tests__/Text.test.d.ts +1 -1
- package/lib/__tests__/Text.test.js +36 -23
- package/lib/__tests__/Text.test.js.map +1 -1
- package/lib/deprecated/Text.d.ts +14 -4
- package/lib/deprecated/Text.js +9 -9
- package/lib/deprecated/Text.settings.d.ts +1 -1
- package/lib/deprecated/Text.settings.js +18 -18
- package/lib/deprecated/Text.types.d.ts +11 -9
- package/lib/deprecated/Text.types.js +1 -1
- package/lib/index.d.ts +20 -2
- package/lib/index.js +20 -2
- package/lib-commonjs/Text.d.ts +6 -2
- package/lib-commonjs/Text.d.ts.map +1 -1
- package/lib-commonjs/Text.js +142 -102
- package/lib-commonjs/Text.js.map +1 -1
- package/lib-commonjs/Text.types.d.ts +9 -6
- package/lib-commonjs/Text.types.js +3 -3
- package/lib-commonjs/TextTokens.d.ts +2 -2
- package/lib-commonjs/TextTokens.js +10 -7
- package/lib-commonjs/Variants.android.d.ts +61 -13
- package/lib-commonjs/Variants.android.d.ts.map +1 -1
- package/lib-commonjs/Variants.android.js +34 -17
- package/lib-commonjs/Variants.d.ts +86 -18
- package/lib-commonjs/Variants.d.ts.map +1 -1
- package/lib-commonjs/Variants.ios.d.ts +61 -13
- package/lib-commonjs/Variants.ios.d.ts.map +1 -1
- package/lib-commonjs/Variants.ios.js +34 -17
- package/lib-commonjs/Variants.js +22 -5
- package/lib-commonjs/Variants.win32.d.ts +66 -14
- package/lib-commonjs/Variants.win32.d.ts.map +1 -1
- package/lib-commonjs/Variants.win32.js +35 -18
- package/lib-commonjs/Variants.windows.d.ts +66 -14
- package/lib-commonjs/Variants.windows.d.ts.map +1 -1
- package/lib-commonjs/Variants.windows.js +35 -18
- package/lib-commonjs/__tests__/Text.test.d.ts +1 -1
- package/lib-commonjs/__tests__/Text.test.js +92 -50
- package/lib-commonjs/__tests__/Text.test.js.map +1 -1
- package/lib-commonjs/deprecated/Text.d.ts +14 -4
- package/lib-commonjs/deprecated/Text.js +17 -17
- package/lib-commonjs/deprecated/Text.js.map +1 -1
- package/lib-commonjs/deprecated/Text.settings.d.ts +1 -1
- package/lib-commonjs/deprecated/Text.settings.js +21 -21
- package/lib-commonjs/deprecated/Text.types.d.ts +11 -9
- package/lib-commonjs/deprecated/Text.types.js +3 -3
- package/lib-commonjs/index.d.ts +20 -2
- package/lib-commonjs/index.js +156 -30
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +63 -62
- package/src/Text.tsx +8 -9
- package/src/__tests__/Text.test.tsx +25 -13
package/lib-commonjs/index.js
CHANGED
|
@@ -1,31 +1,157 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.Text =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
Object.defineProperty(exports,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "A cross-platform Text component using the Fluent Design System",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
23
|
-
"update-snapshots": "fluentui-scripts jest -u",
|
|
29
|
+
"lint-package": "fluentui-scripts lint-package",
|
|
24
30
|
"prettier": "fluentui-scripts prettier",
|
|
25
|
-
"
|
|
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.
|
|
34
|
-
"@fluentui-react-native/framework": "0.
|
|
35
|
-
"@fluentui-react-native/interactive-hooks": "0.
|
|
36
|
-
"@fluentui-react-native/theme-tokens": "0.
|
|
37
|
-
"@fluentui-react-native/tokens": "0.
|
|
38
|
-
"@uifabricshared/foundation-compose": "1.
|
|
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/
|
|
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/
|
|
48
|
-
"@react-native/
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"react": "
|
|
52
|
-
"react
|
|
53
|
-
"react-
|
|
54
|
-
"react
|
|
55
|
-
"react-
|
|
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
|
|
61
|
-
"react-native
|
|
62
|
-
"react-native-
|
|
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-
|
|
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
|
-
/** @
|
|
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,
|
|
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
|
|
119
|
+
const isWin32Platform = Platform.OS === ('win32' as any);
|
|
121
120
|
const filteredProps = {
|
|
122
|
-
onKeyUp:
|
|
123
|
-
keyUpEvents:
|
|
121
|
+
onKeyUp: isWin32Platform ? onKeyUp : undefined,
|
|
122
|
+
keyUpEvents: isWin32Platform ? keyUpEvents : undefined,
|
|
124
123
|
validKeysUp: undefined,
|
|
125
|
-
onKeyDown:
|
|
126
|
-
keyDownEvents:
|
|
124
|
+
onKeyDown: isWin32Platform ? onKeyDown : undefined,
|
|
125
|
+
keyDownEvents: isWin32Platform ? keyDownEvents : undefined,
|
|
127
126
|
validKeysDown: undefined,
|
|
128
|
-
onAccessibilityTap:
|
|
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
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
});
|