@hotelcard/ui 0.0.53 → 0.0.55
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/README.md +115 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,6 +111,16 @@ The package includes built-in translations for `de`, `en`, `fr`, and `it` locale
|
|
|
111
111
|
| `Pin` | Location pin marker |
|
|
112
112
|
| `EmptyState` | Generic empty state with icon, title, description, and optional action button |
|
|
113
113
|
|
|
114
|
+
### Booking Components
|
|
115
|
+
|
|
116
|
+
| Component | Description |
|
|
117
|
+
|-----------|-------------|
|
|
118
|
+
| `FeaturedBookingCard` | Large booking card with image, hotel info, contacts, message accordion, and details |
|
|
119
|
+
| `CompactBookingCard` | Compact booking card with thumbnail, status badge, price, and book again |
|
|
120
|
+
| `BookingCardDetails` | Expandable accordion with check-in/out, guests, room, price breakdown |
|
|
121
|
+
| `FeaturedBookingCardSkeleton` | Loading skeleton for FeaturedBookingCard |
|
|
122
|
+
| `CompactBookingCardSkeleton` | Loading skeleton for CompactBookingCard |
|
|
123
|
+
|
|
114
124
|
### Search Components
|
|
115
125
|
|
|
116
126
|
| Component | Description |
|
|
@@ -314,6 +324,105 @@ import { HotelCardSkeleton } from '@hotelcard/ui';
|
|
|
314
324
|
)}
|
|
315
325
|
```
|
|
316
326
|
|
|
327
|
+
### FeaturedBookingCard
|
|
328
|
+
|
|
329
|
+
Large card for the soonest upcoming booking, with hotel image, countdown badge, contact info, message accordion, and expandable details:
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
import { FeaturedBookingCard, type Booking } from '@hotelcard/ui';
|
|
333
|
+
|
|
334
|
+
const booking: Booking = {
|
|
335
|
+
id: 1,
|
|
336
|
+
confirmationNumber: 'HC-12345',
|
|
337
|
+
status: 'confirmed',
|
|
338
|
+
hotel: {
|
|
339
|
+
id: 42,
|
|
340
|
+
name: 'Grand Hotel Belvedere',
|
|
341
|
+
slug: 'grand-hotel-belvedere',
|
|
342
|
+
address: 'Höheweg 37',
|
|
343
|
+
city: 'Interlaken',
|
|
344
|
+
postalCode: '3800',
|
|
345
|
+
country: 'Switzerland',
|
|
346
|
+
phone: '+41 33 888 99 00',
|
|
347
|
+
email: 'info@grandhotel.ch',
|
|
348
|
+
imageUrl: '/hotel-image.jpg',
|
|
349
|
+
checkInTime: '15:00',
|
|
350
|
+
checkOutTime: '11:00',
|
|
351
|
+
},
|
|
352
|
+
checkIn: '2026-03-14',
|
|
353
|
+
checkOut: '2026-03-16',
|
|
354
|
+
roomName: 'Deluxe Suite',
|
|
355
|
+
guests: 2,
|
|
356
|
+
adults: 2,
|
|
357
|
+
children: 0,
|
|
358
|
+
hasBreakfast: true,
|
|
359
|
+
breakfastInfo: 'Buffet breakfast included',
|
|
360
|
+
originalPrice: 400,
|
|
361
|
+
discountedPrice: 200,
|
|
362
|
+
totalPrice: 200,
|
|
363
|
+
savings: 200,
|
|
364
|
+
currency: 'CHF',
|
|
365
|
+
cancellationPolicy: 'Free cancellation until 48h before check-in',
|
|
366
|
+
isCancellable: true,
|
|
367
|
+
hotelMessage: 'Welcome! We look forward to your stay.',
|
|
368
|
+
bookedAt: '2026-01-10',
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
<FeaturedBookingCard
|
|
372
|
+
booking={booking}
|
|
373
|
+
onCancelBooking={() => showCancelDialog()}
|
|
374
|
+
onAddToCalendar={() => addToCalendar(booking)}
|
|
375
|
+
/>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### CompactBookingCard
|
|
379
|
+
|
|
380
|
+
Compact card for past/cancelled bookings with thumbnail, status badge, and price:
|
|
381
|
+
|
|
382
|
+
```tsx
|
|
383
|
+
import { CompactBookingCard } from '@hotelcard/ui';
|
|
384
|
+
|
|
385
|
+
<CompactBookingCard
|
|
386
|
+
booking={booking}
|
|
387
|
+
showBookAgain={true}
|
|
388
|
+
onBookAgain={() => navigate(`/hotel/${booking.hotel.slug}`)}
|
|
389
|
+
onAddToCalendar={() => addToCalendar(booking)}
|
|
390
|
+
/>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Navigation is handled via the `onBookAgain` callback prop — the component does not handle routing internally.
|
|
394
|
+
|
|
395
|
+
### BookingCardDetails
|
|
396
|
+
|
|
397
|
+
Standalone expandable accordion for booking details (used internally by both card types, but can be used independently):
|
|
398
|
+
|
|
399
|
+
```tsx
|
|
400
|
+
import { BookingCardDetails } from '@hotelcard/ui';
|
|
401
|
+
|
|
402
|
+
<BookingCardDetails
|
|
403
|
+
booking={booking}
|
|
404
|
+
onCancelBooking={() => showCancelDialog()}
|
|
405
|
+
/>
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Booking Card Skeletons
|
|
409
|
+
|
|
410
|
+
Loading placeholders matching the card layouts:
|
|
411
|
+
|
|
412
|
+
```tsx
|
|
413
|
+
import { FeaturedBookingCardSkeleton, CompactBookingCardSkeleton } from '@hotelcard/ui';
|
|
414
|
+
|
|
415
|
+
{isLoading ? (
|
|
416
|
+
<>
|
|
417
|
+
<FeaturedBookingCardSkeleton />
|
|
418
|
+
<CompactBookingCardSkeleton />
|
|
419
|
+
<CompactBookingCardSkeleton />
|
|
420
|
+
</>
|
|
421
|
+
) : (
|
|
422
|
+
// ... render actual cards
|
|
423
|
+
)}
|
|
424
|
+
```
|
|
425
|
+
|
|
317
426
|
### EmptyState
|
|
318
427
|
|
|
319
428
|
Generic empty state component for no results, no bookings, no favourites, etc.
|
|
@@ -810,9 +919,15 @@ import type {
|
|
|
810
919
|
Locale,
|
|
811
920
|
TranslationKeys,
|
|
812
921
|
|
|
922
|
+
// Booking Component Props
|
|
923
|
+
FeaturedBookingCardProps,
|
|
924
|
+
CompactBookingCardProps,
|
|
925
|
+
BookingCardDetailsProps,
|
|
926
|
+
|
|
813
927
|
// Data Types
|
|
814
928
|
Hotel,
|
|
815
929
|
Booking,
|
|
930
|
+
BookingHotel,
|
|
816
931
|
User,
|
|
817
932
|
Address,
|
|
818
933
|
Membership,
|