@fluentui-react-native/tester 0.88.0 → 0.90.1
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 +63 -12
- package/CHANGELOG.md +27 -2
- package/lib/FluentTester.js +6 -6
- package/lib/FluentTester.js.map +1 -1
- package/lib/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
- package/lib/TestComponents/Avatar/AvatarTest.js +2 -1
- package/lib/TestComponents/Avatar/AvatarTest.js.map +1 -1
- package/lib/TestComponents/Avatar/BasicAvatar.js +3 -3
- package/lib/TestComponents/Avatar/BasicAvatar.js.map +1 -1
- package/lib/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
- package/lib/TestComponents/Avatar/CustomizedAvatar.js +14 -8
- package/lib/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
- package/lib/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
- package/lib/TestComponents/Badge/BadgeTest.js +2 -1
- package/lib/TestComponents/Badge/BadgeTest.js.map +1 -1
- package/lib/TestComponents/Button/ButtonIconTestSection.js +2 -2
- package/lib/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
- package/lib/TestComponents/Button/ButtonShapeTestSection.js +2 -2
- package/lib/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
- package/lib/TestComponents/Button/ButtonSizeTestSection.js +2 -2
- package/lib/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
- package/lib/TestComponents/Button/ButtonTest.d.ts.map +1 -1
- package/lib/TestComponents/Button/ButtonTest.js +2 -1
- package/lib/TestComponents/Button/ButtonTest.js.map +1 -1
- package/lib/TestComponents/Button/ButtonVariantTestSection.js +2 -2
- package/lib/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
- package/lib/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
- package/lib/TestComponents/Button/ToggleButtonTestSection.js +6 -7
- package/lib/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
- package/lib/TestComponents/Callout/CalloutTest.js +1 -1
- package/lib/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
- package/lib/TestComponents/Checkbox/CheckboxTest.js +10 -6
- package/lib/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
- package/lib/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
- package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js +8 -5
- package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
- package/lib/TestComponents/Common/styles.d.ts +10 -0
- package/lib/TestComponents/Common/styles.d.ts.map +1 -1
- package/lib/TestComponents/Common/styles.js +3 -0
- package/lib/TestComponents/Common/styles.js.map +1 -1
- package/lib/TestComponents/Menu/MenuTest.d.ts.map +1 -1
- package/lib/TestComponents/Menu/MenuTest.js +11 -5
- package/lib/TestComponents/Menu/MenuTest.js.map +1 -1
- package/lib/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
- package/lib/TestComponents/Notification/NotificationTest.js +4 -3
- package/lib/TestComponents/Notification/NotificationTest.js.map +1 -1
- package/lib/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
- package/lib/TestComponents/Persona/CustomizeUsage.js +8 -5
- package/lib/TestComponents/Persona/CustomizeUsage.js.map +1 -1
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.js +11 -8
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +3 -2
- package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
- package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
- package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
- package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
- package/lib/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
- package/lib/TestComponents/Shadow/ShadowTest.js +2 -1
- package/lib/TestComponents/Shadow/ShadowTest.js.map +1 -1
- package/lib/TestComponents/Switch/Switch.d.ts.map +1 -1
- package/lib/TestComponents/Switch/Switch.js +2 -1
- package/lib/TestComponents/Switch/Switch.js.map +1 -1
- package/lib/TestComponents/Test.d.ts +1 -0
- package/lib/TestComponents/Test.d.ts.map +1 -1
- package/lib/TestComponents/Test.js +74 -47
- package/lib/TestComponents/Test.js.map +1 -1
- package/lib/TestComponents/Text/TextTest.d.ts.map +1 -1
- package/lib/TestComponents/Text/TextTest.js +2 -1
- package/lib/TestComponents/Text/TextTest.js.map +1 -1
- package/lib/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
- package/lib/TestComponents/Theme/ThemeTest.js +11 -12
- package/lib/TestComponents/Theme/ThemeTest.js.map +1 -1
- package/lib/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
- package/lib/TestComponents/Tokens/TokenTest.js +8 -10
- package/lib/TestComponents/Tokens/TokenTest.js.map +1 -1
- package/lib-commonjs/FluentTester.js +5 -5
- package/lib-commonjs/FluentTester.js.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/AvatarTest.js +2 -1
- package/lib-commonjs/TestComponents/Avatar/AvatarTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js +2 -2
- package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js +13 -7
- package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
- package/lib-commonjs/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Badge/BadgeTest.js +2 -1
- package/lib-commonjs/TestComponents/Badge/BadgeTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonTest.js +2 -1
- package/lib-commonjs/TestComponents/Button/ButtonTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js +1 -1
- package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
- package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js +4 -6
- package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
- package/lib-commonjs/TestComponents/Callout/CalloutTest.js +1 -1
- package/lib-commonjs/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js +9 -6
- package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
- package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js +7 -5
- package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Common/styles.d.ts +10 -0
- package/lib-commonjs/TestComponents/Common/styles.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Common/styles.js +4 -1
- package/lib-commonjs/TestComponents/Common/styles.js.map +1 -1
- package/lib-commonjs/TestComponents/Menu/MenuTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Menu/MenuTest.js +10 -5
- package/lib-commonjs/TestComponents/Menu/MenuTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Notification/NotificationTest.js +4 -3
- package/lib-commonjs/TestComponents/Notification/NotificationTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js +7 -5
- package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js.map +1 -1
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js +10 -8
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +2 -1
- package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
- package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
- package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Shadow/ShadowTest.js +2 -1
- package/lib-commonjs/TestComponents/Shadow/ShadowTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Switch/Switch.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Switch/Switch.js +2 -1
- package/lib-commonjs/TestComponents/Switch/Switch.js.map +1 -1
- package/lib-commonjs/TestComponents/Test.d.ts +1 -0
- package/lib-commonjs/TestComponents/Test.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Test.js +72 -45
- package/lib-commonjs/TestComponents/Test.js.map +1 -1
- package/lib-commonjs/TestComponents/Text/TextTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Text/TextTest.js +2 -1
- package/lib-commonjs/TestComponents/Text/TextTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Theme/ThemeTest.js +10 -12
- package/lib-commonjs/TestComponents/Theme/ThemeTest.js.map +1 -1
- package/lib-commonjs/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Tokens/TokenTest.js +8 -10
- package/lib-commonjs/TestComponents/Tokens/TokenTest.js.map +1 -1
- package/package.json +2 -2
- package/src/FluentTester.tsx +6 -6
- package/src/TestComponents/Avatar/AvatarTest.tsx +3 -1
- package/src/TestComponents/Avatar/BasicAvatar.tsx +2 -2
- package/src/TestComponents/Avatar/CustomizedAvatar.tsx +15 -8
- package/src/TestComponents/Badge/BadgeTest.tsx +3 -1
- package/src/TestComponents/Button/ButtonIconTestSection.tsx +2 -2
- package/src/TestComponents/Button/ButtonShapeTestSection.tsx +2 -2
- package/src/TestComponents/Button/ButtonSizeTestSection.tsx +2 -2
- package/src/TestComponents/Button/ButtonTest.tsx +3 -1
- package/src/TestComponents/Button/ButtonVariantTestSection.tsx +2 -2
- package/src/TestComponents/Button/ToggleButtonTestSection.tsx +6 -5
- package/src/TestComponents/Callout/CalloutTest.tsx +1 -1
- package/src/TestComponents/Checkbox/CheckboxTest.tsx +14 -8
- package/src/TestComponents/CheckboxExperimental/CheckboxTest.tsx +10 -7
- package/src/TestComponents/Common/styles.ts +5 -0
- package/src/TestComponents/Menu/MenuTest.tsx +13 -5
- package/src/TestComponents/Notification/NotificationTest.tsx +5 -3
- package/src/TestComponents/Persona/CustomizeUsage.tsx +10 -7
- package/src/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +4 -9
- package/src/TestComponents/PersonaCoin/CustomizeUsage.tsx +13 -10
- package/src/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.tsx +9 -1
- package/src/TestComponents/Shadow/ShadowTest.tsx +3 -1
- package/src/TestComponents/Switch/Switch.tsx +3 -1
- package/src/TestComponents/Test.tsx +98 -62
- package/src/TestComponents/Text/TextTest.tsx +3 -1
- package/src/TestComponents/Theme/ThemeTest.tsx +15 -11
- package/src/TestComponents/Tokens/TokenTest.tsx +8 -9
|
@@ -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
|
|
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
|
|
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={
|
|
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={
|
|
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={
|
|
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={
|
|
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={
|
|
121
|
+
style={textBoxBorderStyle.textbox}
|
|
119
122
|
placeholder="Ring background color"
|
|
120
123
|
blurOnSubmit={true}
|
|
121
124
|
onSubmitEditing={(e) => {
|
|
@@ -23,7 +23,15 @@ export const RadioGroupExperimentalTest: React.FunctionComponent = () => {
|
|
|
23
23
|
const description =
|
|
24
24
|
'RadioGroup lets users select a single option from two or more choices. Each option is represented by one Radio; a user can select only one Radio in a RadioGroup.';
|
|
25
25
|
|
|
26
|
+
const spec = 'https://github.com/microsoft/fluentui-react-native/blob/main/packages/experimental/RadioGroup/SPEC.md';
|
|
27
|
+
|
|
26
28
|
return (
|
|
27
|
-
<Test
|
|
29
|
+
<Test
|
|
30
|
+
name="Experimental RadioGroup Test"
|
|
31
|
+
description={description}
|
|
32
|
+
spec={spec}
|
|
33
|
+
sections={radioGroupExperimentalSections}
|
|
34
|
+
status={status}
|
|
35
|
+
/>
|
|
28
36
|
);
|
|
29
37
|
};
|
|
@@ -28,5 +28,7 @@ export const ShadowTest: React.FunctionComponent = () => {
|
|
|
28
28
|
|
|
29
29
|
const description = 'A Shadow component using the Fluent Design System. Shadow components can be added to other components.';
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const spec = 'https://github.com/microsoft/fluentui-react-native/blob/main/packages/experimental/Shadow/SPEC.md';
|
|
32
|
+
|
|
33
|
+
return <Test name="Shadow Test" description={description} spec={spec} sections={shadowSections} status={status} />;
|
|
32
34
|
};
|
|
@@ -125,5 +125,7 @@ export const SwitchTest: React.FunctionComponent = () => {
|
|
|
125
125
|
|
|
126
126
|
const description = 'Switch is a control that has two mutually exclusive states.';
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
const spec = 'https://github.com/microsoft/fluentui-react-native/blob/main/packages/experimental/Switch/SPEC.md';
|
|
129
|
+
|
|
130
|
+
return <Test name="Switch Test" description={description} spec={spec} sections={toggleSections} status={status} />;
|
|
129
131
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleSheet, View
|
|
3
|
-
import { Text, Separator } from '@fluentui/react-native';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Text, ToggleButton, Separator, Link } from '@fluentui/react-native';
|
|
4
4
|
import { Stack } from '@fluentui-react-native/stack';
|
|
5
5
|
import { stackStyle } from './Common/styles';
|
|
6
|
+
import { useTheme } from '@fluentui-react-native/theme-types';
|
|
7
|
+
import Svg, { G, Path, SvgProps } from 'react-native-svg';
|
|
8
|
+
import { SvgIconProps } from '@fluentui-react-native/icon';
|
|
6
9
|
|
|
7
10
|
export type TestSection = {
|
|
8
11
|
name: string;
|
|
@@ -22,29 +25,44 @@ export type PlatformStatus = {
|
|
|
22
25
|
export interface TestProps {
|
|
23
26
|
name: string;
|
|
24
27
|
description: string;
|
|
28
|
+
spec?: string;
|
|
25
29
|
status: PlatformStatus;
|
|
26
30
|
sections: TestSection[];
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
const definitions = {
|
|
34
|
+
Production: 'Control is ready for broad partner use and to be used in production-ready scenarios.',
|
|
35
|
+
Beta: 'Control is ready for partner consumption, but not ready for production release (e.g. fixing bugs).',
|
|
36
|
+
Experimental: 'Control code checked into repo, but not ready for partner use.',
|
|
37
|
+
Backlog: 'Control is in plan and on our backlog to deliver.',
|
|
38
|
+
'N/A': 'Control is not in current plan.',
|
|
39
|
+
};
|
|
40
|
+
|
|
29
41
|
const styles = StyleSheet.create({
|
|
30
42
|
name: {
|
|
31
43
|
marginTop: 4,
|
|
32
44
|
},
|
|
45
|
+
definitionHeader: {
|
|
46
|
+
marginTop: 12,
|
|
47
|
+
marginBottom: 6,
|
|
48
|
+
},
|
|
33
49
|
description: {
|
|
34
50
|
alignItems: 'flex-start',
|
|
35
51
|
flexWrap: 'wrap',
|
|
36
52
|
},
|
|
53
|
+
header: {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
justifyContent: 'space-between',
|
|
57
|
+
},
|
|
37
58
|
section: {
|
|
38
59
|
marginTop: 12,
|
|
39
60
|
},
|
|
40
61
|
statusView: {
|
|
41
62
|
flexDirection: 'row',
|
|
42
|
-
alignItems: '
|
|
63
|
+
alignItems: 'center',
|
|
43
64
|
justifyContent: 'space-between',
|
|
44
65
|
},
|
|
45
|
-
statusHeader: {
|
|
46
|
-
marginBottom: 6,
|
|
47
|
-
},
|
|
48
66
|
statusLabel: {
|
|
49
67
|
marginTop: 2,
|
|
50
68
|
marginStart: 4,
|
|
@@ -54,75 +72,93 @@ const styles = StyleSheet.create({
|
|
|
54
72
|
},
|
|
55
73
|
});
|
|
56
74
|
|
|
57
|
-
// mobile platform check to not render status components.
|
|
58
|
-
const isMobile = Platform.OS == 'android' || (Platform.OS == 'ios' && !Platform.isPad);
|
|
59
|
-
|
|
60
75
|
export const Test = (props: TestProps): React.ReactElement<Record<string, never>> => {
|
|
76
|
+
const [showStatus, setShowStatus] = React.useState(false);
|
|
77
|
+
|
|
78
|
+
const toggleSvg: React.FunctionComponent<SvgProps> = () => {
|
|
79
|
+
const plusPath =
|
|
80
|
+
'M6.5 1.75C6.5 1.33579 6.16421 1 5.75 1C5.33579 1 5 1.33579 5 1.75V5H1.75C1.33579 5 1 5.33579 1 5.75C1 6.16421 1.33579 6.5 1.75 6.5H5V9.75C5 10.1642 5.33579 10.5 5.75 10.5C6.16421 10.5 6.5 10.1642 6.5 9.75V6.5H9.75C10.1642 6.5 10.5 6.16421 10.5 5.75C10.5 5.33579 10.1642 5 9.75 5H6.5V1.75Z';
|
|
81
|
+
const minusPath = 'M2.75 5.25h6.5s0.75 0 0.75 0.75v0s0 0.75 -0.75 0.75h-6.5s-0.75 0 -0.75 -0.75v0s0 -0.75 0.75 -0.75';
|
|
82
|
+
|
|
83
|
+
const path = showStatus ? minusPath : plusPath;
|
|
84
|
+
return (
|
|
85
|
+
<Svg>
|
|
86
|
+
<G>
|
|
87
|
+
<Path d={path} fill="black" />
|
|
88
|
+
</G>
|
|
89
|
+
</Svg>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
const svgProps: SvgIconProps = {
|
|
93
|
+
src: toggleSvg,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const theme = useTheme();
|
|
97
|
+
const fontFamily = theme.typography.families.primary;
|
|
98
|
+
|
|
99
|
+
const plusCodepoint = 0x2795;
|
|
100
|
+
const minusCodepoint = 0x2796;
|
|
101
|
+
const fontIconProps = {
|
|
102
|
+
fontFamily: fontFamily,
|
|
103
|
+
codepoint: showStatus ? minusCodepoint : plusCodepoint,
|
|
104
|
+
fontSize: 10,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const toggleIconProps = Platform.OS === 'windows' ? { fontSource: fontIconProps } : { svgSource: svgProps, width: 12, height: 12 };
|
|
108
|
+
|
|
61
109
|
return (
|
|
62
110
|
<View testID="ScrollViewAreaForComponents">
|
|
63
|
-
<
|
|
64
|
-
{
|
|
65
|
-
|
|
111
|
+
<View style={styles.header}>
|
|
112
|
+
<Text style={styles.name} variant="heroSemibold">
|
|
113
|
+
{props.name}
|
|
114
|
+
</Text>
|
|
115
|
+
{props.spec && <Link url={props.spec} content="SPEC" />}
|
|
116
|
+
</View>
|
|
66
117
|
<Separator />
|
|
67
118
|
<Stack style={stackStyle}>
|
|
68
119
|
<Text style={styles.description}>{props.description}</Text>
|
|
69
120
|
</Stack>
|
|
70
|
-
{
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</Stack>
|
|
121
|
+
<Stack style={stackStyle}>
|
|
122
|
+
<View style={styles.statusView}>
|
|
123
|
+
<Text variant="headerStandard">Platform Status</Text>
|
|
124
|
+
<ToggleButton iconOnly={true} icon={toggleIconProps} onClick={() => setShowStatus(!showStatus)} />
|
|
125
|
+
</View>
|
|
126
|
+
{showStatus && (
|
|
127
|
+
<>
|
|
128
|
+
<Text style={styles.statusLabel} variant="bodySemibold">
|
|
129
|
+
Win32: <Text style={styles.status}>{props.status.win32Status}</Text>
|
|
130
|
+
</Text>
|
|
131
|
+
<Text style={styles.statusLabel} variant="bodySemibold">
|
|
132
|
+
UWP: <Text style={styles.status}>{props.status.uwpStatus}</Text>
|
|
133
|
+
</Text>
|
|
134
|
+
<Text style={styles.statusLabel} variant="bodySemibold">
|
|
135
|
+
iOS: <Text style={styles.status}>{props.status.iosStatus}</Text>
|
|
136
|
+
</Text>
|
|
137
|
+
<Text style={styles.statusLabel} variant="bodySemibold">
|
|
138
|
+
macOS: <Text style={styles.status}>{props.status.macosStatus}</Text>
|
|
139
|
+
</Text>
|
|
140
|
+
<Text style={styles.statusLabel} variant="bodySemibold">
|
|
141
|
+
Android: <Text style={styles.status}>{props.status.androidStatus}</Text>
|
|
142
|
+
</Text>
|
|
93
143
|
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</Text>
|
|
102
|
-
<Text style={[styles.statusLabel]} variant="bodySemibold">
|
|
103
|
-
Beta:{' '}
|
|
104
|
-
<Text style={styles.status}>
|
|
105
|
-
Control is ready for partner consumption, but not ready for production release (e.g. fixing bugs).
|
|
144
|
+
<Text style={styles.definitionHeader} variant="headerStandard">
|
|
145
|
+
Status Definitions
|
|
146
|
+
</Text>
|
|
147
|
+
{Object.entries(definitions).map(([key, value]) => {
|
|
148
|
+
return (
|
|
149
|
+
<Text style={styles.statusLabel} variant="bodySemibold" key={key}>
|
|
150
|
+
{key}: <Text style={styles.status}>{value}</Text>
|
|
106
151
|
</Text>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Backlog: <Text style={styles.status}>Control is in plan and on our backlog to deliver.</Text>
|
|
113
|
-
</Text>
|
|
114
|
-
<Text style={[styles.statusLabel]} variant="bodySemibold">
|
|
115
|
-
N/A: <Text style={styles.status}>Control is not in current plan.</Text>
|
|
116
|
-
</Text>
|
|
117
|
-
</Stack>
|
|
118
|
-
</View>
|
|
119
|
-
</Stack>
|
|
120
|
-
)}
|
|
152
|
+
);
|
|
153
|
+
})}
|
|
154
|
+
</>
|
|
155
|
+
)}
|
|
156
|
+
</Stack>
|
|
121
157
|
{props.sections.map((section, index) => {
|
|
122
158
|
const TestComponent = section.component;
|
|
123
159
|
return (
|
|
124
160
|
<View key={index}>
|
|
125
|
-
<Text style={
|
|
161
|
+
<Text style={styles.section} variant="headerSemibold" testID={section.testID}>
|
|
126
162
|
{section.name}
|
|
127
163
|
</Text>
|
|
128
164
|
<Separator />
|
|
@@ -35,5 +35,7 @@ export const TextTest: React.FunctionComponent = () => {
|
|
|
35
35
|
|
|
36
36
|
const description = 'Text is a component for displaying text. You can use Text to standardize text across your app.';
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const spec = 'https://github.com/microsoft/fluentui-react-native/blob/main/packages/components/text/SPEC.md';
|
|
39
|
+
|
|
40
|
+
return <Test name="Text Test" description={description} spec={spec} sections={textSections} status={status} />;
|
|
39
41
|
};
|
|
@@ -16,11 +16,6 @@ const getThemedStyles = themedStyleSheet((theme: Theme) => {
|
|
|
16
16
|
borderWidth: 2,
|
|
17
17
|
borderColor: theme.colors.bodyText,
|
|
18
18
|
},
|
|
19
|
-
stackStyle: {
|
|
20
|
-
borderWidth: 2,
|
|
21
|
-
padding: 12,
|
|
22
|
-
margin: 8,
|
|
23
|
-
},
|
|
24
19
|
};
|
|
25
20
|
});
|
|
26
21
|
|
|
@@ -30,18 +25,28 @@ const styles = StyleSheet.create({
|
|
|
30
25
|
alignItems: 'center',
|
|
31
26
|
marginVertical: 5,
|
|
32
27
|
},
|
|
28
|
+
panel: {
|
|
29
|
+
...commonTestStyles.view,
|
|
30
|
+
borderWidth: 2,
|
|
31
|
+
padding: 12,
|
|
32
|
+
margin: 8,
|
|
33
|
+
},
|
|
33
34
|
pickerContainer: {
|
|
34
35
|
flexDirection: 'row',
|
|
35
36
|
justifyContent: 'space-evenly',
|
|
36
37
|
},
|
|
38
|
+
stackStyle: {
|
|
39
|
+
borderWidth: 2,
|
|
40
|
+
padding: 12,
|
|
41
|
+
margin: 8,
|
|
42
|
+
},
|
|
37
43
|
});
|
|
38
44
|
|
|
39
45
|
const Panel: React.FunctionComponent = () => {
|
|
40
46
|
const [disabled, setDisabled] = React.useState(false);
|
|
41
47
|
const onClick = React.useCallback(() => setDisabled(!disabled), [disabled, setDisabled]);
|
|
42
|
-
const themedStyles = getThemedStyles(useTheme());
|
|
43
48
|
return (
|
|
44
|
-
<View style={
|
|
49
|
+
<View style={styles.panel}>
|
|
45
50
|
<PrimaryButton onClick={onClick} content="Primary Button" disabled={disabled} />
|
|
46
51
|
<Button onClick={onClick} content="Default Button" disabled={disabled} />
|
|
47
52
|
<StealthButton onClick={onClick} content="Stealth Button" disabled={disabled} />
|
|
@@ -69,7 +74,6 @@ const SemanticColor: React.FunctionComponent<SemanticColorProps> = (p: SemanticC
|
|
|
69
74
|
|
|
70
75
|
const SwatchList: React.FunctionComponent = () => {
|
|
71
76
|
const theme = useTheme();
|
|
72
|
-
const themedStyles = getThemedStyles(theme);
|
|
73
77
|
const palette = theme.colors;
|
|
74
78
|
|
|
75
79
|
const aggregator = React.useCallback(
|
|
@@ -84,14 +88,14 @@ const SwatchList: React.FunctionComponent = () => {
|
|
|
84
88
|
}, [palette, aggregator]);
|
|
85
89
|
|
|
86
90
|
const paletteAsArray = React.useMemo(flattenArray, [flattenArray]);
|
|
87
|
-
const renderSwatch = React.useCallback((
|
|
91
|
+
const renderSwatch = React.useCallback((item) => {
|
|
88
92
|
const { color, key } = item;
|
|
89
93
|
return <SemanticColor key={key} color={color} name={key} />;
|
|
90
94
|
}, []);
|
|
91
95
|
return (
|
|
92
|
-
<View style={
|
|
96
|
+
<View style={commonTestStyles.view}>
|
|
93
97
|
<Text>getHostSettingsWin32(theme: ITheme).palette</Text>
|
|
94
|
-
<View style={
|
|
98
|
+
<View style={styles.stackStyle}>{paletteAsArray.map((item) => renderSwatch(item))}</View>
|
|
95
99
|
</View>
|
|
96
100
|
);
|
|
97
101
|
};
|
|
@@ -19,11 +19,6 @@ const getThemedStyles = themedStyleSheet((theme: Theme) => {
|
|
|
19
19
|
borderWidth: 2,
|
|
20
20
|
borderColor: theme.colors.bodyText,
|
|
21
21
|
},
|
|
22
|
-
stackStyle: {
|
|
23
|
-
borderWidth: 2,
|
|
24
|
-
padding: 12,
|
|
25
|
-
margin: 8,
|
|
26
|
-
},
|
|
27
22
|
};
|
|
28
23
|
});
|
|
29
24
|
|
|
@@ -37,6 +32,11 @@ const styles = StyleSheet.create({
|
|
|
37
32
|
flexDirection: 'row',
|
|
38
33
|
justifyContent: 'space-evenly',
|
|
39
34
|
},
|
|
35
|
+
stackStyle: {
|
|
36
|
+
borderWidth: 2,
|
|
37
|
+
padding: 12,
|
|
38
|
+
margin: 8,
|
|
39
|
+
},
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
const getSwatchColorStyle = (name: string, color: ColorValue): ViewStyle => {
|
|
@@ -57,7 +57,6 @@ const ColorToken: React.FunctionComponent<ColorTokenProps> = (p: ColorTokenProps
|
|
|
57
57
|
|
|
58
58
|
const AliasTokensSwatchList: React.FunctionComponent = () => {
|
|
59
59
|
const theme = useTheme();
|
|
60
|
-
const themedStyles = getThemedStyles(theme);
|
|
61
60
|
const isOfficeTheme =
|
|
62
61
|
theme.name === 'White' ||
|
|
63
62
|
theme.name === 'Colorful' ||
|
|
@@ -80,14 +79,14 @@ const AliasTokensSwatchList: React.FunctionComponent = () => {
|
|
|
80
79
|
}, [aliasColorTokens, aggregator]);
|
|
81
80
|
|
|
82
81
|
const aliasTokensAsArray = React.useMemo(flattenArray, [flattenArray]);
|
|
83
|
-
const renderSwatch = React.useCallback((
|
|
82
|
+
const renderSwatch = React.useCallback((item) => {
|
|
84
83
|
const { color, key } = item;
|
|
85
84
|
return <ColorToken key={key} color={color} name={key} />;
|
|
86
85
|
}, []);
|
|
87
86
|
return (
|
|
88
|
-
<View style={
|
|
87
|
+
<View style={commonTestStyles.view}>
|
|
89
88
|
<Text>Alias Color Tokens from Token Pipeline</Text>
|
|
90
|
-
<View style={
|
|
89
|
+
<View style={styles.stackStyle}>{aliasTokensAsArray.map((item) => renderSwatch(item))}</View>
|
|
91
90
|
</View>
|
|
92
91
|
);
|
|
93
92
|
};
|