@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.
Potentially problematic release.
This version of @hotelcard/ui might be problematic. Click here for more details.
- 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/dist/index.d.cts
CHANGED
|
@@ -318,35 +318,6 @@ interface CardProps {
|
|
|
318
318
|
|
|
319
319
|
declare const Card: React__default.FC<CardProps>;
|
|
320
320
|
|
|
321
|
-
interface CompactCardBadge {
|
|
322
|
-
text: string;
|
|
323
|
-
variant?: 'primary' | 'secondary';
|
|
324
|
-
}
|
|
325
|
-
interface CompactCardProps {
|
|
326
|
-
/** Image URL for the card */
|
|
327
|
-
image?: string;
|
|
328
|
-
/** Alt text for accessibility */
|
|
329
|
-
imageAlt?: string;
|
|
330
|
-
/** Main label/title text */
|
|
331
|
-
label?: string;
|
|
332
|
-
/** Price text */
|
|
333
|
-
price?: string;
|
|
334
|
-
/** Rating value (1-6, 6 = Swiss Lodge) */
|
|
335
|
-
stars?: number;
|
|
336
|
-
/** Superior hotel indicator */
|
|
337
|
-
isSuperior?: boolean;
|
|
338
|
-
/** Badge configuration */
|
|
339
|
-
badge?: CompactCardBadge;
|
|
340
|
-
/** Click handler */
|
|
341
|
-
onClick?: () => void;
|
|
342
|
-
/** Additional CSS classes */
|
|
343
|
-
className?: string;
|
|
344
|
-
/** Label for Swiss Lodge (rating = 6), e.g., "Swiss Lodge" */
|
|
345
|
-
swissLodgeLabel?: string;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
declare const CompactCard: React__default.FC<CompactCardProps>;
|
|
349
|
-
|
|
350
321
|
interface DropdownOption {
|
|
351
322
|
value: string;
|
|
352
323
|
label: string;
|
|
@@ -680,6 +651,125 @@ interface GuestContentProps {
|
|
|
680
651
|
*/
|
|
681
652
|
declare const GuestContent: React__default.FC<GuestContentProps>;
|
|
682
653
|
|
|
654
|
+
/**
|
|
655
|
+
* HotelCard Component Types
|
|
656
|
+
*
|
|
657
|
+
* Shared hotel card for search results. Platform-agnostic design:
|
|
658
|
+
* - All text via labels prop
|
|
659
|
+
* - Navigation/auth handled by consuming apps
|
|
660
|
+
*/
|
|
661
|
+
/**
|
|
662
|
+
* Labels for HotelCard component
|
|
663
|
+
* All text is passed as props - consuming apps provide translations
|
|
664
|
+
*/
|
|
665
|
+
interface HotelCardLabels {
|
|
666
|
+
ratingExcellent?: string;
|
|
667
|
+
ratingVeryGood?: string;
|
|
668
|
+
ratingGood?: string;
|
|
669
|
+
ratingFair?: string;
|
|
670
|
+
rating?: string;
|
|
671
|
+
priceFrom?: string;
|
|
672
|
+
notAvailable?: string;
|
|
673
|
+
swissLodge?: string;
|
|
674
|
+
removeFromFavorites?: string;
|
|
675
|
+
addToFavorites?: string;
|
|
676
|
+
previousImage?: string;
|
|
677
|
+
nextImage?: string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Hotel data structure for the card
|
|
681
|
+
*/
|
|
682
|
+
interface HotelCardHotel {
|
|
683
|
+
id: string;
|
|
684
|
+
name: string;
|
|
685
|
+
slug: string;
|
|
686
|
+
stars: number;
|
|
687
|
+
isSuperior?: boolean;
|
|
688
|
+
rating: number;
|
|
689
|
+
location: string;
|
|
690
|
+
images: string[];
|
|
691
|
+
isFavorite: boolean;
|
|
692
|
+
benefits: Array<{
|
|
693
|
+
id: string;
|
|
694
|
+
label: string;
|
|
695
|
+
}>;
|
|
696
|
+
isAvailable?: boolean;
|
|
697
|
+
currency?: string;
|
|
698
|
+
price: {
|
|
699
|
+
current: number;
|
|
700
|
+
original?: number;
|
|
701
|
+
discount?: number;
|
|
702
|
+
};
|
|
703
|
+
usp?: string;
|
|
704
|
+
badges?: string[];
|
|
705
|
+
}
|
|
706
|
+
interface HotelCardProps {
|
|
707
|
+
/** Hotel data */
|
|
708
|
+
hotel: HotelCardHotel;
|
|
709
|
+
/** Called when favorite button is clicked */
|
|
710
|
+
onFavoriteClick: () => void;
|
|
711
|
+
/** Called when card content is clicked (for navigation) */
|
|
712
|
+
onContentClick?: () => void;
|
|
713
|
+
/** Labels for all text content */
|
|
714
|
+
labels?: HotelCardLabels;
|
|
715
|
+
/** Additional class name */
|
|
716
|
+
className?: string;
|
|
717
|
+
}
|
|
718
|
+
interface HotelCardImageProps {
|
|
719
|
+
images: string[];
|
|
720
|
+
hotelName: string;
|
|
721
|
+
badges?: string[];
|
|
722
|
+
isFavorite: boolean;
|
|
723
|
+
onFavoriteClick: () => void;
|
|
724
|
+
labels?: Pick<HotelCardLabels, 'removeFromFavorites' | 'addToFavorites' | 'previousImage' | 'nextImage'>;
|
|
725
|
+
}
|
|
726
|
+
interface HotelCardContentProps {
|
|
727
|
+
name: string;
|
|
728
|
+
stars: number;
|
|
729
|
+
isSuperior?: boolean;
|
|
730
|
+
rating: number;
|
|
731
|
+
location: string;
|
|
732
|
+
benefits: Array<{
|
|
733
|
+
id: string;
|
|
734
|
+
label: string;
|
|
735
|
+
}>;
|
|
736
|
+
price: {
|
|
737
|
+
current: number;
|
|
738
|
+
original?: number;
|
|
739
|
+
discount?: number;
|
|
740
|
+
};
|
|
741
|
+
currency?: string;
|
|
742
|
+
isAvailable?: boolean;
|
|
743
|
+
usp?: string;
|
|
744
|
+
onClick?: () => void;
|
|
745
|
+
labels?: Omit<HotelCardLabels, 'removeFromFavorites' | 'addToFavorites' | 'previousImage' | 'nextImage'>;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* HotelCard Component
|
|
750
|
+
*
|
|
751
|
+
* A presentational card component for displaying hotel information in search results.
|
|
752
|
+
* Platform-agnostic - navigation and auth logic should be handled by consuming apps.
|
|
753
|
+
*
|
|
754
|
+
* @example
|
|
755
|
+
* ```tsx
|
|
756
|
+
* <HotelCard
|
|
757
|
+
* hotel={hotelData}
|
|
758
|
+
* onFavoriteClick={() => toggleFavorite(hotelData.id)}
|
|
759
|
+
* onContentClick={() => navigate(`/hotel/${hotelData.slug}`)}
|
|
760
|
+
* labels={{
|
|
761
|
+
* priceFrom: t('hotel.priceFrom'),
|
|
762
|
+
* ratingExcellent: t('rating.excellent'),
|
|
763
|
+
* }}
|
|
764
|
+
* />
|
|
765
|
+
* ```
|
|
766
|
+
*/
|
|
767
|
+
declare const HotelCard: React__default.FC<HotelCardProps>;
|
|
768
|
+
|
|
769
|
+
declare const HotelCardImage: React__default.FC<HotelCardImageProps>;
|
|
770
|
+
|
|
771
|
+
declare const HotelCardContent: React__default.FC<HotelCardContentProps>;
|
|
772
|
+
|
|
683
773
|
interface HeartIconProps {
|
|
684
774
|
filled?: boolean;
|
|
685
775
|
className?: string;
|
|
@@ -874,4 +964,4 @@ interface SearchFilters {
|
|
|
874
964
|
regions?: string[];
|
|
875
965
|
}
|
|
876
966
|
|
|
877
|
-
export { type Address, Badge, type BadgeProps, type BenefitItem, Benefits, type BenefitsProps, Block, type BlockProps, type Booking, Button, type ButtonProps, Card, type CardBadge, type CardProps, type CardRatingInfo, Checkbox, type CheckboxProps, type CheckboxSize, ChevronLeftIcon, ChevronRightIcon, type ChildAgeError, Chip, type ChipProps, type ChipSize, type ChipState,
|
|
967
|
+
export { type Address, Badge, type BadgeProps, type BenefitItem, Benefits, type BenefitsProps, Block, type BlockProps, type Booking, Button, type ButtonProps, Card, type CardBadge, type CardProps, type CardRatingInfo, Checkbox, type CheckboxProps, type CheckboxSize, ChevronLeftIcon, ChevronRightIcon, type ChildAgeError, Chip, type ChipProps, type ChipSize, type ChipState, type DateRange, DateSelector, type DateSelectorProps, Divider, type DividerProps, Dropdown, type DropdownOption, type DropdownProps, DualCalendar, FAQ, type FAQItem, type FAQProps, GuestContent, type GuestContentLabels, type GuestContentProps, type GuestCounts, HeartIcon, type Hotel, HotelCard, HotelCardContent, type HotelCardContentProps, type HotelCardHotel, HotelCardImage, type HotelCardImageProps, type HotelCardLabels, type HotelCardProps, HotelCardUIProvider, type HotelCardUIProviderProps, Input, type InputProps, type InputType, type Membership, Modal, type ModalProps, Pin, PinIcon, type PinProps, RadioButton, type RadioButtonProps, Rating, type RatingProps, ReviewCard, type ReviewCardProps, type SearchFilters, type SearchParams, SectionHeader, type SectionHeaderProps, StarIcon, type UIContextValue, type User, WhenContent, type WhenContentLabels, type WhenContentProps, calculateDiscount, formatDate, formatDateRange, formatPrice, useDebounce, useResponsive, useTranslation, useUIContext, useWindowData };
|
package/dist/index.d.ts
CHANGED
|
@@ -318,35 +318,6 @@ interface CardProps {
|
|
|
318
318
|
|
|
319
319
|
declare const Card: React__default.FC<CardProps>;
|
|
320
320
|
|
|
321
|
-
interface CompactCardBadge {
|
|
322
|
-
text: string;
|
|
323
|
-
variant?: 'primary' | 'secondary';
|
|
324
|
-
}
|
|
325
|
-
interface CompactCardProps {
|
|
326
|
-
/** Image URL for the card */
|
|
327
|
-
image?: string;
|
|
328
|
-
/** Alt text for accessibility */
|
|
329
|
-
imageAlt?: string;
|
|
330
|
-
/** Main label/title text */
|
|
331
|
-
label?: string;
|
|
332
|
-
/** Price text */
|
|
333
|
-
price?: string;
|
|
334
|
-
/** Rating value (1-6, 6 = Swiss Lodge) */
|
|
335
|
-
stars?: number;
|
|
336
|
-
/** Superior hotel indicator */
|
|
337
|
-
isSuperior?: boolean;
|
|
338
|
-
/** Badge configuration */
|
|
339
|
-
badge?: CompactCardBadge;
|
|
340
|
-
/** Click handler */
|
|
341
|
-
onClick?: () => void;
|
|
342
|
-
/** Additional CSS classes */
|
|
343
|
-
className?: string;
|
|
344
|
-
/** Label for Swiss Lodge (rating = 6), e.g., "Swiss Lodge" */
|
|
345
|
-
swissLodgeLabel?: string;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
declare const CompactCard: React__default.FC<CompactCardProps>;
|
|
349
|
-
|
|
350
321
|
interface DropdownOption {
|
|
351
322
|
value: string;
|
|
352
323
|
label: string;
|
|
@@ -680,6 +651,125 @@ interface GuestContentProps {
|
|
|
680
651
|
*/
|
|
681
652
|
declare const GuestContent: React__default.FC<GuestContentProps>;
|
|
682
653
|
|
|
654
|
+
/**
|
|
655
|
+
* HotelCard Component Types
|
|
656
|
+
*
|
|
657
|
+
* Shared hotel card for search results. Platform-agnostic design:
|
|
658
|
+
* - All text via labels prop
|
|
659
|
+
* - Navigation/auth handled by consuming apps
|
|
660
|
+
*/
|
|
661
|
+
/**
|
|
662
|
+
* Labels for HotelCard component
|
|
663
|
+
* All text is passed as props - consuming apps provide translations
|
|
664
|
+
*/
|
|
665
|
+
interface HotelCardLabels {
|
|
666
|
+
ratingExcellent?: string;
|
|
667
|
+
ratingVeryGood?: string;
|
|
668
|
+
ratingGood?: string;
|
|
669
|
+
ratingFair?: string;
|
|
670
|
+
rating?: string;
|
|
671
|
+
priceFrom?: string;
|
|
672
|
+
notAvailable?: string;
|
|
673
|
+
swissLodge?: string;
|
|
674
|
+
removeFromFavorites?: string;
|
|
675
|
+
addToFavorites?: string;
|
|
676
|
+
previousImage?: string;
|
|
677
|
+
nextImage?: string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Hotel data structure for the card
|
|
681
|
+
*/
|
|
682
|
+
interface HotelCardHotel {
|
|
683
|
+
id: string;
|
|
684
|
+
name: string;
|
|
685
|
+
slug: string;
|
|
686
|
+
stars: number;
|
|
687
|
+
isSuperior?: boolean;
|
|
688
|
+
rating: number;
|
|
689
|
+
location: string;
|
|
690
|
+
images: string[];
|
|
691
|
+
isFavorite: boolean;
|
|
692
|
+
benefits: Array<{
|
|
693
|
+
id: string;
|
|
694
|
+
label: string;
|
|
695
|
+
}>;
|
|
696
|
+
isAvailable?: boolean;
|
|
697
|
+
currency?: string;
|
|
698
|
+
price: {
|
|
699
|
+
current: number;
|
|
700
|
+
original?: number;
|
|
701
|
+
discount?: number;
|
|
702
|
+
};
|
|
703
|
+
usp?: string;
|
|
704
|
+
badges?: string[];
|
|
705
|
+
}
|
|
706
|
+
interface HotelCardProps {
|
|
707
|
+
/** Hotel data */
|
|
708
|
+
hotel: HotelCardHotel;
|
|
709
|
+
/** Called when favorite button is clicked */
|
|
710
|
+
onFavoriteClick: () => void;
|
|
711
|
+
/** Called when card content is clicked (for navigation) */
|
|
712
|
+
onContentClick?: () => void;
|
|
713
|
+
/** Labels for all text content */
|
|
714
|
+
labels?: HotelCardLabels;
|
|
715
|
+
/** Additional class name */
|
|
716
|
+
className?: string;
|
|
717
|
+
}
|
|
718
|
+
interface HotelCardImageProps {
|
|
719
|
+
images: string[];
|
|
720
|
+
hotelName: string;
|
|
721
|
+
badges?: string[];
|
|
722
|
+
isFavorite: boolean;
|
|
723
|
+
onFavoriteClick: () => void;
|
|
724
|
+
labels?: Pick<HotelCardLabels, 'removeFromFavorites' | 'addToFavorites' | 'previousImage' | 'nextImage'>;
|
|
725
|
+
}
|
|
726
|
+
interface HotelCardContentProps {
|
|
727
|
+
name: string;
|
|
728
|
+
stars: number;
|
|
729
|
+
isSuperior?: boolean;
|
|
730
|
+
rating: number;
|
|
731
|
+
location: string;
|
|
732
|
+
benefits: Array<{
|
|
733
|
+
id: string;
|
|
734
|
+
label: string;
|
|
735
|
+
}>;
|
|
736
|
+
price: {
|
|
737
|
+
current: number;
|
|
738
|
+
original?: number;
|
|
739
|
+
discount?: number;
|
|
740
|
+
};
|
|
741
|
+
currency?: string;
|
|
742
|
+
isAvailable?: boolean;
|
|
743
|
+
usp?: string;
|
|
744
|
+
onClick?: () => void;
|
|
745
|
+
labels?: Omit<HotelCardLabels, 'removeFromFavorites' | 'addToFavorites' | 'previousImage' | 'nextImage'>;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* HotelCard Component
|
|
750
|
+
*
|
|
751
|
+
* A presentational card component for displaying hotel information in search results.
|
|
752
|
+
* Platform-agnostic - navigation and auth logic should be handled by consuming apps.
|
|
753
|
+
*
|
|
754
|
+
* @example
|
|
755
|
+
* ```tsx
|
|
756
|
+
* <HotelCard
|
|
757
|
+
* hotel={hotelData}
|
|
758
|
+
* onFavoriteClick={() => toggleFavorite(hotelData.id)}
|
|
759
|
+
* onContentClick={() => navigate(`/hotel/${hotelData.slug}`)}
|
|
760
|
+
* labels={{
|
|
761
|
+
* priceFrom: t('hotel.priceFrom'),
|
|
762
|
+
* ratingExcellent: t('rating.excellent'),
|
|
763
|
+
* }}
|
|
764
|
+
* />
|
|
765
|
+
* ```
|
|
766
|
+
*/
|
|
767
|
+
declare const HotelCard: React__default.FC<HotelCardProps>;
|
|
768
|
+
|
|
769
|
+
declare const HotelCardImage: React__default.FC<HotelCardImageProps>;
|
|
770
|
+
|
|
771
|
+
declare const HotelCardContent: React__default.FC<HotelCardContentProps>;
|
|
772
|
+
|
|
683
773
|
interface HeartIconProps {
|
|
684
774
|
filled?: boolean;
|
|
685
775
|
className?: string;
|
|
@@ -874,4 +964,4 @@ interface SearchFilters {
|
|
|
874
964
|
regions?: string[];
|
|
875
965
|
}
|
|
876
966
|
|
|
877
|
-
export { type Address, Badge, type BadgeProps, type BenefitItem, Benefits, type BenefitsProps, Block, type BlockProps, type Booking, Button, type ButtonProps, Card, type CardBadge, type CardProps, type CardRatingInfo, Checkbox, type CheckboxProps, type CheckboxSize, ChevronLeftIcon, ChevronRightIcon, type ChildAgeError, Chip, type ChipProps, type ChipSize, type ChipState,
|
|
967
|
+
export { type Address, Badge, type BadgeProps, type BenefitItem, Benefits, type BenefitsProps, Block, type BlockProps, type Booking, Button, type ButtonProps, Card, type CardBadge, type CardProps, type CardRatingInfo, Checkbox, type CheckboxProps, type CheckboxSize, ChevronLeftIcon, ChevronRightIcon, type ChildAgeError, Chip, type ChipProps, type ChipSize, type ChipState, type DateRange, DateSelector, type DateSelectorProps, Divider, type DividerProps, Dropdown, type DropdownOption, type DropdownProps, DualCalendar, FAQ, type FAQItem, type FAQProps, GuestContent, type GuestContentLabels, type GuestContentProps, type GuestCounts, HeartIcon, type Hotel, HotelCard, HotelCardContent, type HotelCardContentProps, type HotelCardHotel, HotelCardImage, type HotelCardImageProps, type HotelCardLabels, type HotelCardProps, HotelCardUIProvider, type HotelCardUIProviderProps, Input, type InputProps, type InputType, type Membership, Modal, type ModalProps, Pin, PinIcon, type PinProps, RadioButton, type RadioButtonProps, Rating, type RatingProps, ReviewCard, type ReviewCardProps, type SearchFilters, type SearchParams, SectionHeader, type SectionHeaderProps, StarIcon, type UIContextValue, type User, WhenContent, type WhenContentLabels, type WhenContentProps, calculateDiscount, formatDate, formatDateRange, formatPrice, useDebounce, useResponsive, useTranslation, useUIContext, useWindowData };
|