Skip to content

Commit 28cfc3f

Browse files
tatchisgny
authored andcommitted
checkbox-bindings
1 parent e8b65aa commit 28cfc3f

File tree

6 files changed

+4876
-0
lines changed

6 files changed

+4876
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Ocaml / Reason / BuckleScript artifacts
2+
.bsb.lock
3+
**/lib/bs
4+
**/lib/ocaml
5+
**/.merlin
6+
7+
# macos crap
8+
.DS_Store
9+
# node
10+
node_modules
11+
# npm unused lock file (we use yarn.lock)
12+
package-lock.json

bsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@reason-react-native/checkbox",
3+
"refmt": 3,
4+
"reason": {
5+
"react-jsx": 3
6+
},
7+
"package-specs": {
8+
"module": "commonjs",
9+
"in-source": true
10+
},
11+
"suffix": ".bs.js",
12+
"sources": [
13+
{
14+
"dir": "src",
15+
"subdirs": false
16+
}
17+
],
18+
"bsc-flags": ["-bs-no-version-header", "-warn-error @a"],
19+
"bs-dependencies": ["reason-react", "reason-react-native"]
20+
}

package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "@reason-react-native/checkbox",
3+
"version": "0.0.1",
4+
"publishConfig": {
5+
"access": "public"
6+
},
7+
"repository": "https://github.com/reason-react-native/checkbox.git",
8+
"license": "MIT",
9+
"keywords": [
10+
"reason",
11+
"reasonml",
12+
"bucklescript",
13+
"react-native",
14+
"react-native-checkbox",
15+
"checkbox"
16+
],
17+
"files": [
18+
"*",
19+
"!.DS_Store",
20+
"!**/*.bs.js",
21+
"!.merlin",
22+
"!lib/bs",
23+
"!lib/ocaml"
24+
],
25+
"scripts": {
26+
"start": "bsb -make-world -w",
27+
"build": "bsb -make-world",
28+
"clean": "bsb -clean-world",
29+
"test": "bsb -clean-world -make-world"
30+
},
31+
"devDependencies": {
32+
"bs-platform": "^5.0.4",
33+
"react": "^16.8.0",
34+
"react-native": "^0.60.0",
35+
"reason-react": "^0.7.0",
36+
"reason-react-native": "^0.60.0",
37+
"@react-native-community/checkbox": "^0.2.0"
38+
},
39+
"peerDependencies": {
40+
"@react-native-community/checkbox": "^0.2.0"
41+
}
42+
}

src/ReactNativeCheckbox.bs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
var NativeElement$ReactNative = require("reason-react-native/src/elements/NativeElement.bs.js");
4+
5+
6+
/* NativeElement-ReactNative Not a pure module */

src/ReactNativeCheckbox.re

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
include ReactNative.NativeElement;
2+
open ReactNative;
3+
4+
type tintColors;
5+
[@bs.obj]
6+
external tintColors:
7+
(~true_: Color.t=?, ~false_: Color.t=?, unit) => tintColors =
8+
"";
9+
10+
type checkBoxEvent =
11+
Event.syntheticEvent({
12+
.
13+
"target": int,
14+
"value": bool,
15+
});
16+
17+
[@react.component] [@bs.module]
18+
external make:
19+
(
20+
~ref: ref=?,
21+
// CheckBox props
22+
~disabled: bool=?,
23+
~onChange: checkBoxEvent => unit=?,
24+
~onValueChange: bool => unit=?,
25+
~value: bool=?,
26+
~tintColors: tintColors=?,
27+
// View props
28+
~accessibilityComponentType: [@bs.string] [
29+
| `none
30+
| `button
31+
| `radiobutton_checked
32+
| `radiobutton_unchecked
33+
]
34+
=?,
35+
~accessibilityElementsHidden: bool=?,
36+
~accessibilityHint: string=?,
37+
~accessibilityIgnoresInvertColors: bool=?,
38+
~accessibilityLabel: string=?,
39+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
40+
~accessibilityRole: [@bs.string] [
41+
| `none
42+
| `button
43+
| `link
44+
| `search
45+
| `image
46+
| `keyboardkey
47+
| `text
48+
| `adjustable
49+
| `header
50+
| `summary
51+
| `imagebutton
52+
]
53+
=?,
54+
~accessibilityStates: array(AccessibilityState.t)=?,
55+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
56+
~accessibilityViewIsModal: bool=?,
57+
~accessible: bool=?,
58+
~collapsable: bool=?,
59+
~hitSlop: View.edgeInsets=?,
60+
~importantForAccessibility: [@bs.string] [
61+
| `auto
62+
| `yes
63+
| `no
64+
| [@bs.as "no-hide-descendants"]
65+
`noHideDescendants
66+
]
67+
=?,
68+
~nativeID: string=?,
69+
~needsOffscreenAlphaCompositing: bool=?,
70+
~onAccessibilityEscape: unit => unit=?,
71+
~onAccessibilityTap: unit => unit=?,
72+
~onLayout: Event.layoutEvent => unit=?,
73+
~onMagicTap: unit => unit=?,
74+
// Gesture Responder props
75+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
76+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
77+
~onResponderEnd: Event.pressEvent => unit=?,
78+
~onResponderGrant: Event.pressEvent => unit=?,
79+
~onResponderMove: Event.pressEvent => unit=?,
80+
~onResponderReject: Event.pressEvent => unit=?,
81+
~onResponderRelease: Event.pressEvent => unit=?,
82+
~onResponderStart: Event.pressEvent => unit=?,
83+
~onResponderTerminate: Event.pressEvent => unit=?,
84+
~onResponderTerminationRequest: Event.pressEvent => bool=?,
85+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
86+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
87+
~pointerEvents: [@bs.string] [
88+
| `auto
89+
| `none
90+
| [@bs.as "box-none"] `boxNone
91+
| [@bs.as "box-only"] `boxOnly
92+
]
93+
=?,
94+
~removeClippedSubviews: bool=?,
95+
~renderToHardwareTextureAndroid: bool=?,
96+
~shouldRasterizeIOS: bool=?,
97+
~style: Style.t=?,
98+
~testID: string=?
99+
) =>
100+
React.element =
101+
"@react-native-community/checkbox";

0 commit comments

Comments
 (0)