@searchcraft/react-sdk 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
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 {
1
+ import { jsx as t, jsxs as u, Fragment as j } from "react/jsx-runtime";
2
+ import { createContext as Y, useContext as V, useState as y, useMemo as U, useEffect as tt, useCallback as at } from "react";
3
+ var st = Object.defineProperty, ct = (n, e, i) => e in n ? st(n, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[e] = i, N = (n, e, i) => ct(n, typeof e != "symbol" ? e + "" : e, i);
4
+ class yn {
5
5
  constructor(e) {
6
- if (E(this, "config"), E(this, "search", async (o) => {
6
+ if (N(this, "config"), N(this, "search", async (i) => {
7
7
  try {
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
- }, a = {
8
+ const a = this.config.index.join(","), c = `${this.config.endpointURL}/search`, r = {
9
+ query: i.query,
10
+ mode: i.mode,
11
+ app: a
12
+ }, s = {
13
13
  method: "POST",
14
14
  headers: {
15
15
  "Content-Type": "application/json",
@@ -17,9 +17,9 @@ class et {
17
17
  },
18
18
  body: JSON.stringify(r)
19
19
  };
20
- return await (await fetch(c, a)).json();
21
- } catch (i) {
22
- return i;
20
+ return await (await fetch(c, s)).json();
21
+ } catch (a) {
22
+ return a;
23
23
  }
24
24
  }), !e.endpointURL || !e.index)
25
25
  throw new Error("Endpoint URL and Index value(s) must be provided");
@@ -27,12 +27,12 @@ class et {
27
27
  }
28
28
  }
29
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 {
30
+ class ht {
31
31
  constructor(e) {
32
- E(this, "logLevel"), E(this, "logFormatter"), this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
32
+ N(this, "logLevel"), N(this, "logFormatter"), this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
33
33
  }
34
- defaultFormatter(e, o) {
35
- return `[${_[e]}] ${(/* @__PURE__ */ new Date()).toISOString()}: ${o}`;
34
+ defaultFormatter(e, i) {
35
+ return `[${_[e]}] ${(/* @__PURE__ */ new Date()).toISOString()}: ${i}`;
36
36
  }
37
37
  debug(e) {
38
38
  this.logLevel <= 0 && console.log(this.logFormatter(0, e));
@@ -47,7 +47,7 @@ class Y {
47
47
  this.logLevel <= 3 && console.error(this.logFormatter(3, e));
48
48
  }
49
49
  }
50
- const nn = {
50
+ const lt = {
51
51
  error: null,
52
52
  index: [""],
53
53
  isRequesting: !1,
@@ -55,71 +55,82 @@ const nn = {
55
55
  query: "",
56
56
  setQuery: (n) => n,
57
57
  search: async () => null
58
- }, G = K.createContext(nn), tn = ({
58
+ }, nt = Y(lt), et = Y(
59
+ void 0
60
+ ), ut = ({
59
61
  children: n,
60
62
  searchcraft: e,
61
- debug: o = !1
63
+ debug: i = !1
62
64
  }) => {
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) {
65
+ const [a, c] = y(""), [r, s] = y(!1), [l, o] = y(null), [p, m] = y("light"), h = U(() => i ? new ht({ logLevel: _.DEBUG }) : null, [i]), d = (v, I) => {
66
+ if (h)
67
+ switch (v) {
66
68
  case _.DEBUG:
67
- u.debug(R);
69
+ h.debug(I);
68
70
  break;
69
71
  case _.INFO:
70
- u.info(R);
72
+ h.info(I);
71
73
  break;
72
74
  case _.WARN:
73
- u.warn(R);
75
+ h.warn(I);
74
76
  break;
75
77
  case _.ERROR:
76
- u.error(R);
78
+ h.error(I);
77
79
  break;
78
80
  }
79
- }, L = async () => {
80
- p(_.INFO, `Starting search with query: "${i}"`), a(!0);
81
+ }, R = async () => {
82
+ d(_.INFO, `Starting search with query: "${a}"`), s(!0);
81
83
  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(
84
+ const v = await e.search({ query: a, mode: "fuzzy" });
85
+ o(v), d(_.DEBUG, `Search results: ${JSON.stringify(v)}`);
86
+ } catch (v) {
87
+ d(
86
88
  _.ERROR,
87
- `Search failed with error: ${f.message}`
89
+ `Search failed with error: ${v.message}`
88
90
  );
89
91
  } finally {
90
- a(!1);
92
+ s(!1);
91
93
  }
92
94
  };
93
- z(() => (p(_.INFO, "SearchcraftProvider mounted."), () => {
94
- p(_.INFO, "SearchcraftProvider unmounted.");
95
- }), [u]);
96
- const g = {
95
+ tt(() => (d(_.INFO, "SearchcraftProvider mounted."), () => {
96
+ d(_.INFO, "SearchcraftProvider unmounted.");
97
+ }), [h]);
98
+ const F = {
97
99
  error: null,
98
100
  index: e.config.index,
99
101
  isRequesting: r,
100
102
  mode: "fuzzy",
101
- query: i,
102
- search: L,
103
+ query: a,
104
+ search: R,
103
105
  searchResults: l,
104
106
  setQuery: c
105
- };
106
- return /* @__PURE__ */ t(G.Provider, { value: g, children: n });
107
- }, I = () => {
108
- const n = J(G);
107
+ }, k = at(() => {
108
+ m((v) => v === "light" ? "dark" : "light");
109
+ }, []), ot = U(
110
+ () => ({
111
+ theme: p,
112
+ toggleTheme: k
113
+ }),
114
+ [p, k]
115
+ );
116
+ return /* @__PURE__ */ t(nt.Provider, { value: F, children: /* @__PURE__ */ t(et.Provider, { value: ot, children: n }) });
117
+ }, S = () => {
118
+ const n = V(nt);
109
119
  if (!n)
110
120
  throw new Error(
111
121
  "Searchcraft compound components must be used within Searchcraft.Provider"
112
122
  );
113
123
  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
124
+ }, b = () => {
125
+ const n = V(et);
126
+ if (!n)
127
+ throw new Error("useTheme must be used within a ThemeProvider");
128
+ return n;
118
129
  };
119
- function an(n) {
130
+ function pt(n) {
120
131
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
121
132
  }
122
- var Q = { exports: {} };
133
+ var rt = { exports: {} };
123
134
  /*!
124
135
  Copyright (c) 2018 Jed Watson.
125
136
  Licensed under the MIT License (MIT), see
@@ -128,46 +139,54 @@ var Q = { exports: {} };
128
139
  (function(n) {
129
140
  (function() {
130
141
  var e = {}.hasOwnProperty;
131
- function o() {
132
- for (var r = "", a = 0; a < arguments.length; a++) {
133
- var l = arguments[a];
134
- l && (r = c(r, i(l)));
142
+ function i() {
143
+ for (var r = "", s = 0; s < arguments.length; s++) {
144
+ var l = arguments[s];
145
+ l && (r = c(r, a(l)));
135
146
  }
136
147
  return r;
137
148
  }
138
- function i(r) {
149
+ function a(r) {
139
150
  if (typeof r == "string" || typeof r == "number")
140
151
  return r;
141
152
  if (typeof r != "object")
142
153
  return "";
143
154
  if (Array.isArray(r))
144
- return o.apply(null, r);
155
+ return i.apply(null, r);
145
156
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
146
157
  return r.toString();
147
- var a = "";
158
+ var s = "";
148
159
  for (var l in r)
149
- e.call(r, l) && r[l] && (a = c(a, l));
150
- return a;
160
+ e.call(r, l) && r[l] && (s = c(s, l));
161
+ return s;
151
162
  }
152
- function c(r, a) {
153
- return a ? r ? r + " " + a : r + a : r;
163
+ function c(r, s) {
164
+ return s ? r ? r + " " + s : r + s : r;
154
165
  }
155
- n.exports ? (o.default = o, n.exports = o) : window.classNames = o;
166
+ n.exports ? (i.default = i, n.exports = i) : window.classNames = i;
156
167
  })();
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" }),
168
+ })(rt);
169
+ var gt = rt.exports;
170
+ const L = /* @__PURE__ */ pt(gt), Lt = "_formLTR_dvuqa_5", dt = "_formRTL_dvuqa_9", _t = "_searchContainer_dvuqa_13", D = {
171
+ formLTR: Lt,
172
+ formRTL: dt,
173
+ searchContainer: _t
174
+ }, ft = "_inputContainerLTR_1nio0_5", mt = "_inputContainerRTL_1nio0_9", Ct = "_inputLightLTR_1nio0_14", Rt = "_inputDarkLTR_1nio0_38", kt = "_inputErrorLightLTR_1nio0_62", vt = "_inputErrorDarkLTR_1nio0_90", Tt = "_inputLightRTL_1nio0_118", bt = "_inputDarkRTL_1nio0_143", yt = "_inputErrorLightRTL_1nio0_168", Dt = "_inputErrorDarkRTL_1nio0_197", C = {
175
+ inputContainerLTR: ft,
176
+ inputContainerRTL: mt,
177
+ inputLightLTR: Ct,
178
+ inputDarkLTR: Rt,
179
+ inputErrorLightLTR: kt,
180
+ inputErrorDarkLTR: vt,
181
+ inputLightRTL: Tt,
182
+ inputDarkRTL: bt,
183
+ inputErrorLightRTL: yt,
184
+ inputErrorDarkRTL: Dt
185
+ }, St = "_inputClearButtonLTR_t63ei_5", It = "_inputClearButtonRTL_t63ei_19", z = {
186
+ inputClearButtonLTR: St,
187
+ inputClearButtonRTL: It
188
+ }, Z = () => /* @__PURE__ */ u("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
189
+ /* @__PURE__ */ t("title", { children: "Searchcraft Clear Input Icon Light" }),
171
190
  /* @__PURE__ */ t(
172
191
  "path",
173
192
  {
@@ -178,8 +197,30 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
178
197
  strokeLinejoin: "round"
179
198
  }
180
199
  )
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" }),
200
+ ] }), G = () => /* @__PURE__ */ u(
201
+ "svg",
202
+ {
203
+ width: "22",
204
+ height: "22",
205
+ viewBox: "0 0 22 22",
206
+ fill: "none",
207
+ xmlns: "http://www.w3.org/2000/svg",
208
+ children: [
209
+ /* @__PURE__ */ t("title", { children: "Searchcraft Clear Input Icon Dark" }),
210
+ /* @__PURE__ */ t(
211
+ "path",
212
+ {
213
+ 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",
214
+ stroke: "white",
215
+ strokeWidth: "1.5",
216
+ strokeLinecap: "round",
217
+ strokeLinejoin: "round"
218
+ }
219
+ )
220
+ ]
221
+ }
222
+ ), Q = () => /* @__PURE__ */ u("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", children: [
223
+ /* @__PURE__ */ t("title", { children: "Searchcraft Arrow Right Icon Light" }),
183
224
  /* @__PURE__ */ t(
184
225
  "path",
185
226
  {
@@ -190,72 +231,103 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
190
231
  strokeLinejoin: "round"
191
232
  }
192
233
  )
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 = ({
234
+ ] }), K = () => /* @__PURE__ */ u(
235
+ "svg",
236
+ {
237
+ width: "8",
238
+ height: "12",
239
+ viewBox: "0 0 8 12",
240
+ fill: "none",
241
+ xmlns: "http://www.w3.org/2000/svg",
242
+ children: [
243
+ /* @__PURE__ */ t("title", { children: "Searchcraft Arrow Right Icon Dark" }),
244
+ /* @__PURE__ */ t(
245
+ "path",
246
+ {
247
+ d: "M1.5 11L6.5 6L1.5 1",
248
+ stroke: "#BFBFBF",
249
+ strokeWidth: "1.5",
250
+ strokeLinecap: "round",
251
+ strokeLinejoin: "round"
252
+ }
253
+ )
254
+ ]
255
+ }
256
+ ), wt = "_spinnerContainer_1noam_1", Et = "_spinnerDark_1noam_7", Nt = "_spinning_1noam_1", xt = "_spinnerLight_1noam_16", x = {
257
+ spinnerContainer: wt,
258
+ spinnerDark: Et,
259
+ spinning: Nt,
260
+ spinnerLight: xt
261
+ }, J = () => /* @__PURE__ */ t("div", { className: x.spinnerContainer, children: /* @__PURE__ */ t("div", { className: x.spinnerLight }) }), B = () => /* @__PURE__ */ t("div", { className: x.spinnerContainer, children: /* @__PURE__ */ t("div", { className: x.spinnerDark }) }), $ = ({
199
262
  onClearInput: n,
200
263
  rightToLeftOrientation: e = !1
201
264
  }) => {
202
- const { isRequesting: o } = I();
265
+ const { isRequesting: i } = S(), { theme: a } = b(), c = a === "light";
203
266
  return e ? /* @__PURE__ */ t(
204
267
  "button",
205
268
  {
206
- className: d(
207
- P.inputClearButtonRTL,
269
+ className: L(
270
+ z.inputClearButtonRTL,
208
271
  ".sc-clear-input-button-rtl"
209
272
  ),
210
273
  onClick: n,
211
274
  type: "button",
212
- children: o ? /* @__PURE__ */ t(W, {}) : /* @__PURE__ */ t(O, {})
275
+ children: i ? c ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(B, {}) : c ? /* @__PURE__ */ t(Z, {}) : /* @__PURE__ */ t(G, {})
213
276
  }
214
277
  ) : /* @__PURE__ */ t(
215
278
  "button",
216
279
  {
217
- className: d(
218
- P.inputClearButtonLTR,
280
+ className: L(
281
+ z.inputClearButtonLTR,
219
282
  ".sc-clear-input-button-ltr"
220
283
  ),
221
284
  onClick: n,
222
285
  type: "button",
223
- children: o ? /* @__PURE__ */ t(W, {}) : /* @__PURE__ */ t(O, {})
286
+ children: i ? c ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(B, {}) : c ? /* @__PURE__ */ t(Z, {}) : /* @__PURE__ */ t(G, {})
224
287
  }
225
288
  );
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 = ({
289
+ }, Bt = "_inputCaptionLightLTR_f6rxj_5", Mt = "_inputCaptionDarkLTR_f6rxj_14", Ft = "_inputCaptionErrorLightLTR_f6rxj_23", jt = "_inputCaptionErrorDarkLTR_f6rxj_32", $t = "_inputCaptionLightRTL_f6rxj_41", qt = "_inputCaptionDarkRTL_f6rxj_51", At = "_inputCaptionErrorLightRTL_f6rxj_61", Pt = "_inputCaptionErrorDarkRTL_f6rxj_71", T = {
290
+ inputCaptionLightLTR: Bt,
291
+ inputCaptionDarkLTR: Mt,
292
+ inputCaptionErrorLightLTR: Ft,
293
+ inputCaptionErrorDarkLTR: jt,
294
+ inputCaptionLightRTL: $t,
295
+ inputCaptionDarkRTL: qt,
296
+ inputCaptionErrorLightRTL: At,
297
+ inputCaptionErrorDarkRTL: Pt
298
+ }, q = ({
232
299
  error: n = !1,
233
300
  inputCaptionClassName: e,
234
- inputCaptionValue: o = "Enter Search",
235
- rightToLeftOrientation: i = !1
236
- }) => i ? /* @__PURE__ */ t(
237
- "p",
238
- {
239
- className: d(
240
- n ? N.inputCaptionErrorRTL : N.inputCaptionRTL,
241
- e
242
- ),
243
- children: o
244
- }
245
- ) : /* @__PURE__ */ t(
246
- "p",
247
- {
248
- className: d(
249
- n ? N.inputCaptionErrorLTR : N.inputCaptionLTR,
250
- e
251
- ),
252
- children: o
253
- }
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" }),
301
+ inputCaptionValue: i = "Enter Search",
302
+ rightToLeftOrientation: a = !1
303
+ }) => {
304
+ const { theme: c } = b(), r = c === "light";
305
+ return a ? /* @__PURE__ */ t(
306
+ "p",
307
+ {
308
+ className: L(
309
+ n ? r ? T.inputCaptionErrorLightRTL : T.inputCaptionErrorDarkRTL : r ? T.inputCaptionLightRTL : T.inputCaptionDarkRTL,
310
+ e,
311
+ ".searchcraft-input-caption"
312
+ ),
313
+ children: i
314
+ }
315
+ ) : /* @__PURE__ */ t(
316
+ "p",
317
+ {
318
+ className: L(
319
+ n ? r ? T.inputCaptionErrorLightLTR : T.inputCaptionErrorDarkLTR : r ? T.inputCaptionLightLTR : T.inputCaptionDarkLTR,
320
+ e,
321
+ ".searchcraft-input-caption"
322
+ ),
323
+ children: i
324
+ }
325
+ );
326
+ }, Wt = "_inputIconLTR_cusap_5", Ot = "_inputIconRTL_cusap_13", w = {
327
+ inputIconLTR: Wt,
328
+ inputIconRTL: Ot
329
+ }, Ut = () => /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
330
+ /* @__PURE__ */ t("title", { children: "Searchcraft Search Icon Light" }),
259
331
  /* @__PURE__ */ t(
260
332
  "path",
261
333
  {
@@ -266,8 +338,30 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
266
338
  strokeLinejoin: "round"
267
339
  }
268
340
  )
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" }),
341
+ ] }), zt = () => /* @__PURE__ */ u(
342
+ "svg",
343
+ {
344
+ width: "18",
345
+ height: "18",
346
+ viewBox: "0 0 18 18",
347
+ fill: "none",
348
+ xmlns: "http://www.w3.org/2000/svg",
349
+ children: [
350
+ /* @__PURE__ */ t("title", { children: "Searchcraft Search Icon Dark" }),
351
+ /* @__PURE__ */ t(
352
+ "path",
353
+ {
354
+ d: "M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",
355
+ stroke: "#E6E6E6",
356
+ strokeWidth: "1.5",
357
+ strokeLinecap: "round",
358
+ strokeLinejoin: "round"
359
+ }
360
+ )
361
+ ]
362
+ }
363
+ ), Zt = () => /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
364
+ /* @__PURE__ */ t("title", { children: "Searchcraft Error Search Icon Light" }),
271
365
  /* @__PURE__ */ t(
272
366
  "path",
273
367
  {
@@ -278,178 +372,207 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
278
372
  strokeLinejoin: "round"
279
373
  }
280
374
  )
281
- ] }), q = ({
282
- error: n = !1,
283
- rightToLeftOrientation: e = !1
284
- }) => n ? /* @__PURE__ */ t(
285
- "div",
286
- {
287
- className: e ? k.inputIconRTL : k.inputIconLTR,
288
- children: /* @__PURE__ */ t(Nn, {})
289
- }
290
- ) : /* @__PURE__ */ t(
291
- "div",
375
+ ] }), Gt = () => /* @__PURE__ */ u(
376
+ "svg",
292
377
  {
293
- className: e ? k.inputIconRTL : k.inputIconLTR,
294
- children: /* @__PURE__ */ t(In, {})
378
+ width: "18",
379
+ height: "18",
380
+ viewBox: "0 0 18 18",
381
+ fill: "none",
382
+ xmlns: "http://www.w3.org/2000/svg",
383
+ children: [
384
+ /* @__PURE__ */ t("title", { children: "Searchcraft Error Search Icon Dark" }),
385
+ /* @__PURE__ */ t(
386
+ "path",
387
+ {
388
+ d: "M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",
389
+ stroke: "#BFBFBF",
390
+ strokeWidth: "1.5",
391
+ strokeLinecap: "round",
392
+ strokeLinejoin: "round"
393
+ }
394
+ )
395
+ ]
295
396
  }
296
- ), j = ({
397
+ ), A = ({
398
+ error: n = !1,
399
+ rightToLeftOrientation: e = !1
400
+ }) => {
401
+ const { theme: i } = b(), a = i === "light";
402
+ return n ? /* @__PURE__ */ t(
403
+ "div",
404
+ {
405
+ className: e ? w.inputIconRTL : w.inputIconLTR,
406
+ children: a ? /* @__PURE__ */ t(Zt, {}) : /* @__PURE__ */ t(Gt, {})
407
+ }
408
+ ) : /* @__PURE__ */ t(
409
+ "div",
410
+ {
411
+ className: e ? w.inputIconRTL : w.inputIconLTR,
412
+ children: a ? /* @__PURE__ */ t(Ut, {}) : /* @__PURE__ */ t(zt, {})
413
+ }
414
+ );
415
+ }, P = ({
297
416
  error: n = !1,
298
417
  formClassName: e = "",
299
- inputCaptionClassName: o = "",
300
- inputClassName: i = "",
418
+ inputCaptionClassName: i = "",
419
+ inputClassName: a = "",
301
420
  inputCaptionValue: c = "",
302
421
  onClearInput: r,
303
- onSearchInputChange: a,
422
+ onSearchInputChange: s,
304
423
  placeholderValue: l = "Enter Search",
305
- rightToLeftOrientation: s = !1,
306
- query: u = ""
424
+ rightToLeftOrientation: o = !1,
425
+ query: p = ""
307
426
  }) => {
308
- const p = s ? b.inputContainerRTL : b.inputContainerLTR;
427
+ const { theme: m } = b(), h = m === "light", d = o ? C.inputContainerRTL : C.inputContainerLTR;
309
428
  return /* @__PURE__ */ t(
310
429
  "div",
311
430
  {
312
- className: d(
313
- p,
431
+ className: L(
432
+ d,
314
433
  e,
315
434
  "searchcraft-input-form"
316
435
  ),
317
- children: s ? /* @__PURE__ */ h(x, { children: [
436
+ children: o ? /* @__PURE__ */ u(j, { children: [
318
437
  /* @__PURE__ */ t(
319
438
  "input",
320
439
  {
321
- className: d(
322
- n ? b.inputErrorRTL : b.inputRTL,
323
- i,
440
+ className: L(
441
+ n ? h ? C.inputErrorLightRTL : C.inputErrorDarkRTL : h ? C.inputLightRTL : C.inputDarkRTL,
442
+ a,
324
443
  "searchcraft-input"
325
444
  ),
326
445
  id: "searchcraft-input-id",
327
- onChange: a,
446
+ onChange: s,
328
447
  placeholder: l,
329
448
  type: "text",
330
- value: u
449
+ value: p
331
450
  }
332
451
  ),
333
452
  c && /* @__PURE__ */ t(
334
- F,
453
+ q,
335
454
  {
336
- inputCaptionClassName: o,
455
+ inputCaptionClassName: i,
337
456
  inputCaptionValue: c,
338
- rightToLeftOrientation: s
457
+ rightToLeftOrientation: o
339
458
  }
340
459
  ),
341
- u.length > 0 && /* @__PURE__ */ t(
342
- M,
460
+ p.length > 0 && /* @__PURE__ */ t(
461
+ $,
343
462
  {
344
463
  onClearInput: r,
345
- rightToLeftOrientation: s
464
+ rightToLeftOrientation: o
346
465
  }
347
466
  ),
348
467
  /* @__PURE__ */ t(
349
- q,
468
+ A,
350
469
  {
351
470
  error: n,
352
- rightToLeftOrientation: s
471
+ rightToLeftOrientation: o
353
472
  }
354
473
  )
355
- ] }) : /* @__PURE__ */ h(x, { children: [
474
+ ] }) : /* @__PURE__ */ u(j, { children: [
356
475
  /* @__PURE__ */ t(
357
476
  "input",
358
477
  {
359
- className: d(
360
- n ? b.inputErrorLTR : b.inputLTR,
361
- i,
478
+ className: L(
479
+ n ? h ? C.inputErrorLightLTR : C.inputErrorDarkLTR : h ? C.inputLightLTR : C.inputDarkLTR,
480
+ a,
362
481
  "searchcraft-input"
363
482
  ),
364
483
  id: "searchcraft-input-id",
365
- onChange: a,
484
+ onChange: s,
366
485
  placeholder: l,
367
486
  type: "text",
368
- value: u
487
+ value: p
369
488
  }
370
489
  ),
371
490
  c && /* @__PURE__ */ t(
372
- F,
491
+ q,
373
492
  {
374
- inputCaptionClassName: o,
493
+ inputCaptionClassName: i,
375
494
  inputCaptionValue: c,
376
- rightToLeftOrientation: s
495
+ rightToLeftOrientation: o
377
496
  }
378
497
  ),
379
- u.length > 0 && /* @__PURE__ */ t(
380
- M,
498
+ p.length > 0 && /* @__PURE__ */ t(
499
+ $,
381
500
  {
382
501
  onClearInput: r,
383
- rightToLeftOrientation: s
502
+ rightToLeftOrientation: o
384
503
  }
385
504
  ),
386
- /* @__PURE__ */ t(q, { error: n })
505
+ /* @__PURE__ */ t(A, { error: n })
387
506
  ] })
388
507
  }
389
508
  );
390
- }, kn = "_label_1euwf_5", En = {
391
- label: kn
392
- }, D = ({
509
+ }, Qt = "_labelLight_14iga_5", Kt = "_labelDark_14iga_14", H = {
510
+ labelLight: Qt,
511
+ labelDark: Kt
512
+ }, W = ({
393
513
  className: n,
394
514
  label: e = "Enter Search"
395
- }) => /* @__PURE__ */ t(
396
- "label",
397
- {
398
- className: d(En.label, n),
399
- htmlFor: "searchcraft-input-id",
400
- children: e
401
- }
402
- ), wn = ({
515
+ }) => {
516
+ const { theme: i } = b(), a = i === "light" ? H.labelLight : H.labelDark;
517
+ return /* @__PURE__ */ t(
518
+ "label",
519
+ {
520
+ className: L(a, n),
521
+ htmlFor: "searchcraft-input-id",
522
+ children: e
523
+ }
524
+ );
525
+ }, Jt = ({
403
526
  autoSearchFormClass: n = "",
404
527
  handleSubmit: e,
405
- inputCaptionValue: o = "",
406
- labelForInput: i = "Search",
528
+ inputCaptionValue: i = "",
529
+ labelForInput: a = "Search",
407
530
  onClearInput: c = () => {
408
531
  },
409
532
  placeholderValue: r = "Search here",
410
- rightToLeftOrientation: a = !1,
533
+ rightToLeftOrientation: s = !1,
411
534
  searchContainerClass: l = ""
412
535
  }) => {
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();
536
+ const { query: o, setQuery: p } = S(), [m, h] = y(!1), d = s ? D.formRTL : D.formLTR, R = (k) => {
537
+ k.preventDefault(), p(k.currentTarget.value), o !== k.currentTarget.value && h(!0);
538
+ }, F = () => {
539
+ p(""), c();
417
540
  };
418
- return z(() => {
419
- if (p)
420
- e(s), L(!1);
541
+ return tt(() => {
542
+ if (m)
543
+ e(o), h(!1);
421
544
  else
422
545
  return;
423
- }, [p, e, s]), /* @__PURE__ */ h(
546
+ }, [m, e, o]), /* @__PURE__ */ u(
424
547
  "form",
425
548
  {
426
- className: d(
427
- g,
549
+ className: L(
550
+ d,
428
551
  n,
429
552
  "searchcraft-auto-search-form"
430
553
  ),
431
- onSubmit: (S) => {
432
- S.preventDefault();
554
+ onSubmit: (k) => {
555
+ k.preventDefault();
433
556
  },
434
557
  children: [
435
- /* @__PURE__ */ t(D, { label: i }),
558
+ /* @__PURE__ */ t(W, { label: a }),
436
559
  /* @__PURE__ */ t(
437
560
  "div",
438
561
  {
439
- className: d(
440
- v.searchContainer,
562
+ className: L(
563
+ D.searchContainer,
441
564
  l,
442
565
  "searchcraft-input-container"
443
566
  ),
444
567
  children: /* @__PURE__ */ t(
445
- j,
568
+ P,
446
569
  {
447
- inputCaptionValue: o,
448
- onClearInput: R,
449
- onSearchInputChange: f,
570
+ inputCaptionValue: i,
571
+ onClearInput: F,
572
+ onSearchInputChange: R,
450
573
  placeholderValue: r,
451
- query: s,
452
- rightToLeftOrientation: a
574
+ query: o,
575
+ rightToLeftOrientation: s
453
576
  }
454
577
  )
455
578
  }
@@ -457,188 +580,192 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
457
580
  ]
458
581
  }
459
582
  );
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
- }, $ = ({
583
+ }, Ht = "_buttonLight_97gf2_5", Xt = "_buttonDark_97gf2_28", Yt = "_spinnerMarginRight_97gf2_51", Vt = "_spinnerMarginLeft_97gf2_57", tn = "_buttonLabel_97gf2_63", E = {
584
+ buttonLight: Ht,
585
+ buttonDark: Xt,
586
+ spinnerMarginRight: Yt,
587
+ spinnerMarginLeft: Vt,
588
+ buttonLabel: tn,
589
+ "right-and-back": "_right-and-back_97gf2_1"
590
+ }, M = ({
467
591
  className: n,
468
592
  iconElement: e,
469
- iconOnly: o = !1,
470
- iconPosition: i = "left",
593
+ iconOnly: i = !1,
594
+ iconPosition: a = "left",
471
595
  label: c = "Search",
472
596
  onClick: r
473
597
  }) => {
474
- const { isRequesting: a } = I();
475
- return /* @__PURE__ */ h(x, { children: [
476
- o && /* @__PURE__ */ t(
598
+ const { isRequesting: s } = S(), { theme: l } = b(), o = l === "light" ? E.buttonLight : E.buttonDark;
599
+ return /* @__PURE__ */ u(j, { children: [
600
+ i && /* @__PURE__ */ t(
477
601
  "button",
478
602
  {
479
- className: d(
480
- y.button,
481
- n,
482
- ".searchcraft-button"
483
- ),
603
+ className: L(o, n, ".searchcraft-button"),
484
604
  onClick: r,
485
605
  type: "submit",
486
- children: a ? /* @__PURE__ */ t(B, {}) : e
606
+ children: s ? /* @__PURE__ */ t(B, {}) : e
487
607
  }
488
608
  ),
489
- !o && /* @__PURE__ */ h(
609
+ !i && /* @__PURE__ */ u(
490
610
  "button",
491
611
  {
492
- className: d(
493
- y.button,
494
- n,
495
- ".searchcraft-button"
496
- ),
612
+ className: L(o, n, ".searchcraft-button"),
497
613
  onClick: r,
498
614
  type: "submit",
499
615
  children: [
500
- i === "left" && a ? /* @__PURE__ */ t("div", { className: y.spinnerMarginRight, children: /* @__PURE__ */ t(B, {}) }) : e,
616
+ a === "left" && s ? /* @__PURE__ */ t("div", { className: E.spinnerMarginRight, children: /* @__PURE__ */ t(B, {}) }) : e,
501
617
  /* @__PURE__ */ t(
502
618
  "span",
503
619
  {
504
- className: d(
505
- a && y.buttonLabel,
620
+ className: L(
621
+ s && E.buttonLabel,
506
622
  n,
507
623
  ".searchcraft-button-label"
508
624
  ),
509
625
  children: c
510
626
  }
511
- ),
512
- i === "right" && a ? /* @__PURE__ */ t("div", { className: y.spinnerMarginLeft, children: /* @__PURE__ */ t(B, {}) }) : e
627
+ )
513
628
  ]
514
629
  }
515
630
  )
516
631
  ] });
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 = ({
632
+ }, nn = "_errorMessageLight_1endn_5", en = "_errorMessageDark_1endn_14", X = {
633
+ errorMessageLight: nn,
634
+ errorMessageDark: en
635
+ }, O = ({ className: n, errorMessage: e }) => {
636
+ const { theme: i } = b(), a = i === "light" ? X.errorMessageLight : X.errorMessageDark;
637
+ return /* @__PURE__ */ t("p", { className: L(a, n), children: e || "Search term is required." });
638
+ }, rn = ({
520
639
  errorMessage: n,
521
640
  handleSubmit: e,
522
- labelForInput: o = "Search",
523
- onClearInput: i = () => {
641
+ labelForInput: i = "Search",
642
+ onClearInput: a = () => {
524
643
  },
525
644
  placeholderValue: c = "Enter Search Term",
526
645
  rightToLeftOrientation: r = !1
527
646
  }) => {
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();
647
+ const { query: s, setQuery: l } = S(), [o, p] = y(!1), m = (R) => {
648
+ R.preventDefault(), s.trim() === "" ? p(!0) : (p(!1), e(s));
649
+ }, h = (R) => l(R.target.value), d = () => {
650
+ l(""), a();
532
651
  };
533
- return /* @__PURE__ */ h(
652
+ return /* @__PURE__ */ u(
534
653
  "form",
535
654
  {
536
- className: r ? v.formRTL : v.formLTR,
537
- onSubmit: p,
655
+ className: r ? D.formRTL : D.formLTR,
656
+ onSubmit: m,
538
657
  children: [
539
- /* @__PURE__ */ t(D, { label: o }),
540
- /* @__PURE__ */ h("div", { className: v.searchContainer, children: [
541
- r && /* @__PURE__ */ t($, {}),
658
+ /* @__PURE__ */ t(W, { label: i }),
659
+ /* @__PURE__ */ u("div", { className: D.searchContainer, children: [
660
+ r && /* @__PURE__ */ t(M, {}),
542
661
  /* @__PURE__ */ t(
543
- j,
662
+ P,
544
663
  {
545
- error: s,
546
- onClearInput: g,
547
- onSearchInputChange: L,
664
+ error: o,
665
+ onClearInput: d,
666
+ onSearchInputChange: h,
548
667
  placeholderValue: c,
549
- query: a,
668
+ query: s,
550
669
  rightToLeftOrientation: r
551
670
  }
552
671
  ),
553
- !r && /* @__PURE__ */ t($, {})
672
+ !r && /* @__PURE__ */ t(M, {})
554
673
  ] }),
555
- s && /* @__PURE__ */ t(A, { errorMessage: n })
674
+ o && /* @__PURE__ */ t(O, { errorMessage: n })
556
675
  ]
557
676
  }
558
677
  );
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(
562
- "path",
563
- {
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",
565
- stroke: "white",
566
- strokeWidth: "1.5",
567
- strokeLinecap: "round",
568
- strokeLinejoin: "round"
569
- }
570
- )
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 = ({
678
+ }, on = "_interactiveResultContainerLight_vyyhe_5", an = "_interactiveResultContainerDark_vyyhe_21", sn = "_resultContainer_vyyhe_37", cn = "_interactiveIconLarge_vyyhe_49", hn = "_interactiveIconSmall_vyyhe_61", ln = "_imageContainer_vyyhe_73", un = "_contentContainer_vyyhe_84", pn = "_imageLight_vyyhe_94", gn = "_imageDark_vyyhe_102", Ln = "_headingLight_vyyhe_110", dn = "_headingDark_vyyhe_121", _n = "_subheadingLight_vyyhe_132", fn = "_subheadingDark_vyyhe_142", mn = "_bodyContentLight_vyyhe_152", Cn = "_bodyContentDark_vyyhe_162", g = {
679
+ interactiveResultContainerLight: on,
680
+ interactiveResultContainerDark: an,
681
+ resultContainer: sn,
682
+ interactiveIconLarge: cn,
683
+ interactiveIconSmall: hn,
684
+ imageContainer: ln,
685
+ contentContainer: un,
686
+ imageLight: pn,
687
+ imageDark: gn,
688
+ headingLight: Ln,
689
+ headingDark: dn,
690
+ subheadingLight: _n,
691
+ subheadingDark: fn,
692
+ bodyContentLight: mn,
693
+ bodyContentDark: Cn
694
+ }, it = ({
584
695
  buttonCallbackFn: n = () => {
585
696
  },
586
697
  buttonLabel: e = "",
587
- callbackFn: o = () => {
698
+ callbackFn: i = () => {
588
699
  },
589
- keyDownCallbackFn: i = () => {
700
+ keyDownCallbackFn: a = () => {
590
701
  },
591
702
  imageAltText: c = "",
592
703
  interactiveResult: r = !1,
593
- imageSrc: a = "",
704
+ imageSrc: s = "",
594
705
  resultBodyContent: l = "",
595
- resultHeading: s = "",
596
- resultSubheading: u = ""
706
+ resultHeading: o = "",
707
+ resultSubheading: p = ""
597
708
  }) => {
598
- const p = (g) => {
599
- g.stopPropagation(), n();
600
- }, L = () => {
709
+ const { theme: m } = b(), h = m === "light", d = () => {
710
+ n();
711
+ }, R = () => {
601
712
  if (r)
602
- o();
713
+ i();
603
714
  else
604
715
  return;
605
716
  };
606
- return /* @__PURE__ */ h(
717
+ return /* @__PURE__ */ u(
607
718
  "div",
608
719
  {
609
- className: r ? C.interactiveResultContainer : C.resultContainer,
720
+ className: r ? h ? g.interactiveResultContainerLight : g.interactiveResultContainerDark : g.resultContainer,
610
721
  id: "searchcraft-item",
611
- onClick: L,
612
- onKeyDown: i,
722
+ onClick: R,
723
+ onKeyDown: a,
613
724
  children: [
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,
725
+ r && /* @__PURE__ */ t("div", { className: g.interactiveIconLarge, children: h ? /* @__PURE__ */ t(Q, {}) : /* @__PURE__ */ t(K, {}) }),
726
+ /* @__PURE__ */ t("div", { className: g.imageContainer, children: /* @__PURE__ */ t(
727
+ "img",
728
+ {
729
+ alt: c,
730
+ className: h ? g.imageLight : g.imageDark,
731
+ src: s
732
+ }
733
+ ) }),
734
+ /* @__PURE__ */ u("div", { className: g.contentContainer, children: [
735
+ /* @__PURE__ */ u("h2", { className: h ? g.headingLight : g.headingDark, children: [
736
+ o,
619
737
  " ",
620
- r && /* @__PURE__ */ t("div", { className: C.interactiveIconSmall, children: /* @__PURE__ */ t(U, {}) })
738
+ r && /* @__PURE__ */ t("div", { className: g.interactiveIconSmall, children: h ? /* @__PURE__ */ t(Q, {}) : /* @__PURE__ */ t(K, {}) })
621
739
  ] }),
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 })
627
- ] })
740
+ /* @__PURE__ */ t(
741
+ "h3",
742
+ {
743
+ className: h ? g.subheadingLight : g.subheadingDark,
744
+ children: p
745
+ }
746
+ ),
747
+ /* @__PURE__ */ t(
748
+ "p",
749
+ {
750
+ className: h ? g.bodyContentLight : g.bodyContentDark,
751
+ children: l
752
+ }
753
+ ),
754
+ /* @__PURE__ */ t(M, { label: e, onClick: d })
628
755
  ] })
629
756
  ]
630
757
  }
631
758
  );
632
- }, Vn = "_resultsContainer_684vx_5", Xn = {
633
- resultsContainer: Vn
634
- }, Yn = () => {
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;
759
+ }, Rn = "_resultsContainer_684vx_5", kn = {
760
+ resultsContainer: Rn
761
+ }, vn = () => {
762
+ var i, a, c, r;
763
+ const { searchResults: n, query: e } = S();
764
+ return /* @__PURE__ */ u("div", { className: kn.resultsContainer, children: [
765
+ (a = (i = n == null ? void 0 : n.data) == null ? void 0 : i.hits) == null ? void 0 : a.map((s, l) => {
766
+ const { doc: o } = s;
640
767
  return /* @__PURE__ */ t(
641
- Z,
768
+ it,
642
769
  {
643
770
  buttonLabel: "View More",
644
771
  buttonCallbackFn: () => {
@@ -648,45 +775,46 @@ const d = /* @__PURE__ */ an(sn), cn = "_inputContainerLTR_s1rq8_5", ln = "_inpu
648
775
  console.log("interactive element");
649
776
  },
650
777
  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
778
+ imageSrc: o == null ? void 0 : o.poster,
779
+ resultBodyContent: o == null ? void 0 : o.overview,
780
+ resultHeading: o == null ? void 0 : o.title,
781
+ resultSubheading: o == null ? void 0 : o.release_date
655
782
  },
656
- `${s == null ? void 0 : s.id}-${l}`
783
+ `${o == null ? void 0 : o.id}-${l}`
657
784
  );
658
785
  }),
659
786
  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,
787
+ O,
661
788
  {
662
789
  errorMessage: `No search results found for ${e} query`
663
790
  }
664
791
  )
665
792
  ] });
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;
793
+ }, f = () => null;
794
+ f.AutoSearchForm = Jt;
795
+ f.BaseSearchForm = rn;
796
+ f.BaseSearchResult = it;
797
+ f.BaseSearchResults = vn;
798
+ f.Button = M;
799
+ f.ClearInputButton = $;
800
+ f.ErrorMessage = O;
801
+ f.Input = P;
802
+ f.InputCaption = q;
803
+ f.InputIcon = A;
804
+ f.InputLabel = W;
805
+ f.Provider = ut;
679
806
  export {
680
- wn as AutoSearchForm,
681
- Dn as BaseSearchForm,
682
- Z as BaseSearchResult,
683
- Yn as BaseSearchResults,
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
807
+ Jt as AutoSearchForm,
808
+ rn as BaseSearchForm,
809
+ it as BaseSearchResult,
810
+ vn as BaseSearchResults,
811
+ M as Button,
812
+ O as ErrorMessage,
813
+ P as Input,
814
+ W as InputLabel,
815
+ yn as SearchcraftCore,
816
+ f as default,
817
+ S as useSearchcraft,
818
+ b as useTheme
691
819
  };
692
820
  //# sourceMappingURL=index.js.map