related-ui-components 2.7.5 → 2.7.6

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.
Files changed (25) hide show
  1. package/lib/module/app.js +4 -29
  2. package/lib/module/app.js.map +1 -1
  3. package/lib/module/components/TravelBooking/FlightSummary.js +219 -112
  4. package/lib/module/components/TravelBooking/FlightSummary.js.map +1 -1
  5. package/lib/module/components/TravelBooking/SummaryBar.js +239 -172
  6. package/lib/module/components/TravelBooking/SummaryBar.js.map +1 -1
  7. package/lib/module/components/TravelBooking/TravelBooking.js +407 -241
  8. package/lib/module/components/TravelBooking/TravelBooking.js.map +1 -1
  9. package/lib/module/components/TravelBooking/index.js +5 -4
  10. package/lib/module/components/TravelBooking/index.js.map +1 -1
  11. package/lib/typescript/src/components/TravelBooking/FlightSummary.d.ts +25 -11
  12. package/lib/typescript/src/components/TravelBooking/FlightSummary.d.ts.map +1 -1
  13. package/lib/typescript/src/components/TravelBooking/SummaryBar.d.ts +1 -16
  14. package/lib/typescript/src/components/TravelBooking/SummaryBar.d.ts.map +1 -1
  15. package/lib/typescript/src/components/TravelBooking/TravelBooking.d.ts +1 -83
  16. package/lib/typescript/src/components/TravelBooking/TravelBooking.d.ts.map +1 -1
  17. package/lib/typescript/src/components/TravelBooking/index.d.ts +0 -4
  18. package/lib/typescript/src/components/TravelBooking/index.d.ts.map +1 -1
  19. package/package.json +1 -1
  20. package/src/app.tsx +3 -3
  21. package/src/components/TravelBooking/FlightSummary.tsx +264 -164
  22. package/src/components/TravelBooking/SummaryBar.tsx +239 -239
  23. package/src/components/TravelBooking/TravelBooking.tsx +407 -407
  24. package/src/components/TravelBooking/index.ts +4 -4
  25. package/src/index.ts +1 -1
@@ -1,243 +1,409 @@
1
- "use strict";
1
+ // // src/components/TravelBooking.tsx (or wherever TravelBooking is)
2
+ // import React, { useState, useCallback, useMemo, useEffect } from "react";
3
+ // import { View, StyleSheet, StyleProp, ViewStyle, TextStyle } from "react-native"; // Import style types
4
+ // import TabSelector, { TabSelectorProps } from "./TabSelector"; // Adjust import path
5
+ // import FlightForm, { FlightFormProps } from "./FlightForm"; // Adjust import path
6
+ // import HotelForm, { HotelFormProps } from "./HotelForm"; // Adjust import path
7
+ // import CarRentalForm, {
8
+ // CarRentalFormProps,
9
+ // mockCarSuggestions,
10
+ // } from "./CarRentalForm"; // Adjust import path
11
+ // import { ThemeType, useTheme } from "../../theme"; // Adjust import path
12
+ // import SummaryBar, {
13
+ // SelectionCallbackDataType,
14
+ // SummaryBarProps,
15
+ // } from "./SummaryBar"; // Adjust import path
16
+ // import {
17
+ // FlightSuggestions,
18
+ // FormInputType,
19
+ // HotelSuggestions,
20
+ // CarSuggestions,
21
+ // } from "./types"; // Adjust import path
22
+ // import { FlightSelection, FlightSummaryProps } from "./FlightSummary";
23
+ // import { HotelSummaryProps, RoomState } from "./HotelSummary";
24
+
25
+ // // Define the possible tab names (can be overridden via props)
26
+ // type DefaultBookingType = "Flights" | "Hotels" | "Car Rentals";
27
+ // const DEFAULT_TABS: DefaultBookingType[] = ["Flights", "Hotels", "Car Rentals"];
28
+
29
+ // // Mock Data (Keep accessible for potential defaults)
30
+ // const DEFAULT_MOCK_FLIGHT_SUGGESTIONS: FlightSuggestions[] = [
31
+ // {
32
+ // id: 1,
33
+ // city: "London",
34
+ // value: "London, United Kingdom",
35
+ // airports: [
36
+ // "Heathrow Airport (LHR)",
37
+ // "Gatwick Airport (LGW)",
38
+ // "Stansted Airport (STN)",
39
+ // ],
40
+ // },
41
+ // {
42
+ // id: 2,
43
+ // city: "New York",
44
+ // value: "New York, USA",
45
+ // airports: [
46
+ // "John F. Kennedy Intl (JFK)",
47
+ // "LaGuardia Airport (LGA)",
48
+ // "Newark Liberty Intl (EWR)",
49
+ // ],
50
+ // },
51
+ // ];
52
+ // const DEFAULT_MOCK_HOTEL_SUGGESTIONS: HotelSuggestions[] = [
53
+ // { id: 1, city: "Beirut", country: "Lebanon", value: "BEIRUT, LEBANON" },
54
+ // {
55
+ // id: 2,
56
+ // city: "Dubai",
57
+ // country: "United Arab Emirates",
58
+ // value: "DUBAI, UNITED ARAB EMIRATES",
59
+ // },
60
+ // ];
61
+ // const DEFAULT_MOCK_CAR_SUGGESTIONS: CarSuggestions[] = mockCarSuggestions;
62
+
63
+ // // --- TravelBooking Props Interface ---
64
+ // export interface TravelBookingProps {
65
+ // /** Array of tab names. Defaults to ['Flights', 'Hotels', 'Car Rentals'] */
66
+ // tabs?: string[];
67
+ // /** The initially selected tab. Defaults to the first tab in the `tabs` array. */
68
+ // initialTab?: string;
69
+ // /** Callback when the selected tab changes */
70
+ // onTabChange?: (tab: string) => void;
71
+ // /** Callback when the search button is pressed in any form */
72
+ // onSearch?: (details: any) => void;
73
+ // /** Callback when any form input gains focus */
74
+ // onInputFocus?: (input: FormInputType) => void;
75
+ // /** Callback when text changes in location inputs */
76
+ // onTextChange?: (text: string) => void;
77
+
78
+ // /** Initial selection state for FlightSummary (if mode is 'flight') */
79
+ // initialFlightSelection?: FlightSelection;
80
+ // /** Initial selection state for HotelSummary (if mode is 'hotel') */
81
+ // initialHotelSelection?: RoomState[];
82
+ // /** Callback when the selection in SummaryBar changes */
83
+ // onSummarySelectionChange?: (selection: SelectionCallbackDataType) => void;
84
+
85
+ // /** Suggestion data for FlightForm */
86
+ // flightSuggestionData?: FlightSuggestions[];
87
+ // /** Suggestion data for HotelForm */
88
+ // hotelSuggestionData?: HotelSuggestions[];
89
+ // /** Suggestion data for CarRentalForm */
90
+ // carSuggestionData?: CarSuggestions[];
91
+
92
+ // // --- Common Style Props ---
93
+ // /** Style for the root container of each form */
94
+ // formContainerStyle?: StyleProp<ViewStyle>;
95
+ // /** Style for input labels */
96
+ // labelStyle?: StyleProp<TextStyle>;
97
+ // /** Style for the CustomInput's TextInput component */
98
+ // inputStyle?: StyleProp<ViewStyle>; // Renamed from commonInputStyle for clarity
99
+ // /** Style for the touchable wrapper around date displays (if applicable) */
100
+ // inputTouchableStyle?: StyleProp<ViewStyle>;
101
+ // /** Style for the text inside inputs or date displays */
102
+ // inputTextStyle?: StyleProp<TextStyle>;
103
+ // /** Style for the container holding the date picker(s) and search button */
104
+ // dateSearchRowStyle?: StyleProp<ViewStyle>;
105
+ // /** Style for the individual date display groups within DateRangePicker */
106
+ // dateInputGroupStyle?: StyleProp<ViewStyle>;
107
+ // /** Style for the search button */
108
+ // searchButtonStyle?: StyleProp<ViewStyle>;
109
+ // /** Style for the search icon */
110
+ // searchIconStyle?: StyleProp<TextStyle>;
111
+ // /** Theme overrides for the calendar component */
112
+ // calendarThemeOverrides?: object;
113
+ // /** Style for the container wrapping the calendar modal/view */
114
+ // calendarContainerStyle?: StyleProp<ViewStyle>;
115
+ // /** Style for the container wrapping the swap button (Flights/Cars) */
116
+ // swapButtonContainerStyle?: StyleProp<ViewStyle>;
117
+ // /** Style for the swap button itself (Flights/Cars) */
118
+ // swapButtonStyle?: StyleProp<ViewStyle>;
119
+ // /** Style for the swap icon (Flights/Cars) */
120
+ // swapIconStyle?: StyleProp<TextStyle>;
121
+ // /** Style for the container wrapping the input fields (Flights/Cars) */
122
+ // inputGroupContainerStyle?: StyleProp<ViewStyle>; // Added for consistency
123
+
124
+ // // --- Nested Props for Child Components ---
125
+
126
+ // /** Props to pass down to the TabSelector component */
127
+ // tabSelectorProps?: Omit<
128
+ // TabSelectorProps,
129
+ // "tabs" | "initialTab" | "onTabChange" // Controlled by TravelBooking
130
+ // >;
131
+
132
+ // /** Props to pass down to the SummaryBar component */
133
+ // summaryBarProps?: Omit<
134
+ // SummaryBarProps,
135
+ // | "mode"
136
+ // | "initialSelection"
137
+ // | "onSelectionChange"
138
+ // | "flightProps"
139
+ // | "hotelProps" // Controlled or derived by TravelBooking
140
+ // >;
141
+
142
+ // /** Props to pass down to the FlightSummary component (via SummaryBar) */
143
+ // flightSummaryProps?: Omit<
144
+ // FlightSummaryProps,
145
+ // "selection" | "onSelectionChange" // Controlled by SummaryBar/TravelBooking
146
+ // >;
147
+
148
+ // /** Props to pass down to the HotelSummary component (via SummaryBar) */
149
+ // hotelSummaryProps?: Omit<
150
+ // HotelSummaryProps,
151
+ // "selection" | "onSelectionChange" // Controlled by SummaryBar/TravelBooking
152
+ // >;
153
+
154
+ // /** Props to pass down to the FlightForm component */
155
+ // /** Props to pass down to the FlightForm component */
156
+ // flightFormProps?: Omit<
157
+ // FlightFormProps,
158
+ // "isOneWay" | "onSearchPress" | "onInputFocus" | "suggestionData" | "onTextChange" // Controlled or derived by TravelBooking
159
+ // >;
160
+
161
+ // /** Props to pass down to the HotelForm component */
162
+ // hotelFormProps?: Omit<
163
+ // HotelFormProps,
164
+ // "onSearchPress" | "onInputFocus" | "suggestionData" | "onTextChange" // Controlled by TravelBooking
165
+ // >;
166
+
167
+ // /** Props to pass down to the CarRentalForm component */
168
+ // carRentalFormProps?: Omit<
169
+ // CarRentalFormProps,
170
+ // "onSearchPress" | "onInputFocus" | "suggestionData" | "onTextChange"// Controlled by TravelBooking
171
+ // >;
172
+ // }
173
+
174
+ // // --- TravelBooking Component Implementation ---
175
+ // const TravelBooking: React.FC<TravelBookingProps> = ({
176
+ // tabs = DEFAULT_TABS,
177
+ // initialTab,
178
+ // onTabChange,
179
+ // onSearch,
180
+ // initialFlightSelection,
181
+ // initialHotelSelection,
182
+ // onSummarySelectionChange,
183
+ // flightSuggestionData = DEFAULT_MOCK_FLIGHT_SUGGESTIONS, // Provide defaults
184
+ // hotelSuggestionData = DEFAULT_MOCK_HOTEL_SUGGESTIONS, // Provide defaults
185
+ // carSuggestionData = DEFAULT_MOCK_CAR_SUGGESTIONS, // Provide defaults
186
+ // tabSelectorProps,
187
+ // summaryBarProps,
188
+ // flightFormProps,
189
+ // hotelFormProps,
190
+ // carRentalFormProps,
191
+ // onInputFocus,
192
+ // onTextChange,
193
+ // // Destructure common style props
194
+ // formContainerStyle,
195
+ // labelStyle,
196
+ // inputStyle,
197
+ // inputTouchableStyle,
198
+ // inputTextStyle,
199
+ // dateSearchRowStyle,
200
+ // dateInputGroupStyle,
201
+ // searchButtonStyle,
202
+ // searchIconStyle,
203
+ // calendarThemeOverrides,
204
+ // calendarContainerStyle,
205
+ // swapButtonContainerStyle,
206
+ // swapButtonStyle,
207
+ // swapIconStyle,
208
+ // inputGroupContainerStyle, // Added
209
+ // }) => {
210
+ // const { theme } = useTheme();
211
+ // const styles = useMemo(() => themedStyles(theme), [theme]);
212
+
213
+ // const actualInitialTab = useMemo(
214
+ // () => initialTab ?? (tabs.length > 0 ? tabs[0] : ""),
215
+ // [initialTab, tabs]
216
+ // );
217
+
218
+ // const [selectedTab, setSelectedTab] = useState<string>(actualInitialTab);
219
+ // const [selectedOptions, setSelectedOptions] = useState<
220
+ // SelectionCallbackDataType | undefined
221
+ // >(
222
+ // actualInitialTab === tabs[0] && tabs[0] === "Flights"
223
+ // ? initialFlightSelection
224
+ // : actualInitialTab === tabs[1] && tabs[1] === "Hotels"
225
+ // ? initialHotelSelection
226
+ // : undefined
227
+ // );
228
+
229
+ // // --- Handlers ---
230
+ // const handleTabChange = useCallback(
231
+ // (tab: string) => {
232
+ // setSelectedTab(tab);
233
+ // if (tab === "Flights") {
234
+ // setSelectedOptions(initialFlightSelection);
235
+ // } else if (tab === "Hotels") {
236
+ // setSelectedOptions(initialHotelSelection);
237
+ // } else {
238
+ // setSelectedOptions(undefined);
239
+ // }
240
+ // onTabChange?.(tab);
241
+ // },
242
+ // [onTabChange, initialFlightSelection, initialHotelSelection]
243
+ // );
2
244
 
3
- // src/components/TravelBooking.tsx (or wherever TravelBooking is)
4
- import React, { useState, useCallback, useMemo } from "react";
5
- import { View, StyleSheet } from "react-native"; // Import style types
6
- import TabSelector from "./TabSelector.js"; // Adjust import path
7
- import FlightForm from "./FlightForm.js"; // Adjust import path
8
- import HotelForm from "./HotelForm.js"; // Adjust import path
9
- import CarRentalForm, { mockCarSuggestions } from "./CarRentalForm.js"; // Adjust import path
10
- import { useTheme } from "../../theme/index.js"; // Adjust import path
11
- import SummaryBar from "./SummaryBar.js"; // Adjust import path
12
-
13
- // Adjust import path
14
-
15
- // Define the possible tab names (can be overridden via props)
16
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
- const DEFAULT_TABS = ["Flights", "Hotels", "Car Rentals"];
18
-
19
- // Mock Data (Keep accessible for potential defaults)
20
- const DEFAULT_MOCK_FLIGHT_SUGGESTIONS = [{
21
- id: 1,
22
- city: "London",
23
- value: "London, United Kingdom",
24
- airports: ["Heathrow Airport (LHR)", "Gatwick Airport (LGW)", "Stansted Airport (STN)"]
25
- }, {
26
- id: 2,
27
- city: "New York",
28
- value: "New York, USA",
29
- airports: ["John F. Kennedy Intl (JFK)", "LaGuardia Airport (LGA)", "Newark Liberty Intl (EWR)"]
30
- }];
31
- const DEFAULT_MOCK_HOTEL_SUGGESTIONS = [{
32
- id: 1,
33
- city: "Beirut",
34
- country: "Lebanon",
35
- value: "BEIRUT, LEBANON"
36
- }, {
37
- id: 2,
38
- city: "Dubai",
39
- country: "United Arab Emirates",
40
- value: "DUBAI, UNITED ARAB EMIRATES"
41
- }];
42
- const DEFAULT_MOCK_CAR_SUGGESTIONS = mockCarSuggestions;
43
-
44
- // --- TravelBooking Props Interface ---
45
-
46
- // --- TravelBooking Component Implementation ---
47
- const TravelBooking = ({
48
- tabs = DEFAULT_TABS,
49
- initialTab,
50
- onTabChange,
51
- onSearch,
52
- initialFlightSelection,
53
- initialHotelSelection,
54
- onSummarySelectionChange,
55
- flightSuggestionData = DEFAULT_MOCK_FLIGHT_SUGGESTIONS,
56
- // Provide defaults
57
- hotelSuggestionData = DEFAULT_MOCK_HOTEL_SUGGESTIONS,
58
- // Provide defaults
59
- carSuggestionData = DEFAULT_MOCK_CAR_SUGGESTIONS,
60
- // Provide defaults
61
- tabSelectorProps,
62
- summaryBarProps,
63
- flightFormProps,
64
- hotelFormProps,
65
- carRentalFormProps,
66
- onInputFocus,
67
- onTextChange,
68
- // Destructure common style props
69
- formContainerStyle,
70
- labelStyle,
71
- inputStyle,
72
- inputTouchableStyle,
73
- inputTextStyle,
74
- dateSearchRowStyle,
75
- dateInputGroupStyle,
76
- searchButtonStyle,
77
- searchIconStyle,
78
- calendarThemeOverrides,
79
- calendarContainerStyle,
80
- swapButtonContainerStyle,
81
- swapButtonStyle,
82
- swapIconStyle,
83
- inputGroupContainerStyle // Added
84
- }) => {
85
- const {
86
- theme
87
- } = useTheme();
88
- const styles = useMemo(() => themedStyles(theme), [theme]);
89
- const actualInitialTab = useMemo(() => initialTab ?? (tabs.length > 0 ? tabs[0] : ""), [initialTab, tabs]);
90
- const [selectedTab, setSelectedTab] = useState(actualInitialTab);
91
- const [selectedOptions, setSelectedOptions] = useState(actualInitialTab === tabs[0] && tabs[0] === "Flights" ? initialFlightSelection : actualInitialTab === tabs[1] && tabs[1] === "Hotels" ? initialHotelSelection : undefined);
92
-
93
- // --- Handlers ---
94
- const handleTabChange = useCallback(tab => {
95
- setSelectedTab(tab);
96
- if (tab === "Flights") {
97
- setSelectedOptions(initialFlightSelection);
98
- } else if (tab === "Hotels") {
99
- setSelectedOptions(initialHotelSelection);
100
- } else {
101
- setSelectedOptions(undefined);
102
- }
103
- onTabChange?.(tab);
104
- }, [onTabChange, initialFlightSelection, initialHotelSelection]);
105
- const handleInternalSummarySelectionChange = useCallback(selection => {
106
- setSelectedOptions(selection);
107
- onSummarySelectionChange?.(selection);
108
- }, [onSummarySelectionChange]);
109
- const handleInternalSearch = useCallback(details => {
110
- console.log("Internal Search Triggered:", details);
111
- onSearch?.(details);
112
- }, [onSearch]);
113
- const handleInternalTextChange = useCallback(text => {
114
- onTextChange?.(text);
115
- }, [onTextChange] // Added dependency
116
- );
117
- const handleInternalInputFocus = useCallback(input => {
118
- console.log("Input Focused:", input);
119
- onInputFocus?.(input);
120
- }, [onInputFocus] // Added dependency
121
- );
122
-
123
- // Determine SummaryBar mode
124
- const summaryBarMode = useMemo(() => {
125
- if (selectedTab === "Flights") return "flight";
126
- if (selectedTab === "Hotels") return "hotel";
127
- return undefined;
128
- }, [selectedTab]);
129
-
130
- // --- Render Content Logic ---
131
- const renderContent = () => {
132
- const commonFormProps = {
133
- containerStyle: formContainerStyle,
134
- labelStyle: labelStyle,
135
- inputStyle: inputStyle,
136
- inputTouchableStyle: inputTouchableStyle,
137
- inputTextStyle: inputTextStyle,
138
- dateInputGroupStyle: dateInputGroupStyle,
139
- searchButtonStyle: searchButtonStyle,
140
- searchIconStyle: searchIconStyle,
141
- calendarThemeOverrides: calendarThemeOverrides,
142
- calendarContainerStyle: calendarContainerStyle
143
- };
144
- switch (selectedTab) {
145
- case "Flights":
146
- {
147
- let isOneWay = false;
148
- if (selectedOptions && typeof selectedOptions === "object" && !Array.isArray(selectedOptions) && "flightType" in selectedOptions) {
149
- isOneWay = selectedOptions.flightType === "ONE_WAY";
150
- }
151
- return /*#__PURE__*/_jsx(FlightForm
152
- // Pass common props first
153
- , {
154
- ...commonFormProps,
155
- departureRowStyle: dateSearchRowStyle // Map specific row style
156
- ,
157
- swapButtonContainerStyle: swapButtonContainerStyle // Pass swap styles
158
- ,
159
- swapButtonStyle: swapButtonStyle,
160
- swapIconStyle: swapIconStyle
161
-
162
- // Pass specific FlightForm props (will override common ones if keys match)
163
- ,
164
- ...flightFormProps,
165
- // Pass controlled props
166
- isOneWay: isOneWay,
167
- onSearchPress: handleInternalSearch,
168
- onInputFocus: handleInternalInputFocus,
169
- onTextChange: handleInternalTextChange,
170
- suggestionData: flightSuggestionData
171
- });
172
- }
173
- case "Hotels":
174
- return /*#__PURE__*/_jsx(HotelForm
175
- // Pass common props first
176
- , {
177
- ...commonFormProps,
178
- checkoutRowStyle: dateSearchRowStyle // Map specific row style
179
-
180
- // Pass specific HotelForm props (will override common ones if keys match)
181
- ,
182
- ...hotelFormProps,
183
- // Pass controlled props
184
- onSearchPress: handleInternalSearch,
185
- onInputFocus: handleInternalInputFocus,
186
- onTextChange: handleInternalTextChange,
187
- suggestionData: hotelSuggestionData
188
- });
189
- case "Car Rentals":
190
- return /*#__PURE__*/_jsx(CarRentalForm
191
- // Pass common props first
192
- , {
193
- ...commonFormProps,
194
- pickupRowStyle: dateSearchRowStyle // Map specific row style
195
- ,
196
- swapButtonContainerStyle: swapButtonContainerStyle // Pass swap styles
197
- ,
198
- swapButtonStyle: swapButtonStyle,
199
- swapIconStyle: swapIconStyle,
200
- inputGroupStyle: inputGroupContainerStyle // Map input group style
201
-
202
- // Pass specific CarRentalForm props (will override common ones if keys match)
203
- ,
204
- ...carRentalFormProps,
205
- // Pass controlled props
206
- onSearchPress: handleInternalSearch,
207
- onInputFocus: handleInternalInputFocus,
208
- onTextChange: handleInternalTextChange,
209
- suggestionData: carSuggestionData
210
- });
211
- default:
212
- console.warn(`No content defined for tab: ${selectedTab}`);
213
- return null;
214
- }
215
- };
216
- return /*#__PURE__*/_jsxs(View, {
217
- style: styles.container,
218
- children: [summaryBarMode && /*#__PURE__*/_jsx(SummaryBar, {
219
- ...summaryBarProps,
220
- mode: summaryBarMode,
221
- onSelectionChange: handleInternalSummarySelectionChange
222
- }), /*#__PURE__*/_jsx(TabSelector, {
223
- ...tabSelectorProps,
224
- tabs: tabs,
225
- initialTab: selectedTab // Use state for controlled component
226
- ,
227
- onTabChange: handleTabChange
228
- }), /*#__PURE__*/_jsx(View, {
229
- style: styles.contentContainer,
230
- children: renderContent()
231
- })]
232
- });
233
- };
234
- const themedStyles = theme => StyleSheet.create({
235
- container: {
236
- // Removed flex: 1 to allow content to determine height naturally
237
- },
238
- contentContainer: {
239
- // Removed flex: 1
240
- }
241
- });
242
- export default TravelBooking;
245
+ // const handleInternalSummarySelectionChange = useCallback(
246
+ // (selection: SelectionCallbackDataType) => {
247
+ // setSelectedOptions(selection);
248
+ // onSummarySelectionChange?.(selection);
249
+ // },
250
+ // [onSummarySelectionChange]
251
+ // );
252
+
253
+ // const handleInternalSearch = useCallback(
254
+ // (details: any) => {
255
+ // console.log("Internal Search Triggered:", details);
256
+ // onSearch?.(details);
257
+ // },
258
+ // [onSearch]
259
+ // );
260
+
261
+ // const handleInternalTextChange = useCallback(
262
+ // (text: string) => {
263
+ // onTextChange?.(text);
264
+ // },
265
+ // [onTextChange] // Added dependency
266
+ // );
267
+
268
+ // const handleInternalInputFocus = useCallback(
269
+ // (input: FormInputType) => {
270
+ // console.log("Input Focused:", input);
271
+ // onInputFocus?.(input);
272
+ // },
273
+ // [onInputFocus] // Added dependency
274
+ // );
275
+
276
+ // // Determine SummaryBar mode
277
+ // const summaryBarMode = useMemo(() => {
278
+ // if (selectedTab === "Flights") return "flight";
279
+ // if (selectedTab === "Hotels") return "hotel";
280
+ // return undefined;
281
+ // }, [selectedTab]);
282
+
283
+ // // --- Render Content Logic ---
284
+ // const renderContent = () => {
285
+ // const commonFormProps = {
286
+ // containerStyle: formContainerStyle,
287
+ // labelStyle: labelStyle,
288
+ // inputStyle: inputStyle,
289
+ // inputTouchableStyle: inputTouchableStyle,
290
+ // inputTextStyle: inputTextStyle,
291
+ // dateInputGroupStyle: dateInputGroupStyle,
292
+ // searchButtonStyle: searchButtonStyle,
293
+ // searchIconStyle: searchIconStyle,
294
+ // calendarThemeOverrides: calendarThemeOverrides,
295
+ // calendarContainerStyle: calendarContainerStyle,
296
+ // };
297
+
298
+ // switch (selectedTab) {
299
+ // case "Flights": {
300
+ // let isOneWay = false;
301
+ // if (
302
+ // selectedOptions &&
303
+ // typeof selectedOptions === "object" &&
304
+ // !Array.isArray(selectedOptions) &&
305
+ // "flightType" in selectedOptions
306
+ // ) {
307
+ // isOneWay = selectedOptions.flightType === "ONE_WAY";
308
+ // }
309
+ // return (
310
+ // <FlightForm
311
+ // // Pass common props first
312
+ // {...commonFormProps}
313
+ // departureRowStyle={dateSearchRowStyle} // Map specific row style
314
+ // swapButtonContainerStyle={swapButtonContainerStyle} // Pass swap styles
315
+ // swapButtonStyle={swapButtonStyle}
316
+ // swapIconStyle={swapIconStyle}
317
+
318
+ // // Pass specific FlightForm props (will override common ones if keys match)
319
+ // {...flightFormProps}
320
+
321
+ // // Pass controlled props
322
+ // isOneWay={isOneWay}
323
+ // onSearchPress={handleInternalSearch}
324
+ // onInputFocus={handleInternalInputFocus}
325
+ // onTextChange={handleInternalTextChange}
326
+ // suggestionData={flightSuggestionData}
327
+ // />
328
+ // );
329
+ // }
330
+ // case "Hotels":
331
+ // return (
332
+ // <HotelForm
333
+ // // Pass common props first
334
+ // {...commonFormProps}
335
+ // checkoutRowStyle={dateSearchRowStyle} // Map specific row style
336
+
337
+ // // Pass specific HotelForm props (will override common ones if keys match)
338
+ // {...hotelFormProps}
339
+
340
+ // // Pass controlled props
341
+ // onSearchPress={handleInternalSearch}
342
+ // onInputFocus={handleInternalInputFocus}
343
+ // onTextChange={handleInternalTextChange}
344
+ // suggestionData={hotelSuggestionData}
345
+ // />
346
+ // );
347
+ // case "Car Rentals":
348
+ // return (
349
+ // <CarRentalForm
350
+ // // Pass common props first
351
+ // {...commonFormProps}
352
+ // pickupRowStyle={dateSearchRowStyle} // Map specific row style
353
+ // swapButtonContainerStyle={swapButtonContainerStyle} // Pass swap styles
354
+ // swapButtonStyle={swapButtonStyle}
355
+ // swapIconStyle={swapIconStyle}
356
+ // inputGroupStyle={inputGroupContainerStyle} // Map input group style
357
+
358
+ // // Pass specific CarRentalForm props (will override common ones if keys match)
359
+ // {...carRentalFormProps}
360
+
361
+ // // Pass controlled props
362
+ // onSearchPress={handleInternalSearch}
363
+ // onInputFocus={handleInternalInputFocus}
364
+ // onTextChange={handleInternalTextChange}
365
+ // suggestionData={carSuggestionData}
366
+ // />
367
+ // );
368
+ // default:
369
+ // console.warn(`No content defined for tab: ${selectedTab}`);
370
+ // return null;
371
+ // }
372
+ // };
373
+
374
+ // return (
375
+ // <View style={styles.container}>
376
+ // {/* Conditionally render SummaryBar */}
377
+ // {summaryBarMode && (
378
+ // <SummaryBar
379
+ // {...summaryBarProps}
380
+ // mode={summaryBarMode}
381
+ // onSelectionChange={handleInternalSummarySelectionChange}
382
+ // />
383
+ // )}
384
+
385
+ // <TabSelector
386
+ // {...tabSelectorProps}
387
+ // tabs={tabs}
388
+ // initialTab={selectedTab} // Use state for controlled component
389
+ // onTabChange={handleTabChange}
390
+ // />
391
+
392
+ // <View style={styles.contentContainer}>{renderContent()}</View>
393
+ // </View>
394
+ // );
395
+ // };
396
+
397
+ // const themedStyles = (theme: ThemeType) =>
398
+ // StyleSheet.create({
399
+ // container: {
400
+ // // Removed flex: 1 to allow content to determine height naturally
401
+ // },
402
+ // contentContainer: {
403
+ // // Removed flex: 1
404
+ // },
405
+ // });
406
+
407
+ // export default TravelBooking;
408
+ "use strict";
243
409
  //# sourceMappingURL=TravelBooking.js.map