@fluentui-react-native/tester 0.170.13 → 0.170.15
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 +41 -0
- package/CHANGELOG.md +11 -1
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.js +16 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.d.ts.map +1 -1
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.js +6 -101
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js +9 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.js +37 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.js +10 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.js +63 -0
- package/lib/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.js +21 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/BasicCheckboxTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.js +10 -104
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/CheckboxV1Test.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js +14 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.js +41 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.js +15 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/SizeCheckboxTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.js +67 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/TokenCheckboxTest.js.map +1 -0
- package/package.json +26 -26
- package/src/TestComponents/CheckboxV1/BasicCheckboxTest.tsx +22 -0
- package/src/TestComponents/CheckboxV1/CheckboxV1Test.tsx +6 -172
- package/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.tsx +13 -0
- package/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.tsx +64 -0
- package/src/TestComponents/CheckboxV1/SizeCheckboxTest.tsx +14 -0
- package/src/TestComponents/CheckboxV1/TokenCheckboxTest.tsx +106 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, TextInput, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
5
|
+
import type { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
|
|
6
|
+
import type { Theme } from '@fluentui-react-native/theme-types';
|
|
7
|
+
import { useTheme } from '@fluentui-react-native/theme-types';
|
|
8
|
+
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
|
|
9
|
+
|
|
10
|
+
import { commonTestStyles as commonStyles } from '../Common/styles';
|
|
11
|
+
|
|
12
|
+
function onChangeUncontrolled(_e: InteractionEvent, isChecked: boolean) {
|
|
13
|
+
console.log(isChecked);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CircleColorCheckbox = Checkbox.customize({
|
|
17
|
+
checked: {
|
|
18
|
+
checkboxBackgroundColor: 'green',
|
|
19
|
+
checkboxBorderColor: 'green',
|
|
20
|
+
checkmarkColor: 'white',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const HoverCheckbox = Checkbox.customize({
|
|
25
|
+
hovered: {
|
|
26
|
+
checkmarkOpacity: 1,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const BigLabelCheckbox = Checkbox.customize({
|
|
31
|
+
label: {
|
|
32
|
+
fontSize: 24,
|
|
33
|
+
fontWeight: 'bold',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const ComposedCheckbox = Checkbox.compose({
|
|
38
|
+
slotProps: {
|
|
39
|
+
label: { style: { color: 'hotpink' } },
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const getThemedStyles = themedStyleSheet((t: Theme) => {
|
|
44
|
+
return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const TokenCheckbox: React.FunctionComponent = () => {
|
|
48
|
+
const [checkboxColor, setCheckboxColor] = React.useState('blue');
|
|
49
|
+
const [checkmarkColor, setCheckmarkColor] = React.useState('white');
|
|
50
|
+
|
|
51
|
+
const BlueCheckbox = Checkbox.customize({
|
|
52
|
+
checked: {
|
|
53
|
+
checkboxBackgroundColor: checkboxColor,
|
|
54
|
+
checkboxBorderColor: checkboxColor,
|
|
55
|
+
checkmarkColor: checkmarkColor,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const theme = useTheme();
|
|
60
|
+
const textBoxBorderStyle = getThemedStyles(theme);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View>
|
|
64
|
+
{Platform.OS !== 'android' && (
|
|
65
|
+
<>
|
|
66
|
+
<HoverCheckbox label="A checkbox with checkmark visible on hover" onChange={onChangeUncontrolled} />
|
|
67
|
+
<CircleColorCheckbox
|
|
68
|
+
label="A circular token-customized checkbox"
|
|
69
|
+
shape="circular"
|
|
70
|
+
onChange={onChangeUncontrolled}
|
|
71
|
+
defaultChecked
|
|
72
|
+
/>
|
|
73
|
+
</>
|
|
74
|
+
)}
|
|
75
|
+
|
|
76
|
+
<BigLabelCheckbox label="A checkbox with a bold large font label" />
|
|
77
|
+
<ComposedCheckbox label="A checkbox with a hot pink label and no padding" />
|
|
78
|
+
|
|
79
|
+
<BlueCheckbox
|
|
80
|
+
label="Token-customized checkbox. Customizable below."
|
|
81
|
+
onChange={onChangeUncontrolled}
|
|
82
|
+
labelPosition="before"
|
|
83
|
+
defaultChecked={false}
|
|
84
|
+
/>
|
|
85
|
+
<TextInput
|
|
86
|
+
accessibilityLabel="Background color"
|
|
87
|
+
style={textBoxBorderStyle.textbox}
|
|
88
|
+
placeholder="Background color"
|
|
89
|
+
blurOnSubmit={true}
|
|
90
|
+
onSubmitEditing={(e) => {
|
|
91
|
+
setCheckboxColor(e.nativeEvent.text);
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<TextInput
|
|
96
|
+
accessibilityLabel="Checkmark color"
|
|
97
|
+
style={textBoxBorderStyle.textbox}
|
|
98
|
+
placeholder="Checkmark color"
|
|
99
|
+
blurOnSubmit={true}
|
|
100
|
+
onSubmitEditing={(e) => {
|
|
101
|
+
setCheckmarkColor(e.nativeEvent.text);
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
};
|