rn-inputforge 0.2.0 → 0.3.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.
- package/README.md +19 -18
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# rn-inputforge
|
|
2
2
|
|
|
3
|
-
A production-ready, highly customizable input field system for **bare React Native CLI** apps — text, email, number, phone, password, search, description, and chat inputs, with built-in validation, theming, icons, and keyboard-aware form navigation. Pure JS/TS, no native modules, so there's nothing to link.
|
|
3
|
+
A production-ready, highly customizable input field system for **bare React Native CLI** apps — text, email, number, phone, password, search, description, and chat inputs, plus a fully customizable single/multi-select dropdown (bottom sheet, popup, or inline), with built-in validation, theming, icons, and keyboard-aware form navigation. Pure JS/TS, no native modules, so there's nothing to link.
|
|
4
4
|
|
|
5
5
|
Works identically whether your project uses **npm** or **yarn**.
|
|
6
6
|
|
|
@@ -55,18 +55,18 @@ Setting `type="email"` automatically wires up the email keyboard, disables autoc
|
|
|
55
55
|
|
|
56
56
|
## Field types
|
|
57
57
|
|
|
58
|
-
| `type` | Keyboard
|
|
59
|
-
|
|
60
|
-
| `text` | default
|
|
61
|
-
| `email` | email-address
|
|
62
|
-
| `number` | numeric / number-pad| strips non-digits as you type
|
|
63
|
-
| `decimal` | decimal-pad
|
|
64
|
-
| `phone` | phone-pad
|
|
65
|
-
| `password` | default, masked
|
|
66
|
-
| `search` | default
|
|
67
|
-
| `multiline` | default, multi-line
|
|
68
|
-
| `description` | default, multi-line
|
|
69
|
-
| `chat` | default
|
|
58
|
+
| `type` | Keyboard | Notes |
|
|
59
|
+
| ------------- | -------------------- | ------------------------------------- |
|
|
60
|
+
| `text` | default | sentence auto-capitalize |
|
|
61
|
+
| `email` | email-address | auto validates email format |
|
|
62
|
+
| `number` | numeric / number-pad | strips non-digits as you type |
|
|
63
|
+
| `decimal` | decimal-pad | allows a single `.` |
|
|
64
|
+
| `phone` | phone-pad | strips invalid phone characters |
|
|
65
|
+
| `password` | default, masked | built-in show/hide toggle |
|
|
66
|
+
| `search` | default | search icon + clear button by default |
|
|
67
|
+
| `multiline` | default, multi-line | free-form multi-line text |
|
|
68
|
+
| `description` | default, multi-line | used internally by `DescriptionField` |
|
|
69
|
+
| `chat` | default | used internally by `ChatInput` |
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
@@ -109,7 +109,7 @@ const form = useFieldFlowForm({
|
|
|
109
109
|
onChangeText={form.handleChange('name')}
|
|
110
110
|
onBlur={form.handleBlur('name')}
|
|
111
111
|
errorText={form.touched.name ? form.errors.name : undefined}
|
|
112
|
-
|
|
112
|
+
/>;
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
`form.submit()` validates every field and only calls `onSubmit` if everything passes.
|
|
@@ -134,7 +134,7 @@ const keyboardManager = useKeyboardManager({
|
|
|
134
134
|
/* ...value, onChangeText, etc. */
|
|
135
135
|
/>
|
|
136
136
|
{/* ...more fields */}
|
|
137
|
-
</KeyboardAwareFormWrapper
|
|
137
|
+
</KeyboardAwareFormWrapper>;
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
See `example/App.tsx` for a complete multi-field form wired end to end.
|
|
@@ -174,6 +174,7 @@ import { FieldFlowDropdown } from 'rn-inputforge';
|
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
**Presentation modes** (`presentation` prop):
|
|
177
|
+
|
|
177
178
|
- `"bottomSheet"` (default) — slides up from the bottom, dismiss by tapping the backdrop
|
|
178
179
|
- `"popup"` — fades in, centered on screen
|
|
179
180
|
- `"inline"` — drops down directly under the field itself (flips upward automatically if there isn't room below)
|
|
@@ -197,7 +198,7 @@ import { DescriptionField } from 'rn-inputforge';
|
|
|
197
198
|
maxLength={240}
|
|
198
199
|
minHeight={80}
|
|
199
200
|
maxHeight={200}
|
|
200
|
-
|
|
201
|
+
/>;
|
|
201
202
|
```
|
|
202
203
|
|
|
203
204
|
Grows automatically as the user types, shows a live character counter, and supports every validation/theming prop `FieldFlowInput` does.
|
|
@@ -217,7 +218,7 @@ import { ChatInput } from 'rn-inputforge';
|
|
|
217
218
|
onAttachmentPress={action => handleAttachment(action)}
|
|
218
219
|
customActions={[{ id: 'gif', icon: 'image', onPress: openGifPicker }]}
|
|
219
220
|
placeholder="Type a message..."
|
|
220
|
-
|
|
221
|
+
/>;
|
|
221
222
|
```
|
|
222
223
|
|
|
223
224
|
Handles expandable height, keyboard-avoiding behavior, and a send button that's only active once there's text to send. Attachment buttons are opt-in per screen — pass only the ones your chat needs.
|
|
@@ -250,7 +251,7 @@ import { FieldFlowThemeProvider } from 'rn-inputforge';
|
|
|
250
251
|
}}
|
|
251
252
|
>
|
|
252
253
|
<App />
|
|
253
|
-
</FieldFlowThemeProvider
|
|
254
|
+
</FieldFlowThemeProvider>;
|
|
254
255
|
```
|
|
255
256
|
|
|
256
257
|
You can also pass a one-off `theme` prop directly to any single field to override it locally, or use the bundled `darkTheme` as a starting point for dark mode.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-inputforge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A production-ready, highly customizable input field system for React Native (bare CLI) — text/email/number/phone/password/search fields, description fields, chat input, built-in validation, theming, icons, and keyboard-aware form navigation.",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "A production-ready, highly customizable input field system for React Native (bare CLI) — text/email/number/phone/password/search fields, description fields, chat input, and a single/multi-select dropdown (bottom sheet, popup, or inline), with built-in validation, theming, icons, and keyboard-aware form navigation.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"form",
|
|
34
34
|
"form-builder",
|
|
35
35
|
"chat-input",
|
|
36
|
+
"dropdown",
|
|
37
|
+
"select",
|
|
38
|
+
"multi-select",
|
|
39
|
+
"bottom-sheet",
|
|
36
40
|
"keyboard-aware",
|
|
37
41
|
"validation",
|
|
38
42
|
"typescript",
|