@fluentui-react-native/tester 0.90.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 (127) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +10 -2
  3. package/lib/FluentTester.js +6 -6
  4. package/lib/FluentTester.js.map +1 -1
  5. package/lib/TestComponents/Avatar/BasicAvatar.js +3 -3
  6. package/lib/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  7. package/lib/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  8. package/lib/TestComponents/Avatar/CustomizedAvatar.js +14 -8
  9. package/lib/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  10. package/lib/TestComponents/Button/ButtonIconTestSection.js +2 -2
  11. package/lib/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  12. package/lib/TestComponents/Button/ButtonShapeTestSection.js +2 -2
  13. package/lib/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  14. package/lib/TestComponents/Button/ButtonSizeTestSection.js +2 -2
  15. package/lib/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  16. package/lib/TestComponents/Button/ButtonVariantTestSection.js +2 -2
  17. package/lib/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  18. package/lib/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  19. package/lib/TestComponents/Button/ToggleButtonTestSection.js +6 -7
  20. package/lib/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  21. package/lib/TestComponents/Callout/CalloutTest.js +1 -1
  22. package/lib/TestComponents/Callout/CalloutTest.js.map +1 -1
  23. package/lib/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  24. package/lib/TestComponents/Checkbox/CheckboxTest.js +8 -5
  25. package/lib/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  26. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  27. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js +8 -5
  28. package/lib/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  29. package/lib/TestComponents/Common/styles.d.ts +10 -0
  30. package/lib/TestComponents/Common/styles.d.ts.map +1 -1
  31. package/lib/TestComponents/Common/styles.js +3 -0
  32. package/lib/TestComponents/Common/styles.js.map +1 -1
  33. package/lib/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  34. package/lib/TestComponents/Menu/MenuTest.js +9 -4
  35. package/lib/TestComponents/Menu/MenuTest.js.map +1 -1
  36. package/lib/TestComponents/Notification/NotificationTest.js +2 -2
  37. package/lib/TestComponents/Notification/NotificationTest.js.map +1 -1
  38. package/lib/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  39. package/lib/TestComponents/Persona/CustomizeUsage.js +8 -5
  40. package/lib/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  41. package/lib/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  42. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js +11 -8
  43. package/lib/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  44. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  45. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +3 -2
  46. package/lib/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  47. package/lib/TestComponents/Test.js +9 -9
  48. package/lib/TestComponents/Test.js.map +1 -1
  49. package/lib/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  50. package/lib/TestComponents/Theme/ThemeTest.js +11 -12
  51. package/lib/TestComponents/Theme/ThemeTest.js.map +1 -1
  52. package/lib/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  53. package/lib/TestComponents/Tokens/TokenTest.js +8 -10
  54. package/lib/TestComponents/Tokens/TokenTest.js.map +1 -1
  55. package/lib-commonjs/FluentTester.js +5 -5
  56. package/lib-commonjs/FluentTester.js.map +1 -1
  57. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js +2 -2
  58. package/lib-commonjs/TestComponents/Avatar/BasicAvatar.js.map +1 -1
  59. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.d.ts.map +1 -1
  60. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js +13 -7
  61. package/lib-commonjs/TestComponents/Avatar/CustomizedAvatar.js.map +1 -1
  62. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js +1 -1
  63. package/lib-commonjs/TestComponents/Button/ButtonIconTestSection.js.map +1 -1
  64. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js +1 -1
  65. package/lib-commonjs/TestComponents/Button/ButtonShapeTestSection.js.map +1 -1
  66. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js +1 -1
  67. package/lib-commonjs/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  68. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js +1 -1
  69. package/lib-commonjs/TestComponents/Button/ButtonVariantTestSection.js.map +1 -1
  70. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.d.ts.map +1 -1
  71. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js +4 -6
  72. package/lib-commonjs/TestComponents/Button/ToggleButtonTestSection.js.map +1 -1
  73. package/lib-commonjs/TestComponents/Callout/CalloutTest.js +1 -1
  74. package/lib-commonjs/TestComponents/Callout/CalloutTest.js.map +1 -1
  75. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.d.ts.map +1 -1
  76. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js +7 -5
  77. package/lib-commonjs/TestComponents/Checkbox/CheckboxTest.js.map +1 -1
  78. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  79. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js +7 -5
  80. package/lib-commonjs/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  81. package/lib-commonjs/TestComponents/Common/styles.d.ts +10 -0
  82. package/lib-commonjs/TestComponents/Common/styles.d.ts.map +1 -1
  83. package/lib-commonjs/TestComponents/Common/styles.js +4 -1
  84. package/lib-commonjs/TestComponents/Common/styles.js.map +1 -1
  85. package/lib-commonjs/TestComponents/Menu/MenuTest.d.ts.map +1 -1
  86. package/lib-commonjs/TestComponents/Menu/MenuTest.js +8 -4
  87. package/lib-commonjs/TestComponents/Menu/MenuTest.js.map +1 -1
  88. package/lib-commonjs/TestComponents/Notification/NotificationTest.js +2 -2
  89. package/lib-commonjs/TestComponents/Notification/NotificationTest.js.map +1 -1
  90. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.d.ts.map +1 -1
  91. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js +7 -5
  92. package/lib-commonjs/TestComponents/Persona/CustomizeUsage.js.map +1 -1
  93. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.d.ts.map +1 -1
  94. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js +10 -8
  95. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.js.map +1 -1
  96. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.d.ts.map +1 -1
  97. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +2 -1
  98. package/lib-commonjs/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
  99. package/lib-commonjs/TestComponents/Test.js +9 -9
  100. package/lib-commonjs/TestComponents/Test.js.map +1 -1
  101. package/lib-commonjs/TestComponents/Theme/ThemeTest.d.ts.map +1 -1
  102. package/lib-commonjs/TestComponents/Theme/ThemeTest.js +10 -12
  103. package/lib-commonjs/TestComponents/Theme/ThemeTest.js.map +1 -1
  104. package/lib-commonjs/TestComponents/Tokens/TokenTest.d.ts.map +1 -1
  105. package/lib-commonjs/TestComponents/Tokens/TokenTest.js +8 -10
  106. package/lib-commonjs/TestComponents/Tokens/TokenTest.js.map +1 -1
  107. package/package.json +1 -1
  108. package/src/FluentTester.tsx +6 -6
  109. package/src/TestComponents/Avatar/BasicAvatar.tsx +2 -2
  110. package/src/TestComponents/Avatar/CustomizedAvatar.tsx +15 -8
  111. package/src/TestComponents/Button/ButtonIconTestSection.tsx +2 -2
  112. package/src/TestComponents/Button/ButtonShapeTestSection.tsx +2 -2
  113. package/src/TestComponents/Button/ButtonSizeTestSection.tsx +2 -2
  114. package/src/TestComponents/Button/ButtonVariantTestSection.tsx +2 -2
  115. package/src/TestComponents/Button/ToggleButtonTestSection.tsx +6 -5
  116. package/src/TestComponents/Callout/CalloutTest.tsx +1 -1
  117. package/src/TestComponents/Checkbox/CheckboxTest.tsx +11 -7
  118. package/src/TestComponents/CheckboxExperimental/CheckboxTest.tsx +10 -7
  119. package/src/TestComponents/Common/styles.ts +5 -0
  120. package/src/TestComponents/Menu/MenuTest.tsx +10 -4
  121. package/src/TestComponents/Notification/NotificationTest.tsx +2 -2
  122. package/src/TestComponents/Persona/CustomizeUsage.tsx +10 -7
  123. package/src/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +4 -9
  124. package/src/TestComponents/PersonaCoin/CustomizeUsage.tsx +13 -10
  125. package/src/TestComponents/Test.tsx +9 -9
  126. package/src/TestComponents/Theme/ThemeTest.tsx +15 -11
  127. package/src/TestComponents/Tokens/TokenTest.tsx +8 -9
@@ -2,13 +2,14 @@ import { ToggleButton } from '@fluentui/react-native';
2
2
  import { Checkbox } from '@fluentui/react-native';
3
3
  import * as React from 'react';
4
4
  import { StyleSheet, View } from 'react-native';
5
- import { commonTestStyles, stackStyle } from '../Common/styles';
5
+ import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
6
6
 
7
7
  const styles = StyleSheet.create({
8
8
  row: {
9
9
  flexDirection: 'row',
10
10
  },
11
- hmargin: {
11
+ checkbox: {
12
+ ...commonTestStyles.vmargin,
12
13
  marginHorizontal: 8,
13
14
  },
14
15
  });
@@ -20,12 +21,12 @@ export const ToggleButtonTest: React.FunctionComponent = () => {
20
21
  const onGhostClicked = React.useCallback(() => setSubtleChecked(!subtleChecked), [subtleChecked, setSubtleChecked]);
21
22
 
22
23
  return (
23
- <View style={[stackStyle, commonTestStyles.view]}>
24
+ <View style={testContentRootViewStyle}>
24
25
  <View style={styles.row}>
25
26
  <ToggleButton onClick={onDefaultClicked} checked={defaultChecked} style={commonTestStyles.vmargin}>
26
27
  Default Toggle
27
28
  </ToggleButton>
28
- <Checkbox checked={defaultChecked} label="Default Toggle is Checked" style={[commonTestStyles.vmargin, styles.hmargin]} />
29
+ <Checkbox checked={defaultChecked} label="Default Toggle is Checked" style={styles.checkbox} />
29
30
  </View>
30
31
  <ToggleButton checked style={commonTestStyles.vmargin}>
31
32
  Checked Default Toggle
@@ -46,7 +47,7 @@ export const ToggleButtonTest: React.FunctionComponent = () => {
46
47
  <ToggleButton appearance="subtle" onClick={onGhostClicked} checked={subtleChecked} style={commonTestStyles.vmargin}>
47
48
  Subtle Toggle
48
49
  </ToggleButton>
49
- <Checkbox checked={subtleChecked} label="Subtle Toggle is Checked" style={[commonTestStyles.vmargin, styles.hmargin]} />
50
+ <Checkbox checked={subtleChecked} label="Subtle Toggle is Checked" style={styles.checkbox} />
50
51
  </View>
51
52
  <ToggleButton appearance="subtle" checked style={commonTestStyles.vmargin}>
52
53
  Checked Subtle Toggle
@@ -348,7 +348,7 @@ const StandardCallout: React.FunctionComponent = () => {
348
348
  </View>
349
349
  ) : (
350
350
  //else
351
- <View style={[{ padding: 20 }, { backgroundColor: calloutHovered ? 'lightgreen' : 'pink' }]}>
351
+ <View style={{ padding: 20, backgroundColor: calloutHovered ? 'lightgreen' : 'pink' }}>
352
352
  <Button content="click to change anchor" onClick={toggleCalloutRef} />
353
353
  </View>
354
354
  )}
@@ -1,11 +1,12 @@
1
1
  import { Checkbox } from '@fluentui/react-native';
2
- import { useTheme } from '@fluentui-react-native/theme-types';
2
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
3
3
  import * as React from 'react';
4
- import { View, TextInput, TextStyle } from 'react-native';
4
+ import { View, TextInput } from 'react-native';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
6
  import { CHECKBOX_TESTPAGE } from './consts';
7
7
  import { E2ECheckboxTest } from './CheckboxE2ETest';
8
8
  import { Test, TestSection, PlatformStatus } from '../Test';
9
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
9
10
 
10
11
  function onChangeUncontrolled(isChecked: boolean) {
11
12
  console.log(isChecked);
@@ -87,6 +88,10 @@ const HoverCheckbox = Checkbox.customize({
87
88
  },
88
89
  });
89
90
 
91
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
92
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
93
+ });
94
+
90
95
  const TokenCheckbox: React.FunctionComponent = () => {
91
96
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
92
97
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
@@ -108,9 +113,8 @@ const TokenCheckbox: React.FunctionComponent = () => {
108
113
  });
109
114
 
110
115
  const theme = useTheme();
111
- const textBoxBorderStyle: TextStyle = {
112
- borderColor: theme.colors.inputBorder,
113
- };
116
+ const textBoxBorderStyle = getThemedStyles(theme);
117
+
114
118
  return (
115
119
  <View>
116
120
  <CircularCheckbox label="A circular checkbox" onChange={onChangeUncontrolled} defaultChecked={false} />
@@ -125,7 +129,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
125
129
 
126
130
  <TextInput
127
131
  accessibilityLabel="Background color"
128
- style={[commonStyles.textBox, textBoxBorderStyle]}
132
+ style={textBoxBorderStyle.textbox}
129
133
  placeholder="Background color"
130
134
  blurOnSubmit={true}
131
135
  onSubmitEditing={(e) => {
@@ -135,7 +139,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
135
139
 
136
140
  <TextInput
137
141
  accessibilityLabel="Checkmark color"
138
- style={[commonStyles.textBox, textBoxBorderStyle]}
142
+ style={textBoxBorderStyle.textbox}
139
143
  placeholder="Checkmark color"
140
144
  blurOnSubmit={true}
141
145
  onSubmitEditing={(e) => {
@@ -2,11 +2,12 @@ import * as React from 'react';
2
2
  import { EXPERIMENTAL_CHECKBOX_TESTPAGE } from './consts';
3
3
  import { Test, TestSection, PlatformStatus } from '../Test';
4
4
  import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
5
- import { useTheme } from '@fluentui-react-native/theme-types';
6
- import { View, TextInput, TextStyle } from 'react-native';
5
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
6
+ import { View, TextInput } from 'react-native';
7
7
  import { commonTestStyles as commonStyles } from '../Common/styles';
8
8
  import { E2ECheckboxExperimentalTest } from './E2ECheckboxExperimentalTest';
9
9
  import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
10
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
10
11
 
11
12
  function onChangeUncontrolled(_e: InteractionEvent, isChecked: boolean) {
12
13
  console.log(isChecked);
@@ -91,6 +92,10 @@ const ComposedCheckbox = Checkbox.compose({
91
92
  },
92
93
  });
93
94
 
95
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
96
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
97
+ });
98
+
94
99
  const TokenCheckbox: React.FunctionComponent = () => {
95
100
  const [checkboxColor, setCheckboxColor] = React.useState('blue');
96
101
  const [checkmarkColor, setCheckmarkColor] = React.useState('white');
@@ -104,9 +109,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
104
109
  });
105
110
 
106
111
  const theme = useTheme();
107
- const textBoxBorderStyle: TextStyle = {
108
- borderColor: theme.colors.inputBorder,
109
- };
112
+ const textBoxBorderStyle = getThemedStyles(theme);
110
113
 
111
114
  return (
112
115
  <View>
@@ -123,7 +126,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
123
126
  />
124
127
  <TextInput
125
128
  accessibilityLabel="Background color"
126
- style={[commonStyles.textBox, textBoxBorderStyle]}
129
+ style={textBoxBorderStyle.textbox}
127
130
  placeholder="Background color"
128
131
  blurOnSubmit={true}
129
132
  onSubmitEditing={(e) => {
@@ -133,7 +136,7 @@ const TokenCheckbox: React.FunctionComponent = () => {
133
136
 
134
137
  <TextInput
135
138
  accessibilityLabel="Checkmark color"
136
- style={[commonStyles.textBox, textBoxBorderStyle]}
139
+ style={textBoxBorderStyle.textbox}
137
140
  placeholder="Checkmark color"
138
141
  blurOnSubmit={true}
139
142
  onSubmitEditing={(e) => {
@@ -8,6 +8,7 @@ export const commonTestStyles = StyleSheet.create({
8
8
  flexDirection: 'row',
9
9
  alignItems: 'flex-start',
10
10
  },
11
+ flex: { flex: 1 },
11
12
  header: {
12
13
  marginVertical: 6,
13
14
  fontSize: 16,
@@ -116,6 +117,8 @@ export const fluentTesterStyles = StyleSheet.create({
116
117
  justifyContent: 'flex-start',
117
118
  },
118
119
 
120
+ testListSeparator: { marginHorizontal: 8 },
121
+
119
122
  testSection: {
120
123
  flexGrow: 1,
121
124
  },
@@ -159,3 +162,5 @@ export const mobileStyles = StyleSheet.create({
159
162
  width: '100%',
160
163
  },
161
164
  });
165
+
166
+ export const testContentRootViewStyle = [stackStyle, commonTestStyles.view];
@@ -16,6 +16,7 @@ import { MENU_TESTPAGE } from './consts';
16
16
  import { Test, TestSection, PlatformStatus } from '../Test';
17
17
  import { TextV1 as Text } from '@fluentui-react-native/text';
18
18
  import { E2EMenuTest } from './E2EMenuTest';
19
+ import { StyleSheet } from 'react-native';
19
20
 
20
21
  const MenuDefault: React.FunctionComponent = () => {
21
22
  return (
@@ -36,10 +37,13 @@ const MenuDefault: React.FunctionComponent = () => {
36
37
  );
37
38
  };
38
39
 
40
+ const defaultCheckedTestCase = ['itemOne'];
41
+ const checkedTestCase = ['itemTwo'];
42
+
39
43
  const MenuCheckmarks: React.FunctionComponent = () => {
40
44
  return (
41
45
  <Stack style={stackStyle}>
42
- <Menu defaultChecked={['itemOne']}>
46
+ <Menu defaultChecked={defaultCheckedTestCase}>
43
47
  <MenuTrigger>
44
48
  <Button>All checkmark items</Button>
45
49
  </MenuTrigger>
@@ -51,7 +55,7 @@ const MenuCheckmarks: React.FunctionComponent = () => {
51
55
  </MenuList>
52
56
  </MenuPopover>
53
57
  </Menu>
54
- <Menu hasCheckmarks checked={['itemTwo']}>
58
+ <Menu hasCheckmarks checked={checkedTestCase}>
55
59
  <MenuTrigger>
56
60
  <Button>Some controlled checkmark items with alignment</Button>
57
61
  </MenuTrigger>
@@ -94,7 +98,7 @@ const MenuRadioItem: React.FunctionComponent = () => {
94
98
  return (
95
99
  <Stack style={stackStyle}>
96
100
  <Text>Current checked: {checked.join(' ')}</Text>
97
- <Menu defaultChecked={['itemOne']} onCheckedChange={onCheckedChange}>
101
+ <Menu defaultChecked={defaultCheckedTestCase} onCheckedChange={onCheckedChange}>
98
102
  <MenuTrigger>
99
103
  <Button>Items with radio selection</Button>
100
104
  </MenuTrigger>
@@ -164,10 +168,12 @@ const MenuOpenOnHover: React.FunctionComponent = () => {
164
168
  );
165
169
  };
166
170
 
171
+ const rootStackStyle = StyleSheet.create({ root: { ...(stackStyle as object), flexDirection: 'row' } });
172
+
167
173
  const MenuControlledOpen: React.FunctionComponent = () => {
168
174
  const [open, setOpen] = React.useState<boolean>(false);
169
175
  return (
170
- <Stack style={[stackStyle, { flexDirection: 'row' }]}>
176
+ <Stack style={rootStackStyle.root}>
171
177
  <Button onClick={() => setOpen(!open)}>Toggle open</Button>
172
178
  <Menu open={open}>
173
179
  <MenuTrigger>
@@ -164,7 +164,7 @@ const PrimaryWithAutoHide: React.FunctionComponent = () => {
164
164
  {visible ? 'Hide' : 'Show'}
165
165
  </Button>
166
166
  {!hidden && (
167
- <Animated.View style={[animatedViewProps]}>
167
+ <Animated.View style={animatedViewProps}>
168
168
  <Notification
169
169
  variant={'primary'}
170
170
  action="Undo"
@@ -237,7 +237,7 @@ const PrimaryBarWithAutoHide: React.FunctionComponent = () => {
237
237
  {visible ? 'Hide' : 'Show'}
238
238
  </Button>
239
239
  {!hidden && (
240
- <Animated.View style={[animatedViewProps]}>
240
+ <Animated.View style={animatedViewProps}>
241
241
  <Notification
242
242
  variant={'primaryBar'}
243
243
  onPress={() => {
@@ -1,10 +1,15 @@
1
1
  import * as React from 'react';
2
- import { View, Text, Switch, TextInput, TextStyle } from 'react-native';
2
+ import { View, Text, Switch, TextInput } from 'react-native';
3
3
  import { Persona } from '@fluentui/react-native';
4
4
  import { michaelImageUrl } from './styles';
5
5
  import { commonTestStyles as commonStyles } from '../Common/styles';
6
- import { useTheme } from '@fluentui-react-native/theme-types';
6
+ import { Theme, useTheme } from '@fluentui-react-native/theme-types';
7
7
  import { Slider } from '../Common/Slider';
8
+ import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
9
+
10
+ const getThemedStyles = themedStyleSheet((t: Theme) => {
11
+ return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
12
+ });
8
13
 
9
14
  export const CustomizeUsage: React.FunctionComponent = () => {
10
15
  const [showImage, setShowImage] = React.useState(true);
@@ -20,9 +25,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
20
25
  const [verticalGap, setVerticalGap] = React.useState<number>();
21
26
 
22
27
  const theme = useTheme();
23
- const textBoxBorderStyle: TextStyle = {
24
- borderColor: theme.colors.inputBorder,
25
- };
28
+ const textBoxBorderStyle = getThemedStyles(theme);
26
29
 
27
30
  const CustomizedPersona = React.useMemo(() => {
28
31
  const tokens = {
@@ -49,7 +52,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
49
52
 
50
53
  <TextInput
51
54
  accessibilityLabel="Background color"
52
- style={[commonStyles.textBox, textBoxBorderStyle]}
55
+ style={textBoxBorderStyle.textbox}
53
56
  placeholder="Background color"
54
57
  blurOnSubmit={true}
55
58
  onSubmitEditing={(e) => {
@@ -59,7 +62,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
59
62
 
60
63
  <TextInput
61
64
  accessibilityLabel="Initials text color"
62
- style={[commonStyles.textBox, textBoxBorderStyle]}
65
+ style={textBoxBorderStyle.textbox}
63
66
  placeholder="Initials text color"
64
67
  blurOnSubmit={true}
65
68
  onSubmitEditing={(e) => {
@@ -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) => {
@@ -109,7 +109,7 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
109
109
  return (
110
110
  <View testID="ScrollViewAreaForComponents">
111
111
  <View style={styles.header}>
112
- <Text style={[styles.name]} variant="heroSemibold">
112
+ <Text style={styles.name} variant="heroSemibold">
113
113
  {props.name}
114
114
  </Text>
115
115
  {props.spec && <Link url={props.spec} content="SPEC" />}
@@ -125,28 +125,28 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
125
125
  </View>
126
126
  {showStatus && (
127
127
  <>
128
- <Text style={[styles.statusLabel]} variant="bodySemibold">
128
+ <Text style={styles.statusLabel} variant="bodySemibold">
129
129
  Win32: <Text style={styles.status}>{props.status.win32Status}</Text>
130
130
  </Text>
131
- <Text style={[styles.statusLabel]} variant="bodySemibold">
131
+ <Text style={styles.statusLabel} variant="bodySemibold">
132
132
  UWP: <Text style={styles.status}>{props.status.uwpStatus}</Text>
133
133
  </Text>
134
- <Text style={[styles.statusLabel]} variant="bodySemibold">
134
+ <Text style={styles.statusLabel} variant="bodySemibold">
135
135
  iOS: <Text style={styles.status}>{props.status.iosStatus}</Text>
136
136
  </Text>
137
- <Text style={[styles.statusLabel]} variant="bodySemibold">
137
+ <Text style={styles.statusLabel} variant="bodySemibold">
138
138
  macOS: <Text style={styles.status}>{props.status.macosStatus}</Text>
139
139
  </Text>
140
- <Text style={[styles.statusLabel]} variant="bodySemibold">
140
+ <Text style={styles.statusLabel} variant="bodySemibold">
141
141
  Android: <Text style={styles.status}>{props.status.androidStatus}</Text>
142
142
  </Text>
143
143
 
144
- <Text style={[styles.definitionHeader]} variant="headerStandard">
144
+ <Text style={styles.definitionHeader} variant="headerStandard">
145
145
  Status Definitions
146
146
  </Text>
147
147
  {Object.entries(definitions).map(([key, value]) => {
148
148
  return (
149
- <Text style={[styles.statusLabel]} variant="bodySemibold" key={key}>
149
+ <Text style={styles.statusLabel} variant="bodySemibold" key={key}>
150
150
  {key}: <Text style={styles.status}>{value}</Text>
151
151
  </Text>
152
152
  );
@@ -158,7 +158,7 @@ export const Test = (props: TestProps): React.ReactElement<Record<string, never>
158
158
  const TestComponent = section.component;
159
159
  return (
160
160
  <View key={index}>
161
- <Text style={[styles.section]} variant="headerSemibold" testID={section.testID}>
161
+ <Text style={styles.section} variant="headerSemibold" testID={section.testID}>
162
162
  {section.name}
163
163
  </Text>
164
164
  <Separator />
@@ -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
  };