@fluentui-react-native/tester 0.90.0 → 0.90.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.json +64 -1
  2. package/CHANGELOG.md +29 -2
  3. package/lib/FluentTester.js +6 -6
  4. package/lib/FluentTester.js.map +1 -1
  5. package/lib/TestComponents/Avatar/BasicAvatar.js +3 -3
  6. package/lib/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  7. package/lib/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  8. package/lib/TestComponents/Avatar/CustomizedAvatar.js +14 -8
  9. package/lib/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  10. package/lib/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -1
  11. package/lib/TestComponents/Badge/BasicBadgeTest.js +1 -2
  12. package/lib/TestComponents/Badge/BasicBadgeTest.js.map +1 -1
  13. package/lib/TestComponents/Button/ButtonIconTestSection.js +2 -2
  14. package/lib/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  15. package/lib/TestComponents/Button/ButtonShapeTestSection.js +2 -2
  16. package/lib/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  17. package/lib/TestComponents/Button/ButtonSizeTestSection.js +2 -2
  18. package/lib/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  19. package/lib/TestComponents/Button/ButtonVariantTestSection.js +2 -2
  20. package/lib/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  21. package/lib/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  22. package/lib/TestComponents/Button/ToggleButtonTestSection.js +6 -7
  23. package/lib/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  24. package/lib/TestComponents/Callout/CalloutTest.js +1 -1
  25. package/lib/TestComponents/Callout/CalloutTest.js.map +1 -1
  26. package/lib/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  27. package/lib/TestComponents/Checkbox/CheckboxTest.js +8 -5
  28. package/lib/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  29. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  30. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js +8 -5
  31. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  32. package/lib/TestComponents/Common/styles.d.ts +10 -0
  33. package/lib/TestComponents/Common/styles.d.ts.map +1 -1
  34. package/lib/TestComponents/Common/styles.js +3 -0
  35. package/lib/TestComponents/Common/styles.js.map +1 -1
  36. package/lib/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  37. package/lib/TestComponents/Menu/MenuTest.js +9 -4
  38. package/lib/TestComponents/Menu/MenuTest.js.map +1 -1
  39. package/lib/TestComponents/Notification/NotificationTest.js +2 -2
  40. package/lib/TestComponents/Notification/NotificationTest.js.map +1 -1
  41. package/lib/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  42. package/lib/TestComponents/Persona/CustomizeUsage.js +8 -5
  43. package/lib/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  44. package/lib/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  45. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js +11 -8
  46. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  47. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  48. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +3 -2
  49. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  50. package/lib/TestComponents/Test.js +9 -9
  51. package/lib/TestComponents/Test.js.map +1 -1
  52. package/lib/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  53. package/lib/TestComponents/Theme/ThemeTest.js +11 -12
  54. package/lib/TestComponents/Theme/ThemeTest.js.map +1 -1
  55. package/lib/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  56. package/lib/TestComponents/Tokens/TokenTest.js +8 -10
  57. package/lib/TestComponents/Tokens/TokenTest.js.map +1 -1
  58. package/lib-commonjs/FluentTester.js +5 -5
  59. package/lib-commonjs/FluentTester.js.map +1 -1
  60. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js +2 -2
  61. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  62. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  63. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js +13 -7
  64. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  65. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -1
  66. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js +1 -2
  67. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js.map +1 -1
  68. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js +1 -1
  69. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  70. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js +1 -1
  71. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  72. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js +1 -1
  73. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  74. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js +1 -1
  75. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  76. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  77. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js +4 -6
  78. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  79. package/lib-commonjs/TestComponents/Callout/CalloutTest.js +1 -1
  80. package/lib-commonjs/TestComponents/Callout/CalloutTest.js.map +1 -1
  81. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  82. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js +7 -5
  83. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  84. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  85. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js +7 -5
  86. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  87. package/lib-commonjs/TestComponents/Common/styles.d.ts +10 -0
  88. package/lib-commonjs/TestComponents/Common/styles.d.ts.map +1 -1
  89. package/lib-commonjs/TestComponents/Common/styles.js +4 -1
  90. package/lib-commonjs/TestComponents/Common/styles.js.map +1 -1
  91. package/lib-commonjs/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  92. package/lib-commonjs/TestComponents/Menu/MenuTest.js +8 -4
  93. package/lib-commonjs/TestComponents/Menu/MenuTest.js.map +1 -1
  94. package/lib-commonjs/TestComponents/Notification/NotificationTest.js +2 -2
  95. package/lib-commonjs/TestComponents/Notification/NotificationTest.js.map +1 -1
  96. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  97. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js +7 -5
  98. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  99. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  100. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js +10 -8
  101. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  102. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  103. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +2 -1
  104. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  105. package/lib-commonjs/TestComponents/Test.js +9 -9
  106. package/lib-commonjs/TestComponents/Test.js.map +1 -1
  107. package/lib-commonjs/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  108. package/lib-commonjs/TestComponents/Theme/ThemeTest.js +10 -12
  109. package/lib-commonjs/TestComponents/Theme/ThemeTest.js.map +1 -1
  110. package/lib-commonjs/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  111. package/lib-commonjs/TestComponents/Tokens/TokenTest.js +8 -10
  112. package/lib-commonjs/TestComponents/Tokens/TokenTest.js.map +1 -1
  113. package/package.json +5 -5
  114. package/src/FluentTester.tsx +6 -6
  115. package/src/TestComponents/Avatar/BasicAvatar.tsx +2 -2
  116. package/src/TestComponents/Avatar/CustomizedAvatar.tsx +15 -8
  117. package/src/TestComponents/Badge/BasicBadgeTest.tsx +2 -3
  118. package/src/TestComponents/Button/ButtonIconTestSection.tsx +2 -2
  119. package/src/TestComponents/Button/ButtonShapeTestSection.tsx +2 -2
  120. package/src/TestComponents/Button/ButtonSizeTestSection.tsx +2 -2
  121. package/src/TestComponents/Button/ButtonVariantTestSection.tsx +2 -2
  122. package/src/TestComponents/Button/ToggleButtonTestSection.tsx +6 -5
  123. package/src/TestComponents/Callout/CalloutTest.tsx +1 -1
  124. package/src/TestComponents/Checkbox/CheckboxTest.tsx +11 -7
  125. package/src/TestComponents/CheckboxExperimental/CheckboxTest.tsx +10 -7
  126. package/src/TestComponents/Common/styles.ts +5 -0
  127. package/src/TestComponents/Menu/MenuTest.tsx +10 -4
  128. package/src/TestComponents/Notification/NotificationTest.tsx +2 -2
  129. package/src/TestComponents/Persona/CustomizeUsage.tsx +10 -7
  130. package/src/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +4 -9
  131. package/src/TestComponents/PersonaCoin/CustomizeUsage.tsx +13 -10
  132. package/src/TestComponents/Test.tsx +9 -9
  133. package/src/TestComponents/Theme/ThemeTest.tsx +15 -11
  134. package/src/TestComponents/Tokens/TokenTest.tsx +8 -9
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useMemo } from 'react';
2
2
  import { Avatar, AvatarColors, AvatarSize, getJavaHashCode } from '@fluentui-react-native/avatar';
3
- import { View, Text, TextInput, Platform } from 'react-native';
3
+ import { View, Text, TextInput, Platform, StyleSheet } from 'react-native';
4
4
  import { steveBallmerPhotoUrl } from './../PersonaCoin/styles';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
6
  import { FontWeight } from '@fluentui-react-native/theme-types';
@@ -8,6 +8,13 @@ import { SvgIconProps } from '@fluentui-react-native/icon';
8
8
  import TestSvg from '../../FluentTester/test-data/test.svg';
9
9
  import { ToggleButton } from '@fluentui/react-native';
10
10
 
11
+ const styles = StyleSheet.create({
12
+ avatarTestCaseContainer: { marginLeft: 20 },
13
+ avatarTokenOptions: { flexDirection: 'row' },
14
+ fontTokenOptions: { paddingHorizontal: 20 },
15
+ tokenHeader: { fontWeight: 'bold' },
16
+ });
17
+
11
18
  export const CustomizeUsage: React.FunctionComponent = () => {
12
19
  const [showImage, setShowImage] = useState(true);
13
20
  const [showInitials, setShowInitials] = useState(true);
@@ -80,7 +87,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
80
87
  <ToggleButton onClick={() => setShowRing(!showRing)} checked={showRing} style={commonStyles.vmargin}>
81
88
  {showRing ? 'Hide' : 'Show'} ring
82
89
  </ToggleButton>
83
- <View style={{ flexDirection: 'row' }}>
90
+ <View style={styles.avatarTokenOptions}>
84
91
  <View>
85
92
  <TextInput
86
93
  accessibilityLabel="Name for generating initials"
@@ -100,7 +107,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
100
107
  setInitials(e.nativeEvent.text);
101
108
  }}
102
109
  />
103
- <Text style={{ fontWeight: 'bold' }}>Avatar tokens</Text>
110
+ <Text style={styles.tokenHeader}>Avatar tokens</Text>
104
111
  <TextInput
105
112
  accessibilityLabel="Background color"
106
113
  style={commonStyles.textBox}
@@ -139,7 +146,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
139
146
  setIconColor(e.nativeEvent.text);
140
147
  }}
141
148
  />
142
- <Text style={{ fontWeight: 'bold' }}>Ring tokens</Text>
149
+ <Text style={styles.tokenHeader}>Ring tokens</Text>
143
150
  <TextInput
144
151
  accessibilityLabel="Ring background color"
145
152
  style={commonStyles.textBox}
@@ -177,8 +184,8 @@ export const CustomizeUsage: React.FunctionComponent = () => {
177
184
  }}
178
185
  />
179
186
  </View>
180
- <View style={{ paddingHorizontal: 20 }}>
181
- <Text style={{ fontWeight: 'bold' }}>Font tokens</Text>
187
+ <View style={styles.fontTokenOptions}>
188
+ <Text style={styles.tokenHeader}>Font tokens</Text>
182
189
  <TextInput
183
190
  accessibilityLabel="Initials text color"
184
191
  style={commonStyles.textBox}
@@ -232,7 +239,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
232
239
  transparentRing={!showRing}
233
240
  />
234
241
  </View>
235
- <View style={{ marginLeft: 20 }}>
242
+ <View style={styles.avatarTestCaseContainer}>
236
243
  <Text>Avatar customized with props</Text>
237
244
  <Avatar
238
245
  active="active"
@@ -251,7 +258,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
251
258
  />
252
259
  </View>
253
260
  {useJavaHashCode && (
254
- <View style={{ marginLeft: 20 }}>
261
+ <View style={styles.avatarTestCaseContainer}>
255
262
  <Text>Avatar with hashed color</Text>
256
263
  <Avatar
257
264
  active="active"
@@ -67,7 +67,6 @@ export const BasicBadge: React.FunctionComponent = () => {
67
67
  size,
68
68
  shape,
69
69
  };
70
- const badgeContent = size === 'tiny' || size === 'extraSmall' ? '' : 'Basic badge';
71
70
 
72
71
  return (
73
72
  <View>
@@ -88,10 +87,10 @@ export const BasicBadge: React.FunctionComponent = () => {
88
87
  <Text>Parent component for the Badge</Text>
89
88
  {svgIconsEnabled && showIcon ? (
90
89
  <Badge {...badgeConfig} icon={{ svgSource: svgProps }} iconPosition={iconPosition}>
91
- {badgeContent}
90
+ Basic badge
92
91
  </Badge>
93
92
  ) : (
94
- <Badge {...badgeConfig}>{badgeContent}</Badge>
93
+ <Badge {...badgeConfig}>Basic badge</Badge>
95
94
  )}
96
95
  </View>
97
96
 
@@ -1,7 +1,7 @@
1
1
  import { ButtonV1 as Button } from '@fluentui/react-native';
2
2
  import * as React from 'react';
3
3
  import { Platform, View, StyleSheet } from 'react-native';
4
- import { commonTestStyles, stackStyle } from '../Common/styles';
4
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
5
5
  import { SvgIconProps } from '@fluentui-react-native/icon';
6
6
  import TestSvg from './test.svg';
7
7
  import { SvgXml } from 'react-native-svg';
@@ -32,7 +32,7 @@ export const ButtonIconTest: React.FunctionComponent = () => {
32
32
  </svg>`;
33
33
 
34
34
  return (
35
- <View style={[stackStyle, commonTestStyles.view]}>
35
+ <View style={testContentRootViewStyle}>
36
36
  <Button icon={{ fontSource: { ...fontBuiltInProps, fontSize: 32 }, color: '#060' }} style={commonTestStyles.vmargin}>
37
37
  Font icon
38
38
  </Button>
@@ -1,11 +1,11 @@
1
1
  import { ButtonV1 as Button, CompoundButton } from '@fluentui/react-native';
2
2
  import * as React from 'react';
3
3
  import { View } from 'react-native';
4
- import { commonTestStyles, stackStyle } from '../Common/styles';
4
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
5
5
 
6
6
  export const ButtonShapeTest: React.FunctionComponent = () => {
7
7
  return (
8
- <View style={[stackStyle, commonTestStyles.view]}>
8
+ <View style={testContentRootViewStyle}>
9
9
  <Button shape="rounded" style={commonTestStyles.vmargin}>
10
10
  Default Rounded Button
11
11
  </Button>
@@ -2,7 +2,7 @@ import { ButtonV1 as Button, CompoundButton } from '@fluentui/react-native';
2
2
  import { SvgIconProps } from '@fluentui-react-native/icon';
3
3
  import * as React from 'react';
4
4
  import { Platform, View } from 'react-native';
5
- import { commonTestStyles, stackStyle } from '../Common/styles';
5
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
6
6
  import TestSvg from './test.svg';
7
7
 
8
8
  export const ButtonSizeTest: React.FunctionComponent = () => {
@@ -12,7 +12,7 @@ export const ButtonSizeTest: React.FunctionComponent = () => {
12
12
  };
13
13
  const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
14
14
  return (
15
- <View style={[stackStyle, commonTestStyles.view]}>
15
+ <View style={testContentRootViewStyle}>
16
16
  {svgIconsEnabled && (
17
17
  <>
18
18
  <Button
@@ -1,7 +1,7 @@
1
1
  import { Button, CompoundButton, FAB } from '@fluentui-react-native/experimental-button';
2
2
  import * as React from 'react';
3
3
  import { View } from 'react-native';
4
- import { commonTestStyles, stackStyle } from '../Common/styles';
4
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
5
5
  import { SvgIconProps } from '@fluentui-react-native/icon';
6
6
  import TestSvg from './test.svg';
7
7
 
@@ -14,7 +14,7 @@ export const ButtonVariantTest: React.FunctionComponent = () => {
14
14
  const iconProps = { svgSource: svgProps, width: 20, height: 20 };
15
15
 
16
16
  return (
17
- <View style={[stackStyle, commonTestStyles.view]}>
17
+ <View style={testContentRootViewStyle}>
18
18
  <Button style={commonTestStyles.vmargin}>Default</Button>
19
19
  <Button disabled style={commonTestStyles.vmargin}>
20
20
  Default Disabled
@@ -2,13 +2,14 @@ import { ToggleButton } from '@fluentui/react-native';
2
2
  import { Checkbox } from '@fluentui/react-native';
3
3
  import * as React from 'react';
4
4
  import { StyleSheet, View } from 'react-native';
5
- import { commonTestStyles, stackStyle } from '../Common/styles';
5
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
6
6
 
7
7
  const styles = StyleSheet.create({
8
8
  row: {
9
9
  flexDirection: 'row',
10
10
  },
11
- hmargin: {
11
+ checkbox: {
12
+ ...commonTestStyles.vmargin,
12
13
  marginHorizontal: 8,
13
14
  },
14
15
  });
@@ -20,12 +21,12 @@ export const ToggleButtonTest: React.FunctionComponent = () => {
20
21
  const onGhostClicked = React.useCallback(() => setSubtleChecked(!subtleChecked), [subtleChecked, setSubtleChecked]);
21
22
 
22
23
  return (
23
- <View style={[stackStyle, commonTestStyles.view]}>
24
+ <View style={testContentRootViewStyle}>
24
25
  <View style={styles.row}>
25
26
  <ToggleButton onClick={onDefaultClicked} checked={defaultChecked} style={commonTestStyles.vmargin}>
26
27
  Default Toggle
27
28
  </ToggleButton>
28
- <Checkbox checked={defaultChecked} label="Default Toggle is Checked" style={[commonTestStyles.vmargin, styles.hmargin]} />
29
+ <Checkbox checked={defaultChecked} label="Default Toggle is Checked" style={styles.checkbox} />
29
30
  </View>
30
31
  <ToggleButton checked style={commonTestStyles.vmargin}>
31
32
  Checked Default Toggle
@@ -46,7 +47,7 @@ export const ToggleButtonTest: React.FunctionComponent = () => {
46
47
  <ToggleButton appearance="subtle" onClick={onGhostClicked} checked={subtleChecked} style={commonTestStyles.vmargin}>
47
48
  Subtle Toggle
48
49
  </ToggleButton>
49
- <Checkbox checked={subtleChecked} label="Subtle Toggle is Checked" style={[commonTestStyles.vmargin, styles.hmargin]} />
50
+ <Checkbox checked={subtleChecked} label="Subtle Toggle is Checked" style={styles.checkbox} />
50
51
  </View>
51
52
  <ToggleButton appearance="subtle" checked style={commonTestStyles.vmargin}>
52
53
  Checked Subtle Toggle
@@ -348,7 +348,7 @@ const StandardCallout: React.FunctionComponent = () => {
348
348
  </View>
349
349
  ) : (
350
350
  //else
351
- <View style={[{ padding: 20 }, { backgroundColor: calloutHovered ? 'lightgreen' : 'pink' }]}>
351
+ <View style={{ padding: 20, backgroundColor: calloutHovered ? 'lightgreen' : 'pink' }}>
352
352
  <Button content="click to change anchor" onClick={toggleCalloutRef} />
353
353
  </View>
354
354
  )}
@@ -1,11 +1,12 @@
1
1
  import { Checkbox } from '@fluentui/react-native';
2
- import { useTheme } from '@fluentui-react-native/theme-types';
2
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
3
3
  import * as React from 'react';
4
- import { View, TextInput, TextStyle } from 'react-native';
4
+ import { View, TextInput } from 'react-native';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
6
  import { CHECKBOX_TESTPAGE } from './consts';
7
7
  import { E2ECheckboxTest } from './CheckboxE2ETest';
8
8
  import { Test, TestSection, PlatformStatus } from '../Test';
9
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
9
10
 
10
11
  function onChangeUncontrolled(isChecked: boolean) {
11
12
  console.log(isChecked);
@@ -87,6 +88,10 @@ const HoverCheckbox = Checkbox.customize({
87
88
  },
88
89
  });
89
90
 
91
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
92
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
93
+ });
94
+
90
95
  const TokenCheckbox: React.FunctionComponent = () => {
91
96
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
92
97
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
@@ -108,9 +113,8 @@ const TokenCheckbox: React.FunctionComponent = () => {
108
113
  });
109
114
 
110
115
  const theme = useTheme();
111
- const textBoxBorderStyle: TextStyle = {
112
- borderColor: theme.colors.inputBorder,
113
- };
116
+ const textBoxBorderStyle = getThemedStyles(theme);
117
+
114
118
  return (
115
119
  <View>
116
120
  <CircularCheckbox label="A circular checkbox" onChange={onChangeUncontrolled} defaultChecked={false} />
@@ -125,7 +129,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
125
129
 
126
130
  <TextInput
127
131
  accessibilityLabel="Background color"
128
- style={[commonStyles.textBox, textBoxBorderStyle]}
132
+ style={textBoxBorderStyle.textbox}
129
133
  placeholder="Background color"
130
134
  blurOnSubmit={true}
131
135
  onSubmitEditing={(e) => {
@@ -135,7 +139,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
135
139
 
136
140
  <TextInput
137
141
  accessibilityLabel="Checkmark color"
138
- style={[commonStyles.textBox, textBoxBorderStyle]}
142
+ style={textBoxBorderStyle.textbox}
139
143
  placeholder="Checkmark color"
140
144
  blurOnSubmit={true}
141
145
  onSubmitEditing={(e) => {
@@ -2,11 +2,12 @@ import * as React from 'react';
2
2
  import { EXPERIMENTAL_CHECKBOX_TESTPAGE } from './consts';
3
3
  import { Test, TestSection, PlatformStatus } from '../Test';
4
4
  import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
5
- import { useTheme } from '@fluentui-react-native/theme-types';
6
- import { View, TextInput, TextStyle } from 'react-native';
5
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
6
+ import { View, TextInput } from 'react-native';
7
7
  import { commonTestStyles as commonStyles } from '../Common/styles';
8
8
  import { E2ECheckboxExperimentalTest } from './E2ECheckboxExperimentalTest';
9
9
  import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
10
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
10
11
 
11
12
  function onChangeUncontrolled(_e: InteractionEvent, isChecked: boolean) {
12
13
  console.log(isChecked);
@@ -91,6 +92,10 @@ const ComposedCheckbox = Checkbox.compose({
91
92
  },
92
93
  });
93
94
 
95
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
96
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
97
+ });
98
+
94
99
  const TokenCheckbox: React.FunctionComponent = () => {
95
100
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
96
101
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
@@ -104,9 +109,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
104
109
  });
105
110
 
106
111
  const theme = useTheme();
107
- const textBoxBorderStyle: TextStyle = {
108
- borderColor: theme.colors.inputBorder,
109
- };
112
+ const textBoxBorderStyle = getThemedStyles(theme);
110
113
 
111
114
  return (
112
115
  <View>
@@ -123,7 +126,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
123
126
  />
124
127
  <TextInput
125
128
  accessibilityLabel="Background color"
126
- style={[commonStyles.textBox, textBoxBorderStyle]}
129
+ style={textBoxBorderStyle.textbox}
127
130
  placeholder="Background color"
128
131
  blurOnSubmit={true}
129
132
  onSubmitEditing={(e) => {
@@ -133,7 +136,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
133
136
 
134
137
  <TextInput
135
138
  accessibilityLabel="Checkmark color"
136
- style={[commonStyles.textBox, textBoxBorderStyle]}
139
+ style={textBoxBorderStyle.textbox}
137
140
  placeholder="Checkmark color"
138
141
  blurOnSubmit={true}
139
142
  onSubmitEditing={(e) => {
@@ -8,6 +8,7 @@ export const commonTestStyles = StyleSheet.create({
8
8
  flexDirection: 'row',
9
9
  alignItems: 'flex-start',
10
10
  },
11
+ flex: { flex: 1 },
11
12
  header: {
12
13
  marginVertical: 6,
13
14
  fontSize: 16,
@@ -116,6 +117,8 @@ export const fluentTesterStyles = StyleSheet.create({
116
117
  justifyContent: 'flex-start',
117
118
  },
118
119
 
120
+ testListSeparator: { marginHorizontal: 8 },
121
+
119
122
  testSection: {
120
123
  flexGrow: 1,
121
124
  },
@@ -159,3 +162,5 @@ export const mobileStyles = StyleSheet.create({
159
162
  width: '100%',
160
163
  },
161
164
  });
165
+
166
+ export const testContentRootViewStyle = [stackStyle, commonTestStyles.view];
@@ -16,6 +16,7 @@ import { MENU_TESTPAGE } from './consts';
16
16
  import { Test, TestSection, PlatformStatus } from '../Test';
17
17
  import { TextV1 as Text } from '@fluentui-react-native/text';
18
18
  import { E2EMenuTest } from './E2EMenuTest';
19
+ import { StyleSheet } from 'react-native';
19
20
 
20
21
  const MenuDefault: React.FunctionComponent = () => {
21
22
  return (
@@ -36,10 +37,13 @@ const MenuDefault: React.FunctionComponent = () => {
36
37
  );
37
38
  };
38
39
 
40
+ const defaultCheckedTestCase = ['itemOne'];
41
+ const checkedTestCase = ['itemTwo'];
42
+
39
43
  const MenuCheckmarks: React.FunctionComponent = () => {
40
44
  return (
41
45
  <Stack style={stackStyle}>
42
- <Menu defaultChecked={['itemOne']}>
46
+ <Menu defaultChecked={defaultCheckedTestCase}>
43
47
  <MenuTrigger>
44
48
  <Button>All checkmark items</Button>
45
49
  </MenuTrigger>
@@ -51,7 +55,7 @@ const MenuCheckmarks: React.FunctionComponent = () => {
51
55
  </MenuList>
52
56
  </MenuPopover>
53
57
  </Menu>
54
- <Menu hasCheckmarks checked={['itemTwo']}>
58
+ <Menu hasCheckmarks checked={checkedTestCase}>
55
59
  <MenuTrigger>
56
60
  <Button>Some controlled checkmark items with alignment</Button>
57
61
  </MenuTrigger>
@@ -94,7 +98,7 @@ const MenuRadioItem: React.FunctionComponent = () => {
94
98
  return (
95
99
  <Stack style={stackStyle}>
96
100
  <Text>Current checked: {checked.join(' ')}</Text>
97
- <Menu defaultChecked={['itemOne']} onCheckedChange={onCheckedChange}>
101
+ <Menu defaultChecked={defaultCheckedTestCase} onCheckedChange={onCheckedChange}>
98
102
  <MenuTrigger>
99
103
  <Button>Items with radio selection</Button>
100
104
  </MenuTrigger>
@@ -164,10 +168,12 @@ const MenuOpenOnHover: React.FunctionComponent = () => {
164
168
  );
165
169
  };
166
170
 
171
+ const rootStackStyle = StyleSheet.create({ root: { ...(stackStyle as object), flexDirection: 'row' } });
172
+
167
173
  const MenuControlledOpen: React.FunctionComponent = () => {
168
174
  const [open, setOpen] = React.useState<boolean>(false);
169
175
  return (
170
- <Stack style={[stackStyle, { flexDirection: 'row' }]}>
176
+ <Stack style={rootStackStyle.root}>
171
177
  <Button onClick={() => setOpen(!open)}>Toggle open</Button>
172
178
  <Menu open={open}>
173
179
  <MenuTrigger>
@@ -164,7 +164,7 @@ const PrimaryWithAutoHide: React.FunctionComponent = () => {
164
164
  {visible ? 'Hide' : 'Show'}
165
165
  </Button>
166
166
  {!hidden && (
167
- <Animated.View style={[animatedViewProps]}>
167
+ <Animated.View style={animatedViewProps}>
168
168
  <Notification
169
169
  variant={'primary'}
170
170
  action="Undo"
@@ -237,7 +237,7 @@ const PrimaryBarWithAutoHide: React.FunctionComponent = () => {
237
237
  {visible ? 'Hide' : 'Show'}
238
238
  </Button>
239
239
  {!hidden && (
240
- <Animated.View style={[animatedViewProps]}>
240
+ <Animated.View style={animatedViewProps}>
241
241
  <Notification
242
242
  variant={'primaryBar'}
243
243
  onPress={() => {
@@ -1,10 +1,15 @@
1
1
  import * as React from 'react';
2
- import { View, Text, Switch, TextInput, TextStyle } from 'react-native';
2
+ import { View, Text, Switch, TextInput } from 'react-native';
3
3
  import { Persona } from '@fluentui/react-native';
4
4
  import { michaelImageUrl } from './styles';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
- import { useTheme } from '@fluentui-react-native/theme-types';
6
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
7
7
  import { Slider } from '../Common/Slider';
8
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
9
+
10
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
11
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
12
+ });
8
13
 
9
14
  export const CustomizeUsage: React.FunctionComponent = () => {
10
15
  const [showImage, setShowImage] = React.useState(true);
@@ -20,9 +25,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
20
25
  const [verticalGap, setVerticalGap] = React.useState<number>();
21
26
 
22
27
  const theme = useTheme();
23
- const textBoxBorderStyle: TextStyle = {
24
- borderColor: theme.colors.inputBorder,
25
- };
28
+ const textBoxBorderStyle = getThemedStyles(theme);
26
29
 
27
30
  const CustomizedPersona = React.useMemo(() => {
28
31
  const tokens = {
@@ -49,7 +52,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
49
52
 
50
53
  <TextInput
51
54
  accessibilityLabel="Background color"
52
- style={[commonStyles.textBox, textBoxBorderStyle]}
55
+ style={textBoxBorderStyle.textbox}
53
56
  placeholder="Background color"
54
57
  blurOnSubmit={true}
55
58
  onSubmitEditing={(e) => {
@@ -59,7 +62,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
59
62
 
60
63
  <TextInput
61
64
  accessibilityLabel="Initials text color"
62
- style={[commonStyles.textBox, textBoxBorderStyle]}
65
+ style={textBoxBorderStyle.textbox}
63
66
  placeholder="Initials text color"
64
67
  blurOnSubmit={true}
65
68
  onSubmitEditing={(e) => {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { PersonaCoin } from '@fluentui/react-native';
3
- import { Switch, View, Text, TextInput } from 'react-native';
3
+ import { Switch, View, Text, TextInput, StyleSheet } from 'react-native';
4
4
  import Slider from '@react-native-community/slider';
5
5
  import { steveBallmerPhotoUrl, undefinedText } from './styles';
6
6
  import { commonTestStyles as commonStyles } from '../Common/styles';
@@ -8,20 +8,15 @@ import { useTheme } from '@fluentui-react-native/theme-types';
8
8
 
9
9
  type WithUndefined<T> = T | typeof undefinedText;
10
10
 
11
+ const styles = StyleSheet.create({ slider: { ...commonStyles.vmargin, flex: 1 } });
12
+
11
13
  const StyledSlider = (props) => {
12
14
  const { title, min, max, initial, onChange, current, step } = props;
13
15
  const theme = useTheme();
14
16
  return (
15
17
  <View style={{ flexDirection: 'row' }}>
16
18
  <Text style={{ flex: 0.5, color: theme.colors.inputText }}>{title}</Text>
17
- <Slider
18
- step={step || 1}
19
- minimumValue={min}
20
- maximumValue={max}
21
- value={initial}
22
- style={[commonStyles.vmargin, { flex: 1 }]}
23
- onValueChange={onChange}
24
- />
19
+ <Slider step={step || 1} minimumValue={min} maximumValue={max} value={initial} style={styles.slider} onValueChange={onChange} />
25
20
  <Text style={{ flex: 0.2, color: theme.colors.inputText }}>{current}</Text>
26
21
  </View>
27
22
  );
@@ -1,11 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { PersonaCoin, IconAlignment } from '@fluentui/react-native';
3
- import { Switch, View, Text, TextInput, TextStyle } from 'react-native';
3
+ import { Switch, View, Text, TextInput } from 'react-native';
4
4
  import { Slider } from '../Common/Slider';
5
5
  import { steveBallmerPhotoUrl } from './styles';
6
- import { useTheme } from '@fluentui-react-native/theme-types';
6
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
7
7
  import { AlignmentPicker } from '../Common/AlignmentPicker';
8
8
  import { commonTestStyles as commonStyles } from '../Common/styles';
9
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
10
+
11
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
12
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
13
+ });
9
14
 
10
15
  export const CustomizeUsage: React.FunctionComponent = () => {
11
16
  const [showImage, setShowImage] = React.useState(true);
@@ -25,9 +30,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
25
30
  const [transparent, setTransparent] = React.useState<boolean>(false);
26
31
 
27
32
  const theme = useTheme();
28
- const textBoxBorderStyle: TextStyle = {
29
- borderColor: theme.colors.inputBorder,
30
- };
33
+ const textBoxBorderStyle = getThemedStyles(theme);
31
34
 
32
35
  const CustomizedPersonaCoin = React.useMemo(() => {
33
36
  const tokens = {
@@ -75,7 +78,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
75
78
 
76
79
  <TextInput
77
80
  accessibilityLabel="Background color"
78
- style={[commonStyles.textBox, textBoxBorderStyle]}
81
+ style={textBoxBorderStyle.textbox}
79
82
  placeholder="Background color"
80
83
  blurOnSubmit={true}
81
84
  onSubmitEditing={(e) => {
@@ -85,7 +88,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
85
88
 
86
89
  <TextInput
87
90
  accessibilityLabel="Initials text color"
88
- style={[commonStyles.textBox, textBoxBorderStyle]}
91
+ style={textBoxBorderStyle.textbox}
89
92
  placeholder="Initials text color"
90
93
  blurOnSubmit={true}
91
94
  onSubmitEditing={(e) => {
@@ -95,7 +98,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
95
98
 
96
99
  <TextInput
97
100
  accessibilityLabel="Icon stroke color"
98
- style={[commonStyles.textBox, textBoxBorderStyle]}
101
+ style={textBoxBorderStyle.textbox}
99
102
  placeholder="Icon stroke color"
100
103
  blurOnSubmit={true}
101
104
  onSubmitEditing={(e) => {
@@ -105,7 +108,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
105
108
 
106
109
  <TextInput
107
110
  accessibilityLabel="Ring color"
108
- style={[commonStyles.textBox, textBoxBorderStyle]}
111
+ style={textBoxBorderStyle.textbox}
109
112
  placeholder="Ring color"
110
113
  blurOnSubmit={true}
111
114
  onSubmitEditing={(e) => {
@@ -115,7 +118,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
115
118
 
116
119
  <TextInput
117
120
  accessibilityLabel="Ring background color"
118
- style={[commonStyles.textBox, textBoxBorderStyle]}
121
+ style={textBoxBorderStyle.textbox}
119
122
  placeholder="Ring background color"
120
123
  blurOnSubmit={true}
121
124
  onSubmitEditing={(e) => {
@@ -109,7 +109,7 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
109
109
  return (
110
110
  <View testID="ScrollViewAreaForComponents">
111
111
  <View style={styles.header}>
112
- <Text style={[styles.name]} variant="heroSemibold">
112
+ <Text style={styles.name} variant="heroSemibold">
113
113
  {props.name}
114
114
  </Text>
115
115
  {props.spec && <Link url={props.spec} content="SPEC" />}
@@ -125,28 +125,28 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
125
125
  </View>
126
126
  {showStatus && (
127
127
  <>
128
- <Text style={[styles.statusLabel]} variant="bodySemibold">
128
+ <Text style={styles.statusLabel} variant="bodySemibold">
129
129
  Win32: <Text style={styles.status}>{props.status.win32Status}</Text>
130
130
  </Text>
131
- <Text style={[styles.statusLabel]} variant="bodySemibold">
131
+ <Text style={styles.statusLabel} variant="bodySemibold">
132
132
  UWP: <Text style={styles.status}>{props.status.uwpStatus}</Text>
133
133
  </Text>
134
- <Text style={[styles.statusLabel]} variant="bodySemibold">
134
+ <Text style={styles.statusLabel} variant="bodySemibold">
135
135
  iOS: <Text style={styles.status}>{props.status.iosStatus}</Text>
136
136
  </Text>
137
- <Text style={[styles.statusLabel]} variant="bodySemibold">
137
+ <Text style={styles.statusLabel} variant="bodySemibold">
138
138
  macOS: <Text style={styles.status}>{props.status.macosStatus}</Text>
139
139
  </Text>
140
- <Text style={[styles.statusLabel]} variant="bodySemibold">
140
+ <Text style={styles.statusLabel} variant="bodySemibold">
141
141
  Android: <Text style={styles.status}>{props.status.androidStatus}</Text>
142
142
  </Text>
143
143
 
144
- <Text style={[styles.definitionHeader]} variant="headerStandard">
144
+ <Text style={styles.definitionHeader} variant="headerStandard">
145
145
  Status Definitions
146
146
  </Text>
147
147
  {Object.entries(definitions).map(([key, value]) => {
148
148
  return (
149
- <Text style={[styles.statusLabel]} variant="bodySemibold" key={key}>
149
+ <Text style={styles.statusLabel} variant="bodySemibold" key={key}>
150
150
  {key}: <Text style={styles.status}>{value}</Text>
151
151
  </Text>
152
152
  );
@@ -158,7 +158,7 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
158
158
  const TestComponent = section.component;
159
159
  return (
160
160
  <View key={index}>
161
- <Text style={[styles.section]} variant="headerSemibold" testID={section.testID}>
161
+ <Text style={styles.section} variant="headerSemibold" testID={section.testID}>
162
162
  {section.name}
163
163
  </Text>
164
164
  <Separator />