@searchcraft/react-sdk 0.1.1 → 0.1.3
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/README.md +59 -19
- package/dist/index.d.ts +29 -7
- package/dist/index.js +434 -355
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import K, { useContext as J, useState as T, useMemo as H, useEffect as z } from "react";
|
|
3
|
+
var V = Object.defineProperty, X = (n, e, o) => e in n ? V(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, E = (n, e, o) => X(n, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
class et {
|
|
5
5
|
constructor(e) {
|
|
6
|
-
if (
|
|
6
|
+
if (E(this, "config"), E(this, "search", async (o) => {
|
|
7
7
|
try {
|
|
8
|
-
const i = this.config.index.join(","),
|
|
9
|
-
query:
|
|
10
|
-
mode:
|
|
11
|
-
app:
|
|
8
|
+
const i = this.config.index.join(","), c = `${this.config.endpointURL}/search`, r = {
|
|
9
|
+
query: o.query,
|
|
10
|
+
mode: o.mode,
|
|
11
|
+
app: i
|
|
12
12
|
}, a = {
|
|
13
13
|
method: "POST",
|
|
14
14
|
headers: {
|
|
15
15
|
"Content-Type": "application/json",
|
|
16
|
-
"Access-Control-Allow-Origin": "*",
|
|
17
16
|
Authorization: this.config.apiKey ? `${this.config.apiKey}` : ""
|
|
18
17
|
},
|
|
19
18
|
body: JSON.stringify(r)
|
|
20
19
|
};
|
|
21
|
-
return await (await fetch(
|
|
20
|
+
return await (await fetch(c, a)).json();
|
|
22
21
|
} catch (i) {
|
|
23
22
|
return i;
|
|
24
23
|
}
|
|
@@ -27,54 +26,112 @@ class Jn {
|
|
|
27
26
|
this.config = e;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
|
|
29
|
+
var _ = /* @__PURE__ */ ((n) => (n[n.DEBUG = 0] = "DEBUG", n[n.INFO = 1] = "INFO", n[n.WARN = 2] = "WARN", n[n.ERROR = 3] = "ERROR", n))(_ || {});
|
|
30
|
+
class Y {
|
|
31
|
+
constructor(e) {
|
|
32
|
+
E(this, "logLevel"), E(this, "logFormatter"), this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
|
|
33
|
+
}
|
|
34
|
+
defaultFormatter(e, o) {
|
|
35
|
+
return `[${_[e]}] ${(/* @__PURE__ */ new Date()).toISOString()}: ${o}`;
|
|
36
|
+
}
|
|
37
|
+
debug(e) {
|
|
38
|
+
this.logLevel <= 0 && console.log(this.logFormatter(0, e));
|
|
39
|
+
}
|
|
40
|
+
info(e) {
|
|
41
|
+
this.logLevel <= 1 && console.info(this.logFormatter(1, e));
|
|
42
|
+
}
|
|
43
|
+
warn(e) {
|
|
44
|
+
this.logLevel <= 2 && console.warn(this.logFormatter(2, e));
|
|
45
|
+
}
|
|
46
|
+
error(e) {
|
|
47
|
+
this.logLevel <= 3 && console.error(this.logFormatter(3, e));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const nn = {
|
|
31
51
|
error: null,
|
|
32
52
|
index: [""],
|
|
33
53
|
isRequesting: !1,
|
|
34
54
|
mode: "fuzzy",
|
|
35
55
|
query: "",
|
|
36
|
-
setQuery: (
|
|
56
|
+
setQuery: (n) => n,
|
|
37
57
|
search: async () => null
|
|
38
|
-
},
|
|
39
|
-
children:
|
|
40
|
-
searchcraft: e
|
|
58
|
+
}, G = K.createContext(nn), tn = ({
|
|
59
|
+
children: n,
|
|
60
|
+
searchcraft: e,
|
|
61
|
+
debug: o = !1
|
|
41
62
|
}) => {
|
|
42
|
-
const [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
const [i, c] = T(""), [r, a] = T(!1), [l, s] = T(null), u = H(() => o ? new Y({ logLevel: _.DEBUG }) : null, [o]), p = (f, R) => {
|
|
64
|
+
if (u)
|
|
65
|
+
switch (f) {
|
|
66
|
+
case _.DEBUG:
|
|
67
|
+
u.debug(R);
|
|
68
|
+
break;
|
|
69
|
+
case _.INFO:
|
|
70
|
+
u.info(R);
|
|
71
|
+
break;
|
|
72
|
+
case _.WARN:
|
|
73
|
+
u.warn(R);
|
|
74
|
+
break;
|
|
75
|
+
case _.ERROR:
|
|
76
|
+
u.error(R);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}, L = async () => {
|
|
80
|
+
p(_.INFO, `Starting search with query: "${i}"`), a(!0);
|
|
81
|
+
try {
|
|
82
|
+
const f = await e.search({ query: i, mode: "fuzzy" });
|
|
83
|
+
s(f), p(_.DEBUG, `Search results: ${JSON.stringify(f)}`);
|
|
84
|
+
} catch (f) {
|
|
85
|
+
p(
|
|
86
|
+
_.ERROR,
|
|
87
|
+
`Search failed with error: ${f.message}`
|
|
88
|
+
);
|
|
89
|
+
} finally {
|
|
90
|
+
a(!1);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
z(() => (p(_.INFO, "SearchcraftProvider mounted."), () => {
|
|
94
|
+
p(_.INFO, "SearchcraftProvider unmounted.");
|
|
95
|
+
}), [u]);
|
|
96
|
+
const g = {
|
|
47
97
|
error: null,
|
|
48
98
|
index: e.config.index,
|
|
49
|
-
isRequesting:
|
|
99
|
+
isRequesting: r,
|
|
50
100
|
mode: "fuzzy",
|
|
51
|
-
query:
|
|
52
|
-
search:
|
|
53
|
-
searchResults:
|
|
54
|
-
setQuery:
|
|
101
|
+
query: i,
|
|
102
|
+
search: L,
|
|
103
|
+
searchResults: l,
|
|
104
|
+
setQuery: c
|
|
55
105
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
return /* @__PURE__ */ t(G.Provider, { value: g, children: n });
|
|
107
|
+
}, I = () => {
|
|
108
|
+
const n = J(G);
|
|
109
|
+
if (!n)
|
|
110
|
+
throw new Error(
|
|
111
|
+
"Searchcraft compound components must be used within Searchcraft.Provider"
|
|
112
|
+
);
|
|
113
|
+
return n;
|
|
114
|
+
}, en = "_formLTR_dvuqa_5", rn = "_formRTL_dvuqa_9", on = "_searchContainer_dvuqa_13", v = {
|
|
115
|
+
formLTR: en,
|
|
116
|
+
formRTL: rn,
|
|
117
|
+
searchContainer: on
|
|
61
118
|
};
|
|
62
|
-
function
|
|
63
|
-
return
|
|
119
|
+
function an(n) {
|
|
120
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
64
121
|
}
|
|
65
|
-
var
|
|
122
|
+
var Q = { exports: {} };
|
|
66
123
|
/*!
|
|
67
124
|
Copyright (c) 2018 Jed Watson.
|
|
68
125
|
Licensed under the MIT License (MIT), see
|
|
69
126
|
http://jedwatson.github.io/classnames
|
|
70
127
|
*/
|
|
71
|
-
(function(
|
|
128
|
+
(function(n) {
|
|
72
129
|
(function() {
|
|
73
130
|
var e = {}.hasOwnProperty;
|
|
74
|
-
function
|
|
131
|
+
function o() {
|
|
75
132
|
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
76
133
|
var l = arguments[a];
|
|
77
|
-
l && (r =
|
|
134
|
+
l && (r = c(r, i(l)));
|
|
78
135
|
}
|
|
79
136
|
return r;
|
|
80
137
|
}
|
|
@@ -84,98 +141,34 @@ var D = { exports: {} };
|
|
|
84
141
|
if (typeof r != "object")
|
|
85
142
|
return "";
|
|
86
143
|
if (Array.isArray(r))
|
|
87
|
-
return
|
|
144
|
+
return o.apply(null, r);
|
|
88
145
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
89
146
|
return r.toString();
|
|
90
147
|
var a = "";
|
|
91
148
|
for (var l in r)
|
|
92
|
-
e.call(r, l) && r[l] && (a =
|
|
149
|
+
e.call(r, l) && r[l] && (a = c(a, l));
|
|
93
150
|
return a;
|
|
94
151
|
}
|
|
95
|
-
function
|
|
152
|
+
function c(r, a) {
|
|
96
153
|
return a ? r ? r + " " + a : r + a : r;
|
|
97
154
|
}
|
|
98
|
-
|
|
155
|
+
n.exports ? (o.default = o, n.exports = o) : window.classNames = o;
|
|
99
156
|
})();
|
|
100
|
-
})(
|
|
101
|
-
var
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
iconElement: e,
|
|
116
|
-
iconOnly: s = !1,
|
|
117
|
-
iconPosition: i = "left",
|
|
118
|
-
label: o = "Search",
|
|
119
|
-
onClick: r
|
|
120
|
-
}) => {
|
|
121
|
-
const { isRequesting: a } = v();
|
|
122
|
-
return /* @__PURE__ */ u(k, { children: [
|
|
123
|
-
s && /* @__PURE__ */ n(
|
|
124
|
-
"button",
|
|
125
|
-
{
|
|
126
|
-
className: p(
|
|
127
|
-
b.button,
|
|
128
|
-
t,
|
|
129
|
-
".searchcraft-button"
|
|
130
|
-
),
|
|
131
|
-
onClick: r,
|
|
132
|
-
type: "submit",
|
|
133
|
-
children: a ? /* @__PURE__ */ n(I, {}) : e
|
|
134
|
-
}
|
|
135
|
-
),
|
|
136
|
-
!s && /* @__PURE__ */ u(
|
|
137
|
-
"button",
|
|
138
|
-
{
|
|
139
|
-
className: p(
|
|
140
|
-
b.button,
|
|
141
|
-
t,
|
|
142
|
-
".searchcraft-button"
|
|
143
|
-
),
|
|
144
|
-
onClick: r,
|
|
145
|
-
type: "submit",
|
|
146
|
-
children: [
|
|
147
|
-
i === "left" && a ? /* @__PURE__ */ n("div", { className: b.spinnerMarginRight, children: /* @__PURE__ */ n(I, {}) }) : e,
|
|
148
|
-
/* @__PURE__ */ n(
|
|
149
|
-
"span",
|
|
150
|
-
{
|
|
151
|
-
className: p(
|
|
152
|
-
a && b.buttonLabel,
|
|
153
|
-
t,
|
|
154
|
-
".searchcraft-button-label"
|
|
155
|
-
),
|
|
156
|
-
children: o
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
i === "right" && a ? /* @__PURE__ */ n("div", { className: b.spinnerMarginLeft, children: /* @__PURE__ */ n(I, {}) }) : e
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
] });
|
|
164
|
-
}, un = "_errorMessage_12dc9_5", pn = {
|
|
165
|
-
errorMessage: un
|
|
166
|
-
}, hn = ({ className: t, errorMessage: e }) => /* @__PURE__ */ n("p", { className: p(pn.errorMessage, t), children: e || "Search term is required." }), dn = "_inputContainerLTR_s1rq8_5", _n = "_inputContainerRTL_s1rq8_9", Cn = "_inputLTR_s1rq8_14", fn = "_inputRTL_s1rq8_35", mn = "_inputErrorLTR_s1rq8_57", Ln = "_inputErrorRTL_s1rq8_82", m = {
|
|
167
|
-
inputContainerLTR: dn,
|
|
168
|
-
inputContainerRTL: _n,
|
|
169
|
-
inputLTR: Cn,
|
|
170
|
-
inputRTL: fn,
|
|
171
|
-
inputErrorLTR: mn,
|
|
172
|
-
inputErrorRTL: Ln
|
|
173
|
-
}, Rn = "_inputClearButtonLTR_t63ei_5", bn = "_inputClearButtonRTL_t63ei_19", E = {
|
|
174
|
-
inputClearButtonLTR: Rn,
|
|
175
|
-
inputClearButtonRTL: bn
|
|
176
|
-
}, M = () => /* @__PURE__ */ u("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
177
|
-
/* @__PURE__ */ n("title", { children: "Searchcraft Clear Input Icon" }),
|
|
178
|
-
/* @__PURE__ */ n(
|
|
157
|
+
})(Q);
|
|
158
|
+
var sn = Q.exports;
|
|
159
|
+
const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inputContainerRTL_s1rq8_9", un = "_inputLTR_s1rq8_14", hn = "_inputRTL_s1rq8_35", pn = "_inputErrorLTR_s1rq8_57", dn = "_inputErrorRTL_s1rq8_82", b = {
|
|
160
|
+
inputContainerLTR: cn,
|
|
161
|
+
inputContainerRTL: ln,
|
|
162
|
+
inputLTR: un,
|
|
163
|
+
inputRTL: hn,
|
|
164
|
+
inputErrorLTR: pn,
|
|
165
|
+
inputErrorRTL: dn
|
|
166
|
+
}, fn = "_inputClearButtonLTR_t63ei_5", _n = "_inputClearButtonRTL_t63ei_19", P = {
|
|
167
|
+
inputClearButtonLTR: fn,
|
|
168
|
+
inputClearButtonRTL: _n
|
|
169
|
+
}, O = () => /* @__PURE__ */ h("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
170
|
+
/* @__PURE__ */ t("title", { children: "Searchcraft Clear Input Icon" }),
|
|
171
|
+
/* @__PURE__ */ t(
|
|
179
172
|
"path",
|
|
180
173
|
{
|
|
181
174
|
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",
|
|
@@ -185,9 +178,9 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
185
178
|
strokeLinejoin: "round"
|
|
186
179
|
}
|
|
187
180
|
)
|
|
188
|
-
] }),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
181
|
+
] }), U = () => /* @__PURE__ */ h("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", children: [
|
|
182
|
+
/* @__PURE__ */ t("title", { children: "Searchcraft Arrow Right Icon" }),
|
|
183
|
+
/* @__PURE__ */ t(
|
|
191
184
|
"path",
|
|
192
185
|
{
|
|
193
186
|
d: "M7.5 15.0444L12.5 10.0444L7.5 5.04443",
|
|
@@ -197,68 +190,73 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
197
190
|
strokeLinejoin: "round"
|
|
198
191
|
}
|
|
199
192
|
)
|
|
200
|
-
] }),
|
|
201
|
-
|
|
193
|
+
] }), mn = "_spinnerContainer_1noam_1", Cn = "_spinnerDark_1noam_7", Ln = "_spinning_1noam_1", gn = "_spinnerLight_1noam_16", w = {
|
|
194
|
+
spinnerContainer: mn,
|
|
195
|
+
spinnerDark: Cn,
|
|
196
|
+
spinning: Ln,
|
|
197
|
+
spinnerLight: gn
|
|
198
|
+
}, W = () => /* @__PURE__ */ t("div", { className: w.spinnerContainer, children: /* @__PURE__ */ t("div", { className: w.spinnerLight }) }), B = () => /* @__PURE__ */ t("div", { className: w.spinnerContainer, children: /* @__PURE__ */ t("div", { className: w.spinnerDark }) }), M = ({
|
|
199
|
+
onClearInput: n,
|
|
202
200
|
rightToLeftOrientation: e = !1
|
|
203
201
|
}) => {
|
|
204
|
-
const { isRequesting:
|
|
205
|
-
return e ? /* @__PURE__ */
|
|
202
|
+
const { isRequesting: o } = I();
|
|
203
|
+
return e ? /* @__PURE__ */ t(
|
|
206
204
|
"button",
|
|
207
205
|
{
|
|
208
|
-
className:
|
|
209
|
-
|
|
206
|
+
className: d(
|
|
207
|
+
P.inputClearButtonRTL,
|
|
210
208
|
".sc-clear-input-button-rtl"
|
|
211
209
|
),
|
|
212
|
-
onClick:
|
|
210
|
+
onClick: n,
|
|
213
211
|
type: "button",
|
|
214
|
-
children:
|
|
212
|
+
children: o ? /* @__PURE__ */ t(W, {}) : /* @__PURE__ */ t(O, {})
|
|
215
213
|
}
|
|
216
|
-
) : /* @__PURE__ */
|
|
214
|
+
) : /* @__PURE__ */ t(
|
|
217
215
|
"button",
|
|
218
216
|
{
|
|
219
|
-
className:
|
|
220
|
-
|
|
217
|
+
className: d(
|
|
218
|
+
P.inputClearButtonLTR,
|
|
221
219
|
".sc-clear-input-button-ltr"
|
|
222
220
|
),
|
|
223
|
-
onClick:
|
|
221
|
+
onClick: n,
|
|
224
222
|
type: "button",
|
|
225
|
-
children:
|
|
223
|
+
children: o ? /* @__PURE__ */ t(W, {}) : /* @__PURE__ */ t(O, {})
|
|
226
224
|
}
|
|
227
225
|
);
|
|
228
|
-
},
|
|
229
|
-
inputCaptionLTR:
|
|
230
|
-
inputCaptionErrorLTR:
|
|
231
|
-
inputCaptionRTL:
|
|
232
|
-
inputCaptionErrorRTL:
|
|
233
|
-
},
|
|
234
|
-
error:
|
|
226
|
+
}, Rn = "_inputCaptionLTR_xoy9r_5", bn = "_inputCaptionErrorLTR_xoy9r_14", vn = "_inputCaptionRTL_xoy9r_24", Sn = "_inputCaptionErrorRTL_xoy9r_34", N = {
|
|
227
|
+
inputCaptionLTR: Rn,
|
|
228
|
+
inputCaptionErrorLTR: bn,
|
|
229
|
+
inputCaptionRTL: vn,
|
|
230
|
+
inputCaptionErrorRTL: Sn
|
|
231
|
+
}, F = ({
|
|
232
|
+
error: n = !1,
|
|
235
233
|
inputCaptionClassName: e,
|
|
236
|
-
inputCaptionValue:
|
|
234
|
+
inputCaptionValue: o = "Enter Search",
|
|
237
235
|
rightToLeftOrientation: i = !1
|
|
238
|
-
}) => i ? /* @__PURE__ */
|
|
236
|
+
}) => i ? /* @__PURE__ */ t(
|
|
239
237
|
"p",
|
|
240
238
|
{
|
|
241
|
-
className:
|
|
242
|
-
|
|
239
|
+
className: d(
|
|
240
|
+
n ? N.inputCaptionErrorRTL : N.inputCaptionRTL,
|
|
243
241
|
e
|
|
244
242
|
),
|
|
245
|
-
children:
|
|
243
|
+
children: o
|
|
246
244
|
}
|
|
247
|
-
) : /* @__PURE__ */
|
|
245
|
+
) : /* @__PURE__ */ t(
|
|
248
246
|
"p",
|
|
249
247
|
{
|
|
250
|
-
className:
|
|
251
|
-
|
|
248
|
+
className: d(
|
|
249
|
+
n ? N.inputCaptionErrorLTR : N.inputCaptionLTR,
|
|
252
250
|
e
|
|
253
251
|
),
|
|
254
|
-
children:
|
|
252
|
+
children: o
|
|
255
253
|
}
|
|
256
|
-
),
|
|
257
|
-
inputIconLTR:
|
|
258
|
-
inputIconRTL:
|
|
259
|
-
},
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
254
|
+
), yn = "_inputIconLTR_cusap_5", Tn = "_inputIconRTL_cusap_13", k = {
|
|
255
|
+
inputIconLTR: yn,
|
|
256
|
+
inputIconRTL: Tn
|
|
257
|
+
}, In = () => /* @__PURE__ */ h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
258
|
+
/* @__PURE__ */ t("title", { children: "Searchcraft Search Icon" }),
|
|
259
|
+
/* @__PURE__ */ t(
|
|
262
260
|
"path",
|
|
263
261
|
{
|
|
264
262
|
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",
|
|
@@ -268,9 +266,9 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
268
266
|
strokeLinejoin: "round"
|
|
269
267
|
}
|
|
270
268
|
)
|
|
271
|
-
] }), Nn = () => /* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
269
|
+
] }), Nn = () => /* @__PURE__ */ h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
270
|
+
/* @__PURE__ */ t("title", { children: "Searchcraft Error Search Icon" }),
|
|
271
|
+
/* @__PURE__ */ t(
|
|
274
272
|
"path",
|
|
275
273
|
{
|
|
276
274
|
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",
|
|
@@ -280,48 +278,48 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
280
278
|
strokeLinejoin: "round"
|
|
281
279
|
}
|
|
282
280
|
)
|
|
283
|
-
] }),
|
|
284
|
-
error:
|
|
281
|
+
] }), q = ({
|
|
282
|
+
error: n = !1,
|
|
285
283
|
rightToLeftOrientation: e = !1
|
|
286
|
-
}) =>
|
|
284
|
+
}) => n ? /* @__PURE__ */ t(
|
|
287
285
|
"div",
|
|
288
286
|
{
|
|
289
|
-
className: e ?
|
|
290
|
-
children: /* @__PURE__ */
|
|
287
|
+
className: e ? k.inputIconRTL : k.inputIconLTR,
|
|
288
|
+
children: /* @__PURE__ */ t(Nn, {})
|
|
291
289
|
}
|
|
292
|
-
) : /* @__PURE__ */
|
|
290
|
+
) : /* @__PURE__ */ t(
|
|
293
291
|
"div",
|
|
294
292
|
{
|
|
295
|
-
className: e ?
|
|
296
|
-
children: /* @__PURE__ */
|
|
293
|
+
className: e ? k.inputIconRTL : k.inputIconLTR,
|
|
294
|
+
children: /* @__PURE__ */ t(In, {})
|
|
297
295
|
}
|
|
298
|
-
),
|
|
299
|
-
error:
|
|
296
|
+
), j = ({
|
|
297
|
+
error: n = !1,
|
|
300
298
|
formClassName: e = "",
|
|
301
|
-
inputCaptionClassName:
|
|
299
|
+
inputCaptionClassName: o = "",
|
|
302
300
|
inputClassName: i = "",
|
|
303
|
-
inputCaptionValue:
|
|
301
|
+
inputCaptionValue: c = "",
|
|
304
302
|
onClearInput: r,
|
|
305
303
|
onSearchInputChange: a,
|
|
306
304
|
placeholderValue: l = "Enter Search",
|
|
307
|
-
rightToLeftOrientation:
|
|
308
|
-
query:
|
|
305
|
+
rightToLeftOrientation: s = !1,
|
|
306
|
+
query: u = ""
|
|
309
307
|
}) => {
|
|
310
|
-
const
|
|
311
|
-
return /* @__PURE__ */
|
|
308
|
+
const p = s ? b.inputContainerRTL : b.inputContainerLTR;
|
|
309
|
+
return /* @__PURE__ */ t(
|
|
312
310
|
"div",
|
|
313
311
|
{
|
|
314
|
-
className:
|
|
315
|
-
|
|
312
|
+
className: d(
|
|
313
|
+
p,
|
|
316
314
|
e,
|
|
317
315
|
"searchcraft-input-form"
|
|
318
316
|
),
|
|
319
|
-
children:
|
|
320
|
-
/* @__PURE__ */
|
|
317
|
+
children: s ? /* @__PURE__ */ h(x, { children: [
|
|
318
|
+
/* @__PURE__ */ t(
|
|
321
319
|
"input",
|
|
322
320
|
{
|
|
323
|
-
className:
|
|
324
|
-
|
|
321
|
+
className: d(
|
|
322
|
+
n ? b.inputErrorRTL : b.inputRTL,
|
|
325
323
|
i,
|
|
326
324
|
"searchcraft-input"
|
|
327
325
|
),
|
|
@@ -329,37 +327,37 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
329
327
|
onChange: a,
|
|
330
328
|
placeholder: l,
|
|
331
329
|
type: "text",
|
|
332
|
-
value:
|
|
330
|
+
value: u
|
|
333
331
|
}
|
|
334
332
|
),
|
|
335
|
-
|
|
336
|
-
|
|
333
|
+
c && /* @__PURE__ */ t(
|
|
334
|
+
F,
|
|
337
335
|
{
|
|
338
|
-
inputCaptionClassName:
|
|
339
|
-
inputCaptionValue:
|
|
340
|
-
rightToLeftOrientation:
|
|
336
|
+
inputCaptionClassName: o,
|
|
337
|
+
inputCaptionValue: c,
|
|
338
|
+
rightToLeftOrientation: s
|
|
341
339
|
}
|
|
342
340
|
),
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
u.length > 0 && /* @__PURE__ */ t(
|
|
342
|
+
M,
|
|
345
343
|
{
|
|
346
344
|
onClearInput: r,
|
|
347
|
-
rightToLeftOrientation:
|
|
345
|
+
rightToLeftOrientation: s
|
|
348
346
|
}
|
|
349
347
|
),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
|
|
348
|
+
/* @__PURE__ */ t(
|
|
349
|
+
q,
|
|
352
350
|
{
|
|
353
|
-
error:
|
|
354
|
-
rightToLeftOrientation:
|
|
351
|
+
error: n,
|
|
352
|
+
rightToLeftOrientation: s
|
|
355
353
|
}
|
|
356
354
|
)
|
|
357
|
-
] }) : /* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
355
|
+
] }) : /* @__PURE__ */ h(x, { children: [
|
|
356
|
+
/* @__PURE__ */ t(
|
|
359
357
|
"input",
|
|
360
358
|
{
|
|
361
|
-
className:
|
|
362
|
-
|
|
359
|
+
className: d(
|
|
360
|
+
n ? b.inputErrorLTR : b.inputLTR,
|
|
363
361
|
i,
|
|
364
362
|
"searchcraft-input"
|
|
365
363
|
),
|
|
@@ -367,128 +365,90 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
367
365
|
onChange: a,
|
|
368
366
|
placeholder: l,
|
|
369
367
|
type: "text",
|
|
370
|
-
value:
|
|
368
|
+
value: u
|
|
371
369
|
}
|
|
372
370
|
),
|
|
373
|
-
|
|
374
|
-
|
|
371
|
+
c && /* @__PURE__ */ t(
|
|
372
|
+
F,
|
|
375
373
|
{
|
|
376
|
-
inputCaptionClassName:
|
|
377
|
-
inputCaptionValue:
|
|
378
|
-
rightToLeftOrientation:
|
|
374
|
+
inputCaptionClassName: o,
|
|
375
|
+
inputCaptionValue: c,
|
|
376
|
+
rightToLeftOrientation: s
|
|
379
377
|
}
|
|
380
378
|
),
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
u.length > 0 && /* @__PURE__ */ t(
|
|
380
|
+
M,
|
|
383
381
|
{
|
|
384
382
|
onClearInput: r,
|
|
385
|
-
rightToLeftOrientation:
|
|
383
|
+
rightToLeftOrientation: s
|
|
386
384
|
}
|
|
387
385
|
),
|
|
388
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ t(q, { error: n })
|
|
389
387
|
] })
|
|
390
388
|
}
|
|
391
389
|
);
|
|
392
|
-
},
|
|
393
|
-
label:
|
|
394
|
-
},
|
|
395
|
-
className:
|
|
390
|
+
}, kn = "_label_1euwf_5", En = {
|
|
391
|
+
label: kn
|
|
392
|
+
}, D = ({
|
|
393
|
+
className: n,
|
|
396
394
|
label: e = "Enter Search"
|
|
397
|
-
}) => /* @__PURE__ */
|
|
395
|
+
}) => /* @__PURE__ */ t(
|
|
398
396
|
"label",
|
|
399
397
|
{
|
|
400
|
-
className:
|
|
398
|
+
className: d(En.label, n),
|
|
401
399
|
htmlFor: "searchcraft-input-id",
|
|
402
400
|
children: e
|
|
403
401
|
}
|
|
404
|
-
),
|
|
405
|
-
|
|
402
|
+
), wn = ({
|
|
403
|
+
autoSearchFormClass: n = "",
|
|
406
404
|
handleSubmit: e,
|
|
407
|
-
|
|
408
|
-
placeholderValue: i = "Enter Search Term",
|
|
409
|
-
rightToLeftOrientation: o = !1
|
|
410
|
-
}) => {
|
|
411
|
-
const { query: r, setQuery: a } = v(), [l, c] = g(!1), h = (C) => {
|
|
412
|
-
C.preventDefault(), r.trim() === "" ? c(!0) : (c(!1), e(r));
|
|
413
|
-
}, _ = (C) => a(C.target.value), f = () => a("");
|
|
414
|
-
return /* @__PURE__ */ u(
|
|
415
|
-
"form",
|
|
416
|
-
{
|
|
417
|
-
className: o ? L.formRTL : L.formLTR,
|
|
418
|
-
onSubmit: h,
|
|
419
|
-
children: [
|
|
420
|
-
/* @__PURE__ */ n(z, { label: s }),
|
|
421
|
-
/* @__PURE__ */ u("div", { className: L.searchContainer, children: [
|
|
422
|
-
o && /* @__PURE__ */ n(w, {}),
|
|
423
|
-
/* @__PURE__ */ n(
|
|
424
|
-
A,
|
|
425
|
-
{
|
|
426
|
-
error: l,
|
|
427
|
-
onClearInput: f,
|
|
428
|
-
onSearchInputChange: _,
|
|
429
|
-
placeholderValue: i,
|
|
430
|
-
query: r,
|
|
431
|
-
rightToLeftOrientation: o
|
|
432
|
-
}
|
|
433
|
-
),
|
|
434
|
-
!o && /* @__PURE__ */ n(w, {})
|
|
435
|
-
] }),
|
|
436
|
-
l && /* @__PURE__ */ n(hn, { errorMessage: t })
|
|
437
|
-
]
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
}, Xn = ({
|
|
441
|
-
autoSearchFormClass: t = "",
|
|
442
|
-
handleSubmit: e,
|
|
443
|
-
inputCaptionValue: s = "",
|
|
405
|
+
inputCaptionValue: o = "",
|
|
444
406
|
labelForInput: i = "Search",
|
|
445
|
-
|
|
407
|
+
onClearInput: c = () => {
|
|
446
408
|
},
|
|
447
409
|
placeholderValue: r = "Search here",
|
|
448
410
|
rightToLeftOrientation: a = !1,
|
|
449
411
|
searchContainerClass: l = ""
|
|
450
412
|
}) => {
|
|
451
|
-
const { query:
|
|
452
|
-
|
|
453
|
-
},
|
|
454
|
-
|
|
413
|
+
const { query: s, setQuery: u } = I(), [p, L] = T(!1), g = a ? v.formRTL : v.formLTR, f = (S) => {
|
|
414
|
+
S.preventDefault(), u(S.currentTarget.value), s !== S.currentTarget.value && L(!0);
|
|
415
|
+
}, R = () => {
|
|
416
|
+
u(""), c();
|
|
455
417
|
};
|
|
456
|
-
|
|
457
|
-
if (
|
|
458
|
-
e(
|
|
418
|
+
return z(() => {
|
|
419
|
+
if (p)
|
|
420
|
+
e(s), L(!1);
|
|
459
421
|
else
|
|
460
422
|
return;
|
|
461
|
-
}, [
|
|
462
|
-
const W = a ? L.formRTL : L.formLTR;
|
|
463
|
-
return /* @__PURE__ */ u(
|
|
423
|
+
}, [p, e, s]), /* @__PURE__ */ h(
|
|
464
424
|
"form",
|
|
465
425
|
{
|
|
466
|
-
className:
|
|
467
|
-
|
|
468
|
-
|
|
426
|
+
className: d(
|
|
427
|
+
g,
|
|
428
|
+
n,
|
|
469
429
|
"searchcraft-auto-search-form"
|
|
470
430
|
),
|
|
471
|
-
onSubmit: (
|
|
472
|
-
|
|
431
|
+
onSubmit: (S) => {
|
|
432
|
+
S.preventDefault();
|
|
473
433
|
},
|
|
474
434
|
children: [
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ t(D, { label: i }),
|
|
436
|
+
/* @__PURE__ */ t(
|
|
477
437
|
"div",
|
|
478
438
|
{
|
|
479
|
-
className:
|
|
480
|
-
|
|
439
|
+
className: d(
|
|
440
|
+
v.searchContainer,
|
|
481
441
|
l,
|
|
482
442
|
"searchcraft-input-container"
|
|
483
443
|
),
|
|
484
|
-
children: /* @__PURE__ */
|
|
485
|
-
|
|
444
|
+
children: /* @__PURE__ */ t(
|
|
445
|
+
j,
|
|
486
446
|
{
|
|
487
|
-
inputCaptionValue:
|
|
488
|
-
onClearInput:
|
|
489
|
-
onSearchInputChange:
|
|
447
|
+
inputCaptionValue: o,
|
|
448
|
+
onClearInput: R,
|
|
449
|
+
onSearchInputChange: f,
|
|
490
450
|
placeholderValue: r,
|
|
491
|
-
query:
|
|
451
|
+
query: s,
|
|
492
452
|
rightToLeftOrientation: a
|
|
493
453
|
}
|
|
494
454
|
)
|
|
@@ -497,9 +457,108 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
497
457
|
]
|
|
498
458
|
}
|
|
499
459
|
);
|
|
500
|
-
},
|
|
501
|
-
|
|
502
|
-
|
|
460
|
+
}, Bn = "_button_8jqm2_5", xn = "_spinnerMarginRight_8jqm2_26", Mn = "_spinnerMarginLeft_8jqm2_32", Fn = "_buttonLabel_8jqm2_38", qn = "_rightandback_8jqm2_1", y = {
|
|
461
|
+
button: Bn,
|
|
462
|
+
spinnerMarginRight: xn,
|
|
463
|
+
spinnerMarginLeft: Mn,
|
|
464
|
+
buttonLabel: Fn,
|
|
465
|
+
rightandback: qn
|
|
466
|
+
}, $ = ({
|
|
467
|
+
className: n,
|
|
468
|
+
iconElement: e,
|
|
469
|
+
iconOnly: o = !1,
|
|
470
|
+
iconPosition: i = "left",
|
|
471
|
+
label: c = "Search",
|
|
472
|
+
onClick: r
|
|
473
|
+
}) => {
|
|
474
|
+
const { isRequesting: a } = I();
|
|
475
|
+
return /* @__PURE__ */ h(x, { children: [
|
|
476
|
+
o && /* @__PURE__ */ t(
|
|
477
|
+
"button",
|
|
478
|
+
{
|
|
479
|
+
className: d(
|
|
480
|
+
y.button,
|
|
481
|
+
n,
|
|
482
|
+
".searchcraft-button"
|
|
483
|
+
),
|
|
484
|
+
onClick: r,
|
|
485
|
+
type: "submit",
|
|
486
|
+
children: a ? /* @__PURE__ */ t(B, {}) : e
|
|
487
|
+
}
|
|
488
|
+
),
|
|
489
|
+
!o && /* @__PURE__ */ h(
|
|
490
|
+
"button",
|
|
491
|
+
{
|
|
492
|
+
className: d(
|
|
493
|
+
y.button,
|
|
494
|
+
n,
|
|
495
|
+
".searchcraft-button"
|
|
496
|
+
),
|
|
497
|
+
onClick: r,
|
|
498
|
+
type: "submit",
|
|
499
|
+
children: [
|
|
500
|
+
i === "left" && a ? /* @__PURE__ */ t("div", { className: y.spinnerMarginRight, children: /* @__PURE__ */ t(B, {}) }) : e,
|
|
501
|
+
/* @__PURE__ */ t(
|
|
502
|
+
"span",
|
|
503
|
+
{
|
|
504
|
+
className: d(
|
|
505
|
+
a && y.buttonLabel,
|
|
506
|
+
n,
|
|
507
|
+
".searchcraft-button-label"
|
|
508
|
+
),
|
|
509
|
+
children: c
|
|
510
|
+
}
|
|
511
|
+
),
|
|
512
|
+
i === "right" && a ? /* @__PURE__ */ t("div", { className: y.spinnerMarginLeft, children: /* @__PURE__ */ t(B, {}) }) : e
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
] });
|
|
517
|
+
}, $n = "_errorMessage_12dc9_5", jn = {
|
|
518
|
+
errorMessage: $n
|
|
519
|
+
}, A = ({ className: n, errorMessage: e }) => /* @__PURE__ */ t("p", { className: d(jn.errorMessage, n), children: e || "Search term is required." }), Dn = ({
|
|
520
|
+
errorMessage: n,
|
|
521
|
+
handleSubmit: e,
|
|
522
|
+
labelForInput: o = "Search",
|
|
523
|
+
onClearInput: i = () => {
|
|
524
|
+
},
|
|
525
|
+
placeholderValue: c = "Enter Search Term",
|
|
526
|
+
rightToLeftOrientation: r = !1
|
|
527
|
+
}) => {
|
|
528
|
+
const { query: a, setQuery: l } = I(), [s, u] = T(!1), p = (f) => {
|
|
529
|
+
f.preventDefault(), a.trim() === "" ? u(!0) : (u(!1), e(a));
|
|
530
|
+
}, L = (f) => l(f.target.value), g = () => {
|
|
531
|
+
l(""), i();
|
|
532
|
+
};
|
|
533
|
+
return /* @__PURE__ */ h(
|
|
534
|
+
"form",
|
|
535
|
+
{
|
|
536
|
+
className: r ? v.formRTL : v.formLTR,
|
|
537
|
+
onSubmit: p,
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ t(D, { label: o }),
|
|
540
|
+
/* @__PURE__ */ h("div", { className: v.searchContainer, children: [
|
|
541
|
+
r && /* @__PURE__ */ t($, {}),
|
|
542
|
+
/* @__PURE__ */ t(
|
|
543
|
+
j,
|
|
544
|
+
{
|
|
545
|
+
error: s,
|
|
546
|
+
onClearInput: g,
|
|
547
|
+
onSearchInputChange: L,
|
|
548
|
+
placeholderValue: c,
|
|
549
|
+
query: a,
|
|
550
|
+
rightToLeftOrientation: r
|
|
551
|
+
}
|
|
552
|
+
),
|
|
553
|
+
!r && /* @__PURE__ */ t($, {})
|
|
554
|
+
] }),
|
|
555
|
+
s && /* @__PURE__ */ t(A, { errorMessage: n })
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}, An = () => /* @__PURE__ */ h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
560
|
+
/* @__PURE__ */ t("title", { children: "Searchcraft Button Icon" }),
|
|
561
|
+
/* @__PURE__ */ t(
|
|
503
562
|
"path",
|
|
504
563
|
{
|
|
505
564
|
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",
|
|
@@ -509,105 +568,125 @@ const p = /* @__PURE__ */ Y(O), nn = "_button_8jqm2_5", tn = "_spinnerMarginRigh
|
|
|
509
568
|
strokeLinejoin: "round"
|
|
510
569
|
}
|
|
511
570
|
)
|
|
512
|
-
] }),
|
|
513
|
-
resultContainer:
|
|
514
|
-
interactiveResultContainer:
|
|
515
|
-
interactiveIconLarge:
|
|
516
|
-
interactiveIconSmall:
|
|
517
|
-
imageContainer:
|
|
518
|
-
contentContainer:
|
|
519
|
-
image:
|
|
520
|
-
heading:
|
|
521
|
-
subheading:
|
|
522
|
-
bodyContent:
|
|
523
|
-
button:
|
|
524
|
-
},
|
|
525
|
-
buttonCallbackFn:
|
|
571
|
+
] }), Pn = "_resultContainer_10d68_5", On = "_interactiveResultContainer_10d68_17", Un = "_interactiveIconLarge_10d68_33", Wn = "_interactiveIconSmall_10d68_45", zn = "_imageContainer_10d68_57", Gn = "_contentContainer_10d68_68", Qn = "_image_10d68_57", Zn = "_heading_10d68_86", Kn = "_subheading_10d68_97", Jn = "_bodyContent_10d68_107", Hn = "_button_10d68_117", C = {
|
|
572
|
+
resultContainer: Pn,
|
|
573
|
+
interactiveResultContainer: On,
|
|
574
|
+
interactiveIconLarge: Un,
|
|
575
|
+
interactiveIconSmall: Wn,
|
|
576
|
+
imageContainer: zn,
|
|
577
|
+
contentContainer: Gn,
|
|
578
|
+
image: Qn,
|
|
579
|
+
heading: Zn,
|
|
580
|
+
subheading: Kn,
|
|
581
|
+
bodyContent: Jn,
|
|
582
|
+
button: Hn
|
|
583
|
+
}, Z = ({
|
|
584
|
+
buttonCallbackFn: n = () => {
|
|
526
585
|
},
|
|
527
586
|
buttonLabel: e = "",
|
|
528
|
-
callbackFn:
|
|
587
|
+
callbackFn: o = () => {
|
|
529
588
|
},
|
|
530
589
|
keyDownCallbackFn: i = () => {
|
|
531
590
|
},
|
|
532
|
-
imageAltText:
|
|
591
|
+
imageAltText: c = "",
|
|
533
592
|
interactiveResult: r = !1,
|
|
534
593
|
imageSrc: a = "",
|
|
535
594
|
resultBodyContent: l = "",
|
|
536
|
-
resultHeading:
|
|
537
|
-
resultSubheading:
|
|
595
|
+
resultHeading: s = "",
|
|
596
|
+
resultSubheading: u = ""
|
|
538
597
|
}) => {
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
},
|
|
598
|
+
const p = (g) => {
|
|
599
|
+
g.stopPropagation(), n();
|
|
600
|
+
}, L = () => {
|
|
542
601
|
if (r)
|
|
543
|
-
|
|
602
|
+
o();
|
|
544
603
|
else
|
|
545
604
|
return;
|
|
546
605
|
};
|
|
547
|
-
return /* @__PURE__ */
|
|
606
|
+
return /* @__PURE__ */ h(
|
|
548
607
|
"div",
|
|
549
608
|
{
|
|
550
|
-
className: r ?
|
|
609
|
+
className: r ? C.interactiveResultContainer : C.resultContainer,
|
|
551
610
|
id: "searchcraft-item",
|
|
552
|
-
onClick:
|
|
611
|
+
onClick: L,
|
|
553
612
|
onKeyDown: i,
|
|
554
613
|
children: [
|
|
555
|
-
r && /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
|
|
614
|
+
r && /* @__PURE__ */ t("div", { className: C.interactiveIconLarge, children: /* @__PURE__ */ t(U, {}) }),
|
|
615
|
+
/* @__PURE__ */ t("div", { className: C.imageContainer, children: /* @__PURE__ */ t("img", { alt: c, className: C.image, src: a }) }),
|
|
616
|
+
/* @__PURE__ */ h("div", { className: C.contentContainer, children: [
|
|
617
|
+
/* @__PURE__ */ h("h2", { className: C.heading, children: [
|
|
618
|
+
s,
|
|
560
619
|
" ",
|
|
561
|
-
r && /* @__PURE__ */
|
|
620
|
+
r && /* @__PURE__ */ t("div", { className: C.interactiveIconSmall, children: /* @__PURE__ */ t(U, {}) })
|
|
562
621
|
] }),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ t("h3", { className: C.subheading, children: u }),
|
|
623
|
+
/* @__PURE__ */ t("p", { className: C.bodyContent, children: l }),
|
|
624
|
+
/* @__PURE__ */ h("button", { className: C.button, onClick: p, type: "button", children: [
|
|
625
|
+
/* @__PURE__ */ t(An, {}),
|
|
626
|
+
/* @__PURE__ */ t("span", { children: e })
|
|
568
627
|
] })
|
|
569
628
|
] })
|
|
570
629
|
]
|
|
571
630
|
}
|
|
572
631
|
);
|
|
573
|
-
},
|
|
574
|
-
resultsContainer:
|
|
632
|
+
}, Vn = "_resultsContainer_684vx_5", Xn = {
|
|
633
|
+
resultsContainer: Vn
|
|
575
634
|
}, Yn = () => {
|
|
576
|
-
var
|
|
577
|
-
const { searchResults:
|
|
578
|
-
return /* @__PURE__ */
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
635
|
+
var o, i, c, r;
|
|
636
|
+
const { searchResults: n, query: e } = I();
|
|
637
|
+
return /* @__PURE__ */ h("div", { className: Xn.resultsContainer, children: [
|
|
638
|
+
(i = (o = n == null ? void 0 : n.data) == null ? void 0 : o.hits) == null ? void 0 : i.map((a, l) => {
|
|
639
|
+
const { doc: s } = a;
|
|
640
|
+
return /* @__PURE__ */ t(
|
|
641
|
+
Z,
|
|
642
|
+
{
|
|
643
|
+
buttonLabel: "View More",
|
|
644
|
+
buttonCallbackFn: () => {
|
|
645
|
+
console.log("button callback");
|
|
646
|
+
},
|
|
647
|
+
callbackFn: () => {
|
|
648
|
+
console.log("interactive element");
|
|
649
|
+
},
|
|
650
|
+
interactiveResult: !0,
|
|
651
|
+
imageSrc: s == null ? void 0 : s.poster,
|
|
652
|
+
resultBodyContent: s == null ? void 0 : s.overview,
|
|
653
|
+
resultHeading: s == null ? void 0 : s.title,
|
|
654
|
+
resultSubheading: s == null ? void 0 : s.release_date
|
|
589
655
|
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
};
|
|
656
|
+
`${s == null ? void 0 : s.id}-${l}`
|
|
657
|
+
);
|
|
658
|
+
}),
|
|
659
|
+
e.length > 0 && ((r = (c = n == null ? void 0 : n.data) == null ? void 0 : c.hits) == null ? void 0 : r.length) === 0 && /* @__PURE__ */ t(
|
|
660
|
+
A,
|
|
661
|
+
{
|
|
662
|
+
errorMessage: `No search results found for ${e} query`
|
|
663
|
+
}
|
|
664
|
+
)
|
|
665
|
+
] });
|
|
666
|
+
}, m = () => null;
|
|
667
|
+
m.AutoSearchForm = wn;
|
|
668
|
+
m.BaseSearchForm = Dn;
|
|
669
|
+
m.BaseSearchResult = Z;
|
|
670
|
+
m.BaseSearchResults = Yn;
|
|
671
|
+
m.Button = $;
|
|
672
|
+
m.ClearInputButton = M;
|
|
673
|
+
m.ErrorMessage = A;
|
|
674
|
+
m.Input = j;
|
|
675
|
+
m.InputCaption = F;
|
|
676
|
+
m.InputIcon = q;
|
|
677
|
+
m.InputLabel = D;
|
|
678
|
+
m.Provider = tn;
|
|
600
679
|
export {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
680
|
+
wn as AutoSearchForm,
|
|
681
|
+
Dn as BaseSearchForm,
|
|
682
|
+
Z as BaseSearchResult,
|
|
604
683
|
Yn as BaseSearchResults,
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
684
|
+
$ as Button,
|
|
685
|
+
A as ErrorMessage,
|
|
686
|
+
j as Input,
|
|
687
|
+
D as InputLabel,
|
|
688
|
+
et as SearchcraftCore,
|
|
689
|
+
m as default,
|
|
690
|
+
I as useSearchcraft
|
|
612
691
|
};
|
|
613
692
|
//# sourceMappingURL=index.js.map
|