@hotelcard/ui 0.0.46 → 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.

Potentially problematic release.


This version of @hotelcard/ui might be problematic. Click here for more details.

package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ButtonHTMLAttributes } from 'react';
2
+ import { CSSProperties } from 'react';
2
3
  import { default as default_2 } from 'react';
3
4
  import { ForwardRefExoticComponent } from 'react';
4
5
  import { i18n } from 'i18next';
@@ -47,6 +48,105 @@ export declare interface BadgeProps {
47
48
  className?: string;
48
49
  }
49
50
 
51
+ /**
52
+ * BaseCard - Container component
53
+ *
54
+ * A composable card container that provides consistent styling.
55
+ * Use with BaseCardImage and BaseCardContent for complete cards.
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * <BaseCard hoverable onClick={handleClick}>
60
+ * <BaseCardImage src={imageUrl} alt="Hotel" topRightSlot={<FavoriteButton />} />
61
+ * <BaseCardContent padding="large">
62
+ * <h3>Hotel Name</h3>
63
+ * <p>Location</p>
64
+ * </BaseCardContent>
65
+ * </BaseCard>
66
+ * ```
67
+ */
68
+ export declare const BaseCard: default_2.FC<BaseCardProps>;
69
+
70
+ /**
71
+ * BaseCardContent - Content container with configurable padding
72
+ *
73
+ * Wraps card content with consistent spacing.
74
+ */
75
+ export declare const BaseCardContent: default_2.FC<BaseCardContentProps>;
76
+
77
+ export declare interface BaseCardContentProps {
78
+ /** Child content */
79
+ children: ReactNode;
80
+ /** Padding size: 'none' | 'small' | 'medium' | 'large' */
81
+ padding?: 'none' | 'small' | 'medium' | 'large';
82
+ /** Additional class name */
83
+ className?: string;
84
+ /** Custom styles */
85
+ style?: CSSProperties;
86
+ /** Content click handler */
87
+ onClick?: () => void;
88
+ }
89
+
90
+ /**
91
+ * BaseCardImage - Image container with overlay slots
92
+ *
93
+ * Provides consistent image styling with support for overlays
94
+ * like badges, favorite buttons, and indicators.
95
+ */
96
+ export declare const BaseCardImage: default_2.FC<BaseCardImageProps>;
97
+
98
+ export declare interface BaseCardImageProps {
99
+ /** Image source URL */
100
+ src: string;
101
+ /** Alt text for accessibility */
102
+ alt: string;
103
+ /** Image height (default: 268.5px for mobile) */
104
+ height?: number | string;
105
+ /** Aspect ratio (e.g., "16/9") - alternative to fixed height */
106
+ aspectRatio?: string;
107
+ /** Top-left overlay slot (e.g., badges) */
108
+ topLeftSlot?: ReactNode;
109
+ /** Top-right overlay slot (e.g., favorite button) */
110
+ topRightSlot?: ReactNode;
111
+ /** Bottom overlay slot (e.g., indicators, buttons) */
112
+ bottomSlot?: ReactNode;
113
+ /** Center overlay slot (e.g., play button) */
114
+ centerSlot?: ReactNode;
115
+ /** Whether to show gradient overlay for better text visibility */
116
+ showGradient?: boolean;
117
+ /** Image click handler (separate from card click) */
118
+ onClick?: () => void;
119
+ /** Custom styles */
120
+ style?: CSSProperties;
121
+ /** Additional class name */
122
+ className?: string;
123
+ /** Placeholder shown while loading or on error */
124
+ placeholder?: string;
125
+ /** Border radius for image container (default: inherits from card) */
126
+ borderRadius?: string;
127
+ }
128
+
129
+ /**
130
+ * BaseCard - Composable card container for building hotel/booking cards
131
+ *
132
+ * Provides consistent styling for:
133
+ * - Card container (border, radius, shadow)
134
+ * - Image container (aspect ratio, overlays)
135
+ * - Content container (padding)
136
+ */
137
+ export declare interface BaseCardProps {
138
+ /** Child content - can include BaseCardImage and BaseCardContent */
139
+ children: ReactNode;
140
+ /** Additional CSS class name */
141
+ className?: string;
142
+ /** Card click handler */
143
+ onClick?: () => void;
144
+ /** Whether to show hover shadow effect */
145
+ hoverable?: boolean;
146
+ /** Custom border radius (default: 24px) */
147
+ borderRadius?: number | string;
148
+ }
149
+
50
150
  export declare interface BenefitItem {
51
151
  icon?: string;
52
152
  title: string;
@@ -1008,6 +1108,7 @@ export declare interface Hotel {
1008
1108
  * HotelCard Component
1009
1109
  *
1010
1110
  * A presentational card component for displaying hotel information in search results.
1111
+ * Built on BaseCard for consistent card styling across the app.
1011
1112
  * Platform-agnostic - navigation and auth logic should be handled by consuming apps.
1012
1113
  * Translations handled internally via UIContext.
1013
1114
  *
@@ -1703,10 +1804,15 @@ export declare interface ThemeAggregation {
1703
1804
  }
1704
1805
 
1705
1806
  /** Translation function type */
1706
- export declare type TranslateFunction = (key: string, fallback?: string) => string;
1807
+ export declare type TranslateFunction = (key: string, optionsOrFallback?: TranslateOptions | string, fallback?: string) => string;
1707
1808
 
1708
1809
  declare type TranslateFunction_2 = (key: string, optionsOrFallback?: string | Record<string, unknown>, fallback?: string) => string;
1709
1810
 
1811
+ /** Translation options for interpolation */
1812
+ export declare interface TranslateOptions {
1813
+ [key: string]: string | number;
1814
+ }
1815
+
1710
1816
  export declare type TranslationKeys = typeof _default;
1711
1817
 
1712
1818
  export declare const translations: {