@autobusal/routes-order 1.37.1 → 1.37.2
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/Found/Route/Route.tsx +15 -0
- package/Found/Route/styles.ts +40 -4
- package/package.json +1 -1
package/Found/Route/Route.tsx
CHANGED
|
@@ -288,6 +288,7 @@ const Route = ({ data, type, date, passengers, t, onSave, children }: Props): JS
|
|
|
288
288
|
right under the button, and a wrap moves both together. */ }
|
|
289
289
|
<ButtonDetails
|
|
290
290
|
className="details-toggle"
|
|
291
|
+
$only="narrow"
|
|
291
292
|
type="button"
|
|
292
293
|
aria-expanded={ details }
|
|
293
294
|
onClick={ () => setDetails(!details) }
|
|
@@ -300,6 +301,20 @@ const Route = ({ data, type, date, passengers, t, onSave, children }: Props): JS
|
|
|
300
301
|
|
|
301
302
|
{ children }
|
|
302
303
|
|
|
304
|
+
{ /* Claude - 2026-09-01: the wide-screen copy, back where it sat before
|
|
305
|
+
the phone rebuild - bottom-left of the card, below the itinerary
|
|
306
|
+
and whatever `children` adds, rather than inside the fare column.
|
|
307
|
+
Exactly one of the two is ever displayed; see ButtonDetails. */ }
|
|
308
|
+
<ButtonDetails
|
|
309
|
+
$only="wide"
|
|
310
|
+
type="button"
|
|
311
|
+
aria-expanded={ details }
|
|
312
|
+
onClick={ () => setDetails(!details) }
|
|
313
|
+
>
|
|
314
|
+
{ details ? <HiChevronUp /> : <HiChevronDown /> }
|
|
315
|
+
{ t('routes_order.step2.route.details') }
|
|
316
|
+
</ButtonDetails>
|
|
317
|
+
|
|
303
318
|
<Details $open={ details }>
|
|
304
319
|
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-01
|
|
305
320
|
Amenities were a separate full-width block under the card.
|
package/Found/Route/styles.ts
CHANGED
|
@@ -730,7 +730,35 @@ export const Details = styled.div<{ $open: boolean }>`
|
|
|
730
730
|
* The disclosure. Small and quiet - it is a way to get at supporting detail,
|
|
731
731
|
* not an action competing with "select".
|
|
732
732
|
*/
|
|
733
|
-
|
|
733
|
+
/**
|
|
734
|
+
* Claude - 2026-09-01
|
|
735
|
+
*
|
|
736
|
+
* TWO PLACES, ONE AT A TIME, and the reason is a layout constraint rather
|
|
737
|
+
* than a preference.
|
|
738
|
+
*
|
|
739
|
+
* On a phone Ferjolt asked for this to sit "right below 'Select route'
|
|
740
|
+
* button, in the same line as 'Taxes included'". Sharing a line with the tax
|
|
741
|
+
* note means being its SIBLING - two elements in different flex contexts
|
|
742
|
+
* cannot be put on one row without taking one of them out of flow, which
|
|
743
|
+
* comes apart the moment the note wraps to two lines in a longer language.
|
|
744
|
+
* So on a phone it has to live inside the price cell.
|
|
745
|
+
*
|
|
746
|
+
* On a wide screen it belongs where it was before any of the mobile work:
|
|
747
|
+
* bottom-left of the whole card, under the itinerary. That is a sibling of
|
|
748
|
+
* Trip. The price cell is a narrow right-hand column up there, and putting
|
|
749
|
+
* the toggle in it moved a card-level control into the fare - which was
|
|
750
|
+
* never asked for and was only ever a side effect of the phone change.
|
|
751
|
+
*
|
|
752
|
+
* The two positions are in different containers, so no single element can
|
|
753
|
+
* occupy both. Rendering it twice and letting the breakpoint choose is the
|
|
754
|
+
* boring answer, and `display: none` keeps the unused one out of the
|
|
755
|
+
* accessibility tree entirely rather than merely out of sight - there is
|
|
756
|
+
* never a second "Details" control for a screen reader to find.
|
|
757
|
+
*
|
|
758
|
+
* 768px, not 640px, because that is where Price stops being a row and
|
|
759
|
+
* becomes the right-hand column - see Price above.
|
|
760
|
+
*/
|
|
761
|
+
export const ButtonDetails = styled.button<{ $only?: 'narrow' | 'wide' }>`
|
|
734
762
|
display: inline-flex;
|
|
735
763
|
align-items: center;
|
|
736
764
|
gap: 5px;
|
|
@@ -739,14 +767,22 @@ export const ButtonDetails = styled.button`
|
|
|
739
767
|
font-size: ${ props => props.theme.size.s };
|
|
740
768
|
color: ${ props => props.theme.font.faded };
|
|
741
769
|
|
|
770
|
+
@media (max-width: 767px) {
|
|
771
|
+
display: ${ props => (props.$only === 'wide' ? 'none' : 'inline-flex') };
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
@media (min-width: 768px) {
|
|
775
|
+
display: ${ props => (props.$only === 'narrow' ? 'none' : 'inline-flex') };
|
|
776
|
+
}
|
|
777
|
+
|
|
742
778
|
/*
|
|
743
779
|
* Claude - 2026-08-31 (Ferjolt: "the 'Details' should be right below
|
|
744
780
|
* 'Select route' button, in the same line as 'Taxes included - total for 1
|
|
745
781
|
* passenger'").
|
|
746
782
|
*
|
|
747
|
-
* No self-alignment
|
|
748
|
-
* row's own rules put it hard right on the second line,
|
|
749
|
-
* note. Only the size is set here.
|
|
783
|
+
* No self-alignment on the phone copy: it is a child of the price row
|
|
784
|
+
* there, and that row's own rules put it hard right on the second line,
|
|
785
|
+
* beside the tax note. Only the size is set here.
|
|
750
786
|
*/
|
|
751
787
|
@media (max-width: 639px) {
|
|
752
788
|
font-size: ${ props => props.theme.size.xs };
|