@fluentui-react-native/tester 0.114.1 → 0.115.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 (38) hide show
  1. package/CHANGELOG.json +241 -1
  2. package/CHANGELOG.md +53 -2
  3. package/lib/fluent-tester/src/TestComponents/Common/styles.d.ts +4 -0
  4. package/lib/fluent-tester/src/TestComponents/Common/styles.d.ts.map +1 -1
  5. package/lib/fluent-tester/src/TestComponents/Common/styles.js +4 -0
  6. package/lib/fluent-tester/src/TestComponents/Common/styles.js.map +1 -1
  7. package/lib/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.d.ts.map +1 -1
  8. package/lib/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.js +2 -1
  9. package/lib/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.js.map +1 -1
  10. package/lib/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.d.ts.map +1 -1
  11. package/lib/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.js +7 -4
  12. package/lib/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.js.map +1 -1
  13. package/lib/fluent-tester/src/TestComponents/Switch/Switch.d.ts.map +1 -1
  14. package/lib/fluent-tester/src/TestComponents/Switch/Switch.js +24 -13
  15. package/lib/fluent-tester/src/TestComponents/Switch/Switch.js.map +1 -1
  16. package/lib/fluent-tester/src/testPages.js +13 -13
  17. package/lib/fluent-tester/src/testPages.js.map +1 -1
  18. package/lib-commonjs/fluent-tester/src/TestComponents/Common/styles.d.ts +4 -0
  19. package/lib-commonjs/fluent-tester/src/TestComponents/Common/styles.d.ts.map +1 -1
  20. package/lib-commonjs/fluent-tester/src/TestComponents/Common/styles.js +4 -0
  21. package/lib-commonjs/fluent-tester/src/TestComponents/Common/styles.js.map +1 -1
  22. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.d.ts.map +1 -1
  23. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.js +5 -4
  24. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/CustomizedSwitch.js.map +1 -1
  25. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.d.ts.map +1 -1
  26. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.js +5 -3
  27. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/E2ESwitchTest.js.map +1 -1
  28. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/Switch.d.ts.map +1 -1
  29. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/Switch.js +23 -13
  30. package/lib-commonjs/fluent-tester/src/TestComponents/Switch/Switch.js.map +1 -1
  31. package/lib-commonjs/fluent-tester/src/testPages.js +13 -13
  32. package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
  33. package/package.json +36 -36
  34. package/src/TestComponents/Common/styles.ts +4 -0
  35. package/src/TestComponents/Switch/CustomizedSwitch.tsx +2 -1
  36. package/src/TestComponents/Switch/E2ESwitchTest.tsx +10 -4
  37. package/src/TestComponents/Switch/Switch.tsx +34 -13
  38. package/src/testPages.ts +13 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/tester",
3
- "version": "0.114.1",
3
+ "version": "0.115.0",
4
4
  "description": "A test app to test FluentUI React Native Components during development",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft <fluentuinativeowners@microsoft.com>",
@@ -33,43 +33,43 @@
33
33
  "directory": "apps/fluent-tester"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui-react-native/android-theme": ">=0.15.0 <1.0.0",
37
- "@fluentui-react-native/apple-theme": ">=0.17.1 <1.0.0",
38
- "@fluentui-react-native/avatar": "^1.5.0",
39
- "@fluentui-react-native/badge": ">=0.4.1 <1.0.0",
40
- "@fluentui-react-native/button": ">=0.32.6 <1.0.0",
41
- "@fluentui-react-native/default-theme": ">=0.16.15 <1.0.0",
42
- "@fluentui-react-native/dropdown": ">=0.7.1 <1.0.0",
43
- "@fluentui-react-native/experimental-activity-indicator": ">=0.7.1 <1.0.0",
44
- "@fluentui-react-native/experimental-avatar": ">=0.16.28 <1.0.0",
45
- "@fluentui-react-native/experimental-button": "0.16.64",
46
- "@fluentui-react-native/experimental-checkbox": "0.13.10",
47
- "@fluentui-react-native/experimental-expander": "0.5.1",
48
- "@fluentui-react-native/experimental-icon": ">=0.1.2 <1.0.0",
49
- "@fluentui-react-native/experimental-link": "^0.2.6",
50
- "@fluentui-react-native/experimental-menu-button": ">=0.6.1 <1.0.0",
36
+ "@fluentui-react-native/android-theme": ">=0.15.1 <1.0.0",
37
+ "@fluentui-react-native/apple-theme": ">=0.17.2 <1.0.0",
38
+ "@fluentui-react-native/avatar": "^1.5.1",
39
+ "@fluentui-react-native/badge": ">=0.4.2 <1.0.0",
40
+ "@fluentui-react-native/button": ">=0.32.7 <1.0.0",
41
+ "@fluentui-react-native/default-theme": ">=0.16.16 <1.0.0",
42
+ "@fluentui-react-native/dropdown": ">=0.7.2 <1.0.0",
43
+ "@fluentui-react-native/experimental-activity-indicator": ">=0.7.2 <1.0.0",
44
+ "@fluentui-react-native/experimental-avatar": ">=0.16.29 <1.0.0",
45
+ "@fluentui-react-native/experimental-button": "0.16.65",
46
+ "@fluentui-react-native/experimental-checkbox": "0.13.11",
47
+ "@fluentui-react-native/experimental-expander": "0.5.2",
48
+ "@fluentui-react-native/experimental-icon": ">=0.1.3 <1.0.0",
49
+ "@fluentui-react-native/experimental-link": "^0.2.7",
50
+ "@fluentui-react-native/experimental-menu-button": ">=0.6.2 <1.0.0",
51
51
  "@fluentui-react-native/experimental-native-date-picker": ">=0.7.3 <1.0.0",
52
- "@fluentui-react-native/experimental-radio-group": "^0.8.5",
53
- "@fluentui-react-native/experimental-shadow": "0.2.48",
54
- "@fluentui-react-native/experimental-shimmer": "0.8.1",
55
- "@fluentui-react-native/experimental-tabs": "0.8.9",
56
- "@fluentui-react-native/experimental-text": ">=0.11.28 <1.0.0",
57
- "@fluentui-react-native/framework": ">=0.8.24 <1.0.0",
58
- "@fluentui-react-native/icon": "0.16.1",
59
- "@fluentui-react-native/interactive-hooks": ">=0.21.5 <1.0.0",
60
- "@fluentui-react-native/menu": "^1.1.1",
52
+ "@fluentui-react-native/experimental-radio-group": "^0.8.6",
53
+ "@fluentui-react-native/experimental-shadow": "0.2.49",
54
+ "@fluentui-react-native/experimental-shimmer": "0.8.2",
55
+ "@fluentui-react-native/experimental-tabs": "0.8.10",
56
+ "@fluentui-react-native/experimental-text": ">=0.11.29 <1.0.0",
57
+ "@fluentui-react-native/framework": ">=0.8.25 <1.0.0",
58
+ "@fluentui-react-native/icon": "0.16.2",
59
+ "@fluentui-react-native/interactive-hooks": ">=0.22.0 <1.0.0",
60
+ "@fluentui-react-native/menu": "^1.1.2",
61
61
  "@fluentui-react-native/merge-props": ">=0.5.1 <1.0.0",
62
- "@fluentui-react-native/notification": "0.20.1",
63
- "@fluentui-react-native/stack": ">=0.7.30 <1.0.0",
64
- "@fluentui-react-native/switch": "^0.7.9",
65
- "@fluentui-react-native/text": ">=0.18.1 <1.0.0",
66
- "@fluentui-react-native/theme": ">=0.7.10 <1.0.0",
67
- "@fluentui-react-native/theme-tokens": "^0.22.0",
68
- "@fluentui-react-native/theme-types": ">=0.25.0 <1.0.0",
62
+ "@fluentui-react-native/notification": "0.20.2",
63
+ "@fluentui-react-native/stack": ">=0.7.31 <1.0.0",
64
+ "@fluentui-react-native/switch": "^0.8.0",
65
+ "@fluentui-react-native/text": ">=0.18.2 <1.0.0",
66
+ "@fluentui-react-native/theme": ">=0.7.11 <1.0.0",
67
+ "@fluentui-react-native/theme-tokens": "^0.22.1",
68
+ "@fluentui-react-native/theme-types": ">=0.26.0 <1.0.0",
69
69
  "@fluentui-react-native/themed-stylesheet": "^1.4.1",
70
- "@fluentui-react-native/theming-utils": ">=0.19.1 <1.0.0",
71
- "@fluentui-react-native/win32-theme": ">=0.24.2 <1.0.0",
72
- "@fluentui/react-native": ">=0.33.10 <1.0.0",
70
+ "@fluentui-react-native/theming-utils": ">=0.20.0 <1.0.0",
71
+ "@fluentui-react-native/win32-theme": ">=0.24.3 <1.0.0",
72
+ "@fluentui/react-native": ">=0.33.11 <1.0.0",
73
73
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
74
74
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
75
75
  "@fortawesome/react-native-fontawesome": "^0.3.0",
@@ -97,7 +97,7 @@
97
97
  "react-native-svg-transformer": "^1.0.0",
98
98
  "react-native-test-app": "^2.0.2",
99
99
  "react-test-renderer": "17.0.2",
100
- "@fluentui-react-native/focus-zone": "^0.11.11"
100
+ "@fluentui-react-native/focus-zone": "^0.11.12"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@office-iss/react-native-win32": "^0.68.0"
@@ -60,6 +60,10 @@ export const commonTestStyles = StyleSheet.create({
60
60
  minHeight: 200,
61
61
  justifyContent: 'space-between',
62
62
  },
63
+ androidContainer: {
64
+ marginTop: 20,
65
+ justifyContent: 'space-between',
66
+ },
63
67
  });
64
68
 
65
69
  export const fluentTesterStyles = StyleSheet.create({
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- import { View, TextInput, Text, StyleSheet } from 'react-native';
2
+ import { View, TextInput, StyleSheet } from 'react-native';
3
+ import { Text } from '@fluentui-react-native/experimental-text';
3
4
  import { Switch, SwitchTokens } from '@fluentui-react-native/switch';
4
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
5
6
 
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { Stack } from '@fluentui-react-native/stack';
3
3
  import { Switch } from '@fluentui-react-native/switch';
4
- import { Text } from 'react-native';
5
- import { stackStyle } from '../Common/styles';
4
+ import { TextV1 } from '@fluentui-react-native/text';
5
+ import { stackStyle, commonTestStyles } from '../Common/styles';
6
6
  import {
7
7
  SWITCH_TEST_COMPONENT,
8
8
  SWITCH_ACCESSIBILITY_LABEL,
@@ -10,10 +10,16 @@ import {
10
10
  SWITCH_TEST_COMPONENT_LABEL,
11
11
  SWITCH_ON_PRESS,
12
12
  } from './consts';
13
+ import { Platform } from 'react-native';
13
14
 
14
15
  export const E2ESwitchTest: React.FunctionComponent = () => {
15
16
  const [switchPressed, setSwitchSwitchPressed] = React.useState(false);
16
17
 
18
+ const memoizedStyles = React.useMemo(
19
+ () => (Platform.OS === 'android' ? { ...commonTestStyles.androidContainer, height: 100, marginBottom: 50 } : stackStyle),
20
+ [],
21
+ );
22
+
17
23
  const onToggle = React.useCallback(
18
24
  (_e, checked) => {
19
25
  setSwitchSwitchPressed(checked);
@@ -22,9 +28,9 @@ export const E2ESwitchTest: React.FunctionComponent = () => {
22
28
  );
23
29
 
24
30
  return (
25
- <Stack style={stackStyle}>
31
+ <Stack style={memoizedStyles}>
26
32
  <Switch testID={SWITCH_TEST_COMPONENT} label={'Switch Test'} onChange={onToggle} accessibilityLabel={SWITCH_ACCESSIBILITY_LABEL} />
27
- {switchPressed ? <Text testID={SWITCH_ON_PRESS}>Switch Toggled On</Text> : null}
33
+ {switchPressed ? <TextV1 testID={SWITCH_ON_PRESS}>Switch Toggled On</TextV1> : null}
28
34
  <Switch label={SWITCH_TEST_COMPONENT_LABEL} testID={SWITCH_NO_A11Y_LABEL_COMPONENT} />
29
35
  </Stack>
30
36
  );
@@ -8,6 +8,7 @@ import { commonTestStyles } from '../Common/styles';
8
8
  import { ButtonV1 as Button } from '@fluentui-react-native/button';
9
9
  import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
10
10
  import { CustomizedSwitch } from './CustomizedSwitch';
11
+ import { Platform } from 'react-native';
11
12
 
12
13
  const styles = StyleSheet.create({
13
14
  square: {
@@ -18,8 +19,12 @@ const styles = StyleSheet.create({
18
19
  });
19
20
 
20
21
  const StandardUsage: React.FunctionComponent = () => {
22
+ const memoizedStyles = React.useMemo(
23
+ () => (Platform.OS === 'android' ? { ...commonTestStyles.androidContainer, height: 180 } : commonTestStyles.settingsPicker),
24
+ [],
25
+ );
21
26
  return (
22
- <View style={commonTestStyles.settingsPicker}>
27
+ <View style={memoizedStyles}>
23
28
  <Switch defaultChecked={true} label={'Default Checked True'} />
24
29
  <Switch defaultChecked={false} label={'Default Checked False'} />
25
30
  <Switch defaultChecked={true} label={'Disabled Default Checked True'} disabled />
@@ -35,8 +40,13 @@ const OnChangeUsage: React.FunctionComponent = () => {
35
40
  setDisplaySquare(checked);
36
41
  };
37
42
 
43
+ const memoizedStyles = React.useMemo(
44
+ () => (Platform.OS === 'android' ? { ...commonTestStyles.androidContainer, height: 150 } : commonTestStyles.settingsPicker),
45
+ [],
46
+ );
47
+
38
48
  return (
39
- <View style={commonTestStyles.settingsPicker}>
49
+ <View style={memoizedStyles}>
40
50
  <Switch label={'Toggle Square'} defaultChecked={true} onChange={defaultToggleSquare} />
41
51
  {displaySquare && <View style={styles.square} />}
42
52
  </View>
@@ -54,8 +64,13 @@ const ControlSwitchValues: React.FunctionComponent = () => {
54
64
  setToggleSwitch(false);
55
65
  };
56
66
 
67
+ const memoizedStyles = React.useMemo(
68
+ () => (Platform.OS === 'android' ? { ...commonTestStyles.androidContainer, height: 150 } : commonTestStyles.settingsPicker),
69
+ [],
70
+ );
71
+
57
72
  return (
58
- <View style={commonTestStyles.settingsPicker}>
73
+ <View style={memoizedStyles}>
59
74
  <Button onClick={toggleSwitchTrue}>Toggle Switch True</Button>
60
75
  <Button onClick={toggleSwitchFalse}>Toggle Switch False</Button>
61
76
  <Switch label={'Switch Value Being Controlled'} checked={toggleSwitch} />
@@ -68,7 +83,7 @@ const LabelPosition: React.FunctionComponent = () => {
68
83
  <View style={commonTestStyles.settingsPicker}>
69
84
  <Switch defaultChecked={true} labelPosition={'before'} label={'before'} />
70
85
  <Switch defaultChecked={true} labelPosition={'after'} label={'after'} />
71
- <Switch defaultChecked={true} labelPosition={'above'} label={'above'} />
86
+ {Platform.OS !== 'android' && <Switch defaultChecked={true} labelPosition={'above'} label={'above'} />}
72
87
  </View>
73
88
  );
74
89
  };
@@ -96,14 +111,20 @@ const toggleSections: TestSection[] = [
96
111
  name: 'Control Switch Values',
97
112
  component: () => <ControlSwitchValues />,
98
113
  },
99
- {
100
- name: 'Label Position',
101
- component: () => <LabelPosition />,
102
- },
103
- {
104
- name: 'On/Off Text',
105
- component: () => <OnOffText />,
106
- },
114
+ Platform.select({
115
+ android: null,
116
+ default: {
117
+ name: 'Label Position',
118
+ component: () => <LabelPosition />,
119
+ },
120
+ }),
121
+ Platform.select({
122
+ android: null,
123
+ default: {
124
+ name: 'On/Off Text',
125
+ component: () => <OnOffText />,
126
+ },
127
+ }),
107
128
  {
108
129
  name: 'Customized Tokens',
109
130
  component: () => <CustomizedSwitch />,
@@ -120,7 +141,7 @@ export const SwitchTest: React.FunctionComponent = () => {
120
141
  uwpStatus: 'Backlog',
121
142
  iosStatus: 'Backlog',
122
143
  macosStatus: 'Backlog',
123
- androidStatus: 'Backlog',
144
+ androidStatus: 'Experimental',
124
145
  };
125
146
 
126
147
  const description = 'Switch is a control that has two mutually exclusive states.';
package/src/testPages.ts CHANGED
@@ -78,13 +78,13 @@ export const tests: TestDescription[] = [
78
78
  platforms: ['android', 'macos', 'win32'],
79
79
  },
80
80
  {
81
- name: 'Checkbox',
81
+ name: 'Checkbox Legacy',
82
82
  component: CheckboxTest,
83
83
  testPage: HOMEPAGE_CHECKBOX_BUTTON,
84
84
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],
85
85
  },
86
86
  {
87
- name: 'Checkbox (Experimental)',
87
+ name: 'Checkbox V1',
88
88
  component: ExperimentalCheckboxTest,
89
89
  testPage: HOMEPAGE_CHECKBOX_EXPERIMENTAL_BUTTON,
90
90
  platforms: ['android', 'ios', 'macos', 'win32'], // 'windows': GH#935: Temporarily disabling while SVGs don't work in windows
@@ -145,13 +145,13 @@ export const tests: TestDescription[] = [
145
145
  platforms: ['android', 'ios', 'macos', 'win32'],
146
146
  },
147
147
  {
148
- name: 'Link',
148
+ name: 'Link Legacy',
149
149
  component: LinkTest,
150
150
  testPage: HOMEPAGE_LINK_BUTTON,
151
151
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],
152
152
  },
153
153
  {
154
- name: 'Link (Experimental)',
154
+ name: 'Link V1',
155
155
  component: ExperimentalLinkTest,
156
156
  testPage: HOMEPAGE_EXPERIMENTAL_LINK_BUTTON,
157
157
  platforms: ['win32'],
@@ -163,13 +163,13 @@ export const tests: TestDescription[] = [
163
163
  platforms: ['macos', 'win32'],
164
164
  },
165
165
  {
166
- name: 'MenuButton',
166
+ name: 'MenuButton Legacy',
167
167
  component: MenuButtonTest,
168
168
  testPage: HOMEPAGE_MENUBUTTON_BUTTON,
169
169
  platforms: ['macos', 'win32'],
170
170
  },
171
171
  {
172
- name: 'MenuButton (Experimental)',
172
+ name: 'MenuButton V1',
173
173
  component: ExperimentalMenuButtonTest,
174
174
  testPage: HOMEPAGE_EXPERIMENTAL_MENU_BUTTON,
175
175
  platforms: ['macos', 'win32'],
@@ -199,13 +199,13 @@ export const tests: TestDescription[] = [
199
199
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],
200
200
  },
201
201
  {
202
- name: 'RadioGroup',
202
+ name: 'RadioGroup Legacy',
203
203
  component: RadioGroupTest,
204
204
  testPage: HOMEPAGE_RADIOGROUP_BUTTON,
205
205
  platforms: ['macos', 'win32'],
206
206
  },
207
207
  {
208
- name: 'RadioGroup (Experimental)',
208
+ name: 'RadioGroup V1',
209
209
  component: RadioGroupExperimentalTest,
210
210
  testPage: HOMEPAGE_RADIO_GROUP_EXPERIMENTAL_BUTTON,
211
211
  platforms: ['macos', 'win32'],
@@ -250,28 +250,28 @@ export const tests: TestDescription[] = [
250
250
  name: 'Switch',
251
251
  component: SwitchTest,
252
252
  testPage: HOMEPAGE_SWITCH_BUTTON,
253
- platforms: ['win32'],
253
+ platforms: ['win32', 'android'],
254
254
  },
255
255
  {
256
- name: 'Tabs',
256
+ name: 'Tabs Legacy',
257
257
  component: TabsTest,
258
258
  testPage: HOMEPAGE_TABS_BUTTON,
259
259
  platforms: ['macos', 'win32', 'windows'],
260
260
  },
261
261
  {
262
- name: 'Tabs (Experimental)',
262
+ name: 'Tabs V1',
263
263
  component: ExperimentalTabsTest,
264
264
  testPage: HOMEPAGE_EXPERIMENTAL_TABS_BUTTON,
265
265
  platforms: ['macos', 'win32', 'windows'],
266
266
  },
267
267
  {
268
- name: 'Text',
268
+ name: 'Text Legacy',
269
269
  component: TextTest,
270
270
  testPage: HOMEPAGE_TEXT_BUTTON,
271
271
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],
272
272
  },
273
273
  {
274
- name: 'Text (Experimental)',
274
+ name: 'Text V1',
275
275
  component: TextExperimentalTest,
276
276
  testPage: HOMEPAGE_EXPERIMENTAL_TEXT_BUTTON,
277
277
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],