@fluentui-react-native/tester 0.83.2 → 0.84.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.
- package/CHANGELOG.json +22 -1
- package/CHANGELOG.md +11 -2
- package/lib/TestComponents/Switch/CustomizedSwitch.d.ts +3 -0
- package/lib/TestComponents/Switch/CustomizedSwitch.d.ts.map +1 -0
- package/lib/TestComponents/Switch/CustomizedSwitch.js +159 -0
- package/lib/TestComponents/Switch/CustomizedSwitch.js.map +1 -0
- package/lib/TestComponents/Switch/Switch.d.ts.map +1 -1
- package/lib/TestComponents/Switch/Switch.js +5 -0
- package/lib/TestComponents/Switch/Switch.js.map +1 -1
- package/lib-commonjs/TestComponents/Switch/CustomizedSwitch.d.ts +3 -0
- package/lib-commonjs/TestComponents/Switch/CustomizedSwitch.d.ts.map +1 -0
- package/lib-commonjs/TestComponents/Switch/CustomizedSwitch.js +164 -0
- package/lib-commonjs/TestComponents/Switch/CustomizedSwitch.js.map +1 -0
- package/lib-commonjs/TestComponents/Switch/Switch.d.ts.map +1 -1
- package/lib-commonjs/TestComponents/Switch/Switch.js +5 -0
- package/lib-commonjs/TestComponents/Switch/Switch.js.map +1 -1
- package/package.json +2 -2
- package/src/TestComponents/Switch/CustomizedSwitch.tsx +281 -0
- package/src/TestComponents/Switch/Switch.tsx +5 -0
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/tester",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Mon, 08 Aug 2022
|
|
5
|
+
"date": "Mon, 08 Aug 2022 21:40:25 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/tester_v0.84.0",
|
|
7
|
+
"version": "0.84.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "nkhalil942@gmail.com",
|
|
12
|
+
"package": "@fluentui-react-native/tester",
|
|
13
|
+
"commit": "abeef208893a37feffab338d8074de3e064c7703",
|
|
14
|
+
"comment": "Added Token Customization section for Switch"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui-react-native/tester",
|
|
19
|
+
"comment": "Bump @fluentui-react-native/switch to v0.4.0",
|
|
20
|
+
"commit": "abeef208893a37feffab338d8074de3e064c7703"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Mon, 08 Aug 2022 11:50:27 GMT",
|
|
6
27
|
"tag": "@fluentui-react-native/tester_v0.83.2",
|
|
7
28
|
"version": "0.83.2",
|
|
8
29
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/tester
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon, 08 Aug 2022
|
|
3
|
+
This log was last generated on Mon, 08 Aug 2022 21:40:25 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.84.0
|
|
8
|
+
|
|
9
|
+
Mon, 08 Aug 2022 21:40:25 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Added Token Customization section for Switch (nkhalil942@gmail.com)
|
|
14
|
+
- Bump @fluentui-react-native/switch to v0.4.0
|
|
15
|
+
|
|
7
16
|
## 0.83.2
|
|
8
17
|
|
|
9
|
-
Mon, 08 Aug 2022 11:50:
|
|
18
|
+
Mon, 08 Aug 2022 11:50:27 GMT
|
|
10
19
|
|
|
11
20
|
### Patches
|
|
12
21
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomizedSwitch.d.ts","sourceRoot":"","sources":["../../../src/TestComponents/Switch/CustomizedSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAwQpC,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, TextInput, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { Switch } from '@fluentui-react-native/switch';
|
|
4
|
+
import { commonTestStyles as commonStyles } from '../Common/styles';
|
|
5
|
+
var styles = StyleSheet.create({
|
|
6
|
+
tokensRow: {
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
marginBottom: 10,
|
|
9
|
+
},
|
|
10
|
+
tokensColumn: {
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
margin: 10,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export var CustomizedSwitch = function () {
|
|
16
|
+
var _a = React.useState('blue'), trackColor = _a[0], setTrackColor = _a[1];
|
|
17
|
+
var _b = React.useState('white'), thumbColorOn = _b[0], setThumbColorOn = _b[1];
|
|
18
|
+
var _c = React.useState('grey'), thumbColorOff = _c[0], setThumbColorOff = _c[1];
|
|
19
|
+
var _d = React.useState(20), thumbSize = _d[0], setThumbSize = _d[1];
|
|
20
|
+
var _e = React.useState(100), trackWidth = _e[0], setTrackWidth = _e[1];
|
|
21
|
+
var _f = React.useState(30), trackHeight = _f[0], setTrackHeight = _f[1];
|
|
22
|
+
var _g = React.useState('black'), focusStrokeColor = _g[0], setFocusStrokeColor = _g[1];
|
|
23
|
+
var _h = React.useState(4), focusBorderRadius = _h[0], setFocusBorderRadius = _h[1];
|
|
24
|
+
var _j = React.useState(1), focusBorderWidth = _j[0], setFocusBorderWidth = _j[1];
|
|
25
|
+
var _k = React.useState(20), thumbRadius = _k[0], setThumbRadius = _k[1];
|
|
26
|
+
var _l = React.useState(4), padding = _l[0], setPadding = _l[1];
|
|
27
|
+
var _m = React.useState('black'), color = _m[0], setColor = _m[1];
|
|
28
|
+
var _o = React.useState(trackWidth), minWidth = _o[0], setMinWidth = _o[1];
|
|
29
|
+
var _p = React.useState(trackHeight), minHeight = _p[0], setMinHeight = _p[1];
|
|
30
|
+
var _q = React.useState(1), borderWidth = _q[0], setBorderWidth = _q[1];
|
|
31
|
+
var _r = React.useState(20), borderRadius = _r[0], setBorderRadius = _r[1];
|
|
32
|
+
var _s = React.useState(trackColor), borderColor = _s[0], setBorderColor = _s[1];
|
|
33
|
+
var CustomSwitch = React.useMemo(function () {
|
|
34
|
+
var tokens = {
|
|
35
|
+
trackWidth: trackWidth,
|
|
36
|
+
trackHeight: trackHeight,
|
|
37
|
+
minWidth: minWidth,
|
|
38
|
+
minHeight: minHeight,
|
|
39
|
+
thumbSize: thumbSize,
|
|
40
|
+
thumbRadius: thumbRadius,
|
|
41
|
+
padding: padding,
|
|
42
|
+
color: color,
|
|
43
|
+
borderWidth: borderWidth,
|
|
44
|
+
borderRadius: borderRadius,
|
|
45
|
+
toggleOn: {
|
|
46
|
+
thumbColor: thumbColorOn,
|
|
47
|
+
trackColor: trackColor,
|
|
48
|
+
borderColor: borderColor,
|
|
49
|
+
hovered: {
|
|
50
|
+
borderColor: borderColor,
|
|
51
|
+
trackColor: trackColor,
|
|
52
|
+
thumbColor: thumbColorOn,
|
|
53
|
+
},
|
|
54
|
+
pressed: {
|
|
55
|
+
borderColor: trackColor,
|
|
56
|
+
trackColor: trackColor,
|
|
57
|
+
thumbColor: thumbColorOn,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
toggleOff: {
|
|
61
|
+
thumbColor: thumbColorOff,
|
|
62
|
+
hovered: {
|
|
63
|
+
thumbColor: thumbColorOff,
|
|
64
|
+
},
|
|
65
|
+
pressed: {
|
|
66
|
+
thumbColor: thumbColorOff,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
focused: {
|
|
70
|
+
focusBorderRadius: focusBorderRadius,
|
|
71
|
+
focusStrokeColor: focusStrokeColor,
|
|
72
|
+
focusBorderWidth: focusBorderWidth,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
return Switch.customize(tokens);
|
|
76
|
+
}, [
|
|
77
|
+
trackColor,
|
|
78
|
+
thumbColorOn,
|
|
79
|
+
thumbColorOff,
|
|
80
|
+
thumbSize,
|
|
81
|
+
thumbRadius,
|
|
82
|
+
trackWidth,
|
|
83
|
+
trackHeight,
|
|
84
|
+
focusStrokeColor,
|
|
85
|
+
focusBorderRadius,
|
|
86
|
+
focusBorderWidth,
|
|
87
|
+
padding,
|
|
88
|
+
color,
|
|
89
|
+
minWidth,
|
|
90
|
+
minHeight,
|
|
91
|
+
borderWidth,
|
|
92
|
+
borderRadius,
|
|
93
|
+
borderColor,
|
|
94
|
+
]);
|
|
95
|
+
return (React.createElement(View, { style: styles.tokensColumn },
|
|
96
|
+
React.createElement(View, { style: styles.tokensRow },
|
|
97
|
+
React.createElement(View, null,
|
|
98
|
+
React.createElement(Text, null, "Track Tokens"),
|
|
99
|
+
React.createElement(TextInput, { accessibilityLabel: "Track color", style: commonStyles.textBox, placeholder: "Track color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
100
|
+
setTrackColor(e.nativeEvent.text);
|
|
101
|
+
} }),
|
|
102
|
+
React.createElement(TextInput, { accessibilityLabel: "Track border color", style: commonStyles.textBox, placeholder: "Track border color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
103
|
+
setBorderColor(e.nativeEvent.text);
|
|
104
|
+
} }),
|
|
105
|
+
React.createElement(TextInput, { accessibilityLabel: "Track width", style: commonStyles.textBox, placeholder: "Track width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
106
|
+
setTrackWidth(parseInt(e.nativeEvent.text.toString()));
|
|
107
|
+
} }),
|
|
108
|
+
React.createElement(TextInput, { accessibilityLabel: "Track height", style: commonStyles.textBox, placeholder: "Track height", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
109
|
+
setTrackHeight(parseInt(e.nativeEvent.text.toString()));
|
|
110
|
+
} }),
|
|
111
|
+
React.createElement(TextInput, { accessibilityLabel: "Track border width", style: commonStyles.textBox, placeholder: "Track border width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
112
|
+
setBorderWidth(parseInt(e.nativeEvent.text.toString()));
|
|
113
|
+
} }),
|
|
114
|
+
React.createElement(TextInput, { accessibilityLabel: "Track border radius", style: commonStyles.textBox, placeholder: "Track border radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
115
|
+
setBorderRadius(parseInt(e.nativeEvent.text.toString()));
|
|
116
|
+
} })),
|
|
117
|
+
React.createElement(View, null,
|
|
118
|
+
React.createElement(Text, null, "Thumb Tokens"),
|
|
119
|
+
React.createElement(TextInput, { accessibilityLabel: "Thumb on color", style: commonStyles.textBox, placeholder: "Thumb on color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
120
|
+
setThumbColorOn(e.nativeEvent.text);
|
|
121
|
+
} }),
|
|
122
|
+
React.createElement(TextInput, { accessibilityLabel: "Thumb off color", style: commonStyles.textBox, placeholder: "Thumb off color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
123
|
+
setThumbColorOff(e.nativeEvent.text);
|
|
124
|
+
} }),
|
|
125
|
+
React.createElement(TextInput, { accessibilityLabel: "Thumb size", style: commonStyles.textBox, placeholder: "Thumb size", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
126
|
+
setThumbSize(parseInt(e.nativeEvent.text));
|
|
127
|
+
} }),
|
|
128
|
+
React.createElement(TextInput, { accessibilityLabel: "Thumb radius", style: commonStyles.textBox, placeholder: "Thumb radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
129
|
+
setThumbRadius(parseInt(e.nativeEvent.text));
|
|
130
|
+
} }))),
|
|
131
|
+
React.createElement(View, { style: styles.tokensRow },
|
|
132
|
+
React.createElement(View, null,
|
|
133
|
+
React.createElement(Text, null, "Focus Stroke Tokens"),
|
|
134
|
+
React.createElement(TextInput, { accessibilityLabel: "Focus stroke color", style: commonStyles.textBox, placeholder: "Focus stroke color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
135
|
+
setFocusStrokeColor(e.nativeEvent.text);
|
|
136
|
+
} }),
|
|
137
|
+
React.createElement(TextInput, { accessibilityLabel: "Focus stroke border radius", style: commonStyles.textBox, placeholder: "Focus stroke border radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
138
|
+
setFocusBorderRadius(parseInt(e.nativeEvent.text));
|
|
139
|
+
} }),
|
|
140
|
+
React.createElement(TextInput, { accessibilityLabel: "Focus stroke border width", style: commonStyles.textBox, placeholder: "Focus stroke border width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
141
|
+
setFocusBorderWidth(parseInt(e.nativeEvent.text));
|
|
142
|
+
} })),
|
|
143
|
+
React.createElement(View, null,
|
|
144
|
+
React.createElement(Text, null, "Other Tokens"),
|
|
145
|
+
React.createElement(TextInput, { accessibilityLabel: "Minimum width", style: commonStyles.textBox, placeholder: "Minimum width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
146
|
+
setMinWidth(parseInt(e.nativeEvent.text));
|
|
147
|
+
} }),
|
|
148
|
+
React.createElement(TextInput, { accessibilityLabel: "Minimum height", style: commonStyles.textBox, placeholder: "Minimum height", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
149
|
+
setMinHeight(parseInt(e.nativeEvent.text));
|
|
150
|
+
} }),
|
|
151
|
+
React.createElement(TextInput, { accessibilityLabel: "Padding", style: commonStyles.textBox, placeholder: "Padding", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
152
|
+
setPadding(parseInt(e.nativeEvent.text));
|
|
153
|
+
} }),
|
|
154
|
+
React.createElement(TextInput, { accessibilityLabel: "Text colors", style: commonStyles.textBox, placeholder: "Text colors", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
155
|
+
setColor(e.nativeEvent.text);
|
|
156
|
+
} }))),
|
|
157
|
+
React.createElement(CustomSwitch, { label: "Custom Switch", onText: "On", offText: "Off", accessibilityLabel: "Custom Switch" })));
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL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sourceRoot":"","sources":["../../../src/TestComponents/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqH/B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAY9B,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { Switch } from '@fluentui-react-native/switch';
|
|
|
6
6
|
import { E2ESwitchTest } from './E2ESwitchTest';
|
|
7
7
|
import { commonTestStyles } from '../Common/styles';
|
|
8
8
|
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
9
|
+
import { CustomizedSwitch } from './CustomizedSwitch';
|
|
9
10
|
var styles = StyleSheet.create({
|
|
10
11
|
square: {
|
|
11
12
|
backgroundColor: 'red',
|
|
@@ -76,6 +77,10 @@ var toggleSections = [
|
|
|
76
77
|
name: 'On/Off Text',
|
|
77
78
|
component: function () { return React.createElement(OnOffText, null); },
|
|
78
79
|
},
|
|
80
|
+
{
|
|
81
|
+
name: 'Customized Tokens',
|
|
82
|
+
component: function () { return React.createElement(CustomizedSwitch, null); },
|
|
83
|
+
},
|
|
79
84
|
{
|
|
80
85
|
name: 'Switch E2E Testing',
|
|
81
86
|
component: function () { return React.createElement(E2ESwitchTest, null); },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/TestComponents/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAA+B,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,O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C;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,cAAM,OAAA,oBAAC,aAAa,OAAG,EAAjB,CAAiB;KACnC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,cAAM,OAAA,oBAAC,SAAS,OAAG,EAAb,CAAa;KAC/B;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,cAAM,OAAA,oBAAC,gBAAgB,OAAG,EAApB,CAAoB;KACtC;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,cAAM,OAAA,oBAAC,aAAa,OAAG,EAAjB,CAAiB;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAA4B;IACjD,IAAM,MAAM,GAAmB;QAC7B,WAAW,EAAE,cAAc;QAC3B,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,SAAS;KACzB,CAAC;IAEF,IAAM,WAAW,GAAG,6DAA6D,CAAC;IAElF,OAAO,oBAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAS,CAAC;AAC9G,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomizedSwitch.d.ts","sourceRoot":"","sources":["../../../src/TestComponents/Switch/CustomizedSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAwQpC,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomizedSwitch = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var React = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
var react_native_1 = require("react-native");
|
|
7
|
+
var switch_1 = require("@fluentui-react-native/switch");
|
|
8
|
+
var styles_1 = require("../Common/styles");
|
|
9
|
+
var styles = react_native_1.StyleSheet.create({
|
|
10
|
+
tokensRow: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
marginBottom: 10,
|
|
13
|
+
},
|
|
14
|
+
tokensColumn: {
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
margin: 10,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
var CustomizedSwitch = function () {
|
|
20
|
+
var _a = React.useState('blue'), trackColor = _a[0], setTrackColor = _a[1];
|
|
21
|
+
var _b = React.useState('white'), thumbColorOn = _b[0], setThumbColorOn = _b[1];
|
|
22
|
+
var _c = React.useState('grey'), thumbColorOff = _c[0], setThumbColorOff = _c[1];
|
|
23
|
+
var _d = React.useState(20), thumbSize = _d[0], setThumbSize = _d[1];
|
|
24
|
+
var _e = React.useState(100), trackWidth = _e[0], setTrackWidth = _e[1];
|
|
25
|
+
var _f = React.useState(30), trackHeight = _f[0], setTrackHeight = _f[1];
|
|
26
|
+
var _g = React.useState('black'), focusStrokeColor = _g[0], setFocusStrokeColor = _g[1];
|
|
27
|
+
var _h = React.useState(4), focusBorderRadius = _h[0], setFocusBorderRadius = _h[1];
|
|
28
|
+
var _j = React.useState(1), focusBorderWidth = _j[0], setFocusBorderWidth = _j[1];
|
|
29
|
+
var _k = React.useState(20), thumbRadius = _k[0], setThumbRadius = _k[1];
|
|
30
|
+
var _l = React.useState(4), padding = _l[0], setPadding = _l[1];
|
|
31
|
+
var _m = React.useState('black'), color = _m[0], setColor = _m[1];
|
|
32
|
+
var _o = React.useState(trackWidth), minWidth = _o[0], setMinWidth = _o[1];
|
|
33
|
+
var _p = React.useState(trackHeight), minHeight = _p[0], setMinHeight = _p[1];
|
|
34
|
+
var _q = React.useState(1), borderWidth = _q[0], setBorderWidth = _q[1];
|
|
35
|
+
var _r = React.useState(20), borderRadius = _r[0], setBorderRadius = _r[1];
|
|
36
|
+
var _s = React.useState(trackColor), borderColor = _s[0], setBorderColor = _s[1];
|
|
37
|
+
var CustomSwitch = React.useMemo(function () {
|
|
38
|
+
var tokens = {
|
|
39
|
+
trackWidth: trackWidth,
|
|
40
|
+
trackHeight: trackHeight,
|
|
41
|
+
minWidth: minWidth,
|
|
42
|
+
minHeight: minHeight,
|
|
43
|
+
thumbSize: thumbSize,
|
|
44
|
+
thumbRadius: thumbRadius,
|
|
45
|
+
padding: padding,
|
|
46
|
+
color: color,
|
|
47
|
+
borderWidth: borderWidth,
|
|
48
|
+
borderRadius: borderRadius,
|
|
49
|
+
toggleOn: {
|
|
50
|
+
thumbColor: thumbColorOn,
|
|
51
|
+
trackColor: trackColor,
|
|
52
|
+
borderColor: borderColor,
|
|
53
|
+
hovered: {
|
|
54
|
+
borderColor: borderColor,
|
|
55
|
+
trackColor: trackColor,
|
|
56
|
+
thumbColor: thumbColorOn,
|
|
57
|
+
},
|
|
58
|
+
pressed: {
|
|
59
|
+
borderColor: trackColor,
|
|
60
|
+
trackColor: trackColor,
|
|
61
|
+
thumbColor: thumbColorOn,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
toggleOff: {
|
|
65
|
+
thumbColor: thumbColorOff,
|
|
66
|
+
hovered: {
|
|
67
|
+
thumbColor: thumbColorOff,
|
|
68
|
+
},
|
|
69
|
+
pressed: {
|
|
70
|
+
thumbColor: thumbColorOff,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
focused: {
|
|
74
|
+
focusBorderRadius: focusBorderRadius,
|
|
75
|
+
focusStrokeColor: focusStrokeColor,
|
|
76
|
+
focusBorderWidth: focusBorderWidth,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
return switch_1.Switch.customize(tokens);
|
|
80
|
+
}, [
|
|
81
|
+
trackColor,
|
|
82
|
+
thumbColorOn,
|
|
83
|
+
thumbColorOff,
|
|
84
|
+
thumbSize,
|
|
85
|
+
thumbRadius,
|
|
86
|
+
trackWidth,
|
|
87
|
+
trackHeight,
|
|
88
|
+
focusStrokeColor,
|
|
89
|
+
focusBorderRadius,
|
|
90
|
+
focusBorderWidth,
|
|
91
|
+
padding,
|
|
92
|
+
color,
|
|
93
|
+
minWidth,
|
|
94
|
+
minHeight,
|
|
95
|
+
borderWidth,
|
|
96
|
+
borderRadius,
|
|
97
|
+
borderColor,
|
|
98
|
+
]);
|
|
99
|
+
return (React.createElement(react_native_1.View, { style: styles.tokensColumn },
|
|
100
|
+
React.createElement(react_native_1.View, { style: styles.tokensRow },
|
|
101
|
+
React.createElement(react_native_1.View, null,
|
|
102
|
+
React.createElement(react_native_1.Text, null, "Track Tokens"),
|
|
103
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track color", style: styles_1.commonTestStyles.textBox, placeholder: "Track color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
104
|
+
setTrackColor(e.nativeEvent.text);
|
|
105
|
+
} }),
|
|
106
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track border color", style: styles_1.commonTestStyles.textBox, placeholder: "Track border color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
107
|
+
setBorderColor(e.nativeEvent.text);
|
|
108
|
+
} }),
|
|
109
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track width", style: styles_1.commonTestStyles.textBox, placeholder: "Track width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
110
|
+
setTrackWidth(parseInt(e.nativeEvent.text.toString()));
|
|
111
|
+
} }),
|
|
112
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track height", style: styles_1.commonTestStyles.textBox, placeholder: "Track height", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
113
|
+
setTrackHeight(parseInt(e.nativeEvent.text.toString()));
|
|
114
|
+
} }),
|
|
115
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track border width", style: styles_1.commonTestStyles.textBox, placeholder: "Track border width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
116
|
+
setBorderWidth(parseInt(e.nativeEvent.text.toString()));
|
|
117
|
+
} }),
|
|
118
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Track border radius", style: styles_1.commonTestStyles.textBox, placeholder: "Track border radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
119
|
+
setBorderRadius(parseInt(e.nativeEvent.text.toString()));
|
|
120
|
+
} })),
|
|
121
|
+
React.createElement(react_native_1.View, null,
|
|
122
|
+
React.createElement(react_native_1.Text, null, "Thumb Tokens"),
|
|
123
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Thumb on color", style: styles_1.commonTestStyles.textBox, placeholder: "Thumb on color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
124
|
+
setThumbColorOn(e.nativeEvent.text);
|
|
125
|
+
} }),
|
|
126
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Thumb off color", style: styles_1.commonTestStyles.textBox, placeholder: "Thumb off color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
127
|
+
setThumbColorOff(e.nativeEvent.text);
|
|
128
|
+
} }),
|
|
129
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Thumb size", style: styles_1.commonTestStyles.textBox, placeholder: "Thumb size", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
130
|
+
setThumbSize(parseInt(e.nativeEvent.text));
|
|
131
|
+
} }),
|
|
132
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Thumb radius", style: styles_1.commonTestStyles.textBox, placeholder: "Thumb radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
133
|
+
setThumbRadius(parseInt(e.nativeEvent.text));
|
|
134
|
+
} }))),
|
|
135
|
+
React.createElement(react_native_1.View, { style: styles.tokensRow },
|
|
136
|
+
React.createElement(react_native_1.View, null,
|
|
137
|
+
React.createElement(react_native_1.Text, null, "Focus Stroke Tokens"),
|
|
138
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Focus stroke color", style: styles_1.commonTestStyles.textBox, placeholder: "Focus stroke color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
139
|
+
setFocusStrokeColor(e.nativeEvent.text);
|
|
140
|
+
} }),
|
|
141
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Focus stroke border radius", style: styles_1.commonTestStyles.textBox, placeholder: "Focus stroke border radius", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
142
|
+
setFocusBorderRadius(parseInt(e.nativeEvent.text));
|
|
143
|
+
} }),
|
|
144
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Focus stroke border width", style: styles_1.commonTestStyles.textBox, placeholder: "Focus stroke border width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
145
|
+
setFocusBorderWidth(parseInt(e.nativeEvent.text));
|
|
146
|
+
} })),
|
|
147
|
+
React.createElement(react_native_1.View, null,
|
|
148
|
+
React.createElement(react_native_1.Text, null, "Other Tokens"),
|
|
149
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Minimum width", style: styles_1.commonTestStyles.textBox, placeholder: "Minimum width", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
150
|
+
setMinWidth(parseInt(e.nativeEvent.text));
|
|
151
|
+
} }),
|
|
152
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Minimum height", style: styles_1.commonTestStyles.textBox, placeholder: "Minimum height", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
153
|
+
setMinHeight(parseInt(e.nativeEvent.text));
|
|
154
|
+
} }),
|
|
155
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Padding", style: styles_1.commonTestStyles.textBox, placeholder: "Padding", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
156
|
+
setPadding(parseInt(e.nativeEvent.text));
|
|
157
|
+
} }),
|
|
158
|
+
React.createElement(react_native_1.TextInput, { accessibilityLabel: "Text colors", style: styles_1.commonTestStyles.textBox, placeholder: "Text colors", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
159
|
+
setColor(e.nativeEvent.text);
|
|
160
|
+
} }))),
|
|
161
|
+
React.createElement(CustomSwitch, { label: "Custom Switch", onText: "On", offText: "Off", accessibilityLabel: "Custom Switch" })));
|
|
162
|
+
};
|
|
163
|
+
exports.CustomizedSwitch = CustomizedSwitch;
|
|
164
|
+
//# sourceMappingURL=CustomizedSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomizedSwitch.js","sourceRoot":"","sources":["../../../src/TestComponents/Switch/CustomizedSwitch.tsx"],"names":[],"mappings":";;;;AAAA,wDAA+B;AAC/B,6CAAiE;AACjE,wDAAqE;AACrE,2CAAoE;AAEpE,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,YAAY,EAAE,EAAE;KACjB;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,QAAQ;QACvB,MAAM,EAAE,EAAE;KACX;CACF,CAAC,CAAC;AAEI,IAAM,gBAAgB,GAA4B;IACjD,IAAA,KAA8B,KAAK,CAAC,QAAQ,CAAS,MAAM,CAAC,EAA3D,UAAU,QAAA,EAAE,aAAa,QAAkC,CAAC;IAC7D,IAAA,KAAkC,KAAK,CAAC,QAAQ,CAAS,OAAO,CAAC,EAAhE,YAAY,QAAA,EAAE,eAAe,QAAmC,CAAC;IAClE,IAAA,KAAoC,KAAK,CAAC,QAAQ,CAAS,MAAM,CAAC,EAAjE,aAAa,QAAA,EAAE,gBAAgB,QAAkC,CAAC;IACnE,IAAA,KAA4B,KAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,EAArD,SAAS,QAAA,EAAE,YAAY,QAA8B,CAAC;IACvD,IAAA,KAA8B,KAAK,CAAC,QAAQ,CAAS,GAAG,CAAC,EAAxD,UAAU,QAAA,EAAE,aAAa,QAA+B,CAAC;IAC1D,IAAA,KAAgC,KAAK,CA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.d.ts","sourceRoot":"","sources":["../../../src/TestComponents/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/TestComponents/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqH/B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAY9B,CAAC"}
|
|
@@ -10,6 +10,7 @@ var switch_1 = require("@fluentui-react-native/switch");
|
|
|
10
10
|
var E2ESwitchTest_1 = require("./E2ESwitchTest");
|
|
11
11
|
var styles_1 = require("../Common/styles");
|
|
12
12
|
var button_1 = require("@fluentui-react-native/button");
|
|
13
|
+
var CustomizedSwitch_1 = require("./CustomizedSwitch");
|
|
13
14
|
var styles = react_native_1.StyleSheet.create({
|
|
14
15
|
square: {
|
|
15
16
|
backgroundColor: 'red',
|
|
@@ -80,6 +81,10 @@ var toggleSections = [
|
|
|
80
81
|
name: 'On/Off Text',
|
|
81
82
|
component: function () { return React.createElement(OnOffText, null); },
|
|
82
83
|
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Customized Tokens',
|
|
86
|
+
component: function () { return React.createElement(CustomizedSwitch_1.CustomizedSwitch, null); },
|
|
87
|
+
},
|
|
83
88
|
{
|
|
84
89
|
name: 'Switch E2E Testing',
|
|
85
90
|
component: function () { return React.createElement(E2ESwitchTest_1.E2ESwitchTest, null); },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/TestComponents/Switch/Switch.tsx"],"names":[],"mappings":";;;;AAAA,wDAA+B;AAC/B,gCAA4D;AAC5D,mCAA2C;AAC3C,6CAAgD;AAChD,wDAAuD;AACvD,iDAAgD;AAChD,2CAAoD;AACpD,wDAAmE;
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/TestComponents/Switch/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M,MAAM,GAAmB;QAC7B,WAAW,EAAE,cAAc;QAC3B,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,SAAS;KACzB,CAAC;IAEF,IAAM,WAAW,GAAG,6DAA6D,CAAC;IAElF,OAAO,oBAAC,WAAI,IAAC,IAAI,EAAC,aAAa,EAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAS,CAAC;AAC9G,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/tester",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"description": "A test app to test FluentUI React Native Components during development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft <fluentuinativeowners@microsoft.com>",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@fluentui-react-native/menu": "^1.0.23",
|
|
59
59
|
"@fluentui-react-native/notification": "0.12.0",
|
|
60
60
|
"@fluentui-react-native/stack": ">=0.7.3 <1.0.0",
|
|
61
|
-
"@fluentui-react-native/switch": "^0.
|
|
61
|
+
"@fluentui-react-native/switch": "^0.4.0",
|
|
62
62
|
"@fluentui-react-native/text": ">=0.14.0 <1.0.0",
|
|
63
63
|
"@fluentui-react-native/theme": ">=0.7.0 <1.0.0",
|
|
64
64
|
"@fluentui-react-native/theme-types": ">=0.18.0 <1.0.0",
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, TextInput, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { Switch, SwitchTokens } from '@fluentui-react-native/switch';
|
|
4
|
+
import { commonTestStyles as commonStyles } from '../Common/styles';
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
tokensRow: {
|
|
8
|
+
flexDirection: 'row',
|
|
9
|
+
marginBottom: 10,
|
|
10
|
+
},
|
|
11
|
+
tokensColumn: {
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
margin: 10,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const CustomizedSwitch: React.FunctionComponent = () => {
|
|
18
|
+
const [trackColor, setTrackColor] = React.useState<string>('blue');
|
|
19
|
+
const [thumbColorOn, setThumbColorOn] = React.useState<string>('white');
|
|
20
|
+
const [thumbColorOff, setThumbColorOff] = React.useState<string>('grey');
|
|
21
|
+
const [thumbSize, setThumbSize] = React.useState<number>(20);
|
|
22
|
+
const [trackWidth, setTrackWidth] = React.useState<number>(100);
|
|
23
|
+
const [trackHeight, setTrackHeight] = React.useState<number>(30);
|
|
24
|
+
const [focusStrokeColor, setFocusStrokeColor] = React.useState<string>('black');
|
|
25
|
+
const [focusBorderRadius, setFocusBorderRadius] = React.useState<number>(4);
|
|
26
|
+
const [focusBorderWidth, setFocusBorderWidth] = React.useState<number>(1);
|
|
27
|
+
const [thumbRadius, setThumbRadius] = React.useState<number>(20);
|
|
28
|
+
const [padding, setPadding] = React.useState<number>(4);
|
|
29
|
+
const [color, setColor] = React.useState<string>('black');
|
|
30
|
+
const [minWidth, setMinWidth] = React.useState<number>(trackWidth);
|
|
31
|
+
const [minHeight, setMinHeight] = React.useState<number>(trackHeight);
|
|
32
|
+
const [borderWidth, setBorderWidth] = React.useState<number>(1);
|
|
33
|
+
const [borderRadius, setBorderRadius] = React.useState<number>(20);
|
|
34
|
+
const [borderColor, setBorderColor] = React.useState<string>(trackColor);
|
|
35
|
+
|
|
36
|
+
const CustomSwitch = React.useMemo(() => {
|
|
37
|
+
const tokens: SwitchTokens = {
|
|
38
|
+
trackWidth,
|
|
39
|
+
trackHeight,
|
|
40
|
+
minWidth,
|
|
41
|
+
minHeight,
|
|
42
|
+
thumbSize,
|
|
43
|
+
thumbRadius,
|
|
44
|
+
padding,
|
|
45
|
+
color,
|
|
46
|
+
borderWidth,
|
|
47
|
+
borderRadius,
|
|
48
|
+
|
|
49
|
+
toggleOn: {
|
|
50
|
+
thumbColor: thumbColorOn,
|
|
51
|
+
trackColor,
|
|
52
|
+
borderColor,
|
|
53
|
+
|
|
54
|
+
hovered: {
|
|
55
|
+
borderColor,
|
|
56
|
+
trackColor,
|
|
57
|
+
thumbColor: thumbColorOn,
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
pressed: {
|
|
61
|
+
borderColor: trackColor,
|
|
62
|
+
trackColor,
|
|
63
|
+
thumbColor: thumbColorOn,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
toggleOff: {
|
|
68
|
+
thumbColor: thumbColorOff,
|
|
69
|
+
|
|
70
|
+
hovered: {
|
|
71
|
+
thumbColor: thumbColorOff,
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
pressed: {
|
|
75
|
+
thumbColor: thumbColorOff,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
focused: {
|
|
80
|
+
focusBorderRadius,
|
|
81
|
+
focusStrokeColor,
|
|
82
|
+
focusBorderWidth,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
return Switch.customize(tokens);
|
|
86
|
+
}, [
|
|
87
|
+
trackColor,
|
|
88
|
+
thumbColorOn,
|
|
89
|
+
thumbColorOff,
|
|
90
|
+
thumbSize,
|
|
91
|
+
thumbRadius,
|
|
92
|
+
trackWidth,
|
|
93
|
+
trackHeight,
|
|
94
|
+
focusStrokeColor,
|
|
95
|
+
focusBorderRadius,
|
|
96
|
+
focusBorderWidth,
|
|
97
|
+
padding,
|
|
98
|
+
color,
|
|
99
|
+
minWidth,
|
|
100
|
+
minHeight,
|
|
101
|
+
borderWidth,
|
|
102
|
+
borderRadius,
|
|
103
|
+
borderColor,
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<View style={styles.tokensColumn}>
|
|
108
|
+
<View style={styles.tokensRow}>
|
|
109
|
+
<View>
|
|
110
|
+
<Text>Track Tokens</Text>
|
|
111
|
+
<TextInput
|
|
112
|
+
accessibilityLabel="Track color"
|
|
113
|
+
style={commonStyles.textBox}
|
|
114
|
+
placeholder="Track color"
|
|
115
|
+
blurOnSubmit={true}
|
|
116
|
+
onSubmitEditing={(e) => {
|
|
117
|
+
setTrackColor(e.nativeEvent.text);
|
|
118
|
+
}}
|
|
119
|
+
/>
|
|
120
|
+
<TextInput
|
|
121
|
+
accessibilityLabel="Track border color"
|
|
122
|
+
style={commonStyles.textBox}
|
|
123
|
+
placeholder="Track border color"
|
|
124
|
+
blurOnSubmit={true}
|
|
125
|
+
onSubmitEditing={(e) => {
|
|
126
|
+
setBorderColor(e.nativeEvent.text);
|
|
127
|
+
}}
|
|
128
|
+
/>
|
|
129
|
+
<TextInput
|
|
130
|
+
accessibilityLabel="Track width"
|
|
131
|
+
style={commonStyles.textBox}
|
|
132
|
+
placeholder="Track width"
|
|
133
|
+
blurOnSubmit={true}
|
|
134
|
+
onSubmitEditing={(e) => {
|
|
135
|
+
setTrackWidth(parseInt(e.nativeEvent.text.toString()));
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
<TextInput
|
|
139
|
+
accessibilityLabel="Track height"
|
|
140
|
+
style={commonStyles.textBox}
|
|
141
|
+
placeholder="Track height"
|
|
142
|
+
blurOnSubmit={true}
|
|
143
|
+
onSubmitEditing={(e) => {
|
|
144
|
+
setTrackHeight(parseInt(e.nativeEvent.text.toString()));
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
147
|
+
<TextInput
|
|
148
|
+
accessibilityLabel="Track border width"
|
|
149
|
+
style={commonStyles.textBox}
|
|
150
|
+
placeholder="Track border width"
|
|
151
|
+
blurOnSubmit={true}
|
|
152
|
+
onSubmitEditing={(e) => {
|
|
153
|
+
setBorderWidth(parseInt(e.nativeEvent.text.toString()));
|
|
154
|
+
}}
|
|
155
|
+
/>
|
|
156
|
+
<TextInput
|
|
157
|
+
accessibilityLabel="Track border radius"
|
|
158
|
+
style={commonStyles.textBox}
|
|
159
|
+
placeholder="Track border radius"
|
|
160
|
+
blurOnSubmit={true}
|
|
161
|
+
onSubmitEditing={(e) => {
|
|
162
|
+
setBorderRadius(parseInt(e.nativeEvent.text.toString()));
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
165
|
+
</View>
|
|
166
|
+
<View>
|
|
167
|
+
<Text>Thumb Tokens</Text>
|
|
168
|
+
<TextInput
|
|
169
|
+
accessibilityLabel="Thumb on color"
|
|
170
|
+
style={commonStyles.textBox}
|
|
171
|
+
placeholder="Thumb on color"
|
|
172
|
+
blurOnSubmit={true}
|
|
173
|
+
onSubmitEditing={(e) => {
|
|
174
|
+
setThumbColorOn(e.nativeEvent.text);
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
<TextInput
|
|
178
|
+
accessibilityLabel="Thumb off color"
|
|
179
|
+
style={commonStyles.textBox}
|
|
180
|
+
placeholder="Thumb off color"
|
|
181
|
+
blurOnSubmit={true}
|
|
182
|
+
onSubmitEditing={(e) => {
|
|
183
|
+
setThumbColorOff(e.nativeEvent.text);
|
|
184
|
+
}}
|
|
185
|
+
/>
|
|
186
|
+
<TextInput
|
|
187
|
+
accessibilityLabel="Thumb size"
|
|
188
|
+
style={commonStyles.textBox}
|
|
189
|
+
placeholder="Thumb size"
|
|
190
|
+
blurOnSubmit={true}
|
|
191
|
+
onSubmitEditing={(e) => {
|
|
192
|
+
setThumbSize(parseInt(e.nativeEvent.text));
|
|
193
|
+
}}
|
|
194
|
+
/>
|
|
195
|
+
<TextInput
|
|
196
|
+
accessibilityLabel="Thumb radius"
|
|
197
|
+
style={commonStyles.textBox}
|
|
198
|
+
placeholder="Thumb radius"
|
|
199
|
+
blurOnSubmit={true}
|
|
200
|
+
onSubmitEditing={(e) => {
|
|
201
|
+
setThumbRadius(parseInt(e.nativeEvent.text));
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
</View>
|
|
205
|
+
</View>
|
|
206
|
+
<View style={styles.tokensRow}>
|
|
207
|
+
<View>
|
|
208
|
+
<Text>Focus Stroke Tokens</Text>
|
|
209
|
+
<TextInput
|
|
210
|
+
accessibilityLabel="Focus stroke color"
|
|
211
|
+
style={commonStyles.textBox}
|
|
212
|
+
placeholder="Focus stroke color"
|
|
213
|
+
blurOnSubmit={true}
|
|
214
|
+
onSubmitEditing={(e) => {
|
|
215
|
+
setFocusStrokeColor(e.nativeEvent.text);
|
|
216
|
+
}}
|
|
217
|
+
/>
|
|
218
|
+
<TextInput
|
|
219
|
+
accessibilityLabel="Focus stroke border radius"
|
|
220
|
+
style={commonStyles.textBox}
|
|
221
|
+
placeholder="Focus stroke border radius"
|
|
222
|
+
blurOnSubmit={true}
|
|
223
|
+
onSubmitEditing={(e) => {
|
|
224
|
+
setFocusBorderRadius(parseInt(e.nativeEvent.text));
|
|
225
|
+
}}
|
|
226
|
+
/>
|
|
227
|
+
<TextInput
|
|
228
|
+
accessibilityLabel="Focus stroke border width"
|
|
229
|
+
style={commonStyles.textBox}
|
|
230
|
+
placeholder="Focus stroke border width"
|
|
231
|
+
blurOnSubmit={true}
|
|
232
|
+
onSubmitEditing={(e) => {
|
|
233
|
+
setFocusBorderWidth(parseInt(e.nativeEvent.text));
|
|
234
|
+
}}
|
|
235
|
+
/>
|
|
236
|
+
</View>
|
|
237
|
+
<View>
|
|
238
|
+
<Text>Other Tokens</Text>
|
|
239
|
+
<TextInput
|
|
240
|
+
accessibilityLabel="Minimum width"
|
|
241
|
+
style={commonStyles.textBox}
|
|
242
|
+
placeholder="Minimum width"
|
|
243
|
+
blurOnSubmit={true}
|
|
244
|
+
onSubmitEditing={(e) => {
|
|
245
|
+
setMinWidth(parseInt(e.nativeEvent.text));
|
|
246
|
+
}}
|
|
247
|
+
/>
|
|
248
|
+
<TextInput
|
|
249
|
+
accessibilityLabel="Minimum height"
|
|
250
|
+
style={commonStyles.textBox}
|
|
251
|
+
placeholder="Minimum height"
|
|
252
|
+
blurOnSubmit={true}
|
|
253
|
+
onSubmitEditing={(e) => {
|
|
254
|
+
setMinHeight(parseInt(e.nativeEvent.text));
|
|
255
|
+
}}
|
|
256
|
+
/>
|
|
257
|
+
<TextInput
|
|
258
|
+
accessibilityLabel="Padding"
|
|
259
|
+
style={commonStyles.textBox}
|
|
260
|
+
placeholder="Padding"
|
|
261
|
+
blurOnSubmit={true}
|
|
262
|
+
onSubmitEditing={(e) => {
|
|
263
|
+
setPadding(parseInt(e.nativeEvent.text));
|
|
264
|
+
}}
|
|
265
|
+
/>
|
|
266
|
+
<TextInput
|
|
267
|
+
accessibilityLabel="Text colors"
|
|
268
|
+
style={commonStyles.textBox}
|
|
269
|
+
placeholder="Text colors"
|
|
270
|
+
blurOnSubmit={true}
|
|
271
|
+
onSubmitEditing={(e) => {
|
|
272
|
+
setColor(e.nativeEvent.text);
|
|
273
|
+
}}
|
|
274
|
+
/>
|
|
275
|
+
</View>
|
|
276
|
+
</View>
|
|
277
|
+
|
|
278
|
+
<CustomSwitch label="Custom Switch" onText="On" offText="Off" accessibilityLabel="Custom Switch" />
|
|
279
|
+
</View>
|
|
280
|
+
);
|
|
281
|
+
};
|
|
@@ -7,6 +7,7 @@ import { E2ESwitchTest } from './E2ESwitchTest';
|
|
|
7
7
|
import { commonTestStyles } from '../Common/styles';
|
|
8
8
|
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
9
9
|
import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
|
|
10
|
+
import { CustomizedSwitch } from './CustomizedSwitch';
|
|
10
11
|
|
|
11
12
|
const styles = StyleSheet.create({
|
|
12
13
|
square: {
|
|
@@ -104,6 +105,10 @@ const toggleSections: TestSection[] = [
|
|
|
104
105
|
name: 'On/Off Text',
|
|
105
106
|
component: () => <OnOffText />,
|
|
106
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: 'Customized Tokens',
|
|
110
|
+
component: () => <CustomizedSwitch />,
|
|
111
|
+
},
|
|
107
112
|
{
|
|
108
113
|
name: 'Switch E2E Testing',
|
|
109
114
|
component: () => <E2ESwitchTest />,
|