@autobusal/routes-order 1.23.1 → 1.23.3

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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.3
4
+
5
+ **The arrival heading was painting over the price.** Measured: the arrival cell is 165px wide and its content needed **215px**, so it ran 50px into the fare beside it.
6
+
7
+ Two causes, both fixed — widths alone would only have moved the width at which it broke:
8
+
9
+ - **No spaces to wrap at.** JSX drops the whitespace around a newline, so city, country and time were concatenated into one unbreakable token. Real spaces added, plus overflow-wrap: break-word above 640px as a backstop for a long city name on its own line.
10
+ - **The operator cell was taking room it did not need.** 185px to 120px with a smaller logo, and the one-row gap from 15px to 10px. That returns 85px to the two location columns, which go 165px to 208px.
11
+
12
+ Verified no overflow on any card at 1024 / 1100 / 1280 / 1440 / 1920px. 1024 is the tightest - it is where the card first lays out in a single row.
13
+
14
+ **The route code moved out of the collapsed details and under the logo**, where it sits beside the operator it identifies. That frees a slot in the details row for things that actually need explaining - customs on a cross-border run, for one.
15
+
16
+ The route information link is now **Route Info** rather than "Read Operator Information".
17
+
18
+ ## 1.23.2
19
+
20
+ - Flexible Ticket detail is now behind a small **Read More** link rather than the title. Its own control, so the thing you click to *read* is never next to the thing you click to *buy*. Closed by default; one line — "without it, this ticket cannot be cancelled or changed" — stays outside the collapse, because that is the material fact and hiding it would be a dark pattern rather than a tidy layout.
21
+ - **Date strip: dropped the joining comma.** Above 1024px the day number carried a `::before` comma so the cell would read "Mon, 03 Aug" on one line. The cells are narrow enough that the two parts wrap anyway, so the comma led the second line and every desktop cell rendered as "Mon" over ", 03 Aug". Punctuation that only works when text happens not to wrap will keep breaking.
22
+
3
23
  ## 1.23.1
4
24
 
5
25
  **Flexible Ticket as a title, a price and an Add button, with the detail collapsed.**
@@ -99,12 +99,20 @@ export const DayNumber = styled.span`
99
99
  display: block;
100
100
  line-height: 1.2;
101
101
 
102
+ /*
103
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
104
+ *
105
+ * NO JOINING COMMA. This carried a ::before comma above 1024px, to read
106
+ * "Mon, 03 Aug" on one line. The cells are narrow enough
107
+ * that the weekday and the date wrap anyway, and the comma then led the
108
+ * second line - every desktop cell rendered as "Mon" over ", 03 Aug".
109
+ *
110
+ * Punctuation that only works when the text happens not to wrap is
111
+ * punctuation that will keep breaking; the two parts read perfectly well
112
+ * stacked without it.
113
+ */
102
114
  @media (min-width: 1024px) {
103
115
  display: inline;
104
-
105
- &::before {
106
- content: ', ';
107
- }
108
116
  }
109
117
  `;
110
118
 
@@ -5,7 +5,7 @@ import { BiHourglass } from 'react-icons/bi';
5
5
  import { RiBus2Line } from 'react-icons/ri';
6
6
  import { formatDuration, splitPrice } from '../refine';
7
7
  import { Button, RouteFeature, Information, Rating } from '@autobusal/common';
8
- import { Container, ButtonDetails, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, Details, Detail, ButtonPolicy, TitleDetail, LinkRoute, FeaturesItems, Leaves } from './styles';
8
+ import { Container, ButtonDetails, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, CodeCompany, Details, Detail, ButtonPolicy, TitleDetail, FeaturesItems, Leaves } from './styles';
9
9
  import { FoundData } from '@autobusal/providers/types/routes';
10
10
 
11
11
  // neutral placeholder so a missing/broken operator logo doesn't render the
@@ -86,12 +86,29 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
86
86
  nothing when there is no rating yet, which is why a brand-new
87
87
  operator does not look like a badly rated one. */ }
88
88
  <Rating rating={ data.operator.rating } size="small" t={ t } />
89
+
90
+ { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
91
+ The route code, moved up out of the collapsed details. It is an
92
+ identifier of the same kind as the logo above it, and moving it
93
+ here frees a slot in the details row for things that actually
94
+ need explaining - customs on a cross-border run, for one. */ }
95
+ <CodeCompany to={ bookOnUrl ?? data.link } target="_blank" rel="noopener noreferrer">{ data.code }</CodeCompany>
89
96
  </Company>
90
97
 
91
98
  <Location>
92
99
  <h2>
93
100
  { data.locations.from.city.name }
101
+ { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
102
+ REAL SPACES, and they are load-bearing. JSX drops the
103
+ whitespace around a newline, so city, country and time were
104
+ concatenated into one unbreakable token - "Thessaloniki(GRC)
105
+ 06:00" measured 215px inside a 165px column and painted 50px
106
+ into the price beside it. Nothing about the widths could fix
107
+ that on its own: with nowhere to wrap, text will always
108
+ overflow eventually. */ }
109
+ { ' ' }
94
110
  <Iso>({ data.locations.from.city.country?.iso_code })</Iso>
111
+ { ' ' }
95
112
  { data.locations.from.departure }
96
113
  </h2>
97
114
 
@@ -111,7 +128,17 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
111
128
  <Location>
112
129
  <h2>
113
130
  { data.locations.to.city.name }
131
+ { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
132
+ REAL SPACES, and they are load-bearing. JSX drops the
133
+ whitespace around a newline, so city, country and time were
134
+ concatenated into one unbreakable token - "Thessaloniki(GRC)
135
+ 06:00" measured 215px inside a 165px column and painted 50px
136
+ into the price beside it. Nothing about the widths could fix
137
+ that on its own: with nowhere to wrap, text will always
138
+ overflow eventually. */ }
139
+ { ' ' }
114
140
  <Iso>({ data.locations.to.city.country?.iso_code })</Iso>
141
+ { ' ' }
115
142
  { data.locations.to.arrival }
116
143
  </h2>
117
144
 
@@ -182,11 +209,6 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
182
209
  </Detail>
183
210
  ) }
184
211
 
185
- <Detail>
186
- <TitleDetail>{ t('routes_order.step2.route.name') }</TitleDetail>
187
- <LinkRoute to={ bookOnUrl ?? data.link } target="_blank" rel="noopener noreferrer">{ data.code }</LinkRoute>
188
- </Detail>
189
-
190
212
  { customs && (
191
213
  <Detail>
192
214
  <TitleDetail>{ t('routes_order.step2.route.customs') }</TitleDetail>
@@ -85,8 +85,15 @@ export const Trip = styled.div`
85
85
  gap: 15px;
86
86
  }
87
87
 
88
+ /**
89
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
90
+ * A tighter gap once every cell shares one row: four gaps at 15px spent
91
+ * 60px of the widest layout on whitespace, while the arrival column was
92
+ * overflowing by 50px.
93
+ */
88
94
  @media (min-width: 1024px) {
89
95
  flex-wrap: nowrap;
96
+ gap: 10px;
90
97
  }
91
98
  `;
92
99
 
@@ -104,8 +111,14 @@ export const Company = styled.div`
104
111
  gap: 6px;
105
112
  align-items: flex-start;
106
113
 
114
+ /**
115
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
116
+ * 185px down to 120px. The logo is an identifier, not the product - it
117
+ * only has to be recognisable - and the 65px it gives back goes to the two
118
+ * location columns, which were the cells actually running out of room.
119
+ */
107
120
  @media (min-width: 1024px) {
108
- flex: 0 0 185px;
121
+ flex: 0 0 120px;
109
122
  }
110
123
  `;
111
124
 
@@ -164,9 +177,21 @@ export const Location = styled.div`
164
177
  overflow-wrap: anywhere;
165
178
  }
166
179
 
180
+ /**
181
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
182
+ * break-word, not normal. Real spaces now let the heading wrap between
183
+ * city, country and time, which covers almost every width - but at exactly
184
+ * 1024px, where the card first lays out in one row and the columns are at
185
+ * their narrowest, "Thessaloniki" on its own still exceeds its column and
186
+ * a heading that cannot break simply paints over the price.
187
+ *
188
+ * break-word only splits a word when it has a line to itself and still
189
+ * does not fit, so the ordinary case is untouched. The phone layout's
190
+ * anywhere would break words it did not have to.
191
+ */
167
192
  @media (min-width: 640px) {
168
193
  & > h2 {
169
- overflow-wrap: normal;
194
+ overflow-wrap: break-word;
170
195
  }
171
196
  }
172
197
  `;
@@ -390,6 +415,33 @@ export const LinkCompany = styled(Link)`
390
415
 
391
416
  border-radius: 8px;
392
417
  }
418
+
419
+ /**
420
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
421
+ * Smaller from the width where the card lays out in one row, since that is
422
+ * the only place the space was contested.
423
+ */
424
+ @media (min-width: 1024px) {
425
+ max-width: 120px;
426
+
427
+ & > img {
428
+ ${ logoBox('100%', '44px') }
429
+ }
430
+ }
431
+ `;
432
+
433
+ /**
434
+ * The route code, under the logo.
435
+ *
436
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
437
+ * Moved out of the collapsed details and up beside the operator it belongs
438
+ * to. It is an identifier of the same kind as the logo, and putting it here
439
+ * frees a slot in the details row for things that genuinely need explaining.
440
+ */
441
+ export const CodeCompany = styled(Link)`
442
+ font-size: ${ props => props.theme.size.xxs };
443
+ color: ${ props => props.theme.font.faded };
444
+ line-height: 1.2;
393
445
  `;
394
446
 
395
447
  /**
@@ -465,10 +517,6 @@ export const TitleDetail = styled.h6`
465
517
  font-size: ${ props => props.theme.size.xs };
466
518
  `;
467
519
 
468
- export const LinkRoute = styled(Link)`
469
- font-weight: 700;
470
- `;
471
-
472
520
  export const ButtonPolicy = styled.button`
473
521
  display: flex;
474
522
  align-items: center;
@@ -3,7 +3,7 @@ import { useState } from 'react';
3
3
  import { RiWhatsappLine, RiTelegramLine, RiCalendarCheckLine, RiArrowUpSLine, RiArrowDownSLine } from 'react-icons/ri';
4
4
  import { FlexOffer } from '@autobusal/providers/types/routes';
5
5
  import { SubTitle } from '../../styles';
6
- import { Container, Option, Notice, Terms, Term, FlexHeader, FlexToggle, FlexPrice, FlexAdd, FlexDetails } from './styles';
6
+ import { Container, Option, Notice, Terms, Term, FlexHeader, FlexTitle, FlexToggle, FlexPrice, FlexAdd, FlexDetails } from './styles';
7
7
 
8
8
  interface AddonsData {
9
9
  whatsapp: { available: boolean, price: number }
@@ -103,15 +103,13 @@ const Addons = ({ data, flexOffer, currency, whatsapp, whatsappNumber, telegram,
103
103
  { hasFlex && (
104
104
  <Option>
105
105
  <FlexHeader>
106
- <FlexToggle type="button" aria-expanded={ open } onClick={ () => setOpen(!open) }>
106
+ <FlexTitle>
107
107
  <RiCalendarCheckLine />
108
108
 
109
109
  { t('routes_order.step5.flex.title') }
110
110
 
111
111
  <FlexPrice>{ flexOffer?.price_display }</FlexPrice>
112
-
113
- { open ? <RiArrowUpSLine /> : <RiArrowDownSLine /> }
114
- </FlexToggle>
112
+ </FlexTitle>
115
113
 
116
114
  <FlexAdd type="button" $added={ flex } onClick={ () => onChangeFlex(!flex) }>
117
115
  { flex ? t('routes_order.step5.flex.remove') : t('routes_order.step5.flex.add') }
@@ -128,6 +126,12 @@ const Addons = ({ data, flexOffer, currency, whatsapp, whatsappNumber, telegram,
128
126
  */}
129
127
  <Notice>{ t('routes_order.step5.flex.default') }</Notice>
130
128
 
129
+ <FlexToggle type="button" aria-expanded={ open } onClick={ () => setOpen(!open) }>
130
+ { open ? t('routes_order.step5.flex.less') : t('routes_order.step5.flex.more') }
131
+
132
+ { open ? <RiArrowUpSLine /> : <RiArrowDownSLine /> }
133
+ </FlexToggle>
134
+
131
135
  { open && (
132
136
  <FlexDetails>
133
137
  <Terms>
@@ -69,19 +69,34 @@ export const FlexHeader = styled.div`
69
69
  gap: 10px;
70
70
  `;
71
71
 
72
- export const FlexToggle = styled.button`
72
+ export const FlexTitle = styled.span`
73
73
  display: flex;
74
74
  align-items: center;
75
75
  gap: 6px;
76
+ font-weight: 700;
77
+ `;
78
+
79
+ /**
80
+ * "Read More", small and quiet, under the one line that always shows.
81
+ *
82
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
83
+ * Its own control rather than the title, so the thing you click to READ is
84
+ * never next to the thing you click to BUY.
85
+ */
86
+ export const FlexToggle = styled.button`
87
+ display: inline-flex;
88
+ align-items: center;
89
+ gap: 2px;
90
+ margin-top: 4px;
91
+ margin-left: 22px;
76
92
  padding: 0;
77
93
  border: 0;
78
94
  background: none;
79
- color: inherit;
95
+ color: ${ props => props.theme.primary.normal };
80
96
  font-family: inherit;
81
- font-size: inherit;
82
- font-weight: 700;
97
+ font-size: ${ props => props.theme.size.xs };
83
98
  cursor: pointer;
84
- text-align: left;
99
+ text-decoration: underline;
85
100
  `;
86
101
 
87
102
  export const FlexPrice = styled.span`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.23.1",
3
+ "version": "1.23.3",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"