@fluentui-react-native/tester 0.170.12 → 0.170.14
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 +35 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxV1Test.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/CheckboxV1Test.tsx"],"names":[],"mappings":";;;;AAAA,mDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"CheckboxV1Test.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/CheckboxV1Test.tsx"],"names":[],"mappings":";;;;AAAA,mDAA+B;A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AAgB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAI,CAAC;AACzI,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DesktopSpecificCheckboxTest.d.ts","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAQ3C,CAAC"}
|
package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DesktopSpecificCheckbox = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var experimental_checkbox_1 = require("@fluentui-react-native/experimental-checkbox");
|
|
7
|
+
var DesktopSpecificCheckbox = function () {
|
|
8
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
9
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "Checkbox will display a tooltip", tooltip: "This is a tooltip" }),
|
|
10
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "A circular checkbox", shape: "circular" }),
|
|
11
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "A checkbox with label placed before", labelPosition: "before" })));
|
|
12
|
+
};
|
|
13
|
+
exports.DesktopSpecificCheckbox = DesktopSpecificCheckbox;
|
|
14
|
+
//# sourceMappingURL=DesktopSpecificCheckboxTest.js.map
|
package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DesktopSpecificCheckboxTest.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/DesktopSpecificCheckboxTest.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,sFAAwE;AAEjE,IAAM,uBAAuB,GAA4B;IAC9D,OAAO,CACL;QACE,8BAAC,gCAAQ,IAAC,KAAK,EAAC,iCAAiC,EAAC,OAAO,EAAC,mBAAmB,GAAG;QAChF,8BAAC,gCAAQ,IAAC,KAAK,EAAC,qBAAqB,EAAC,KAAK,EAAC,UAAU,GAAG;QACzD,8BAAC,gCAAQ,IAAC,KAAK,EAAC,qCAAqC,EAAC,aAAa,EAAC,QAAQ,GAAG,CAC9E,CACJ,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,uBAAuB,2BAQlC"}
|
package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherCheckboxPropsTest.d.ts","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAmDjC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OtherCheckbox = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var react_native_1 = require("react-native");
|
|
7
|
+
var button_1 = require("@fluentui-react-native/button");
|
|
8
|
+
var experimental_checkbox_1 = require("@fluentui-react-native/experimental-checkbox");
|
|
9
|
+
var text_1 = require("@fluentui-react-native/text");
|
|
10
|
+
var styles_1 = require("../Common/styles");
|
|
11
|
+
var pressableStyle = { borderWidth: 1, padding: 4, gap: 4, flexDirection: 'row', alignItems: 'center' };
|
|
12
|
+
var OtherCheckbox = function () {
|
|
13
|
+
var _a = react_1.default.useState(false), isChecked = _a[0], setisChecked = _a[1];
|
|
14
|
+
var setCheckedTrue = react_1.default.useCallback(function () {
|
|
15
|
+
setisChecked(true);
|
|
16
|
+
}, []);
|
|
17
|
+
var setCheckedFalse = react_1.default.useCallback(function () {
|
|
18
|
+
setisChecked(false);
|
|
19
|
+
}, []);
|
|
20
|
+
var onChange = react_1.default.useCallback(function (_e, checked) {
|
|
21
|
+
setisChecked(checked);
|
|
22
|
+
}, []);
|
|
23
|
+
var onPress = react_1.default.useCallback(function () {
|
|
24
|
+
setisChecked(!isChecked);
|
|
25
|
+
}, [isChecked]);
|
|
26
|
+
var memoizedStyles = react_1.default.useMemo(function () { return (react_native_1.Platform.OS === 'android' ? tslib_1.__assign(tslib_1.__assign({}, styles_1.mobileStyles.containerSpacedEvenly), { height: 150 }) : { gap: 8 }); }, []);
|
|
27
|
+
return (react_1.default.createElement(react_native_1.View, { style: memoizedStyles },
|
|
28
|
+
react_1.default.createElement(react_native_1.View, null,
|
|
29
|
+
react_1.default.createElement(button_1.ButtonV1, { onClick: setCheckedTrue, size: "small" }, "Check controlled checkboxes below"),
|
|
30
|
+
react_1.default.createElement(button_1.ButtonV1, { onClick: setCheckedFalse, size: "small" }, "Uncheck controlled checkboxes below")),
|
|
31
|
+
react_1.default.createElement(react_native_1.View, null,
|
|
32
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "This is a controlled Checkbox", checked: isChecked, onChange: onChange }),
|
|
33
|
+
react_1.default.createElement(react_native_1.Pressable, { style: pressableStyle, onPress: onPress },
|
|
34
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { checked: isChecked, onChange: onChange }),
|
|
35
|
+
react_1.default.createElement(text_1.TextV1, null, "A controlled checkbox in a Pressable. Pressing Pressable also toggles Checkbox")),
|
|
36
|
+
react_native_1.Platform.OS !== 'android' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
37
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "Checkbox rendered with labelPosition 'before' (controlled)", labelPosition: "before", checked: isChecked }),
|
|
38
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "A required checkbox with other required text", required: "**" }))))));
|
|
39
|
+
};
|
|
40
|
+
exports.OtherCheckbox = OtherCheckbox;
|
|
41
|
+
//# sourceMappingURL=OtherCheckboxPropsTest.js.map
|
package/lib-commonjs/fluent-tester/src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherCheckboxPropsTest.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/OtherCheckboxPropsTest.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAC1B,6CAAyD;AAGzD,wDAAmE;AACnE,sFAAwE;AACxE,oDAAqD;AAErD,2CAAgD;AAEhD,IAAM,cAAc,GAAc,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAE9G,IAAM,aAAa,GAA4B;IAC9C,IAAA,KAA4B,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAhD,SAAS,QAAA,EAAE,YAAY,QAAyB,CAAC;IAExD,IAAM,cAAc,GAAG,eAAK,CAAC,WAAW,CAAC;QACvC,YAAY,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,eAAe,GAAG,eAAK,CAAC,WAAW,CAAC;QACxC,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,QAAQ,GAAG,eAAK,CAAC,WAAW,CAAC,UAAC,EAAE,EAAE,OAAgB;QACtD,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,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AAC;AACJ,CAAC,CAAC;AAnDW,QAAA,aAAa,iBAmDxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SizeCheckboxTest.d.ts","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/SizeCheckboxTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAShC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SizeCheckbox = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var experimental_checkbox_1 = require("@fluentui-react-native/experimental-checkbox");
|
|
7
|
+
var SizeCheckbox = function () {
|
|
8
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
9
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { tooltip: "Medium checkbox", size: "medium" }),
|
|
10
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { tooltip: "Large checkbox", size: "large" }),
|
|
11
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "Medium checkbox", size: "medium" }),
|
|
12
|
+
react_1.default.createElement(experimental_checkbox_1.Checkbox, { label: "Large checkbox", size: "large" })));
|
|
13
|
+
};
|
|
14
|
+
exports.SizeCheckbox = SizeCheckbox;
|
|
15
|
+
//# sourceMappingURL=SizeCheckboxTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SizeCheckboxTest.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/SizeCheckboxTest.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,sFAAwE;AAEjE,IAAM,YAAY,GAA4B;IACnD,OAAO,CACL;QACE,8BAAC,gCAAQ,IAAC,OAAO,EAAC,iBAAiB,EAAC,IAAI,EAAC,QAAQ,GAAG;QACpD,8BAAC,gCAAQ,IAAC,OAAO,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,GAAG;QAClD,8BAAC,gCAAQ,IAAC,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,QAAQ,GAAG;QAClD,8BAAC,gCAAQ,IAAC,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC/C,CACJ,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenCheckboxTest.d.ts","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/TokenCheckboxTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA8C1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBA2DjC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenCheckbox = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var react_native_1 = require("react-native");
|
|
7
|
+
var experimental_checkbox_1 = require("@fluentui-react-native/experimental-checkbox");
|
|
8
|
+
var theme_types_1 = require("@fluentui-react-native/theme-types");
|
|
9
|
+
var themed_stylesheet_1 = require("@fluentui-react-native/themed-stylesheet");
|
|
10
|
+
var styles_1 = require("../Common/styles");
|
|
11
|
+
function onChangeUncontrolled(_e, isChecked) {
|
|
12
|
+
console.log(isChecked);
|
|
13
|
+
}
|
|
14
|
+
var CircleColorCheckbox = experimental_checkbox_1.Checkbox.customize({
|
|
15
|
+
checked: {
|
|
16
|
+
checkboxBackgroundColor: 'green',
|
|
17
|
+
checkboxBorderColor: 'green',
|
|
18
|
+
checkmarkColor: 'white',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
var HoverCheckbox = experimental_checkbox_1.Checkbox.customize({
|
|
22
|
+
hovered: {
|
|
23
|
+
checkmarkOpacity: 1,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
var BigLabelCheckbox = experimental_checkbox_1.Checkbox.customize({
|
|
27
|
+
label: {
|
|
28
|
+
fontSize: 24,
|
|
29
|
+
fontWeight: 'bold',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
var ComposedCheckbox = experimental_checkbox_1.Checkbox.compose({
|
|
33
|
+
slotProps: {
|
|
34
|
+
label: { style: { color: 'hotpink' } },
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
var getThemedStyles = (0, themed_stylesheet_1.themedStyleSheet)(function (t) {
|
|
38
|
+
return { textbox: tslib_1.__assign(tslib_1.__assign({}, styles_1.commonTestStyles.textBox), { borderColor: t.colors.inputBorder }) };
|
|
39
|
+
});
|
|
40
|
+
var TokenCheckbox = function () {
|
|
41
|
+
var _a = react_1.default.useState('blue'), checkboxColor = _a[0], setCheckboxColor = _a[1];
|
|
42
|
+
var _b = react_1.default.useState('white'), checkmarkColor = _b[0], setCheckmarkColor = _b[1];
|
|
43
|
+
var BlueCheckbox = experimental_checkbox_1.Checkbox.customize({
|
|
44
|
+
checked: {
|
|
45
|
+
checkboxBackgroundColor: checkboxColor,
|
|
46
|
+
checkboxBorderColor: checkboxColor,
|
|
47
|
+
checkmarkColor: checkmarkColor,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
var theme = (0, theme_types_1.useTheme)();
|
|
51
|
+
var textBoxBorderStyle = getThemedStyles(theme);
|
|
52
|
+
return (react_1.default.createElement(react_native_1.View, null,
|
|
53
|
+
react_native_1.Platform.OS !== 'android' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
|
+
react_1.default.createElement(HoverCheckbox, { label: "A checkbox with checkmark visible on hover", onChange: onChangeUncontrolled }),
|
|
55
|
+
react_1.default.createElement(CircleColorCheckbox, { label: "A circular token-customized checkbox", shape: "circular", onChange: onChangeUncontrolled, defaultChecked: true }))),
|
|
56
|
+
react_1.default.createElement(BigLabelCheckbox, { label: "A checkbox with a bold large font label" }),
|
|
57
|
+
react_1.default.createElement(ComposedCheckbox, { label: "A checkbox with a hot pink label and no padding" }),
|
|
58
|
+
react_1.default.createElement(BlueCheckbox, { label: "Token-customized checkbox. Customizable below.", onChange: onChangeUncontrolled, labelPosition: "before", defaultChecked: false }),
|
|
59
|
+
react_1.default.createElement(react_native_1.TextInput, { accessibilityLabel: "Background color", style: textBoxBorderStyle.textbox, placeholder: "Background color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
60
|
+
setCheckboxColor(e.nativeEvent.text);
|
|
61
|
+
} }),
|
|
62
|
+
react_1.default.createElement(react_native_1.TextInput, { accessibilityLabel: "Checkmark color", style: textBoxBorderStyle.textbox, placeholder: "Checkmark color", blurOnSubmit: true, onSubmitEditing: function (e) {
|
|
63
|
+
setCheckmarkColor(e.nativeEvent.text);
|
|
64
|
+
} })));
|
|
65
|
+
};
|
|
66
|
+
exports.TokenCheckbox = TokenCheckbox;
|
|
67
|
+
//# sourceMappingURL=TokenCheckboxTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenCheckboxTest.js","sourceRoot":"","sources":["../../../../../src/TestComponents/CheckboxV1/TokenCheckboxTest.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAC1B,6CAAyD;AAEzD,sFAAwE;AAGxE,kEAA8D;AAC9D,8EAA4E;AAE5E,2CAAoE;AAEpE,SAAS,oBAAoB,CAAC,EAAoB,EAAE,SAAkB;IACpE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB,CAAC;AAED,IAAM,mBAAmB,GAAG,gCAAQ,CAAC,SAAS,CAAC;IAC7C,OAAO,EAAE;QACP,uBAAuB,EAAE,OAAO;QAChC,mBAAmB,EAAE,OAAO;QAC5B,c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AAK,SAAS,IAAI,CAC5B;YACE,8BAAC,aAAa,IAAC,KAAK,EAAC,4CAA4C,EAAC,QAAQ,EAAE,oBAAoB,GAAI;YACpG,8BAAC,mBAAmB,IAClB,KAAK,EAAC,sCAAsC,EAC5C,KAAK,EAAC,UAAU,EAChB,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,SACd,CACD,CACJ;QAED,8BAAC,gBAAgB,IAAC,KAAK,EAAC,yCAAyC,GAAG;QACpE,8BAAC,gBAAgB,IAAC,KAAK,EAAC,iDAAiD,GAAG;QAE5E,8BAAC,YAAY,IACX,KAAK,EAAC,gDAAgD,EACtD,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,EAAC,QAAQ,EACtB,cAAc,EAAE,KAAK,GACrB;QACF,8BAAC,wBAAS,IACR,kBAAkB,EAAC,kBAAkB,EACrC,KAAK,EAAE,kBAAkB,CAAC,OAAO,EACjC,WAAW,EAAC,kBAAkB,EAC9B,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE,UAAC,CAAC;gBACjB,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC,GACD;QAEF,8BAAC,wBAAS,IACR,kBAAkB,EAAC,iBAAiB,EACpC,KAAK,EAAE,kBAAkB,CAAC,OAAO,EACjC,WAAW,EAAC,iBAAiB,EAC7B,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE,UAAC,CAAC;gBACjB,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC,GACD,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,aAAa,iBA2DxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/tester",
|
|
3
|
-
"version": "0.170.
|
|
3
|
+
"version": "0.170.14",
|
|
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>",
|
|
@@ -35,47 +35,47 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@fluentui-react-native/android-theme": "0.25.0",
|
|
37
37
|
"@fluentui-react-native/apple-theme": "0.28.0",
|
|
38
|
-
"@fluentui-react-native/avatar": "1.12.
|
|
39
|
-
"@fluentui-react-native/badge": "0.
|
|
40
|
-
"@fluentui-react-native/button": "0.39.
|
|
41
|
-
"@fluentui-react-native/chip": "0.4.
|
|
38
|
+
"@fluentui-react-native/avatar": "1.12.5",
|
|
39
|
+
"@fluentui-react-native/badge": "0.10.0",
|
|
40
|
+
"@fluentui-react-native/button": "0.39.1",
|
|
41
|
+
"@fluentui-react-native/chip": "0.4.5",
|
|
42
42
|
"@fluentui-react-native/default-theme": "0.26.0",
|
|
43
|
-
"@fluentui-react-native/divider": "0.7.
|
|
44
|
-
"@fluentui-react-native/drawer": "0.4.
|
|
45
|
-
"@fluentui-react-native/dropdown": "0.10.
|
|
43
|
+
"@fluentui-react-native/divider": "0.7.5",
|
|
44
|
+
"@fluentui-react-native/drawer": "0.4.1",
|
|
45
|
+
"@fluentui-react-native/dropdown": "0.10.10",
|
|
46
46
|
"@fluentui-react-native/experimental-activity-indicator": "0.10.1",
|
|
47
47
|
"@fluentui-react-native/experimental-appearance-additions": "0.7.0",
|
|
48
48
|
"@fluentui-react-native/experimental-avatar": "0.21.2",
|
|
49
|
-
"@fluentui-react-native/experimental-checkbox": "0.17.
|
|
49
|
+
"@fluentui-react-native/experimental-checkbox": "0.17.6",
|
|
50
50
|
"@fluentui-react-native/experimental-expander": "0.8.1",
|
|
51
|
-
"@fluentui-react-native/experimental-menu-button": "0.10.
|
|
51
|
+
"@fluentui-react-native/experimental-menu-button": "0.10.14",
|
|
52
52
|
"@fluentui-react-native/experimental-native-date-picker": "0.11.0",
|
|
53
|
-
"@fluentui-react-native/experimental-shadow": "0.6.
|
|
53
|
+
"@fluentui-react-native/experimental-shadow": "0.6.1",
|
|
54
54
|
"@fluentui-react-native/experimental-shimmer": "0.13.3",
|
|
55
55
|
"@fluentui-react-native/framework": "0.14.0",
|
|
56
|
-
"@fluentui-react-native/icon": "0.21.
|
|
57
|
-
"@fluentui-react-native/input": "0.7.
|
|
58
|
-
"@fluentui-react-native/interactive-hooks": "0.27.
|
|
59
|
-
"@fluentui-react-native/menu": "1.14.
|
|
56
|
+
"@fluentui-react-native/icon": "0.21.5",
|
|
57
|
+
"@fluentui-react-native/input": "0.7.5",
|
|
58
|
+
"@fluentui-react-native/interactive-hooks": "0.27.1",
|
|
59
|
+
"@fluentui-react-native/menu": "1.14.16",
|
|
60
60
|
"@fluentui-react-native/merge-props": "0.9.0",
|
|
61
|
-
"@fluentui-react-native/notification": "0.25.
|
|
62
|
-
"@fluentui-react-native/overflow": "0.3.
|
|
63
|
-
"@fluentui-react-native/radio-group": "0.21.
|
|
61
|
+
"@fluentui-react-native/notification": "0.25.8",
|
|
62
|
+
"@fluentui-react-native/overflow": "0.3.16",
|
|
63
|
+
"@fluentui-react-native/radio-group": "0.21.11",
|
|
64
64
|
"@fluentui-react-native/separator": "0.18.0",
|
|
65
|
-
"@fluentui-react-native/spinner": "0.9.
|
|
66
|
-
"@fluentui-react-native/stack": "0.10.
|
|
67
|
-
"@fluentui-react-native/switch": "0.13.
|
|
68
|
-
"@fluentui-react-native/tablist": "0.6.
|
|
69
|
-
"@fluentui-react-native/text": "0.24.
|
|
65
|
+
"@fluentui-react-native/spinner": "0.9.6",
|
|
66
|
+
"@fluentui-react-native/stack": "0.10.4",
|
|
67
|
+
"@fluentui-react-native/switch": "0.13.4",
|
|
68
|
+
"@fluentui-react-native/tablist": "0.6.11",
|
|
69
|
+
"@fluentui-react-native/text": "0.24.3",
|
|
70
70
|
"@fluentui-react-native/theme": "0.11.0",
|
|
71
71
|
"@fluentui-react-native/theme-tokens": "0.27.0",
|
|
72
72
|
"@fluentui-react-native/theme-types": "0.39.0",
|
|
73
73
|
"@fluentui-react-native/themed-stylesheet": "1.7.0",
|
|
74
74
|
"@fluentui-react-native/theming-utils": "0.26.0",
|
|
75
|
-
"@fluentui-react-native/tooltip": "0.4.
|
|
75
|
+
"@fluentui-react-native/tooltip": "0.4.8",
|
|
76
76
|
"@fluentui-react-native/vibrancy-view": "0.2.1",
|
|
77
77
|
"@fluentui-react-native/win32-theme": "0.34.3",
|
|
78
|
-
"@fluentui/react-native": "0.42.
|
|
78
|
+
"@fluentui/react-native": "0.42.5",
|
|
79
79
|
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
80
80
|
"@fortawesome/free-solid-svg-icons": "^6.2.0",
|
|
81
81
|
"@fortawesome/react-native-fontawesome": "^0.3.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@babel/core": "^7.8.0",
|
|
95
95
|
"@babel/runtime": "^7.8.0",
|
|
96
96
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
97
|
-
"@fluentui-react-native/focus-zone": "0.19.
|
|
97
|
+
"@fluentui-react-native/focus-zone": "0.19.3",
|
|
98
98
|
"@fluentui-react-native/scripts": "0.1.1",
|
|
99
99
|
"@react-native/babel-preset": "^0.73.0",
|
|
100
100
|
"@react-native/metro-babel-transformer": "^0.73.0",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
5
|
+
import type { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
|
|
6
|
+
|
|
7
|
+
function onChangeUncontrolled(_e: InteractionEvent, isChecked: boolean) {
|
|
8
|
+
console.log(isChecked);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BasicCheckbox: React.FunctionComponent = () => {
|
|
12
|
+
return (
|
|
13
|
+
<View>
|
|
14
|
+
<Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
|
|
15
|
+
<Checkbox label="Unchecked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked={false} />
|
|
16
|
+
<Checkbox label="Checked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked accessibilityLabel="Hello there" />
|
|
17
|
+
<Checkbox label="Disabled checkbox" disabled />
|
|
18
|
+
<Checkbox label="Disabled checked checkbox" defaultChecked disabled />
|
|
19
|
+
<Checkbox label="A required checkbox" required />
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -1,181 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
5
|
-
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
6
|
-
import type { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
|
|
7
|
-
import type { Theme } from '@fluentui-react-native/theme-types';
|
|
8
|
-
import { useTheme } from '@fluentui-react-native/theme-types';
|
|
9
|
-
import { themedStyleSheet } from '@fluentui-react-native/themed-stylesheet';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
10
3
|
|
|
11
4
|
import { E2ECheckboxV1Test } from './E2ECheckboxV1Test';
|
|
12
5
|
import { CHECKBOXV1_TESTPAGE } from '../../../../E2E/src/CheckboxV1/consts';
|
|
13
|
-
import { commonTestStyles as commonStyles, mobileStyles } from '../Common/styles';
|
|
14
6
|
import type { TestSection, PlatformStatus } from '../Test';
|
|
15
7
|
import { Test } from '../Test';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const BasicCheckbox: React.FunctionComponent = () => {
|
|
22
|
-
return (
|
|
23
|
-
<View>
|
|
24
|
-
<Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
|
|
25
|
-
<Checkbox label="Unchecked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked={false} />
|
|
26
|
-
<Checkbox label="Checked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked accessibilityLabel="Hello there" />
|
|
27
|
-
<Checkbox label="Disabled checkbox" disabled />
|
|
28
|
-
<Checkbox label="Disabled checked checkbox" defaultChecked disabled />
|
|
29
|
-
<Checkbox label="A required checkbox" required />
|
|
30
|
-
</View>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const DesktopSpecificCheckbox: React.FunctionComponent = () => {
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<Checkbox label="Checkbox will display a tooltip" tooltip="This is a tooltip" />
|
|
38
|
-
<Checkbox label="A circular checkbox" shape="circular" />
|
|
39
|
-
<Checkbox label="A checkbox with label placed before" labelPosition="before" />
|
|
40
|
-
</>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const SizeCheckbox: React.FunctionComponent = () => {
|
|
45
|
-
return (
|
|
46
|
-
<View>
|
|
47
|
-
<Checkbox tooltip="Medium checkbox" size="medium" />
|
|
48
|
-
<Checkbox tooltip="Large checkbox" size="large" />
|
|
49
|
-
<Checkbox label="Medium checkbox" size="medium" />
|
|
50
|
-
<Checkbox label="Large checkbox" size="large" />
|
|
51
|
-
</View>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const OtherCheckbox: React.FunctionComponent = () => {
|
|
56
|
-
const [isChecked, setisChecked] = React.useState(false);
|
|
57
|
-
|
|
58
|
-
const setCheckedTrue = React.useCallback(() => {
|
|
59
|
-
setisChecked(true);
|
|
60
|
-
}, []);
|
|
61
|
-
|
|
62
|
-
const setCheckedFalse = React.useCallback(() => {
|
|
63
|
-
setisChecked(false);
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
|
-
const memoizedStyles = React.useMemo(() => (Platform.OS === 'android' ? { ...mobileStyles.containerSpacedEvenly, height: 150 } : {}), []);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<View style={memoizedStyles}>
|
|
70
|
-
<Button onClick={setCheckedTrue} size="small">
|
|
71
|
-
Check controlled checkboxes below
|
|
72
|
-
</Button>
|
|
73
|
-
<Button onClick={setCheckedFalse} size="small">
|
|
74
|
-
Uncheck controlled checkboxes below
|
|
75
|
-
</Button>
|
|
76
|
-
|
|
77
|
-
<Checkbox label="This is a controlled Checkbox" checked={isChecked} />
|
|
78
|
-
{Platform.OS !== 'android' && (
|
|
79
|
-
<>
|
|
80
|
-
<Checkbox label="Checkbox rendered with labelPosition 'before' (controlled)" labelPosition="before" checked={isChecked} />
|
|
81
|
-
<Checkbox label="A required checkbox with other required text" required="**" />
|
|
82
|
-
</>
|
|
83
|
-
)}
|
|
84
|
-
</View>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const CircleColorCheckbox = Checkbox.customize({
|
|
89
|
-
checked: {
|
|
90
|
-
checkboxBackgroundColor: 'green',
|
|
91
|
-
checkboxBorderColor: 'green',
|
|
92
|
-
checkmarkColor: 'white',
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const HoverCheckbox = Checkbox.customize({
|
|
97
|
-
hovered: {
|
|
98
|
-
checkmarkOpacity: 1,
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const BigLabelCheckbox = Checkbox.customize({
|
|
103
|
-
label: {
|
|
104
|
-
fontSize: 24,
|
|
105
|
-
fontWeight: 'bold',
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const ComposedCheckbox = Checkbox.compose({
|
|
110
|
-
slotProps: {
|
|
111
|
-
label: { style: { color: 'hotpink' } },
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
const getThemedStyles = themedStyleSheet((t: Theme) => {
|
|
116
|
-
return { textbox: { ...commonStyles.textBox, borderColor: t.colors.inputBorder } };
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
const TokenCheckbox: React.FunctionComponent = () => {
|
|
120
|
-
const [checkboxColor, setCheckboxColor] = React.useState('blue');
|
|
121
|
-
const [checkmarkColor, setCheckmarkColor] = React.useState('white');
|
|
122
|
-
|
|
123
|
-
const BlueCheckbox = Checkbox.customize({
|
|
124
|
-
checked: {
|
|
125
|
-
checkboxBackgroundColor: checkboxColor,
|
|
126
|
-
checkboxBorderColor: checkboxColor,
|
|
127
|
-
checkmarkColor: checkmarkColor,
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
const theme = useTheme();
|
|
132
|
-
const textBoxBorderStyle = getThemedStyles(theme);
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<View>
|
|
136
|
-
{Platform.OS !== 'android' && (
|
|
137
|
-
<>
|
|
138
|
-
<HoverCheckbox label="A checkbox with checkmark visible on hover" onChange={onChangeUncontrolled} />
|
|
139
|
-
<CircleColorCheckbox
|
|
140
|
-
label="A circular token-customized checkbox"
|
|
141
|
-
shape="circular"
|
|
142
|
-
onChange={onChangeUncontrolled}
|
|
143
|
-
defaultChecked
|
|
144
|
-
/>
|
|
145
|
-
</>
|
|
146
|
-
)}
|
|
147
|
-
|
|
148
|
-
<BigLabelCheckbox label="A checkbox with a bold large font label" />
|
|
149
|
-
<ComposedCheckbox label="A checkbox with a hot pink label and no padding" />
|
|
150
|
-
|
|
151
|
-
<BlueCheckbox
|
|
152
|
-
label="Token-customized checkbox. Customizable below."
|
|
153
|
-
onChange={onChangeUncontrolled}
|
|
154
|
-
labelPosition="before"
|
|
155
|
-
defaultChecked={false}
|
|
156
|
-
/>
|
|
157
|
-
<TextInput
|
|
158
|
-
accessibilityLabel="Background color"
|
|
159
|
-
style={textBoxBorderStyle.textbox}
|
|
160
|
-
placeholder="Background color"
|
|
161
|
-
blurOnSubmit={true}
|
|
162
|
-
onSubmitEditing={(e) => {
|
|
163
|
-
setCheckboxColor(e.nativeEvent.text);
|
|
164
|
-
}}
|
|
165
|
-
/>
|
|
166
|
-
|
|
167
|
-
<TextInput
|
|
168
|
-
accessibilityLabel="Checkmark color"
|
|
169
|
-
style={textBoxBorderStyle.textbox}
|
|
170
|
-
placeholder="Checkmark color"
|
|
171
|
-
blurOnSubmit={true}
|
|
172
|
-
onSubmitEditing={(e) => {
|
|
173
|
-
setCheckmarkColor(e.nativeEvent.text);
|
|
174
|
-
}}
|
|
175
|
-
/>
|
|
176
|
-
</View>
|
|
177
|
-
);
|
|
178
|
-
};
|
|
8
|
+
import { BasicCheckbox } from './BasicCheckboxTest';
|
|
9
|
+
import { DesktopSpecificCheckbox } from './DesktopSpecificCheckboxTest';
|
|
10
|
+
import { OtherCheckbox } from './OtherCheckboxPropsTest';
|
|
11
|
+
import { SizeCheckbox } from './SizeCheckboxTest';
|
|
12
|
+
import { TokenCheckbox } from './TokenCheckboxTest';
|
|
179
13
|
|
|
180
14
|
const checkboxSections: TestSection[] = [
|
|
181
15
|
{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
4
|
+
|
|
5
|
+
export const DesktopSpecificCheckbox: React.FunctionComponent = () => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<Checkbox label="Checkbox will display a tooltip" tooltip="This is a tooltip" />
|
|
9
|
+
<Checkbox label="A circular checkbox" shape="circular" />
|
|
10
|
+
<Checkbox label="A checkbox with label placed before" labelPosition="before" />
|
|
11
|
+
</>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Pressable, View } from 'react-native';
|
|
3
|
+
import type { ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { ButtonV1 as Button } from '@fluentui-react-native/button';
|
|
6
|
+
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
7
|
+
import { TextV1 } from '@fluentui-react-native/text';
|
|
8
|
+
|
|
9
|
+
import { mobileStyles } from '../Common/styles';
|
|
10
|
+
|
|
11
|
+
const pressableStyle: ViewStyle = { borderWidth: 1, padding: 4, gap: 4, flexDirection: 'row', alignItems: 'center' };
|
|
12
|
+
|
|
13
|
+
export const OtherCheckbox: React.FunctionComponent = () => {
|
|
14
|
+
const [isChecked, setisChecked] = React.useState(false);
|
|
15
|
+
|
|
16
|
+
const setCheckedTrue = React.useCallback(() => {
|
|
17
|
+
setisChecked(true);
|
|
18
|
+
}, []);
|
|
19
|
+
|
|
20
|
+
const setCheckedFalse = React.useCallback(() => {
|
|
21
|
+
setisChecked(false);
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const onChange = React.useCallback((_e, checked: boolean) => {
|
|
25
|
+
setisChecked(checked);
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const onPress = React.useCallback(() => {
|
|
29
|
+
setisChecked(!isChecked);
|
|
30
|
+
}, [isChecked]);
|
|
31
|
+
|
|
32
|
+
const memoizedStyles = React.useMemo(
|
|
33
|
+
() => (Platform.OS === 'android' ? { ...mobileStyles.containerSpacedEvenly, height: 150 } : { gap: 8 }),
|
|
34
|
+
[],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<View style={memoizedStyles}>
|
|
39
|
+
<View>
|
|
40
|
+
<Button onClick={setCheckedTrue} size="small">
|
|
41
|
+
Check controlled checkboxes below
|
|
42
|
+
</Button>
|
|
43
|
+
<Button onClick={setCheckedFalse} size="small">
|
|
44
|
+
Uncheck controlled checkboxes below
|
|
45
|
+
</Button>
|
|
46
|
+
</View>
|
|
47
|
+
|
|
48
|
+
<View>
|
|
49
|
+
<Checkbox label="This is a controlled Checkbox" checked={isChecked} onChange={onChange} />
|
|
50
|
+
<Pressable style={pressableStyle} onPress={onPress}>
|
|
51
|
+
<Checkbox checked={isChecked} onChange={onChange} />
|
|
52
|
+
<TextV1>A controlled checkbox in a Pressable. Pressing Pressable also toggles Checkbox</TextV1>
|
|
53
|
+
</Pressable>
|
|
54
|
+
|
|
55
|
+
{Platform.OS !== 'android' && (
|
|
56
|
+
<>
|
|
57
|
+
<Checkbox label="Checkbox rendered with labelPosition 'before' (controlled)" labelPosition="before" checked={isChecked} />
|
|
58
|
+
<Checkbox label="A required checkbox with other required text" required="**" />
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
</View>
|
|
62
|
+
</View>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Checkbox } from '@fluentui-react-native/experimental-checkbox';
|
|
4
|
+
|
|
5
|
+
export const SizeCheckbox: React.FunctionComponent = () => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<Checkbox tooltip="Medium checkbox" size="medium" />
|
|
9
|
+
<Checkbox tooltip="Large checkbox" size="large" />
|
|
10
|
+
<Checkbox label="Medium checkbox" size="medium" />
|
|
11
|
+
<Checkbox label="Large checkbox" size="large" />
|
|
12
|
+
</>
|
|
13
|
+
);
|
|
14
|
+
};
|