rn-floating-input 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ilham Babayev
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,252 @@
1
+ # react-native-floating-input
2
+
3
+ A performant floating label TextInput for React Native with animated label transitions, error shake animation, and full customization support.
4
+
5
+ Built with `react-native-reanimated` for smooth 60fps animations. No styled-components dependency — uses plain `StyleSheet`.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install react-native-floating-input
11
+ # or
12
+ yarn add react-native-floating-input
13
+ ```
14
+
15
+ ### Peer Dependencies
16
+
17
+ ```bash
18
+ npm install react-native-reanimated react-native-worklets
19
+ ```
20
+
21
+ Make sure `react-native-reanimated` is properly configured in your project (babel plugin, etc).
22
+
23
+ ## Basic Usage
24
+
25
+ ```tsx
26
+ import { FloatingInput } from 'react-native-floating-input'
27
+
28
+ function MyForm() {
29
+ const [value, setValue] = useState('')
30
+
31
+ return (
32
+ <FloatingInput
33
+ label="Email"
34
+ value={value}
35
+ onChangeText={setValue}
36
+ />
37
+ )
38
+ }
39
+ ```
40
+
41
+ ## With Validation
42
+
43
+ ```tsx
44
+ <FloatingInput
45
+ label="Email"
46
+ value={values.email}
47
+ onChangeText={handleChange('email')}
48
+ onBlur={handleBlur('email')}
49
+ error={errors.email}
50
+ touched={touched.email}
51
+ keyboardType="email-address"
52
+ autoCapitalize="none"
53
+ />
54
+ ```
55
+
56
+ When `touched` and `error` are both truthy, the error message renders below the input and a shake animation plays.
57
+
58
+ ## With Right Element
59
+
60
+ ```tsx
61
+ <FloatingInput
62
+ label="Password"
63
+ value={password}
64
+ onChangeText={setPassword}
65
+ secureTextEntry={!showPassword}
66
+ right={
67
+ <Pressable onPress={() => setShowPassword(!showPassword)}>
68
+ <Icon name={showPassword ? 'eye-off' : 'eye'} />
69
+ </Pressable>
70
+ }
71
+ />
72
+ ```
73
+
74
+ ## Pressable Mode
75
+
76
+ When `onPress` is provided, the input becomes a pressable area (useful for date pickers, dropdowns, etc):
77
+
78
+ ```tsx
79
+ <FloatingInput
80
+ label="Date of Birth"
81
+ value={selectedDate}
82
+ onPress={() => openDatePicker()}
83
+ />
84
+ ```
85
+
86
+ ## Ref Methods
87
+
88
+ ```tsx
89
+ const inputRef = useRef<FloatingInputRef>(null)
90
+
91
+ <FloatingInput ref={inputRef} label="Name" value={name} onChangeText={setName} />
92
+
93
+ // Later:
94
+ inputRef.current?.focus()
95
+ inputRef.current?.blur()
96
+ inputRef.current?.clear()
97
+ inputRef.current?.isFocused()
98
+ ```
99
+
100
+ ## Customization
101
+
102
+ ### Theme Prop
103
+
104
+ Override default colors and sizes:
105
+
106
+ ```tsx
107
+ <FloatingInput
108
+ label="Name"
109
+ value={name}
110
+ onChangeText={setName}
111
+ theme={{
112
+ backgroundColor: '#F0F0F0',
113
+ selectionColor: '#007AFF',
114
+ borderRadius: 8,
115
+ fontSize: 14,
116
+ fontFamily: 'Inter-Regular',
117
+ }}
118
+ />
119
+ ```
120
+
121
+
122
+ | Token | Default | Description |
123
+ | --------------------- | --------- | ---------------------------------- |
124
+ | `backgroundColor` | `#EDEFF2` | Input container background |
125
+ | `labelColor` | `#878A99` | Inactive label color |
126
+ | `inputColor` | `#36373D` | Text input color |
127
+ | `errorColor` | `#E3152E` | Error label & message color |
128
+ | `selectionColor` | `#31BE30` | Cursor and selection color |
129
+ | `placeholderColor` | `#878A99` | Placeholder text color |
130
+ | `borderRadius` | `14` | Container border radius |
131
+ | `minHeight` | `56` | Container minimum height |
132
+ | `fontSize` | `16` | Input and inactive label font size |
133
+ | `labelActiveFontSize` | `12` | Active (raised) label font size |
134
+ | `fontFamily` | `System` | Font family for all text |
135
+
136
+
137
+ ### Styles Prop
138
+
139
+ Granular style overrides per element:
140
+
141
+ ```tsx
142
+ <FloatingInput
143
+ label="Name"
144
+ value={name}
145
+ onChangeText={setName}
146
+ styles={{
147
+ inputContainer: { borderWidth: 1, borderColor: '#DDD' },
148
+ label: { fontWeight: '600' },
149
+ input: { letterSpacing: 0.5 },
150
+ error: { marginLeft: 16 },
151
+ right: { right: 16 },
152
+ }}
153
+ />
154
+ ```
155
+
156
+ ### Animation Config
157
+
158
+ ```tsx
159
+ <FloatingInput
160
+ label="Name"
161
+ value={name}
162
+ onChangeText={setName}
163
+ animationConfig={{
164
+ labelDuration: 150, // Label transition duration (ms)
165
+ shakeMagnitude: 4, // Error shake distance (px)
166
+ shakeDuration: 40, // Each shake step duration (ms)
167
+ labelTranslateY: 12, // How far the label moves up (px)
168
+ }}
169
+ />
170
+ ```
171
+
172
+ ### Custom Input Renderer
173
+
174
+ Replace the default `TextInput` entirely:
175
+
176
+ ```tsx
177
+ <FloatingInput
178
+ label="Custom"
179
+ value={value}
180
+ onChangeText={setValue}
181
+ renderInput={(props) => <MyCustomInput {...props} />}
182
+ />
183
+ ```
184
+
185
+ ### TextInput Pass-through
186
+
187
+ Pass any additional `TextInput` props via `textInputProps`:
188
+
189
+ ```tsx
190
+ <FloatingInput
191
+ label="Bio"
192
+ value={bio}
193
+ onChangeText={setBio}
194
+ textInputProps={{
195
+ multiline: true,
196
+ numberOfLines: 4,
197
+ textAlignVertical: 'top',
198
+ }}
199
+ />
200
+ ```
201
+
202
+ ## Props
203
+
204
+
205
+ | Prop | Type | Default | Description |
206
+ | ----------------- | ------------------------------ | ----------- | ---------------------------------------- |
207
+ | `value` | `string` | — | Input value |
208
+ | `onChangeText` | `(text: string) => void` | — | Change handler |
209
+ | `onBlur` | `() => void` | — | Blur handler |
210
+ | `onFocus` | `() => void` | — | Focus handler |
211
+ | `onPress` | `() => void` | — | Makes input pressable (disables editing) |
212
+ | `label` | `string` | — | Floating label text |
213
+ | `placeholder` | `string` | — | Shown when label is active |
214
+ | `error` | `string` | — | Error message |
215
+ | `touched` | `boolean` | — | Whether field has been touched |
216
+ | `maxLength` | `number` | — | Max input length |
217
+ | `keyboardType` | `KeyboardTypeOptions` | `'default'` | Keyboard type |
218
+ | `autoFocus` | `boolean` | `false` | Auto focus on mount |
219
+ | `editable` | `boolean` | `true` | Whether input is editable |
220
+ | `autoCapitalize` | `string` | — | Auto-capitalization behavior |
221
+ | `secureTextEntry` | `boolean` | `false` | Password mode |
222
+ | `right` | `ReactNode` | — | Right slot element |
223
+ | `renderInput` | `(props) => ReactNode` | — | Custom input renderer |
224
+ | `theme` | `FloatingInputTheme` | — | Theme overrides |
225
+ | `styles` | `FloatingInputStyles` | — | Per-element style overrides |
226
+ | `style` | `StyleProp<ViewStyle>` | — | Input container style shorthand |
227
+ | `animationConfig` | `FloatingInputAnimationConfig` | — | Animation overrides |
228
+ | `textInputProps` | `TextInputProps` | — | Pass-through to underlying TextInput |
229
+
230
+
231
+ ## Exports
232
+
233
+ ```tsx
234
+ // Component
235
+ import { FloatingInput } from 'react-native-floating-input'
236
+
237
+ // Types
238
+ import type {
239
+ FloatingInputProps,
240
+ FloatingInputRef,
241
+ FloatingInputTheme,
242
+ FloatingInputStyles,
243
+ FloatingInputAnimationConfig,
244
+ } from 'react-native-floating-input'
245
+
246
+ // Constants
247
+ import { DEFAULT_THEME, DEFAULT_ANIMATION } from 'react-native-floating-input'
248
+ ```
249
+
250
+ ## License
251
+
252
+ MIT
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FloatingInput = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
+ var _defaults = require("./defaults");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ 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); }
13
+ const FloatingInput = exports.FloatingInput = /*#__PURE__*/_react.default.forwardRef(({
14
+ value,
15
+ onChangeText,
16
+ onBlur,
17
+ onFocus,
18
+ onPress,
19
+ label,
20
+ placeholder,
21
+ error,
22
+ touched,
23
+ maxLength,
24
+ keyboardType = "default",
25
+ autoFocus = false,
26
+ editable = true,
27
+ autoCapitalize,
28
+ secureTextEntry = false,
29
+ right,
30
+ renderInput,
31
+ theme: themeProp,
32
+ styles: stylesProp,
33
+ style,
34
+ animationConfig: animationProp,
35
+ textInputProps
36
+ }, ref) => {
37
+ const inputRef = (0, _react.useRef)(null);
38
+ const [isFocused, setIsFocused] = (0, _react.useState)(false);
39
+ const hasError = !!touched && !!error;
40
+ const theme = {
41
+ ..._defaults.DEFAULT_THEME,
42
+ ...themeProp
43
+ };
44
+ const anim = {
45
+ ..._defaults.DEFAULT_ANIMATION,
46
+ ...animationProp
47
+ };
48
+ const shouldBeActive = isFocused || !!value;
49
+ const focusAnim = (0, _reactNativeReanimated.useSharedValue)(value ? 1 : 0);
50
+ const shakeAnim = (0, _reactNativeReanimated.useSharedValue)(0);
51
+ (0, _react.useImperativeHandle)(ref, () => ({
52
+ focus: () => inputRef.current?.focus(),
53
+ blur: () => inputRef.current?.blur(),
54
+ clear: () => inputRef.current?.clear(),
55
+ isFocused: () => inputRef.current?.isFocused() ?? false
56
+ }));
57
+ (0, _react.useEffect)(() => {
58
+ focusAnim.value = (0, _reactNativeReanimated.withTiming)(shouldBeActive ? 1 : 0, {
59
+ duration: anim.labelDuration
60
+ });
61
+ }, [shouldBeActive]);
62
+ (0, _react.useEffect)(() => {
63
+ if (!hasError) return;
64
+ const mag = anim.shakeMagnitude;
65
+ const dur = anim.shakeDuration;
66
+ shakeAnim.value = (0, _reactNativeReanimated.withSequence)((0, _reactNativeReanimated.withTiming)(-mag, {
67
+ duration: dur
68
+ }), (0, _reactNativeReanimated.withTiming)(mag, {
69
+ duration: dur
70
+ }), (0, _reactNativeReanimated.withTiming)(-mag, {
71
+ duration: dur
72
+ }), (0, _reactNativeReanimated.withTiming)(0, {
73
+ duration: dur
74
+ }));
75
+ }, [hasError]);
76
+ const labelAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
77
+ transform: [{
78
+ translateX: shakeAnim.value
79
+ }, {
80
+ translateY: (0, _reactNativeReanimated.interpolate)(focusAnim.value, [0, 1], [0, -anim.labelTranslateY])
81
+ }],
82
+ fontSize: (0, _reactNativeReanimated.interpolate)(focusAnim.value, [0, 1], [theme.fontSize, theme.labelActiveFontSize])
83
+ }));
84
+ function handleFocus() {
85
+ setIsFocused(true);
86
+ onFocus?.();
87
+ }
88
+ function handleBlur() {
89
+ setIsFocused(false);
90
+ onBlur?.();
91
+ }
92
+ function renderTextInput() {
93
+ const inputProps = {
94
+ ref: inputRef,
95
+ editable,
96
+ autoFocus,
97
+ maxLength,
98
+ value,
99
+ placeholder: shouldBeActive ? placeholder : undefined,
100
+ placeholderTextColor: theme.placeholderColor,
101
+ onChangeText,
102
+ onBlur: handleBlur,
103
+ onFocus: handleFocus,
104
+ keyboardType,
105
+ autoCapitalize,
106
+ secureTextEntry,
107
+ selectionColor: theme.selectionColor,
108
+ cursorColor: theme.selectionColor,
109
+ selectionHandleColor: theme.selectionColor,
110
+ underlineColorAndroid: "transparent",
111
+ style: [_defaults.baseStyles.input, {
112
+ color: theme.inputColor,
113
+ fontFamily: theme.fontFamily,
114
+ fontSize: theme.fontSize
115
+ }, right ? _defaults.baseStyles.inputWithRight : undefined, stylesProp?.input],
116
+ ...textInputProps
117
+ };
118
+ const inputElement = renderInput ? renderInput(inputProps) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
119
+ ...inputProps
120
+ });
121
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
122
+ style: [_defaults.baseStyles.inputContainer, {
123
+ backgroundColor: theme.backgroundColor,
124
+ borderRadius: theme.borderRadius,
125
+ minHeight: theme.minHeight
126
+ }, style, stylesProp?.inputContainer],
127
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
128
+ style: [_defaults.baseStyles.labelAndInputArea, stylesProp?.labelAndInputArea],
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
130
+ style: [_defaults.baseStyles.label, {
131
+ color: hasError ? theme.errorColor : theme.labelColor,
132
+ fontFamily: theme.fontFamily
133
+ }, labelAnimatedStyle, stylesProp?.label],
134
+ children: label
135
+ }), inputElement]
136
+ }), right && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
137
+ style: [_defaults.baseStyles.rightContainer, stylesProp?.right],
138
+ children: right
139
+ })]
140
+ });
141
+ }
142
+ function renderContent() {
143
+ if (onPress) {
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
145
+ onPress: onPress,
146
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
147
+ pointerEvents: "none",
148
+ children: renderTextInput()
149
+ })
150
+ });
151
+ }
152
+ return renderTextInput();
153
+ }
154
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
155
+ layout: _reactNativeReanimated.LinearTransition.springify(),
156
+ style: [_defaults.baseStyles.container, stylesProp?.container],
157
+ children: [renderContent(), hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
158
+ style: [_defaults.baseStyles.errorText, {
159
+ fontSize: theme.labelActiveFontSize,
160
+ color: theme.errorColor,
161
+ fontFamily: theme.fontFamily
162
+ }, stylesProp?.error],
163
+ children: error
164
+ })]
165
+ });
166
+ });
167
+ FloatingInput.displayName = "FloatingInput";
168
+ //# sourceMappingURL=FloatingInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_defaults","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FloatingInput","exports","React","forwardRef","value","onChangeText","onBlur","onFocus","onPress","label","placeholder","error","touched","maxLength","keyboardType","autoFocus","editable","autoCapitalize","secureTextEntry","right","renderInput","theme","themeProp","styles","stylesProp","style","animationConfig","animationProp","textInputProps","ref","inputRef","useRef","isFocused","setIsFocused","useState","hasError","DEFAULT_THEME","anim","DEFAULT_ANIMATION","shouldBeActive","focusAnim","useSharedValue","shakeAnim","useImperativeHandle","focus","current","blur","clear","useEffect","withTiming","duration","labelDuration","mag","shakeMagnitude","dur","shakeDuration","withSequence","labelAnimatedStyle","useAnimatedStyle","transform","translateX","translateY","interpolate","labelTranslateY","fontSize","labelActiveFontSize","handleFocus","handleBlur","renderTextInput","inputProps","undefined","placeholderTextColor","placeholderColor","selectionColor","cursorColor","selectionHandleColor","underlineColorAndroid","baseStyles","input","color","inputColor","fontFamily","inputWithRight","inputElement","jsx","TextInput","jsxs","View","inputContainer","backgroundColor","borderRadius","minHeight","children","labelAndInputArea","Text","errorColor","labelColor","rightContainer","renderContent","Pressable","pointerEvents","layout","LinearTransition","springify","container","errorText","displayName"],"sourceRoot":"../../src","sources":["FloatingInput.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AASA,IAAAG,SAAA,GAAAH,OAAA;AAA0E,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,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,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAA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CAAC4D;MACpB,CAAC,EACDzD,UAAU,EAAEb,KAAK,CACjB;MAAAiF,QAAA,EAEDjF;IAAK,CACO,CAChB;EAAA,CACY,CAAC;AAEpB,CACF,CAAC;AAEDX,aAAa,CAAC0G,WAAW,GAAG,eAAe","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.baseStyles = exports.DEFAULT_THEME = exports.DEFAULT_ANIMATION = void 0;
7
+ var _reactNative = require("react-native");
8
+ const DEFAULT_THEME = exports.DEFAULT_THEME = {
9
+ backgroundColor: '#EDEFF2',
10
+ labelColor: '#878A99',
11
+ inputColor: '#36373D',
12
+ errorColor: '#E3152E',
13
+ selectionColor: '#31BE30',
14
+ placeholderColor: '#878A99',
15
+ borderRadius: 14,
16
+ minHeight: 56,
17
+ fontSize: 16,
18
+ labelActiveFontSize: 12,
19
+ fontFamily: 'System'
20
+ };
21
+ const DEFAULT_ANIMATION = exports.DEFAULT_ANIMATION = {
22
+ labelDuration: 200,
23
+ shakeMagnitude: 2,
24
+ shakeDuration: 50,
25
+ labelTranslateY: 10
26
+ };
27
+ const baseStyles = exports.baseStyles = _reactNative.StyleSheet.create({
28
+ container: {},
29
+ inputContainer: {
30
+ flexDirection: 'row',
31
+ alignItems: 'center'
32
+ },
33
+ labelAndInputArea: {
34
+ flex: 1,
35
+ justifyContent: 'center'
36
+ },
37
+ label: {
38
+ position: 'absolute',
39
+ left: 16
40
+ },
41
+ input: {
42
+ paddingTop: 24,
43
+ paddingBottom: 8,
44
+ paddingLeft: 16,
45
+ paddingRight: 16
46
+ },
47
+ inputWithRight: {
48
+ paddingRight: 48
49
+ },
50
+ rightContainer: {
51
+ position: 'absolute',
52
+ right: 12,
53
+ alignSelf: 'center'
54
+ },
55
+ errorText: {
56
+ marginLeft: 8,
57
+ marginTop: 6
58
+ }
59
+ });
60
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","DEFAULT_THEME","exports","backgroundColor","labelColor","inputColor","errorColor","selectionColor","placeholderColor","borderRadius","minHeight","fontSize","labelActiveFontSize","fontFamily","DEFAULT_ANIMATION","labelDuration","shakeMagnitude","shakeDuration","labelTranslateY","baseStyles","StyleSheet","create","container","inputContainer","flexDirection","alignItems","labelAndInputArea","flex","justifyContent","label","position","left","input","paddingTop","paddingBottom","paddingLeft","paddingRight","inputWithRight","rightContainer","right","alignSelf","errorText","marginLeft","marginTop"],"sourceRoot":"../../src","sources":["defaults.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIO,MAAMC,aAA2C,GAAAC,OAAA,CAAAD,aAAA,GAAG;EACzDE,eAAe,EAAE,SAAS;EAC1BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,cAAc,EAAE,SAAS;EACzBC,gBAAgB,EAAE,SAAS;EAC3BC,YAAY,EAAE,EAAE;EAChBC,SAAS,EAAE,EAAE;EACbC,QAAQ,EAAE,EAAE;EACZC,mBAAmB,EAAE,EAAE;EACvBC,UAAU,EAAE;AACd,CAAC;AAEM,MAAMC,iBAAyD,GAAAZ,OAAA,CAAAY,iBAAA,GAAG;EACvEC,aAAa,EAAE,GAAG;EAClBC,cAAc,EAAE,CAAC;EACjBC,aAAa,EAAE,EAAE;EACjBC,eAAe,EAAE;AACnB,CAAC;AAEM,MAAMC,UAAU,GAAAjB,OAAA,CAAAiB,UAAA,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC1CC,SAAS,EAAE,CAAC,CAAC;EACbC,cAAc,EAAE;IACdC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDC,iBAAiB,EAAE;IACjBC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDC,KAAK,EAAE;IACLC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE;EACR,CAAC;EACDC,KAAK,EAAE;IACLC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,CAAC;IAChBC,WAAW,EAAE,EAAE;IACfC,YAAY,EAAE;EAChB,CAAC;EACDC,cAAc,EAAE;IACdD,YAAY,EAAE;EAChB,CAAC;EACDE,cAAc,EAAE;IACdR,QAAQ,EAAE,UAAU;IACpBS,KAAK,EAAE,EAAE;IACTC,SAAS,EAAE;EACb,CAAC;EACDC,SAAS,EAAE;IACTC,UAAU,EAAE,CAAC;IACbC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DEFAULT_ANIMATION", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _defaults.DEFAULT_ANIMATION;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "DEFAULT_THEME", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _defaults.DEFAULT_THEME;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "FloatingInput", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _FloatingInput.FloatingInput;
22
+ }
23
+ });
24
+ var _FloatingInput = require("./FloatingInput");
25
+ var _defaults = require("./defaults");
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FloatingInput","require","_defaults"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}