@hotelcard/ui 0.0.12 → 0.0.13
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 +59 -2
- package/dist/index.cjs +600 -339
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +330 -146
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +120 -30
- package/dist/index.d.ts +120 -30
- package/dist/index.js +597 -338
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -69,7 +69,6 @@ function App() {
|
|
|
69
69
|
| `Input` | Text input with label, helper text, and validation |
|
|
70
70
|
| `Badge` | Status and discount badges |
|
|
71
71
|
| `Card` | Hotel card component |
|
|
72
|
-
| `CompactCard` | Compact hotel card for carousels |
|
|
73
72
|
| `Chip` | Filter and tag chips |
|
|
74
73
|
| `Checkbox` | Checkbox with label |
|
|
75
74
|
| `RadioButton` | Radio button with label |
|
|
@@ -81,6 +80,7 @@ function App() {
|
|
|
81
80
|
| `WhenContent` | Date/month picker for search (accepts labels as props) |
|
|
82
81
|
| `DualCalendar` | Calendar component for date range selection |
|
|
83
82
|
| `GuestContent` | Guest selector with adults, children (with ages), and pet toggle |
|
|
83
|
+
| `HotelCard` | Hotel card for search results with image carousel, rating, and pricing |
|
|
84
84
|
|
|
85
85
|
### Icons
|
|
86
86
|
|
|
@@ -237,6 +237,59 @@ const [petFilter, setPetFilter] = useState(0);
|
|
|
237
237
|
|
|
238
238
|
**Note**: All text labels are passed as props. The consuming app provides translated strings.
|
|
239
239
|
|
|
240
|
+
### HotelCard
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
import { HotelCard, type HotelCardHotel } from '@hotelcard/ui';
|
|
244
|
+
|
|
245
|
+
const hotel: HotelCardHotel = {
|
|
246
|
+
id: '123',
|
|
247
|
+
name: 'Grand Hotel Belvedere',
|
|
248
|
+
slug: 'grand-hotel-belvedere',
|
|
249
|
+
stars: 5,
|
|
250
|
+
isSuperior: true,
|
|
251
|
+
rating: 4.5,
|
|
252
|
+
location: 'Lauterbrunnen, Switzerland',
|
|
253
|
+
images: ['/hotel1.jpg', '/hotel2.jpg'],
|
|
254
|
+
isFavorite: false,
|
|
255
|
+
benefits: [
|
|
256
|
+
{ id: 'free-breakfast', label: 'Free breakfast' },
|
|
257
|
+
{ id: 'free-cancellation', label: 'Free cancellation' },
|
|
258
|
+
],
|
|
259
|
+
isAvailable: true,
|
|
260
|
+
currency: 'CHF',
|
|
261
|
+
price: {
|
|
262
|
+
current: 195,
|
|
263
|
+
original: 390,
|
|
264
|
+
discount: 50,
|
|
265
|
+
},
|
|
266
|
+
usp: 'Best price guarantee',
|
|
267
|
+
badges: ['New'],
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
<HotelCard
|
|
271
|
+
hotel={hotel}
|
|
272
|
+
onFavoriteClick={() => toggleFavorite(hotel.id)}
|
|
273
|
+
onContentClick={() => navigate(`/hotel/${hotel.slug}`)}
|
|
274
|
+
labels={{
|
|
275
|
+
priceFrom: t('hotel.priceFrom'),
|
|
276
|
+
notAvailable: t('hotel.notAvailable'),
|
|
277
|
+
ratingExcellent: t('rating.excellent'),
|
|
278
|
+
ratingVeryGood: t('rating.veryGood'),
|
|
279
|
+
ratingGood: t('rating.good'),
|
|
280
|
+
ratingFair: t('rating.fair'),
|
|
281
|
+
rating: t('rating.rating'),
|
|
282
|
+
swissLodge: t('hotel.swissLodge'),
|
|
283
|
+
removeFromFavorites: t('favorites.remove'),
|
|
284
|
+
addToFavorites: t('favorites.add'),
|
|
285
|
+
previousImage: t('navigation.previous'),
|
|
286
|
+
nextImage: t('navigation.next'),
|
|
287
|
+
}}
|
|
288
|
+
/>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Note**: All text labels are passed as props. The consuming app provides translated strings. Navigation and favorite logic are handled by the consuming app via callbacks.
|
|
292
|
+
|
|
240
293
|
### Checkbox & RadioButton
|
|
241
294
|
|
|
242
295
|
```tsx
|
|
@@ -269,7 +322,6 @@ import type {
|
|
|
269
322
|
BadgeProps,
|
|
270
323
|
InputProps,
|
|
271
324
|
CardProps,
|
|
272
|
-
CompactCardProps,
|
|
273
325
|
CheckboxProps,
|
|
274
326
|
RadioButtonProps,
|
|
275
327
|
DropdownProps,
|
|
@@ -285,6 +337,11 @@ import type {
|
|
|
285
337
|
GuestContentLabels,
|
|
286
338
|
GuestCounts,
|
|
287
339
|
ChildAgeError,
|
|
340
|
+
HotelCardProps,
|
|
341
|
+
HotelCardLabels,
|
|
342
|
+
HotelCardHotel,
|
|
343
|
+
HotelCardImageProps,
|
|
344
|
+
HotelCardContentProps,
|
|
288
345
|
|
|
289
346
|
// Data Types
|
|
290
347
|
Hotel,
|