@autobusal/routes-order 1.33.9 → 1.34.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.34.0 (2026-08-29)
4
+
5
+ - The bare /bus-lines form suggests an origin near the visitor and no longer pre-fills a destination; a URL that names one still wins.
6
+
7
+ ## 1.33.10 (2026-08-29)
8
+
9
+ - The return date falls back to the outbound when the URL carries no real one ('none' on a one-way link), so switching a collapsed search to Round Trip opens the calendar on the month being travelled and cannot offer a day before the departure.
10
+ - The collapsed search panel sits above the step markers: its backdrop-filter creates a stacking context, so the date picker used to draw underneath them.
11
+
3
12
  ## 1.33.9 (2026-08-28)
4
13
 
5
14
  - Return-leg empty state fetches RETURN alternatives (swapped pair + return date) and its suggested-day links fill the return slot instead of rewriting the departure; nearby-city swaps map back to the URL's outbound pair (sweep #50).
package/Step1/Step1.tsx CHANGED
@@ -59,6 +59,7 @@ const Step1 = ({ value, redirected, t, onSave }: Props): JSX.Element => {
59
59
  to={ `${ prepared.to }${ prepared.stop_to ? `:${ prepared.stop_to }` : '' }` }
60
60
  departure={ prepared.departure }
61
61
  _return={ prepared._return ?? '' }
62
+ suggest
62
63
  adultsNo={ prepared.adults }
63
64
  childrenNo={ prepared.children }
64
65
  babiesNo={ prepared.babies }
package/Step1/prepare.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Params } from 'react-router-dom';
2
- import { futureDate } from '@autobusal/utilities';
2
+ import { futureDate, isPreparedDate } from '@autobusal/utilities';
3
3
  import { RoutesSearchForm } from '@autobusal/routes-search/types';
4
4
 
5
5
  const prepare = (
@@ -15,10 +15,38 @@ const prepare = (
15
15
  const type = params.type === 'return' ? 'return' : 'departure';
16
16
 
17
17
  const from = params.from ?? defaultLocations.from;
18
- const to = params.to ?? defaultLocations.to;
18
+ /*
19
+ * Edited: Claude - Date: 2026-08-29
20
+ *
21
+ * No default DESTINATION. A URL that names one is honoured; a bare form
22
+ * is left empty, because the destination is the one thing only the
23
+ * visitor knows and a pre-filled wrong one has to be noticed before it
24
+ * can be corrected. The origin still defaults - see the search form's
25
+ * `suggest`, which opens it near the visitor.
26
+ */
27
+ const to = params.to ?? '';
19
28
 
20
29
  const departure = params.departure?.replace(/-/g, '/') ?? futureDate(1);
21
- const _return = params._return?.replace(/-/g, '/') ?? futureDate(2);
30
+
31
+ /*
32
+ * Edited: Claude - Date: 2026-08-29
33
+ *
34
+ * THE RETURN DATE IS TIED TO THE OUTBOUND. A one-way URL carries the
35
+ * literal "none" in the return slot, and `??` only catches null - so
36
+ * "none" travelled all the way into the picker, whose grid is built by
37
+ * splitting on "/" and feeding Date.UTC: an Invalid Date, rendered as
38
+ * January. Switching a collapsed search from One Way to Round Trip
39
+ * showed exactly that.
40
+ *
41
+ * Anything that is not a real date falls back to the departure, which is
42
+ * also the picker's floor - so the return calendar opens on the month
43
+ * being travelled and cannot offer a day before the outbound.
44
+ */
45
+ const requested = params._return?.replace(/-/g, '/');
46
+
47
+ const _return = isPreparedDate(requested)
48
+ ? String(requested)
49
+ : (isPreparedDate(departure) ? departure : futureDate(2));
22
50
 
23
51
  const adults = params.adults ?? 1;
24
52
  const children = params.children ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.33.9",
3
+ "version": "1.34.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
package/styles.ts CHANGED
@@ -94,6 +94,19 @@ export const SearchPanel = styled.div<{ $open: boolean }>`
94
94
  display: ${ props => props.$open ? 'block' : 'none' };
95
95
  margin-top: 14px;
96
96
  padding: 20px;
97
+
98
+ /**
99
+ * Edited: Claude - Date: 2026-08-29
100
+ *
101
+ * ABOVE THE STEPS, because backdrop-filter below creates a stacking
102
+ * context: everything inside this panel is confined to it, so the date
103
+ * picker's own z-index (100) could never beat the step markers sitting
104
+ * at z-index 1 in the page's context. Opening the collapsed search and
105
+ * clicking a date drew the calendar UNDERNEATH the 1-2-3-4 circles.
106
+ * Raising the panel itself lifts its whole subtree with it.
107
+ */
108
+ position: relative;
109
+ z-index: 20;
97
110
  background: ${ props => props.theme.header.transparent };
98
111
  backdrop-filter: blur(25px);
99
112
  -webkit-backdrop-filter: blur(25px);