@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.
Files changed (182) hide show
  1. package/CHANGELOG.json +63 -12
  2. package/CHANGELOG.md +27 -2
  3. package/lib/FluentTester.js +6 -6
  4. package/lib/FluentTester.js.map +1 -1
  5. package/lib/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
  6. package/lib/TestComponents/Avatar/AvatarTest.js +2 -1
  7. package/lib/TestComponents/Avatar/AvatarTest.js.map +1 -1
  8. package/lib/TestComponents/Avatar/BasicAvatar.js +3 -3
  9. package/lib/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  10. package/lib/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  11. package/lib/TestComponents/Avatar/CustomizedAvatar.js +14 -8
  12. package/lib/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  13. package/lib/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  14. package/lib/TestComponents/Badge/BadgeTest.js +2 -1
  15. package/lib/TestComponents/Badge/BadgeTest.js.map +1 -1
  16. package/lib/TestComponents/Button/ButtonIconTestSection.js +2 -2
  17. package/lib/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  18. package/lib/TestComponents/Button/ButtonShapeTestSection.js +2 -2
  19. package/lib/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  20. package/lib/TestComponents/Button/ButtonSizeTestSection.js +2 -2
  21. package/lib/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  22. package/lib/TestComponents/Button/ButtonTest.d.ts.map +1 -1
  23. package/lib/TestComponents/Button/ButtonTest.js +2 -1
  24. package/lib/TestComponents/Button/ButtonTest.js.map +1 -1
  25. package/lib/TestComponents/Button/ButtonVariantTestSection.js +2 -2
  26. package/lib/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  27. package/lib/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  28. package/lib/TestComponents/Button/ToggleButtonTestSection.js +6 -7
  29. package/lib/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  30. package/lib/TestComponents/Callout/CalloutTest.js +1 -1
  31. package/lib/TestComponents/Callout/CalloutTest.js.map +1 -1
  32. package/lib/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  33. package/lib/TestComponents/Checkbox/CheckboxTest.js +10 -6
  34. package/lib/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  35. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  36. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js +8 -5
  37. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  38. package/lib/TestComponents/Common/styles.d.ts +10 -0
  39. package/lib/TestComponents/Common/styles.d.ts.map +1 -1
  40. package/lib/TestComponents/Common/styles.js +3 -0
  41. package/lib/TestComponents/Common/styles.js.map +1 -1
  42. package/lib/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  43. package/lib/TestComponents/Menu/MenuTest.js +11 -5
  44. package/lib/TestComponents/Menu/MenuTest.js.map +1 -1
  45. package/lib/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
  46. package/lib/TestComponents/Notification/NotificationTest.js +4 -3
  47. package/lib/TestComponents/Notification/NotificationTest.js.map +1 -1
  48. package/lib/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  49. package/lib/TestComponents/Persona/CustomizeUsage.js +8 -5
  50. package/lib/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  51. package/lib/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  52. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js +11 -8
  53. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  54. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  55. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +3 -2
  56. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  57. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
  58. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
  59. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
  60. package/lib/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
  61. package/lib/TestComponents/Shadow/ShadowTest.js +2 -1
  62. package/lib/TestComponents/Shadow/ShadowTest.js.map +1 -1
  63. package/lib/TestComponents/Switch/Switch.d.ts.map +1 -1
  64. package/lib/TestComponents/Switch/Switch.js +2 -1
  65. package/lib/TestComponents/Switch/Switch.js.map +1 -1
  66. package/lib/TestComponents/Test.d.ts +1 -0
  67. package/lib/TestComponents/Test.d.ts.map +1 -1
  68. package/lib/TestComponents/Test.js +74 -47
  69. package/lib/TestComponents/Test.js.map +1 -1
  70. package/lib/TestComponents/Text/TextTest.d.ts.map +1 -1
  71. package/lib/TestComponents/Text/TextTest.js +2 -1
  72. package/lib/TestComponents/Text/TextTest.js.map +1 -1
  73. package/lib/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  74. package/lib/TestComponents/Theme/ThemeTest.js +11 -12
  75. package/lib/TestComponents/Theme/ThemeTest.js.map +1 -1
  76. package/lib/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  77. package/lib/TestComponents/Tokens/TokenTest.js +8 -10
  78. package/lib/TestComponents/Tokens/TokenTest.js.map +1 -1
  79. package/lib-commonjs/FluentTester.js +5 -5
  80. package/lib-commonjs/FluentTester.js.map +1 -1
  81. package/lib-commonjs/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
  82. package/lib-commonjs/TestComponents/Avatar/AvatarTest.js +2 -1
  83. package/lib-commonjs/TestComponents/Avatar/AvatarTest.js.map +1 -1
  84. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js +2 -2
  85. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  86. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  87. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js +13 -7
  88. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  89. package/lib-commonjs/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  90. package/lib-commonjs/TestComponents/Badge/BadgeTest.js +2 -1
  91. package/lib-commonjs/TestComponents/Badge/BadgeTest.js.map +1 -1
  92. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js +1 -1
  93. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  94. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js +1 -1
  95. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  96. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js +1 -1
  97. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  98. package/lib-commonjs/TestComponents/Button/ButtonTest.d.ts.map +1 -1
  99. package/lib-commonjs/TestComponents/Button/ButtonTest.js +2 -1
  100. package/lib-commonjs/TestComponents/Button/ButtonTest.js.map +1 -1
  101. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js +1 -1
  102. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  103. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  104. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js +4 -6
  105. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  106. package/lib-commonjs/TestComponents/Callout/CalloutTest.js +1 -1
  107. package/lib-commonjs/TestComponents/Callout/CalloutTest.js.map +1 -1
  108. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  109. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js +9 -6
  110. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  111. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  112. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js +7 -5
  113. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  114. package/lib-commonjs/TestComponents/Common/styles.d.ts +10 -0
  115. package/lib-commonjs/TestComponents/Common/styles.d.ts.map +1 -1
  116. package/lib-commonjs/TestComponents/Common/styles.js +4 -1
  117. package/lib-commonjs/TestComponents/Common/styles.js.map +1 -1
  118. package/lib-commonjs/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  119. package/lib-commonjs/TestComponents/Menu/MenuTest.js +10 -5
  120. package/lib-commonjs/TestComponents/Menu/MenuTest.js.map +1 -1
  121. package/lib-commonjs/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
  122. package/lib-commonjs/TestComponents/Notification/NotificationTest.js +4 -3
  123. package/lib-commonjs/TestComponents/Notification/NotificationTest.js.map +1 -1
  124. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  125. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js +7 -5
  126. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  127. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  128. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js +10 -8
  129. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  130. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  131. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +2 -1
  132. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  133. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
  134. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
  135. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
  136. package/lib-commonjs/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
  137. package/lib-commonjs/TestComponents/Shadow/ShadowTest.js +2 -1
  138. package/lib-commonjs/TestComponents/Shadow/ShadowTest.js.map +1 -1
  139. package/lib-commonjs/TestComponents/Switch/Switch.d.ts.map +1 -1
  140. package/lib-commonjs/TestComponents/Switch/Switch.js +2 -1
  141. package/lib-commonjs/TestComponents/Switch/Switch.js.map +1 -1
  142. package/lib-commonjs/TestComponents/Test.d.ts +1 -0
  143. package/lib-commonjs/TestComponents/Test.d.ts.map +1 -1
  144. package/lib-commonjs/TestComponents/Test.js +72 -45
  145. package/lib-commonjs/TestComponents/Test.js.map +1 -1
  146. package/lib-commonjs/TestComponents/Text/TextTest.d.ts.map +1 -1
  147. package/lib-commonjs/TestComponents/Text/TextTest.js +2 -1
  148. package/lib-commonjs/TestComponents/Text/TextTest.js.map +1 -1
  149. package/lib-commonjs/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  150. package/lib-commonjs/TestComponents/Theme/ThemeTest.js +10 -12
  151. package/lib-commonjs/TestComponents/Theme/ThemeTest.js.map +1 -1
  152. package/lib-commonjs/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  153. package/lib-commonjs/TestComponents/Tokens/TokenTest.js +8 -10
  154. package/lib-commonjs/TestComponents/Tokens/TokenTest.js.map +1 -1
  155. package/package.json +2 -2
  156. package/src/FluentTester.tsx +6 -6
  157. package/src/TestComponents/Avatar/AvatarTest.tsx +3 -1
  158. package/src/TestComponents/Avatar/BasicAvatar.tsx +2 -2
  159. package/src/TestComponents/Avatar/CustomizedAvatar.tsx +15 -8
  160. package/src/TestComponents/Badge/BadgeTest.tsx +3 -1
  161. package/src/TestComponents/Button/ButtonIconTestSection.tsx +2 -2
  162. package/src/TestComponents/Button/ButtonShapeTestSection.tsx +2 -2
  163. package/src/TestComponents/Button/ButtonSizeTestSection.tsx +2 -2
  164. package/src/TestComponents/Button/ButtonTest.tsx +3 -1
  165. package/src/TestComponents/Button/ButtonVariantTestSection.tsx +2 -2
  166. package/src/TestComponents/Button/ToggleButtonTestSection.tsx +6 -5
  167. package/src/TestComponents/Callout/CalloutTest.tsx +1 -1
  168. package/src/TestComponents/Checkbox/CheckboxTest.tsx +14 -8
  169. package/src/TestComponents/CheckboxExperimental/CheckboxTest.tsx +10 -7
  170. package/src/TestComponents/Common/styles.ts +5 -0
  171. package/src/TestComponents/Menu/MenuTest.tsx +13 -5
  172. package/src/TestComponents/Notification/NotificationTest.tsx +5 -3
  173. package/src/TestComponents/Persona/CustomizeUsage.tsx +10 -7
  174. package/src/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +4 -9
  175. package/src/TestComponents/PersonaCoin/CustomizeUsage.tsx +13 -10
  176. package/src/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.tsx +9 -1
  177. package/src/TestComponents/Shadow/ShadowTest.tsx +3 -1
  178. package/src/TestComponents/Switch/Switch.tsx +3 -1
  179. package/src/TestComponents/Test.tsx +98 -62
  180. package/src/TestComponents/Text/TextTest.tsx +3 -1
  181. package/src/TestComponents/Theme/ThemeTest.tsx +15 -11
  182. 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, 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) => {
@@ -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 name="Experimental RadioGroup Test" description={description} sections={radioGroupExperimentalSections} status={status}></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
- return <Test name="Shadow Test" description={description} sections={shadowSections} status={status} />;
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
- return <Test name="Switch Test" description={description} sections={toggleSections} status={status}></Test>;
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, Platform } from 'react-native';
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: 'flex-start',
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
- <Text style={[styles.name]} variant="heroSemibold">
64
- {props.name}
65
- </Text>
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
- {!isMobile && (
71
- <Stack style={stackStyle}>
72
- <View style={styles.statusView}>
73
- <Stack>
74
- <Text style={[styles.statusHeader]} variant="headerStandard">
75
- Platform Status
76
- </Text>
77
- <Text style={[styles.statusLabel]} variant="bodySemibold">
78
- Win32: <Text style={styles.status}>{props.status.win32Status}</Text>
79
- </Text>
80
- <Text style={[styles.statusLabel]} variant="bodySemibold">
81
- UWP: <Text style={styles.status}>{props.status.uwpStatus}</Text>
82
- </Text>
83
- <Text style={[styles.statusLabel]} variant="bodySemibold">
84
- iOS: <Text style={styles.status}>{props.status.iosStatus}</Text>
85
- </Text>
86
- <Text style={[styles.statusLabel]} variant="bodySemibold">
87
- macOS: <Text style={styles.status}>{props.status.macosStatus}</Text>
88
- </Text>
89
- <Text style={[styles.statusLabel]} variant="bodySemibold">
90
- Android: <Text style={styles.status}>{props.status.androidStatus}</Text>
91
- </Text>
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
- <Stack style={stackStyle}>
95
- <Text style={[styles.statusHeader]} variant="headerStandard">
96
- Status Definitions
97
- </Text>
98
- <Text style={[styles.statusLabel]} variant="bodySemibold">
99
- Production:{' '}
100
- <Text style={styles.status}>Control is ready for broad partner use and to be used in production-ready scenarios.</Text>
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
- </Text>
108
- <Text style={[styles.statusLabel]} variant="bodySemibold">
109
- Experimental: <Text style={styles.status}>Control code checked into repo, but not ready for partner use.</Text>
110
- </Text>
111
- <Text style={[styles.statusLabel]} variant="bodySemibold">
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={[styles.section]} variant="headerSemibold" testID={section.testID}>
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
- return <Test name="Text Test" description={description} sections={textSections} status={status} />;
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={[commonTestStyles.view, themedStyles.stackStyle]}>
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(({ item }) => {
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={[commonTestStyles.view]}>
96
+ <View style={commonTestStyles.view}>
93
97
  <Text>getHostSettingsWin32(theme: ITheme).palette</Text>
94
- <View style={themedStyles.stackStyle}>{paletteAsArray.map((item) => renderSwatch({ item }))}</View>
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(({ item }) => {
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={[commonTestStyles.view]}>
87
+ <View style={commonTestStyles.view}>
89
88
  <Text>Alias Color Tokens from Token Pipeline</Text>
90
- <View style={themedStyles.stackStyle}>{aliasTokensAsArray.map((item) => renderSwatch({ item }))}</View>
89
+ <View style={styles.stackStyle}>{aliasTokensAsArray.map((item) => renderSwatch(item))}</View>
91
90
  </View>
92
91
  );
93
92
  };