@fluentui-react-native/tester 0.87.0 → 0.90.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 (113) hide show
  1. package/CHANGELOG.json +138 -1
  2. package/CHANGELOG.md +44 -2
  3. package/lib/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
  4. package/lib/TestComponents/Avatar/AvatarTest.js +2 -1
  5. package/lib/TestComponents/Avatar/AvatarTest.js.map +1 -1
  6. package/lib/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  7. package/lib/TestComponents/Avatar/CustomizedAvatar.js +7 -2
  8. package/lib/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  9. package/lib/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  10. package/lib/TestComponents/Badge/BadgeTest.js +2 -1
  11. package/lib/TestComponents/Badge/BadgeTest.js.map +1 -1
  12. package/lib/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -1
  13. package/lib/TestComponents/Badge/BasicBadgeTest.js +12 -11
  14. package/lib/TestComponents/Badge/BasicBadgeTest.js.map +1 -1
  15. package/lib/TestComponents/Badge/CounterBadgeTest.js +3 -3
  16. package/lib/TestComponents/Badge/CounterBadgeTest.js.map +1 -1
  17. package/lib/TestComponents/Badge/E2EBadgeTest.js +1 -1
  18. package/lib/TestComponents/Badge/E2EBadgeTest.js.map +1 -1
  19. package/lib/TestComponents/Badge/PresenceBadgeTest.d.ts.map +1 -1
  20. package/lib/TestComponents/Badge/PresenceBadgeTest.js +25 -12
  21. package/lib/TestComponents/Badge/PresenceBadgeTest.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/Checkbox/CheckboxTest.d.ts.map +1 -1
  26. package/lib/TestComponents/Checkbox/CheckboxTest.js +2 -1
  27. package/lib/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  28. package/lib/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  29. package/lib/TestComponents/Menu/MenuTest.js +2 -1
  30. package/lib/TestComponents/Menu/MenuTest.js.map +1 -1
  31. package/lib/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
  32. package/lib/TestComponents/Notification/NotificationTest.js +2 -1
  33. package/lib/TestComponents/Notification/NotificationTest.js.map +1 -1
  34. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
  35. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
  36. package/lib/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
  37. package/lib/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
  38. package/lib/TestComponents/Shadow/ShadowTest.js +2 -1
  39. package/lib/TestComponents/Shadow/ShadowTest.js.map +1 -1
  40. package/lib/TestComponents/Switch/Switch.d.ts.map +1 -1
  41. package/lib/TestComponents/Switch/Switch.js +2 -1
  42. package/lib/TestComponents/Switch/Switch.js.map +1 -1
  43. package/lib/TestComponents/Test.d.ts +1 -0
  44. package/lib/TestComponents/Test.d.ts.map +1 -1
  45. package/lib/TestComponents/Test.js +73 -46
  46. package/lib/TestComponents/Test.js.map +1 -1
  47. package/lib/TestComponents/Text/TextTest.d.ts.map +1 -1
  48. package/lib/TestComponents/Text/TextTest.js +2 -1
  49. package/lib/TestComponents/Text/TextTest.js.map +1 -1
  50. package/lib-commonjs/TestComponents/Avatar/AvatarTest.d.ts.map +1 -1
  51. package/lib-commonjs/TestComponents/Avatar/AvatarTest.js +2 -1
  52. package/lib-commonjs/TestComponents/Avatar/AvatarTest.js.map +1 -1
  53. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  54. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js +6 -1
  55. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  56. package/lib-commonjs/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  57. package/lib-commonjs/TestComponents/Badge/BadgeTest.js +2 -1
  58. package/lib-commonjs/TestComponents/Badge/BadgeTest.js.map +1 -1
  59. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -1
  60. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js +12 -11
  61. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js.map +1 -1
  62. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.js +3 -3
  63. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.js.map +1 -1
  64. package/lib-commonjs/TestComponents/Badge/E2EBadgeTest.js +1 -1
  65. package/lib-commonjs/TestComponents/Badge/E2EBadgeTest.js.map +1 -1
  66. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.d.ts.map +1 -1
  67. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.js +23 -11
  68. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.js.map +1 -1
  69. package/lib-commonjs/TestComponents/Button/ButtonTest.d.ts.map +1 -1
  70. package/lib-commonjs/TestComponents/Button/ButtonTest.js +2 -1
  71. package/lib-commonjs/TestComponents/Button/ButtonTest.js.map +1 -1
  72. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  73. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js +2 -1
  74. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  75. package/lib-commonjs/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  76. package/lib-commonjs/TestComponents/Menu/MenuTest.js +2 -1
  77. package/lib-commonjs/TestComponents/Menu/MenuTest.js.map +1 -1
  78. package/lib-commonjs/TestComponents/Notification/NotificationTest.d.ts.map +1 -1
  79. package/lib-commonjs/TestComponents/Notification/NotificationTest.js +2 -1
  80. package/lib-commonjs/TestComponents/Notification/NotificationTest.js.map +1 -1
  81. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.d.ts.map +1 -1
  82. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js +2 -1
  83. package/lib-commonjs/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.js.map +1 -1
  84. package/lib-commonjs/TestComponents/Shadow/ShadowTest.d.ts.map +1 -1
  85. package/lib-commonjs/TestComponents/Shadow/ShadowTest.js +2 -1
  86. package/lib-commonjs/TestComponents/Shadow/ShadowTest.js.map +1 -1
  87. package/lib-commonjs/TestComponents/Switch/Switch.d.ts.map +1 -1
  88. package/lib-commonjs/TestComponents/Switch/Switch.js +2 -1
  89. package/lib-commonjs/TestComponents/Switch/Switch.js.map +1 -1
  90. package/lib-commonjs/TestComponents/Test.d.ts +1 -0
  91. package/lib-commonjs/TestComponents/Test.d.ts.map +1 -1
  92. package/lib-commonjs/TestComponents/Test.js +71 -44
  93. package/lib-commonjs/TestComponents/Test.js.map +1 -1
  94. package/lib-commonjs/TestComponents/Text/TextTest.d.ts.map +1 -1
  95. package/lib-commonjs/TestComponents/Text/TextTest.js +2 -1
  96. package/lib-commonjs/TestComponents/Text/TextTest.js.map +1 -1
  97. package/package.json +12 -12
  98. package/src/TestComponents/Avatar/AvatarTest.tsx +3 -1
  99. package/src/TestComponents/Avatar/CustomizedAvatar.tsx +22 -1
  100. package/src/TestComponents/Badge/BadgeTest.tsx +3 -1
  101. package/src/TestComponents/Badge/BasicBadgeTest.tsx +18 -17
  102. package/src/TestComponents/Badge/CounterBadgeTest.tsx +3 -3
  103. package/src/TestComponents/Badge/E2EBadgeTest.tsx +1 -1
  104. package/src/TestComponents/Badge/PresenceBadgeTest.tsx +22 -10
  105. package/src/TestComponents/Button/ButtonTest.tsx +3 -1
  106. package/src/TestComponents/Checkbox/CheckboxTest.tsx +3 -1
  107. package/src/TestComponents/Menu/MenuTest.tsx +3 -1
  108. package/src/TestComponents/Notification/NotificationTest.tsx +3 -1
  109. package/src/TestComponents/RadioGroupExperimental/RadioGroupExperimentalTest.tsx +9 -1
  110. package/src/TestComponents/Shadow/ShadowTest.tsx +3 -1
  111. package/src/TestComponents/Switch/Switch.tsx +3 -1
  112. package/src/TestComponents/Test.tsx +97 -61
  113. package/src/TestComponents/Text/TextTest.tsx +3 -1
@@ -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,70 +72,88 @@ 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 (
@@ -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
  };