@hotelcard/ui 0.0.11 → 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/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;
@@ -612,6 +583,193 @@ interface DualCalendarProps {
612
583
  }
613
584
  declare const DualCalendar: React__default.FC<DualCalendarProps>;
614
585
 
586
+ /**
587
+ * Guest counts object
588
+ */
589
+ interface GuestCounts {
590
+ adults: number;
591
+ children: number;
592
+ childrenAges: Array<number | null>;
593
+ }
594
+ interface ChildAgeError {
595
+ index: number;
596
+ message: string;
597
+ }
598
+ /**
599
+ * Labels for GuestContent component
600
+ * All text is passed as props - consuming apps provide translations
601
+ */
602
+ interface GuestContentLabels {
603
+ /** Label for adults row (e.g., "Adults") */
604
+ adults?: string;
605
+ /** Label for children row (e.g., "Children") */
606
+ children?: string;
607
+ /** Label for pet toggle (e.g., "Pet") */
608
+ pet?: string;
609
+ /** Label for child age dropdown (e.g., "Age of child") */
610
+ ageOfChild?: string;
611
+ /** Placeholder for age dropdown (e.g., "Age") */
612
+ age?: string;
613
+ /** Aria label for decrease adults button */
614
+ decreaseAdults?: string;
615
+ /** Aria label for increase adults button */
616
+ increaseAdults?: string;
617
+ /** Aria label for decrease children button */
618
+ decreaseChildren?: string;
619
+ /** Aria label for increase children button */
620
+ increaseChildren?: string;
621
+ /** Aria label for pet toggle */
622
+ togglePets?: string;
623
+ }
624
+ interface GuestContentProps {
625
+ /** Current guest counts */
626
+ guests: GuestCounts;
627
+ /** Called when guests change */
628
+ onChange: (guests: GuestCounts) => void;
629
+ /** Current pet filter value (0 or 1) */
630
+ petFilter?: number;
631
+ /** Called when pet filter changes */
632
+ onPetChange?: (value: number) => void;
633
+ /** Show pet toggle */
634
+ showPetToggle?: boolean;
635
+ /** Additional class name for container */
636
+ className?: string;
637
+ /** Validation errors for child ages */
638
+ childAgeErrors?: ChildAgeError[];
639
+ /** Called when an error is cleared (user selects an age) */
640
+ onErrorClear?: (index: number) => void;
641
+ /** Labels for all text content */
642
+ labels?: GuestContentLabels;
643
+ }
644
+ /**
645
+ * GuestContent - Shared guest selection UI
646
+ *
647
+ * Used by both desktop GuestSelector dropdown and mobile SearchModal.
648
+ * Contains adults counter, children counter with age dropdowns, and optional pet toggle.
649
+ *
650
+ * All text labels are passed as props - consuming apps provide translations.
651
+ */
652
+ declare const GuestContent: React__default.FC<GuestContentProps>;
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
+
615
773
  interface HeartIconProps {
616
774
  filled?: boolean;
617
775
  className?: string;
@@ -806,4 +964,4 @@ interface SearchFilters {
806
964
  regions?: string[];
807
965
  }
808
966
 
809
- 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, Chip, type ChipProps, type ChipSize, type ChipState, CompactCard, type CompactCardBadge, type CompactCardProps, type DateRange, DateSelector, type DateSelectorProps, Divider, type DividerProps, Dropdown, type DropdownOption, type DropdownProps, DualCalendar, FAQ, type FAQItem, type FAQProps, HeartIcon, type Hotel, 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 WhenContentProps, calculateDiscount, formatDate, formatDateRange, formatPrice, useDebounce, useResponsive, useTranslation, useUIContext, useWindowData };
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;
@@ -612,6 +583,193 @@ interface DualCalendarProps {
612
583
  }
613
584
  declare const DualCalendar: React__default.FC<DualCalendarProps>;
614
585
 
586
+ /**
587
+ * Guest counts object
588
+ */
589
+ interface GuestCounts {
590
+ adults: number;
591
+ children: number;
592
+ childrenAges: Array<number | null>;
593
+ }
594
+ interface ChildAgeError {
595
+ index: number;
596
+ message: string;
597
+ }
598
+ /**
599
+ * Labels for GuestContent component
600
+ * All text is passed as props - consuming apps provide translations
601
+ */
602
+ interface GuestContentLabels {
603
+ /** Label for adults row (e.g., "Adults") */
604
+ adults?: string;
605
+ /** Label for children row (e.g., "Children") */
606
+ children?: string;
607
+ /** Label for pet toggle (e.g., "Pet") */
608
+ pet?: string;
609
+ /** Label for child age dropdown (e.g., "Age of child") */
610
+ ageOfChild?: string;
611
+ /** Placeholder for age dropdown (e.g., "Age") */
612
+ age?: string;
613
+ /** Aria label for decrease adults button */
614
+ decreaseAdults?: string;
615
+ /** Aria label for increase adults button */
616
+ increaseAdults?: string;
617
+ /** Aria label for decrease children button */
618
+ decreaseChildren?: string;
619
+ /** Aria label for increase children button */
620
+ increaseChildren?: string;
621
+ /** Aria label for pet toggle */
622
+ togglePets?: string;
623
+ }
624
+ interface GuestContentProps {
625
+ /** Current guest counts */
626
+ guests: GuestCounts;
627
+ /** Called when guests change */
628
+ onChange: (guests: GuestCounts) => void;
629
+ /** Current pet filter value (0 or 1) */
630
+ petFilter?: number;
631
+ /** Called when pet filter changes */
632
+ onPetChange?: (value: number) => void;
633
+ /** Show pet toggle */
634
+ showPetToggle?: boolean;
635
+ /** Additional class name for container */
636
+ className?: string;
637
+ /** Validation errors for child ages */
638
+ childAgeErrors?: ChildAgeError[];
639
+ /** Called when an error is cleared (user selects an age) */
640
+ onErrorClear?: (index: number) => void;
641
+ /** Labels for all text content */
642
+ labels?: GuestContentLabels;
643
+ }
644
+ /**
645
+ * GuestContent - Shared guest selection UI
646
+ *
647
+ * Used by both desktop GuestSelector dropdown and mobile SearchModal.
648
+ * Contains adults counter, children counter with age dropdowns, and optional pet toggle.
649
+ *
650
+ * All text labels are passed as props - consuming apps provide translations.
651
+ */
652
+ declare const GuestContent: React__default.FC<GuestContentProps>;
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
+
615
773
  interface HeartIconProps {
616
774
  filled?: boolean;
617
775
  className?: string;
@@ -806,4 +964,4 @@ interface SearchFilters {
806
964
  regions?: string[];
807
965
  }
808
966
 
809
- 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, Chip, type ChipProps, type ChipSize, type ChipState, CompactCard, type CompactCardBadge, type CompactCardProps, type DateRange, DateSelector, type DateSelectorProps, Divider, type DividerProps, Dropdown, type DropdownOption, type DropdownProps, DualCalendar, FAQ, type FAQItem, type FAQProps, HeartIcon, type Hotel, 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 WhenContentProps, calculateDiscount, formatDate, formatDateRange, formatPrice, useDebounce, useResponsive, useTranslation, useUIContext, useWindowData };
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 };