@fluentui-react-native/tester 0.82.14 → 0.83.2

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 (73) hide show
  1. package/CHANGELOG.json +163 -3
  2. package/CHANGELOG.md +48 -2
  3. package/android/build.gradle +7 -2
  4. package/app.json +23 -0
  5. package/assets/fluent_app_icon_ios.png +0 -0
  6. package/assets/fluent_app_icon_macos.png +0 -0
  7. package/assets/res/drawable/fluent_app_icon_android_background.xml +74 -0
  8. package/assets/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  9. package/assets/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  10. package/assets/res/mipmap-hdpi/fluent_app_icon_android.png +0 -0
  11. package/assets/res/mipmap-hdpi/fluent_app_icon_android_foreground.png +0 -0
  12. package/assets/res/mipmap-hdpi/fluent_app_icon_android_round.png +0 -0
  13. package/assets/res/mipmap-mdpi/fluent_app_icon_android.png +0 -0
  14. package/assets/res/mipmap-mdpi/fluent_app_icon_android_foreground.png +0 -0
  15. package/assets/res/mipmap-mdpi/fluent_app_icon_android_round.png +0 -0
  16. package/assets/res/mipmap-xhdpi/fluent_app_icon_android.png +0 -0
  17. package/assets/res/mipmap-xhdpi/fluent_app_icon_android_foreground.png +0 -0
  18. package/assets/res/mipmap-xhdpi/fluent_app_icon_android_round.png +0 -0
  19. package/assets/res/mipmap-xxhdpi/fluent_app_icon_android.png +0 -0
  20. package/assets/res/mipmap-xxhdpi/fluent_app_icon_android_foreground.png +0 -0
  21. package/assets/res/mipmap-xxhdpi/fluent_app_icon_android_round.png +0 -0
  22. package/assets/res/mipmap-xxxhdpi/fluent_app_icon_android.png +0 -0
  23. package/assets/res/mipmap-xxxhdpi/fluent_app_icon_android_foreground.png +0 -0
  24. package/assets/res/mipmap-xxxhdpi/fluent_app_icon_android_round.png +0 -0
  25. package/docs/ios.md +9 -9
  26. package/docs/macos.md +7 -7
  27. package/ios/Podfile.lock +9 -13
  28. package/lib/FluentTesterApp.d.ts.map +1 -1
  29. package/lib/FluentTesterApp.js +34 -3
  30. package/lib/FluentTesterApp.js.map +1 -1
  31. package/lib/TestComponents/Badge/BadgeTest.d.ts +1 -2
  32. package/lib/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  33. package/lib/TestComponents/Badge/BadgeTest.js +12 -108
  34. package/lib/TestComponents/Badge/BadgeTest.js.map +1 -1
  35. package/lib/TestComponents/Badge/BasicBadgeTest.d.ts +3 -0
  36. package/lib/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -0
  37. package/lib/TestComponents/Badge/BasicBadgeTest.js +83 -0
  38. package/lib/TestComponents/Badge/BasicBadgeTest.js.map +1 -0
  39. package/lib/TestComponents/Badge/CounterBadgeTest.d.ts +3 -0
  40. package/lib/TestComponents/Badge/CounterBadgeTest.d.ts.map +1 -0
  41. package/lib/TestComponents/Badge/CounterBadgeTest.js +24 -0
  42. package/lib/TestComponents/Badge/CounterBadgeTest.js.map +1 -0
  43. package/lib/TestComponents/Badge/PresenceBadgeTest.d.ts +3 -0
  44. package/lib/TestComponents/Badge/PresenceBadgeTest.d.ts.map +1 -0
  45. package/lib/TestComponents/Badge/PresenceBadgeTest.js +18 -0
  46. package/lib/TestComponents/Badge/PresenceBadgeTest.js.map +1 -0
  47. package/lib-commonjs/FluentTesterApp.d.ts.map +1 -1
  48. package/lib-commonjs/FluentTesterApp.js +33 -2
  49. package/lib-commonjs/FluentTesterApp.js.map +1 -1
  50. package/lib-commonjs/TestComponents/Badge/BadgeTest.d.ts +1 -2
  51. package/lib-commonjs/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  52. package/lib-commonjs/TestComponents/Badge/BadgeTest.js +15 -111
  53. package/lib-commonjs/TestComponents/Badge/BadgeTest.js.map +1 -1
  54. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.d.ts +3 -0
  55. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.d.ts.map +1 -0
  56. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js +87 -0
  57. package/lib-commonjs/TestComponents/Badge/BasicBadgeTest.js.map +1 -0
  58. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.d.ts +3 -0
  59. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.d.ts.map +1 -0
  60. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.js +29 -0
  61. package/lib-commonjs/TestComponents/Badge/CounterBadgeTest.js.map +1 -0
  62. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.d.ts +3 -0
  63. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.d.ts.map +1 -0
  64. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.js +23 -0
  65. package/lib-commonjs/TestComponents/Badge/PresenceBadgeTest.js.map +1 -0
  66. package/macos/Podfile.lock +223 -227
  67. package/package.json +18 -18
  68. package/src/FluentTesterApp.tsx +36 -3
  69. package/src/TestComponents/Badge/BadgeTest.tsx +12 -181
  70. package/src/TestComponents/Badge/BasicBadgeTest.tsx +120 -0
  71. package/src/TestComponents/Badge/CounterBadgeTest.tsx +30 -0
  72. package/src/TestComponents/Badge/PresenceBadgeTest.tsx +26 -0
  73. package/src/TestComponents/Notification/assets/play_button.svg +1 -1
@@ -2,17 +2,50 @@
2
2
 
3
3
  import { ThemeProvider } from '@fluentui-react-native/theme';
4
4
  import * as React from 'react';
5
- import { Platform } from 'react-native';
5
+ import { Platform, useWindowDimensions } from 'react-native';
6
6
  import { FluentTester, FluentTesterProps } from './FluentTester';
7
7
  import { tests } from './testPages';
8
8
  import { testerTheme } from './theme/index';
9
9
 
10
- const isMobile = Platform.OS == 'android' || (Platform.OS === 'ios' && Platform.isPad === false);
10
+ type SizeClassIOS = 'regular' | 'compact' | undefined;
11
+
12
+ /**
13
+ * Hook that "guesses" our Size Class on iOS based on our window width.
14
+ * Note: this is hacky and should not be used.
15
+ *
16
+ * For more information about Size Classes, see the following:
17
+ * https://developer.apple.com/documentation/uikit/uitraitcollection
18
+ * https://developer.apple.com/design/human-interface-guidelines/foundations/layout/#platform-considerations
19
+ * @returns SizeClassIOS: enum determining our size class
20
+ */
21
+ const useSizeClassIOS_DO_NOT_USE: () => SizeClassIOS = () => {
22
+ if (Platform.OS === 'ios') {
23
+ /**
24
+ * Technically this violates the rules of hooks (calling hooks inside conditions) but Platform.OS checks are pretty non-conditional.
25
+ * This is necessary because useWindowDimensions() does not work in win32.
26
+ */
27
+ // eslint-disable-next-line react-hooks/rules-of-hooks
28
+ const width = useWindowDimensions().width;
29
+ if (Platform.isPad && width > 375) {
30
+ return 'regular';
31
+ } else {
32
+ return 'compact';
33
+ }
34
+ } else {
35
+ return undefined;
36
+ }
37
+ };
11
38
 
12
39
  export const FluentTesterApp: React.FunctionComponent<FluentTesterProps> = (props) => {
40
+ const sizeClass = useSizeClassIOS_DO_NOT_USE();
41
+ const isMobile = Platform.OS == 'android' || (Platform.OS === 'ios' && Platform.isPad === false);
42
+
43
+ // If on iPad we are presented in a Split View or Slide Over context, show the single pane view.
44
+ const shouldShowSinglePane = isMobile || (!isMobile && sizeClass === 'compact');
45
+
13
46
  return (
14
47
  <ThemeProvider theme={testerTheme}>
15
- <FluentTester enabledTests={tests} enableSinglePaneView={isMobile} {...props} />
48
+ <FluentTester enabledTests={tests} enableSinglePaneView={shouldShowSinglePane} {...props} />
16
49
  </ThemeProvider>
17
50
  );
18
51
  };
@@ -1,186 +1,9 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- import React, { useState, useCallback } from 'react';
1
+ import * as React from 'react';
3
2
  import { BADGE_TESTPAGE } from './consts';
4
3
  import { Test, TestSection, PlatformStatus } from '../Test';
5
- import { View, Platform, Text, Image } from 'react-native';
6
- import { commonTestStyles } from '../Common/styles';
7
- import {
8
- Badge,
9
- PresenceBadge,
10
- BadgeAppearance,
11
- BadgeAppearances,
12
- BadgeColor,
13
- BadgeColors,
14
- BadgeShape,
15
- BadgeShapes,
16
- BadgeSize,
17
- BadgeSizes,
18
- BadgeIconPosition,
19
- } from '@fluentui-react-native/badge';
20
- import { SvgIconProps } from '@fluentui-react-native/icon';
21
- import { StyledPicker } from '../Common/StyledPicker';
22
- import { satyaPhotoUrl } from './../PersonaCoin/styles';
23
- import TestSvg from '../../FluentTester/test-data/test.svg';
24
- import { ToggleButton } from '@fluentui/react-native';
25
-
26
- const badgeColors: BadgeColor[] = [...BadgeColors];
27
- const badgeShapes: BadgeShape[] = [...BadgeShapes];
28
- const badgeSizes: BadgeSize[] = [...BadgeSizes];
29
- const badgeAppearances: BadgeAppearance[] = [...BadgeAppearances];
30
- const badgeIconPositions = ['before', 'after'];
31
-
32
- const StyledBadge = Badge.customize({
33
- backgroundColor: 'yellow',
34
- borderColor: '#f09',
35
- borderWidth: 4,
36
- });
37
-
38
- export const BasicBadge: React.FunctionComponent = () => {
39
- const [badgeAppearance, setBadgeAppearance] = useState<BadgeAppearance>('filled');
40
- const [badgeColor, setBadgeColor] = useState<BadgeColor>('brand');
41
- const [shape, setShape] = useState<BadgeShape>('circular');
42
- const [size, setSize] = useState<BadgeSize>('medium');
43
- const [showIcon, setShowIcon] = useState(false);
44
- const [iconPosition, setIconPosition] = useState<BadgeIconPosition>('before');
45
-
46
- const onBadgeAppearanceChange = useCallback((value) => setBadgeAppearance(value), []);
47
- const onBadgeColorChange = useCallback((value) => setBadgeColor(value), []);
48
- const onShapeChange = useCallback((value) => setShape(value), []);
49
- const onSizeChange = useCallback((value) => setSize(value), []);
50
- const onIconPositionChange = useCallback((value) => setIconPosition(value), []);
51
-
52
- const svgProps: SvgIconProps = {
53
- src: TestSvg,
54
- viewBox: '0 0 500 500',
55
- };
56
-
57
- const fontBuiltInProps = {
58
- fontFamily: 'Arial',
59
- codepoint: 0x2663,
60
- fontSize: 16,
61
- };
62
-
63
- const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
64
- const iconProps = { svgSource: svgProps, width: 20, height: 20 };
65
- const badgeConfig = {
66
- appearance: badgeAppearance,
67
- color: badgeColor,
68
- size,
69
- shape,
70
- };
71
- const badgeContent = size !== 'tiny' && size !== 'extraSmall' ? 'Basic badge' : '';
72
-
73
- return (
74
- <View>
75
- <View style={{ flexDirection: 'row' }}>
76
- <View>
77
- <StyledPicker
78
- prompt="Badge appearance"
79
- selected={badgeAppearance}
80
- onChange={onBadgeAppearanceChange}
81
- collection={badgeAppearances}
82
- />
83
- <StyledPicker prompt="Badge color" selected={badgeColor} onChange={onBadgeColorChange} collection={badgeColors} />
84
- <StyledPicker prompt="Shape" selected={shape} onChange={onShapeChange} collection={badgeShapes} />
85
- <StyledPicker prompt="Size" selected={size} onChange={onSizeChange} collection={badgeSizes} />
86
- {svgIconsEnabled && (
87
- <>
88
- <ToggleButton onClick={() => setShowIcon(!showIcon)} checked={showIcon}>
89
- Set {showIcon ? ' Hide icon' : ' Show icon'}
90
- </ToggleButton>
91
- <StyledPicker
92
- prompt="Icon position"
93
- selected={iconPosition}
94
- onChange={onIconPositionChange}
95
- collection={badgeIconPositions}
96
- />
97
- </>
98
- )}
99
- </View>
100
- <View style={{ paddingHorizontal: 40, ...commonTestStyles.vmargin }}>
101
- {svgIconsEnabled && showIcon ? (
102
- <Badge {...badgeConfig} icon={{ svgSource: svgProps }} iconPosition={iconPosition}>
103
- {badgeContent}
104
- </Badge>
105
- ) : (
106
- <Badge {...badgeConfig}>{badgeContent}</Badge>
107
- )}
108
- </View>
109
- </View>
110
- <View style={{ flexDirection: 'row' }}>
111
- {svgIconsEnabled && (
112
- <>
113
- <View>
114
- <Badge size="small" icon={{ svgSource: svgProps }}></Badge>
115
- <Badge size="medium" icon={{ svgSource: svgProps }}></Badge>
116
- <Badge size="large" icon={{ svgSource: svgProps }}></Badge>
117
- <Badge size="extraLarge" icon={{ svgSource: svgProps }}></Badge>
118
- </View>
119
- <View>
120
- <Badge size="small" icon={{ svgSource: svgProps }}>
121
- 999+
122
- </Badge>
123
- <Badge size="medium" icon={{ svgSource: svgProps }}>
124
- 999+
125
- </Badge>
126
- <Badge size="large" icon={{ svgSource: svgProps }}>
127
- 999+
128
- </Badge>
129
- <Badge size="extraLarge" icon={{ svgSource: svgProps }}>
130
- 999+
131
- </Badge>
132
- </View>
133
- <View>
134
- <Badge icon={{ svgSource: svgProps }} />
135
- <Badge icon={{ svgSource: svgProps }}>Icon before by default</Badge>
136
- <Badge icon={{ svgSource: svgProps }} iconPosition="before">
137
- Icon before
138
- </Badge>
139
- <Badge icon={{ svgSource: svgProps }} iconPosition="after">
140
- Icon after
141
- </Badge>
142
- </View>
143
- </>
144
- )}
145
-
146
- <Text>Size</Text>
147
- <Badge size="tiny" shape="circular" />
148
- <Badge size="extraSmall" shape="circular" />
149
- <Badge size="small">Small</Badge>
150
- <Badge size="medium">Medium</Badge>
151
- <Badge size="large">Large</Badge>
152
- <Badge size="extraLarge">Extra Large</Badge>
153
- </View>
154
- {svgIconsEnabled && (
155
- <>
156
- <Text>Badge with icon</Text>
157
- <Badge icon={{ svgSource: svgProps }} iconPosition="after">
158
- <Image source={{ uri: satyaPhotoUrl }} style={{ width: 20, height: 20 }} />
159
- Badge with
160
- <Image source={{ uri: satyaPhotoUrl }} style={{ width: 20, height: 20 }} />
161
- <Text style={{ backgroundColor: 'yellow' }}>optional content</Text>
162
- </Badge>
163
- <Badge appearance="outline" icon={iconProps} />
164
- <Badge icon={{ fontSource: { ...fontBuiltInProps }, color: '#fff' }}>Badge with icon</Badge>
165
- </>
166
- )}
167
- <StyledBadge appearance="outline">Styled badge</StyledBadge>
168
- {svgIconsEnabled && (
169
- <>
170
- <Text>Presence Badge</Text>
171
- <PresenceBadge status="available" size="extraLarge" />
172
- <PresenceBadge status="available" outOfOffice={true} size="large" />
173
- <PresenceBadge status="doNotDisturb" outOfOffice={true} />
174
- <PresenceBadge status="away" size="small" />
175
- <PresenceBadge status="busy" size="tiny" />
176
- <PresenceBadge status="offline" />
177
- <PresenceBadge status="outOfOffice" />
178
- <PresenceBadge status="away" />
179
- </>
180
- )}
181
- </View>
182
- );
183
- };
4
+ import { BasicBadge } from './BasicBadgeTest';
5
+ import { CounterBadgeTest } from './CounterBadgeTest';
6
+ import { PresenceBadgeTest } from './PresenceBadgeTest';
184
7
 
185
8
  const badgeSections: TestSection[] = [
186
9
  {
@@ -188,6 +11,14 @@ const badgeSections: TestSection[] = [
188
11
  testID: BADGE_TESTPAGE,
189
12
  component: BasicBadge,
190
13
  },
14
+ {
15
+ name: 'Counter Badge',
16
+ component: CounterBadgeTest,
17
+ },
18
+ {
19
+ name: 'Presence Badge',
20
+ component: PresenceBadgeTest,
21
+ },
191
22
  ];
192
23
 
193
24
  export const BadgeTest: React.FunctionComponent = () => {
@@ -0,0 +1,120 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ import React, { useState, useCallback } from 'react';
3
+ import { View, Platform, Text, Image } from 'react-native';
4
+ import {
5
+ Badge,
6
+ BadgeAppearance,
7
+ BadgeAppearances,
8
+ BadgeColor,
9
+ BadgeColors,
10
+ BadgeShape,
11
+ BadgeShapes,
12
+ BadgeSize,
13
+ BadgeSizes,
14
+ BadgeIconPosition,
15
+ } from '@fluentui-react-native/badge';
16
+ import { SvgIconProps } from '@fluentui-react-native/icon';
17
+ import { StyledPicker } from '../Common/StyledPicker';
18
+ import { satyaPhotoUrl } from './../PersonaCoin/styles';
19
+ import TestSvg from '../../FluentTester/test-data/test.svg';
20
+ import { ToggleButton } from '@fluentui/react-native';
21
+
22
+ const badgeColors: BadgeColor[] = [...BadgeColors];
23
+ const badgeShapes: BadgeShape[] = [...BadgeShapes];
24
+ const badgeSizes: BadgeSize[] = [...BadgeSizes];
25
+ const badgeAppearances: BadgeAppearance[] = [...BadgeAppearances];
26
+ const badgeIconPositions = ['before', 'after'];
27
+
28
+ const BadgeNoBorder = Badge.customize({
29
+ borderColor: 'transparent',
30
+ borderWidth: 0,
31
+ });
32
+
33
+ const StyledBadge = Badge.customize({
34
+ backgroundColor: 'yellow',
35
+ borderColor: '#f09',
36
+ borderWidth: 4,
37
+ });
38
+
39
+ export const BasicBadge: React.FunctionComponent = () => {
40
+ const [badgeAppearance, setBadgeAppearance] = useState<BadgeAppearance>('filled');
41
+ const [badgeColor, setBadgeColor] = useState<BadgeColor>('brand');
42
+ const [shape, setShape] = useState<BadgeShape>('circular');
43
+ const [size, setSize] = useState<BadgeSize>('medium');
44
+ const [showIcon, setShowIcon] = useState(false);
45
+ const [iconPosition, setIconPosition] = useState<BadgeIconPosition>('before');
46
+
47
+ const onBadgeAppearanceChange = useCallback((value) => setBadgeAppearance(value), []);
48
+ const onBadgeColorChange = useCallback((value) => setBadgeColor(value), []);
49
+ const onShapeChange = useCallback((value) => setShape(value), []);
50
+ const onSizeChange = useCallback((value) => setSize(value), []);
51
+ const onIconPositionChange = useCallback((value) => setIconPosition(value), []);
52
+
53
+ const svgProps: SvgIconProps = {
54
+ src: TestSvg,
55
+ viewBox: '0 0 500 500',
56
+ };
57
+
58
+ const fontBuiltInProps = {
59
+ fontFamily: 'Arial',
60
+ codepoint: 0x2663,
61
+ fontSize: 16,
62
+ };
63
+
64
+ const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
65
+ const iconProps = { svgSource: svgProps, width: 20, height: 20 };
66
+ const badgeConfig = {
67
+ appearance: badgeAppearance,
68
+ color: badgeColor,
69
+ size,
70
+ shape,
71
+ };
72
+
73
+ return (
74
+ <View>
75
+ <StyledPicker prompt="Badge appearance" selected={badgeAppearance} onChange={onBadgeAppearanceChange} collection={badgeAppearances} />
76
+ <StyledPicker prompt="Badge color" selected={badgeColor} onChange={onBadgeColorChange} collection={badgeColors} />
77
+ <StyledPicker prompt="Shape" selected={shape} onChange={onShapeChange} collection={badgeShapes} />
78
+ <StyledPicker prompt="Size" selected={size} onChange={onSizeChange} collection={badgeSizes} />
79
+ {svgIconsEnabled && (
80
+ <>
81
+ <ToggleButton onClick={() => setShowIcon(!showIcon)} checked={showIcon}>
82
+ Set {showIcon ? ' Hide icon' : ' Show icon'}
83
+ </ToggleButton>
84
+ <StyledPicker prompt="Icon position" selected={iconPosition} onChange={onIconPositionChange} collection={badgeIconPositions} />
85
+ </>
86
+ )}
87
+
88
+ {svgIconsEnabled && showIcon ? (
89
+ <Badge {...badgeConfig} icon={{ svgSource: svgProps }} iconPosition={iconPosition}>
90
+ Basic badge
91
+ </Badge>
92
+ ) : (
93
+ <Badge {...badgeConfig}>Basic badge</Badge>
94
+ )}
95
+
96
+ <Text>Size</Text>
97
+ <Badge size="tiny" shape="circular" />
98
+ <Badge size="extraSmall" shape="circular" />
99
+ <Badge size="small">Small</Badge>
100
+ <Badge size="medium">Medium</Badge>
101
+ <Badge size="large">Large</Badge>
102
+ <Badge size="extraLarge">Extra Large</Badge>
103
+ {svgIconsEnabled && (
104
+ <>
105
+ <Text>Badge with icon</Text>
106
+ <Badge icon={{ svgSource: svgProps }} iconPosition="after">
107
+ Badge with
108
+ <Image source={{ uri: satyaPhotoUrl }} style={{ width: 20, height: 20 }} />
109
+ <Text style={{ backgroundColor: 'yellow' }}>optional content</Text>
110
+ </Badge>
111
+ <Badge appearance="outline" icon={iconProps} />
112
+ <Badge icon={{ fontSource: { ...fontBuiltInProps }, color: '#fff' }}>Badge with icon</Badge>
113
+ <Text>Customized Badge</Text>
114
+ <BadgeNoBorder appearance="outline" icon={iconProps} />
115
+ </>
116
+ )}
117
+ <StyledBadge appearance="outline">Styled badge</StyledBadge>
118
+ </View>
119
+ );
120
+ };
@@ -0,0 +1,30 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ import React from 'react';
3
+ import { View, Platform, Text } from 'react-native';
4
+ import { CounterBadge } from '@fluentui-react-native/badge';
5
+ import { SvgIconProps } from '@fluentui-react-native/icon';
6
+ import TestSvg from '../../FluentTester/test-data/test.svg';
7
+
8
+ export const CounterBadgeTest: React.FunctionComponent = () => {
9
+ const svgProps: SvgIconProps = {
10
+ src: TestSvg,
11
+ viewBox: '0 0 500 500',
12
+ };
13
+
14
+ const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
15
+
16
+ return (
17
+ <View>
18
+ <Text>Here should be no Badge:</Text>
19
+ <CounterBadge count={0}></CounterBadge>
20
+ <Text>And here is the Badge with showZero = true</Text>
21
+ <CounterBadge count={0} showZero={true}></CounterBadge>
22
+ <CounterBadge color="informative" count={777}></CounterBadge>
23
+ <CounterBadge color="important" overflowCount={1000} count={777}></CounterBadge>
24
+ <CounterBadge color="danger" overflowCount={1000} count={1500}></CounterBadge>
25
+ <CounterBadge count={13}></CounterBadge>
26
+ <CounterBadge count={13}>CounterBadge</CounterBadge>
27
+ {svgIconsEnabled && <CounterBadge count={17} icon={{ svgSource: svgProps }} iconPosition="after" />}
28
+ </View>
29
+ );
30
+ };
@@ -0,0 +1,26 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ import React from 'react';
3
+ import { View, Platform, Text } from 'react-native';
4
+ import { PresenceBadge } from '@fluentui-react-native/badge';
5
+
6
+ export const PresenceBadgeTest: React.FunctionComponent = () => {
7
+ const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
8
+
9
+ return (
10
+ <View>
11
+ {svgIconsEnabled && (
12
+ <>
13
+ <Text>Presence Badge</Text>
14
+ <PresenceBadge status="available" size="extraLarge" />
15
+ <PresenceBadge status="available" outOfOffice={true} size="large" />
16
+ <PresenceBadge status="doNotDisturb" outOfOffice={true} />
17
+ <PresenceBadge status="away" size="small" />
18
+ <PresenceBadge status="busy" size="tiny" />
19
+ <PresenceBadge status="offline" />
20
+ <PresenceBadge status="outOfOffice" />
21
+ <PresenceBadge status="away" />
22
+ </>
23
+ )}
24
+ </View>
25
+ );
26
+ };
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M10.8556 8.15498C10.0225 7.69354 9 8.29608 9 9.24847V14.7516C9 15.704 10.0225 16.3065 10.8556 15.8451L16.6134 12.6561C16.852 12.524 17 12.2727 17 12C17 11.7273 16.852 11.4761 16.6134 11.3439L10.8556 8.15498ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM3.5 12C3.5 7.30558 7.30558 3.5 12 3.5C16.6944 3.5 20.5 7.30558 20.5 12C20.5 16.6944 16.6944 20.5 12 20.5C7.30558 20.5 3.5 16.6944 3.5 12Z"/></svg>