@hotelcard/ui 0.0.47 → 0.0.48
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 +47 -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 +101 -0
- package/dist/index.js +2215 -2085
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -94,6 +94,7 @@ The package includes built-in translations for `de`, `en`, `fr`, and `it` locale
|
|
|
94
94
|
| `Input` | Text input with label, helper text, and validation |
|
|
95
95
|
| `Badge` | Status and discount badges |
|
|
96
96
|
| `Card` | Hotel card component |
|
|
97
|
+
| `BaseCard` | Composable card primitives (container, image, content) for building custom cards |
|
|
97
98
|
| `Chip` | Filter and tag chips |
|
|
98
99
|
| `Checkbox` | Checkbox with label |
|
|
99
100
|
| `RadioButton` | Radio button with label |
|
|
@@ -225,6 +226,49 @@ import { Card } from '@hotelcard/ui';
|
|
|
225
226
|
/>
|
|
226
227
|
```
|
|
227
228
|
|
|
229
|
+
### BaseCard (Composable Card Primitives)
|
|
230
|
+
|
|
231
|
+
Use `BaseCard`, `BaseCardImage`, and `BaseCardContent` to build custom cards with consistent styling:
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
import { BaseCard, BaseCardImage, BaseCardContent } from '@hotelcard/ui';
|
|
235
|
+
|
|
236
|
+
// Custom booking card using BaseCard primitives
|
|
237
|
+
<BaseCard hoverable onClick={() => navigateToBooking()}>
|
|
238
|
+
<BaseCardImage
|
|
239
|
+
src={hotel.imageUrl}
|
|
240
|
+
alt={hotel.name}
|
|
241
|
+
height={200}
|
|
242
|
+
topLeftSlot={<StatusBadge status="confirmed" />}
|
|
243
|
+
topRightSlot={<FavoriteButton />}
|
|
244
|
+
/>
|
|
245
|
+
<BaseCardContent padding="large">
|
|
246
|
+
<h3>{hotel.name}</h3>
|
|
247
|
+
<p>{hotel.location}</p>
|
|
248
|
+
<div>Check-in: {checkInDate}</div>
|
|
249
|
+
</BaseCardContent>
|
|
250
|
+
</BaseCard>
|
|
251
|
+
|
|
252
|
+
// With aspect ratio instead of fixed height
|
|
253
|
+
<BaseCard borderRadius={16}>
|
|
254
|
+
<BaseCardImage
|
|
255
|
+
src={hotel.imageUrl}
|
|
256
|
+
alt={hotel.name}
|
|
257
|
+
aspectRatio="16/9"
|
|
258
|
+
showGradient={true}
|
|
259
|
+
bottomSlot={<ImageIndicatorDots count={3} active={0} />}
|
|
260
|
+
/>
|
|
261
|
+
<BaseCardContent padding="medium">
|
|
262
|
+
{/* Your content */}
|
|
263
|
+
</BaseCardContent>
|
|
264
|
+
</BaseCard>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
BaseCard provides:
|
|
268
|
+
- **BaseCard**: Container with border, radius, shadow, hover effects
|
|
269
|
+
- **BaseCardImage**: Image with overlay slots (top-left, top-right, center, bottom)
|
|
270
|
+
- **BaseCardContent**: Content area with configurable padding ('none' | 'small' | 'medium' | 'large')
|
|
271
|
+
|
|
228
272
|
### Modal
|
|
229
273
|
|
|
230
274
|
```tsx
|
|
@@ -616,6 +660,9 @@ import type {
|
|
|
616
660
|
BadgeProps,
|
|
617
661
|
InputProps,
|
|
618
662
|
CardProps,
|
|
663
|
+
BaseCardProps,
|
|
664
|
+
BaseCardImageProps,
|
|
665
|
+
BaseCardContentProps,
|
|
619
666
|
CheckboxProps,
|
|
620
667
|
RadioButtonProps,
|
|
621
668
|
DropdownProps,
|