@delacour/react-native-ui 0.6.0-alpha.20261102140613 → 0.6.0-alpha.20261102141042
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delacour/react-native-ui",
|
|
3
|
-
"version": "0.6.0-alpha.
|
|
3
|
+
"version": "0.6.0-alpha.20261102141042",
|
|
4
4
|
"description": "React Native UI components — Uniwind, Reanimated, Gesture Handler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
"expo-blur": ">=15",
|
|
182
182
|
"@maplibre/maplibre-react-native": "^11.5.0",
|
|
183
183
|
"@central-icons-react-native/round-outlined-radius-1-stroke-1.5": "^1.1",
|
|
184
|
-
"@delacour/react-native-bottom-sheet": "0.6.0-alpha.
|
|
185
|
-
"@delacour/react-native-charts": "0.6.0-alpha.
|
|
184
|
+
"@delacour/react-native-bottom-sheet": "0.6.0-alpha.20261102141042",
|
|
185
|
+
"@delacour/react-native-charts": "0.6.0-alpha.20261102141042",
|
|
186
186
|
"@legendapp/list": ">=3.3",
|
|
187
187
|
"react-native-skia": ">=3.7.3",
|
|
188
188
|
"expo-linear-gradient": ">=15",
|
|
@@ -51,10 +51,12 @@ The subpath imports `BottomSheet`, so an app using it installs the optional
|
|
|
51
51
|
`resolveShouldClose`: a single day → yes, `null` → no; a range → only with both ends; multiple →
|
|
52
52
|
never, Done closes it. Closing waits `DATE_PICKER_CLOSE_DELAY` (120 ms) so the filled circle is
|
|
53
53
|
seen; under calm motion it does not wait, because the pause is there for the eye and reads as
|
|
54
|
-
lag otherwise.
|
|
54
|
+
lag otherwise. Every tap cancels the last tap's pending close, so starting a new range or
|
|
55
|
+
deselecting the day inside that pause keeps the sheet open.
|
|
55
56
|
- **A half-picked range is never reported.** The first tap is held in `rangeDraft` inside the
|
|
56
57
|
root; `onValueChange` fires once the range is complete, and on Clear. Dismissing the sheet —
|
|
57
|
-
swipe, scrim, close, Done — drops the draft
|
|
58
|
+
swipe, scrim, close, Done, or a controlled `isOpen={false}` — drops the draft and any pending
|
|
59
|
+
close, so the last complete range stands. A caller who
|
|
58
60
|
reads the value on every change would otherwise have to handle `{ start, end: null }` everywhere
|
|
59
61
|
they use it.
|
|
60
62
|
- **While open, the trigger shows the draft.** "12 Oct 2026 –" with a muted "End" behind the
|
|
@@ -138,6 +138,14 @@ function DatePickerRoot(props: DatePickerProps): ReactElement {
|
|
|
138
138
|
}, []);
|
|
139
139
|
useEffect(() => cancelPendingClose, [cancelPendingClose]);
|
|
140
140
|
|
|
141
|
+
// A caller that closes a controlled sheet with `isOpen={false}` skips `close()`, so the sheet
|
|
142
|
+
// drops its half-picked range and pending close here too. An inline picker never opens or closes.
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (isOpen || presentation === "inline") return;
|
|
145
|
+
cancelPendingClose();
|
|
146
|
+
setRangeDraft(null);
|
|
147
|
+
}, [cancelPendingClose, isOpen, presentation]);
|
|
148
|
+
|
|
141
149
|
const trigger = resolveTriggerState({ ...axes, isOpen });
|
|
142
150
|
|
|
143
151
|
const open = useCallback(() => {
|
|
@@ -179,8 +187,11 @@ function DatePickerRoot(props: DatePickerProps): ReactElement {
|
|
|
179
187
|
[cancelPendingClose, isCalm, locale, presentation, setOpen]
|
|
180
188
|
);
|
|
181
189
|
|
|
190
|
+
// Every tap cancels the last selection's pending close. `finish()` schedules a new one only
|
|
191
|
+
// when this selection is complete, so a new range start or a deselect keeps the sheet open.
|
|
182
192
|
const select = useCallback(
|
|
183
193
|
(next: CalendarSelectionState) => {
|
|
194
|
+
cancelPendingClose();
|
|
184
195
|
if (next.mode === "range" && !resolveShouldClose(next)) {
|
|
185
196
|
setRangeDraft(next.value);
|
|
186
197
|
return;
|
|
@@ -189,7 +200,7 @@ function DatePickerRoot(props: DatePickerProps): ReactElement {
|
|
|
189
200
|
setValue(next);
|
|
190
201
|
if (resolveShouldClose(next)) finish(next);
|
|
191
202
|
},
|
|
192
|
-
[finish, setValue]
|
|
203
|
+
[cancelPendingClose, finish, setValue]
|
|
193
204
|
);
|
|
194
205
|
|
|
195
206
|
const clear = useCallback(() => {
|