rn-native-wrapper 1.0.0
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/LICENSE +21 -0
- package/README.md +83 -0
- package/ios/.xcode.env +11 -0
- package/ios/Podfile +63 -0
- package/ios/Podfile.lock +2126 -0
- package/ios/Podfile.properties.json +5 -0
- package/ios/rnnativewrapper/AppDelegate.swift +70 -0
- package/ios/rnnativewrapper/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
- package/ios/rnnativewrapper/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/ios/rnnativewrapper/Images.xcassets/Contents.json +6 -0
- package/ios/rnnativewrapper/Images.xcassets/SplashScreenBackground.colorset/Contents.json +20 -0
- package/ios/rnnativewrapper/Info.plist +77 -0
- package/ios/rnnativewrapper/PrivacyInfo.xcprivacy +48 -0
- package/ios/rnnativewrapper/SplashScreen.storyboard +39 -0
- package/ios/rnnativewrapper/Supporting/Expo.plist +12 -0
- package/ios/rnnativewrapper/rnnativewrapper-Bridging-Header.h +3 -0
- package/ios/rnnativewrapper/rnnativewrapper.entitlements +5 -0
- package/ios/rnnativewrapper.xcodeproj/project.pbxproj +540 -0
- package/ios/rnnativewrapper.xcodeproj/xcshareddata/xcschemes/rnnativewrapper.xcscheme +88 -0
- package/ios/rnnativewrapper.xcworkspace/contents.xcworkspacedata +10 -0
- package/lib/components/RNNativeDatePicker.d.ts +5 -0
- package/lib/components/RNNativeDatePicker.d.ts.map +1 -0
- package/lib/components/RNNativeDatePicker.js +11 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/package.json +72 -0
- package/src/components/RNNativeDatePicker.tsx +12 -0
- package/src/index.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Darshan Padhiyar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# RN Native Wrapper
|
|
2
|
+
|
|
3
|
+
A React Native wrapper component for the native date picker, providing a simple and type-safe interface to `react-native-date-picker`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install rn-native-wrapper
|
|
9
|
+
# or
|
|
10
|
+
yarn add rn-native-wrapper
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer Dependencies
|
|
14
|
+
|
|
15
|
+
This package requires the following peer dependencies:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install react react-native
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The package automatically includes `react-native-date-picker` as a dependency.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import React, { useState } from 'react';
|
|
27
|
+
import { View, Button } from 'react-native';
|
|
28
|
+
import { RNNativeDatePicker } from 'rn-native-wrapper';
|
|
29
|
+
|
|
30
|
+
export default function App() {
|
|
31
|
+
const [date, setDate] = useState(new Date());
|
|
32
|
+
const [open, setOpen] = useState(false);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View>
|
|
36
|
+
<Button title="Open Date Picker" onPress={() => setOpen(true)} />
|
|
37
|
+
|
|
38
|
+
<RNNativeDatePicker
|
|
39
|
+
modal
|
|
40
|
+
open={open}
|
|
41
|
+
date={date}
|
|
42
|
+
onConfirm={(selectedDate) => {
|
|
43
|
+
setOpen(false);
|
|
44
|
+
setDate(selectedDate);
|
|
45
|
+
}}
|
|
46
|
+
onCancel={() => {
|
|
47
|
+
setOpen(false);
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## API
|
|
56
|
+
|
|
57
|
+
The `RNNativeDatePicker` component accepts all props from [`react-native-date-picker`](https://github.com/henninghall/react-native-date-picker). Please refer to their documentation for detailed prop descriptions.
|
|
58
|
+
|
|
59
|
+
### Common Props
|
|
60
|
+
|
|
61
|
+
- `modal`: boolean - Display as modal
|
|
62
|
+
- `open`: boolean - Modal open state
|
|
63
|
+
- `date`: Date - Currently selected date
|
|
64
|
+
- `onConfirm`: (date: Date) => void - Callback when date is confirmed
|
|
65
|
+
- `onCancel`: () => void - Callback when picker is cancelled
|
|
66
|
+
- `mode`: 'date' | 'time' | 'datetime' - Picker mode
|
|
67
|
+
- `locale`: string - Locale for date formatting
|
|
68
|
+
|
|
69
|
+
## TypeScript
|
|
70
|
+
|
|
71
|
+
This package is written in TypeScript and includes full type definitions out of the box.
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT © Darshan Padhiyar
|
|
76
|
+
|
|
77
|
+
## Contributing
|
|
78
|
+
|
|
79
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
80
|
+
|
|
81
|
+
## Issues
|
|
82
|
+
|
|
83
|
+
If you encounter any problems, please file an issue along with a detailed description.
|
package/ios/.xcode.env
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
+
# used when running script phases inside Xcode.
|
|
3
|
+
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
+
# file that is not versioned.
|
|
5
|
+
|
|
6
|
+
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
+
#
|
|
8
|
+
# Customize the NODE_BINARY variable here.
|
|
9
|
+
# For example, to use nvm with brew, add the following line
|
|
10
|
+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
+
export NODE_BINARY=$(command -v node)
|
package/ios/Podfile
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
|
|
2
|
+
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
|
|
3
|
+
|
|
4
|
+
require 'json'
|
|
5
|
+
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
|
|
6
|
+
|
|
7
|
+
def ccache_enabled?(podfile_properties)
|
|
8
|
+
# Environment variable takes precedence
|
|
9
|
+
return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE']
|
|
10
|
+
|
|
11
|
+
# Fall back to Podfile properties
|
|
12
|
+
podfile_properties['apple.ccacheEnabled'] == 'true'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
|
|
16
|
+
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
|
|
17
|
+
ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
|
18
|
+
ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
|
19
|
+
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
|
|
20
|
+
|
|
21
|
+
prepare_react_native_project!
|
|
22
|
+
|
|
23
|
+
target 'rnnativewrapper' do
|
|
24
|
+
use_expo_modules!
|
|
25
|
+
|
|
26
|
+
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
|
|
27
|
+
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
|
|
28
|
+
else
|
|
29
|
+
config_command = [
|
|
30
|
+
'node',
|
|
31
|
+
'--no-warnings',
|
|
32
|
+
'--eval',
|
|
33
|
+
'require(\'expo/bin/autolinking\')',
|
|
34
|
+
'expo-modules-autolinking',
|
|
35
|
+
'react-native-config',
|
|
36
|
+
'--json',
|
|
37
|
+
'--platform',
|
|
38
|
+
'ios'
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
config = use_native_modules!(config_command)
|
|
43
|
+
|
|
44
|
+
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
|
|
45
|
+
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
|
|
46
|
+
|
|
47
|
+
use_react_native!(
|
|
48
|
+
:path => config[:reactNativePath],
|
|
49
|
+
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
|
|
50
|
+
# An absolute path to your application root.
|
|
51
|
+
:app_path => "#{Pod::Config.instance.installation_root}/..",
|
|
52
|
+
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
post_install do |installer|
|
|
56
|
+
react_native_post_install(
|
|
57
|
+
installer,
|
|
58
|
+
config[:reactNativePath],
|
|
59
|
+
:mac_catalyst_enabled => false,
|
|
60
|
+
:ccache_enabled => ccache_enabled?(podfile_properties),
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
end
|