Skip to content

Commit

Permalink
ReScript
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed May 3, 2021
1 parent 28bb6cd commit d08a7ef
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 244 deletions.
3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ node_modules
# npm unused lock file (we use yarn.lock)
package-lock.json

# ReScript / Reason / Ocaml artifacts
#*.bs.js # we do want this files to ensure zero-cost
# ReScript artifacts
# *.bs.js # we do want this files to ensure zero-cost
.bsb.lock
**/lib/bs
**/lib/ocaml
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog of `@reason-react-native/picker`
# Changelog of `@rescript-react-native/picker`

## 1.9.1 - 2020-11-17

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 @reason-react-native contributors
Copyright (c) 2019 @rescript-react-native contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# `@reason-react-native/picker`
# `@rescript-react-native/picker`

[![Build Status](https://github.com/reason-react-native/picker/workflows/Build/badge.svg)](https://github.com/reason-react-native/picker/actions)
[![Version](https://img.shields.io/npm/v/@reason-react-native/picker.svg)](https://www.npmjs.com/@reason-react-native/picker)
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
[![Build Status](https://github.com/rescript-react-native/picker/workflows/Build/badge.svg)](https://github.com/rescript-react-native/picker/actions)
[![Version](https://img.shields.io/npm/v/@rescript-react-native/picker.svg)](https://www.npmjs.com/@rescript-react-native/picker)
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)

[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
[ReScript](https://rescript-lang.org) bindings for
[`@react-native-picker/picker`](https://github.com/react-native-picker/picker).

Exposed as `ReactNativePicker` module.

`@reason-react-native/picker` X.y.\* means it's compatible with
`@rescript-react-native/picker` X.y.\* means it's compatible with
`@react-native-picker/picker` X.y.\*

## Installation
Expand All @@ -20,22 +20,22 @@ is properly installed & configured by following their installation instructions,
you can install the bindings:

```console
npm install @reason-react-native/picker
npm install @rescript-react-native/picker
# or
yarn add @reason-react-native/picker
yarn add @rescript-react-native/picker
```

`@reason-react-native/picker` should be added to `bs-dependencies` in your
`@rescript-react-native/picker` should be added to `bs-dependencies` in your
`bsconfig.json`:

```diff
{
//...
"bs-dependencies": [
"reason-react",
"reason-react-native",
"@rescript/react",
"rescript-react-native",
// ...
+ "@reason-react-native/picker"
+ "@rescript-react-native/picker"
],
//...
}
Expand All @@ -59,7 +59,7 @@ Supported on _Android_ and _iOS_.
| `itemStyle: ReactNative.Style.t` | _iOS only_ <br /> Style to be applied to each item label. <br /> <br /> **Note:** only `Text` style props are supported. |

Please also see
[Reason React Native documentation of `View` props](https://reasonml-community.github.io/reason-react-native/en/docs/components/View/)
[ReScript React Native documentation of `View` props](https://rescript-react-native.github.io/en/docs/components/View/)
for additional supported props.

### `ReactNativePickerIOS` Component
Expand All @@ -75,7 +75,7 @@ Supported on _iOS_.
| `itemStyle: ReactNative.Style.t` | Style to be applied to each item label. <br /> <br /> **Note:** only `Text` style props are supported. |

Please also see
[Reason React Native documentation of `View` props](https://reasonml-community.github.io/reason-react-native/en/docs/components/View/)
[ReScript React Native documentation of `View` props](https://rescript-react-native.github.io/en/docs/components/View/)
for additional supported props.

### `ReactNativePicker.Item` and `ReactNativePickerIOS.Item` Components
Expand All @@ -101,11 +101,11 @@ releases.
## Contribute

Read the
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
before contributing.

## Code of Conduct

We want this community to be friendly and respectful to each other. Please read
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
so that you can understand what actions will and will not be tolerated.
9 changes: 3 additions & 6 deletions bsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@reason-react-native/picker",
"refmt": 3,
"reason": {
"react-jsx": 3
},
"name": "@rescript-react-native/picker",
"reason": { "react-jsx": 3 },
"package-specs": {
"module": "commonjs",
"in-source": true
Expand All @@ -19,5 +16,5 @@
"warnings": {
"error": true
},
"bs-dependencies": ["reason-react", "reason-react-native"]
"bs-dependencies": ["@rescript/react", "rescript-react-native"]
}
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@reason-react-native/picker",
"name": "@rescript-react-native/picker",
"description": "ReScript bindings for @react-native-picker/picker.",
"version": "1.9.1",
"publishConfig": {
Expand All @@ -8,20 +8,18 @@
"peerDependencies": {
"@react-native-picker/picker": "^1.9.0"
},
"repository": "https://github.com/reason-react-native/picker.git",
"repository": "https://github.com/rescript-react-native/picker.git",
"license": "MIT",
"keywords": [
"rescript",
"reason",
"reasonml",
"bucklescript",
"react-native",
"picker"
],
"files": [
"*.md",
"bsconfig.json",
"src/**/*.re",
"src/**/*.res",
"src/**/*.resi",
"src/**/*.js",
"!src/**/*.bs.js"
],
Expand All @@ -38,13 +36,13 @@
"release": "npmpub"
},
"devDependencies": {
"bs-platform": "^8.2.0",
"bs-platform": "^9.0.0",
"husky": "^4.0.0",
"lint-staged": "^10.0.0",
"npmpub": "^5.0.0",
"prettier": "^2.0.0",
"reason-react": "^0.9.0",
"reason-react-native": "^0.63.0"
"@rescript/react": "^0.10.0",
"rescript-react-native": "^0.64.3"
},
"prettier": {
"trailingComma": "all"
Expand Down
2 changes: 1 addition & 1 deletion src/ReactNativePicker.bs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var NativeElement$ReactNative = require("reason-react-native/src/elements/NativeElement.bs.js");
var NativeElement$ReactNative = require("rescript-react-native/src/elements/NativeElement.bs.js");

var Item = {};

Expand Down
99 changes: 0 additions & 99 deletions src/ReactNativePicker.re

This file was deleted.

92 changes: 92 additions & 0 deletions src/ReactNativePicker.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
open ReactNative
include NativeElement

@react.component @module("@react-native-picker/picker")
external make: (
~ref: ref=?,
// Picker props
~onValueChange: ('a, int) => unit=?,
// value == string || float
~selectedValue: 'a=?,
~enabled: bool=?,
// Android only
~dropdownIconColor: string=?,
~mode: [#dialog | #dropdown]=?,
~prompt: string=?,
// iOS only
~itemStyle: ReactNative.Style.t=?,
// rescript-react-native 0.64 View props
~accessibilityActions: array<Accessibility.actionInfo>=?,
~accessibilityElementsHidden: bool=?,
~accessibilityHint: string=?,
~accessibilityIgnoresInvertColors: bool=?,
~accessibilityLabel: string=?,
~accessibilityLiveRegion: Accessibility.liveRegion=?,
~accessibilityRole: Accessibility.role=?,
~accessibilityState: Accessibility.state=?,
~accessibilityValue: Accessibility.value=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
~hitSlop: View.edgeInsets=?,
~importantForAccessibility: @string
[
| #auto
| #yes
| #no
| @as("no-hide-descendants") #noHideDescendants
]=?,
~nativeID: string=?,
~needsOffscreenAlphaCompositing: bool=?,
~onAccessibilityAction: Accessibility.actionEvent => unit=?,
~onAccessibilityEscape: unit => unit=?,
~onAccessibilityTap: unit => unit=?,
~onLayout: Event.layoutEvent => unit=?,
~onMagicTap: unit => unit=?,
// Gesture Responder props
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
~onResponderEnd: Event.pressEvent => unit=?,
~onResponderGrant: Event.pressEvent => unit=?,
~onResponderMove: Event.pressEvent => unit=?,
~onResponderReject: Event.pressEvent => unit=?,
~onResponderRelease: Event.pressEvent => unit=?,
~onResponderStart: Event.pressEvent => unit=?,
~onResponderTerminate: Event.pressEvent => unit=?,
~onResponderTerminationRequest: Event.pressEvent => bool=?,
~onStartShouldSetResponder: Event.pressEvent => bool=?,
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
~pointerEvents: @string
[
| #auto
| #none
| @as("box-none") #boxNone
| @as("box-only") #boxOnly
]=?,
~removeClippedSubviews: bool=?,
~renderToHardwareTextureAndroid: bool=?,
~shouldRasterizeIOS: bool=?,
~style: Style.t=?,
~testID: string=?,
~children: React.element=?,
// react-native-web 0.16 View props
~href: string=?,
~hrefAttrs: Web.hrefAttrs=?,
~onMouseDown: ReactEvent.Mouse.t => unit=?,
~onMouseEnter: ReactEvent.Mouse.t => unit=?,
~onMouseLeave: ReactEvent.Mouse.t => unit=?,
~onMouseMove: ReactEvent.Mouse.t => unit=?,
~onMouseOver: ReactEvent.Mouse.t => unit=?,
~onMouseOut: ReactEvent.Mouse.t => unit=?,
~onMouseUp: ReactEvent.Mouse.t => unit=?,
) => React.element = "Picker"

module Item = {
@react.component @module("@react-native-picker/picker") @scope("Picker")
external make: (
~value: 'a=?,
~label: string,
~color: ReactNative.Color.t=?,
~testID: string=?,
) => React.element = "Item"
}
2 changes: 1 addition & 1 deletion src/ReactNativePickerIOS.bs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var NativeElement$ReactNative = require("reason-react-native/src/elements/NativeElement.bs.js");
var NativeElement$ReactNative = require("rescript-react-native/src/elements/NativeElement.bs.js");

var Item = {};

Expand Down
Loading

0 comments on commit d08a7ef

Please sign in to comment.