@travelswitchhq/flight-search-react 1.1.6 → 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.cjs CHANGED
@@ -69,7 +69,6 @@ var flightSearchWidgetStyles = `
69
69
  position: relative;
70
70
  display: block;
71
71
  width: 100%;
72
- min-width: 1240px;
73
72
  margin: 0;
74
73
  padding: 0;
75
74
  box-sizing: border-box;
@@ -187,7 +186,7 @@ var flightSearchWidgetStyles = `
187
186
  .sw-com-cal .p-disabled{
188
187
  opacity: 0.3;
189
188
  }
190
- .sw-form-field {
189
+ .sw-srh-form-field {
191
190
  display: flex;
192
191
  flex-direction: column;
193
192
  flex: 1 1 auto;
@@ -197,10 +196,10 @@ var flightSearchWidgetStyles = `
197
196
  min-width: 0;
198
197
  overflow: visible;
199
198
  }
200
- .sw-form-field.sw-is-invalid {
199
+ .sw-srh-form-fieldsw-is-invalid {
201
200
  box-shadow: inset 0 0 0 1px var(--sw-error);
202
201
  }
203
- .sw-form-field.sw-is-invalid label {
202
+ .sw-srh-form-fieldsw-is-invalid label {
204
203
  color: var(--sw-error);
205
204
  }
206
205
  .sw-custom-dropdown.sw-has-error .sw-custom-dropdown-trigger {
@@ -226,8 +225,8 @@ var flightSearchWidgetStyles = `
226
225
  .p-button-label {
227
226
  flex: unset;
228
227
  }
229
- .sw-form-field input,
230
- .sw-form-field .p-inputtext {
228
+ .sw-srh-form-field input,
229
+ .sw-srh-form-field .p-inputtext {
231
230
  display: block;
232
231
  width: 100%;
233
232
  margin: 0;
@@ -241,8 +240,8 @@ var flightSearchWidgetStyles = `
241
240
  font-size: 14px;
242
241
  font-weight: 500;
243
242
  }
244
- .sw-form-field input::placeholder,
245
- .sw-form-field .p-inputtext::placeholder {
243
+ .sw-srh-form-field input::placeholder,
244
+ .sw-srh-form-field .p-inputtext::placeholder {
246
245
  color: var(--sw-label-color) !important;
247
246
  }
248
247
  .sw-form-swap {
@@ -260,7 +259,7 @@ var flightSearchWidgetStyles = `
260
259
  cursor: pointer;
261
260
  transform: translate(50%, -50%);
262
261
  }
263
- .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child {
262
+ .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child {
264
263
  padding-inline-start: 25px;
265
264
  }
266
265
  .sw-custom-dropdown {
@@ -876,7 +875,7 @@ padding-inline-start: 25px;
876
875
  min-width: 0;
877
876
  overflow: visible;
878
877
  }
879
- .sw-srh-wrap .sw-form-field {
878
+ .sw-srh-wrap .sw-srh-form-field {
880
879
  flex: 1 1 50%;
881
880
  min-width: 0;
882
881
  justify-content: center;
@@ -1172,7 +1171,7 @@ padding-inline-start: 25px;
1172
1171
  .sw-container .MobileHide{
1173
1172
  display: block;
1174
1173
  }
1175
- @media screen and (max-width: 768px) {
1174
+ @media screen and (max-width: 1024px) {
1176
1175
  .sw-container .MobileShow{
1177
1176
  display: block;
1178
1177
  }
@@ -1199,8 +1198,7 @@ padding-inline-start: 25px;
1199
1198
  display: none;
1200
1199
  }
1201
1200
  }
1202
-
1203
- .sw-container .sw-form-field {
1201
+ .sw-container .sw-srh-form-field {
1204
1202
  border-radius: var(--sw-radius);
1205
1203
  }
1206
1204
  .sw-fsrh-adv-cont{
@@ -1231,7 +1229,7 @@ padding-inline-start: 25px;
1231
1229
  line-height: 1;
1232
1230
  }
1233
1231
  }
1234
- .sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child{
1232
+ .sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child{
1235
1233
  padding-inline-start: 15px;
1236
1234
  }
1237
1235
  .sw-container .p-datepicker-group + .p-datepicker-group .mobileHead {
@@ -2022,7 +2020,7 @@ function FlightSearchWidget({
2022
2020
  case "multi-city":
2023
2021
  return 3;
2024
2022
  case "custom-search":
2025
- return 4;
2023
+ return 1;
2026
2024
  default:
2027
2025
  return 2;
2028
2026
  }
@@ -2187,7 +2185,7 @@ function FlightSearchWidget({
2187
2185
  const list = isOrigin ? getPredictiveState(segmentIndex).fromAirport : getPredictiveState(segmentIndex).toAirport;
2188
2186
  const selectedIndex = isOrigin ? getPredictiveState(segmentIndex).selectedFromIndex : getPredictiveState(segmentIndex).selectedToIndex;
2189
2187
  const isFirstOrigin = segmentIndex === 0 && isOrigin;
2190
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
2188
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-srh-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
2191
2189
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: `${dropdownType}-${segmentIndex}`, children: label }),
2192
2190
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-custom-dropdown ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-has-error" : ""}`, ref: dropdownRef, children: [
2193
2191
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -2296,7 +2294,7 @@ function FlightSearchWidget({
2296
2294
  renderAirportDropdown(index, "destination", destinationDropdownRef || destinationRef, isDestOpen, () => toggleSegmentDropdown(index, "destination"))
2297
2295
  ] }, index),
2298
2296
  isMultiCityOrCustom && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-srh-wrap sw-pos-rel", children: [
2299
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field sw-com-cal ", children: [
2297
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-srh-form-field sw-com-cal", children: [
2300
2298
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: `departure-${index}`, children: "Departure" }),
2301
2299
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2302
2300
  import_calendar.Calendar,
@@ -2419,7 +2417,7 @@ function FlightSearchWidget({
2419
2417
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { cursor: "pointer" }, onClick: () => {
2420
2418
  dateRangeCalendarRef.current?.show?.();
2421
2419
  mobileDateRangeCalendarRef.current?.show?.();
2422
- }, className: "sw-form-field sw-com-cal", children: [
2420
+ }, className: "sw-srh-form-field sw-com-cal", children: [
2423
2421
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2424
2422
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { children: "Departure" }),
2425
2423
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: segments[0]?.dateRange?.[0]?.toLocaleDateString("en-GB", { day: "2-digit", month: "short", year: "numeric" }) })
@@ -2508,7 +2506,7 @@ function FlightSearchWidget({
2508
2506
  }
2509
2507
  )
2510
2508
  ] }),
2511
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { cursor: "pointer" }, className: "sw-form-field sw-com-cal", onClick: () => {
2509
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { cursor: "pointer" }, className: "sw-srh-form-field sw-com-cal", onClick: () => {
2512
2510
  dateRangeCalendarRef.current?.show?.();
2513
2511
  mobileDateRangeCalendarRef.current?.show?.();
2514
2512
  }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
@@ -2519,7 +2517,7 @@ function FlightSearchWidget({
2519
2517
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2520
2518
  "div",
2521
2519
  {
2522
- className: "sw-form-field sw-pos-rel sw-com-cal",
2520
+ className: "sw-srh-form-field sw-pos-rel sw-com-cal",
2523
2521
  style: { cursor: "pointer" },
2524
2522
  onClick: () => {
2525
2523
  oneWayDesktopCalendarRef.current?.show?.();
@@ -2597,7 +2595,7 @@ function FlightSearchWidget({
2597
2595
  ]
2598
2596
  }
2599
2597
  ),
2600
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
2598
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
2601
2599
  setTripType("round-trip");
2602
2600
  setTimeout(() => document.getElementById("dateRange")?.querySelector("input")?.focus?.(), 100);
2603
2601
  }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "font14", children: "Add return" }) })
@@ -2609,7 +2607,7 @@ function FlightSearchWidget({
2609
2607
  ] }),
2610
2608
  "Add Another Flight"
2611
2609
  ] }) }),
2612
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field sw-traveller sw-pos-rel", children: [
2610
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-srh-form-field sw-traveller sw-pos-rel", children: [
2613
2611
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "rooms", children: "Travellers and Class" }),
2614
2612
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-custom-dropdown", ref: roomsGuestsMenuRef, children: [
2615
2613
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(