@fluentui-react-native/tester 0.75.1 → 0.76.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.
- package/CHANGELOG.json +233 -12
- package/CHANGELOG.md +58 -2
- package/lib/E2E/Avatar/specs/Avatar.spec.win.js +5 -3
- package/lib/E2E/Avatar/specs/Avatar.spec.win.js.map +1 -1
- package/lib/FluentTester/TestComponents/Button/ButtonVariantTestSection.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Button/ButtonVariantTestSection.js +3 -2
- package/lib/FluentTester/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
- package/lib/FluentTester/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Notification/NotificationTest.js +2 -2
- package/lib/FluentTester/TestComponents/Notification/NotificationTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.d.ts +3 -0
- package/lib/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.d.ts.map +1 -0
- package/lib/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.js +21 -0
- package/lib/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.js.map +1 -0
- package/lib/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.js +17 -17
- package/lib/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.js.map +1 -1
- package/lib/FluentTester/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Shadow/ShadowTest.js +2 -5
- package/lib/FluentTester/TestComponents/Shadow/ShadowTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +1 -1
- package/lib/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
- package/lib/FluentTester/TestComponents/TextExperimental/PressableUsage.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/TextExperimental/PressableUsage.js +5 -2
- package/lib/FluentTester/TestComponents/TextExperimental/PressableUsage.js.map +1 -1
- package/lib-commonjs/E2E/Avatar/specs/Avatar.spec.win.js +5 -3
- package/lib-commonjs/E2E/Avatar/specs/Avatar.spec.win.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Button/ButtonVariantTestSection.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Button/ButtonVariantTestSection.js +3 -2
- package/lib-commonjs/FluentTester/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Notification/NotificationTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/Notification/NotificationTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.d.ts +3 -0
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.d.ts.map +1 -0
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.js +26 -0
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.js.map +1 -0
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.js +17 -17
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowTest.js +2 -5
- package/lib-commonjs/FluentTester/TestComponents/Shadow/ShadowTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js +1 -1
- package/lib-commonjs/FluentTester/TestComponents/TextExperimental/CustomizeUsage.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/TextExperimental/PressableUsage.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/TextExperimental/PressableUsage.js +5 -2
- package/lib-commonjs/FluentTester/TestComponents/TextExperimental/PressableUsage.js.map +1 -1
- package/package.json +14 -14
- package/src/E2E/Avatar/specs/Avatar.spec.win.ts +5 -3
- package/src/FluentTester/TestComponents/Button/ButtonVariantTestSection.tsx +3 -2
- package/src/FluentTester/TestComponents/Notification/NotificationTest.tsx +1 -3
- package/src/FluentTester/TestComponents/Shadow/ShadowButtonTestSection.tsx +27 -0
- package/src/FluentTester/TestComponents/Shadow/ShadowDepthTestSection.tsx +45 -20
- package/src/FluentTester/TestComponents/Shadow/ShadowTest.tsx +2 -6
- package/src/FluentTester/TestComponents/TextExperimental/CustomizeUsage.tsx +1 -1
- package/src/FluentTester/TestComponents/TextExperimental/PressableUsage.tsx +13 -1
|
@@ -28,8 +28,7 @@ const PrimaryTestWithTitleAndIcon: React.FunctionComponent = () => {
|
|
|
28
28
|
<Notification
|
|
29
29
|
variant={'primary'}
|
|
30
30
|
icon={iconProps}
|
|
31
|
-
title="Kat's
|
|
32
|
-
action="X"
|
|
31
|
+
title="Kat's iPhoneX"
|
|
33
32
|
onPress={() => {
|
|
34
33
|
console.log('Notification tapped');
|
|
35
34
|
}}
|
|
@@ -71,7 +70,6 @@ const WarningTest: React.FunctionComponent = () => {
|
|
|
71
70
|
return (
|
|
72
71
|
<Notification
|
|
73
72
|
variant={'warning'}
|
|
74
|
-
action="X"
|
|
75
73
|
onPress={() => {
|
|
76
74
|
console.log('Notification tapped');
|
|
77
75
|
}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
import { FAB, Text } from '@fluentui/react-native';
|
|
4
|
+
import { commonTestStyles, stackStyle } from '../Common/styles';
|
|
5
|
+
|
|
6
|
+
const CustomFABNoShadow = FAB.customize({ shadowToken: undefined });
|
|
7
|
+
const CustomFABShadow64 = FAB.customize({
|
|
8
|
+
shadowToken: { ambient: { x: 0, y: 0, blur: 8, color: '#00000033' }, key: { x: 0, y: 32, blur: 64, color: '#0000003d' } },
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const ShadowButtonTestSection: React.FunctionComponent = () => {
|
|
12
|
+
if (Platform.OS === 'ios') {
|
|
13
|
+
return (
|
|
14
|
+
<View style={stackStyle}>
|
|
15
|
+
<FAB style={commonTestStyles.vmargin}>FAB with default shadow</FAB>
|
|
16
|
+
<CustomFABShadow64 style={commonTestStyles.vmargin}>Custom FAB with shadow64</CustomFABShadow64>
|
|
17
|
+
<CustomFABNoShadow style={commonTestStyles.vmargin}>Custom FAB with no shadow</CustomFABNoShadow>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
} else {
|
|
21
|
+
return (
|
|
22
|
+
<View style={stackStyle}>
|
|
23
|
+
<Text>Shadows only implemented for iOS at this time</Text>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { commonTestStyles } from '../Common/styles';
|
|
3
3
|
import { ColorValue, View } from 'react-native';
|
|
4
4
|
import { Text } from '@fluentui/react-native';
|
|
5
|
-
import { Shadow,
|
|
6
|
-
import {
|
|
5
|
+
import { Shadow, getShadowTokenStyleSet } from '@fluentui-react-native/experimental-shadow';
|
|
6
|
+
import { ShadowToken, useTheme } from '@fluentui-react-native/theme-types';
|
|
7
7
|
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
|
|
8
8
|
import { useFluentTheme } from '@fluentui-react-native/framework';
|
|
9
9
|
|
|
@@ -25,7 +25,8 @@ const getThemedStyles = themedStyleSheet(() => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
interface ShadowTestBoxProps {
|
|
28
|
-
|
|
28
|
+
shadowDepthText: string;
|
|
29
|
+
shadowToken: ShadowToken;
|
|
29
30
|
backgroundColor: ColorValue;
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@ const ShadowTestBox: React.FunctionComponent<ShadowTestBoxProps> = (props: Shado
|
|
|
34
35
|
const themedStyles = getThemedStyles(theme);
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
|
-
<Shadow
|
|
38
|
+
<Shadow shadowToken={props.shadowToken}>
|
|
38
39
|
<View
|
|
39
40
|
style={[
|
|
40
41
|
commonTestStyles.view,
|
|
@@ -44,8 +45,8 @@ const ShadowTestBox: React.FunctionComponent<ShadowTestBoxProps> = (props: Shado
|
|
|
44
45
|
{ backgroundColor: props.backgroundColor },
|
|
45
46
|
]}
|
|
46
47
|
>
|
|
47
|
-
<Text variant="bodySemibold">{props.
|
|
48
|
-
<Text>{getShadowDescription(props.
|
|
48
|
+
<Text variant="bodySemibold">{props.shadowDepthText}</Text>
|
|
49
|
+
<Text>{getShadowDescription(props.shadowToken)}</Text>
|
|
49
50
|
</View>
|
|
50
51
|
</Shadow>
|
|
51
52
|
);
|
|
@@ -56,24 +57,48 @@ export const ShadowDepthTestSection: React.FunctionComponent = () => {
|
|
|
56
57
|
|
|
57
58
|
return (
|
|
58
59
|
<View>
|
|
59
|
-
<ShadowTestBox
|
|
60
|
-
<ShadowTestBox
|
|
61
|
-
<ShadowTestBox
|
|
62
|
-
<ShadowTestBox
|
|
63
|
-
<ShadowTestBox
|
|
64
|
-
<ShadowTestBox
|
|
65
|
-
<ShadowTestBox
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<ShadowTestBox
|
|
60
|
+
<ShadowTestBox shadowDepthText="Shadow 2" shadowToken={theme.shadows.shadow2} backgroundColor={theme.colors.background} />
|
|
61
|
+
<ShadowTestBox shadowDepthText="Shadow 4" shadowToken={theme.shadows.shadow4} backgroundColor={theme.colors.background} />
|
|
62
|
+
<ShadowTestBox shadowDepthText="Shadow 8" shadowToken={theme.shadows.shadow8} backgroundColor={theme.colors.background} />
|
|
63
|
+
<ShadowTestBox shadowDepthText="Shadow 16" shadowToken={theme.shadows.shadow16} backgroundColor={theme.colors.background} />
|
|
64
|
+
<ShadowTestBox shadowDepthText="Shadow 28" shadowToken={theme.shadows.shadow28} backgroundColor={theme.colors.background} />
|
|
65
|
+
<ShadowTestBox shadowDepthText="Shadow 64" shadowToken={theme.shadows.shadow64} backgroundColor={theme.colors.background} />
|
|
66
|
+
<ShadowTestBox
|
|
67
|
+
shadowDepthText="Brand Shadow 2"
|
|
68
|
+
shadowToken={theme.shadows.shadow2brand}
|
|
69
|
+
backgroundColor={theme.colors.brandBackground}
|
|
70
|
+
/>
|
|
71
|
+
<ShadowTestBox
|
|
72
|
+
shadowDepthText="Brand Shadow 4"
|
|
73
|
+
shadowToken={theme.shadows.shadow4brand}
|
|
74
|
+
backgroundColor={theme.colors.brandBackground}
|
|
75
|
+
/>
|
|
76
|
+
<ShadowTestBox
|
|
77
|
+
shadowDepthText="Brand Shadow 8"
|
|
78
|
+
shadowToken={theme.shadows.shadow8brand}
|
|
79
|
+
backgroundColor={theme.colors.brandBackground}
|
|
80
|
+
/>
|
|
81
|
+
<ShadowTestBox
|
|
82
|
+
shadowDepthText="Brand Shadow 16"
|
|
83
|
+
shadowToken={theme.shadows.shadow16brand}
|
|
84
|
+
backgroundColor={theme.colors.brandBackground}
|
|
85
|
+
/>
|
|
86
|
+
<ShadowTestBox
|
|
87
|
+
shadowDepthText="Brand Shadow 28"
|
|
88
|
+
shadowToken={theme.shadows.shadow28brand}
|
|
89
|
+
backgroundColor={theme.colors.brandBackground}
|
|
90
|
+
/>
|
|
91
|
+
<ShadowTestBox
|
|
92
|
+
shadowDepthText="Brand Shadow 64"
|
|
93
|
+
shadowToken={theme.shadows.shadow64brand}
|
|
94
|
+
backgroundColor={theme.colors.brandBackground}
|
|
95
|
+
/>
|
|
71
96
|
</View>
|
|
72
97
|
);
|
|
73
98
|
};
|
|
74
99
|
|
|
75
|
-
function getShadowDescription(
|
|
76
|
-
const shadowStyle = getShadowTokenStyleSet(
|
|
100
|
+
function getShadowDescription(shadowToken: ShadowToken): string {
|
|
101
|
+
const shadowStyle = getShadowTokenStyleSet(shadowToken);
|
|
77
102
|
|
|
78
103
|
return (
|
|
79
104
|
'\nAmbient: ' +
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Text } from '@fluentui/react-native';
|
|
3
2
|
import { Test, TestSection, PlatformStatus } from '../Test';
|
|
4
3
|
import { SHADOW_TESTPAGE } from './consts';
|
|
5
4
|
import { ShadowDepthTestSection } from './ShadowDepthTestSection';
|
|
6
|
-
|
|
7
|
-
const ShadowButtonTest: React.FunctionComponent = () => {
|
|
8
|
-
return <Text>TODO</Text>;
|
|
9
|
-
};
|
|
5
|
+
import { ShadowButtonTestSection } from './ShadowButtonTestSection';
|
|
10
6
|
|
|
11
7
|
const shadowSections: TestSection[] = [
|
|
12
8
|
{
|
|
@@ -17,7 +13,7 @@ const shadowSections: TestSection[] = [
|
|
|
17
13
|
{
|
|
18
14
|
name: 'Shadows on Button Examples',
|
|
19
15
|
testID: SHADOW_TESTPAGE,
|
|
20
|
-
component:
|
|
16
|
+
component: ShadowButtonTestSection,
|
|
21
17
|
},
|
|
22
18
|
];
|
|
23
19
|
|
|
@@ -50,7 +50,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
|
|
|
50
50
|
const BlockText = () => {
|
|
51
51
|
return (
|
|
52
52
|
<>
|
|
53
|
-
<Text style={{ textTransform: 'uppercase' }} font="base" weight="medium">
|
|
53
|
+
<Text style={{ textTransform: 'uppercase' }} font="base" weight="medium" truncate>
|
|
54
54
|
I am going to be truncated since I am a very very very very very very very very very very very very very very very very very very
|
|
55
55
|
very very very very very very very very very very very very very very very very very very very very very very very very very very
|
|
56
56
|
very very very very very very very very very very very very very very very very long block text.
|
|
@@ -18,6 +18,10 @@ export const PressableUsage: React.FunctionComponent = () => {
|
|
|
18
18
|
Alert.alert('Alert', 'Success!');
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
const _onPress3 = (): void => {
|
|
22
|
+
Alert.alert('Alert', 'onAccessibilityTap invoked!');
|
|
23
|
+
};
|
|
24
|
+
|
|
21
25
|
const _onKeyDown2 = (ev: IKeyboardEvent) => {
|
|
22
26
|
if (ev.nativeEvent.key === 'Enter' || ev.nativeEvent.key == ' ') Alert.alert('Alert', 'Success!');
|
|
23
27
|
};
|
|
@@ -29,7 +33,14 @@ export const PressableUsage: React.FunctionComponent = () => {
|
|
|
29
33
|
<Stack style={stackStyle} gap={5}>
|
|
30
34
|
<Text variant={'bodyStandard'}>
|
|
31
35
|
To learn more about microsoft, visit this{' '}
|
|
32
|
-
<Text
|
|
36
|
+
<Text
|
|
37
|
+
focusable
|
|
38
|
+
variant={'bodyStandard'}
|
|
39
|
+
color="blue"
|
|
40
|
+
keyDownEvents={handledNativeKeyboardEvents}
|
|
41
|
+
onPress={_onPress}
|
|
42
|
+
onKeyDown={_onKeyDown}
|
|
43
|
+
>
|
|
33
44
|
webpage
|
|
34
45
|
</Text>{' '}
|
|
35
46
|
for more details.
|
|
@@ -42,6 +53,7 @@ export const PressableUsage: React.FunctionComponent = () => {
|
|
|
42
53
|
keyDownEvents={handledNativeKeyboardEvents}
|
|
43
54
|
onPress={_onPress2}
|
|
44
55
|
onKeyDown={_onKeyDown2}
|
|
56
|
+
onAccessibilityTap={_onPress3}
|
|
45
57
|
>
|
|
46
58
|
here
|
|
47
59
|
</Text>{' '}
|