@fluentui-react-native/tester 0.151.17 → 0.151.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +301 -1
- package/CHANGELOG.md +63 -2
- package/lib/fluent-tester/src/TestComponents/Callout/CalloutTest.d.ts.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Callout/CalloutTest.js +17 -7
- package/lib/fluent-tester/src/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/StrokeWidth/StrokeWidthTest.js +4 -4
- package/lib/fluent-tester/src/TestComponents/StrokeWidth/StrokeWidthTest.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/TabList/TabListTest.d.ts.map +1 -1
- package/lib/fluent-tester/src/TestComponents/TabList/TabListTest.js +116 -62
- package/lib/fluent-tester/src/TestComponents/TabList/TabListTest.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Callout/CalloutTest.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Callout/CalloutTest.js +16 -6
- package/lib-commonjs/fluent-tester/src/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/StrokeWidth/StrokeWidthTest.js +4 -4
- package/lib-commonjs/fluent-tester/src/TestComponents/StrokeWidth/StrokeWidthTest.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/TabList/TabListTest.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/TabList/TabListTest.js +115 -61
- package/lib-commonjs/fluent-tester/src/TestComponents/TabList/TabListTest.js.map +1 -1
- package/macos/Podfile.lock +1 -1
- package/package.json +44 -44
- package/src/TestComponents/Callout/CalloutTest.tsx +20 -3
- package/src/TestComponents/StrokeWidth/StrokeWidthTest.tsx +4 -4
- package/src/TestComponents/TabList/TabListTest.tsx +151 -72
|
@@ -1,130 +1,209 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
4
5
|
import { Divider } from '@fluentui-react-native/divider';
|
|
6
|
+
import { Menu, MenuTrigger, MenuList, MenuItem, MenuPopover } from '@fluentui-react-native/menu';
|
|
5
7
|
import { TabList, Tab } from '@fluentui-react-native/tablist';
|
|
6
8
|
import { TextV1 as Text } from '@fluentui-react-native/text';
|
|
7
9
|
|
|
10
|
+
import { svgProps, fontProps } from '../Common/iconExamples';
|
|
11
|
+
import { stackStyle } from '../Common/styles';
|
|
8
12
|
import type { PlatformStatus, TestSection } from '../Test';
|
|
9
13
|
import { Test } from '../Test';
|
|
10
14
|
|
|
11
|
-
const
|
|
15
|
+
const SubHeader = Text.customize({ variant: 'subheaderStandard' });
|
|
16
|
+
const Header = Text.customize({ variant: 'headerStandard' });
|
|
12
17
|
const Line = Divider.customize({ paddingVertical: 4 });
|
|
13
18
|
const PaddedTabList = TabList.customize({
|
|
14
19
|
paddingVertical: 4,
|
|
15
20
|
});
|
|
16
21
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
paddingVertical: 8,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const TabListSizeTest: React.FunctionComponent = () => {
|
|
22
|
+
const TabListDefaultTest: React.FunctionComponent = () => {
|
|
23
|
+
const [key, setKey] = React.useState('tab1');
|
|
24
24
|
return (
|
|
25
|
-
<View style={
|
|
26
|
-
<Header>
|
|
27
|
-
<PaddedTabList size="small">
|
|
28
|
-
<Tab tabKey="hello">Tab 1</Tab>
|
|
29
|
-
<Tab tabKey="world">Tab 2</Tab>
|
|
30
|
-
</PaddedTabList>
|
|
25
|
+
<View style={stackStyle}>
|
|
26
|
+
<Header>Uncontrolled Component</Header>
|
|
31
27
|
<Line />
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<Tab tabKey="
|
|
35
|
-
<Tab tabKey="
|
|
28
|
+
<PaddedTabList defaultSelectedKey={'tab1'}>
|
|
29
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
30
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
31
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
36
32
|
</PaddedTabList>
|
|
33
|
+
<Header>Controlled Component</Header>
|
|
37
34
|
<Line />
|
|
38
|
-
<
|
|
39
|
-
<PaddedTabList
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
<Text>Selected Key: {key}</Text>
|
|
36
|
+
<PaddedTabList
|
|
37
|
+
selectedKey={key}
|
|
38
|
+
onTabSelect={(val) => {
|
|
39
|
+
console.log('New key:', val);
|
|
40
|
+
setKey(val);
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
44
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
45
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
42
46
|
</PaddedTabList>
|
|
43
47
|
</View>
|
|
44
48
|
);
|
|
45
49
|
};
|
|
46
50
|
|
|
47
|
-
const
|
|
51
|
+
const TabListDisabledTest: React.FunctionComponent = () => {
|
|
48
52
|
return (
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
<View style={stackStyle}>
|
|
54
|
+
<PaddedTabList defaultSelectedKey="tab2">
|
|
55
|
+
<Tab disabled tabKey="tab1">
|
|
56
|
+
Tab 1
|
|
57
|
+
</Tab>
|
|
58
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
59
|
+
<Tab disabled tabKey="tab3">
|
|
60
|
+
Tab 3
|
|
61
|
+
</Tab>
|
|
62
|
+
<Tab tabKey="tab4">Tab 4</Tab>
|
|
63
|
+
</PaddedTabList>
|
|
64
|
+
<PaddedTabList disabled>
|
|
65
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
66
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
67
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
68
|
+
</PaddedTabList>
|
|
69
|
+
</View>
|
|
53
70
|
);
|
|
54
71
|
};
|
|
55
72
|
|
|
56
|
-
const
|
|
73
|
+
const TabListVariantsTest: React.FunctionComponent = () => {
|
|
57
74
|
return (
|
|
58
|
-
<View style={
|
|
59
|
-
<Header>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
<View style={stackStyle}>
|
|
76
|
+
<Header>Size Variants</Header>
|
|
77
|
+
<Line />
|
|
78
|
+
<SubHeader>Small</SubHeader>
|
|
79
|
+
<PaddedTabList defaultSelectedKey="sm1" size="small">
|
|
80
|
+
<Tab tabKey="sm1">Small Tab 1</Tab>
|
|
81
|
+
<Tab tabKey="sm2">Small Tab 2</Tab>
|
|
82
|
+
<Tab tabKey="sm3">Small Tab 3</Tab>
|
|
83
|
+
</PaddedTabList>
|
|
84
|
+
<SubHeader>Medium (default)</SubHeader>
|
|
85
|
+
<PaddedTabList defaultSelectedKey="m1" size="medium">
|
|
86
|
+
<Tab tabKey="m1">Medium Tab 1</Tab>
|
|
87
|
+
<Tab tabKey="m2">Medium Tab 2</Tab>
|
|
88
|
+
<Tab tabKey="m3">Medium Tab 3</Tab>
|
|
89
|
+
</PaddedTabList>
|
|
90
|
+
<SubHeader>Large</SubHeader>
|
|
91
|
+
<PaddedTabList defaultSelectedKey="lg1" size="large">
|
|
92
|
+
<Tab tabKey="lg1">Large Tab 1</Tab>
|
|
93
|
+
<Tab tabKey="lg2">Large Tab 2</Tab>
|
|
94
|
+
<Tab tabKey="lg3">Large Tab 3</Tab>
|
|
63
95
|
</PaddedTabList>
|
|
64
|
-
<Header>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
96
|
+
<Header>Appearance</Header>
|
|
97
|
+
<Line />
|
|
98
|
+
<SubHeader>Transparent Appearance</SubHeader>
|
|
99
|
+
<PaddedTabList defaultSelectedKey="tab1" appearance="transparent">
|
|
100
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
101
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
102
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
103
|
+
</PaddedTabList>
|
|
104
|
+
<SubHeader>Subtle Appearance</SubHeader>
|
|
105
|
+
<PaddedTabList defaultSelectedKey="tab1" appearance="subtle">
|
|
106
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
107
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
108
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
109
|
+
</PaddedTabList>
|
|
110
|
+
<Header>Vertical Orientation</Header>
|
|
111
|
+
<Line />
|
|
112
|
+
<PaddedTabList defaultSelectedKey="tab1" vertical>
|
|
113
|
+
<Tab tabKey="tab1">Tab 1</Tab>
|
|
114
|
+
<Tab tabKey="tab2">Tab 2</Tab>
|
|
115
|
+
<Tab tabKey="tab3">Tab 3</Tab>
|
|
68
116
|
</PaddedTabList>
|
|
69
117
|
</View>
|
|
70
118
|
);
|
|
71
119
|
};
|
|
72
120
|
|
|
73
|
-
const
|
|
121
|
+
const TabListIconTest: React.FunctionComponent = () => {
|
|
74
122
|
return (
|
|
75
|
-
<View>
|
|
76
|
-
<
|
|
77
|
-
<Tab
|
|
78
|
-
|
|
123
|
+
<View style={stackStyle}>
|
|
124
|
+
<TabList defaultSelectedKey="fontIcon">
|
|
125
|
+
<Tab icon={{ fontSource: fontProps }} tabKey="fontIcon">
|
|
126
|
+
Font Icon
|
|
79
127
|
</Tab>
|
|
80
|
-
<Tab tabKey="
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<Tab tabKey="
|
|
85
|
-
</
|
|
128
|
+
<Tab icon={{ fontSource: fontProps }} tabKey="fontIconOnly" />
|
|
129
|
+
<Tab icon={{ svgSource: svgProps }} tabKey="svgIcon">
|
|
130
|
+
SVG Icon
|
|
131
|
+
</Tab>
|
|
132
|
+
<Tab icon={{ svgSource: svgProps }} tabKey="svgIconOnly" />
|
|
133
|
+
</TabList>
|
|
86
134
|
</View>
|
|
87
135
|
);
|
|
88
136
|
};
|
|
89
137
|
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
138
|
+
const TabListViewTest: React.FunctionComponent = () => {
|
|
139
|
+
const [key, setKey] = React.useState('a');
|
|
140
|
+
const views = React.useMemo(
|
|
141
|
+
() => ({
|
|
142
|
+
a: (
|
|
143
|
+
<View>
|
|
144
|
+
<SubHeader>This is View 1</SubHeader>
|
|
145
|
+
<Text variant="body1">Here is some text.</Text>
|
|
146
|
+
</View>
|
|
147
|
+
),
|
|
148
|
+
b: (
|
|
149
|
+
<View>
|
|
150
|
+
<SubHeader>This is View 2</SubHeader>
|
|
151
|
+
<Button>Button 1</Button>
|
|
152
|
+
</View>
|
|
153
|
+
),
|
|
154
|
+
c: (
|
|
155
|
+
<View>
|
|
156
|
+
<SubHeader>This is View 3</SubHeader>
|
|
157
|
+
<Menu>
|
|
158
|
+
<MenuTrigger>
|
|
159
|
+
<Button>Menu</Button>
|
|
160
|
+
</MenuTrigger>
|
|
161
|
+
<MenuPopover>
|
|
162
|
+
<MenuList>
|
|
163
|
+
<MenuItem>Item 1</MenuItem>
|
|
164
|
+
<MenuItem>Item 2</MenuItem>
|
|
165
|
+
<MenuItem>Item 3</MenuItem>
|
|
166
|
+
</MenuList>
|
|
167
|
+
</MenuPopover>
|
|
168
|
+
</Menu>
|
|
169
|
+
</View>
|
|
170
|
+
),
|
|
171
|
+
}),
|
|
172
|
+
[],
|
|
173
|
+
);
|
|
97
174
|
return (
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
Tab
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
175
|
+
<View style={stackStyle}>
|
|
176
|
+
<TabList selectedKey={key} onTabSelect={setKey}>
|
|
177
|
+
<Tab tabKey="a">View 1</Tab>
|
|
178
|
+
<Tab tabKey="b">View 2</Tab>
|
|
179
|
+
<Tab tabKey="c">View 3</Tab>
|
|
180
|
+
</TabList>
|
|
181
|
+
{views[key]}
|
|
182
|
+
</View>
|
|
104
183
|
);
|
|
105
184
|
};
|
|
106
185
|
|
|
107
186
|
const sections: TestSection[] = [
|
|
108
187
|
{
|
|
109
|
-
name: '
|
|
110
|
-
component:
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'Vertical',
|
|
114
|
-
component: TabListVerticalTest,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'Appearance',
|
|
118
|
-
component: TabListAppearanceTest,
|
|
188
|
+
name: 'TabList Controlled vs Uncontrolled',
|
|
189
|
+
component: TabListDefaultTest,
|
|
119
190
|
},
|
|
120
191
|
{
|
|
121
192
|
name: 'Disabled',
|
|
122
193
|
component: TabListDisabledTest,
|
|
123
194
|
},
|
|
195
|
+
{
|
|
196
|
+
name: 'Variants',
|
|
197
|
+
component: TabListVariantsTest,
|
|
198
|
+
},
|
|
124
199
|
{
|
|
125
200
|
name: 'Icon',
|
|
126
201
|
component: TabListIconTest,
|
|
127
202
|
},
|
|
203
|
+
{
|
|
204
|
+
name: 'Rendering Content Separately',
|
|
205
|
+
component: TabListViewTest,
|
|
206
|
+
},
|
|
128
207
|
];
|
|
129
208
|
|
|
130
209
|
export const TabListTest: React.FunctionComponent = () => {
|