@travelswitchhq/flight-search-react 1.1.7 → 1.1.8

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/dist/index.mjs CHANGED
@@ -160,7 +160,7 @@ var flightSearchWidgetStyles = `
160
160
  .sw-com-cal .p-disabled{
161
161
  opacity: 0.3;
162
162
  }
163
- .sw-form-field {
163
+ .sw-srh-form-field {
164
164
  display: flex;
165
165
  flex-direction: column;
166
166
  flex: 1 1 auto;
@@ -170,10 +170,10 @@ var flightSearchWidgetStyles = `
170
170
  min-width: 0;
171
171
  overflow: visible;
172
172
  }
173
- .sw-form-field.sw-is-invalid {
173
+ .sw-srh-form-fieldsw-is-invalid {
174
174
  box-shadow: inset 0 0 0 1px var(--sw-error);
175
175
  }
176
- .sw-form-field.sw-is-invalid label {
176
+ .sw-srh-form-fieldsw-is-invalid label {
177
177
  color: var(--sw-error);
178
178
  }
179
179
  .sw-custom-dropdown.sw-has-error .sw-custom-dropdown-trigger {
@@ -199,8 +199,8 @@ var flightSearchWidgetStyles = `
199
199
  .p-button-label {
200
200
  flex: unset;
201
201
  }
202
- .sw-form-field input,
203
- .sw-form-field .p-inputtext {
202
+ .sw-srh-form-field input,
203
+ .sw-srh-form-field .p-inputtext {
204
204
  display: block;
205
205
  width: 100%;
206
206
  margin: 0;
@@ -214,8 +214,8 @@ var flightSearchWidgetStyles = `
214
214
  font-size: 14px;
215
215
  font-weight: 500;
216
216
  }
217
- .sw-form-field input::placeholder,
218
- .sw-form-field .p-inputtext::placeholder {
217
+ .sw-srh-form-field input::placeholder,
218
+ .sw-srh-form-field .p-inputtext::placeholder {
219
219
  color: var(--sw-label-color) !important;
220
220
  }
221
221
  .sw-form-swap {
@@ -233,7 +233,7 @@ var flightSearchWidgetStyles = `
233
233
  cursor: pointer;
234
234
  transform: translate(50%, -50%);
235
235
  }
236
- .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child {
236
+ .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child {
237
237
  padding-inline-start: 25px;
238
238
  }
239
239
  .sw-custom-dropdown {
@@ -849,7 +849,7 @@ padding-inline-start: 25px;
849
849
  min-width: 0;
850
850
  overflow: visible;
851
851
  }
852
- .sw-srh-wrap .sw-form-field {
852
+ .sw-srh-wrap .sw-srh-form-field {
853
853
  flex: 1 1 50%;
854
854
  min-width: 0;
855
855
  justify-content: center;
@@ -1172,8 +1172,7 @@ padding-inline-start: 25px;
1172
1172
  display: none;
1173
1173
  }
1174
1174
  }
1175
-
1176
- .sw-container .sw-form-field {
1175
+ .sw-container .sw-srh-form-field {
1177
1176
  border-radius: var(--sw-radius);
1178
1177
  }
1179
1178
  .sw-fsrh-adv-cont{
@@ -1204,7 +1203,7 @@ padding-inline-start: 25px;
1204
1203
  line-height: 1;
1205
1204
  }
1206
1205
  }
1207
- .sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child{
1206
+ .sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child{
1208
1207
  padding-inline-start: 15px;
1209
1208
  }
1210
1209
  .sw-container .p-datepicker-group + .p-datepicker-group .mobileHead {
@@ -1995,7 +1994,7 @@ function FlightSearchWidget({
1995
1994
  case "multi-city":
1996
1995
  return 3;
1997
1996
  case "custom-search":
1998
- return 4;
1997
+ return 1;
1999
1998
  default:
2000
1999
  return 2;
2001
2000
  }
@@ -2160,7 +2159,7 @@ function FlightSearchWidget({
2160
2159
  const list = isOrigin ? getPredictiveState(segmentIndex).fromAirport : getPredictiveState(segmentIndex).toAirport;
2161
2160
  const selectedIndex = isOrigin ? getPredictiveState(segmentIndex).selectedFromIndex : getPredictiveState(segmentIndex).selectedToIndex;
2162
2161
  const isFirstOrigin = segmentIndex === 0 && isOrigin;
2163
- return /* @__PURE__ */ jsxs("div", { className: `sw-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
2162
+ return /* @__PURE__ */ jsxs("div", { className: `sw-srh-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
2164
2163
  /* @__PURE__ */ jsx("label", { htmlFor: `${dropdownType}-${segmentIndex}`, children: label }),
2165
2164
  /* @__PURE__ */ jsxs("div", { className: `sw-custom-dropdown ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-has-error" : ""}`, ref: dropdownRef, children: [
2166
2165
  /* @__PURE__ */ jsx(
@@ -2269,7 +2268,7 @@ function FlightSearchWidget({
2269
2268
  renderAirportDropdown(index, "destination", destinationDropdownRef || destinationRef, isDestOpen, () => toggleSegmentDropdown(index, "destination"))
2270
2269
  ] }, index),
2271
2270
  isMultiCityOrCustom && /* @__PURE__ */ jsxs("div", { className: "sw-srh-wrap sw-pos-rel", children: [
2272
- /* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-com-cal ", children: [
2271
+ /* @__PURE__ */ jsxs("div", { className: "sw-srh-form-field sw-com-cal", children: [
2273
2272
  /* @__PURE__ */ jsx("label", { htmlFor: `departure-${index}`, children: "Departure" }),
2274
2273
  /* @__PURE__ */ jsx(
2275
2274
  Calendar,
@@ -2392,7 +2391,7 @@ function FlightSearchWidget({
2392
2391
  /* @__PURE__ */ jsxs("div", { style: { cursor: "pointer" }, onClick: () => {
2393
2392
  dateRangeCalendarRef.current?.show?.();
2394
2393
  mobileDateRangeCalendarRef.current?.show?.();
2395
- }, className: "sw-form-field sw-com-cal", children: [
2394
+ }, className: "sw-srh-form-field sw-com-cal", children: [
2396
2395
  /* @__PURE__ */ jsxs("div", { children: [
2397
2396
  /* @__PURE__ */ jsx("label", { children: "Departure" }),
2398
2397
  /* @__PURE__ */ jsx("p", { children: segments[0]?.dateRange?.[0]?.toLocaleDateString("en-GB", { day: "2-digit", month: "short", year: "numeric" }) })
@@ -2481,7 +2480,7 @@ function FlightSearchWidget({
2481
2480
  }
2482
2481
  )
2483
2482
  ] }),
2484
- /* @__PURE__ */ jsx("div", { style: { cursor: "pointer" }, className: "sw-form-field sw-com-cal", onClick: () => {
2483
+ /* @__PURE__ */ jsx("div", { style: { cursor: "pointer" }, className: "sw-srh-form-field sw-com-cal", onClick: () => {
2485
2484
  dateRangeCalendarRef.current?.show?.();
2486
2485
  mobileDateRangeCalendarRef.current?.show?.();
2487
2486
  }, children: /* @__PURE__ */ jsxs("div", { children: [
@@ -2492,7 +2491,7 @@ function FlightSearchWidget({
2492
2491
  /* @__PURE__ */ jsxs(
2493
2492
  "div",
2494
2493
  {
2495
- className: "sw-form-field sw-pos-rel sw-com-cal",
2494
+ className: "sw-srh-form-field sw-pos-rel sw-com-cal",
2496
2495
  style: { cursor: "pointer" },
2497
2496
  onClick: () => {
2498
2497
  oneWayDesktopCalendarRef.current?.show?.();
@@ -2570,7 +2569,7 @@ function FlightSearchWidget({
2570
2569
  ]
2571
2570
  }
2572
2571
  ),
2573
- /* @__PURE__ */ jsx("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
2572
+ /* @__PURE__ */ jsx("div", { className: "sw-srh-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
2574
2573
  setTripType("round-trip");
2575
2574
  setTimeout(() => document.getElementById("dateRange")?.querySelector("input")?.focus?.(), 100);
2576
2575
  }, children: /* @__PURE__ */ jsx("label", { className: "font14", children: "Add return" }) })
@@ -2582,7 +2581,7 @@ function FlightSearchWidget({
2582
2581
  ] }),
2583
2582
  "Add Another Flight"
2584
2583
  ] }) }),
2585
- /* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-traveller sw-pos-rel", children: [
2584
+ /* @__PURE__ */ jsxs("div", { className: "sw-srh-form-field sw-traveller sw-pos-rel", children: [
2586
2585
  /* @__PURE__ */ jsx("label", { htmlFor: "rooms", children: "Travellers and Class" }),
2587
2586
  /* @__PURE__ */ jsxs("div", { className: "sw-custom-dropdown", ref: roomsGuestsMenuRef, children: [
2588
2587
  /* @__PURE__ */ jsx(