@fluentui-react-native/tester 0.152.0 → 0.153.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 (45) hide show
  1. package/CHANGELOG.json +22 -1
  2. package/CHANGELOG.md +11 -2
  3. package/lib/E2E/src/VibrancyView/consts.d.ts +4 -0
  4. package/lib/E2E/src/VibrancyView/consts.d.ts.map +1 -0
  5. package/lib/E2E/src/VibrancyView/consts.js +4 -0
  6. package/lib/E2E/src/VibrancyView/consts.js.map +1 -0
  7. package/lib/E2E/src/index.consts.d.ts +1 -0
  8. package/lib/E2E/src/index.consts.d.ts.map +1 -1
  9. package/lib/E2E/src/index.consts.js +1 -0
  10. package/lib/E2E/src/index.consts.js.map +1 -1
  11. package/lib/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.d.ts +3 -0
  12. package/lib/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.d.ts.map +1 -0
  13. package/lib/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.js +184 -0
  14. package/lib/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.js.map +1 -0
  15. package/lib/fluent-tester/src/TestComponents/VibrancyView/index.d.ts +2 -0
  16. package/lib/fluent-tester/src/TestComponents/VibrancyView/index.d.ts.map +1 -0
  17. package/lib/fluent-tester/src/TestComponents/VibrancyView/index.js +2 -0
  18. package/lib/fluent-tester/src/TestComponents/VibrancyView/index.js.map +1 -0
  19. package/lib/fluent-tester/src/testPages.d.ts.map +1 -1
  20. package/lib/fluent-tester/src/testPages.js +7 -0
  21. package/lib/fluent-tester/src/testPages.js.map +1 -1
  22. package/lib-commonjs/E2E/src/VibrancyView/consts.d.ts +4 -0
  23. package/lib-commonjs/E2E/src/VibrancyView/consts.d.ts.map +1 -0
  24. package/lib-commonjs/E2E/src/VibrancyView/consts.js +7 -0
  25. package/lib-commonjs/E2E/src/VibrancyView/consts.js.map +1 -0
  26. package/lib-commonjs/E2E/src/index.consts.d.ts +1 -0
  27. package/lib-commonjs/E2E/src/index.consts.d.ts.map +1 -1
  28. package/lib-commonjs/E2E/src/index.consts.js +1 -0
  29. package/lib-commonjs/E2E/src/index.consts.js.map +1 -1
  30. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.d.ts +3 -0
  31. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.d.ts.map +1 -0
  32. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.js +188 -0
  33. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/VibrancyViewTest.js.map +1 -0
  34. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/index.d.ts +2 -0
  35. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/index.d.ts.map +1 -0
  36. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/index.js +5 -0
  37. package/lib-commonjs/fluent-tester/src/TestComponents/VibrancyView/index.js.map +1 -0
  38. package/lib-commonjs/fluent-tester/src/testPages.d.ts.map +1 -1
  39. package/lib-commonjs/fluent-tester/src/testPages.js +7 -0
  40. package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
  41. package/macos/Podfile.lock +248 -242
  42. package/package.json +2 -1
  43. package/src/TestComponents/VibrancyView/VibrancyViewTest.tsx +231 -0
  44. package/src/TestComponents/VibrancyView/index.ts +1 -0
  45. package/src/testPages.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/tester",
3
- "version": "0.152.0",
3
+ "version": "0.153.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>",
@@ -74,6 +74,7 @@
74
74
  "@fluentui-react-native/theme-types": ">=0.32.0 <1.0.0",
75
75
  "@fluentui-react-native/themed-stylesheet": "^1.5.2",
76
76
  "@fluentui-react-native/theming-utils": ">=0.24.3 <1.0.0",
77
+ "@fluentui-react-native/vibrancy-view": ">=0.0.2 <1.0.0",
77
78
  "@fluentui-react-native/win32-theme": ">=0.27.5 <1.0.0",
78
79
  "@fluentui/react-native": ">=0.37.19 <1.0.0",
79
80
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
@@ -0,0 +1,231 @@
1
+ import * as React from 'react';
2
+ import { Alert, StyleSheet, View } from 'react-native';
3
+ import type { ViewProps } from 'react-native';
4
+
5
+ import { ButtonV1 as Button, Text } from '@fluentui/react-native';
6
+ import { Stack } from '@fluentui-react-native/stack';
7
+ import type { Material, BlendingMode, State } from '@fluentui-react-native/vibrancy-view';
8
+ import { VibrancyView } from '@fluentui-react-native/vibrancy-view';
9
+
10
+ import { VIBRANCYVIEW_TESTPAGE } from '../../../../E2E/src/VibrancyView/consts';
11
+ import { MenuPicker } from '../Common/MenuPicker';
12
+ import { stackStyle, commonTestStyles as commonStyles } from '../Common/styles';
13
+ import type { TestSection, PlatformStatus } from '../Test';
14
+ import { Test } from '../Test';
15
+
16
+ const styles = StyleSheet.create({
17
+ row: {
18
+ flex: 1,
19
+ flexDirection: 'row',
20
+ },
21
+ box: {
22
+ width: 100,
23
+ height: 100,
24
+ justifyContent: 'center',
25
+ alignItems: 'center',
26
+ },
27
+ bigBox: {
28
+ width: 200,
29
+ height: 200,
30
+ justifyContent: 'center',
31
+ alignItems: 'center',
32
+ },
33
+ biggerBox: {
34
+ backgroundColor: 'yellow',
35
+ width: 300,
36
+ height: 300,
37
+ justifyContent: 'center',
38
+ alignItems: 'center',
39
+ },
40
+ Rectangle1: {
41
+ backgroundColor: 'yellow',
42
+ width: 300,
43
+ height: 300,
44
+ },
45
+ Rectangle2: {
46
+ position: 'absolute',
47
+ top: 50,
48
+ width: 400,
49
+ height: 200,
50
+ },
51
+ centeredBox: {
52
+ backgroundColor: 'green',
53
+ width: 100,
54
+ height: 100,
55
+ justifyContent: 'center',
56
+ alignItems: 'center',
57
+ },
58
+ borderProps: {
59
+ backgroundColor: 'blue',
60
+ borderColor: 'red',
61
+ borderWidth: 1,
62
+ borderRadius: 8,
63
+ },
64
+ rootWithSpacing: { ...commonStyles.root, gap: 8 },
65
+ });
66
+
67
+ const VibrancyViewDefault: React.FunctionComponent = () => {
68
+ return (
69
+ <Stack style={stackStyle}>
70
+ <View style={styles.rootWithSpacing}>
71
+ <Text>Vibrancy View with no props set</Text>
72
+ <VibrancyView style={styles.box} />
73
+ </View>
74
+ </Stack>
75
+ );
76
+ };
77
+
78
+ const VibrancyViewWithViewProps: React.FunctionComponent = () => {
79
+ const descriptionString = '<View> and <VibrancyView> with the backgroundColor, borderColor, borderWidth, borderRadius set';
80
+ const viewProps: ViewProps = React.useMemo(() => {
81
+ return {
82
+ focusable: true,
83
+ style: [styles.box, styles.borderProps],
84
+ };
85
+ }, []);
86
+ return (
87
+ <Stack style={stackStyle}>
88
+ <View style={styles.rootWithSpacing}>
89
+ <Text>{descriptionString}</Text>
90
+ <View style={styles.row}>
91
+ <View {...viewProps} />
92
+ <VibrancyView {...viewProps} />
93
+ </View>
94
+ </View>
95
+ </Stack>
96
+ );
97
+ };
98
+
99
+ const materialSelections: Material[] = [
100
+ 'titlebar',
101
+ 'selection',
102
+ 'menu',
103
+ 'popover',
104
+ 'sidebar',
105
+ 'headerview',
106
+ 'sheet',
107
+ 'windowbackground',
108
+ 'hudWindow',
109
+ 'fullScreenUI',
110
+ 'toolTip',
111
+ 'contentBackground',
112
+ 'underWindowBackground',
113
+ 'underPageBackground',
114
+ ];
115
+ const materialsCollection = materialSelections.map((material) => {
116
+ return {
117
+ label: material,
118
+ value: material,
119
+ };
120
+ });
121
+
122
+ const blendingModeSelections: BlendingMode[] = ['withinWindow', 'behindWindow'];
123
+ const blendingModeCollection = blendingModeSelections.map((material) => {
124
+ return {
125
+ label: material,
126
+ value: material,
127
+ };
128
+ });
129
+
130
+ const stateSelections: State[] = ['followsWindowActiveState', 'active', 'inactive'];
131
+ const stateCollection = stateSelections.map((material) => {
132
+ return {
133
+ label: material,
134
+ value: material,
135
+ };
136
+ });
137
+
138
+ const VibrancyViewWithVibrancyViewProps: React.FunctionComponent = () => {
139
+ const [material, setMaterial] = React.useState<Material>(undefined);
140
+ const [blendingMode, setBlendingMode] = React.useState<BlendingMode>(undefined);
141
+ const [state, setState] = React.useState<State>(undefined);
142
+
143
+ const onMaterialChange = React.useCallback((material: Material) => {
144
+ setMaterial(material);
145
+ }, []);
146
+
147
+ const onBlendingModeChange = React.useCallback((blendingMode: BlendingMode) => {
148
+ setBlendingMode(blendingMode);
149
+ }, []);
150
+
151
+ const onStateChange = React.useCallback((state: State) => {
152
+ setState(state);
153
+ }, []);
154
+
155
+ return (
156
+ <Stack style={stackStyle}>
157
+ <View style={styles.Rectangle1}>
158
+ <VibrancyView material={material} blendingMode={blendingMode} state={state} style={styles.Rectangle2}>
159
+ <MenuPicker prompt="Material" selected={material || 'undefined'} onChange={onMaterialChange} collection={materialsCollection} />
160
+ <MenuPicker
161
+ prompt="Blending Mode"
162
+ selected={blendingMode || 'undefined'}
163
+ onChange={onBlendingModeChange}
164
+ collection={blendingModeCollection}
165
+ />
166
+ <MenuPicker prompt="State" selected={state || 'undefined'} onChange={onStateChange} collection={stateCollection} />
167
+ </VibrancyView>
168
+ </View>
169
+ </Stack>
170
+ );
171
+ };
172
+
173
+ const HitTestButton = (props: { title: string }) => {
174
+ const onClick = React.useCallback(
175
+ (_e) => {
176
+ Alert.alert(props.title);
177
+ },
178
+ [props],
179
+ );
180
+ return <Button onClick={onClick}>{props.title}</Button>;
181
+ };
182
+
183
+ const VibrancyViewHitTest: React.FunctionComponent = () => {
184
+ return (
185
+ <View style={commonStyles.root}>
186
+ <HitTestButton title={'Button 1'} />
187
+ <VibrancyView style={styles.biggerBox}>
188
+ <HitTestButton title={'Button 2'} />
189
+ <View style={styles.centeredBox}>
190
+ <HitTestButton title={'Button 3'} />
191
+ </View>
192
+ <HitTestButton title={'Button 4'} />
193
+ </VibrancyView>
194
+ <HitTestButton title={'Button 5'} />
195
+ </View>
196
+ );
197
+ };
198
+
199
+ const VibrancyViewSections: TestSection[] = [
200
+ {
201
+ name: 'VibrancyView Default',
202
+ testID: VIBRANCYVIEW_TESTPAGE,
203
+ component: VibrancyViewDefault,
204
+ },
205
+ {
206
+ name: 'VibrancyView with View props',
207
+ component: VibrancyViewWithViewProps,
208
+ },
209
+ {
210
+ name: 'VibrancyView with VibrancyView props',
211
+ component: VibrancyViewWithVibrancyViewProps,
212
+ },
213
+ {
214
+ name: 'VibrancyView Hit Test',
215
+ component: VibrancyViewHitTest,
216
+ },
217
+ ];
218
+
219
+ export const VibrancyViewTest: React.FunctionComponent = () => {
220
+ const status: PlatformStatus = {
221
+ win32Status: 'N/A',
222
+ uwpStatus: 'N/A',
223
+ iosStatus: 'Backlog',
224
+ macosStatus: 'Beta',
225
+ androidStatus: 'N/A',
226
+ };
227
+
228
+ const description = 'VibrancyView is a native module that exposes NSVisualEffectView to React Native on macOS';
229
+
230
+ return <Test name="VibrancyView Test" description={description} sections={VibrancyViewSections} status={status}></Test>;
231
+ };
@@ -0,0 +1 @@
1
+ export * from './VibrancyViewTest';
package/src/testPages.ts CHANGED
@@ -44,6 +44,7 @@ import { TabsV1Test } from './TestComponents/TabsV1';
44
44
  import { TextLegacyTest } from './TestComponents/TextLegacy';
45
45
  import { TextV1Test } from './TestComponents/TextV1';
46
46
  import { ThemeTest } from './TestComponents/Theme';
47
+ import { VibrancyViewTest } from './TestComponents/VibrancyView';
47
48
  import * as Constants from '../../E2E/src/index.consts';
48
49
 
49
50
  export const tests: TestDescription[] = [
@@ -330,4 +331,10 @@ export const tests: TestDescription[] = [
330
331
  testPageButton: Constants.HOMEPAGE_THEME_BUTTON,
331
332
  platforms: ['android', 'ios', 'macos', 'win32', 'windows'],
332
333
  },
334
+ {
335
+ name: 'Vibrancy View',
336
+ component: VibrancyViewTest,
337
+ testPageButton: Constants.HOMEPAGE_VIBRANCYVIEW_BUTTON,
338
+ platforms: ['macos'],
339
+ },
333
340
  ];