@shortstravelmgmt/component-lib 0.5.0 → 0.5.1-canary.85.gba94682
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/dist/index.d.ts +82 -13
- package/dist/index.esm.js +481 -143
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +481 -143
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3766,6 +3766,8 @@ interface TravelDateRangeProps {
|
|
|
3766
3766
|
startDate: string;
|
|
3767
3767
|
/** Last travel date as `YYYY-MM-DD` */
|
|
3768
3768
|
endDate: string;
|
|
3769
|
+
/** Follow the range with the trip's length as a pill, both ends counted (`4 days`) */
|
|
3770
|
+
showDays?: boolean;
|
|
3769
3771
|
/** Additional CSS class */
|
|
3770
3772
|
className?: string;
|
|
3771
3773
|
}
|
|
@@ -3774,10 +3776,10 @@ declare const ordinalDay: (day: number) => string;
|
|
|
3774
3776
|
/**
|
|
3775
3777
|
* A trip's travel dates as `Sun, Jun 7th ⇢ Tue, Jun 9th, 2026`. The year shows
|
|
3776
3778
|
* once at the end, or on both dates when the trip crosses a year. A single-day
|
|
3777
|
-
* trip shows one date.
|
|
3779
|
+
* trip shows one date. With `showDays`, the trip's length follows as a pill.
|
|
3778
3780
|
*/
|
|
3779
3781
|
declare const TravelDateRange: {
|
|
3780
|
-
({ startDate, endDate, className }: TravelDateRangeProps): React.JSX.Element | null;
|
|
3782
|
+
({ startDate, endDate, showDays, className }: TravelDateRangeProps): React.JSX.Element | null;
|
|
3781
3783
|
displayName: string;
|
|
3782
3784
|
};
|
|
3783
3785
|
|
|
@@ -4167,7 +4169,10 @@ interface AirInvoiceLine {
|
|
|
4167
4169
|
/** A selectable invoice version. */
|
|
4168
4170
|
interface AirInvoiceVersion {
|
|
4169
4171
|
id: string;
|
|
4172
|
+
/** The version's row in the menu, e.g. `Version 3 — May 19, 2026` */
|
|
4170
4173
|
label: string;
|
|
4174
|
+
/** When the version was issued, already formatted, e.g. `May 19, 2026`; the header's status pill reads it */
|
|
4175
|
+
date?: string;
|
|
4171
4176
|
}
|
|
4172
4177
|
interface AirInvoiceCardProps {
|
|
4173
4178
|
/** Card heading, e.g. `Air Invoice Details` */
|
|
@@ -4178,7 +4183,7 @@ interface AirInvoiceCardProps {
|
|
|
4178
4183
|
paymentStatus?: string;
|
|
4179
4184
|
/** Formatted invoice total */
|
|
4180
4185
|
total?: string;
|
|
4181
|
-
/** Invoice versions; the Version control appears when there is more than one */
|
|
4186
|
+
/** Invoice versions, newest first; the Version control appears when there is more than one */
|
|
4182
4187
|
versions?: AirInvoiceVersion[];
|
|
4183
4188
|
/** Id of the version on screen */
|
|
4184
4189
|
selectedVersionId?: string;
|
|
@@ -5153,6 +5158,12 @@ interface ItinerarySegmentBase {
|
|
|
5153
5158
|
loyaltyNumbers?: string[];
|
|
5154
5159
|
/** Associated booking remarks to display in Notes. */
|
|
5155
5160
|
notes?: string[];
|
|
5161
|
+
/**
|
|
5162
|
+
* The itinerary day the segment is listed under, as `YYYY-MM-DD`, when the host groups it by more than
|
|
5163
|
+
* its own date: Hub lists a connecting flight under the day its journey began (a 2:30 AM Jul 2 leg
|
|
5164
|
+
* connecting from a Jul 1 flight reads under Jul 1). Defaults to the segment's own date (getSegmentDate).
|
|
5165
|
+
*/
|
|
5166
|
+
travelDay?: string;
|
|
5156
5167
|
}
|
|
5157
5168
|
/** A flight. Fields follow Hub's `CommercialFlight` plus what the Portal itinerary prints. */
|
|
5158
5169
|
interface ItineraryAirSegment extends ItinerarySegmentBase {
|
|
@@ -5195,6 +5206,11 @@ interface ItineraryAirSegment extends ItinerarySegmentBase {
|
|
|
5195
5206
|
cabin?: string;
|
|
5196
5207
|
/** Shows the online check-in action (the Portal reveals it the day before departure) */
|
|
5197
5208
|
checkInAvailable?: boolean;
|
|
5209
|
+
/**
|
|
5210
|
+
* The airline's own online check-in page. When set, Check In is a link that opens it in a new tab
|
|
5211
|
+
* (and counts as check-in being available), in place of calling `onCheckIn`.
|
|
5212
|
+
*/
|
|
5213
|
+
checkInUrl?: string;
|
|
5198
5214
|
/** Live flight status note, e.g. `In air — scheduled to arrive on time` */
|
|
5199
5215
|
flightStatus?: string;
|
|
5200
5216
|
}
|
|
@@ -5227,12 +5243,23 @@ interface ItineraryCarSegment extends ItinerarySegmentBase {
|
|
|
5227
5243
|
dropoffLocation: string;
|
|
5228
5244
|
/** Optional drop-off street address lines. */
|
|
5229
5245
|
dropoffAddress?: string[];
|
|
5246
|
+
/** Drop-off counter phone, for a one-way rental */
|
|
5247
|
+
dropoffPhone?: string;
|
|
5230
5248
|
/** Formatted rental duration, e.g. `6d 45m`, shown between pick-up and drop-off */
|
|
5231
5249
|
duration?: string;
|
|
5232
5250
|
/** Rental counter phone number */
|
|
5233
5251
|
phone?: string;
|
|
5234
5252
|
/** Quoted rate per day */
|
|
5235
5253
|
dailyRate?: number;
|
|
5254
|
+
/** How the quoted rate is charged, e.g. `Daily` or `Weekly`: it qualifies the rate (`$66.80 daily`) in place of `/ day` */
|
|
5255
|
+
rateCategory?: string;
|
|
5256
|
+
/**
|
|
5257
|
+
* The unit after a rate with no `rateCategory`: `$66.80 / day` by default; `null` or `''` prints the
|
|
5258
|
+
* amount alone (Hub's wording). A `rateCategory` takes its place when given.
|
|
5259
|
+
*/
|
|
5260
|
+
rateUnit?: string | null;
|
|
5261
|
+
/** An SUV-class rental: the Estimated Total reads `$65.00 (SUV)`, explaining a total that would otherwise look wrong for the class booked */
|
|
5262
|
+
isSuv?: boolean;
|
|
5236
5263
|
}
|
|
5237
5264
|
/** A hotel stay. Fields follow Hub's `AgencyHotelSegment` plus the Portal's hotel block. */
|
|
5238
5265
|
interface ItineraryHotelSegment extends ItinerarySegmentBase {
|
|
@@ -5259,6 +5286,8 @@ interface ItineraryHotelSegment extends ItinerarySegmentBase {
|
|
|
5259
5286
|
roomType?: string;
|
|
5260
5287
|
/** Nightly room rate */
|
|
5261
5288
|
nightlyRate?: number;
|
|
5289
|
+
/** The unit after the nightly rate: `$187.00 / night` by default; Hub passes `avg night`. `''` prints the amount alone */
|
|
5290
|
+
rateUnit?: string;
|
|
5262
5291
|
/** Street address lines */
|
|
5263
5292
|
address?: string[];
|
|
5264
5293
|
/** City, state and postal code line */
|
|
@@ -5287,10 +5316,16 @@ interface ItineraryLimoSegment extends ItinerarySegmentBase {
|
|
|
5287
5316
|
cancellationPolicies?: string[];
|
|
5288
5317
|
/** Remaining remarks not consumed by the parsed fields */
|
|
5289
5318
|
comments?: string[];
|
|
5319
|
+
/** The car service providing the transfer */
|
|
5320
|
+
vendor?: string;
|
|
5321
|
+
/** The car service's phone number */
|
|
5322
|
+
vendorPhone?: string;
|
|
5290
5323
|
}
|
|
5291
|
-
/** A rail journey using the station and booking fields shown in Hub. */
|
|
5324
|
+
/** A rail journey using the station and booking fields shown in Hub; with `mode: 'bus'`, a motor coach. */
|
|
5292
5325
|
interface ItineraryRailSegment extends ItinerarySegmentBase {
|
|
5293
5326
|
type: 'rail';
|
|
5327
|
+
/** `bus` makes it a motor coach: the same stations, times and seats, under a bus icon and a Motor Coach label. Defaults to `rail` */
|
|
5328
|
+
mode?: 'rail' | 'bus';
|
|
5294
5329
|
/** Service or carrier name, e.g. `Amtrak Acela` */
|
|
5295
5330
|
carrier: string;
|
|
5296
5331
|
/** Carrier code used by the service icon */
|
|
@@ -5346,12 +5381,14 @@ interface ItinerarySegmentCardProps {
|
|
|
5346
5381
|
headingLevel?: 2 | 3 | 4;
|
|
5347
5382
|
/** Called when a traveler starts online check-in for a flight */
|
|
5348
5383
|
onCheckIn?: (segment: ItineraryAirSegment) => void;
|
|
5349
|
-
/** Shows a blue Check In button beside a flight's vendor name (needs `onCheckIn`); the timeline sets it on each day's first flight */
|
|
5384
|
+
/** Shows a blue Check In button beside a flight's vendor name (needs `onCheckIn` or the flight's `checkInUrl`); the timeline sets it on each day's first flight with check-in */
|
|
5350
5385
|
showCheckIn?: boolean;
|
|
5351
5386
|
/** `card` stands alone with its own border; `section` drops the chrome to sit inside a day card */
|
|
5352
5387
|
variant?: 'card' | 'section';
|
|
5353
5388
|
/** Extra content rendered below the detail list (notes, agent remarks) */
|
|
5354
5389
|
footer?: ReactNode;
|
|
5390
|
+
/** `inline` (default) runs "Label: value" pairs along a line; `stacked` sets a small uppercase label over each value */
|
|
5391
|
+
detailsLayout?: 'inline' | 'stacked';
|
|
5355
5392
|
/**
|
|
5356
5393
|
* Renders the 48px vendor mark in the card header, replacing the built-in
|
|
5357
5394
|
* travel-service icon. The set ships marks for only a few vendors; a host
|
|
@@ -5360,6 +5397,12 @@ interface ItinerarySegmentCardProps {
|
|
|
5360
5397
|
* rail, car or hotel chain). Return `undefined` or `null` for the default.
|
|
5361
5398
|
*/
|
|
5362
5399
|
renderVendorMark?: (segment: ItinerarySegment, vendorCode: string | undefined) => ReactNode;
|
|
5400
|
+
/**
|
|
5401
|
+
* Formats every amount the card prints — a car's or hotel's rate and estimated total — given the
|
|
5402
|
+
* amount and the segment's `currency`. Defaults to `formatItineraryMoney` (`$66.80`); Hub passes its
|
|
5403
|
+
* own (`USD 66.80`).
|
|
5404
|
+
*/
|
|
5405
|
+
formatMoney?: (amount: number, currency?: string) => string;
|
|
5363
5406
|
/** Additional CSS class */
|
|
5364
5407
|
className?: string;
|
|
5365
5408
|
}
|
|
@@ -5368,7 +5411,7 @@ interface ItinerarySegmentCardProps {
|
|
|
5368
5411
|
* Uses a shared header, journey board and labelled details grounded in Hub.
|
|
5369
5412
|
*/
|
|
5370
5413
|
declare const ItinerarySegmentCard: {
|
|
5371
|
-
({ segment, headingLevel, onCheckIn, showCheckIn, variant, footer, renderVendorMark, className, }: ItinerarySegmentCardProps): React.JSX.Element;
|
|
5414
|
+
({ segment, headingLevel, onCheckIn, showCheckIn, variant, footer, detailsLayout, renderVendorMark, formatMoney, className, }: ItinerarySegmentCardProps): React.JSX.Element;
|
|
5372
5415
|
displayName: string;
|
|
5373
5416
|
};
|
|
5374
5417
|
|
|
@@ -5389,11 +5432,18 @@ interface ItineraryDay {
|
|
|
5389
5432
|
* and keeps the legs of a connection in the order they are flown.
|
|
5390
5433
|
*
|
|
5391
5434
|
* Day grouping keys off the plain `YYYY-MM-DD` string, so ordering never depends
|
|
5392
|
-
* on the reader's time zone.
|
|
5393
|
-
* order
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5435
|
+
* on the reader's time zone. A segment's `travelDay`, when given, is its day in
|
|
5436
|
+
* place of its own date; within a day, segments order by their own date, then
|
|
5437
|
+
* time. Segments with no stated time sort last, keeping the order they were given.
|
|
5438
|
+
*
|
|
5439
|
+
* `preserveOrder` keeps each day's segments in the order given (days are still
|
|
5440
|
+
* ordered by date), for a host whose order is already right where local clock
|
|
5441
|
+
* times are not — a day that crosses the date line, ordered by UTC.
|
|
5442
|
+
*/
|
|
5443
|
+
declare const groupSegmentsByDay: (segments: ItinerarySegment[], { preserveOrder }?: {
|
|
5444
|
+
preserveOrder?: boolean;
|
|
5445
|
+
}) => ItineraryDay[];
|
|
5446
|
+
/** Segment-type filters offered above the first day. Ground covers rental cars, Black Car and motor coaches. */
|
|
5397
5447
|
type ItinerarySegmentFilter = 'all' | 'air' | 'hotel' | 'ground' | 'rail';
|
|
5398
5448
|
interface ItineraryTimelineProps {
|
|
5399
5449
|
/** Every booking on the trip, including Black Car and rail, in any order */
|
|
@@ -5408,6 +5458,19 @@ interface ItineraryTimelineProps {
|
|
|
5408
5458
|
onCheckIn?: (segment: ItineraryAirSegment) => void;
|
|
5409
5459
|
/** Draws each card's vendor mark; passed to every ItinerarySegmentCard (see its `renderVendorMark`) */
|
|
5410
5460
|
renderVendorMark?: ItinerarySegmentCardProps['renderVendorMark'];
|
|
5461
|
+
/**
|
|
5462
|
+
* Extra content for each segment's card, below its own notes (see ItinerarySegmentCard's `footer`):
|
|
5463
|
+
* a host's labelled note sections, policies or charter rows. A card whose footer renders nothing draws none.
|
|
5464
|
+
*/
|
|
5465
|
+
renderSegmentFooter?: (segment: ItinerarySegment) => ReactNode;
|
|
5466
|
+
/** Formats every amount on the cards; passed to every ItinerarySegmentCard (see its `formatMoney`) */
|
|
5467
|
+
formatMoney?: ItinerarySegmentCardProps['formatMoney'];
|
|
5468
|
+
/**
|
|
5469
|
+
* Keeps each day's segments in the order given instead of sorting them by start time; days are still
|
|
5470
|
+
* ordered by date. For a host whose order is already right where local clock times mislead — a day
|
|
5471
|
+
* that crosses the date line, which Hub's API orders by UTC.
|
|
5472
|
+
*/
|
|
5473
|
+
preserveOrder?: boolean;
|
|
5411
5474
|
/** Shows All / Flights / Hotels / Ground / Rail tabs above the first day; types with nothing booked are left out */
|
|
5412
5475
|
showTypeTabs?: boolean;
|
|
5413
5476
|
/** Additional CSS class */
|
|
@@ -5418,7 +5481,7 @@ interface ItineraryTimelineProps {
|
|
|
5418
5481
|
* Also covers loading, error and nothing-booked-yet states.
|
|
5419
5482
|
*/
|
|
5420
5483
|
declare const ItineraryTimeline: {
|
|
5421
|
-
({ segments, loading, error, emptyMessage, onCheckIn, renderVendorMark, showTypeTabs, className, }: ItineraryTimelineProps): React.JSX.Element;
|
|
5484
|
+
({ segments, loading, error, emptyMessage, onCheckIn, renderVendorMark, renderSegmentFooter, formatMoney, preserveOrder, showTypeTabs, className, }: ItineraryTimelineProps): React.JSX.Element;
|
|
5422
5485
|
displayName: string;
|
|
5423
5486
|
};
|
|
5424
5487
|
|
|
@@ -8891,6 +8954,12 @@ interface ItineraryPageProps {
|
|
|
8891
8954
|
onCheckIn?: (segment: ItineraryAirSegment) => void;
|
|
8892
8955
|
/** Draws each segment card's vendor mark; see ItinerarySegmentCard's `renderVendorMark` */
|
|
8893
8956
|
renderVendorMark?: ItinerarySegmentCardProps['renderVendorMark'];
|
|
8957
|
+
/** Extra content for each segment's card; see ItineraryTimeline's `renderSegmentFooter` */
|
|
8958
|
+
renderSegmentFooter?: ItineraryTimelineProps['renderSegmentFooter'];
|
|
8959
|
+
/** Formats every amount on the page — the trip cost and the cards' rates and totals; defaults to `formatItineraryMoney` (`$66.80`) */
|
|
8960
|
+
formatMoney?: ItinerarySegmentCardProps['formatMoney'];
|
|
8961
|
+
/** Keeps each day's segments in the order given; see ItineraryTimeline's `preserveOrder` */
|
|
8962
|
+
preserveOrder?: boolean;
|
|
8894
8963
|
/** Additional CSS class */
|
|
8895
8964
|
className?: string;
|
|
8896
8965
|
}
|
|
@@ -8904,7 +8973,7 @@ declare const itineraryPageName: (travelers: string[]) => string;
|
|
|
8904
8973
|
* Trip data and print, email, calendar and invoice actions arrive as props.
|
|
8905
8974
|
*/
|
|
8906
8975
|
declare const ItineraryPage: {
|
|
8907
|
-
({ tripName, recordLocator, travelers, startDate, endDate, segments, status, sportCode, totalCost, currency, agent, invoice, bookingDetails, loading, error, notice, defaultView, onViewChange, alertBanners, travelNotes, closingBanners, closingNotes, onRetry, sectionName, pageName, onBack, backLabel, onPrint, onEmail, onAddToCalendar, onDownloadInvoice, onCheckIn, renderVendorMark, className, }: ItineraryPageProps): React.JSX.Element;
|
|
8976
|
+
({ tripName, recordLocator, travelers, startDate, endDate, segments, status, sportCode, totalCost, currency, agent, invoice, bookingDetails, loading, error, notice, defaultView, onViewChange, alertBanners, travelNotes, closingBanners, closingNotes, onRetry, sectionName, pageName, onBack, backLabel, onPrint, onEmail, onAddToCalendar, onDownloadInvoice, onCheckIn, renderVendorMark, renderSegmentFooter, formatMoney, preserveOrder, className, }: ItineraryPageProps): React.JSX.Element;
|
|
8908
8977
|
displayName: string;
|
|
8909
8978
|
};
|
|
8910
8979
|
|