@hotelcard/ui 0.0.49 → 0.0.50
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 +85 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +816 -794
- package/dist/index.js.map +1 -1
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -95,6 +95,7 @@ The package includes built-in translations for `de`, `en`, `fr`, and `it` locale
|
|
|
95
95
|
| `Badge` | Status and discount badges |
|
|
96
96
|
| `Card` | Hotel card component |
|
|
97
97
|
| `BaseCard` | Composable card primitives (container, image, content) for building custom cards |
|
|
98
|
+
| `BaseCardSkeleton` | Loading skeleton for cards (use as base for custom card skeletons) |
|
|
98
99
|
| `Chip` | Filter and tag chips |
|
|
99
100
|
| `Checkbox` | Checkbox with label |
|
|
100
101
|
| `RadioButton` | Radio button with label |
|
|
@@ -108,6 +109,7 @@ The package includes built-in translations for `de`, `en`, `fr`, and `it` locale
|
|
|
108
109
|
| `FAQ` | Expandable FAQ accordion |
|
|
109
110
|
| `Benefits` | Benefits list with icons |
|
|
110
111
|
| `Pin` | Location pin marker |
|
|
112
|
+
| `EmptyState` | Generic empty state with icon, title, description, and optional action button |
|
|
111
113
|
|
|
112
114
|
### Search Components
|
|
113
115
|
|
|
@@ -121,6 +123,7 @@ The package includes built-in translations for `de`, `en`, `fr`, and `it` locale
|
|
|
121
123
|
| `HotelCard` | Hotel card for search results with image carousel, rating, and pricing |
|
|
122
124
|
| `HotelCardImage` | Hotel image carousel component |
|
|
123
125
|
| `HotelCardContent` | Hotel card content with rating, price, benefits |
|
|
126
|
+
| `HotelCardSkeleton` | Loading skeleton for HotelCard |
|
|
124
127
|
| `SearchModal` | Full-screen search modal with destination, dates, and guest selection |
|
|
125
128
|
| `SearchModalContent` | Content-only version for custom modal wrappers (e.g., IonModal) |
|
|
126
129
|
| `LocationAutocomplete` | Location search input with autocomplete suggestions |
|
|
@@ -268,6 +271,86 @@ BaseCard provides:
|
|
|
268
271
|
- **BaseCard**: Container with border, radius, shadow, hover effects
|
|
269
272
|
- **BaseCardImage**: Image with overlay slots (top-left, top-right, center, bottom)
|
|
270
273
|
- **BaseCardContent**: Content area with configurable padding ('none' | 'small' | 'medium' | 'large')
|
|
274
|
+
- **BaseCardSkeleton**: Loading skeleton with shimmer animation
|
|
275
|
+
|
|
276
|
+
### BaseCardSkeleton (Loading State)
|
|
277
|
+
|
|
278
|
+
Use `BaseCardSkeleton` to create loading placeholders for your custom cards:
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import { BaseCardSkeleton } from '@hotelcard/ui';
|
|
282
|
+
|
|
283
|
+
// Basic skeleton with image and content placeholders
|
|
284
|
+
<BaseCardSkeleton>
|
|
285
|
+
<div className="skeleton" style={{ height: 20, width: '60%' }} />
|
|
286
|
+
<div className="skeleton" style={{ height: 16, width: '40%' }} />
|
|
287
|
+
</BaseCardSkeleton>
|
|
288
|
+
|
|
289
|
+
// With aspect ratio for image
|
|
290
|
+
<BaseCardSkeleton imageAspectRatio="16/9">
|
|
291
|
+
{/* Your content placeholders */}
|
|
292
|
+
</BaseCardSkeleton>
|
|
293
|
+
|
|
294
|
+
// With custom image height
|
|
295
|
+
<BaseCardSkeleton imageHeight={200}>
|
|
296
|
+
{/* Your content placeholders */}
|
|
297
|
+
</BaseCardSkeleton>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Children should include `.hc-skeleton` class for shimmer animation (provided by the package CSS).
|
|
301
|
+
|
|
302
|
+
### HotelCardSkeleton
|
|
303
|
+
|
|
304
|
+
Pre-built loading skeleton matching HotelCard layout:
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
import { HotelCardSkeleton } from '@hotelcard/ui';
|
|
308
|
+
|
|
309
|
+
// Show while loading hotel data
|
|
310
|
+
{isLoading ? (
|
|
311
|
+
<HotelCardSkeleton />
|
|
312
|
+
) : (
|
|
313
|
+
<HotelCard hotel={hotel} />
|
|
314
|
+
)}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### EmptyState
|
|
318
|
+
|
|
319
|
+
Generic empty state component for no results, no bookings, no favourites, etc.
|
|
320
|
+
|
|
321
|
+
```tsx
|
|
322
|
+
import { EmptyState } from '@hotelcard/ui';
|
|
323
|
+
|
|
324
|
+
// With icon (React node)
|
|
325
|
+
<EmptyState
|
|
326
|
+
image={<CalendarIcon />}
|
|
327
|
+
title="No bookings yet!"
|
|
328
|
+
description="Your next travel adventure is just around the corner."
|
|
329
|
+
action={{
|
|
330
|
+
label: "Start exploring",
|
|
331
|
+
onClick: () => navigate('/search'),
|
|
332
|
+
variant: 'secondary',
|
|
333
|
+
}}
|
|
334
|
+
/>
|
|
335
|
+
|
|
336
|
+
// With image URL
|
|
337
|
+
<EmptyState
|
|
338
|
+
image="/images/no-results.png"
|
|
339
|
+
title="No results found"
|
|
340
|
+
description="Try adjusting your filters or search for a different destination."
|
|
341
|
+
action={{
|
|
342
|
+
label: "Clear filters",
|
|
343
|
+
onClick: handleClearFilters,
|
|
344
|
+
}}
|
|
345
|
+
/>
|
|
346
|
+
|
|
347
|
+
// Without action button
|
|
348
|
+
<EmptyState
|
|
349
|
+
image={<SearchIcon />}
|
|
350
|
+
title="Nothing here yet"
|
|
351
|
+
description="Check back later for updates."
|
|
352
|
+
/>
|
|
353
|
+
```
|
|
271
354
|
|
|
272
355
|
### Modal
|
|
273
356
|
|
|
@@ -663,6 +746,7 @@ import type {
|
|
|
663
746
|
BaseCardProps,
|
|
664
747
|
BaseCardImageProps,
|
|
665
748
|
BaseCardContentProps,
|
|
749
|
+
BaseCardSkeletonProps,
|
|
666
750
|
CheckboxProps,
|
|
667
751
|
RadioButtonProps,
|
|
668
752
|
DropdownProps,
|
|
@@ -678,6 +762,7 @@ import type {
|
|
|
678
762
|
BenefitsProps,
|
|
679
763
|
BenefitItem,
|
|
680
764
|
PinProps,
|
|
765
|
+
EmptyStateProps,
|
|
681
766
|
|
|
682
767
|
// Search Component Props
|
|
683
768
|
DateSelectorProps,
|