Skip to content

Commit 5969643

Browse files
broerjuangMoOx
authored andcommitted
Binding for react native slider (#1)
* initial commit * make step optional
1 parent 88a17b1 commit 5969643

File tree

6 files changed

+232
-0
lines changed

6 files changed

+232
-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/slider",
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/slider",
3+
"version": "0.0.1",
4+
"publishConfig": {
5+
"access": "public"
6+
},
7+
"author": "broerjuang (https://github.com/broerjuang)",
8+
"repository": "https://github.com/reason-react-native/slider.git",
9+
"license": "MIT",
10+
"keywords": [
11+
"reason",
12+
"reasonml",
13+
"bucklescript",
14+
"react-native",
15+
"react-native-slider",
16+
"slider"
17+
],
18+
"files": [
19+
"*",
20+
"!.DS_Store",
21+
"!**/*.bs.js",
22+
"!.merlin",
23+
"!lib/bs",
24+
"!lib/ocaml"
25+
],
26+
"scripts": {
27+
"start": "bsb -make-world -w",
28+
"build": "bsb -make-world",
29+
"clean": "bsb -clean-world",
30+
"test": "bsb -clean-world -make-world"
31+
},
32+
"devDependencies": {
33+
"@react-native-community/slider": "^2.0.0",
34+
"bs-platform": "^5.0.4",
35+
"reason-react": ">=0.7.0",
36+
"reason-react-native": "^0.60.0"
37+
},
38+
"peerDependencies": {
39+
"@react-native-community/slider": "^2.0.0",
40+
"reason-react": ">=0.7.0"
41+
}
42+
}

src/ReactNativeSlider.bs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

src/ReactNativeSlider.re

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[@bs.module] [@react.component]
2+
external make:
3+
(
4+
~style: ReactNative.Style.t=?,
5+
~value: int=?,
6+
~step: int=?,
7+
~minimumValue: int=?,
8+
~maximumValue: int=?,
9+
~minimumTrackTintColor: string=?,
10+
~maximumTrackTintColor: string=?,
11+
~disabled: bool=?,
12+
~onSlidingStart: int => unit=?,
13+
~onSlidingComplete: int => unit=?,
14+
~onValueChange: int => unit=?,
15+
~testID: string=?,
16+
~children: React.element=?,
17+
// IOS Props
18+
~maximumTrackImage: ReactNative.Image.Source.t=?,
19+
~minimumTrackImage: ReactNative.Image.Source.t=?,
20+
~thumbImage: ReactNative.Image.Source.t=?,
21+
~trackImage: ReactNative.Image.Source.t=?,
22+
~inverted: bool=?,
23+
// Android
24+
~thumbTintColor: string=?,
25+
// View Props: https://github.com/reasonml-community/reason-react-native/blob/master/reason-react-native/src/components/View.re#L14-L60
26+
~accessibilityComponentType: [@bs.string] [
27+
| `none
28+
| `button
29+
| `radiobutton_checked
30+
| `radiobutton_unchecked
31+
]
32+
=?,
33+
~accessibilityElementsHidden: bool=?,
34+
~accessibilityHint: string=?,
35+
~accessibilityIgnoresInvertColors: bool=?,
36+
~accessibilityLabel: string=?,
37+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
38+
~accessibilityRole: [@bs.string] [
39+
| `none
40+
| `button
41+
| `link
42+
| `search
43+
| `image
44+
| `keyboardkey
45+
| `text
46+
| `adjustable
47+
| `header
48+
| `summary
49+
| `imagebutton
50+
]
51+
=?,
52+
~accessibilityStates: array(ReactNative.AccessibilityState.t)=?,
53+
~accessibilityTraits: array(ReactNative.AccessibilityTrait.t)=?,
54+
~accessibilityViewIsModal: bool=?,
55+
~accessible: bool=?,
56+
~collapsable: bool=?,
57+
~hitSlop: ReactNative.View.edgeInsets=?,
58+
~importantForAccessibility: [@bs.string] [
59+
| `auto
60+
| `yes
61+
| `no
62+
| [@bs.as "no-hide-descendants"]
63+
`noHideDescendants
64+
]
65+
=?,
66+
~nativeID: string=?,
67+
~needsOffscreenAlphaCompositing: bool=?,
68+
~onAccessibilityEscape: unit => unit=?,
69+
~onAccessibilityTap: unit => unit=?,
70+
~onLayout: ReactNative.Event.layoutEvent => unit=?,
71+
~onMagicTap: unit => unit=?
72+
) =>
73+
React.element =
74+
"@react-native-community/slider";

yarn.lock

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
"@react-native-community/slider@^2.0.0":
6+
version "2.0.0"
7+
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-2.0.0.tgz#3d68f68db185fb44d812f66d05d2d7842adfd3db"
8+
integrity sha512-ORokHwQnwXzas+PYQO+G8IxArRVtw2xZdx2C0wV+oQiKbhDl8DBcM6gGT6dNB3VGxVNesWX/3K0IIfVjp4zH0A==
9+
10+
bs-platform@^5.0.4:
11+
version "5.0.6"
12+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.0.6.tgz#88c13041fb020479800de3d82c680bf971091425"
13+
14+
"js-tokens@^3.0.0 || ^4.0.0":
15+
version "4.0.0"
16+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
17+
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
18+
19+
loose-envify@^1.1.0, loose-envify@^1.4.0:
20+
version "1.4.0"
21+
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
22+
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
23+
dependencies:
24+
js-tokens "^3.0.0 || ^4.0.0"
25+
26+
object-assign@^4.1.1:
27+
version "4.1.1"
28+
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
29+
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
30+
31+
prop-types@^15.6.2:
32+
version "15.7.2"
33+
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
34+
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
35+
dependencies:
36+
loose-envify "^1.4.0"
37+
object-assign "^4.1.1"
38+
react-is "^16.8.1"
39+
40+
react-dom@>=16.8.1:
41+
version "16.9.0"
42+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.9.0.tgz#5e65527a5e26f22ae3701131bcccaee9fb0d3962"
43+
integrity sha512-YFT2rxO9hM70ewk9jq0y6sQk8cL02xm4+IzYBz75CQGlClQQ1Bxq0nhHF6OtSbit+AIahujJgb/CPRibFkMNJQ==
44+
dependencies:
45+
loose-envify "^1.1.0"
46+
object-assign "^4.1.1"
47+
prop-types "^15.6.2"
48+
scheduler "^0.15.0"
49+
50+
react-is@^16.8.1:
51+
version "16.9.0"
52+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
53+
integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==
54+
55+
react@>=16.8.1:
56+
version "16.9.0"
57+
resolved "https://registry.yarnpkg.com/react/-/react-16.9.0.tgz#40ba2f9af13bc1a38d75dbf2f4359a5185c4f7aa"
58+
integrity sha512-+7LQnFBwkiw+BobzOF6N//BdoNw0ouwmSJTEm9cglOOmsg/TMiFHZLe2sEoN5M7LgJTj9oHH0gxklfnQe66S1w==
59+
dependencies:
60+
loose-envify "^1.1.0"
61+
object-assign "^4.1.1"
62+
prop-types "^15.6.2"
63+
64+
reason-react-native@^0.60.0:
65+
version "0.60.0"
66+
resolved "https://registry.yarnpkg.com/reason-react-native/-/reason-react-native-0.60.0.tgz#7adb9837f28d79d9f1e009b5d01ae864aff15d51"
67+
integrity sha512-7vq7KIaY1kGb5xnWVewuy8ttBx7/HAgeKfiwDYV3rij6Z89vU6QIheR6rENV8UxaKwRN/Gw168ladWLM042k9A==
68+
69+
reason-react@>=0.7.0:
70+
version "0.7.0"
71+
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.7.0.tgz#46a975c321e81cd51310d7b1a02418ca7667b0d6"
72+
integrity sha512-czR/f0lY5iyLCki9gwftOFF5Zs40l7ZSFmpGK/Z6hx2jBVeFDmIiXB8bAQW/cO6IvtuEt97OmsYueiuOYG9XjQ==
73+
dependencies:
74+
react ">=16.8.1"
75+
react-dom ">=16.8.1"
76+
77+
scheduler@^0.15.0:
78+
version "0.15.0"
79+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.15.0.tgz#6bfcf80ff850b280fed4aeecc6513bc0b4f17f8e"
80+
integrity sha512-xAefmSfN6jqAa7Kuq7LIJY0bwAPG3xlCj0HMEBQk1lxYiDKZscY2xJ5U/61ZTrYbmNQbXa+gc7czPkVo11tnCg==
81+
dependencies:
82+
loose-envify "^1.1.0"
83+
object-assign "^4.1.1"

0 commit comments

Comments
 (0)