@tripian/react 9.1.50 → 9.1.52

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.
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import Model from '@tripian/model';
3
+ export type SuggestedCityMatch = {
4
+ city: {
5
+ id: string;
6
+ name: string;
7
+ description: string;
8
+ };
9
+ reason: string;
10
+ match_score: number;
11
+ highlights: string[];
12
+ };
13
+ interface ICitySearchModalProps {
14
+ isOpen: boolean;
15
+ onClose: () => void;
16
+ suggestions: SuggestedCityMatch[];
17
+ onSelectCity: (cityId: number) => void;
18
+ searchText: string;
19
+ handleSearchChange: (text: string, isQuickSearch?: boolean) => void;
20
+ isSearching: boolean;
21
+ onClearSuggestions?: () => void;
22
+ t: (value: Model.TranslationKey) => string;
23
+ }
24
+ declare const CitySearchModal: React.FC<ICitySearchModalProps>;
25
+ export default CitySearchModal;
@@ -11,6 +11,16 @@ export type RSelectOption = {
11
11
  };
12
12
  isSelected?: boolean;
13
13
  };
14
+ export type SuggestedCityMatch = {
15
+ city: {
16
+ id: string;
17
+ name: string;
18
+ description: string;
19
+ };
20
+ reason: string;
21
+ match_score: number;
22
+ highlights: string[];
23
+ };
14
24
  interface IDestinationSelect {
15
25
  options: RSelectOption[];
16
26
  selectedOptionId?: number;
@@ -19,6 +29,13 @@ interface IDestinationSelect {
19
29
  disabled?: boolean;
20
30
  onFocus?: () => void;
21
31
  onBlur?: () => void;
32
+ showAiSuggestions?: boolean;
33
+ suggestions?: SuggestedCityMatch[];
34
+ onSuggestionsSearch?: (text: string, isQuickSearch?: boolean) => void;
35
+ isSearching?: boolean;
36
+ onSelectSuggestedCity?: (cityId: number) => void;
37
+ onClearSuggestions?: () => void;
38
+ t: (value: Model.TranslationKey) => string;
22
39
  }
23
40
  declare const DestinationSelect: React.FC<IDestinationSelect>;
24
41
  export default DestinationSelect;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import Model from '@tripian/model';
3
+ export type RSelectOption = {
4
+ id: number;
5
+ label: string;
6
+ payload: {
7
+ destinationId: number;
8
+ destinationName: string;
9
+ coordinate: Model.Coordinate;
10
+ parentName: string;
11
+ };
12
+ isSelected?: boolean;
13
+ };
14
+ interface IDestinationSelect {
15
+ options: RSelectOption[];
16
+ selectedOptionId?: number;
17
+ onSelectedOptionChange: (selectedOption: RSelectOption) => void;
18
+ placeHolder?: string;
19
+ disabled?: boolean;
20
+ onFocus?: () => void;
21
+ onBlur?: () => void;
22
+ }
23
+ declare const DestinationSelect: React.FC<IDestinationSelect>;
24
+ export default DestinationSelect;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import Model from '@tripian/model';
3
+ import { SuggestedCityMatch } from '../../DestinationSelect/DestinationSelect';
3
4
  /**
4
5
  * Destinations
5
6
  * Stay & Shares
@@ -40,6 +41,12 @@ interface IFormTemplateTripNext {
40
41
  onSubmit: () => void;
41
42
  onCancel: () => void;
42
43
  t: (value: Model.TranslationKey) => string;
44
+ showAiSuggestions?: boolean;
45
+ citySuggestions?: SuggestedCityMatch[];
46
+ onCitySuggestionsSearch?: (text: string, isQuickSearch?: boolean) => void;
47
+ isCitySearching?: boolean;
48
+ onSelectSuggestedCity?: (cityId: number) => void;
49
+ onClearCitySuggestions?: () => void;
43
50
  }
44
51
  declare const FormTemplateTripNext: React.FC<IFormTemplateTripNext>;
45
52
  export default FormTemplateTripNext;
@@ -1,5 +1,6 @@
1
1
  import Model from '@tripian/model';
2
2
  import React from 'react';
3
+ import { SuggestedCityMatch } from '../../../DestinationSelect/DestinationSelect';
3
4
  export interface StepDestinationProps {
4
5
  tripProfile: Model.TripProfile;
5
6
  destinations: {
@@ -16,6 +17,12 @@ export interface StepDestinationProps {
16
17
  description: string;
17
18
  }[];
18
19
  t: (value: Model.TranslationKey) => string;
20
+ showAiSuggestions?: boolean;
21
+ suggestions?: SuggestedCityMatch[];
22
+ onSuggestionsSearch?: (text: string, isQuickSearch?: boolean) => void;
23
+ isSearching?: boolean;
24
+ onSelectSuggestedCity?: (cityId: number) => void;
25
+ onClearSuggestions?: () => void;
19
26
  }
20
27
  declare const StepDestination: React.FC<StepDestinationProps>;
21
28
  export default StepDestination;
@@ -6,9 +6,11 @@ interface IPoiSearchAutoComplete {
6
6
  selectedOptionValues: string[];
7
7
  onSelectedOptionChange: (selectedOptions: RSelectOption[]) => void;
8
8
  onInputChange?: (input: string) => void;
9
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
9
10
  onCreateOption: (input: string) => void;
10
11
  placeHolder?: string;
11
12
  isDisabled?: boolean;
13
+ isLoading?: boolean;
12
14
  }
13
15
  declare const PoiSearchAutoComplete: React.FC<IPoiSearchAutoComplete>;
14
16
  export default PoiSearchAutoComplete;