@solidx/checkbox 0.0.0-stage → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/NuGet.config +11 -0
  3. package/RNCCheckbox.podspec +22 -0
  4. package/android/build.gradle +65 -0
  5. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  6. package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  7. package/android/gradle.properties +4 -0
  8. package/android/gradlew +172 -0
  9. package/android/gradlew.bat +84 -0
  10. package/android/src/main/AndroidManifest.xml +5 -0
  11. package/android/src/main/java/com/reactnativecommunity/checkbox/ReactCheckBox.java +43 -0
  12. package/android/src/main/java/com/reactnativecommunity/checkbox/ReactCheckBoxEvent.java +47 -0
  13. package/android/src/main/java/com/reactnativecommunity/checkbox/ReactCheckBoxManager.java +128 -0
  14. package/android/src/main/java/com/reactnativecommunity/checkbox/ReactCheckBoxPackage.java +29 -0
  15. package/dist/js/AndroidCheckBoxNativeComponent.d.ts +2 -0
  16. package/dist/js/AndroidCheckBoxNativeComponent.js +11 -0
  17. package/dist/js/CheckBox.android.d.ts +83 -0
  18. package/dist/js/CheckBox.android.js +162 -0
  19. package/dist/js/CheckBox.d.ts +5 -0
  20. package/dist/js/CheckBox.ios.d.ts +92 -0
  21. package/dist/js/CheckBox.ios.js +109 -0
  22. package/dist/js/CheckBox.js +27 -0
  23. package/dist/js/CheckBox.windows.d.ts +95 -0
  24. package/dist/js/CheckBox.windows.js +95 -0
  25. package/dist/js/CheckboxNativeComponent.d.ts +11 -0
  26. package/dist/js/CheckboxNativeComponent.js +22 -0
  27. package/dist/js/IOSCheckBoxNativeComponent.d.ts +2 -0
  28. package/dist/js/IOSCheckBoxNativeComponent.js +11 -0
  29. package/dist/js/NativeCheckboxModule.d.ts +11 -0
  30. package/dist/js/NativeCheckboxModule.js +10 -0
  31. package/dist/js/RNCCheckboxNativeComponent.d.ts +48 -0
  32. package/dist/js/RNCCheckboxNativeComponent.js +12 -0
  33. package/dist/js/index.d.ts +11 -0
  34. package/dist/js/index.js +34 -0
  35. package/dist/js/setAndForwardRef.d.ts +40 -0
  36. package/dist/js/setAndForwardRef.js +53 -0
  37. package/ios/Podfile +3 -0
  38. package/ios/Podfile.lock +16 -0
  39. package/ios/RNCCheckbox.h +16 -0
  40. package/ios/RNCCheckbox.m +13 -0
  41. package/ios/RNCCheckbox.xcodeproj/project.pbxproj +322 -0
  42. package/ios/RNCCheckbox.xcodeproj/xcshareddata/xcschemes/RNCCheckbox.xcscheme +67 -0
  43. package/ios/RNCCheckbox.xcworkspace/contents.xcworkspacedata +10 -0
  44. package/ios/RNCCheckbox.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  45. package/ios/RNCCheckbox.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +10 -0
  46. package/ios/RNCCheckboxManager.h +12 -0
  47. package/ios/RNCCheckboxManager.m +86 -0
  48. package/jest.config.windows.js +3 -0
  49. package/js/AndroidCheckBoxNativeComponent.ts +12 -0
  50. package/js/CheckBox.android.tsx +217 -0
  51. package/js/CheckBox.ios.tsx +175 -0
  52. package/js/CheckBox.ts +9 -0
  53. package/js/CheckBox.windows.tsx +158 -0
  54. package/js/CheckboxNativeComponent.ts +25 -0
  55. package/js/IOSCheckBoxNativeComponent.ts +12 -0
  56. package/js/NativeCheckboxModule.ts +15 -0
  57. package/js/RNCCheckboxNativeComponent.ts +68 -0
  58. package/js/index.ts +17 -0
  59. package/js/setAndForwardRef.ts +64 -0
  60. package/metro.config.js +45 -0
  61. package/package.json +84 -4
  62. package/react-native.config.js +22 -0
  63. package/typings/index.d.ts +14 -0
  64. package/windows/Checkbox/Checkbox.cpp +20 -0
  65. package/windows/Checkbox/Checkbox.def +3 -0
  66. package/windows/Checkbox/Checkbox.h +26 -0
  67. package/windows/Checkbox/Checkbox.rc +0 -0
  68. package/windows/Checkbox/Checkbox.vcxproj +146 -0
  69. package/windows/Checkbox/Checkbox.vcxproj.filters +56 -0
  70. package/windows/Checkbox/CheckboxView.cpp +186 -0
  71. package/windows/Checkbox/CheckboxView.h +59 -0
  72. package/windows/Checkbox/ReactPackageProvider.cpp +24 -0
  73. package/windows/Checkbox/ReactPackageProvider.h +24 -0
  74. package/windows/Checkbox/ReactPackageProvider.idl +9 -0
  75. package/windows/Checkbox/codegen/.clang-format +2 -0
  76. package/windows/Checkbox/codegen/NativeCheckboxModuleSpec.g.h +31 -0
  77. package/windows/Checkbox/codegen_manual/react/components/RNCCheckboxSpec/RNCCheckbox.g.h +232 -0
  78. package/windows/Checkbox/packages.lock.json +151 -0
  79. package/windows/Checkbox/pch.cpp +1 -0
  80. package/windows/Checkbox/pch.h +43 -0
  81. package/windows/Checkbox/resource.h +5 -0
  82. package/windows/Checkbox/targetver.h +8 -0
  83. package/windows/Checkbox.sln +43 -0
  84. package/windows/ExperimentalFeatures.props +33 -0
  85. package/README.md +0 -3
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ 'use strict';
8
+
9
+ import React from 'react';
10
+ import {
11
+ StyleSheet,
12
+ ViewProps,
13
+ HostInstance,
14
+ NativeSyntheticEvent,
15
+ } from 'react-native';
16
+ import RNCCheckboxNativeComponent from './RNCCheckboxNativeComponent';
17
+ // @ts-ignore setAndForwardRef type does not exist in @types/react-native
18
+ import setAndForwardRef from './setAndForwardRef';
19
+
20
+ type CheckBoxEvent = NativeSyntheticEvent<
21
+ Readonly<{
22
+ value: boolean;
23
+ }>
24
+ >;
25
+
26
+ type CheckBoxNativeType = HostInstance;
27
+
28
+ export type Props = Readonly<
29
+ ViewProps & {
30
+ /**
31
+ * Used to get the ref for the native checkbox
32
+ */
33
+ forwardedRef?: React.Ref<CheckBoxNativeType>;
34
+
35
+ /**
36
+ * The value of the checkbox. If true the checkbox will be turned on.
37
+ * Default value is false.
38
+ */
39
+ value?: boolean;
40
+
41
+ /**
42
+ * If true the user won't be able to toggle the checkbox.
43
+ * Default value is false.
44
+ */
45
+ disabled?: boolean;
46
+
47
+ /**
48
+ * Used in case the props change removes the component.
49
+ */
50
+ onChange?: (event: CheckBoxEvent) => void;
51
+
52
+ /**
53
+ * Invoked with the new value when the value changes.
54
+ */
55
+ onValueChange?: (value: boolean) => void;
56
+
57
+ /**
58
+ * Used to set the color of the box when unchecked.
59
+ */
60
+ tintColor?: string;
61
+
62
+ /**
63
+ * Used to set the color of the check mark when the checkbox is checked.
64
+ */
65
+ onCheckColor?: string;
66
+
67
+ /**
68
+ * Used to set the tint color of the checkbox border when it is checked.
69
+ */
70
+ onTintColor?: string;
71
+
72
+ /**
73
+ * Used to set the fill color of the checkbox when it is checked.
74
+ */
75
+ onFillColor?: string;
76
+
77
+ /**
78
+ * Used to locate this view in end-to-end tests.
79
+ */
80
+ testID?: string;
81
+ }
82
+ >;
83
+
84
+ /**
85
+ * Renders a boolean checkbox input (Windows).
86
+ *
87
+ * This is a controlled component that requires an `onValueChange` callback that
88
+ * updates the `value` prop in order for the component to reflect user actions.
89
+ * If the `value` prop is not updated, the component will continue to render
90
+ * the supplied `value` prop instead of the expected result of any user actions.
91
+ */
92
+ class CheckBox extends React.Component<Props> {
93
+ _nativeRef: React.Ref<CheckBoxNativeType> | null = null;
94
+ _setNativeRef = setAndForwardRef({
95
+ getForwardedRef: () => this.props.forwardedRef,
96
+ setLocalRef: (ref: any) => {
97
+ this._nativeRef = ref;
98
+ },
99
+ });
100
+
101
+ _onChange = (event: CheckBoxEvent) => {
102
+ const {onChange, onValueChange} = this.props;
103
+
104
+ onChange && onChange(event);
105
+ onValueChange && onValueChange(event.nativeEvent.value);
106
+ };
107
+
108
+ render() {
109
+ const {
110
+ style,
111
+ value,
112
+ disabled,
113
+ tintColor,
114
+ onCheckColor,
115
+ onTintColor,
116
+ onFillColor,
117
+ testID,
118
+ ...props
119
+ } = this.props;
120
+
121
+ return (
122
+ <RNCCheckboxNativeComponent
123
+ {...props}
124
+ testID={testID}
125
+ value={value ?? false}
126
+ disabled={disabled ?? false}
127
+ tintColor={tintColor}
128
+ onCheckColor={onCheckColor}
129
+ onTintColor={onTintColor}
130
+ onFillColor={onFillColor}
131
+ style={[styles.rctCheckBox, style]}
132
+ ref={this._setNativeRef}
133
+ onChange={this._onChange}
134
+ />
135
+ );
136
+ }
137
+ }
138
+
139
+ const styles = StyleSheet.create({
140
+ rctCheckBox: {
141
+ height: 32,
142
+ width: 32,
143
+ },
144
+ });
145
+
146
+ /**
147
+ * Can't use CheckBoxNativeType because it has different props
148
+ */
149
+ type CheckBoxType = HostInstance;
150
+
151
+ const CheckBoxWithRef = React.forwardRef(function CheckBoxWithRef(
152
+ props: Props,
153
+ ref: React.Ref<CheckBoxType>,
154
+ ) {
155
+ return <CheckBox {...props} forwardedRef={ref} />;
156
+ });
157
+
158
+ export default CheckBoxWithRef;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ import type {HostComponent} from 'react-native';
13
+ import {Platform} from 'react-native';
14
+
15
+ let CheckboxNativeComponent: HostComponent<any>;
16
+
17
+ if (Platform.OS === 'android') {
18
+ CheckboxNativeComponent = require('./AndroidCheckBoxNativeComponent').default;
19
+ } else if (Platform.OS === 'windows') {
20
+ CheckboxNativeComponent = require('./RNCCheckboxNativeComponent').default;
21
+ } else {
22
+ CheckboxNativeComponent = require('./IOSCheckBoxNativeComponent').default;
23
+ }
24
+
25
+ export default CheckboxNativeComponent;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ 'use strict';
9
+
10
+ import {requireNativeComponent} from 'react-native';
11
+
12
+ export default requireNativeComponent('RNCCheckbox');
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ import type {TurboModule} from 'react-native';
11
+ import {TurboModuleRegistry} from 'react-native';
12
+
13
+ export interface Spec extends TurboModule {}
14
+
15
+ export default TurboModuleRegistry.get<Spec>('Checkbox') as Spec | null;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ import type {
11
+ ViewProps,
12
+ ColorValue,
13
+ HostComponent,
14
+ CodegenTypes,
15
+ } from 'react-native';
16
+ import {codegenNativeComponent} from 'react-native';
17
+
18
+ type CheckBoxChangeEvent = Readonly<{
19
+ value: boolean;
20
+ }>;
21
+
22
+ export interface RNCCheckboxNativeProps extends ViewProps {
23
+ /**
24
+ * If true the user won't be able to toggle the checkbox.
25
+ * Default value is false.
26
+ */
27
+ disabled?: CodegenTypes.WithDefault<boolean, false>;
28
+
29
+ /**
30
+ * The value of the checkbox. If true the checkbox will be turned on.
31
+ * Default value is false.
32
+ */
33
+ value?: CodegenTypes.WithDefault<boolean, false>;
34
+
35
+ /**
36
+ * Used to set the color of the checkbox when it is disabled.
37
+ */
38
+ tintColor?: ColorValue;
39
+
40
+ /**
41
+ * Used to set the color of the check mark when the checkbox is checked.
42
+ */
43
+ onCheckColor?: ColorValue;
44
+
45
+ /**
46
+ * Used to set the tint color of the checkbox when it is checked.
47
+ */
48
+ onTintColor?: ColorValue;
49
+
50
+ /**
51
+ * Used to set the fill color of the checkbox when it is checked.
52
+ */
53
+ onFillColor?: ColorValue;
54
+
55
+ /**
56
+ * The label to display next to the checkbox.
57
+ */
58
+ label?: string;
59
+
60
+ /**
61
+ * Called when the checkbox value changes.
62
+ */
63
+ onChange?: CodegenTypes.BubblingEventHandler<CheckBoxChangeEvent>;
64
+ }
65
+
66
+ export default codegenNativeComponent<RNCCheckboxNativeProps>('RNCCheckbox', {
67
+ excludedPlatforms: ['iOS', 'android'],
68
+ }) as HostComponent<RNCCheckboxNativeProps>;
package/js/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+
8
+ // Re-export everything from CheckBox.ts
9
+ export * from './CheckBox';
10
+
11
+ // Export the native component and its types (for Windows/New Architecture)
12
+ export {default as RNCCheckbox} from './RNCCheckboxNativeComponent';
13
+ export type {RNCCheckboxNativeProps} from './RNCCheckboxNativeComponent';
14
+
15
+ // Re-export the native module for direct access
16
+ export {default as NativeCheckboxModule} from './NativeCheckboxModule';
17
+ export type {Spec as NativeCheckboxModuleSpec} from './NativeCheckboxModule';
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Imported from RN .71
3
+ */
4
+
5
+ import type {ElementRef} from 'react';
6
+
7
+ type Args = {
8
+ getForwardedRef: () => React.Ref<any> | undefined;
9
+ setLocalRef: (ref: ElementRef<any>) => any;
10
+ };
11
+
12
+ /**
13
+ * This is a helper function for when a component needs to be able to forward a ref
14
+ * to a child component, but still needs to have access to that component as part of
15
+ * its implementation.
16
+ *
17
+ * Its main use case is in wrappers for native components.
18
+ *
19
+ * Usage:
20
+ *
21
+ * class MyView extends React.Component {
22
+ * _nativeRef = null;
23
+ *
24
+ * _setNativeRef = setAndForwardRef({
25
+ * getForwardedRef: () => this.props.forwardedRef,
26
+ * setLocalRef: ref => {
27
+ * this._nativeRef = ref;
28
+ * },
29
+ * });
30
+ *
31
+ * render() {
32
+ * return <View ref={this._setNativeRef} />;
33
+ * }
34
+ * }
35
+ *
36
+ * const MyViewWithRef = React.forwardRef((props, ref) => (
37
+ * <MyView {...props} forwardedRef={ref} />
38
+ * ));
39
+ *
40
+ * module.exports = MyViewWithRef;
41
+ */
42
+
43
+ function setAndForwardRef({
44
+ getForwardedRef,
45
+ setLocalRef,
46
+ }: Args): (ref: ElementRef<any>) => void {
47
+ return function forwardRef(ref: ElementRef<any>) {
48
+ const forwardedRef = getForwardedRef();
49
+
50
+ setLocalRef(ref);
51
+
52
+ // Forward to user ref prop (if one has been specified)
53
+ if (typeof forwardedRef === 'function') {
54
+ // Handle function-based refs. String-based refs are handled as functions.
55
+ forwardedRef(ref);
56
+ } else if (typeof forwardedRef === 'object' && forwardedRef != null) {
57
+ // Handle createRef-based refs
58
+ // @ts-ignore - We need to set current even though it's readonly
59
+ forwardedRef.current = ref;
60
+ }
61
+ };
62
+ }
63
+
64
+ export default setAndForwardRef;
@@ -0,0 +1,45 @@
1
+ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const exclusionList = require('metro-config/src/defaults/exclusionList');
6
+
7
+ const rnwPath = fs.realpathSync(
8
+ path.resolve(require.resolve('react-native-windows/package.json'), '..'),
9
+ );
10
+
11
+ //
12
+
13
+ /**
14
+ * Metro configuration
15
+ * https://facebook.github.io/metro/docs/configuration
16
+ *
17
+ * @type {import('metro-config').MetroConfig}
18
+ */
19
+
20
+ const config = {
21
+ //
22
+ resolver: {
23
+ blockList: exclusionList([
24
+ // This stops "npx @react-native-community/cli run-windows" from causing the metro server to crash if its already running
25
+ new RegExp(
26
+ `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
27
+ ),
28
+ // This prevents "npx @react-native-community/cli run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
29
+ new RegExp(`${rnwPath}/build/.*`),
30
+ new RegExp(`${rnwPath}/target/.*`),
31
+ /.*\.ProjectImports\.zip/,
32
+ ]),
33
+ //
34
+ },
35
+ transformer: {
36
+ getTransformOptions: async () => ({
37
+ transform: {
38
+ experimentalImportSupport: false,
39
+ inlineRequires: true,
40
+ },
41
+ }),
42
+ },
43
+ };
44
+
45
+ module.exports = mergeConfig(getDefaultConfig(__dirname), config);
package/package.json CHANGED
@@ -1,6 +1,86 @@
1
1
  {
2
2
  "name": "@solidx/checkbox",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.7.1",
4
+ "description": "React Native Checkbox native modules for Android, iOS, and Windows",
5
+ "keywords": ["checkbox", "react native", "react-native"],
6
+ "homepage": "https://github.com/dsolimando/react-native-checkbox#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dsolimando/react-native-checkbox.git"
10
+ },
11
+ "license": "MIT",
12
+ "author": "Nicholas Lee <nicholaslee119@gmail.com>",
13
+ "main": "dist/js/CheckBox",
14
+ "types": "typings/index.d.ts",
15
+
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "prepack": "yarn build",
19
+ "windows": "npx @react-native-community/cli run-windows",
20
+ "test:windows": "jest --config jest.config.windows.js"
21
+ },
22
+
23
+ "devDependencies": {
24
+ "@babel/core": "^7.25.0",
25
+ "@eslint/js": "^9.10.0",
26
+ "@react-native/babel-preset": "0.88.1",
27
+ "@react-native/jest-preset": "0.88.1",
28
+ "@testing-library/react-native": "^13.3.3",
29
+ "@types/jest": "^29.5.12",
30
+ "@types/react": "^19.3.0",
31
+ "@types/react-test-renderer": "^19.1.0",
32
+ "babel-plugin-module-resolver": "^5.0.0",
33
+ "detox": "^20.17.0",
34
+ "eslint": "^9.10.0",
35
+ "eslint-config-prettier": "^9.1.0",
36
+ "eslint-plugin-prettier": "^5.2.1",
37
+ "jest": "^29.7.0",
38
+ "typescript-eslint": "^8.20.0",
39
+ "metro-config": "^0.81.0",
40
+ "prettier": "^3.2.5",
41
+ "react": "19.3.0",
42
+ "react-native": "0.88.1",
43
+ "react-native-windows": "0.82.3",
44
+ "react-test-renderer": "19.3.0",
45
+ "typescript": "^5.7.0",
46
+ "xcpretty": "0.2.8001",
47
+ "@rnx-kit/jest-preset": "0.3.0"
48
+ },
49
+
50
+ "peerDependencies": {
51
+ "react": ">=19.3.0",
52
+ "react-native": ">=0.88.1",
53
+ "react-native-windows": ">=0.63"
54
+ },
55
+
56
+ "peerDependenciesMeta": {
57
+ "react-native-windows": {
58
+ "optional": true
59
+ }
60
+ },
61
+
62
+ "codegenConfig": {
63
+ "name": "RNCCheckboxSpec",
64
+ "type": "all",
65
+ "jsSrcsDir": "js",
66
+ "windows": {
67
+ "namespace": "CheckboxCodegen",
68
+ "outputDirectory": "windows/Checkbox/codegen",
69
+ "separateDataTypes": true,
70
+ "modulesWindows": true,
71
+ "componentsWindows": true
72
+ }
73
+ },
74
+
75
+ "publishConfig": {
76
+ "access": "public"
77
+ },
78
+
79
+ "react-native-windows": {
80
+ "init-windows": {
81
+ "name": "Checkbox",
82
+ "namespace": "Checkbox",
83
+ "template": "cpp-lib"
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,22 @@
1
+ // react-native.config.js
2
+ module.exports = {
3
+ dependency: {
4
+ platforms: {
5
+ windows: {
6
+ sourceDir: 'windows',
7
+ solutionFile: 'Checkbox.sln',
8
+ projects: [
9
+ {
10
+ projectFile: 'Checkbox\\Checkbox.vcxproj',
11
+ projectName: 'Checkbox',
12
+ projectLang: 'cpp',
13
+ projectGuid: '{87A42D22-4DC5-4BDD-A12A-C90CD1B75FF6}',
14
+ directDependency: true,
15
+ cppHeaders: ['winrt/Checkbox.h'],
16
+ cppPackageProviders: ['Checkbox::ReactPackageProvider'],
17
+ },
18
+ ],
19
+ },
20
+ },
21
+ },
22
+ };
@@ -0,0 +1,14 @@
1
+ import {Component} from 'react';
2
+ import {HostInstance} from 'react-native';
3
+ import {Props as AndroidProps} from '../dist/js/CheckBox.android';
4
+ import {Props as IOSProps} from '../dist/js/CheckBox.ios';
5
+ import {Props as WindowsProps} from '../dist/js/CheckBox.windows';
6
+
7
+ type Constructor<T> = new (...args: any[]) => T;
8
+
9
+ type CheckBoxProps = AndroidProps & IOSProps & WindowsProps;
10
+
11
+ declare class CheckBoxComponent extends Component<CheckBoxProps> {}
12
+ declare const CheckBoxBase: Constructor<HostInstance> &
13
+ typeof CheckBoxComponent;
14
+ export default class CheckBox extends CheckBoxBase {}
@@ -0,0 +1,20 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "pch.h"
5
+ #include "Checkbox.h"
6
+
7
+ using namespace winrt;
8
+ using namespace winrt::Microsoft::ReactNative;
9
+
10
+ namespace winrt::Checkbox::implementation {
11
+
12
+ void CheckboxModule::Initialize(ReactContext const &reactContext) noexcept {
13
+ m_reactContext = reactContext;
14
+ }
15
+
16
+ void RegisterCheckboxNativeModule(IReactPackageBuilder const &packageBuilder) noexcept {
17
+ AddAttributedModules(packageBuilder, true);
18
+ }
19
+
20
+ } // namespace winrt::Checkbox::implementation
@@ -0,0 +1,3 @@
1
+ EXPORTS
2
+ DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
3
+ DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
@@ -0,0 +1,26 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ #include "pch.h"
7
+ #include <NativeModules.h>
8
+ #include "codegen/NativeCheckboxModuleSpec.g.h"
9
+
10
+ namespace winrt::Checkbox::implementation {
11
+
12
+ REACT_MODULE(CheckboxModule, L"Checkbox")
13
+ struct CheckboxModule {
14
+ using ModuleSpec = CheckboxCodegen::CheckboxModuleSpec;
15
+
16
+ REACT_INIT(Initialize)
17
+ void Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
18
+
19
+ private:
20
+ winrt::Microsoft::ReactNative::ReactContext m_reactContext{nullptr};
21
+ };
22
+
23
+ void RegisterCheckboxNativeModule(
24
+ winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept;
25
+
26
+ } // namespace winrt::Checkbox::implementation
Binary file