rn-inputforge 0.1.2 → 0.3.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.
Files changed (47) hide show
  1. package/README.md +63 -18
  2. package/lib/commonjs/components/FieldFlowDropdown/FieldFlowDropdown.js +288 -0
  3. package/lib/commonjs/components/FieldFlowDropdown/FieldFlowDropdown.js.map +1 -0
  4. package/lib/commonjs/components/FieldFlowDropdown/index.js +13 -0
  5. package/lib/commonjs/components/FieldFlowDropdown/index.js.map +1 -0
  6. package/lib/commonjs/components/FieldFlowDropdown/styles.js +199 -0
  7. package/lib/commonjs/components/FieldFlowDropdown/styles.js.map +1 -0
  8. package/lib/commonjs/components/FieldFlowDropdown/types.js +6 -0
  9. package/lib/commonjs/components/FieldFlowDropdown/types.js.map +1 -0
  10. package/lib/commonjs/icons/Icon.js +35 -0
  11. package/lib/commonjs/icons/Icon.js.map +1 -1
  12. package/lib/commonjs/index.js +7 -0
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/module/components/FieldFlowDropdown/FieldFlowDropdown.js +283 -0
  15. package/lib/module/components/FieldFlowDropdown/FieldFlowDropdown.js.map +1 -0
  16. package/lib/module/components/FieldFlowDropdown/index.js +4 -0
  17. package/lib/module/components/FieldFlowDropdown/index.js.map +1 -0
  18. package/lib/module/components/FieldFlowDropdown/styles.js +195 -0
  19. package/lib/module/components/FieldFlowDropdown/styles.js.map +1 -0
  20. package/lib/module/components/FieldFlowDropdown/types.js +4 -0
  21. package/lib/module/components/FieldFlowDropdown/types.js.map +1 -0
  22. package/lib/module/icons/Icon.js +35 -0
  23. package/lib/module/icons/Icon.js.map +1 -1
  24. package/lib/module/index.js +1 -0
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/typescript/components/FieldFlowDropdown/FieldFlowDropdown.d.ts +4 -0
  27. package/lib/typescript/components/FieldFlowDropdown/FieldFlowDropdown.d.ts.map +1 -0
  28. package/lib/typescript/components/FieldFlowDropdown/index.d.ts +3 -0
  29. package/lib/typescript/components/FieldFlowDropdown/index.d.ts.map +1 -0
  30. package/lib/typescript/components/FieldFlowDropdown/styles.d.ts +188 -0
  31. package/lib/typescript/components/FieldFlowDropdown/styles.d.ts.map +1 -0
  32. package/lib/typescript/components/FieldFlowDropdown/types.d.ts +51 -0
  33. package/lib/typescript/components/FieldFlowDropdown/types.d.ts.map +1 -0
  34. package/lib/typescript/icons/Icon.d.ts +1 -1
  35. package/lib/typescript/icons/Icon.d.ts.map +1 -1
  36. package/lib/typescript/index.d.ts +3 -1
  37. package/lib/typescript/index.d.ts.map +1 -1
  38. package/lib/typescript/types/index.d.ts +7 -0
  39. package/lib/typescript/types/index.d.ts.map +1 -1
  40. package/package.json +8 -12
  41. package/src/components/FieldFlowDropdown/FieldFlowDropdown.tsx +353 -0
  42. package/src/components/FieldFlowDropdown/index.ts +7 -0
  43. package/src/components/FieldFlowDropdown/styles.ts +193 -0
  44. package/src/components/FieldFlowDropdown/types.ts +57 -0
  45. package/src/icons/Icon.tsx +26 -0
  46. package/src/index.ts +9 -0
  47. package/src/types/index.ts +8 -0
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 | 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` |
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,13 +134,57 @@ 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.
141
141
 
142
142
  ---
143
143
 
144
+ ## Dropdown / select (single & multiple)
145
+
146
+ ```tsx
147
+ import { FieldFlowDropdown } from 'rn-inputforge';
148
+
149
+ // Single select — slides up from the bottom by default
150
+ <FieldFlowDropdown
151
+ label="Country"
152
+ placeholder="Select your country"
153
+ options={[
154
+ { label: 'United States', value: 'us' },
155
+ { label: 'Pakistan', value: 'pk' },
156
+ { label: 'United Kingdom', value: 'uk' },
157
+ ]}
158
+ value={country}
159
+ onChange={setCountry}
160
+ clearable
161
+ required
162
+ />
163
+
164
+ // Multi select — centered popup modal, with search, confirmed via a "Done" button
165
+ <FieldFlowDropdown
166
+ multiple
167
+ label="Skills"
168
+ presentation="popup"
169
+ options={skillOptions}
170
+ values={skills}
171
+ onChangeMulti={setSkills}
172
+ searchable
173
+ />
174
+ ```
175
+
176
+ **Presentation modes** (`presentation` prop):
177
+
178
+ - `"bottomSheet"` (default) — slides up from the bottom, dismiss by tapping the backdrop
179
+ - `"popup"` — fades in, centered on screen
180
+ - `"inline"` — drops down directly under the field itself (flips upward automatically if there isn't room below)
181
+
182
+ **Single vs multiple select:** pass `value` + `onChange` for single select, or `multiple` + `values` + `onChangeMulti` for multi-select. In multi-select, selections are staged until the user taps the confirm button (`confirmLabel`, default `"Done"`) — pass `closeOnSelect` if you'd rather commit immediately on each tap instead.
183
+
184
+ Search is shown automatically once there are more than `searchThreshold` options (default 6) — set `searchable` explicitly to force it on or off. Every option can carry a `description` (shown as a second line) and can be individually `disabled`. Like every other FieldFlow component, it accepts `theme`, `label`, `helperText`, `errorText`, and `disabled` for consistency with the rest of your form.
185
+
186
+ ---
187
+
144
188
  ## Description fields
145
189
 
146
190
  ```tsx
@@ -154,7 +198,7 @@ import { DescriptionField } from 'rn-inputforge';
154
198
  maxLength={240}
155
199
  minHeight={80}
156
200
  maxHeight={200}
157
- />
201
+ />;
158
202
  ```
159
203
 
160
204
  Grows automatically as the user types, shows a live character counter, and supports every validation/theming prop `FieldFlowInput` does.
@@ -174,7 +218,7 @@ import { ChatInput } from 'rn-inputforge';
174
218
  onAttachmentPress={action => handleAttachment(action)}
175
219
  customActions={[{ id: 'gif', icon: 'image', onPress: openGifPicker }]}
176
220
  placeholder="Type a message..."
177
- />
221
+ />;
178
222
  ```
179
223
 
180
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.
@@ -207,7 +251,7 @@ import { FieldFlowThemeProvider } from 'rn-inputforge';
207
251
  }}
208
252
  >
209
253
  <App />
210
- </FieldFlowThemeProvider>
254
+ </FieldFlowThemeProvider>;
211
255
  ```
212
256
 
213
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.
@@ -223,6 +267,7 @@ rn-inputforge/
223
267
  │ │ ├── FieldFlowInput/ core input (all field types, icons, states)
224
268
  │ │ ├── DescriptionField/ auto-growing multiline field
225
269
  │ │ ├── ChatInput/ chat composer + attachment toolbar
270
+ │ │ ├── FieldFlowDropdown/ single/multi select — bottom sheet, popup, or inline
226
271
  │ │ └── KeyboardAwareFormWrapper/
227
272
  │ ├── hooks/ useFieldFlowForm, useKeyboardManager, useFieldState
228
273
  │ ├── theme/ ThemeProvider + default/dark themes
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FieldFlowDropdown = FieldFlowDropdown;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _ThemeProvider = require("../../theme/ThemeProvider");
10
+ var _defaultTheme = require("../../theme/defaultTheme");
11
+ var _useFieldState = require("../../hooks/useFieldState");
12
+ var _Icon = require("../../icons/Icon");
13
+ var _styles = require("./styles");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
+ function FieldFlowDropdown(props) {
17
+ const {
18
+ options,
19
+ label,
20
+ placeholder = 'Select...',
21
+ helperText,
22
+ errorText,
23
+ hasError,
24
+ disabled,
25
+ required,
26
+ title,
27
+ presentation = 'bottomSheet',
28
+ searchable,
29
+ searchThreshold = 6,
30
+ searchPlaceholder = 'Search...',
31
+ emptyText = 'No options found',
32
+ maxModalHeight,
33
+ clearable,
34
+ containerStyle,
35
+ triggerStyle,
36
+ labelStyle,
37
+ theme: themeOverride,
38
+ testID,
39
+ multiple
40
+ } = props;
41
+ const contextTheme = (0, _ThemeProvider.useFieldFlowTheme)();
42
+ const theme = (0, _react.useMemo)(() => themeOverride ? (0, _ThemeProvider.mergeDeep)(contextTheme ?? _defaultTheme.defaultTheme, themeOverride) : contextTheme ?? _defaultTheme.defaultTheme, [contextTheme, themeOverride]);
43
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
44
+ const [query, setQuery] = (0, _react.useState)('');
45
+ const [draftValues, setDraftValues] = (0, _react.useState)(multiple ? props.values ?? [] : []);
46
+ const [anchorLayout, setAnchorLayout] = (0, _react.useState)(null);
47
+ const triggerRef = (0, _react.useRef)(null);
48
+ const resolvedError = errorText;
49
+ const state = (0, _useFieldState.useFieldState)({
50
+ isFocused: isOpen,
51
+ hasError: Boolean(hasError || resolvedError),
52
+ disabled
53
+ });
54
+ const styles = (0, _react.useMemo)(() => (0, _styles.createDropdownStyles)(theme, state), [theme, state]);
55
+ const selectedValues = multiple ? props.values ?? [] : props.value ? [props.value] : [];
56
+ const shouldShowSearch = searchable ?? options.length > searchThreshold;
57
+ const filteredOptions = (0, _react.useMemo)(() => {
58
+ if (!query.trim()) return options;
59
+ const q = query.trim().toLowerCase();
60
+ return options.filter(o => o.label.toLowerCase().includes(q));
61
+ }, [options, query]);
62
+ const openDropdown = () => {
63
+ if (disabled) return;
64
+ if (multiple) setDraftValues(props.values ?? []);
65
+ setQuery('');
66
+ if (presentation === 'inline') {
67
+ triggerRef.current?.measureInWindow((x, y, width, height) => {
68
+ setAnchorLayout({
69
+ x,
70
+ y,
71
+ width,
72
+ height
73
+ });
74
+ setIsOpen(true);
75
+ });
76
+ } else {
77
+ setIsOpen(true);
78
+ }
79
+ };
80
+ const closeDropdown = () => setIsOpen(false);
81
+ const commitSingle = value => {
82
+ if (!multiple) {
83
+ props.onChange(value);
84
+ if (props.closeOnSelect ?? true) closeDropdown();
85
+ }
86
+ };
87
+ const toggleMultiDraft = value => {
88
+ setDraftValues(prev => prev.includes(value) ? prev.filter(v => v !== value) : [...prev, value]);
89
+ if (multiple && (props.closeOnSelect ?? false)) {
90
+ const next = draftValues.includes(value) ? draftValues.filter(v => v !== value) : [...draftValues, value];
91
+ props.onChangeMulti(next);
92
+ }
93
+ };
94
+ const confirmMulti = () => {
95
+ if (multiple) {
96
+ props.onChangeMulti(draftValues);
97
+ }
98
+ closeDropdown();
99
+ };
100
+ const clearSelection = () => {
101
+ if (multiple) {
102
+ props.onChangeMulti([]);
103
+ setDraftValues([]);
104
+ } else {
105
+ props.onChange(null);
106
+ }
107
+ };
108
+ const triggerLabel = (0, _react.useMemo)(() => {
109
+ if (selectedValues.length === 0) return null;
110
+ const labels = options.filter(o => selectedValues.includes(o.value)).map(o => o.label);
111
+ if (!multiple) return labels[0] ?? null;
112
+ const maxShown = props.maxLabelsShown ?? 2;
113
+ if (labels.length <= maxShown) return labels.join(', ');
114
+ return `${labels.slice(0, maxShown).join(', ')} +${labels.length - maxShown} more`;
115
+ }, [selectedValues, options, multiple, props]);
116
+ const renderOption = ({
117
+ item
118
+ }) => {
119
+ const isSelected = multiple ? draftValues.includes(item.value) : props.value === item.value;
120
+ const handlePress = () => {
121
+ if (item.disabled) return;
122
+ multiple ? toggleMultiDraft(item.value) : commitSingle(item.value);
123
+ };
124
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
125
+ onPress: handlePress,
126
+ disabled: item.disabled,
127
+ style: styles.optionRow,
128
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
129
+ style: {
130
+ flex: 1
131
+ },
132
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
133
+ style: [styles.optionLabel, isSelected && styles.optionLabelSelected, item.disabled && styles.optionLabelDisabled],
134
+ children: item.label
135
+ }), item.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
136
+ style: styles.optionDescription,
137
+ children: item.description
138
+ }) : null]
139
+ }), multiple ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
140
+ style: [styles.checkbox, isSelected && styles.checkboxChecked],
141
+ children: isSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.FieldFlowIcon, {
142
+ name: "check",
143
+ size: 12,
144
+ color: "#FFFFFF"
145
+ }) : null
146
+ }) : isSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.FieldFlowIcon, {
147
+ name: "check",
148
+ size: 16,
149
+ color: theme.colors.borderFocused
150
+ }) : null]
151
+ });
152
+ };
153
+ const listContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
154
+ children: [shouldShowSearch ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
155
+ style: styles.searchWrapper,
156
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
157
+ value: query,
158
+ onChangeText: setQuery,
159
+ placeholder: searchPlaceholder,
160
+ placeholderTextColor: theme.colors.placeholder,
161
+ style: styles.searchInput
162
+ })
163
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
164
+ data: filteredOptions,
165
+ keyExtractor: item => item.value,
166
+ renderItem: renderOption,
167
+ keyboardShouldPersistTaps: "handled",
168
+ style: {
169
+ maxHeight: maxModalHeight ?? 360
170
+ },
171
+ ListEmptyComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
172
+ style: styles.emptyText,
173
+ children: emptyText
174
+ })
175
+ }), multiple ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
176
+ style: styles.confirmButton,
177
+ onPress: confirmMulti,
178
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
179
+ style: styles.confirmButtonText,
180
+ children: props.confirmLabel ?? 'Done'
181
+ })
182
+ }) : null]
183
+ });
184
+ const header = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
185
+ style: styles.modalHeader,
186
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
187
+ style: styles.modalTitle,
188
+ children: title ?? label ?? 'Select'
189
+ }), clearable && selectedValues.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
190
+ onPress: clearSelection,
191
+ hitSlop: 8,
192
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
193
+ style: styles.modalClearButton,
194
+ children: "Clear"
195
+ })
196
+ }) : null]
197
+ });
198
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
199
+ style: [styles.wrapper, containerStyle],
200
+ testID: testID,
201
+ children: [label ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
202
+ style: [styles.label, labelStyle],
203
+ children: [label, required ? ' *' : '']
204
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
205
+ ref: triggerRef,
206
+ collapsable: false,
207
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
208
+ onPress: openDropdown,
209
+ disabled: disabled,
210
+ style: [styles.trigger, triggerStyle],
211
+ children: [triggerLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
212
+ style: styles.triggerText,
213
+ numberOfLines: 1,
214
+ children: triggerLabel
215
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
216
+ style: styles.placeholderText,
217
+ numberOfLines: 1,
218
+ children: placeholder
219
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.FieldFlowIcon, {
220
+ name: "chevronDown",
221
+ size: 16,
222
+ color: theme.colors.icon
223
+ })]
224
+ })
225
+ }), (helperText || resolvedError) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
226
+ style: styles.footerRow,
227
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
228
+ style: {
229
+ flex: 1
230
+ },
231
+ children: resolvedError ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
232
+ style: styles.errorText,
233
+ children: resolvedError
234
+ }) : helperText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
235
+ style: styles.helperText,
236
+ children: helperText
237
+ }) : null
238
+ })
239
+ }), presentation === 'inline' ? isOpen && anchorLayout ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
240
+ transparent: true,
241
+ visible: true,
242
+ animationType: "fade",
243
+ onRequestClose: closeDropdown,
244
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
245
+ style: {
246
+ flex: 1
247
+ },
248
+ onPress: closeDropdown,
249
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
250
+ style: [styles.inlineDropdown, inlinePosition(anchorLayout)],
251
+ children: listContent
252
+ })
253
+ })
254
+ }) : null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
255
+ transparent: true,
256
+ visible: isOpen,
257
+ animationType: presentation === 'popup' ? 'fade' : 'slide',
258
+ onRequestClose: closeDropdown,
259
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
260
+ style: presentation === 'popup' ? styles.popupWrapper : styles.bottomSheetWrapper,
261
+ onPress: closeDropdown,
262
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
263
+ style: presentation === 'popup' ? styles.popupCard : styles.sheetCard,
264
+ onPress: e => e.stopPropagation(),
265
+ children: [presentation === 'bottomSheet' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
266
+ style: styles.dragHandle
267
+ }) : null, header, listContent]
268
+ })
269
+ })
270
+ })]
271
+ });
272
+ }
273
+ function inlinePosition(anchor) {
274
+ const screenHeight = _reactNative.Dimensions.get('window').height;
275
+ const spaceBelow = screenHeight - (anchor.y + anchor.height);
276
+ const openUpward = spaceBelow < 260;
277
+ return {
278
+ left: anchor.x,
279
+ width: anchor.width,
280
+ maxHeight: 300,
281
+ ...(openUpward ? {
282
+ bottom: screenHeight - anchor.y + 4
283
+ } : {
284
+ top: anchor.y + anchor.height + 4
285
+ })
286
+ };
287
+ }
288
+ //# sourceMappingURL=FieldFlowDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_ThemeProvider","_defaultTheme","_useFieldState","_Icon","_styles","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FieldFlowDropdown","props","options","label","placeholder","helperText","errorText","hasError","disabled","required","title","presentation","searchable","searchThreshold","searchPlaceholder","emptyText","maxModalHeight","clearable","containerStyle","triggerStyle","labelStyle","theme","themeOverride","testID","multiple","contextTheme","useFieldFlowTheme","useMemo","mergeDeep","defaultTheme","isOpen","setIsOpen","useState","query","setQuery","draftValues","setDraftValues","values","anchorLayout","setAnchorLayout","triggerRef","useRef","resolvedError","state","useFieldState","isFocused","Boolean","styles","createDropdownStyles","selectedValues","value","shouldShowSearch","length","filteredOptions","trim","q","toLowerCase","filter","includes","openDropdown","current","measureInWindow","x","y","width","height","closeDropdown","commitSingle","onChange","closeOnSelect","toggleMultiDraft","prev","v","next","onChangeMulti","confirmMulti","clearSelection","triggerLabel","labels","map","maxShown","maxLabelsShown","join","slice","renderOption","item","isSelected","handlePress","jsxs","Pressable","onPress","style","optionRow","children","View","flex","jsx","Text","optionLabel","optionLabelSelected","optionLabelDisabled","description","optionDescription","checkbox","checkboxChecked","FieldFlowIcon","name","size","color","colors","borderFocused","listContent","Fragment","searchWrapper","TextInput","onChangeText","placeholderTextColor","searchInput","FlatList","data","keyExtractor","renderItem","keyboardShouldPersistTaps","maxHeight","ListEmptyComponent","confirmButton","confirmButtonText","confirmLabel","header","modalHeader","modalTitle","hitSlop","modalClearButton","wrapper","ref","collapsable","trigger","triggerText","numberOfLines","placeholderText","icon","footerRow","Modal","transparent","visible","animationType","onRequestClose","inlineDropdown","inlinePosition","popupWrapper","bottomSheetWrapper","popupCard","sheetCard","stopPropagation","dragHandle","anchor","screenHeight","Dimensions","spaceBelow","openUpward","left","bottom","top"],"sourceRoot":"../../../../src","sources":["components/FieldFlowDropdown/FieldFlowDropdown.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAAgD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA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AACH,KAAK,EAAE5C,MAAM,CAAC2G;UAAW,CAAE,CAAC,GAChC,IAAI,EACP1B,MAAM,EACNjB,WAAW;QAAA,CACH;MAAC,CACH;IAAC,CACP,CACR;EAAA,CACG,CAAC;AAEX;AAEA,SAASqC,cAAcA,CAACO,MAKvB,EAAa;EACZ,MAAMC,YAAY,GAAGC,uBAAU,CAACpK,GAAG,CAAC,QAAQ,CAAC,CAACwE,MAAM;EACpD,MAAM6F,UAAU,GAAGF,YAAY,IAAID,MAAM,CAAC5F,CAAC,GAAG4F,MAAM,CAAC1F,MAAM,CAAC;EAC5D,MAAM8F,UAAU,GAAGD,UAAU,GAAG,GAAG;EACnC,OAAO;IACLE,IAAI,EAAEL,MAAM,CAAC7F,CAAC;IACdE,KAAK,EAAE2F,MAAM,CAAC3F,KAAK;IACnB2D,SAAS,EAAE,GAAG;IACd,IAAIoC,UAAU,GACV;MAAEE,MAAM,EAAEL,YAAY,GAAGD,MAAM,CAAC5F,CAAC,GAAG;IAAE,CAAC,GACvC;MAAEmG,GAAG,EAAEP,MAAM,CAAC5F,CAAC,GAAG4F,MAAM,CAAC1F,MAAM,GAAG;IAAE,CAAC;EAC3C,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "FieldFlowDropdown", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _FieldFlowDropdown.FieldFlowDropdown;
10
+ }
11
+ });
12
+ var _FieldFlowDropdown = require("./FieldFlowDropdown");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FieldFlowDropdown","require"],"sourceRoot":"../../../../src","sources":["components/FieldFlowDropdown/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createDropdownStyles = createDropdownStyles;
7
+ var _reactNative = require("react-native");
8
+ var _styles = require("../FieldFlowInput/styles");
9
+ function createDropdownStyles(theme, state) {
10
+ return _reactNative.StyleSheet.create({
11
+ wrapper: {
12
+ marginBottom: theme.spacing.gap * 2
13
+ },
14
+ label: {
15
+ fontSize: theme.typography.labelFontSize,
16
+ marginBottom: theme.spacing.gap / 1.5,
17
+ color: (0, _styles.labelColorFor)(theme, state),
18
+ fontWeight: '500'
19
+ },
20
+ trigger: {
21
+ flexDirection: 'row',
22
+ alignItems: 'center',
23
+ backgroundColor: state === 'disabled' ? theme.colors.backgroundDisabled : theme.colors.background,
24
+ borderRadius: theme.spacing.borderRadius,
25
+ borderWidth: state === 'focused' ? theme.spacing.borderWidthFocused : theme.spacing.borderWidth,
26
+ borderColor: (0, _styles.borderColorFor)(theme, state),
27
+ paddingHorizontal: theme.spacing.paddingHorizontal,
28
+ minHeight: theme.spacing.paddingVertical * 2 + theme.typography.fontSize + 6
29
+ },
30
+ triggerText: {
31
+ flex: 1,
32
+ fontSize: theme.typography.fontSize,
33
+ color: theme.colors.text
34
+ },
35
+ placeholderText: {
36
+ flex: 1,
37
+ fontSize: theme.typography.fontSize,
38
+ color: theme.colors.placeholder
39
+ },
40
+ footerRow: {
41
+ flexDirection: 'row',
42
+ justifyContent: 'space-between',
43
+ marginTop: theme.spacing.gap / 1.5
44
+ },
45
+ errorText: {
46
+ fontSize: theme.typography.helperFontSize,
47
+ color: theme.colors.error,
48
+ flexShrink: 1
49
+ },
50
+ helperText: {
51
+ fontSize: theme.typography.helperFontSize,
52
+ color: theme.colors.label,
53
+ flexShrink: 1
54
+ },
55
+ // Modal
56
+ backdrop: {
57
+ flex: 1,
58
+ backgroundColor: 'rgba(0,0,0,0.4)'
59
+ },
60
+ bottomSheetWrapper: {
61
+ flex: 1,
62
+ justifyContent: 'flex-end'
63
+ },
64
+ popupWrapper: {
65
+ flex: 1,
66
+ justifyContent: 'center',
67
+ alignItems: 'center',
68
+ paddingHorizontal: 24
69
+ },
70
+ sheetCard: {
71
+ backgroundColor: theme.colors.background,
72
+ borderTopLeftRadius: theme.spacing.borderRadius * 1.6,
73
+ borderTopRightRadius: theme.spacing.borderRadius * 1.6,
74
+ paddingTop: theme.spacing.gap,
75
+ paddingBottom: theme.spacing.paddingVertical
76
+ },
77
+ popupCard: {
78
+ width: '100%',
79
+ backgroundColor: theme.colors.background,
80
+ borderRadius: theme.spacing.borderRadius * 1.4,
81
+ paddingTop: theme.spacing.gap,
82
+ paddingBottom: theme.spacing.paddingVertical,
83
+ maxHeight: '80%'
84
+ },
85
+ dragHandle: {
86
+ alignSelf: 'center',
87
+ width: 36,
88
+ height: 4,
89
+ borderRadius: 2,
90
+ backgroundColor: theme.colors.border,
91
+ marginBottom: theme.spacing.gap
92
+ },
93
+ modalHeader: {
94
+ flexDirection: 'row',
95
+ alignItems: 'center',
96
+ justifyContent: 'space-between',
97
+ paddingHorizontal: theme.spacing.paddingHorizontal,
98
+ paddingBottom: theme.spacing.gap,
99
+ borderBottomWidth: theme.spacing.borderWidth,
100
+ borderBottomColor: theme.colors.border,
101
+ marginBottom: theme.spacing.gap
102
+ },
103
+ modalTitle: {
104
+ fontSize: theme.typography.fontSize + 1,
105
+ fontWeight: '600',
106
+ color: theme.colors.text
107
+ },
108
+ modalClearButton: {
109
+ fontSize: theme.typography.helperFontSize,
110
+ color: theme.colors.borderFocused
111
+ },
112
+ searchWrapper: {
113
+ paddingHorizontal: theme.spacing.paddingHorizontal,
114
+ marginBottom: theme.spacing.gap
115
+ },
116
+ searchInput: {
117
+ backgroundColor: theme.colors.backgroundDisabled,
118
+ borderRadius: theme.spacing.borderRadius,
119
+ paddingHorizontal: theme.spacing.paddingHorizontal,
120
+ paddingVertical: theme.spacing.paddingVertical * 0.6,
121
+ fontSize: theme.typography.fontSize,
122
+ color: theme.colors.text
123
+ },
124
+ optionRow: {
125
+ flexDirection: 'row',
126
+ alignItems: 'center',
127
+ justifyContent: 'space-between',
128
+ paddingHorizontal: theme.spacing.paddingHorizontal,
129
+ paddingVertical: theme.spacing.paddingVertical * 0.9
130
+ },
131
+ optionLabel: {
132
+ fontSize: theme.typography.fontSize,
133
+ color: theme.colors.text
134
+ },
135
+ optionLabelSelected: {
136
+ color: theme.colors.borderFocused,
137
+ fontWeight: '600'
138
+ },
139
+ optionLabelDisabled: {
140
+ color: theme.colors.placeholder
141
+ },
142
+ optionDescription: {
143
+ fontSize: theme.typography.helperFontSize,
144
+ color: theme.colors.placeholder,
145
+ marginTop: 2
146
+ },
147
+ checkbox: {
148
+ width: 20,
149
+ height: 20,
150
+ borderRadius: 5,
151
+ borderWidth: theme.spacing.borderWidth,
152
+ borderColor: theme.colors.border,
153
+ alignItems: 'center',
154
+ justifyContent: 'center'
155
+ },
156
+ checkboxChecked: {
157
+ backgroundColor: theme.colors.borderFocused,
158
+ borderColor: theme.colors.borderFocused
159
+ },
160
+ emptyText: {
161
+ textAlign: 'center',
162
+ paddingVertical: theme.spacing.paddingVertical * 2,
163
+ color: theme.colors.placeholder,
164
+ fontSize: theme.typography.fontSize
165
+ },
166
+ confirmButton: {
167
+ marginHorizontal: theme.spacing.paddingHorizontal,
168
+ marginTop: theme.spacing.gap,
169
+ backgroundColor: theme.colors.borderFocused,
170
+ borderRadius: theme.spacing.borderRadius,
171
+ paddingVertical: theme.spacing.paddingVertical * 0.8,
172
+ alignItems: 'center'
173
+ },
174
+ confirmButtonText: {
175
+ color: '#FFFFFF',
176
+ fontSize: theme.typography.fontSize,
177
+ fontWeight: '600'
178
+ },
179
+ // Inline presentation
180
+ inlineDropdown: {
181
+ position: 'absolute',
182
+ backgroundColor: theme.colors.background,
183
+ borderRadius: theme.spacing.borderRadius,
184
+ borderWidth: theme.spacing.borderWidth,
185
+ borderColor: theme.colors.border,
186
+ shadowColor: '#000',
187
+ shadowOffset: {
188
+ width: 0,
189
+ height: 4
190
+ },
191
+ shadowOpacity: 0.15,
192
+ shadowRadius: 8,
193
+ elevation: 6,
194
+ overflow: 'hidden',
195
+ zIndex: 50
196
+ }
197
+ });
198
+ }
199
+ //# sourceMappingURL=styles.js.map