panelui-native 0.6.0 → 0.7.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/README.md +1 -1
- package/lib/module/components/accordion/index.js +7 -5
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +3 -6
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +67 -3
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/button/index.js +36 -1
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +4 -5
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/inline-select/index.js +171 -46
- package/lib/module/components/inline-select/index.js.map +1 -1
- package/lib/module/components/input/index.js +28 -5
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +0 -1
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +359 -0
- package/lib/module/components/item/index.js.map +1 -0
- package/lib/module/components/label/index.js +5 -3
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/message/index.js +318 -0
- package/lib/module/components/message/index.js.map +1 -0
- package/lib/module/components/scroll-fade/index.js +119 -71
- package/lib/module/components/scroll-fade/index.js.map +1 -1
- package/lib/module/components/select/index.js +35 -6
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/shimmer/index.js +111 -64
- package/lib/module/components/shimmer/index.js.map +1 -1
- package/lib/module/components/surface/index.js +3 -2
- package/lib/module/components/surface/index.js.map +1 -1
- package/lib/module/components/switch/index.js +20 -1
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/toast/index.js +7 -8
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/typography/index.js +3 -3
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-breakpoint.js +2 -2
- package/lib/module/hooks/use-copy-to-clipboard.js +0 -2
- package/lib/module/hooks/use-copy-to-clipboard.js.map +1 -1
- package/lib/module/hooks/use-keyboard-avoidance.js +120 -0
- package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -0
- package/lib/module/icons/index.js +4 -4
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/index.js +53 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +40 -0
- package/lib/module/primitives/keyboard-avoider.js.map +1 -0
- package/lib/module/providers/panel-ui-provider.js +24 -4
- package/lib/module/providers/panel-ui-provider.js.map +1 -1
- package/lib/module/theme/use-theme.js +1 -1
- package/lib/typescript/src/components/accordion/index.d.ts +7 -5
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts +3 -6
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +21 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +11 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +4 -5
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/inline-select/index.d.ts +29 -6
- package/lib/typescript/src/components/inline-select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/index.d.ts +13 -0
- package/lib/typescript/src/components/input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts +0 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts +286 -0
- package/lib/typescript/src/components/item/index.d.ts.map +1 -0
- package/lib/typescript/src/components/label/index.d.ts +5 -3
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message/index.d.ts +170 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -0
- package/lib/typescript/src/components/scroll-fade/index.d.ts +18 -9
- package/lib/typescript/src/components/scroll-fade/index.d.ts.map +1 -1
- package/lib/typescript/src/components/select/index.d.ts +16 -1
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/shimmer/index.d.ts +38 -20
- package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts +10 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts +4 -4
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-breakpoint.d.ts +2 -2
- package/lib/typescript/src/hooks/use-copy-to-clipboard.d.ts +0 -2
- package/lib/typescript/src/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts +20 -0
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +4 -4
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +35 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts +22 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -0
- package/lib/typescript/src/providers/panel-ui-provider.d.ts +1 -1
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
- package/lib/typescript/src/theme/use-theme.d.ts +1 -1
- package/package.json +12 -3
- package/src/components/accordion/index.tsx +7 -5
- package/src/components/alert/index.tsx +3 -6
- package/src/components/bottom-sheet/index.tsx +82 -2
- package/src/components/button/index.tsx +52 -0
- package/src/components/empty-state/index.tsx +4 -5
- package/src/components/inline-select/index.tsx +191 -44
- package/src/components/input/index.tsx +39 -3
- package/src/components/input-group/index.tsx +0 -1
- package/src/components/item/index.tsx +387 -0
- package/src/components/label/index.tsx +5 -3
- package/src/components/message/index.tsx +312 -0
- package/src/components/scroll-fade/index.tsx +163 -51
- package/src/components/select/index.tsx +54 -9
- package/src/components/shimmer/index.tsx +151 -58
- package/src/components/surface/index.tsx +3 -2
- package/src/components/switch/index.tsx +27 -1
- package/src/components/toast/index.tsx +7 -8
- package/src/components/typography/index.tsx +3 -3
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-breakpoint.ts +2 -2
- package/src/hooks/use-copy-to-clipboard.ts +0 -2
- package/src/hooks/use-keyboard-avoidance.ts +140 -0
- package/src/icons/index.tsx +4 -4
- package/src/index.ts +32 -0
- package/src/native/index.ts +79 -0
- package/src/primitives/keyboard-avoider.tsx +49 -0
- package/src/providers/panel-ui-provider.tsx +30 -9
- package/src/theme/use-theme.ts +1 -1
- package/theme.css +5 -3
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* InlineSelect — a select that reveals its options next to the trigger instead
|
|
5
|
+
* of taking over the screen with a sheet.
|
|
6
|
+
*
|
|
7
|
+
* Two presentations, because the right one depends on what surrounds it:
|
|
8
|
+
*
|
|
9
|
+
* - Inline (default) expands the list in normal layout flow. Everything below
|
|
10
|
+
* moves down. Fine inside a settings list where that reads as the row
|
|
11
|
+
* growing, wrong anywhere the shift is jarring.
|
|
12
|
+
* - `overlay` floats the list above the page through a portal, anchored to the
|
|
13
|
+
* trigger and flipped above it when there is no room below. Nothing else on
|
|
14
|
+
* the screen moves.
|
|
15
|
+
*/
|
|
16
|
+
import { Children, createContext, isValidElement, useCallback, useContext, useMemo, useRef, useState } from 'react';
|
|
17
|
+
import { Pressable, ScrollView, useWindowDimensions, View } from 'react-native';
|
|
5
18
|
import Animated, { FadeIn, FadeOut, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
19
|
import { tv } from 'tailwind-variants';
|
|
7
20
|
import { useCSSVariable } from 'uniwind';
|
|
8
21
|
import { CheckIcon, ChevronDownIcon } from "../../icons/index.js";
|
|
22
|
+
import { Portal } from "../../primitives/portal.js";
|
|
9
23
|
import { Text } from "../../primitives/text.js";
|
|
10
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
25
|
const inlineSelectVariants = tv({
|
|
@@ -13,7 +27,7 @@ const inlineSelectVariants = tv({
|
|
|
13
27
|
trigger: 'w-full flex-row items-center justify-between gap-3 rounded-2xl border border-input bg-background px-4 py-3.5',
|
|
14
28
|
triggerLabel: 'flex-1 text-base font-medium text-foreground',
|
|
15
29
|
placeholder: 'flex-1 text-base text-muted-foreground',
|
|
16
|
-
list: '
|
|
30
|
+
list: 'overflow-hidden rounded-2xl border border-border bg-popover p-2 shadow-sm',
|
|
17
31
|
item: 'flex-row items-center gap-2 rounded-xl px-3 py-3',
|
|
18
32
|
itemLabel: 'flex-1 text-base font-medium text-foreground',
|
|
19
33
|
itemIndicator: 'h-5 w-5 items-center justify-center'
|
|
@@ -28,11 +42,22 @@ const inlineSelectVariants = tv({
|
|
|
28
42
|
true: {
|
|
29
43
|
trigger: 'opacity-[0.64]'
|
|
30
44
|
}
|
|
45
|
+
},
|
|
46
|
+
presentation: {
|
|
47
|
+
inline: {
|
|
48
|
+
list: 'mt-2'
|
|
49
|
+
},
|
|
50
|
+
overlay: {
|
|
51
|
+
list: 'shadow-lg'
|
|
52
|
+
}
|
|
31
53
|
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
presentation: 'inline'
|
|
32
57
|
}
|
|
33
58
|
});
|
|
34
59
|
const InlineSelectContext = /*#__PURE__*/createContext(null);
|
|
35
|
-
/** Option row.
|
|
60
|
+
/** Option row. */
|
|
36
61
|
function InlineSelectItem({
|
|
37
62
|
value,
|
|
38
63
|
label
|
|
@@ -69,20 +94,29 @@ function InlineSelectItem({
|
|
|
69
94
|
})]
|
|
70
95
|
});
|
|
71
96
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*/
|
|
97
|
+
|
|
98
|
+
/** Trigger frame in window coordinates, measured when the list opens. */
|
|
99
|
+
|
|
76
100
|
function InlineSelectRoot({
|
|
77
101
|
className,
|
|
78
102
|
value,
|
|
79
103
|
onValueChange,
|
|
80
104
|
placeholder = 'Select an option',
|
|
81
105
|
disabled,
|
|
106
|
+
overlay = false,
|
|
107
|
+
overlayWidth = 'trigger',
|
|
108
|
+
overlayOffset = 8,
|
|
109
|
+
onOpenChange,
|
|
82
110
|
children
|
|
83
111
|
}) {
|
|
84
112
|
const [open, setOpen] = useState(false);
|
|
113
|
+
const [anchor, setAnchor] = useState(null);
|
|
114
|
+
const [listHeight, setListHeight] = useState(0);
|
|
115
|
+
const triggerRef = useRef(null);
|
|
85
116
|
const chevron = useSharedValue(0);
|
|
117
|
+
const {
|
|
118
|
+
height: screenHeight
|
|
119
|
+
} = useWindowDimensions();
|
|
86
120
|
const selectedLabel = useMemo(() => {
|
|
87
121
|
let label;
|
|
88
122
|
Children.forEach(children, child => {
|
|
@@ -92,26 +126,52 @@ function InlineSelectRoot({
|
|
|
92
126
|
});
|
|
93
127
|
return label;
|
|
94
128
|
}, [children, value]);
|
|
129
|
+
const close = useCallback(() => {
|
|
130
|
+
chevron.value = withTiming(0, {
|
|
131
|
+
duration: 160
|
|
132
|
+
});
|
|
133
|
+
setOpen(false);
|
|
134
|
+
onOpenChange?.(false);
|
|
135
|
+
}, [chevron, onOpenChange]);
|
|
95
136
|
const toggle = useCallback(() => {
|
|
96
|
-
|
|
97
|
-
|
|
137
|
+
if (open) {
|
|
138
|
+
close();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const show = () => {
|
|
142
|
+
chevron.value = withTiming(1, {
|
|
98
143
|
duration: 160
|
|
99
144
|
});
|
|
100
|
-
|
|
145
|
+
setOpen(true);
|
|
146
|
+
onOpenChange?.(true);
|
|
147
|
+
};
|
|
148
|
+
if (!overlay) {
|
|
149
|
+
show();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The list is positioned in window coordinates, so it has to know where
|
|
154
|
+
// the trigger actually landed — not where layout said it would.
|
|
155
|
+
triggerRef.current?.measureInWindow((x, y, width, height) => {
|
|
156
|
+
setAnchor({
|
|
157
|
+
x,
|
|
158
|
+
y,
|
|
159
|
+
width,
|
|
160
|
+
height
|
|
161
|
+
});
|
|
162
|
+
show();
|
|
101
163
|
});
|
|
102
|
-
}, [chevron]);
|
|
164
|
+
}, [chevron, close, onOpenChange, open, overlay]);
|
|
103
165
|
const context = useMemo(() => ({
|
|
104
166
|
value,
|
|
105
167
|
onSelect: next => {
|
|
106
168
|
onValueChange(next);
|
|
107
|
-
|
|
108
|
-
duration: 160
|
|
109
|
-
});
|
|
110
|
-
setOpen(false);
|
|
169
|
+
close();
|
|
111
170
|
}
|
|
112
|
-
}), [value, onValueChange,
|
|
171
|
+
}), [value, onValueChange, close]);
|
|
113
172
|
const slots = inlineSelectVariants({
|
|
114
|
-
disabled: !!disabled
|
|
173
|
+
disabled: !!disabled,
|
|
174
|
+
presentation: overlay ? 'overlay' : 'inline'
|
|
115
175
|
});
|
|
116
176
|
const chevronColor = useCSSVariable('--color-muted-foreground');
|
|
117
177
|
const chevronStyle = useAnimatedStyle(() => ({
|
|
@@ -119,38 +179,103 @@ function InlineSelectRoot({
|
|
|
119
179
|
rotate: `${chevron.value * 180}deg`
|
|
120
180
|
}]
|
|
121
181
|
}));
|
|
122
|
-
|
|
182
|
+
const trigger = /*#__PURE__*/_jsxs(Pressable, {
|
|
183
|
+
ref: triggerRef,
|
|
184
|
+
accessibilityRole: "button",
|
|
185
|
+
accessibilityState: {
|
|
186
|
+
disabled: !!disabled,
|
|
187
|
+
expanded: open
|
|
188
|
+
},
|
|
189
|
+
disabled: disabled,
|
|
190
|
+
onPress: toggle,
|
|
191
|
+
className: slots.trigger(),
|
|
192
|
+
children: [selectedLabel ? /*#__PURE__*/_jsx(Text, {
|
|
193
|
+
className: slots.triggerLabel(),
|
|
194
|
+
children: selectedLabel
|
|
195
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
196
|
+
className: slots.placeholder(),
|
|
197
|
+
children: placeholder
|
|
198
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
199
|
+
style: chevronStyle,
|
|
200
|
+
children: /*#__PURE__*/_jsx(ChevronDownIcon, {
|
|
201
|
+
color: typeof chevronColor === 'string' ? chevronColor : '#737373'
|
|
202
|
+
})
|
|
203
|
+
})]
|
|
204
|
+
});
|
|
205
|
+
if (!overlay) {
|
|
206
|
+
return /*#__PURE__*/_jsx(InlineSelectContext.Provider, {
|
|
207
|
+
value: context,
|
|
208
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
209
|
+
className: className,
|
|
210
|
+
children: [trigger, open ? /*#__PURE__*/_jsx(Animated.View, {
|
|
211
|
+
entering: FadeIn.duration(140),
|
|
212
|
+
exiting: FadeOut.duration(120),
|
|
213
|
+
className: slots.list(),
|
|
214
|
+
children: children
|
|
215
|
+
}) : null]
|
|
216
|
+
})
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Flip above the trigger when the list would run off the bottom. listHeight
|
|
221
|
+
// is 0 on the first frame, so the list opens downwards and corrects itself
|
|
222
|
+
// once measured — which is invisible inside the 140ms fade.
|
|
223
|
+
const spaceBelow = anchor ? screenHeight - (anchor.y + anchor.height) - overlayOffset : 0;
|
|
224
|
+
const flip = !!anchor && listHeight > 0 && listHeight > spaceBelow;
|
|
225
|
+
const overlayPosition = anchor ? {
|
|
226
|
+
position: 'absolute',
|
|
227
|
+
left: anchor.x,
|
|
228
|
+
...(flip ? {
|
|
229
|
+
bottom: screenHeight - anchor.y + overlayOffset
|
|
230
|
+
} : {
|
|
231
|
+
top: anchor.y + anchor.height + overlayOffset
|
|
232
|
+
}),
|
|
233
|
+
...(overlayWidth === 'trigger' ? {
|
|
234
|
+
width: anchor.width
|
|
235
|
+
} : typeof overlayWidth === 'number' ? {
|
|
236
|
+
width: overlayWidth
|
|
237
|
+
} : {
|
|
238
|
+
minWidth: anchor.width
|
|
239
|
+
}),
|
|
240
|
+
// Never collapse to nothing in a cramped viewport — the list scrolls.
|
|
241
|
+
maxHeight: Math.max((flip ? anchor.y : spaceBelow) - overlayOffset, 160)
|
|
242
|
+
} : null;
|
|
243
|
+
const onListLayout = event => {
|
|
244
|
+
setListHeight(event.nativeEvent.layout.height);
|
|
245
|
+
};
|
|
246
|
+
return /*#__PURE__*/_jsxs(InlineSelectContext.Provider, {
|
|
123
247
|
value: context,
|
|
124
|
-
children: /*#__PURE__*/
|
|
248
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
125
249
|
className: className,
|
|
126
|
-
children:
|
|
250
|
+
children: trigger
|
|
251
|
+
}), open && overlayPosition ? /*#__PURE__*/_jsxs(Portal, {
|
|
252
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
127
253
|
accessibilityRole: "button",
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
254
|
+
accessibilityLabel: "Close",
|
|
255
|
+
onPress: close,
|
|
256
|
+
style: {
|
|
257
|
+
position: 'absolute',
|
|
258
|
+
top: 0,
|
|
259
|
+
left: 0,
|
|
260
|
+
right: 0,
|
|
261
|
+
bottom: 0
|
|
262
|
+
}
|
|
263
|
+
}), /*#__PURE__*/_jsx(InlineSelectContext.Provider, {
|
|
264
|
+
value: context,
|
|
265
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
266
|
+
entering: FadeIn.duration(140),
|
|
267
|
+
exiting: FadeOut.duration(120),
|
|
268
|
+
onLayout: onListLayout,
|
|
269
|
+
style: overlayPosition,
|
|
270
|
+
className: slots.list(),
|
|
271
|
+
children: /*#__PURE__*/_jsx(ScrollView, {
|
|
272
|
+
bounces: false,
|
|
273
|
+
showsVerticalScrollIndicator: false,
|
|
274
|
+
children: children
|
|
145
275
|
})
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
exiting: FadeOut.duration(120),
|
|
150
|
-
className: slots.list(),
|
|
151
|
-
children: children
|
|
152
|
-
}) : null]
|
|
153
|
-
})
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
}) : null]
|
|
154
279
|
});
|
|
155
280
|
}
|
|
156
281
|
export const InlineSelect = Object.assign(InlineSelectRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","createContext","isValidElement","useCallback","useContext","useMemo","useState","Pressable","View","Animated","FadeIn","FadeOut","useAnimatedStyle","useSharedValue","withTiming","tv","useCSSVariable","CheckIcon","ChevronDownIcon","Text","jsx","_jsx","jsxs","_jsxs","inlineSelectVariants","slots","trigger","triggerLabel","placeholder","list","item","itemLabel","itemIndicator","variants","selected","true","disabled","InlineSelectContext","InlineSelectItem","value","label","context","Error","checkColor","accessibilityRole","accessibilityState","onPress","onSelect","className","children","size","color","InlineSelectRoot","onValueChange","open","setOpen","chevron","selectedLabel","forEach","child","props","toggle","current","
|
|
1
|
+
{"version":3,"names":["Children","createContext","isValidElement","useCallback","useContext","useMemo","useRef","useState","Pressable","ScrollView","useWindowDimensions","View","Animated","FadeIn","FadeOut","useAnimatedStyle","useSharedValue","withTiming","tv","useCSSVariable","CheckIcon","ChevronDownIcon","Portal","Text","jsx","_jsx","jsxs","_jsxs","inlineSelectVariants","slots","trigger","triggerLabel","placeholder","list","item","itemLabel","itemIndicator","variants","selected","true","disabled","presentation","inline","overlay","defaultVariants","InlineSelectContext","InlineSelectItem","value","label","context","Error","checkColor","accessibilityRole","accessibilityState","onPress","onSelect","className","children","size","color","InlineSelectRoot","onValueChange","overlayWidth","overlayOffset","onOpenChange","open","setOpen","anchor","setAnchor","listHeight","setListHeight","triggerRef","chevron","height","screenHeight","selectedLabel","forEach","child","props","close","duration","toggle","show","current","measureInWindow","x","y","width","next","chevronColor","chevronStyle","transform","rotate","ref","expanded","style","Provider","entering","exiting","spaceBelow","flip","overlayPosition","position","left","bottom","top","minWidth","maxHeight","Math","max","onListLayout","event","nativeEvent","layout","accessibilityLabel","right","onLayout","bounces","showsVerticalScrollIndicator","InlineSelect","Object","assign","Item"],"sourceRoot":"../../../../src","sources":["components/inline-select/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AACrB,OAAOC,QAAQ,IACbC,MAAM,EACNC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,eAAe,QAAQ,sBAAa;AACxD,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,oBAAoB,GAAGV,EAAE,CAAC;EAC9BW,KAAK,EAAE;IACLC,OAAO,EACL,8GAA8G;IAChHC,YAAY,EAAE,8CAA8C;IAC5DC,WAAW,EAAE,wCAAwC;IACrDC,IAAI,EAAE,2EAA2E;IACjFC,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,8CAA8C;IACzDC,aAA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AI,CAAC,CAAE;UAAAwB,QAAA,eAExBhC,IAAA,CAAChB,UAAU;YAAC4G,OAAO,EAAE,KAAM;YAACC,4BAA4B,EAAE,KAAM;YAAA7D,QAAA,EAC7DA;UAAQ,CACC;QAAC,CACA;MAAC,CACY,CAAC;IAAA,CACzB,CAAC,GACP,IAAI;EAAA,CACoB,CAAC;AAEnC;AAEA,OAAO,MAAM8D,YAAY,GAAGC,MAAM,CAACC,MAAM,CAAC7D,gBAAgB,EAAE;EAC1D8D,IAAI,EAAE5E;AACR,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,8 +4,9 @@ import { forwardRef, useCallback, useState } from 'react';
|
|
|
4
4
|
import { TextInput, View } from 'react-native';
|
|
5
5
|
import { tv } from 'tailwind-variants';
|
|
6
6
|
import { useCSSVariable } from 'uniwind';
|
|
7
|
+
import { KeyboardAvoider } from "../../primitives/keyboard-avoider.js";
|
|
7
8
|
import { Text } from "../../primitives/text.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const inputVariants = tv({
|
|
10
11
|
slots: {
|
|
11
12
|
container: 'w-full gap-1.5',
|
|
@@ -39,6 +40,8 @@ export const Input = /*#__PURE__*/forwardRef(({
|
|
|
39
40
|
description,
|
|
40
41
|
errorMessage,
|
|
41
42
|
disabled,
|
|
43
|
+
avoidKeyboard = false,
|
|
44
|
+
keyboardOffset = 16,
|
|
42
45
|
onFocus,
|
|
43
46
|
onBlur,
|
|
44
47
|
...props
|
|
@@ -58,10 +61,7 @@ export const Input = /*#__PURE__*/forwardRef(({
|
|
|
58
61
|
setFocused(false);
|
|
59
62
|
onBlur?.(event);
|
|
60
63
|
}, [onBlur]);
|
|
61
|
-
|
|
62
|
-
className: slots.container({
|
|
63
|
-
className: containerClassName
|
|
64
|
-
}),
|
|
64
|
+
const body = /*#__PURE__*/_jsxs(_Fragment, {
|
|
65
65
|
children: [label ? /*#__PURE__*/_jsx(Text, {
|
|
66
66
|
className: slots.label(),
|
|
67
67
|
children: label
|
|
@@ -87,6 +87,29 @@ export const Input = /*#__PURE__*/forwardRef(({
|
|
|
87
87
|
children: description
|
|
88
88
|
}) : null]
|
|
89
89
|
});
|
|
90
|
+
const containerClasses = slots.container({
|
|
91
|
+
className: containerClassName
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* The keyboard hook is deliberately behind a component boundary rather
|
|
96
|
+
* than an `enabled` flag. Calling it at all has global consequences —
|
|
97
|
+
* without the keyboard controller installed it falls back to Reanimated's
|
|
98
|
+
* useAnimatedKeyboard, which switches Android out of adjustResize for the
|
|
99
|
+
* whole app. A field that never asked to avoid the keyboard must not do
|
|
100
|
+
* that to every other screen.
|
|
101
|
+
*/
|
|
102
|
+
if (avoidKeyboard) {
|
|
103
|
+
return /*#__PURE__*/_jsx(KeyboardAvoider, {
|
|
104
|
+
offset: keyboardOffset,
|
|
105
|
+
className: containerClasses,
|
|
106
|
+
children: body
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/_jsx(View, {
|
|
110
|
+
className: containerClasses,
|
|
111
|
+
children: body
|
|
112
|
+
});
|
|
90
113
|
});
|
|
91
114
|
Input.displayName = 'Input';
|
|
92
115
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useCallback","useState","TextInput","View","tv","useCSSVariable","Text","jsx","_jsx","jsxs","_jsxs","inputVariants","slots","container","field","label","description","error","variants","focused","true","invalid","disabled","Input","className","containerClassName","errorMessage","onFocus","onBlur","props","ref","setFocused","placeholderColor","handleFocus","event","handleBlur","children","editable","accessibilityLabel","accessibilityState","placeholderTextColor","undefined","displayName"],"sourceRoot":"../../../../src","sources":["components/input/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACzD,SAASC,SAAS,EAAEC,IAAI,QAA6B,cAAc;AACnE,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"names":["forwardRef","useCallback","useState","TextInput","View","tv","useCSSVariable","KeyboardAvoider","Text","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","inputVariants","slots","container","field","label","description","error","variants","focused","true","invalid","disabled","Input","className","containerClassName","errorMessage","avoidKeyboard","keyboardOffset","onFocus","onBlur","props","ref","setFocused","placeholderColor","handleFocus","event","handleBlur","body","children","editable","accessibilityLabel","accessibilityState","placeholderTextColor","undefined","containerClasses","offset","displayName"],"sourceRoot":"../../../../src","sources":["components/input/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACzD,SAASC,SAAS,EAAEC,IAAI,QAA6B,cAAc;AACnE,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,eAAe,QAAQ,sCAAmC;AACnE,SAASC,IAAI,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,aAAa,GAAGV,EAAE,CAAC;EACvBW,KAAK,EAAE;IACLC,SAAS,EAAE,gBAAgB;IAC3BC,KAAK,EACH,yFAAyF;IAC3FC,KAAK,EAAE,qCAAqC;IAC5CC,WAAW,EAAE,+BAA+B;IAC5CC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,IAAI,EAAE;QAAEN,KAAK,EAAE;MAAc;IAC/B,CAAC;IACDO,OAAO,EAAE;MACPD,IAAI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
* Adapted from: heroui-inc/heroui-native src/components/input-group/
|
|
7
6
|
* Prefix and Suffix are absolutely positioned and their measured widths become
|
|
8
7
|
* padding on the Input, so text never runs underneath a decorator regardless
|
|
9
8
|
* of how wide that decorator turns out to be.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","View","tv","Input","jsx","_jsx","inputGroupVariants","slots","root","prefix","suffix","variants","isDisabled","true","InputGroupContext","useInputGroup","InputGroupRoot","className","children","props","ref","prefixWidth","setPrefixWidth","suffixWidth","setSuffixWidth","value","Provider","displayName","createDecorator","side","Decorator","isDecorative","onLayout","group","setWidth","handleLayout","event","nativeEvent","layout","width","pointerEvents","accessibilityElementsHidden","importantForAccessibility","InputGroupPrefix","InputGroupSuffix","InputGroupInput","style","disabled","paddingLeft","paddingRight","InputGroup","Object","assign","Prefix","Suffix"],"sourceRoot":"../../../../src","sources":["components/input-group/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","View","tv","Input","jsx","_jsx","inputGroupVariants","slots","root","prefix","suffix","variants","isDisabled","true","InputGroupContext","useInputGroup","InputGroupRoot","className","children","props","ref","prefixWidth","setPrefixWidth","suffixWidth","setSuffixWidth","value","Provider","displayName","createDecorator","side","Decorator","isDecorative","onLayout","group","setWidth","handleLayout","event","nativeEvent","layout","width","pointerEvents","accessibilityElementsHidden","importantForAccessibility","InputGroupPrefix","InputGroupSuffix","InputGroupInput","style","disabled","paddingLeft","paddingRight","InputGroup","Object","assign","Prefix","Suffix"],"sourceRoot":"../../../../src","sources":["components/input-group/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SACEC,IAAI,QAIC,cAAc;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