@fluentui-react-native/tester 0.55.2 → 0.57.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 (183) hide show
  1. package/CHANGELOG.json +236 -1
  2. package/CHANGELOG.md +59 -2
  3. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  4. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  5. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +45 -1
  6. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  7. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  8. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  9. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +11 -0
  10. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -0
  11. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +57 -0
  12. package/lib/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -0
  13. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts +2 -0
  14. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts.map +1 -0
  15. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js +26 -0
  16. package/lib/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js.map +1 -0
  17. package/lib/FluentTester/FluentTester.d.ts.map +1 -1
  18. package/lib/FluentTester/FluentTester.js +8 -8
  19. package/lib/FluentTester/FluentTester.js.map +1 -1
  20. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.d.ts.map +1 -1
  21. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +28 -23
  22. package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
  23. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  24. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  25. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  26. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  27. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  28. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  29. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  30. package/lib/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  31. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  32. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  33. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  34. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +23 -15
  35. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  36. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  37. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  38. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  39. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  40. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  41. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +37 -25
  42. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  43. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  44. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +9 -3
  45. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  46. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  47. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  48. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js +1 -0
  49. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  50. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  51. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  52. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  53. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  54. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  55. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  56. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  57. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  58. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  59. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  60. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  61. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  62. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  63. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  64. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  65. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  66. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  67. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  68. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  69. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  70. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  71. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  72. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js +21 -9
  73. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  74. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  75. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  76. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  77. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  78. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  79. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  80. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  81. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  82. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +44 -0
  83. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  84. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  85. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  86. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +11 -0
  87. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -0
  88. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +59 -0
  89. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -0
  90. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts +2 -0
  91. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts.map +1 -0
  92. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js +29 -0
  93. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js.map +1 -0
  94. package/lib-commonjs/FluentTester/FluentTester.d.ts.map +1 -1
  95. package/lib-commonjs/FluentTester/FluentTester.js +8 -8
  96. package/lib-commonjs/FluentTester/FluentTester.js.map +1 -1
  97. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.d.ts.map +1 -1
  98. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +28 -23
  99. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
  100. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  101. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  102. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  103. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  104. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  105. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  106. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  107. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  108. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  109. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  110. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  111. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +22 -14
  112. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  113. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  114. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  115. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  116. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  117. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  118. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +37 -25
  119. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  120. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  121. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +8 -2
  122. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  123. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  124. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  125. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js +2 -1
  126. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  127. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  128. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  129. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  130. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  131. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  132. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  133. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  134. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  135. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  136. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  137. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  138. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  139. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  140. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  141. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  142. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  143. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  144. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  145. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  146. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  147. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  148. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  149. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js +24 -10
  150. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  151. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  152. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  153. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  154. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  155. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  156. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  157. package/package.json +17 -18
  158. package/src/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.ts +63 -0
  159. package/src/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.ts +48 -2
  160. package/src/E2E/README.md +7 -0
  161. package/src/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.ts +56 -0
  162. package/src/E2E/common/NativeTesting/specs/NativeTesting.spec.win.ts +28 -0
  163. package/src/FluentTester/FluentTester.tsx +10 -10
  164. package/src/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.tsx +36 -26
  165. package/src/FluentTester/TestComponents/ActivityIndicator/consts.ts +3 -3
  166. package/src/FluentTester/TestComponents/Avatar/CustomizedAvatar.tsx +25 -31
  167. package/src/FluentTester/TestComponents/Badge/BadgeTest.tsx +11 -11
  168. package/src/FluentTester/TestComponents/Button/ButtonHOCTestSection.tsx +25 -16
  169. package/src/FluentTester/TestComponents/Button/ButtonSizeTestSection.tsx +0 -1
  170. package/src/FluentTester/TestComponents/Checkbox/CheckboxTest.tsx +29 -29
  171. package/src/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.tsx +49 -33
  172. package/src/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.tsx +13 -0
  173. package/src/FluentTester/TestComponents/CheckboxExperimental/consts.ts +2 -0
  174. package/src/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.tsx +3 -3
  175. package/src/FluentTester/TestComponents/Expander/ExpanderTest.tsx +23 -22
  176. package/src/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.tsx +12 -11
  177. package/src/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.tsx +12 -11
  178. package/src/FluentTester/TestComponents/Persona/CustomizeUsage.tsx +15 -28
  179. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +12 -22
  180. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.tsx +25 -31
  181. package/src/FluentTester/TestComponents/Shimmer/ShimmerTest.tsx +50 -10
  182. package/src/FluentTester/TestComponents/Text/CustomizeUsage.tsx +42 -42
  183. package/src/FluentTester/TestComponents/TextExperimental/CustomizeUsage.tsx +42 -42
@@ -16,16 +16,23 @@ const basicCheckbox: React.FunctionComponent = () => {
16
16
  <View>
17
17
  <Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
18
18
  <Checkbox label="Unchecked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked={false} />
19
- <Checkbox
20
- label="Checked checkbox (uncontrolled)"
21
- onChange={onChangeUncontrolled}
22
- defaultChecked={true}
23
- accessibilityLabel="Hello there"
24
- />
25
- <Checkbox label="Disabled checkbox" onChange={onChangeUncontrolled} defaultChecked={false} disabled={true} />
26
- <Checkbox label="Disabled checked checkbox" onChange={onChangeUncontrolled} defaultChecked={true} disabled={true} />
27
- <Checkbox label="Checkbox will display a tooltip" onChange={onChangeUncontrolled} tooltip="This is a tooltip" />
28
- <Checkbox label="A circular checkbox" circular onChange={onChangeUncontrolled} defaultChecked={false} />
19
+ <Checkbox label="Checked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked accessibilityLabel="Hello there" />
20
+ <Checkbox label="Disabled checkbox" disabled />
21
+ <Checkbox label="Disabled checked checkbox" defaultChecked disabled />
22
+ <Checkbox label="Checkbox will display a tooltip" tooltip="This is a tooltip" />
23
+ <Checkbox label="A circular checkbox" shape="circular" />
24
+ <Checkbox label="A checkbox with label placed before" labelPosition="before" />
25
+ </View>
26
+ );
27
+ };
28
+
29
+ const sizeCheckbox: React.FunctionComponent = () => {
30
+ return (
31
+ <View>
32
+ <Checkbox tooltip="Medium checkbox" size="medium" />
33
+ <Checkbox tooltip="Large checkbox" size="large" />
34
+ <Checkbox label="Medium checkbox" size="medium" />
35
+ <Checkbox label="Large checkbox" size="large" />
29
36
  </View>
30
37
  );
31
38
  };
@@ -54,29 +61,29 @@ const otherCheckbox: React.FunctionComponent = () => {
54
61
  );
55
62
  };
56
63
 
57
- const tokenCheckbox: React.FunctionComponent = () => {
58
- const CircleColorCheckbox = Checkbox.customize({
59
- checkboxBackgroundColor: 'white',
60
- checked: {
61
- checkboxBackgroundColor: 'green',
62
- checkboxBorderColor: 'green',
63
- checkmarkColor: 'white',
64
- },
65
- focused: { checkboxBackgroundColor: 'menuItemBackgroundHovered' },
66
- hovered: { checkboxBackgroundColor: 'menuItemBackgroundHovered' },
67
- pressed: { checkboxBackgroundColor: 'menuItemBackgroundPressed' },
68
- });
69
-
70
- const HoverCheckbox = Checkbox.customize({
71
- checked: {
72
- checkboxBackgroundColor: 'black',
73
- checkmarkColor: 'white',
74
- },
75
- hovered: {
76
- checkmarkOpacity: 1,
77
- },
78
- });
64
+ const CircleColorCheckbox = Checkbox.customize({
65
+ checkboxBackgroundColor: 'white',
66
+ checked: {
67
+ checkboxBackgroundColor: 'green',
68
+ checkboxBorderColor: 'green',
69
+ checkmarkColor: 'white',
70
+ },
71
+ focused: { checkboxBackgroundColor: 'menuItemBackgroundHovered' },
72
+ hovered: { checkboxBackgroundColor: 'menuItemBackgroundHovered' },
73
+ pressed: { checkboxBackgroundColor: 'menuItemBackgroundPressed' },
74
+ });
75
+
76
+ const HoverCheckbox = Checkbox.customize({
77
+ checked: {
78
+ checkboxBackgroundColor: 'black',
79
+ checkmarkColor: 'white',
80
+ },
81
+ hovered: {
82
+ checkmarkOpacity: 1,
83
+ },
84
+ });
79
85
 
86
+ const tokenCheckbox: React.FunctionComponent = () => {
80
87
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
81
88
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
82
89
 
@@ -99,7 +106,12 @@ const tokenCheckbox: React.FunctionComponent = () => {
99
106
  return (
100
107
  <View>
101
108
  <HoverCheckbox label="A checkbox with checkmark visible on hover" onChange={onChangeUncontrolled} defaultChecked={false} />
102
- <CircleColorCheckbox label="A circular token-customized checkbox" circular onChange={onChangeUncontrolled} defaultChecked={true} />
109
+ <CircleColorCheckbox
110
+ label="A circular token-customized checkbox"
111
+ shape="circular"
112
+ onChange={onChangeUncontrolled}
113
+ defaultChecked={true}
114
+ />
103
115
  <BlueCheckbox
104
116
  label="Token-customized checkbox. Customizable below."
105
117
  onChange={onChangeUncontrolled}
@@ -134,6 +146,10 @@ const checkboxSections: TestSection[] = [
134
146
  testID: EXPERIMENTAL_CHECKBOX_TESTPAGE,
135
147
  component: basicCheckbox,
136
148
  },
149
+ {
150
+ name: 'Size Checkboxes',
151
+ component: sizeCheckbox,
152
+ },
137
153
  {
138
154
  name: 'Other Implementations',
139
155
  component: otherCheckbox,
@@ -7,10 +7,21 @@ import {
7
7
  EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL,
8
8
  EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT,
9
9
  EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL,
10
+ EXPERIMENTAL_CHECKBOX_ON_PRESS,
10
11
  } from './consts';
11
12
  import { Stack } from '@fluentui-react-native/stack';
13
+ import { Text } from '@fluentui/react-native';
12
14
 
13
15
  export const E2ECheckboxExperimentalTest: React.FunctionComponent = () => {
16
+ const [checkboxPressed, setCheckboxPressed] = React.useState(false);
17
+
18
+ const onClick = React.useCallback(
19
+ (checked) => {
20
+ setCheckboxPressed(checked);
21
+ },
22
+ [setCheckboxPressed],
23
+ );
24
+
14
25
  return (
15
26
  <View>
16
27
  <Stack style={stackStyle}>
@@ -19,8 +30,10 @@ export const E2ECheckboxExperimentalTest: React.FunctionComponent = () => {
19
30
  disabled={false}
20
31
  label="Testing accessibilityLabel"
21
32
  testID={EXPERIMENTAL_CHECKBOX_TEST_COMPONENT}
33
+ onChange={onClick}
22
34
  />
23
35
  <Checkbox label={EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL} testID={EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT} />
36
+ {checkboxPressed ? <Text testID={EXPERIMENTAL_CHECKBOX_ON_PRESS}>Checkbox Selected</Text> : null}
24
37
  </Stack>
25
38
  </View>
26
39
  );
@@ -8,3 +8,5 @@ export const EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL = 'E2E testing Experiment
8
8
  /* Test Experimental Checkbox 2 */
9
9
  export const EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT = 'Experimental Checkbox_No_A11y_label_Component';
10
10
  export const EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL = 'Test Experimental Checkbox2 - No Accessibility Label'; // A component on each specific test page
11
+
12
+ export const EXPERIMENTAL_CHECKBOX_ON_PRESS = 'Experimental_Checkbox_On_Press'; // For testing the press functionality on a Checkbox
@@ -232,6 +232,9 @@ const nestedContextualMenu: React.FunctionComponent = () => {
232
232
  );
233
233
  };
234
234
 
235
+ // custom text
236
+ const IndigoHeroBold = FURNText.customize({ tokens: { variant: 'heroStandard', fontWeight: '100', color: '#4b0082' } });
237
+
235
238
  const IconContextualMenu: React.FunctionComponent = () => {
236
239
  const stdBtnRef = React.useRef(null);
237
240
 
@@ -258,9 +261,6 @@ const IconContextualMenu: React.FunctionComponent = () => {
258
261
  setIsContextualMenuVisible(false);
259
262
  }, [setShowContextualMenu]);
260
263
 
261
- // custom text
262
- const IndigoHeroBold = FURNText.customize({ tokens: { variant: 'heroStandard', fontWeight: '100', color: '#4b0082' } });
263
-
264
264
  return (
265
265
  <View>
266
266
  <View style={{ flexDirection: 'row', paddingVertical: 5 }}>
@@ -7,33 +7,34 @@ import { Test, TestSection, PlatformStatus } from '../Test';
7
7
  import { EXPANDER_TESTPAGE } from './consts';
8
8
  import { View, Switch } from 'react-native';
9
9
 
10
+ const CustomizedExpander = Expander.customize({
11
+ headerBackground: '#9c9c9c',
12
+ headerForeground: '#ffffff',
13
+ contentBackground: '#c3c3c3',
14
+ chevronBackground: '#ff7f7f',
15
+ chevronForeground: '#ffffff',
16
+ chevronPointerOverBackground: '#b5ffb2',
17
+ chevronPointerOverForeground: '#bfbdbd',
18
+ chevronPressedBackground: '#ffb2f4',
19
+ chevronPressedForeground: '#912a2a',
20
+ headerForegroundPointerOver: '#27f238',
21
+ headerForegroundPressed: '#f227eb',
22
+ headerBorderBrush: '#f22727',
23
+ headerBorderPointerOverBrush: '#27f238',
24
+ headerBorderPressedBrush: '#f227eb',
25
+ contentBorderBrush: '#f227eb',
26
+ headerBorderThickness: 2,
27
+ chevronBorderBrush: '#f22727',
28
+ chevronBorderPointerOverBrush: '#27f238',
29
+ chevronBorderPressedBrush: '#f227eb',
30
+ chevronBorderThickness: 2,
31
+ });
32
+
10
33
  const expanderTest: React.FunctionComponent = () => {
11
34
  /** This test page has not yet been tested and does not currently build because
12
35
  * the react-native-test-app does not yet support WinUI 2.6
13
36
  * Filed issue in react-native-test-app: https://github.com/microsoft/react-native-test-app/issues/444
14
37
  */
15
- const CustomizedExpander = Expander.customize({
16
- headerBackground: '#9c9c9c',
17
- headerForeground: '#ffffff',
18
- contentBackground: '#c3c3c3',
19
- chevronBackground: '#ff7f7f',
20
- chevronForeground: '#ffffff',
21
- chevronPointerOverBackground: '#b5ffb2',
22
- chevronPointerOverForeground: '#bfbdbd',
23
- chevronPressedBackground: '#ffb2f4',
24
- chevronPressedForeground: '#912a2a',
25
- headerForegroundPointerOver: '#27f238',
26
- headerForegroundPressed: '#f227eb',
27
- headerBorderBrush: '#f22727',
28
- headerBorderPointerOverBrush: '#27f238',
29
- headerBorderPressedBrush: '#f227eb',
30
- contentBorderBrush: '#f227eb',
31
- headerBorderThickness: 2,
32
- chevronBorderBrush: '#f22727',
33
- chevronBorderPointerOverBrush: '#27f238',
34
- chevronBorderPressedBrush: '#f227eb',
35
- chevronBorderThickness: 2,
36
- });
37
38
 
38
39
  const [switchValue, setSwitchValue] = React.useState(false);
39
40
  const [expanderText, setExpanderText] = React.useState('Initial state');
@@ -4,18 +4,19 @@ import { MenuButton } from '@fluentui/react-native';
4
4
  import { menuItems } from './testData';
5
5
  import { viewWrapperStyle, columnStyle, rowStyle } from './MenuButtonTestStyles';
6
6
 
7
+ const StyledMenuButton = MenuButton.customize({
8
+ button: {
9
+ borderRadius: 4,
10
+ backgroundColor: '#0095ff',
11
+ borderWidth: 0,
12
+ color: '#fff',
13
+ variant: 'heroSemibold',
14
+ fontFamily: 'Georgia',
15
+ },
16
+ contextualMenu: { backgroundColor: '#a9dbff' },
17
+ });
18
+
7
19
  export const CustomizedMenuButton: React.FunctionComponent = () => {
8
- const StyledMenuButton = MenuButton.customize({
9
- button: {
10
- borderRadius: 4,
11
- backgroundColor: '#0095ff',
12
- borderWidth: 0,
13
- color: '#fff',
14
- variant: 'heroSemibold',
15
- fontFamily: 'Georgia',
16
- },
17
- contextualMenu: { backgroundColor: '#a9dbff' },
18
- });
19
20
  return (
20
21
  <View>
21
22
  <View style={viewWrapperStyle}>
@@ -4,18 +4,19 @@ import { MenuButton } from '@fluentui/react-native';
4
4
  import { menuItems } from './testData';
5
5
  import { viewWrapperStyle, columnStyle, rowStyle } from './MenuButtonTestStyles';
6
6
 
7
+ const StyledMenuButton = MenuButton.customize({
8
+ button: {
9
+ borderRadius: 4,
10
+ backgroundColor: '#0095ff',
11
+ borderWidth: 0,
12
+ color: '#fff',
13
+ variant: 'heroSemibold',
14
+ fontFamily: 'Georgia',
15
+ },
16
+ contextualMenu: { backgroundColor: '#a9dbff' },
17
+ });
18
+
7
19
  export const CustomizedMenuButton: React.FunctionComponent = () => {
8
- const StyledMenuButton = MenuButton.customize({
9
- button: {
10
- borderRadius: 4,
11
- backgroundColor: '#0095ff',
12
- borderWidth: 0,
13
- color: '#fff',
14
- variant: 'heroSemibold',
15
- fontFamily: 'Georgia',
16
- },
17
- contextualMenu: { backgroundColor: '#a9dbff' },
18
- });
19
20
  return (
20
21
  <View>
21
22
  <View style={viewWrapperStyle}>
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { View, Text, Switch, TextInput, TextStyle } from 'react-native';
3
- import { IPersonaTokens, Persona } from '@fluentui/react-native';
3
+ import { Persona } from '@fluentui/react-native';
4
4
  import { michaelImageUrl } from './styles';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
6
  import { useTheme } from '@fluentui-react-native/theme-types';
@@ -19,38 +19,25 @@ export const CustomizeUsage: React.FunctionComponent = () => {
19
19
  const [horizontalGap, setHorizontalGap] = React.useState<number>();
20
20
  const [verticalGap, setVerticalGap] = React.useState<number>();
21
21
 
22
- const tokens: Partial<IPersonaTokens> = {};
23
- if (coinColor) {
24
- tokens.coinBackgroundColor = coinColor;
25
- }
26
- if (textColor) {
27
- tokens.color = textColor;
28
- }
29
- if (textSize) {
30
- tokens.textFont = { fontSize: textSize };
31
- }
32
- if (secondarySize) {
33
- tokens.secondaryFont = { fontSize: secondarySize };
34
- }
35
- if (tertiarySize) {
36
- tokens.tertiaryFont = { fontSize: tertiarySize };
37
- }
38
- if (optionalSize) {
39
- tokens.optionalFont = { fontSize: optionalSize };
40
- }
41
- if (horizontalGap !== undefined) {
42
- tokens.horizontalGap = horizontalGap;
43
- }
44
- if (verticalGap !== undefined) {
45
- tokens.verticalGap = verticalGap;
46
- }
47
-
48
22
  const theme = useTheme();
49
23
  const textBoxBorderStyle: TextStyle = {
50
24
  borderColor: theme.colors.inputBorder,
51
25
  };
52
26
 
53
- const CustomizedPersona = Persona.customize({ tokens });
27
+ const CustomizedPersona = React.useMemo(() => {
28
+ const tokens = {
29
+ backgroundColor: coinColor,
30
+ color: textColor,
31
+ textFont: { fontSize: textSize },
32
+ secondaryFont: { fontSize: secondarySize },
33
+ tertiaryFont: { fontSize: tertiarySize },
34
+ optionalFont: { fontSize: optionalSize },
35
+ horizontalGap: horizontalGap,
36
+ verticalGap: verticalGap,
37
+ };
38
+ return Persona.customize({ tokens });
39
+ }, [coinColor, textColor, textSize, secondarySize, tertiarySize, optionalSize, horizontalGap, verticalGap]);
40
+
54
41
  return (
55
42
  <View style={commonStyles.root}>
56
43
  {/* settings */}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PersonaCoin, IPersonaCoinTokens } from '@fluentui/react-native';
2
+ import { PersonaCoin } from '@fluentui/react-native';
3
3
  import { Switch, View, Text, TextInput } from 'react-native';
4
4
  import Slider from '@react-native-community/slider';
5
5
  import { steveBallmerPhotoUrl, undefinedText } from './styles';
@@ -63,27 +63,17 @@ export const CustomizeUsage: React.FunctionComponent = () => {
63
63
  const [ringColor, setRingColor] = React.useState<string>('green');
64
64
  const [ringBackgroundColor, setRingBackgroundColor] = React.useState<string>(undefined);
65
65
 
66
- const tokens: Partial<IPersonaCoinTokens> = {};
67
- const CustomizedPersonaCoin = PersonaCoin.customize({ tokens });
68
-
69
- if (coinColor) {
70
- tokens.backgroundColor = coinColor;
71
- }
72
- if (textColor) {
73
- tokens.color = textColor;
74
- }
75
- if (showRings) {
76
- tokens.ring = { ringColor: 'red' };
77
- }
78
- if (coinSize) {
79
- tokens.coinSize = coinSize;
80
- }
81
- if (iconSize) {
82
- tokens.iconSize = iconSize;
83
- }
84
- if (iconStrokeWidth) {
85
- tokens.iconStrokeWidth = iconStrokeWidth;
86
- }
66
+ const CustomizedPersonaCoin = React.useMemo(() => {
67
+ const tokens = {
68
+ backgroundColor: coinColor,
69
+ color: textColor,
70
+ ring: { ringColor: 'red' },
71
+ coinSize: coinSize,
72
+ iconSize: iconSize,
73
+ iconStrokeWidth: iconStrokeWidth,
74
+ };
75
+ return PersonaCoin.customize({ tokens });
76
+ }, [coinColor, textColor, showRings, coinSize, iconSize, iconStrokeWidth]);
87
77
 
88
78
  return (
89
79
  <View style={{ flexDirection: 'column', padding: 10, backgroundColor: showColoredBackground ? 'gray' : 'transparent' }}>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PersonaCoin, IconAlignment, IPersonaCoinTokens } from '@fluentui/react-native';
2
+ import { PersonaCoin, IconAlignment } from '@fluentui/react-native';
3
3
  import { Switch, View, Text, TextInput, TextStyle } from 'react-native';
4
4
  import { Slider } from '../Common/Slider';
5
5
  import { steveBallmerPhotoUrl } from './styles';
@@ -29,36 +29,30 @@ export const CustomizeUsage: React.FunctionComponent = () => {
29
29
  borderColor: theme.colors.inputBorder,
30
30
  };
31
31
 
32
- const tokens: Partial<IPersonaCoinTokens> = {};
33
- if (coinColor) {
34
- tokens.backgroundColor = coinColor;
35
- }
36
- if (textColor) {
37
- tokens.color = textColor;
38
- }
39
- if (horizontalAlignment) {
40
- tokens.horizontalIconAlignment = horizontalAlignment;
41
- }
42
- if (verticalAlignment) {
43
- tokens.verticalIconAlignment = verticalAlignment;
44
- }
45
- if (iconSize) {
46
- tokens.iconSize = iconSize;
47
- }
48
- if (iconStrokeWidth) {
49
- tokens.iconStrokeWidth = iconStrokeWidth;
50
- }
51
- if (iconStrokeColor) {
52
- tokens.iconStrokeColor = iconStrokeColor;
53
- }
54
- if (initialsSize) {
55
- tokens.initialsSize = initialsSize;
56
- }
57
- if (physicalSize) {
58
- tokens.coinSize = physicalSize;
59
- }
60
-
61
- const CustomizedPersonaCoin = PersonaCoin.customize({ tokens });
32
+ const CustomizedPersonaCoin = React.useMemo(() => {
33
+ const tokens = {
34
+ backgroundColor: coinColor,
35
+ color: textColor,
36
+ horizontalIconAlignment: horizontalAlignment,
37
+ verticalIconAlignment: verticalAlignment,
38
+ iconSize: iconSize,
39
+ iconStrokeWidth: iconStrokeWidth,
40
+ iconStrokeColor: iconStrokeColor,
41
+ initialsSize: initialsSize,
42
+ coinSize: physicalSize,
43
+ };
44
+ return PersonaCoin.customize({ tokens });
45
+ }, [
46
+ coinColor,
47
+ textColor,
48
+ horizontalAlignment,
49
+ verticalAlignment,
50
+ iconSize,
51
+ iconStrokeWidth,
52
+ iconStrokeColor,
53
+ initialsSize,
54
+ physicalSize,
55
+ ]);
62
56
 
63
57
  return (
64
58
  <View style={commonStyles.root}>
@@ -7,6 +7,49 @@ import { stackStyle } from '../Common/styles';
7
7
  import { shimmerBorderRadiusTests, shimmerRectsAndRect, shimmerRectsAndCircle } from './ShimmerTestElementSets';
8
8
  import { E2ETestingShimmer } from './ShimmerE2ETest';
9
9
 
10
+ const TestCompareCustomizeShimmer = Shimmer.customize({
11
+ shimmerWaveColor: 'blue',
12
+ shimmerColor: 'orange',
13
+ backgroundColor: 'red',
14
+ });
15
+
16
+ export const CustomizeAndTokenPropsShimmers: React.FunctionComponent = () => {
17
+ return (
18
+ <Stack style={{ margin: 4 }}>
19
+ <TestCompareCustomizeShimmer
20
+ elements={shimmerRectsAndCircle()}
21
+ duration={2000}
22
+ delay={1000}
23
+ style={{ height: 100, width: '50%', borderWidth: 2, borderColor: 'black' }}
24
+ />
25
+
26
+ <Shimmer
27
+ elements={shimmerRectsAndCircle()}
28
+ duration={2000}
29
+ delay={1000}
30
+ style={{ height: 100, width: '50%', borderWidth: 2, borderColor: 'black' }}
31
+ shimmerWaveColor="blue"
32
+ shimmerColor="orange"
33
+ backgroundColor="red"
34
+ />
35
+ </Stack>
36
+ );
37
+ };
38
+
39
+ export const RoundedCornerClipCheckShimmer: React.FunctionComponent = () => {
40
+ return (
41
+ <Stack style={{ margin: 4 }}>
42
+ <Shimmer
43
+ elements={shimmerRectsAndCircle()}
44
+ duration={2000}
45
+ delay={1000}
46
+ style={{ height: 100, width: 150, borderRadius: 16, borderWidth: 2, borderColor: 'black' }}
47
+ backgroundColor="teal"
48
+ />
49
+ </Stack>
50
+ );
51
+ };
52
+
10
53
  const RectShimmers: React.FunctionComponent<Record<string, never>> = () => {
11
54
  return (
12
55
  <Stack style={stackStyle}>
@@ -24,13 +67,10 @@ const RectCircleShimmers: React.FunctionComponent<Record<string, never>> = () =>
24
67
  };
25
68
 
26
69
  const CustomizedShimmer: React.FunctionComponent<Record<string, never>> = () => {
27
- const PinkShimmer = Shimmer.customize({
28
- shimmerWaveColor: 'pink',
29
- });
30
-
31
70
  return (
32
71
  <Stack style={stackStyle}>
33
- <PinkShimmer elements={shimmerRectsAndCircle()} duration={1500} delay={500} style={{ height: 100, maxWidth: '50%' }} />
72
+ <CustomizeAndTokenPropsShimmers />
73
+ <RoundedCornerClipCheckShimmer />
34
74
  </Stack>
35
75
  );
36
76
  };
@@ -44,11 +84,6 @@ const ShimmerBorderRadii: React.FunctionComponent<Record<string, never>> = () =>
44
84
  };
45
85
 
46
86
  const shimmerSections: TestSection[] = [
47
- {
48
- name: 'Customized Shimmer',
49
- testID: SHIMMER_TESTPAGE,
50
- component: CustomizedShimmer,
51
- },
52
87
  {
53
88
  name: 'Shimmer Rects',
54
89
  testID: SHIMMER_TESTPAGE,
@@ -64,6 +99,11 @@ const shimmerSections: TestSection[] = [
64
99
  testID: SHIMMER_TESTPAGE,
65
100
  component: ShimmerBorderRadii,
66
101
  },
102
+ {
103
+ name: 'Customized Shimmer',
104
+ testID: SHIMMER_TESTPAGE,
105
+ component: CustomizedShimmer,
106
+ },
67
107
  {
68
108
  name: 'Shimmer for E2E Testing',
69
109
  component: E2ETestingShimmer,
@@ -4,15 +4,49 @@ import { Stack } from '@fluentui-react-native/stack';
4
4
  import { Text } from '@fluentui/react-native';
5
5
  import { stackStyle } from '../Common/styles';
6
6
 
7
- export const CustomizeUsage: React.FunctionComponent = () => {
8
- const RedCaptionBold = Text.customize({ tokens: { variant: 'captionStandard', fontWeight: '700', color: '#ff0000' } });
9
- const OrangeSecondaryBold = Text.customize({ tokens: { variant: 'secondaryStandard', fontWeight: '700', color: '#ff9900' } });
10
- const YellowBodyBold = Text.customize({ tokens: { variant: 'bodyStandard', fontWeight: '700', color: '#f3ce00' } });
11
- const GreenSubheaderBold = Text.customize({ tokens: { variant: 'subheaderStandard', fontWeight: '700', color: '#02c440' } });
12
- const BlueHeaderBold = Text.customize({ tokens: { variant: 'headerStandard', fontWeight: '700', color: '#0229c4' } });
13
- const IndigoHeroBold = Text.customize({ tokens: { variant: 'heroStandard', fontWeight: '700', color: '#4b0082' } });
14
- const PurpleHeroLargeBold = Text.customize({ tokens: { variant: 'heroLargeStandard', fontWeight: '700', color: '#8402c4' } });
7
+ const RedCaptionBold = Text.customize({ tokens: { variant: 'captionStandard', fontWeight: '700', color: '#ff0000' } });
8
+ const OrangeSecondaryBold = Text.customize({ tokens: { variant: 'secondaryStandard', fontWeight: '700', color: '#ff9900' } });
9
+ const YellowBodyBold = Text.customize({ tokens: { variant: 'bodyStandard', fontWeight: '700', color: '#f3ce00' } });
10
+ const GreenSubheaderBold = Text.customize({ tokens: { variant: 'subheaderStandard', fontWeight: '700', color: '#02c440' } });
11
+ const BlueHeaderBold = Text.customize({ tokens: { variant: 'headerStandard', fontWeight: '700', color: '#0229c4' } });
12
+ const IndigoHeroBold = Text.customize({ tokens: { variant: 'heroStandard', fontWeight: '700', color: '#4b0082' } });
13
+ const PurpleHeroLargeBold = Text.customize({ tokens: { variant: 'heroLargeStandard', fontWeight: '700', color: '#8402c4' } });
14
+
15
+ // Android has a limited fontFamily support and unknown fonts fallback to sans-serif (Roboto).
16
+ // Custom fonts (ttf, otf) are supported but need to be linked using 'react-native link'
17
+ // The supported font families can be found as <aliases> at https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/fonts.xml
18
+ const CustomFontNames = {
19
+ ...Platform.select({
20
+ android: {
21
+ CourierNew: 'courier new',
22
+ Georgia: 'georgia',
23
+ TimesNewRoman: 'times new roman',
24
+ },
25
+ default: {
26
+ CourierNew: 'Courier New',
27
+ Georgia: 'Georgia',
28
+ TimesNewRoman: 'Times New Roman',
29
+ },
30
+ }),
31
+ };
32
+
33
+ const ArialBlack = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Arial Black' } });
34
+ const BrushScriptMT = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'Brush Script MT' } });
35
+ const CourierNew = Text.customize({ tokens: { variant: 'headerStandard', fontFamily: CustomFontNames.CourierNew } });
36
+ const Georgia = Text.customize({ tokens: { variant: 'subheaderStandard', fontFamily: CustomFontNames.Georgia } });
37
+ const TimesNewRoman = Text.customize({ tokens: { variant: 'secondaryStandard', fontFamily: CustomFontNames.TimesNewRoman } });
38
+ const Wingdings = Text.customize({ tokens: { variant: 'captionStandard', fontFamily: 'Wingdings' } });
39
+
40
+ // Examples of supported Android fonts.
41
+ const Casual = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'casual' } });
42
+ const Cursive = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'cursive' } });
43
+ // Examples of iOS fonts.
44
+ const Papyrus = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Papyrus' } });
45
+ const Helvetica = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Helvetica' } });
46
+ // Fonts supported on Android and iOS
47
+ const Arial = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'arial' } });
15
48
 
49
+ export const CustomizeUsage: React.FunctionComponent = () => {
16
50
  const CustomUsageStack = () => {
17
51
  return (
18
52
  <Stack style={stackStyle} gap={5}>
@@ -27,40 +61,6 @@ export const CustomizeUsage: React.FunctionComponent = () => {
27
61
  );
28
62
  };
29
63
 
30
- // Android has a limited fontFamily support and unknown fonts fallback to sans-serif (Roboto).
31
- // Custom fonts (ttf, otf) are supported but need to be linked using 'react-native link'
32
- // The supported font families can be found as <aliases> at https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/fonts.xml
33
- const CustomFontNames = {
34
- ...Platform.select({
35
- android: {
36
- CourierNew: 'courier new',
37
- Georgia: 'georgia',
38
- TimesNewRoman: 'times new roman',
39
- },
40
- default: {
41
- CourierNew: 'Courier New',
42
- Georgia: 'Georgia',
43
- TimesNewRoman: 'Times New Roman',
44
- },
45
- }),
46
- };
47
-
48
- const ArialBlack = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Arial Black' } });
49
- const BrushScriptMT = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'Brush Script MT' } });
50
- const CourierNew = Text.customize({ tokens: { variant: 'headerStandard', fontFamily: CustomFontNames.CourierNew } });
51
- const Georgia = Text.customize({ tokens: { variant: 'subheaderStandard', fontFamily: CustomFontNames.Georgia } });
52
- const TimesNewRoman = Text.customize({ tokens: { variant: 'secondaryStandard', fontFamily: CustomFontNames.TimesNewRoman } });
53
- const Wingdings = Text.customize({ tokens: { variant: 'captionStandard', fontFamily: 'Wingdings' } });
54
-
55
- // Examples of supported Android fonts.
56
- const Casual = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'casual' } });
57
- const Cursive = Text.customize({ tokens: { variant: 'heroStandard', fontFamily: 'cursive' } });
58
- // Examples of iOS fonts.
59
- const Papyrus = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Papyrus' } });
60
- const Helvetica = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'Helvetica' } });
61
- // Fonts supported on Android and iOS
62
- const Arial = Text.customize({ tokens: { variant: 'heroLargeStandard', fontFamily: 'arial' } });
63
-
64
64
  const CustomFontStack = () => {
65
65
  return (
66
66
  <Stack style={stackStyle} gap={5}>