@searchcraft/react-sdk 0.1.0
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/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.js +544 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Searchcraft React SDK
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ChangeEventHandler } from 'react';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
|
+
import { PropsWithChildren } from 'react';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { SearchcraftDocument } from '@searchcraft-sdk/core';
|
|
8
|
+
import { SetStateAction } from 'react';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* * Buttonless 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
|
+
handleSubmit: (query: string) => void;
|
|
17
|
+
inputCaptionValue?: string;
|
|
18
|
+
labelForInput?: string;
|
|
19
|
+
onClearedInput?: () => void;
|
|
20
|
+
placeholderValue?: string;
|
|
21
|
+
rightToLeftOrientation?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* * Form used to submit the search query using a provided search function.
|
|
26
|
+
*/
|
|
27
|
+
export declare const BaseSearchForm: FC<BaseSearchFormProps>;
|
|
28
|
+
|
|
29
|
+
declare interface BaseSearchFormProps {
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
handleSubmit: (query: string) => void;
|
|
32
|
+
labelForInput?: string;
|
|
33
|
+
placeholderValue?: string;
|
|
34
|
+
rightToLeftOrientation?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare const BaseSearchResult: FC<BaseSearchResultProps>;
|
|
38
|
+
|
|
39
|
+
declare interface BaseSearchResultProps {
|
|
40
|
+
buttonCallbackFn?: () => void;
|
|
41
|
+
buttonLabel?: string;
|
|
42
|
+
imageAltText?: string;
|
|
43
|
+
imageSrc?: string;
|
|
44
|
+
interactiveResult?: boolean;
|
|
45
|
+
callbackFn?: () => void;
|
|
46
|
+
keyDownCallbackFn?: () => void;
|
|
47
|
+
resultBodyContent?: string;
|
|
48
|
+
resultHeading?: string;
|
|
49
|
+
resultSubheading?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare const Button: FC<ButtonProps>;
|
|
53
|
+
|
|
54
|
+
declare type ButtonProps = {
|
|
55
|
+
className?: string;
|
|
56
|
+
isRequesting?: boolean;
|
|
57
|
+
iconElement?: ReactNode;
|
|
58
|
+
iconOnly?: boolean;
|
|
59
|
+
iconPosition?: string;
|
|
60
|
+
label?: string;
|
|
61
|
+
onClick?: () => void;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export declare const ErrorMessage: FC<ErrorMessageProps>;
|
|
65
|
+
|
|
66
|
+
declare type ErrorMessageProps = {
|
|
67
|
+
className?: string;
|
|
68
|
+
errorMessage?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export declare const Input: FC<InputProps>;
|
|
72
|
+
|
|
73
|
+
export declare const InputLabel: FC<InputLabelProps>;
|
|
74
|
+
|
|
75
|
+
declare type InputLabelProps = {
|
|
76
|
+
className?: string;
|
|
77
|
+
label: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
declare type InputProps = {
|
|
81
|
+
error?: boolean;
|
|
82
|
+
formClassName?: string;
|
|
83
|
+
inputCaptionClassName?: string;
|
|
84
|
+
inputCaptionValue?: string;
|
|
85
|
+
inputClassName?: string;
|
|
86
|
+
isRequesting?: boolean;
|
|
87
|
+
onClearInput?: () => void;
|
|
88
|
+
onSearchInputChange: ChangeEventHandler<HTMLInputElement>;
|
|
89
|
+
placeholderValue?: string;
|
|
90
|
+
rightToLeftOrientation?: boolean;
|
|
91
|
+
query: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export declare const SearchcraftProvider: ({ children, config, }: PropsWithChildren & SearchcraftProviderConfig) => JSX_2.Element;
|
|
95
|
+
|
|
96
|
+
export declare interface SearchcraftProviderConfig {
|
|
97
|
+
config: {
|
|
98
|
+
index: string;
|
|
99
|
+
apiKey: string;
|
|
100
|
+
endpointPath: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** The context provided by the Searchcraft React SDK */
|
|
105
|
+
export declare interface SearchcraftProviderContext {
|
|
106
|
+
/**
|
|
107
|
+
* Error occurred while making a search query.
|
|
108
|
+
*/
|
|
109
|
+
error: Error | null;
|
|
110
|
+
/**
|
|
111
|
+
* The db name created in Vektron to query.
|
|
112
|
+
*/
|
|
113
|
+
index: string;
|
|
114
|
+
/**
|
|
115
|
+
* Value exposed when a search is in progress.
|
|
116
|
+
*/
|
|
117
|
+
isRequesting: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Can be either fuzzy or normal. The default is fuzzy.
|
|
120
|
+
*/
|
|
121
|
+
mode: 'fuzzy' | 'normal';
|
|
122
|
+
/**
|
|
123
|
+
* Input value given by the user to query the DB by.
|
|
124
|
+
*/
|
|
125
|
+
query: string;
|
|
126
|
+
/**
|
|
127
|
+
* Setter function to update the value being sent to the SDK.
|
|
128
|
+
*/
|
|
129
|
+
setQuery: Dispatch<SetStateAction<string>>;
|
|
130
|
+
/**
|
|
131
|
+
* Function for searching that requires search mode and search type.
|
|
132
|
+
*/
|
|
133
|
+
search: <T>(query: string, mode: 'fuzzy' | 'normal') => Promise<T[] | null>;
|
|
134
|
+
searchResult?: {
|
|
135
|
+
count: number;
|
|
136
|
+
hits: SearchcraftDocument[];
|
|
137
|
+
time_taken: number;
|
|
138
|
+
} | null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare const useSearchcraft: () => SearchcraftProviderContext;
|
|
142
|
+
|
|
143
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import z, { useMemo as W, useState as y, useContext as Q, useEffect as Z } from "react";
|
|
3
|
+
var K = Object.defineProperty, J = (t, e, s) => e in t ? K(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, S = (t, e, s) => J(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
class G {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
if (S(this, "config"), S(this, "searchResult"), S(this, "search", async (s, c) => {
|
|
7
|
+
try {
|
|
8
|
+
this.config.setIsRequestingTrue();
|
|
9
|
+
const o = `http://localhost:3000${this.config.endpointPath}`, r = {
|
|
10
|
+
query: s,
|
|
11
|
+
mode: c,
|
|
12
|
+
app: this.config.index
|
|
13
|
+
}, a = {
|
|
14
|
+
method: "POST",
|
|
15
|
+
headers: {
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
Authorization: `${this.config.apiKey}`
|
|
18
|
+
},
|
|
19
|
+
body: JSON.stringify(r)
|
|
20
|
+
}, i = await (await fetch(o, a)).json();
|
|
21
|
+
return this.searchResult = i.data, i;
|
|
22
|
+
} catch (o) {
|
|
23
|
+
return o;
|
|
24
|
+
} finally {
|
|
25
|
+
this.config.setIsRequestingFalse();
|
|
26
|
+
}
|
|
27
|
+
}), !e.apiKey || !e.endpointPath || !e.index)
|
|
28
|
+
throw new Error(
|
|
29
|
+
"API key, endpoint path, and index value(s) must be provided"
|
|
30
|
+
);
|
|
31
|
+
this.config = e, this.searchResult = null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const H = {
|
|
35
|
+
error: null,
|
|
36
|
+
index: "",
|
|
37
|
+
isRequesting: !1,
|
|
38
|
+
mode: "fuzzy",
|
|
39
|
+
query: "",
|
|
40
|
+
setQuery: (t) => t,
|
|
41
|
+
search: async () => null
|
|
42
|
+
}, $ = z.createContext(H), Kn = ({
|
|
43
|
+
children: t,
|
|
44
|
+
config: e
|
|
45
|
+
}) => {
|
|
46
|
+
const s = W(
|
|
47
|
+
() => new G({
|
|
48
|
+
...e,
|
|
49
|
+
setIsRequestingFalse: () => a(!1),
|
|
50
|
+
setIsRequestingTrue: () => a(!0)
|
|
51
|
+
}),
|
|
52
|
+
[e]
|
|
53
|
+
), [c, o] = y(""), [r, a] = y(!1), i = {
|
|
54
|
+
error: null,
|
|
55
|
+
index: s.config.index,
|
|
56
|
+
isRequesting: r,
|
|
57
|
+
mode: "fuzzy",
|
|
58
|
+
query: c,
|
|
59
|
+
search: s.search,
|
|
60
|
+
searchResult: s.searchResult,
|
|
61
|
+
setQuery: o
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ n($.Provider, { value: i, children: t });
|
|
64
|
+
}, D = () => Q($), U = "_formLTR_dvuqa_5", X = "_formRTL_dvuqa_9", Y = "_searchContainer_dvuqa_13", g = {
|
|
65
|
+
formLTR: U,
|
|
66
|
+
formRTL: X,
|
|
67
|
+
searchContainer: Y
|
|
68
|
+
};
|
|
69
|
+
function V(t) {
|
|
70
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
71
|
+
}
|
|
72
|
+
var F = { exports: {} };
|
|
73
|
+
/*!
|
|
74
|
+
Copyright (c) 2018 Jed Watson.
|
|
75
|
+
Licensed under the MIT License (MIT), see
|
|
76
|
+
http://jedwatson.github.io/classnames
|
|
77
|
+
*/
|
|
78
|
+
(function(t) {
|
|
79
|
+
(function() {
|
|
80
|
+
var e = {}.hasOwnProperty;
|
|
81
|
+
function s() {
|
|
82
|
+
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
83
|
+
var i = arguments[a];
|
|
84
|
+
i && (r = o(r, c(i)));
|
|
85
|
+
}
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
function c(r) {
|
|
89
|
+
if (typeof r == "string" || typeof r == "number")
|
|
90
|
+
return r;
|
|
91
|
+
if (typeof r != "object")
|
|
92
|
+
return "";
|
|
93
|
+
if (Array.isArray(r))
|
|
94
|
+
return s.apply(null, r);
|
|
95
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
96
|
+
return r.toString();
|
|
97
|
+
var a = "";
|
|
98
|
+
for (var i in r)
|
|
99
|
+
e.call(r, i) && r[i] && (a = o(a, i));
|
|
100
|
+
return a;
|
|
101
|
+
}
|
|
102
|
+
function o(r, a) {
|
|
103
|
+
return a ? r ? r + " " + a : r + a : r;
|
|
104
|
+
}
|
|
105
|
+
t.exports ? (s.default = s, t.exports = s) : window.classNames = s;
|
|
106
|
+
})();
|
|
107
|
+
})(F);
|
|
108
|
+
var O = F.exports;
|
|
109
|
+
const _ = /* @__PURE__ */ V(O), nn = "_spinnerContainer_1noam_1", tn = "_spinnerDark_1noam_7", en = "_spinning_1noam_1", rn = "_spinnerLight_1noam_16", I = {
|
|
110
|
+
spinnerContainer: nn,
|
|
111
|
+
spinnerDark: tn,
|
|
112
|
+
spinning: en,
|
|
113
|
+
spinnerLight: rn
|
|
114
|
+
}, N = () => /* @__PURE__ */ n("div", { className: I.spinnerContainer, children: /* @__PURE__ */ n("div", { className: I.spinnerLight }) }), k = () => /* @__PURE__ */ n("div", { className: I.spinnerContainer, children: /* @__PURE__ */ n("div", { className: I.spinnerDark }) }), sn = "_button_8jqm2_5", an = "_spinnerMarginRight_8jqm2_26", on = "_spinnerMarginLeft_8jqm2_32", cn = "_buttonLabel_8jqm2_38", ln = "_rightandback_8jqm2_1", b = {
|
|
115
|
+
button: sn,
|
|
116
|
+
spinnerMarginRight: an,
|
|
117
|
+
spinnerMarginLeft: on,
|
|
118
|
+
buttonLabel: cn,
|
|
119
|
+
rightandback: ln
|
|
120
|
+
}, E = ({
|
|
121
|
+
className: t,
|
|
122
|
+
iconElement: e,
|
|
123
|
+
iconOnly: s = !1,
|
|
124
|
+
iconPosition: c = "left",
|
|
125
|
+
isRequesting: o = !1,
|
|
126
|
+
label: r = "Search",
|
|
127
|
+
onClick: a
|
|
128
|
+
}) => /* @__PURE__ */ l(T, { children: [
|
|
129
|
+
s && /* @__PURE__ */ n(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
className: _(b.button, t),
|
|
133
|
+
onClick: a,
|
|
134
|
+
type: "submit",
|
|
135
|
+
children: o ? /* @__PURE__ */ n(k, {}) : e
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
!s && /* @__PURE__ */ l(
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
className: _(b.button, t),
|
|
142
|
+
onClick: a,
|
|
143
|
+
type: "submit",
|
|
144
|
+
children: [
|
|
145
|
+
c === "left" && o ? /* @__PURE__ */ n("div", { className: b.spinnerMarginRight, children: /* @__PURE__ */ n(k, {}) }) : e,
|
|
146
|
+
/* @__PURE__ */ n(
|
|
147
|
+
"span",
|
|
148
|
+
{
|
|
149
|
+
className: _(
|
|
150
|
+
o && b.buttonLabel,
|
|
151
|
+
t
|
|
152
|
+
),
|
|
153
|
+
children: r
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
c === "right" && o ? /* @__PURE__ */ n("div", { className: b.spinnerMarginLeft, children: /* @__PURE__ */ n(k, {}) }) : e
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }), un = "_errorMessage_12dc9_5", hn = {
|
|
161
|
+
errorMessage: un
|
|
162
|
+
}, pn = ({
|
|
163
|
+
className: t,
|
|
164
|
+
errorMessage: e
|
|
165
|
+
}) => /* @__PURE__ */ n("p", { className: _(hn.errorMessage, t), children: e || "Search term is required." }), dn = "_inputCaption_hmjqk_5", _n = "_inputCaptionError_hmjqk_14", mn = "_inputCaptionRTL_hmjqk_24", Cn = "_inputCaptionErrorRTL_hmjqk_34", v = {
|
|
166
|
+
inputCaption: dn,
|
|
167
|
+
inputCaptionError: _n,
|
|
168
|
+
inputCaptionRTL: mn,
|
|
169
|
+
inputCaptionErrorRTL: Cn
|
|
170
|
+
}, M = ({
|
|
171
|
+
error: t = !1,
|
|
172
|
+
inputCaptionClassName: e,
|
|
173
|
+
inputCaptionValue: s = "Enter Search",
|
|
174
|
+
rightToLeftOrientation: c = !1
|
|
175
|
+
}) => c ? /* @__PURE__ */ n(
|
|
176
|
+
"p",
|
|
177
|
+
{
|
|
178
|
+
className: _(
|
|
179
|
+
t ? v.inputCaptionErrorRTL : v.inputCaptionRTL,
|
|
180
|
+
e
|
|
181
|
+
),
|
|
182
|
+
children: s
|
|
183
|
+
}
|
|
184
|
+
) : /* @__PURE__ */ n(
|
|
185
|
+
"p",
|
|
186
|
+
{
|
|
187
|
+
className: _(
|
|
188
|
+
t ? v.inputCaptionError : v.inputCaption,
|
|
189
|
+
e
|
|
190
|
+
),
|
|
191
|
+
children: s
|
|
192
|
+
}
|
|
193
|
+
), fn = "_inputIcon_101v2_5", gn = "_inputIconRTL_101v2_13", R = {
|
|
194
|
+
inputIcon: fn,
|
|
195
|
+
inputIconRTL: gn
|
|
196
|
+
}, Ln = () => /* @__PURE__ */ l("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
197
|
+
/* @__PURE__ */ n("title", { children: "Searchcraft Search Icon" }),
|
|
198
|
+
/* @__PURE__ */ n(
|
|
199
|
+
"path",
|
|
200
|
+
{
|
|
201
|
+
d: "M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",
|
|
202
|
+
stroke: "#404040",
|
|
203
|
+
strokeWidth: "1.5",
|
|
204
|
+
strokeLinecap: "round",
|
|
205
|
+
strokeLinejoin: "round"
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] }), bn = () => /* @__PURE__ */ l("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
209
|
+
/* @__PURE__ */ n("title", { children: "Searchcraft Error Search Icon" }),
|
|
210
|
+
/* @__PURE__ */ n(
|
|
211
|
+
"path",
|
|
212
|
+
{
|
|
213
|
+
d: "M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",
|
|
214
|
+
stroke: "#737373",
|
|
215
|
+
strokeWidth: "1.5",
|
|
216
|
+
strokeLinecap: "round",
|
|
217
|
+
strokeLinejoin: "round"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] }), x = ({
|
|
221
|
+
error: t = !1,
|
|
222
|
+
rightToLeftOrientation: e = !1
|
|
223
|
+
}) => t ? /* @__PURE__ */ n(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
className: e ? R.inputIconRTL : R.inputIcon,
|
|
227
|
+
children: /* @__PURE__ */ n(bn, {})
|
|
228
|
+
}
|
|
229
|
+
) : /* @__PURE__ */ n(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
className: e ? R.inputIconRTL : R.inputIcon,
|
|
233
|
+
children: /* @__PURE__ */ n(Ln, {})
|
|
234
|
+
}
|
|
235
|
+
), w = () => /* @__PURE__ */ l("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
236
|
+
/* @__PURE__ */ n("title", { children: "Searchcraft Clear Input Icon" }),
|
|
237
|
+
/* @__PURE__ */ n(
|
|
238
|
+
"path",
|
|
239
|
+
{
|
|
240
|
+
d: "M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",
|
|
241
|
+
stroke: "black",
|
|
242
|
+
strokeWidth: "1.5",
|
|
243
|
+
strokeLinecap: "round",
|
|
244
|
+
strokeLinejoin: "round"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] }), j = () => /* @__PURE__ */ l("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", children: [
|
|
248
|
+
/* @__PURE__ */ n("title", { children: "Searchcraft Arrow Right Icon" }),
|
|
249
|
+
/* @__PURE__ */ n(
|
|
250
|
+
"path",
|
|
251
|
+
{
|
|
252
|
+
d: "M7.5 15.0444L12.5 10.0444L7.5 5.04443",
|
|
253
|
+
stroke: "#737373",
|
|
254
|
+
strokeWidth: "1.5",
|
|
255
|
+
strokeLinecap: "round",
|
|
256
|
+
strokeLinejoin: "round"
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] }), vn = "_inputClearButton_xi5sa_5", Rn = "_inputClearButtonRTL_xi5sa_19", q = {
|
|
260
|
+
inputClearButton: vn,
|
|
261
|
+
inputClearButtonRTL: Rn
|
|
262
|
+
}, B = ({
|
|
263
|
+
isAutoSearch: t = !1,
|
|
264
|
+
isRequesting: e = !1,
|
|
265
|
+
onClearInput: s,
|
|
266
|
+
rightToLeftOrientation: c = !1
|
|
267
|
+
}) => c ? /* @__PURE__ */ n(
|
|
268
|
+
"button",
|
|
269
|
+
{
|
|
270
|
+
className: q.inputClearButtonRTL,
|
|
271
|
+
onClick: s,
|
|
272
|
+
type: "button",
|
|
273
|
+
children: e ? /* @__PURE__ */ n(N, {}) : /* @__PURE__ */ n(w, {})
|
|
274
|
+
}
|
|
275
|
+
) : /* @__PURE__ */ n(
|
|
276
|
+
"button",
|
|
277
|
+
{
|
|
278
|
+
className: q.inputClearButton,
|
|
279
|
+
onClick: s,
|
|
280
|
+
type: "button",
|
|
281
|
+
children: e ? /* @__PURE__ */ n(N, {}) : /* @__PURE__ */ n(w, {})
|
|
282
|
+
}
|
|
283
|
+
), yn = "_inputContainer_17hag_5", In = "_inputContainerRTL_17hag_9", Sn = "_input_17hag_5", kn = "_inputRTL_17hag_35", Tn = "_inputError_17hag_57", Nn = "_inputErrorRTL_17hag_82", f = {
|
|
284
|
+
inputContainer: yn,
|
|
285
|
+
inputContainerRTL: In,
|
|
286
|
+
input: Sn,
|
|
287
|
+
inputRTL: kn,
|
|
288
|
+
inputError: Tn,
|
|
289
|
+
inputErrorRTL: Nn
|
|
290
|
+
}, P = ({
|
|
291
|
+
error: t = !1,
|
|
292
|
+
formClassName: e = "",
|
|
293
|
+
inputCaptionClassName: s = "",
|
|
294
|
+
inputClassName: c = "",
|
|
295
|
+
inputCaptionValue: o = "",
|
|
296
|
+
isRequesting: r = !1,
|
|
297
|
+
onClearInput: a,
|
|
298
|
+
onSearchInputChange: i,
|
|
299
|
+
placeholderValue: d = "Enter Search",
|
|
300
|
+
rightToLeftOrientation: u = !1,
|
|
301
|
+
query: h = ""
|
|
302
|
+
}) => {
|
|
303
|
+
const C = u ? f.inputContainerRTL : f.inputContainer;
|
|
304
|
+
return /* @__PURE__ */ n("div", { className: _(C, e), children: u ? /* @__PURE__ */ l(T, { children: [
|
|
305
|
+
/* @__PURE__ */ n(
|
|
306
|
+
"input",
|
|
307
|
+
{
|
|
308
|
+
className: _(
|
|
309
|
+
t ? f.inputErrorRTL : f.inputRTL,
|
|
310
|
+
c
|
|
311
|
+
),
|
|
312
|
+
id: "sc-input",
|
|
313
|
+
onChange: i,
|
|
314
|
+
placeholder: d,
|
|
315
|
+
type: "text",
|
|
316
|
+
value: h
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
o && /* @__PURE__ */ n(
|
|
320
|
+
M,
|
|
321
|
+
{
|
|
322
|
+
inputCaptionClassName: s,
|
|
323
|
+
inputCaptionValue: o,
|
|
324
|
+
rightToLeftOrientation: u
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
h.length > 0 && /* @__PURE__ */ n(
|
|
328
|
+
B,
|
|
329
|
+
{
|
|
330
|
+
isRequesting: r,
|
|
331
|
+
onClearInput: a,
|
|
332
|
+
rightToLeftOrientation: u
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
/* @__PURE__ */ n(
|
|
336
|
+
x,
|
|
337
|
+
{
|
|
338
|
+
error: t,
|
|
339
|
+
rightToLeftOrientation: u
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
] }) : /* @__PURE__ */ l(T, { children: [
|
|
343
|
+
/* @__PURE__ */ n(
|
|
344
|
+
"input",
|
|
345
|
+
{
|
|
346
|
+
className: _(
|
|
347
|
+
t ? f.inputError : f.input,
|
|
348
|
+
c
|
|
349
|
+
),
|
|
350
|
+
id: "sc-input",
|
|
351
|
+
onChange: i,
|
|
352
|
+
placeholder: d,
|
|
353
|
+
type: "text",
|
|
354
|
+
value: h
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
o && /* @__PURE__ */ n(
|
|
358
|
+
M,
|
|
359
|
+
{
|
|
360
|
+
inputCaptionClassName: s,
|
|
361
|
+
inputCaptionValue: o,
|
|
362
|
+
rightToLeftOrientation: u
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
h.length > 0 && /* @__PURE__ */ n(
|
|
366
|
+
B,
|
|
367
|
+
{
|
|
368
|
+
onClearInput: a,
|
|
369
|
+
isRequesting: r,
|
|
370
|
+
rightToLeftOrientation: u
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ n(x, { error: t })
|
|
374
|
+
] }) });
|
|
375
|
+
}, En = "_label_1euwf_5", Mn = {
|
|
376
|
+
label: En
|
|
377
|
+
}, A = ({
|
|
378
|
+
className: t,
|
|
379
|
+
label: e = "Enter Search"
|
|
380
|
+
}) => /* @__PURE__ */ n("label", { className: _(Mn.label, t), htmlFor: "sc-input", children: e }), Jn = ({
|
|
381
|
+
errorMessage: t,
|
|
382
|
+
handleSubmit: e,
|
|
383
|
+
labelForInput: s = "Search",
|
|
384
|
+
placeholderValue: c = "Enter Search Term",
|
|
385
|
+
rightToLeftOrientation: o = !1
|
|
386
|
+
}) => {
|
|
387
|
+
const { query: r, isRequesting: a, setQuery: i } = D(), [d, u] = y(!1), h = (m) => {
|
|
388
|
+
m.preventDefault(), r.trim() === "" ? u(!0) : (u(!1), e(r));
|
|
389
|
+
}, C = (m) => i(m.target.value), L = () => i("");
|
|
390
|
+
return /* @__PURE__ */ l(
|
|
391
|
+
"form",
|
|
392
|
+
{
|
|
393
|
+
className: o ? g.formRTL : g.formLTR,
|
|
394
|
+
onSubmit: h,
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ n(A, { label: s }),
|
|
397
|
+
/* @__PURE__ */ l("div", { className: g.searchContainer, children: [
|
|
398
|
+
o && /* @__PURE__ */ n(E, { isRequesting: a }),
|
|
399
|
+
/* @__PURE__ */ n(
|
|
400
|
+
P,
|
|
401
|
+
{
|
|
402
|
+
error: d,
|
|
403
|
+
onClearInput: L,
|
|
404
|
+
onSearchInputChange: C,
|
|
405
|
+
placeholderValue: c,
|
|
406
|
+
query: r,
|
|
407
|
+
rightToLeftOrientation: o
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
!o && /* @__PURE__ */ n(E, { isRequesting: a })
|
|
411
|
+
] }),
|
|
412
|
+
d && /* @__PURE__ */ n(pn, { errorMessage: t })
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}, Gn = ({
|
|
417
|
+
handleSubmit: t,
|
|
418
|
+
inputCaptionValue: e = "",
|
|
419
|
+
labelForInput: s = "Search",
|
|
420
|
+
onClearedInput: c = () => {
|
|
421
|
+
},
|
|
422
|
+
placeholderValue: o = "Search here",
|
|
423
|
+
rightToLeftOrientation: r = !1
|
|
424
|
+
}) => {
|
|
425
|
+
const { isRequesting: a, query: i, setQuery: d } = D(), [u, h] = y(!1), C = (m) => {
|
|
426
|
+
m.preventDefault(), d(m.currentTarget.value), i !== m.currentTarget.value && h(!0);
|
|
427
|
+
}, L = () => {
|
|
428
|
+
d(""), c();
|
|
429
|
+
};
|
|
430
|
+
return Z(() => {
|
|
431
|
+
if (u)
|
|
432
|
+
t(i), h(!1);
|
|
433
|
+
else
|
|
434
|
+
return;
|
|
435
|
+
}, [u, t, i]), /* @__PURE__ */ l(
|
|
436
|
+
"form",
|
|
437
|
+
{
|
|
438
|
+
className: r ? g.formRTL : g.formLTR,
|
|
439
|
+
onSubmit: (m) => {
|
|
440
|
+
m.preventDefault();
|
|
441
|
+
},
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ n(A, { label: s }),
|
|
444
|
+
/* @__PURE__ */ n("div", { className: g.searchContainer, children: /* @__PURE__ */ n(
|
|
445
|
+
P,
|
|
446
|
+
{
|
|
447
|
+
inputCaptionValue: e,
|
|
448
|
+
isRequesting: a,
|
|
449
|
+
onClearInput: L,
|
|
450
|
+
onSearchInputChange: C,
|
|
451
|
+
placeholderValue: o,
|
|
452
|
+
query: i,
|
|
453
|
+
rightToLeftOrientation: r
|
|
454
|
+
}
|
|
455
|
+
) })
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
}, xn = () => /* @__PURE__ */ l("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
460
|
+
/* @__PURE__ */ n("title", { children: "Searchcraft Button Icon" }),
|
|
461
|
+
/* @__PURE__ */ n(
|
|
462
|
+
"path",
|
|
463
|
+
{
|
|
464
|
+
d: "M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z",
|
|
465
|
+
stroke: "white",
|
|
466
|
+
strokeWidth: "1.5",
|
|
467
|
+
strokeLinecap: "round",
|
|
468
|
+
strokeLinejoin: "round"
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
] }), wn = "_resultContainer_10d68_5", jn = "_interactiveResultContainer_10d68_17", qn = "_interactiveIconLarge_10d68_33", Bn = "_interactiveIconSmall_10d68_45", $n = "_imageContainer_10d68_57", Dn = "_contentContainer_10d68_68", Fn = "_image_10d68_57", Pn = "_heading_10d68_86", An = "_subheading_10d68_97", zn = "_bodyContent_10d68_107", Wn = "_button_10d68_117", p = {
|
|
472
|
+
resultContainer: wn,
|
|
473
|
+
interactiveResultContainer: jn,
|
|
474
|
+
interactiveIconLarge: qn,
|
|
475
|
+
interactiveIconSmall: Bn,
|
|
476
|
+
imageContainer: $n,
|
|
477
|
+
contentContainer: Dn,
|
|
478
|
+
image: Fn,
|
|
479
|
+
heading: Pn,
|
|
480
|
+
subheading: An,
|
|
481
|
+
bodyContent: zn,
|
|
482
|
+
button: Wn
|
|
483
|
+
}, Hn = ({
|
|
484
|
+
buttonCallbackFn: t = () => {
|
|
485
|
+
},
|
|
486
|
+
buttonLabel: e = "",
|
|
487
|
+
callbackFn: s = () => {
|
|
488
|
+
},
|
|
489
|
+
keyDownCallbackFn: c = () => {
|
|
490
|
+
},
|
|
491
|
+
imageAltText: o = "",
|
|
492
|
+
interactiveResult: r = !1,
|
|
493
|
+
imageSrc: a = "",
|
|
494
|
+
resultBodyContent: i = "",
|
|
495
|
+
resultHeading: d = "",
|
|
496
|
+
resultSubheading: u = ""
|
|
497
|
+
}) => {
|
|
498
|
+
const h = (L) => {
|
|
499
|
+
L.stopPropagation(), t();
|
|
500
|
+
}, C = () => {
|
|
501
|
+
if (r)
|
|
502
|
+
s();
|
|
503
|
+
else
|
|
504
|
+
return;
|
|
505
|
+
};
|
|
506
|
+
return /* @__PURE__ */ l(
|
|
507
|
+
"div",
|
|
508
|
+
{
|
|
509
|
+
className: r ? p.interactiveResultContainer : p.resultContainer,
|
|
510
|
+
id: "searchcraft-item",
|
|
511
|
+
onClick: C,
|
|
512
|
+
onKeyDown: c,
|
|
513
|
+
children: [
|
|
514
|
+
r && /* @__PURE__ */ n("div", { className: p.interactiveIconLarge, children: /* @__PURE__ */ n(j, {}) }),
|
|
515
|
+
/* @__PURE__ */ n("div", { className: p.imageContainer, children: /* @__PURE__ */ n("img", { alt: o, className: p.image, src: a }) }),
|
|
516
|
+
/* @__PURE__ */ l("div", { className: p.contentContainer, children: [
|
|
517
|
+
/* @__PURE__ */ l("h2", { className: p.heading, children: [
|
|
518
|
+
d,
|
|
519
|
+
" ",
|
|
520
|
+
r && /* @__PURE__ */ n("div", { className: p.interactiveIconSmall, children: /* @__PURE__ */ n(j, {}) })
|
|
521
|
+
] }),
|
|
522
|
+
/* @__PURE__ */ n("h3", { className: p.subheading, children: u }),
|
|
523
|
+
/* @__PURE__ */ n("p", { className: p.bodyContent, children: i }),
|
|
524
|
+
/* @__PURE__ */ l("button", { className: p.button, onClick: h, type: "button", children: [
|
|
525
|
+
/* @__PURE__ */ n(xn, {}),
|
|
526
|
+
/* @__PURE__ */ n("span", { children: e })
|
|
527
|
+
] })
|
|
528
|
+
] })
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
export {
|
|
534
|
+
Gn as AutoSearchForm,
|
|
535
|
+
Jn as BaseSearchForm,
|
|
536
|
+
Hn as BaseSearchResult,
|
|
537
|
+
E as Button,
|
|
538
|
+
pn as ErrorMessage,
|
|
539
|
+
P as Input,
|
|
540
|
+
A as InputLabel,
|
|
541
|
+
Kn as SearchcraftProvider,
|
|
542
|
+
D as useSearchcraft
|
|
543
|
+
};
|
|
544
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../core-sdk/dist/index.js","../src/components/providers/SearchcraftContext.tsx","../src/components/providers/SearchcraftProvider.tsx","../../../node_modules/classnames/index.js","../src/components/ui/components/Spinner/index.tsx","../src/components/ui/components/Button/index.tsx","../src/components/ui/components/ErrorMessage/index.tsx","../src/components/ui/components/InputCaption/index.tsx","../src/components/ui/assets/SearchIcons.jsx","../src/components/ui/components/InputIcon/index.tsx","../src/components/ui/assets/ClearInputIcon.jsx","../src/components/ui/components/ClearInputButton/index.tsx","../src/components/ui/components/Input/index.tsx","../src/components/ui/components/InputLabel/index.tsx","../src/components/ui/BaseSearchForm/index.tsx","../src/components/ui/AutoSearchForm/index.tsx","../src/components/ui/assets/ButtonIcons.jsx","../src/components/ui/BaseSearchResult/index.tsx"],"sourcesContent":["var h = Object.defineProperty;\nvar c = (e, t, s) => t in e ? h(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;\nvar n = (e, t, s) => c(e, typeof t != \"symbol\" ? t + \"\" : t, s);\nclass l {\n constructor(t) {\n n(this, \"config\");\n n(this, \"searchResult\");\n /**\n * @param {string} query - User provided value Searchcraft will use to search against\n * @param {string} mode - Can be either 'fuzzy' or 'normal'\n * @returns {SearchResults} - Returns a `SearchResponse` object with the results from the search or throws an error\n */\n n(this, \"search\", async (t, s) => {\n try {\n this.config.setIsRequestingTrue();\n const i = `http://localhost:3000${this.config.endpointPath}`, r = {\n query: t,\n mode: s,\n app: this.config.index\n }, a = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `${this.config.apiKey}`\n },\n body: JSON.stringify(r)\n }, o = await (await fetch(i, a)).json();\n return this.searchResult = o.data, o;\n } catch (i) {\n return i;\n } finally {\n this.config.setIsRequestingFalse();\n }\n });\n if (!t.apiKey || !t.endpointPath || !t.index)\n throw new Error(\n \"API key, endpoint path, and index value(s) must be provided\"\n );\n this.config = t, this.searchResult = null;\n }\n}\nexport {\n l as CoreSDK\n};\n//# sourceMappingURL=index.js.map\n","import React from 'react';\n\nimport type { SearchcraftProviderContext } from './SearchcraftProviderContext';\n\nconst defaultContext: SearchcraftProviderContext = {\n error: null,\n index: '',\n isRequesting: false,\n mode: 'fuzzy',\n query: '',\n setQuery: (query) => query,\n search: async () => null,\n};\n\nexport const SearchcraftContext =\n React.createContext<SearchcraftProviderContext>(defaultContext);\n","import { type PropsWithChildren, useContext, useMemo, useState } from 'react';\nimport { CoreSDK } from '@searchcraft-sdk/core';\n\nimport { SearchcraftContext } from './SearchcraftContext';\nimport type { SearchcraftProviderConfig } from './SearchcraftProviderConfig';\nimport type { SearchcraftProviderContext } from './SearchcraftProviderContext';\n\nconst SearchcraftProvider = ({\n children,\n config,\n}: PropsWithChildren & SearchcraftProviderConfig) => {\n const core: CoreSDK = useMemo<CoreSDK>(\n () =>\n new CoreSDK({\n ...config,\n setIsRequestingFalse: () => setIsRequesting(false),\n setIsRequestingTrue: () => setIsRequesting(true),\n }),\n [config],\n );\n\n const [query, setQuery] = useState<string>('');\n const [isRequesting, setIsRequesting] = useState<boolean>(false);\n\n const providerContext: SearchcraftProviderContext = {\n error: null,\n index: core.config.index,\n isRequesting,\n mode: 'fuzzy',\n query,\n search: core.search,\n searchResult: core.searchResult,\n setQuery,\n };\n\n return (\n <SearchcraftContext.Provider value={providerContext}>\n {children}\n </SearchcraftContext.Provider>\n );\n};\n\nconst useSearchcraft = () =>\n useContext<SearchcraftProviderContext>(SearchcraftContext);\n\nexport { SearchcraftProvider, useSearchcraft };\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import styles from '@styles/sc-spinner.module.scss';\n\nexport const SpinnerLight = () => (\n <div className={styles.spinnerContainer}>\n <div className={styles.spinnerLight} />\n </div>\n);\n\nexport const SpinnerDark = () => (\n <div className={styles.spinnerContainer}>\n <div className={styles.spinnerDark} />\n </div>\n);\n","import type { FC, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { SpinnerDark } from '../Spinner';\n\nimport styles from '@styles/sc-button.module.scss';\n\ntype ButtonProps = {\n className?: string;\n isRequesting?: boolean;\n iconElement?: ReactNode;\n iconOnly?: boolean;\n iconPosition?: string;\n label?: string;\n onClick?: () => void;\n};\n\nexport const Button: FC<ButtonProps> = ({\n className,\n iconElement,\n iconOnly = false,\n iconPosition = 'left',\n isRequesting = false,\n label = 'Search',\n onClick,\n}) => {\n return (\n <>\n {iconOnly && (\n <button\n className={classNames(styles.button, className)}\n onClick={onClick}\n type='submit'\n >\n {isRequesting ? <SpinnerDark /> : iconElement}\n </button>\n )}\n {!iconOnly && (\n <button\n className={classNames(styles.button, className)}\n onClick={onClick}\n type='submit'\n >\n {iconPosition === 'left' && isRequesting ? (\n <div className={styles.spinnerMarginRight}>\n <SpinnerDark />\n </div>\n ) : (\n iconElement\n )}\n <span\n className={classNames(\n isRequesting && styles.buttonLabel,\n className,\n )}\n >\n {label}\n </span>\n {iconPosition === 'right' && isRequesting ? (\n <div className={styles.spinnerMarginLeft}>\n <SpinnerDark />\n </div>\n ) : (\n iconElement\n )}\n </button>\n )}\n </>\n );\n};\n","import type { FC } from 'react';\nimport classNames from 'classnames';\n\nimport styles from '@styles/sc-input-error-message.module.scss';\n\ntype ErrorMessageProps = {\n className?: string;\n errorMessage?: string;\n};\n\nexport const ErrorMessage: FC<ErrorMessageProps> = ({\n className,\n errorMessage,\n}) => {\n return (\n <p className={classNames(styles.errorMessage, className)}>\n {errorMessage || 'Search term is required.'}\n </p>\n );\n};\n","import type { FC } from 'react';\nimport classNames from 'classnames';\n\nimport styles from '@styles/sc-input-caption.module.scss';\n\ntype InputCaptionProps = {\n error?: boolean;\n inputCaptionClassName?: string;\n inputCaptionValue: string;\n rightToLeftOrientation?: boolean;\n};\n\nexport const InputCaption: FC<InputCaptionProps> = ({\n error = false,\n inputCaptionClassName,\n inputCaptionValue = 'Enter Search',\n rightToLeftOrientation = false,\n}) => {\n return rightToLeftOrientation ? (\n <p\n className={classNames(\n error ? styles.inputCaptionErrorRTL : styles.inputCaptionRTL,\n inputCaptionClassName,\n )}\n >\n {inputCaptionValue}\n </p>\n ) : (\n <p\n className={classNames(\n error ? styles.inputCaptionError : styles.inputCaption,\n inputCaptionClassName,\n )}\n >\n {inputCaptionValue}\n </p>\n );\n};\n","export const SearchIcon = () => (\n <svg width='20' height='20' viewBox='0 0 20 20' fill='none'>\n <title>Searchcraft Search Icon</title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#404040'\n strokeWidth='1.5'\n strokeLinecap='round'\n strokeLinejoin='round'\n />\n </svg>\n);\n\nexport const SearchIconError = () => (\n <svg width='20' height='20' viewBox='0 0 20 20' fill='none'>\n <title>Searchcraft Error Search Icon</title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#737373'\n strokeWidth='1.5'\n strokeLinecap='round'\n strokeLinejoin='round'\n />\n </svg>\n);\n","import type { FC } from 'react';\n\nimport styles from '@styles/sc-input-icon.module.scss';\nimport { SearchIcon, SearchIconError } from '../../assets/SearchIcons';\n\ntype InputIconProps = {\n error?: boolean;\n rightToLeftOrientation?: boolean;\n};\n\nexport const InputIcon: FC<InputIconProps> = ({\n error = false,\n rightToLeftOrientation = false,\n}) => {\n return error ? (\n <div\n className={\n rightToLeftOrientation ? styles.inputIconRTL : styles.inputIcon\n }\n >\n <SearchIconError />\n </div>\n ) : (\n <div\n className={\n rightToLeftOrientation ? styles.inputIconRTL : styles.inputIcon\n }\n >\n <SearchIcon />\n </div>\n );\n};\n","export const ClearInputIcon = () => (\n <svg width='22' height='22' viewBox='0 0 22 22' fill='none'>\n <title>Searchcraft Clear Input Icon</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='black'\n strokeWidth='1.5'\n strokeLinecap='round'\n strokeLinejoin='round'\n />\n </svg>\n);\n\nexport const ArrowRightIcon = () => (\n <svg width='20' height='21' viewBox='0 0 20 21' fill='none'>\n <title>Searchcraft Arrow Right Icon</title>\n <path\n d='M7.5 15.0444L12.5 10.0444L7.5 5.04443'\n stroke='#737373'\n strokeWidth='1.5'\n strokeLinecap='round'\n strokeLinejoin='round'\n />\n </svg>\n);\n","import type { FC } from 'react';\n\nimport { ClearInputIcon } from '../../assets/ClearInputIcon';\n\nimport { SpinnerLight } from '../Spinner';\n\nimport styles from '@styles/sc-clear-input-button.module.scss';\n\ntype ClearInputButtonProps = {\n isAutoSearch?: boolean;\n isRequesting?: boolean;\n onClearInput?: () => void;\n rightToLeftOrientation?: boolean;\n};\n\nexport const ClearInputButton: FC<ClearInputButtonProps> = ({\n isAutoSearch = false,\n isRequesting = false,\n onClearInput,\n rightToLeftOrientation = false,\n}) => {\n return rightToLeftOrientation ? (\n <button\n className={styles.inputClearButtonRTL}\n onClick={onClearInput}\n type='button'\n >\n {isRequesting ? <SpinnerLight /> : <ClearInputIcon />}\n </button>\n ) : (\n <button\n className={styles.inputClearButton}\n onClick={onClearInput}\n type='button'\n >\n {isRequesting ? <SpinnerLight /> : <ClearInputIcon />}\n </button>\n );\n};\n","import type { ChangeEventHandler, FC } from 'react';\nimport classNames from 'classnames';\n\nimport { InputCaption } from '../InputCaption';\nimport { InputIcon } from '../InputIcon';\nimport { ClearInputButton } from '../ClearInputButton';\n\nimport styles from '@styles/sc-input.module.scss';\n\ntype InputProps = {\n error?: boolean;\n formClassName?: string;\n inputCaptionClassName?: string;\n inputCaptionValue?: string;\n inputClassName?: string;\n isRequesting?: boolean;\n onClearInput?: () => void;\n onSearchInputChange: ChangeEventHandler<HTMLInputElement>;\n placeholderValue?: string;\n rightToLeftOrientation?: boolean;\n query: string;\n};\n\nexport const Input: FC<InputProps> = ({\n error = false,\n formClassName = '',\n inputCaptionClassName = '',\n inputClassName = '',\n inputCaptionValue = '',\n isRequesting = false,\n onClearInput,\n onSearchInputChange,\n placeholderValue = 'Enter Search',\n rightToLeftOrientation = false,\n query = '',\n}) => {\n const containerClassName = rightToLeftOrientation\n ? styles.inputContainerRTL\n : styles.inputContainer;\n return (\n <div className={classNames(containerClassName, formClassName)}>\n {rightToLeftOrientation ? (\n <>\n <input\n className={classNames(\n error ? styles.inputErrorRTL : styles.inputRTL,\n inputClassName,\n )}\n id='sc-input'\n onChange={onSearchInputChange}\n placeholder={placeholderValue}\n type='text'\n value={query}\n />\n {inputCaptionValue && (\n <InputCaption\n inputCaptionClassName={inputCaptionClassName}\n inputCaptionValue={inputCaptionValue}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n )}\n {query.length > 0 && (\n <ClearInputButton\n isRequesting={isRequesting}\n onClearInput={onClearInput}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n )}\n <InputIcon\n error={error}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n </>\n ) : (\n <>\n <input\n className={classNames(\n error ? styles.inputError : styles.input,\n inputClassName,\n )}\n id='sc-input'\n onChange={onSearchInputChange}\n placeholder={placeholderValue}\n type='text'\n value={query}\n />\n {inputCaptionValue && (\n <InputCaption\n inputCaptionClassName={inputCaptionClassName}\n inputCaptionValue={inputCaptionValue}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n )}\n {query.length > 0 && (\n <ClearInputButton\n onClearInput={onClearInput}\n isRequesting={isRequesting}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n )}\n <InputIcon error={error} />\n </>\n )}\n </div>\n );\n};\n","import type { FC } from 'react';\nimport classNames from 'classnames';\n\nimport styles from '@styles/sc-input-label.module.scss';\n\ntype InputLabelProps = {\n className?: string;\n label: string;\n};\n\nexport const InputLabel: FC<InputLabelProps> = ({\n className,\n label = 'Enter Search',\n}) => {\n return (\n <label className={classNames(styles.label, className)} htmlFor='sc-input'>\n {label}\n </label>\n );\n};\n","import { useState, type FC } from 'react';\n\nimport { useSearchcraft } from '@components/providers/SearchcraftProvider';\nimport styles from '@styles/sc-search-form.module.scss';\n\nimport { Button } from '../components/Button';\nimport { ErrorMessage } from '../components/ErrorMessage';\nimport { Input } from '../components/Input';\nimport { InputLabel } from '../components/InputLabel';\n\ninterface BaseSearchFormProps {\n errorMessage?: string;\n handleSubmit: (query: string) => void;\n labelForInput?: string;\n placeholderValue?: string;\n rightToLeftOrientation?: boolean;\n}\n\n/**\n * * Form used to submit the search query using a provided search function.\n */\nexport const BaseSearchForm: FC<BaseSearchFormProps> = ({\n errorMessage,\n handleSubmit,\n labelForInput = 'Search',\n placeholderValue = 'Enter Search Term',\n rightToLeftOrientation = false,\n}) => {\n const { query, isRequesting, setQuery } = useSearchcraft();\n const [error, setError] = useState<boolean>(false);\n\n const handleFormSubmit = (e: { preventDefault: () => void }) => {\n e.preventDefault();\n if (query.trim() === '') {\n setError(true);\n } else {\n setError(false);\n handleSubmit(query);\n }\n };\n\n const handleSearchInputChange = (event: { target: { value: string } }) =>\n setQuery(event.target.value);\n\n const handleClearInput = () => setQuery('');\n\n return (\n <form\n className={rightToLeftOrientation ? styles.formRTL : styles.formLTR}\n onSubmit={handleFormSubmit}\n >\n <InputLabel label={labelForInput} />\n <div className={styles.searchContainer}>\n {rightToLeftOrientation && <Button isRequesting={isRequesting} />}\n <Input\n error={error}\n onClearInput={handleClearInput}\n onSearchInputChange={handleSearchInputChange}\n placeholderValue={placeholderValue}\n query={query}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n {!rightToLeftOrientation && <Button isRequesting={isRequesting} />}\n </div>\n {error && <ErrorMessage errorMessage={errorMessage} />}\n </form>\n );\n};\n","import { useState, type FC, useEffect, type ChangeEventHandler } from 'react';\n\nimport { useSearchcraft } from '@components/providers/SearchcraftProvider';\nimport styles from '@styles/sc-search-form.module.scss';\n\nimport { Input } from '../components/Input';\nimport { InputLabel } from '../components/InputLabel';\n\ninterface AutoSearchFormProps {\n handleSubmit: (query: string) => void;\n inputCaptionValue?: string;\n labelForInput?: string;\n onClearedInput?: () => void;\n placeholderValue?: string;\n rightToLeftOrientation?: boolean;\n}\n/**\n * * Buttonless form used to submit the search query with a timing configurable debounced function.\n */\nexport const AutoSearchForm: FC<AutoSearchFormProps> = ({\n handleSubmit,\n inputCaptionValue = '',\n labelForInput = 'Search',\n onClearedInput = () => {},\n placeholderValue = 'Search here',\n rightToLeftOrientation = false,\n}) => {\n const { isRequesting, query, setQuery } = useSearchcraft();\n const [canSearch, setCanSearch] = useState<boolean>(false);\n\n const handleSearchInputChange: ChangeEventHandler<HTMLInputElement> = (\n event,\n ) => {\n event.preventDefault();\n setQuery(event.currentTarget.value);\n if (query !== event.currentTarget.value) {\n setCanSearch(true);\n }\n };\n\n /**\n * * Exposes a callback for convenience when the input's value is cleared by the user\n */\n const handleClearInput = () => {\n setQuery('');\n onClearedInput();\n };\n\n /**\n * * Delay the submit function until the user is done typing to throttle API usage.\n */\n useEffect(() => {\n if (canSearch) {\n handleSubmit(query);\n setCanSearch(false);\n } else {\n return;\n }\n }, [canSearch, handleSubmit, query]);\n\n return (\n <form\n className={rightToLeftOrientation ? styles.formRTL : styles.formLTR}\n onSubmit={(e) => {\n e.preventDefault();\n }}\n >\n <InputLabel label={labelForInput} />\n <div className={styles.searchContainer}>\n <Input\n inputCaptionValue={inputCaptionValue}\n isRequesting={isRequesting}\n onClearInput={handleClearInput}\n onSearchInputChange={handleSearchInputChange}\n placeholderValue={placeholderValue}\n query={query}\n rightToLeftOrientation={rightToLeftOrientation}\n />\n </div>\n </form>\n );\n};\n","export const ButtonIcon = () => (\n <svg width='20' height='20' viewBox='0 0 20 20' fill='none'>\n <title>Searchcraft Button Icon</title>\n <path\n d='M2.725 5.79959L10 10.0079L17.275 5.79959M10 18.3996V9.99959M17.5 13.3329V6.66626C17.4997 6.37399 17.4225 6.08693 17.2763 5.8339C17.13 5.58086 16.9198 5.37073 16.6667 5.22459L10.8333 1.89126C10.58 1.74498 10.2926 1.66797 10 1.66797C9.70744 1.66797 9.42003 1.74498 9.16667 1.89126L3.33333 5.22459C3.08022 5.37073 2.86998 5.58086 2.72372 5.8339C2.57745 6.08693 2.5003 6.37399 2.5 6.66626V13.3329C2.5003 13.6252 2.57745 13.9123 2.72372 14.1653C2.86998 14.4183 3.08022 14.6285 3.33333 14.7746L9.16667 18.1079C9.42003 18.2542 9.70744 18.3312 10 18.3312C10.2926 18.3312 10.58 18.2542 10.8333 18.1079L16.6667 14.7746C16.9198 14.6285 17.13 14.4183 17.2763 14.1653C17.4225 13.9123 17.4997 13.6252 17.5 13.3329Z'\n stroke='white'\n strokeWidth='1.5'\n strokeLinecap='round'\n strokeLinejoin='round'\n />\n </svg>\n);\n","import type { FC } from 'react';\n\nimport { ButtonIcon } from '../assets/ButtonIcons';\n\nimport styles from '@styles/sc-search-result.module.scss';\nimport { ArrowRightIcon } from '../assets/ClearInputIcon';\n\ninterface BaseSearchResultProps {\n buttonCallbackFn?: () => void;\n buttonLabel?: string;\n imageAltText?: string;\n imageSrc?: string;\n interactiveResult?: boolean;\n callbackFn?: () => void;\n keyDownCallbackFn?: () => void;\n resultBodyContent?: string;\n resultHeading?: string;\n resultSubheading?: string;\n}\n\nexport const BaseSearchResult: FC<BaseSearchResultProps> = ({\n buttonCallbackFn = () => {},\n buttonLabel = '',\n callbackFn = () => {},\n keyDownCallbackFn = () => {},\n imageAltText = '',\n interactiveResult = false,\n imageSrc = '',\n resultBodyContent = '',\n resultHeading = '',\n resultSubheading = '',\n}) => {\n const buttonFn = (event: { stopPropagation: () => void }) => {\n event.stopPropagation();\n buttonCallbackFn();\n };\n\n const callbackFunc = () => {\n if (interactiveResult) {\n callbackFn();\n } else {\n return;\n }\n };\n\n return (\n <div\n className={\n interactiveResult\n ? styles.interactiveResultContainer\n : styles.resultContainer\n }\n id='searchcraft-item'\n onClick={callbackFunc}\n onKeyDown={keyDownCallbackFn}\n >\n {interactiveResult && (\n <div className={styles.interactiveIconLarge}>\n <ArrowRightIcon />\n </div>\n )}\n <div className={styles.imageContainer}>\n <img alt={imageAltText} className={styles.image} src={imageSrc} />\n </div>\n <div className={styles.contentContainer}>\n <h2 className={styles.heading}>\n {resultHeading}{' '}\n {interactiveResult && (\n <div className={styles.interactiveIconSmall}>\n <ArrowRightIcon />\n </div>\n )}\n </h2>\n <h3 className={styles.subheading}>{resultSubheading}</h3>\n <p className={styles.bodyContent}>{resultBodyContent}</p>\n <button className={styles.button} onClick={buttonFn} type='button'>\n <ButtonIcon />\n <span>{buttonLabel}</span>\n </button>\n </div>\n </div>\n );\n};\n"],"names":["h","c","e","t","n","l","s","i","o","defaultContext","query","SearchcraftContext","React","SearchcraftProvider","children","config","core","useMemo","CoreSDK","setIsRequesting","setQuery","useState","isRequesting","providerContext","useSearchcraft","useContext","hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","SpinnerLight","jsx","styles","SpinnerDark","Button","className","iconElement","iconOnly","iconPosition","label","onClick","jsxs","Fragment","ErrorMessage","errorMessage","InputCaption","error","inputCaptionClassName","inputCaptionValue","rightToLeftOrientation","SearchIcon","SearchIconError","InputIcon","ClearInputIcon","ArrowRightIcon","ClearInputButton","isAutoSearch","onClearInput","Input","formClassName","inputClassName","onSearchInputChange","placeholderValue","containerClassName","InputLabel","BaseSearchForm","handleSubmit","labelForInput","setError","handleFormSubmit","handleSearchInputChange","event","handleClearInput","AutoSearchForm","onClearedInput","canSearch","setCanSearch","useEffect","ButtonIcon","BaseSearchResult","buttonCallbackFn","buttonLabel","callbackFn","keyDownCallbackFn","imageAltText","interactiveResult","imageSrc","resultBodyContent","resultHeading","resultSubheading","buttonFn","callbackFunc"],"mappings":";;AAAA,IAAIA,IAAI,OAAO,gBACXC,IAAI,CAACC,GAAGC,GAAG,MAAMA,KAAKD,IAAIF,EAAEE,GAAGC,GAAG,EAAE,YAAY,IAAI,cAAc,IAAI,UAAU,IAAI,OAAO,EAAC,CAAE,IAAID,EAAEC,CAAC,IAAI,GACzGC,IAAI,CAACF,GAAGC,GAAG,MAAMF,EAAEC,GAAG,OAAOC,KAAK,WAAWA,IAAI,KAAKA,GAAG,CAAC;AAC9D,MAAME,EAAE;AAAA,EACN,YAAYF,GAAG;AA8Bb,QA7BAC,EAAE,MAAM,QAAQ,GAChBA,EAAE,MAAM,cAAc,GAMtBA,EAAE,MAAM,UAAU,OAAOD,GAAGG,MAAM;AAChC,UAAI;AACF,aAAK,OAAO;AACZ,cAAMC,IAAI,wBAAwB,KAAK,OAAO,YAAY,IAAI,IAAI;AAAA,UAChE,OAAOJ;AAAA,UACP,MAAMG;AAAA,UACN,KAAK,KAAK,OAAO;AAAA,QAClB,GAAE,IAAI;AAAA,UACL,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,gBAAgB;AAAA,YAChB,eAAe,GAAG,KAAK,OAAO,MAAM;AAAA,UACrC;AAAA,UACD,MAAM,KAAK,UAAU,CAAC;AAAA,QAChC,GAAWE,IAAI,OAAO,MAAM,MAAMD,GAAG,CAAC,GAAG;AACjC,eAAO,KAAK,eAAeC,EAAE,MAAMA;AAAA,MACpC,SAAQD,GAAG;AACV,e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kBuD,GAAA;AAAA,UACrD,gBAAA9C,EAAC,YAAO,WAAWT,EAAO,QAAQ,SAAS0D,GAAU,MAAK,UACxD,UAAA;AAAA,YAAA,gBAAA3D,EAAC+C,IAAW,EAAA;AAAA,YACZ,gBAAA/C,EAAC,UAAM,UAAYkD,EAAA,CAAA;AAAA,UAAA,GACrB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[3]}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._formLTR_dvuqa_5{text-align:left}._formRTL_dvuqa_9{text-align:right}._searchContainer_dvuqa_13{align-items:center;display:flex}._spinnerContainer_1noam_1{background-color:transparent;height:20px;width:20px}._spinnerDark_1noam_7{height:100%;width:100%;background:conic-gradient(#000 50%,#fff);clip-path:circle(50%);-webkit-mask-image:radial-gradient(circle at center,#0000 6.6666666667px,#000 6.6666666667px);mask-image:radial-gradient(circle at center,#0000 6.6666666667px,#000 6.6666666667px);animation:_spinning_1noam_1 1s linear infinite}._spinnerLight_1noam_16{height:100%;width:100%;background:conic-gradient(#737373 50%,#fff);clip-path:circle(50%);-webkit-mask-image:radial-gradient(circle at center,#0000 6.6666666667px,#000 6.6666666667px);mask-image:radial-gradient(circle at center,#0000 6.6666666667px,#000 6.6666666667px);animation:_spinning_1noam_1 1s linear infinite}@keyframes _spinning_1noam_1{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}._button_8jqm2_5{background-color:#000;border:1px solid #E6E6E6;border-radius:8px;color:#fff;display:flex;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;padding:11px 20px;position:relative}._button_8jqm2_5:hover{background-color:#2e2e2e;cursor:pointer}._button_8jqm2_5:focus{outline:2px solid #000000}._spinnerMarginRight_8jqm2_26{margin-right:4px;position:absolute;left:4px}._spinnerMarginLeft_8jqm2_32{margin-left:4px;position:absolute;left:4px}._buttonLabel_8jqm2_38{animation:_rightandback_8jqm2_1 .2s;position:relative}@keyframes _rightandback_8jqm2_1{0%{right:-6px}50%{right:-12px}75%{right:-6px}to{right:0}}._errorMessage_12dc9_5{color:#900;font-family:var(--font-stack);font-size:12px;line-height:16px;margin-bottom:4px;margin-top:4px}._inputCaption_hmjqk_5{color:#404040;font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px}._inputCaptionError_hmjqk_14{color:#404040;font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#900}._inputCaptionRTL_hmjqk_24{color:#404040;font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;text-align:right}._inputCaptionErrorRTL_hmjqk_34{color:#404040;font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#900;text-align:right}._inputIcon_101v2_5{height:20px;left:10px;position:absolute;top:11px;width:20px}._inputIconRTL_101v2_13{height:20px;position:absolute;right:10px;top:11px;width:20px}._inputClearButton_xi5sa_5{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:25px;top:11px;width:20px}._inputClearButtonRTL_xi5sa_19{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:25px;padding:0;position:absolute;top:11px;width:20px}._inputContainer_17hag_5{position:relative}._inputContainerRTL_17hag_9{position:relative;margin-left:8px}._input_17hag_5{background-color:#ededed;border:none;border-radius:8px;font-family:var(--font-stack);outline:none;margin-right:8px;padding:15px 16px 15px 36px}._input_17hag_5::placeholder{color:#737373;font-family:var(--font-stack);font-size:16px}._input_17hag_5:focus{outline:2px solid #000000}._inputRTL_17hag_35{background-color:#ededed;border:none;border-radius:8px;font-family:var(--font-stack);outline:none;margin-left:8px;padding:15px 36px 15px 16px;text-align:right}._inputRTL_17hag_35::placeholder{color:#737373;font-family:var(--font-stack);font-size:16px}._inputRTL_17hag_35:focus{outline:2px solid #000000}._inputError_17hag_57{background-color:#ededed;border:none;border-radius:8px;font-family:var(--font-stack);outline:none;outline:2px solid #c00;margin-right:8px;padding:15px 16px 15px 36px}._inputError_17hag_57::placeholder{color:#737373;font-family:var(--font-stack);font-size:16px}._inputError_17hag_57:focus{outline:2px solid #000000}._inputError_17hag_57:focus-visible{outline:2px solid #c00}._inputErrorRTL_17hag_82{background-color:#ededed;border:none;border-radius:8px;font-family:var(--font-stack);outline:none;outline:2px solid #c00;margin-left:8px;padding:15px 36px 15px 16px;text-align:right}._inputErrorRTL_17hag_82::placeholder{color:#737373;font-family:var(--font-stack);font-size:16px}._inputErrorRTL_17hag_82:focus{outline:2px solid #000000}._inputErrorRTL_17hag_82:focus-visible{outline:2px solid #c00}._label_1euwf_5{color:#292929;font-family:var(--font-stack);font-size:12px;font-weight:700;line-height:16px;margin-bottom:4px}:root{--font-stack: Helvetica, Arial, sans-serif}._resultContainer_10d68_5{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){._resultContainer_10d68_5{flex-direction:row}}._interactiveResultContainer_10d68_17{align-items:flex-start;background-color:#fafafa;border-radius:16px;display:flex;position:relative;flex-direction:column;gap:16px;padding:8px}@media (min-width: 600px){._interactiveResultContainer_10d68_17{flex-direction:row}}._interactiveIconLarge_10d68_33{position:absolute;right:5px;top:8px;display:inline-block}@media (max-width: 600px){._interactiveIconLarge_10d68_33{display:none}}._interactiveIconSmall_10d68_45{position:absolute;right:5px;top:-2px;display:inline-block}@media (min-width: 600px){._interactiveIconSmall_10d68_45{display:none}}._imageContainer_10d68_57{max-height:540px;max-width:100%}@media (min-width: 600px){._imageContainer_10d68_57{max-height:100%;max-width:50%}}._contentContainer_10d68_68{max-height:100%;max-width:100%}@media (min-width: 600px){._contentContainer_10d68_68{max-width:50%}}._image_10d68_57{aspect-ratio:2/1;border-radius:8px;border:1px solid #D9D9D9;max-height:100%;max-width:100%}._heading_10d68_86{color:#292929;font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative}._subheading_10d68_97{color:#737373;font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0}._bodyContent_10d68_107{color:#404040;font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-top:0;margin-bottom:4px}._button_10d68_117{background-color:#000;border:1px solid #E6E6E6;border-radius:8px;color:#fff;display:flex;font-weight:700;line-height:20px;padding:10px 20px;margin-top:16px}._button_10d68_117 span{margin-left:4px}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@searchcraft/react-sdk",
|
|
3
|
+
"private": false,
|
|
4
|
+
"author": "Searchcraft",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "SearchCraft's React SDK.",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc && vite build",
|
|
11
|
+
"lint": "biome format lint ./src",
|
|
12
|
+
"test": "vitest --watch=false",
|
|
13
|
+
"test:watch": "vitest"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0",
|
|
21
|
+
"npm": ">=10.0.0"
|
|
22
|
+
},
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
26
|
+
"files": ["dist/**/*"],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"classnames": "^2.3.2"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^18.3.1",
|
|
35
|
+
"react-dom": "^18.3.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@biomejs/biome": "^1.8.1",
|
|
39
|
+
"@searchcraft-sdk/core": "*",
|
|
40
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
41
|
+
"@testing-library/react": "^14.2.1",
|
|
42
|
+
"@types/node": "^20.11.25",
|
|
43
|
+
"@types/react": "^18.3.3",
|
|
44
|
+
"@types/react-dom": "^18.3.0",
|
|
45
|
+
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
46
|
+
"jsdom": "^24.0.0",
|
|
47
|
+
"react": "^18.3.1",
|
|
48
|
+
"react-dom": "^18.3.1",
|
|
49
|
+
"sass": "^1.56.1",
|
|
50
|
+
"typescript": "^5.5.3",
|
|
51
|
+
"vite": "^5.4.1",
|
|
52
|
+
"vite-plugin-dts": "^3.7.3",
|
|
53
|
+
"vitest": "^1.3.1"
|
|
54
|
+
}
|
|
55
|
+
}
|