@searchcraft/react-sdk 0.1.4 → 0.5.1

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.d.ts CHANGED
@@ -1,178 +1,59 @@
1
- import { ChangeEventHandler } from 'react';
2
- import { Dispatch } from 'react';
1
+ import { Components } from '@searchcraft/javascript-sdk';
3
2
  import { FC } from 'react';
4
- import { ReactNode } from 'react';
5
- import { CoreSDK as SearchcraftCore } from '@searchcraft/core';
6
- import { SearchError } from '@searchcraft/core';
7
- import { SearchResult } from '@searchcraft/core';
8
- import { SetStateAction } from 'react';
9
-
10
- /**
11
- * * Button-less form used to submit the search query with a timing configurable debounced function.
12
- */
13
- export declare const AutoSearchForm: FC<AutoSearchFormProps>;
14
-
15
- declare interface AutoSearchFormProps {
16
- autoSearchFormClass?: string;
17
- handleSubmit: (query: string) => void;
18
- inputCaptionValue?: string;
19
- labelForInput?: string;
20
- onClearInput?: () => void;
21
- placeholderValue?: string;
22
- rightToLeftOrientation?: boolean;
23
- searchContainerClass?: string;
3
+
4
+ export declare const SearchcraftBaseSearchResult: FC<SearchcraftBaseSearchResultProps>;
5
+
6
+ export declare interface SearchcraftBaseSearchResultProps extends Components.SearchcraftBaseSearchResult {
24
7
  }
25
8
 
26
- /**
27
- * * Form used to submit the search query using a provided search function.
28
- */
29
- export declare const BaseSearchForm: FC<BaseSearchFormProps>;
30
-
31
- declare interface BaseSearchFormProps {
32
- errorMessage?: string;
33
- handleSubmit: (query: string) => void;
34
- labelForInput?: string;
35
- onClearInput?: () => void;
36
- placeholderValue?: string;
37
- rightToLeftOrientation?: boolean;
9
+ export declare const SearchcraftBaseSearchResults: FC<SearchcraftBaseSearchResultsProps>;
10
+
11
+ export declare interface SearchcraftBaseSearchResultsProps extends Components.SearchcraftBaseSearchResults {
38
12
  }
39
13
 
40
- export declare const BaseSearchResult: FC<BaseSearchResultProps>;
41
-
42
- declare interface BaseSearchResultProps {
43
- buttonCallbackFn?: () => void;
44
- buttonLabel?: string;
45
- imageAltText?: string;
46
- imageSrc?: string;
47
- interactiveResult?: boolean;
48
- callbackFn?: () => void;
49
- keyDownCallbackFn?: () => void;
50
- resultBodyContent?: string;
51
- resultHeading?: string;
52
- resultSubheading?: string;
14
+ export declare const SearchcraftButton: FC<SearchcraftButtonProps>;
15
+
16
+ export declare interface SearchcraftButtonProps extends Components.SearchcraftButton {
53
17
  }
54
18
 
55
- export declare const BaseSearchResults: FC;
56
-
57
- export declare const Button: FC<ButtonProps>;
58
-
59
- declare type ButtonProps = {
60
- className?: string;
61
- iconElement?: ReactNode;
62
- iconOnly?: boolean;
63
- iconPosition?: string;
64
- label?: string;
65
- onClick?: () => void;
66
- };
67
-
68
- export declare const ErrorMessage: FC<ErrorMessageProps>;
69
-
70
- declare type ErrorMessageProps = {
71
- className?: string;
72
- errorMessage?: string;
73
- };
74
-
75
- export declare const Input: FC<InputProps>;
76
-
77
- declare type InputCaptionProps = {
78
- error?: boolean;
79
- inputCaptionClassName?: string;
80
- inputCaptionValue: string;
81
- rightToLeftOrientation?: boolean;
82
- };
83
-
84
- export declare const InputLabel: FC<InputLabelProps>;
85
-
86
- declare type InputLabelProps = {
87
- className?: string;
88
- label: string;
89
- };
90
-
91
- declare type InputProps = {
92
- error?: boolean;
93
- formClassName?: string;
94
- inputCaptionClassName?: string;
95
- inputCaptionValue?: string;
96
- inputClassName?: string;
97
- onClearInput?: () => void;
98
- onSearchInputChange: ChangeEventHandler<HTMLInputElement>;
99
- placeholderValue?: string;
100
- rightToLeftOrientation?: boolean;
101
- query: string;
102
- };
103
-
104
- export declare interface ProviderConfigTypes {
105
- index: string[];
106
- apiKey: string;
107
- endpointURL: string;
19
+ export declare const SearchcraftErrorMessage: FC<SearchcraftErrorMessageProps>;
20
+
21
+ export declare interface SearchcraftErrorMessageProps extends Components.SearchcraftErrorMessage {
108
22
  }
109
23
 
110
- /** The context provided by the Searchcraft React SDK */
111
- export declare interface ProviderContextTypes {
112
- /**
113
- * Error occurred while making a search query.
114
- */
115
- error: Error | null;
116
- /**
117
- * The db name(s) created in Vektron to query.
118
- */
119
- index: string[];
120
- /**
121
- * Value exposed when a search is in progress.
122
- */
123
- isRequesting: boolean;
124
- /**
125
- * Can be either fuzzy or normal. The default is fuzzy.
126
- */
127
- mode: 'fuzzy' | 'normal';
128
- /**
129
- * Input value given by the user to query the DB by.
130
- */
131
- query: string;
132
- /**
133
- * Setter function to update the value being sent to the SDK.
134
- */
135
- setQuery: Dispatch<SetStateAction<string>>;
136
- /**
137
- * Function for searching that requires search mode and search type.
138
- */
139
- search: (query: string, mode: 'fuzzy' | 'normal') => void;
140
- /**
141
- * Object that is returned from the Searchcraft API when a search request has resolved
142
- */
143
- searchResults?: SearchResult | SearchError | null;
24
+ export declare const SearchcraftFacetList: FC<SearchcraftFacetListProps>;
25
+
26
+ export declare interface SearchcraftFacetListProps extends Components.SearchcraftFacetList {
144
27
  }
145
28
 
146
- declare const Searchcraft: FC & {
147
- AutoSearchForm: FC<AutoSearchFormProps>;
148
- BaseSearchForm: FC<BaseSearchFormProps>;
149
- BaseSearchResult: FC<BaseSearchResultProps>;
150
- BaseSearchResults: FC;
151
- Button: FC;
152
- ClearInputButton: FC;
153
- ErrorMessage: FC;
154
- Input: FC<InputProps>;
155
- InputCaption: FC<InputCaptionProps>;
156
- InputIcon: FC;
157
- InputLabel: FC<InputLabelProps>;
158
- Provider: FC<{
159
- searchcraft: SearchcraftCore;
160
- debug?: boolean;
161
- }>;
162
- };
163
- export default Searchcraft;
164
-
165
- export { SearchcraftCore }
166
-
167
- declare interface ThemeContextType {
168
- theme: ThemeOptionType;
169
- toggleTheme: () => void;
29
+ export declare const SearchcraftFilterPanel: FC<SearchcraftFilterPanelProps>;
30
+
31
+ export declare interface SearchcraftFilterPanelProps extends Components.SearchcraftFilterPanel {
170
32
  }
171
33
 
172
- declare type ThemeOptionType = 'light' | 'dark';
34
+ export declare const SearchcraftInputForm: FC<SearchcraftInputFormProps>;
173
35
 
174
- export declare const useSearchcraft: () => ProviderContextTypes;
36
+ export declare interface SearchcraftInputFormProps extends Components.SearchcraftInputForm {
37
+ }
175
38
 
176
- export declare const useTheme: () => ThemeContextType;
39
+ export declare const SearchcraftInputLabel: FC<SearchcraftInputLabelProps>;
40
+
41
+ export declare interface SearchcraftInputLabelProps extends Components.SearchcraftInputLabel {
42
+ }
43
+
44
+ export declare const SearchcraftResultsInfo: FC<SearchcraftResultsInfoProps>;
45
+
46
+ export declare interface SearchcraftResultsInfoProps extends Components.SearchcraftResultsInfo {
47
+ }
48
+
49
+ export declare const SearchcraftSlider: FC<SearchcraftSliderProps>;
50
+
51
+ export declare interface SearchcraftSliderProps extends Components.SearchcraftSlider {
52
+ }
53
+
54
+ export declare const SearchcraftToggleButton: FC<SearchcraftToggleButtonProps>;
55
+
56
+ export declare interface SearchcraftToggleButtonProps extends Components.SearchcraftToggleButton {
57
+ }
177
58
 
178
59
  export { }