@fluentui-react-native/tester 0.56.0 → 0.58.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 (173) hide show
  1. package/CHANGELOG.json +190 -1
  2. package/CHANGELOG.md +54 -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/Avatar/CustomizedAvatar.d.ts.map +1 -1
  24. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  25. package/lib/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  26. package/lib/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  27. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  28. package/lib/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  29. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  30. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +29 -16
  31. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  32. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  33. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  34. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  35. package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  36. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  37. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +38 -26
  38. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  39. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  40. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +9 -3
  41. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  42. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  43. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  44. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js +1 -0
  45. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  46. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  47. package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  48. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  49. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  50. package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  51. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  52. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  53. package/lib/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  54. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  55. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  56. package/lib/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  57. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  58. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  59. package/lib/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  60. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  61. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  62. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  63. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  64. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  65. package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  66. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  67. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  68. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js +21 -9
  69. package/lib/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  70. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  71. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  72. package/lib/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  73. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  74. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  75. package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  76. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  77. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  78. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +44 -0
  79. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  80. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  81. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  82. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts +11 -0
  83. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.d.ts.map +1 -0
  84. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js +59 -0
  85. package/lib-commonjs/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.js.map +1 -0
  86. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts +2 -0
  87. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.d.ts.map +1 -0
  88. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js +29 -0
  89. package/lib-commonjs/E2E/common/NativeTesting/specs/NativeTesting.spec.win.js.map +1 -0
  90. package/lib-commonjs/FluentTester/FluentTester.d.ts.map +1 -1
  91. package/lib-commonjs/FluentTester/FluentTester.js +8 -8
  92. package/lib-commonjs/FluentTester/FluentTester.js.map +1 -1
  93. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.d.ts.map +1 -1
  94. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +28 -23
  95. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
  96. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  97. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js +24 -29
  98. package/lib-commonjs/FluentTester/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  99. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  100. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js +9 -9
  101. package/lib-commonjs/FluentTester/TestComponents/Badge/BadgeTest.js.map +1 -1
  102. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  103. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +28 -15
  104. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  105. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  106. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  107. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js +27 -27
  108. package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  109. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  110. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +38 -26
  111. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  112. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  113. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +8 -2
  114. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  115. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  116. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  117. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js +2 -1
  118. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  119. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +2 -2
  120. package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
  121. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.d.ts.map +1 -1
  122. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js +22 -22
  123. package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
  124. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.d.ts.map +1 -1
  125. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js +11 -11
  126. package/lib-commonjs/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.js.map +1 -1
  127. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.d.ts.map +1 -1
  128. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js +11 -11
  129. package/lib-commonjs/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.js.map +1 -1
  130. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  131. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js +13 -26
  132. package/lib-commonjs/FluentTester/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  133. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  134. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js +24 -29
  135. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  136. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  137. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +11 -20
  138. package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  139. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts +2 -0
  140. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.d.ts.map +1 -1
  141. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js +24 -10
  142. package/lib-commonjs/FluentTester/TestComponents/Shimmer/ShimmerTest.js.map +1 -1
  143. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.d.ts.map +1 -1
  144. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js +36 -36
  145. package/lib-commonjs/FluentTester/TestComponents/Text/CustomizeUsage.js.map +1 -1
  146. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.d.ts.map +1 -1
  147. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +36 -36
  148. package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
  149. package/package.json +10 -11
  150. package/src/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.ts +63 -0
  151. package/src/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.ts +48 -2
  152. package/src/E2E/common/NativeTesting/pages/NativeTestingPageObject.win.ts +56 -0
  153. package/src/E2E/common/NativeTesting/specs/NativeTesting.spec.win.ts +28 -0
  154. package/src/FluentTester/FluentTester.tsx +10 -10
  155. package/src/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.tsx +36 -26
  156. package/src/FluentTester/TestComponents/Avatar/CustomizedAvatar.tsx +25 -31
  157. package/src/FluentTester/TestComponents/Badge/BadgeTest.tsx +11 -11
  158. package/src/FluentTester/TestComponents/Button/ButtonHOCTestSection.tsx +33 -17
  159. package/src/FluentTester/TestComponents/Button/ButtonSizeTestSection.tsx +0 -1
  160. package/src/FluentTester/TestComponents/Checkbox/CheckboxTest.tsx +29 -29
  161. package/src/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.tsx +51 -34
  162. package/src/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.tsx +13 -0
  163. package/src/FluentTester/TestComponents/CheckboxExperimental/consts.ts +2 -0
  164. package/src/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.tsx +3 -3
  165. package/src/FluentTester/TestComponents/Expander/ExpanderTest.tsx +23 -22
  166. package/src/FluentTester/TestComponents/MenuButton/CustomizedMenuButtonTest.tsx +12 -11
  167. package/src/FluentTester/TestComponents/MenuButtonExperimental/CustomizedMenuButtonTest.tsx +12 -11
  168. package/src/FluentTester/TestComponents/Persona/CustomizeUsage.tsx +15 -28
  169. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +12 -22
  170. package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.tsx +25 -31
  171. package/src/FluentTester/TestComponents/Shimmer/ShimmerTest.tsx +50 -10
  172. package/src/FluentTester/TestComponents/Text/CustomizeUsage.tsx +42 -42
  173. package/src/FluentTester/TestComponents/TextExperimental/CustomizeUsage.tsx +42 -42
@@ -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}>
@@ -4,15 +4,49 @@ import { Stack } from '@fluentui-react-native/stack';
4
4
  import { Text } from '@fluentui-react-native/experimental-text';
5
5
  import { stackStyle } from '../Common/styles';
6
6
 
7
- export const CustomizeUsage: React.FunctionComponent = () => {
8
- const RedCaptionBold = Text.customize({ variant: 'captionStandard', fontWeight: '700', color: '#ff0000' });
9
- const OrangeSecondaryBold = Text.customize({ variant: 'secondaryStandard', fontWeight: '700', color: '#ff9900' });
10
- const YellowBodyBold = Text.customize({ variant: 'bodyStandard', fontWeight: '700', color: '#f3ce00' });
11
- const GreenSubheaderBold = Text.customize({ variant: 'subheaderStandard', fontWeight: '700', color: '#02c440' });
12
- const BlueHeaderBold = Text.customize({ variant: 'headerStandard', fontWeight: '700', color: '#0229c4' });
13
- const IndigoHeroBold = Text.customize({ variant: 'heroStandard', fontWeight: '700', color: '#4b0082' });
14
- const PurpleHeroLargeBold = Text.customize({ variant: 'heroLargeStandard', fontWeight: '700', color: '#8402c4' });
7
+ const RedCaptionBold = Text.customize({ variant: 'captionStandard', fontWeight: '700', color: '#ff0000' });
8
+ const OrangeSecondaryBold = Text.customize({ variant: 'secondaryStandard', fontWeight: '700', color: '#ff9900' });
9
+ const YellowBodyBold = Text.customize({ variant: 'bodyStandard', fontWeight: '700', color: '#f3ce00' });
10
+ const GreenSubheaderBold = Text.customize({ variant: 'subheaderStandard', fontWeight: '700', color: '#02c440' });
11
+ const BlueHeaderBold = Text.customize({ variant: 'headerStandard', fontWeight: '700', color: '#0229c4' });
12
+ const IndigoHeroBold = Text.customize({ variant: 'heroStandard', fontWeight: '700', color: '#4b0082' });
13
+ const PurpleHeroLargeBold = Text.customize({ 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({ variant: 'heroLargeStandard', fontFamily: 'Arial Black' });
34
+ const BrushScriptMT = Text.customize({ variant: 'heroStandard', fontFamily: 'Brush Script MT' });
35
+ const CourierNew = Text.customize({ variant: 'headerStandard', fontFamily: CustomFontNames.CourierNew });
36
+ const Georgia = Text.customize({ variant: 'subheaderStandard', fontFamily: CustomFontNames.Georgia });
37
+ const TimesNewRoman = Text.customize({ variant: 'secondaryStandard', fontFamily: CustomFontNames.TimesNewRoman });
38
+ const Wingdings = Text.customize({ variant: 'captionStandard', fontFamily: 'Wingdings' });
39
+
40
+ // Examples of supported Android fonts.
41
+ const Casual = Text.customize({ variant: 'heroStandard', fontFamily: 'casual' });
42
+ const Cursive = Text.customize({ variant: 'heroStandard', fontFamily: 'cursive' });
43
+ // Examples of iOS fonts.
44
+ const Papyrus = Text.customize({ variant: 'heroLargeStandard', fontFamily: 'Papyrus' });
45
+ const Helvetica = Text.customize({ variant: 'heroLargeStandard', fontFamily: 'Helvetica' });
46
+ // Fonts supported on Android and iOS
47
+ const Arial = Text.customize({ 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({ variant: 'heroLargeStandard', fontFamily: 'Arial Black' });
49
- const BrushScriptMT = Text.customize({ variant: 'heroStandard', fontFamily: 'Brush Script MT' });
50
- const CourierNew = Text.customize({ variant: 'headerStandard', fontFamily: CustomFontNames.CourierNew });
51
- const Georgia = Text.customize({ variant: 'subheaderStandard', fontFamily: CustomFontNames.Georgia });
52
- const TimesNewRoman = Text.customize({ variant: 'secondaryStandard', fontFamily: CustomFontNames.TimesNewRoman });
53
- const Wingdings = Text.customize({ variant: 'captionStandard', fontFamily: 'Wingdings' });
54
-
55
- // Examples of supported Android fonts.
56
- const Casual = Text.customize({ variant: 'heroStandard', fontFamily: 'casual' });
57
- const Cursive = Text.customize({ variant: 'heroStandard', fontFamily: 'cursive' });
58
- // Examples of iOS fonts.
59
- const Papyrus = Text.customize({ variant: 'heroLargeStandard', fontFamily: 'Papyrus' });
60
- const Helvetica = Text.customize({ variant: 'heroLargeStandard', fontFamily: 'Helvetica' });
61
- // Fonts supported on Android and iOS
62
- const Arial = Text.customize({ variant: 'heroLargeStandard', fontFamily: 'arial' });
63
-
64
64
  const CustomFontStack = () => {
65
65
  return (
66
66
  <Stack style={stackStyle} gap={5}>