@searchcraft/javascript-sdk 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +7 -1
  2. package/dist/cjs/{index-d4b4a45e.js → index-a81df4f0.js} +29 -113
  3. package/dist/{components/p-6cafd48d.js.map → cjs/index-a81df4f0.js.map} +1 -1
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +91 -44
  7. package/dist/cjs/searchcraft-base-search-result.cjs.entry.js.map +1 -1
  8. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +74 -50
  9. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
  10. package/dist/cjs/searchcraft-button_3.cjs.entry.js +37 -36
  11. package/dist/cjs/searchcraft-button_3.cjs.entry.js.map +1 -1
  12. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +141 -119
  13. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
  14. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +11 -14
  15. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
  16. package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +127 -92
  17. package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -1
  18. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
  19. package/dist/cjs/searchcraft-popover-button.cjs.entry.js +3 -7
  20. package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -1
  21. package/dist/cjs/searchcraft-popover-form.cjs.entry.js +81 -75
  22. package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
  23. package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +29 -6
  24. package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +1 -1
  25. package/dist/cjs/searchcraft-results-info.cjs.entry.js +9 -13
  26. package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
  27. package/dist/cjs/searchcraft-theme.cjs.entry.js +38 -0
  28. package/dist/cjs/searchcraft-theme.cjs.entry.js.map +1 -0
  29. package/dist/cjs/{store-abe47006.js → store-f6ba3dfb.js} +26 -10
  30. package/dist/cjs/{store-abe47006.js.map → store-f6ba3dfb.js.map} +1 -1
  31. package/dist/collection/collection-manifest.json +1 -0
  32. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +102 -62
  33. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
  34. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +77 -61
  35. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  36. package/dist/collection/components/searchcraft-button/searchcraft-button.js +26 -30
  37. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
  38. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +6 -12
  39. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
  40. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +59 -51
  41. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
  42. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +9 -20
  43. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
  44. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +109 -87
  45. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
  46. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +10 -20
  47. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
  48. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +1 -11
  49. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +1 -1
  50. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +81 -82
  51. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
  52. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +35 -17
  53. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -1
  54. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +17 -19
  55. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +1 -1
  56. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +7 -19
  57. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
  58. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +57 -65
  59. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
  60. package/dist/collection/components/searchcraft-theme/searchcraft-theme.js +27 -0
  61. package/dist/collection/components/searchcraft-theme/searchcraft-theme.js.map +1 -0
  62. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +23 -26
  63. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
  64. package/dist/collection/index.js.map +1 -1
  65. package/dist/collection/provider/store.js +25 -9
  66. package/dist/collection/provider/store.js.map +1 -1
  67. package/dist/collection/utils/facets.js +5 -3
  68. package/dist/collection/utils/facets.js.map +1 -1
  69. package/dist/components/index.js +4 -2
  70. package/dist/components/index.js.map +1 -1
  71. package/dist/components/p-0ef4ab33.js +66 -0
  72. package/dist/components/p-0ef4ab33.js.map +1 -0
  73. package/dist/components/p-1234974c.js +72 -0
  74. package/dist/components/p-1234974c.js.map +1 -0
  75. package/dist/components/p-4b92ae26.js +109 -0
  76. package/dist/components/p-4b92ae26.js.map +1 -0
  77. package/dist/components/{p-e1cf5f9d.js → p-506cdac1.js} +18 -14
  78. package/dist/components/p-506cdac1.js.map +1 -0
  79. package/dist/components/p-521fe971.js +60 -0
  80. package/dist/components/p-521fe971.js.map +1 -0
  81. package/dist/components/{p-6cafd48d.js → p-5365011f.js} +30 -123
  82. package/dist/components/p-5365011f.js.map +1 -0
  83. package/dist/components/p-54998882.js +285 -0
  84. package/dist/components/p-54998882.js.map +1 -0
  85. package/dist/{esm/store-712f0586.js → components/p-936e2ed4.js} +26 -10
  86. package/dist/components/{p-01dc5b3b.js.map → p-936e2ed4.js.map} +1 -1
  87. package/dist/components/p-a75ef832.js +34 -0
  88. package/dist/components/p-a75ef832.js.map +1 -0
  89. package/dist/components/p-b4a8fcbe.js +144 -0
  90. package/dist/components/p-b4a8fcbe.js.map +1 -0
  91. package/dist/components/p-ca881e5c.js +37 -0
  92. package/dist/components/p-ca881e5c.js.map +1 -0
  93. package/dist/components/p-d95bc2a0.js +284 -0
  94. package/dist/components/p-d95bc2a0.js.map +1 -0
  95. package/dist/components/searchcraft-base-search-result.js +1 -1
  96. package/dist/components/searchcraft-base-search-results.js +76 -52
  97. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  98. package/dist/components/searchcraft-button.js +1 -1
  99. package/dist/components/searchcraft-error-message.js +1 -1
  100. package/dist/components/searchcraft-facet-list.js +1 -1
  101. package/dist/components/searchcraft-filter-panel.js +14 -17
  102. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  103. package/dist/components/searchcraft-input-form.js +1 -1
  104. package/dist/components/searchcraft-input-label.js +1 -1
  105. package/dist/components/searchcraft-popover-button.js +3 -7
  106. package/dist/components/searchcraft-popover-button.js.map +1 -1
  107. package/dist/components/searchcraft-popover-form.js +87 -81
  108. package/dist/components/searchcraft-popover-form.js.map +1 -1
  109. package/dist/components/searchcraft-popover-list-item.js +1 -1
  110. package/dist/components/searchcraft-popover-list-view.js +1 -1
  111. package/dist/components/searchcraft-results-info.js +9 -13
  112. package/dist/components/searchcraft-results-info.js.map +1 -1
  113. package/dist/components/searchcraft-slider.js +1 -1
  114. package/dist/components/searchcraft-theme.d.ts +11 -0
  115. package/dist/components/searchcraft-theme.js +51 -0
  116. package/dist/components/searchcraft-theme.js.map +1 -0
  117. package/dist/components/searchcraft-toggle-button.js +1 -1
  118. package/dist/esm/{index-56b713de.js → index-3608c57d.js} +29 -113
  119. package/dist/esm/index-3608c57d.js.map +1 -0
  120. package/dist/esm/index.js +1 -1
  121. package/dist/esm/loader.js +3 -3
  122. package/dist/esm/searchcraft-base-search-result.entry.js +91 -44
  123. package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
  124. package/dist/esm/searchcraft-base-search-results.entry.js +74 -50
  125. package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
  126. package/dist/esm/searchcraft-button_3.entry.js +37 -36
  127. package/dist/esm/searchcraft-button_3.entry.js.map +1 -1
  128. package/dist/esm/searchcraft-facet-list_3.entry.js +141 -119
  129. package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
  130. package/dist/esm/searchcraft-filter-panel.entry.js +11 -14
  131. package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
  132. package/dist/esm/searchcraft-input-form_2.entry.js +127 -92
  133. package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -1
  134. package/dist/esm/searchcraft-javascript-sdk.js +3 -3
  135. package/dist/esm/searchcraft-popover-button.entry.js +3 -7
  136. package/dist/esm/searchcraft-popover-button.entry.js.map +1 -1
  137. package/dist/esm/searchcraft-popover-form.entry.js +81 -75
  138. package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
  139. package/dist/esm/searchcraft-popover-list-item.entry.js +29 -6
  140. package/dist/esm/searchcraft-popover-list-item.entry.js.map +1 -1
  141. package/dist/esm/searchcraft-results-info.entry.js +9 -13
  142. package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
  143. package/dist/esm/searchcraft-theme.entry.js +34 -0
  144. package/dist/esm/searchcraft-theme.entry.js.map +1 -0
  145. package/dist/{components/p-01dc5b3b.js → esm/store-aa071d9c.js} +26 -10
  146. package/dist/esm/{store-712f0586.js.map → store-aa071d9c.js.map} +1 -1
  147. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  148. package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js +2 -0
  149. package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js.map +1 -0
  150. package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js +2 -0
  151. package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js.map +1 -0
  152. package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js +2 -0
  153. package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js.map +1 -0
  154. package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js +2 -0
  155. package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js.map +1 -0
  156. package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js +2 -0
  157. package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js.map +1 -0
  158. package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js +2 -0
  159. package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js.map +1 -0
  160. package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js +2 -0
  161. package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js.map +1 -0
  162. package/dist/searchcraft-javascript-sdk/p-7e13c128.js +3 -0
  163. package/dist/searchcraft-javascript-sdk/p-7e13c128.js.map +1 -0
  164. package/dist/searchcraft-javascript-sdk/p-8b0a60b3.entry.js +2 -0
  165. package/dist/searchcraft-javascript-sdk/p-8b0a60b3.entry.js.map +1 -0
  166. package/dist/searchcraft-javascript-sdk/{p-01dc5b3b.js → p-936e2ed4.js} +2 -2
  167. package/dist/searchcraft-javascript-sdk/{p-01dc5b3b.js.map → p-936e2ed4.js.map} +1 -1
  168. package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js +2 -0
  169. package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js.map +1 -0
  170. package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js +2 -0
  171. package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js.map +1 -0
  172. package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js +2 -0
  173. package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js.map +1 -0
  174. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  175. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  176. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +1 -0
  177. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +2 -1
  178. package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +1 -0
  179. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +1 -0
  180. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +2 -1
  181. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +1 -0
  182. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +7 -10
  183. package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +2 -1
  184. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -0
  185. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +2 -1
  186. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +2 -0
  187. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -0
  188. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +1 -0
  189. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +2 -1
  190. package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +5 -0
  191. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
  192. package/dist/types/components.d.ts +17 -4
  193. package/dist/types/index.d.ts +2 -1
  194. package/dist/types/provider/store.d.ts +1 -0
  195. package/dist/types/types/_shared.types.d.ts +1 -0
  196. package/dist/types/types/index.d.ts +1 -0
  197. package/dist/types/types/raw.d.ts +4 -0
  198. package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -0
  199. package/dist/types/types/searchcraft-filter-panel.types.d.ts +1 -0
  200. package/dist/types/types/searchcraft-popover-form.types.d.ts +1 -0
  201. package/dist/types/utils/facets.d.ts +1 -0
  202. package/dist/types/utils/index.d.ts +1 -0
  203. package/dist/types/utils/styles.d.ts +1 -0
  204. package/dist/types/utils/units.d.ts +1 -0
  205. package/package.json +5 -4
  206. package/dist/cjs/index-d4b4a45e.js.map +0 -1
  207. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -227
  208. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -179
  209. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -174
  210. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -158
  211. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +0 -266
  212. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +0 -168
  213. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.module.css +0 -293
  214. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -159
  215. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.module.css +0 -0
  216. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.module.css +0 -322
  217. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.css +0 -209
  218. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.module.css +0 -0
  219. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -169
  220. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +0 -231
  221. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -207
  222. package/dist/components/p-1ae87308.js +0 -43
  223. package/dist/components/p-1ae87308.js.map +0 -1
  224. package/dist/components/p-649654b5.js +0 -268
  225. package/dist/components/p-649654b5.js.map +0 -1
  226. package/dist/components/p-662cb490.js +0 -67
  227. package/dist/components/p-662cb490.js.map +0 -1
  228. package/dist/components/p-87d1611b.js +0 -97
  229. package/dist/components/p-87d1611b.js.map +0 -1
  230. package/dist/components/p-c273e43d.js +0 -40
  231. package/dist/components/p-c273e43d.js.map +0 -1
  232. package/dist/components/p-cc9f8c61.js +0 -109
  233. package/dist/components/p-cc9f8c61.js.map +0 -1
  234. package/dist/components/p-cf096782.js +0 -56
  235. package/dist/components/p-cf096782.js.map +0 -1
  236. package/dist/components/p-da5b92ef.js +0 -253
  237. package/dist/components/p-da5b92ef.js.map +0 -1
  238. package/dist/components/p-e1cf5f9d.js.map +0 -1
  239. package/dist/components/p-f5a06210.js +0 -34
  240. package/dist/components/p-f5a06210.js.map +0 -1
  241. package/dist/esm/index-56b713de.js.map +0 -1
  242. package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js +0 -2
  243. package/dist/searchcraft-javascript-sdk/p-117fcdd3.entry.js.map +0 -1
  244. package/dist/searchcraft-javascript-sdk/p-129e6f2c.js +0 -3
  245. package/dist/searchcraft-javascript-sdk/p-129e6f2c.js.map +0 -1
  246. package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js +0 -2
  247. package/dist/searchcraft-javascript-sdk/p-27cb401c.entry.js.map +0 -1
  248. package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js +0 -2
  249. package/dist/searchcraft-javascript-sdk/p-4df4a29e.entry.js.map +0 -1
  250. package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js +0 -2
  251. package/dist/searchcraft-javascript-sdk/p-54248dd8.entry.js.map +0 -1
  252. package/dist/searchcraft-javascript-sdk/p-69430dbf.entry.js +0 -2
  253. package/dist/searchcraft-javascript-sdk/p-69430dbf.entry.js.map +0 -1
  254. package/dist/searchcraft-javascript-sdk/p-a460755d.entry.js +0 -2
  255. package/dist/searchcraft-javascript-sdk/p-a460755d.entry.js.map +0 -1
  256. package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js +0 -2
  257. package/dist/searchcraft-javascript-sdk/p-bc2c4259.entry.js.map +0 -1
  258. package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.js +0 -2
  259. package/dist/searchcraft-javascript-sdk/p-caecdcda.entry.js.map +0 -1
  260. package/dist/searchcraft-javascript-sdk/p-f8129731.entry.js +0 -2
  261. package/dist/searchcraft-javascript-sdk/p-f8129731.entry.js.map +0 -1
  262. package/dist/searchcraft-javascript-sdk/p-f839b682.entry.js +0 -2
  263. package/dist/searchcraft-javascript-sdk/p-f839b682.entry.js.map +0 -1
@@ -1,77 +1,52 @@
1
- import { p as proxyCustomElement, H, h } from './p-6cafd48d.js';
1
+ import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
2
  import { c as classNames } from './p-5cdc6210.js';
3
- import { u as useSearchcraftStore } from './p-01dc5b3b.js';
4
- import { d as defineCustomElement$7 } from './p-cf096782.js';
5
- import { d as defineCustomElement$6 } from './p-f5a06210.js';
6
- import { d as defineCustomElement$5 } from './p-da5b92ef.js';
7
- import { d as defineCustomElement$4 } from './p-c273e43d.js';
8
- import { d as defineCustomElement$3 } from './p-1ae87308.js';
9
- import { d as defineCustomElement$2 } from './p-e1cf5f9d.js';
10
-
11
- const searchcraftPopoverFormModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px;border-radius:calc(var(--sc-popover-form-border-radius) * 0.8)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media (min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:transparent}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius) * 0.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0, 0, 0, 0.5);display:none}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media (min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media (min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius) * 0.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}";
12
- const SearchcraftPopoverFormStyle0 = searchcraftPopoverFormModuleCss;
3
+ import { u as useSearchcraftStore } from './p-936e2ed4.js';
4
+ import { d as defineCustomElement$7 } from './p-521fe971.js';
5
+ import { d as defineCustomElement$6 } from './p-a75ef832.js';
6
+ import { d as defineCustomElement$5 } from './p-d95bc2a0.js';
7
+ import { d as defineCustomElement$4 } from './p-ca881e5c.js';
8
+ import { d as defineCustomElement$3 } from './p-0ef4ab33.js';
9
+ import { d as defineCustomElement$2 } from './p-506cdac1.js';
13
10
 
14
11
  const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class SearchcraftPopoverForm extends H {
15
12
  constructor() {
16
13
  super();
17
14
  this.__registerHost();
18
- /**
19
- * The type of popover form to render.
20
- *
21
- * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.
22
- * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.
23
- * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
24
- */
25
- this.type = 'inline';
26
- /**
27
- * The hotkey that activates the popover.
28
- */
29
- this.hotkey = 'k';
30
- /**
31
- * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
32
- */
33
- this.hotkeyModifier = 'meta';
34
- this.isPopoverVisibleInState = false;
35
- this.isFocused = false;
36
- this.breakpointSm = 576;
37
- this.breakpointMd = 768;
38
- this.breakpointLg = 992;
39
- this.handleDocumentClick = (event) => {
40
- if (!this.hostElement.contains(event.target)) {
41
- this.isFocused = false;
42
- }
43
- };
44
- /**
45
- * Actions to perform when various keys are pressed within the popover form.
46
- */
47
- this.handleDocumentKeyDown = (event) => {
48
- // Document-scoped actions
49
- if (event.key === this.hotkey) {
50
- this.handleHotkeyPressed(event);
51
- }
52
- // Document-scoped -> Popover-scoped keyboard event boundary
53
- if (!this.hostElement.contains(document.activeElement)) {
54
- return;
55
- }
56
- // Popover-scoped actions
57
- switch (event.key) {
58
- case 'ArrowDown':
59
- case 'ArrowUp':
60
- event.preventDefault();
61
- this.focusOnNextListItem(event.key);
62
- break;
63
- case 'Escape':
64
- useSearchcraftStore.getState().setPopoverVisibility(false);
65
- break;
66
- default:
67
- return;
68
- }
69
- };
70
- this.handleInputInit = () => {
71
- const input = this.hostElement.querySelector('.searchcraft-input');
72
- input === null || input === void 0 ? void 0 : input.focus();
73
- };
74
15
  }
16
+ /**
17
+ * The Searchcraft config object.
18
+ */
19
+ config;
20
+ /**
21
+ * The type of popover form to render.
22
+ *
23
+ * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.
24
+ * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.
25
+ * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
26
+ */
27
+ type = 'inline';
28
+ /**
29
+ * Formats the content rendered for each result.
30
+ */
31
+ popoverResultMappings;
32
+ /**
33
+ * The hotkey that activates the popover.
34
+ */
35
+ hotkey = 'k';
36
+ /**
37
+ * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
38
+ */
39
+ hotkeyModifier = 'meta';
40
+ isPopoverVisibleInState = false;
41
+ unsubscribe;
42
+ searchResults;
43
+ searchTerm;
44
+ isFocused = false;
45
+ breakpointSm = 576;
46
+ breakpointMd = 768;
47
+ breakpointLg = 992;
48
+ modalElement;
49
+ get hostElement() { return this; }
75
50
  componentDidLoad() {
76
51
  // Loads the breakpoint values into state
77
52
  const computedStyle = getComputedStyle(document.documentElement);
@@ -89,16 +64,20 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
89
64
  if (this.isPopoverVisibleInState !== state.isPopoverVisible) {
90
65
  this.handlePopoverVisibilityChange(state.isPopoverVisible);
91
66
  }
92
- this.searchResults = Object.assign({}, state.searchResults);
67
+ this.searchResults = { ...state.searchResults };
93
68
  this.searchTerm = state.query;
94
69
  });
95
70
  }
96
71
  disconnectedCallback() {
97
- var _a;
98
- (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
72
+ this.unsubscribe?.();
99
73
  document.removeEventListener('click', this.handleDocumentClick);
100
74
  document.removeEventListener('keydown', this.handleDocumentKeyDown);
101
75
  }
76
+ handleDocumentClick = (event) => {
77
+ if (!this.hostElement.contains(event.target)) {
78
+ this.isFocused = false;
79
+ }
80
+ };
102
81
  /**
103
82
  * Handles when popover visibility is changed in state
104
83
  */
@@ -106,6 +85,36 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
106
85
  this.isPopoverVisibleInState = isVisible;
107
86
  document.body.style.overflow = isVisible ? 'hidden' : 'auto';
108
87
  }
88
+ /**
89
+ * Actions to perform when various keys are pressed within the popover form.
90
+ */
91
+ handleDocumentKeyDown = (event) => {
92
+ // Document-scoped actions
93
+ if (event.key === this.hotkey) {
94
+ this.handleHotkeyPressed(event);
95
+ }
96
+ // Document-scoped -> Popover-scoped keyboard event boundary
97
+ if (!this.hostElement.contains(document.activeElement)) {
98
+ return;
99
+ }
100
+ // Popover-scoped actions
101
+ switch (event.key) {
102
+ case 'ArrowDown':
103
+ case 'ArrowUp':
104
+ event.preventDefault();
105
+ this.focusOnNextListItem(event.key);
106
+ break;
107
+ case 'Escape':
108
+ useSearchcraftStore.getState().setPopoverVisibility(false);
109
+ break;
110
+ default:
111
+ return;
112
+ }
113
+ };
114
+ handleInputInit = () => {
115
+ const input = this.hostElement.querySelector('.searchcraft-input');
116
+ input?.focus();
117
+ };
109
118
  /**
110
119
  * When popover is `inline` and the viewport is at the smallest breakpoint,
111
120
  * focusing on the input will open a modal version of the popover form.
@@ -113,6 +122,7 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
113
122
  handleInputFocus() {
114
123
  this.isFocused = true;
115
124
  if (this.type === 'inline' &&
125
+ window.visualViewport &&
116
126
  window.visualViewport.width < this.breakpointSm) {
117
127
  useSearchcraftStore.getState().setPopoverVisibility(true);
118
128
  // Appends a popover form of type=`modal` to the body
@@ -139,7 +149,7 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
139
149
  event.preventDefault();
140
150
  if (this.type === 'inline' && !this.isPopoverVisibleInState) {
141
151
  const hostElementInput = this.hostElement.querySelector('.searchcraft-input');
142
- hostElementInput === null || hostElementInput === void 0 ? void 0 : hostElementInput.focus();
152
+ hostElementInput?.focus();
143
153
  }
144
154
  else {
145
155
  useSearchcraftStore
@@ -158,15 +168,14 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
158
168
  * @param direction
159
169
  */
160
170
  focusOnNextListItem(direction) {
161
- var _a, _b;
162
171
  const listItems = Array.from(document.querySelectorAll('a.searchcraft-popover-list-item')).filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);
163
172
  const currentIndex = listItems.indexOf(document.activeElement);
164
173
  if (direction === 'ArrowDown') {
165
- (_a = listItems[(currentIndex + 1) % listItems.length]) === null || _a === void 0 ? void 0 : _a.focus();
174
+ listItems[(currentIndex + 1) % listItems.length]?.focus();
166
175
  }
167
176
  else if (direction === 'ArrowUp') {
168
177
  if (currentIndex >= 1) {
169
- (_b = listItems[currentIndex - 1]) === null || _b === void 0 ? void 0 : _b.focus();
178
+ listItems[currentIndex - 1]?.focus();
170
179
  }
171
180
  else {
172
181
  const input = document.querySelector('.searchcraft-input');
@@ -181,9 +190,9 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
181
190
  }
182
191
  }
183
192
  get hasResultsToShow() {
184
- var _a, _b, _c, _d, _e;
185
- return (((_b = (_a = this.searchTerm) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
186
- ((_e = (_d = (_c = this.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.hits) === null || _e === void 0 ? void 0 : _e.length) > 0);
193
+ return (this.searchTerm &&
194
+ this.searchTerm?.trim()?.length > 0 &&
195
+ (this.searchResults?.data?.hits?.length || 0) > 0);
187
196
  }
188
197
  renderInlinePopover(documents) {
189
198
  const isListViewVisible = this.hasResultsToShow && this.isFocused;
@@ -206,8 +215,7 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
206
215
  }
207
216
  }
208
217
  render() {
209
- var _a, _b, _c;
210
- const documents = (_c = (_b = (_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.hits) === null || _c === void 0 ? void 0 : _c.map((data, _index) => {
218
+ const documents = this.searchResults?.data?.hits?.map((data, _index) => {
211
219
  const { doc: result } = data;
212
220
  return result;
213
221
  });
@@ -220,8 +228,6 @@ const SearchcraftPopoverForm$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
220
228
  return this.renderFullscreenPopover(documents);
221
229
  }
222
230
  }
223
- get hostElement() { return this; }
224
- static get style() { return SearchcraftPopoverFormStyle0; }
225
231
  }, [0, "searchcraft-popover-form", {
226
232
  "config": [16],
227
233
  "type": [1],
@@ -1 +1 @@
1
- {"file":"searchcraft-popover-form.js","mappings":";;;;;;;;;;AAAA,MAAM,+BAA+B,GAAG,+iPAA+iP,CAAC;AACxlP,qCAAe,+BAA+B;;MCyCjCA,wBAAsB;IALnC;;;;;;;;;;QAiBU,SAAI,GAAsC,QAAQ,CAAC;;;;QAQnD,WAAM,GAAG,GAAG,CAAC;;;;QAIb,mBAAc,GAAuC,MAAM,CAAC;QAE3D,4BAAuB,GAAG,KAAK,CAAC;QAIhC,cAAS,GAAG,KAAK,CAAC;QAClB,iBAAY,GAAG,GAAG,CAAC;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AAI,CAAC;YAC7B,OAAO,MAAM,CAAC;SACf,CAAC,CAAC;QAEL,QAAQ,IAAI,CAAC,IAAI;YACf,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAC7C,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YAC5C,KAAK,YAAY;gBACf,OAAO,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;SAClD;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SearchcraftPopoverForm"],"sources":["src/components/searchcraft-popover-form/searchcraft-popover-form.module.scss?tag=searchcraft-popover-form","src/components/searchcraft-popover-form/searchcraft-popover-form.tsx"],"sourcesContent":["/**\n * Styles applied to all popover form variants.\n */\n.searchcraft-popover-form {\n display: flex;\n flex-direction: column;\n flex: 1;\n\n & .searchcraft-popover-form-input-wrapper {\n padding: 12px;\n background-color: var(--sc-surface-neutral-secondary);\n display: flex;\n flex-direction: row;\n gap: 4px;\n }\n\n & .searchcraft-popover-form-input-wrapper > searchcraft-input-form {\n flex: 1;\n }\n\n & .searchcraft-popover-form-cancel-button {\n @include body();\n border: 0;\n outline: 0;\n padding: 0;\n flex-shrink: 0;\n background: none;\n cursor: pointer;\n padding-left: 12px;\n padding-right: 12px;\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n\n &:hover {\n background-color: var(--sc-surface-brand-secondary-hover);\n }\n\n &:focus {\n background-color: var(--sc-surface-brand-secondary-active);\n }\n }\n}\n\n/**\n * Styles applied to `inline` popover forms.\n */\n.searchcraft-popover-form-inline {\n & .searchcraft-input {\n border-top-left-radius: var(--sc-popover-form-border-radius);\n border-top-right-radius: var(--sc-popover-form-border-radius);\n border-bottom-left-radius: var(--sc-popover-form-border-radius);\n border-bottom-right-radius: var(--sc-popover-form-border-radius);\n border: none;\n outline: none;\n }\n\n &.searchcraft-popover-form-active .searchcraft-input {\n border-top-left-radius: var(--sc-popover-form-border-radius);\n border-top-right-radius: var(--sc-popover-form-border-radius);\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n & .searchcraft-popover-inline-wrapper-outer {\n position: relative;\n }\n\n & .searchcraft-popover-inline-wrapper-inner {\n position: absolute;\n height: var(--sc-popover-list-view-height);\n z-index: 1000;\n width: 100%;\n }\n\n & .searchcraft-popover-list-view {\n display: flex;\n flex-direction: column;\n overflow: auto;\n background-color: var(--sc-surface-neutral-secondary);\n border-bottom-left-radius: var(--sc-popover-form-border-radius);\n border-bottom-right-radius: var(--sc-popover-form-border-radius);\n max-height: var(--sc-popover-list-view-height)\n }\n}\n\n/**\n * Styles applied to `modal` popover forms.\n */\n.searchcraft-popover-form-modal {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n background-color: var(--sc-surface-neutral-secondary);\n\n @media (min-width: $breakpoint-sm) {\n padding: 16px;\n background-color: transparent;\n }\n\n & .searchcraft-input {\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n outline-width: 1px;\n outline-color: var(--sc-border-neutral);\n }\n\n & .searchcraft-popover-form-modal-backdrop {\n position: absolute;\n inset: 0;\n background-color: rgba(0,0,0, 0.5);\n display: none;\n\n @media (min-width: $breakpoint-sm) {\n display: block;\n }\n }\n\n & .searchcraft-popover-form-modal-inner {\n position: absolute;\n inset: 0;\n z-index: 1002;\n margin-top: 0px;\n display: flex;\n border-radius: var(--sc-popover-form-border-radius);\n overflow: hidden;\n\n @media (min-width: $breakpoint-sm) {\n inset: auto;\n position: relative;\n width: 100%;\n margin-top: 100px;\n max-width: var(--sc-popover-modal-max-width);\n }\n }\n\n & .searchcraft-popover-list-view {\n display: flex;\n flex-direction: column;\n overflow: auto;\n background-color: var(--sc-surface-neutral-secondary);\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n\n @media (min-width: $breakpoint-sm) {\n max-height: var(--sc-popover-list-view-height)\n }\n }\n\n & searchcraft-popover-list-view {\n overflow: scroll;\n\n @media (min-width: $breakpoint-sm) {\n overflow: auto;\n }\n }\n}\n\n/**\n * Styles applied to `fullscreen` popover forms.\n */\n.searchcraft-popover-form-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: var(--sc-surface-neutral-secondary);\n\n & .searchcraft-popover-form {\n position: absolute;\n inset: 0;\n }\n\n & .searchcraft-input {\n border-radius: calc(var(--sc-popover-form-border-radius) * 0.8);\n outline-width: 1px;\n outline-color: var(--sc-border-neutral);\n }\n\n & searchcraft-popover-list-view {\n overflow: scroll;\n }\n}\n","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport classNames from 'classnames';\nimport type { SearchcraftConfig, SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport type { PopoverResultMappings } from 'types';\n\n/**\n * This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-popover-form type=\"fullscreen\" />\n * ```\n *\n * ```js\n * // index.js\n * const popoverForm = document.querySelector('searchcraft-popover-form');\n *\n * popoverForm.config = {\n * index: [index_name_from_vektron],\n * readKey: 'read_key_from_vektron',\n * endpointUrl: 'enpoint_url_from_vektron',\n * };\n *\n * popoverForm.popoverResultMappings = {\n * containerHref: {\n * fieldNames: [\n * {\n * fieldName: 'canonical_link',\n * dataType: 'text',\n * },\n * ],\n * };\n * ```\n */\n@Component({\n tag: 'searchcraft-popover-form',\n styleUrl: 'searchcraft-popover-form.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverForm {\n /**\n * The Searchcraft config object.\n */\n @Prop() config: SearchcraftConfig | undefined;\n /**\n * The type of popover form to render.\n *\n * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.\n * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.\n * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.\n */\n @Prop() type: 'inline' | 'fullscreen' | 'modal' = 'inline';\n /**\n * Formats the content rendered for each result.\n */\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /**\n * The hotkey that activates the popover.\n */\n @Prop() hotkey = 'k';\n /**\n * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.\n */\n @Prop() hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option' = 'meta';\n\n @State() isPopoverVisibleInState = false;\n @State() unsubscribe: (() => void) | undefined;\n @State() searchResults: SearchcraftResponse | undefined;\n @State() searchTerm: string | undefined;\n @State() isFocused = false;\n @State() breakpointSm = 576;\n @State() breakpointMd = 768;\n @State() breakpointLg = 992;\n\n @State() modalElement;\n\n @Element() hostElement!: HTMLElement;\n\n componentDidLoad() {\n // Loads the breakpoint values into state\n const computedStyle = getComputedStyle(document.documentElement);\n this.breakpointSm = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-sm').trim(),\n );\n this.breakpointMd = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-md').trim(),\n );\n this.breakpointLg = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-lg').trim(),\n );\n // Set popover visiblity in state\n this.isPopoverVisibleInState =\n useSearchcraftStore.getState().isPopoverVisible;\n\n // Add event listeners\n document.addEventListener('click', this.handleDocumentClick);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n\n // Subscribe to state events\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (this.isPopoverVisibleInState !== state.isPopoverVisible) {\n this.handlePopoverVisibilityChange(state.isPopoverVisible);\n }\n\n this.searchResults = { ...state.searchResults };\n this.searchTerm = state.query;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n document.removeEventListener('click', this.handleDocumentClick);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n handleDocumentClick = (event: MouseEvent) => {\n if (!this.hostElement.contains(event.target as Node)) {\n this.isFocused = false;\n }\n };\n\n /**\n * Handles when popover visibility is changed in state\n */\n handlePopoverVisibilityChange(isVisible: boolean) {\n this.isPopoverVisibleInState = isVisible;\n document.body.style.overflow = isVisible ? 'hidden' : 'auto';\n }\n\n /**\n * Actions to perform when various keys are pressed within the popover form.\n */\n handleDocumentKeyDown = (event: KeyboardEvent) => {\n // Document-scoped actions\n if (event.key === this.hotkey) {\n this.handleHotkeyPressed(event);\n }\n\n // Document-scoped -> Popover-scoped keyboard event boundary\n if (!this.hostElement.contains(document.activeElement)) {\n return;\n }\n\n // Popover-scoped actions\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n this.focusOnNextListItem(event.key);\n break;\n case 'Escape':\n useSearchcraftStore.getState().setPopoverVisibility(false);\n break;\n default:\n return;\n }\n };\n\n handleInputInit = () => {\n const input = this.hostElement.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n input?.focus();\n };\n\n /**\n * When popover is `inline` and the viewport is at the smallest breakpoint,\n * focusing on the input will open a modal version of the popover form.\n */\n handleInputFocus() {\n this.isFocused = true;\n\n if (\n this.type === 'inline' &&\n window.visualViewport.width < this.breakpointSm\n ) {\n useSearchcraftStore.getState().setPopoverVisibility(true);\n\n // Appends a popover form of type=`modal` to the body\n if (!this.modalElement) {\n this.modalElement = document.createElement('searchcraft-popover-form');\n this.modalElement.config = this.config;\n this.modalElement.popoverResultMappings = this.popoverResultMappings;\n this.modalElement.setAttribute('type', 'fullscreen');\n document.body.appendChild(this.modalElement);\n }\n }\n }\n\n handleModalBackdropClick(_event: MouseEvent) {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * When a hotkey is pressed, tests if the modifiers also match.\n * If modifiers match, toggles visibility of the popover modal.\n */\n handleHotkeyPressed(event: KeyboardEvent) {\n if (\n (event.ctrlKey && this.hotkeyModifier === 'ctrl') ||\n (event.altKey && this.hotkeyModifier === 'alt') ||\n (event.metaKey && this.hotkeyModifier === 'meta')\n ) {\n event.preventDefault();\n if (this.type === 'inline' && !this.isPopoverVisibleInState) {\n const hostElementInput = this.hostElement.querySelector(\n '.searchcraft-input',\n ) as HTMLInputElement | undefined;\n hostElementInput?.focus();\n } else {\n useSearchcraftStore\n .getState()\n .setPopoverVisibility(!this.isPopoverVisibleInState);\n }\n }\n }\n\n handleCancelButtonClick() {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * Moves focus to the next/previous list item in the list view. If you are at the top\n * of the list view, it moves focus back to the input.\n *\n * @param direction\n */\n focusOnNextListItem(direction: 'ArrowDown' | 'ArrowUp') {\n const listItems = Array.from(\n document.querySelectorAll<HTMLAnchorElement>(\n 'a.searchcraft-popover-list-item',\n ),\n ).filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);\n\n const currentIndex = listItems.indexOf(\n document.activeElement as HTMLAnchorElement,\n );\n\n if (direction === 'ArrowDown') {\n listItems[(currentIndex + 1) % listItems.length]?.focus();\n } else if (direction === 'ArrowUp') {\n if (currentIndex >= 1) {\n listItems[currentIndex - 1]?.focus();\n } else {\n const input = document.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n\n if (input) {\n input.focus();\n requestAnimationFrame(() => {\n input.selectionEnd = input.value.length;\n input.selectionStart = input.value.length;\n });\n }\n }\n }\n }\n\n get hasResultsToShow() {\n return (\n this.searchTerm?.trim()?.length > 0 &&\n this.searchResults?.data?.hits?.length > 0\n );\n }\n\n renderInlinePopover(documents: Record<string, unknown>[]) {\n const isListViewVisible = this.hasResultsToShow && this.isFocused;\n\n const popoverFormClassNames = classNames(\n 'searchcraft-popover-form searchcraft-popover-form-inline',\n {\n 'searchcraft-popover-form-active': isListViewVisible,\n },\n );\n\n return (\n <div class={popoverFormClassNames}>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n />\n {isListViewVisible && (\n <div class='searchcraft-popover-inline-wrapper-outer'>\n <div class='searchcraft-popover-inline-wrapper-inner'>\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n </div>\n </div>\n )}\n </div>\n );\n }\n\n renderModalPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n const popoverFormClassNames = classNames('searchcraft-popover-form', {\n 'searchcraft-popover-form-active': this.hasResultsToShow,\n });\n\n return (\n <div class='searchcraft-popover-form-modal'>\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}\n <div\n class='searchcraft-popover-form-modal-backdrop'\n onClick={this.handleModalBackdropClick}\n />\n <div class='searchcraft-popover-form-modal-inner'>\n <div class={popoverFormClassNames}>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n </div>\n );\n }\n }\n\n renderFullscreenPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n return (\n <div class='searchcraft-popover-form-fullscreen'>\n <div class='searchcraft-popover-form'>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n );\n }\n }\n\n render() {\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n switch (this.type) {\n case 'inline':\n return this.renderInlinePopover(documents);\n case 'modal':\n return this.renderModalPopover(documents);\n case 'fullscreen':\n return this.renderFullscreenPopover(documents);\n }\n }\n}\n"],"version":3}
1
+ {"file":"searchcraft-popover-form.js","mappings":";;;;;;;;;;MAyCaA,wBAAsB;;;;;;;;IAIzB,MAAM,CAAgC;;;;;;;;IAQtC,IAAI,GAAsC,QAAQ,CAAC;;;;IAInD,qBAAqB,CAAoC;;;;IAIzD,MAAM,GAAG,GAAG,CAAC;;;;IAIb,cAAc,GAAuC,MAAM,CAAC;IAE3D,uBAAuB,GAAG,KAAK,CAAC;IAChC,WAAW,CAA2B;IACtC,aAAa,CAAkC;IAC/C,UAAU,CAAqB;IAC/B,SAAS,GAAG,KAAK,CAAC;IAClB,YAAY,GAAG,GAAG,CAAC;IACnB,YAAY,GAAG,GAAG,CAAC;IACnB,YAAY,GAAG,GAAG,CAAC;IAEnB,YAAY,CAAC;;IAItB,gBAAgB;;QAEd,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CACnC,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAC5D,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CACnC,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAC5D,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CACnC,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAC5D,CAAC;;QAEF,IAAI,CAAC,uBAAuB;YAC1B,mBAAmB,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAAC;;QAGlD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,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AAC,GAC5C,EACF,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,wCAAwC,EAC9C,OAAO,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,aAGzC,CACL,EACL,IAAI,CAAC,gBAAgB,KACpB,qCACE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,SAAS,EAAE,SAAS,GACpB,CACH,CACG,CACF,EACN;SACH;KACF;IAED,MAAM;QACJ,MAAM,SAAS,GACb,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM;YAC/C,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;YAC7B,OAAO,MAAM,CAAC;SACf,CAA8B,CAAC;QAElC,QAAQ,IAAI,CAAC,IAAI;YACf,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAC7C,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YAC5C,KAAK,YAAY;gBACf,OAAO,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;SAClD;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SearchcraftPopoverForm"],"sources":["src/components/searchcraft-popover-form/searchcraft-popover-form.tsx"],"sourcesContent":["import { Component, Element, Prop, State, h } from '@stencil/core';\nimport classNames from 'classnames';\nimport type { SearchcraftConfig, SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport type { PopoverResultMappings } from 'types';\n\n/**\n * This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-popover-form type=\"fullscreen\" />\n * ```\n *\n * ```js\n * // index.js\n * const popoverForm = document.querySelector('searchcraft-popover-form');\n *\n * popoverForm.config = {\n * index: [index_name_from_vektron],\n * readKey: 'read_key_from_vektron',\n * endpointUrl: 'enpoint_url_from_vektron',\n * };\n *\n * popoverForm.popoverResultMappings = {\n * containerHref: {\n * fieldNames: [\n * {\n * fieldName: 'canonical_link',\n * dataType: 'text',\n * },\n * ],\n * };\n * ```\n */\n@Component({\n tag: 'searchcraft-popover-form',\n shadow: false,\n})\nexport class SearchcraftPopoverForm {\n /**\n * The Searchcraft config object.\n */\n @Prop() config: SearchcraftConfig | undefined;\n /**\n * The type of popover form to render.\n *\n * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.\n * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.\n * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.\n */\n @Prop() type: 'inline' | 'fullscreen' | 'modal' = 'inline';\n /**\n * Formats the content rendered for each result.\n */\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /**\n * The hotkey that activates the popover.\n */\n @Prop() hotkey = 'k';\n /**\n * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.\n */\n @Prop() hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option' = 'meta';\n\n @State() isPopoverVisibleInState = false;\n @State() unsubscribe: (() => void) | undefined;\n @State() searchResults: SearchcraftResponse | undefined;\n @State() searchTerm: string | undefined;\n @State() isFocused = false;\n @State() breakpointSm = 576;\n @State() breakpointMd = 768;\n @State() breakpointLg = 992;\n\n @State() modalElement;\n\n @Element() hostElement!: HTMLElement;\n\n componentDidLoad() {\n // Loads the breakpoint values into state\n const computedStyle = getComputedStyle(document.documentElement);\n this.breakpointSm = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-sm').trim(),\n );\n this.breakpointMd = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-md').trim(),\n );\n this.breakpointLg = Number.parseFloat(\n computedStyle.getPropertyValue('--sc-breakpoint-lg').trim(),\n );\n // Set popover visiblity in state\n this.isPopoverVisibleInState =\n useSearchcraftStore.getState().isPopoverVisible;\n\n // Add event listeners\n document.addEventListener('click', this.handleDocumentClick);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n\n // Subscribe to state events\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (this.isPopoverVisibleInState !== state.isPopoverVisible) {\n this.handlePopoverVisibilityChange(state.isPopoverVisible);\n }\n\n this.searchResults = { ...state.searchResults } as SearchcraftResponse;\n this.searchTerm = state.query;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n document.removeEventListener('click', this.handleDocumentClick);\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n handleDocumentClick = (event: MouseEvent) => {\n if (!this.hostElement.contains(event.target as Node)) {\n this.isFocused = false;\n }\n };\n\n /**\n * Handles when popover visibility is changed in state\n */\n handlePopoverVisibilityChange(isVisible: boolean) {\n this.isPopoverVisibleInState = isVisible;\n document.body.style.overflow = isVisible ? 'hidden' : 'auto';\n }\n\n /**\n * Actions to perform when various keys are pressed within the popover form.\n */\n handleDocumentKeyDown = (event: KeyboardEvent) => {\n // Document-scoped actions\n if (event.key === this.hotkey) {\n this.handleHotkeyPressed(event);\n }\n\n // Document-scoped -> Popover-scoped keyboard event boundary\n if (!this.hostElement.contains(document.activeElement)) {\n return;\n }\n\n // Popover-scoped actions\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n this.focusOnNextListItem(event.key);\n break;\n case 'Escape':\n useSearchcraftStore.getState().setPopoverVisibility(false);\n break;\n default:\n return;\n }\n };\n\n handleInputInit = () => {\n const input = this.hostElement.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n input?.focus();\n };\n\n /**\n * When popover is `inline` and the viewport is at the smallest breakpoint,\n * focusing on the input will open a modal version of the popover form.\n */\n handleInputFocus() {\n this.isFocused = true;\n\n if (\n this.type === 'inline' &&\n window.visualViewport &&\n window.visualViewport.width < this.breakpointSm\n ) {\n useSearchcraftStore.getState().setPopoverVisibility(true);\n\n // Appends a popover form of type=`modal` to the body\n if (!this.modalElement) {\n this.modalElement = document.createElement('searchcraft-popover-form');\n this.modalElement.config = this.config;\n this.modalElement.popoverResultMappings = this.popoverResultMappings;\n this.modalElement.setAttribute('type', 'fullscreen');\n document.body.appendChild(this.modalElement);\n }\n }\n }\n\n handleModalBackdropClick(_event: MouseEvent) {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * When a hotkey is pressed, tests if the modifiers also match.\n * If modifiers match, toggles visibility of the popover modal.\n */\n handleHotkeyPressed(event: KeyboardEvent) {\n if (\n (event.ctrlKey && this.hotkeyModifier === 'ctrl') ||\n (event.altKey && this.hotkeyModifier === 'alt') ||\n (event.metaKey && this.hotkeyModifier === 'meta')\n ) {\n event.preventDefault();\n if (this.type === 'inline' && !this.isPopoverVisibleInState) {\n const hostElementInput = this.hostElement.querySelector(\n '.searchcraft-input',\n ) as HTMLInputElement | undefined;\n hostElementInput?.focus();\n } else {\n useSearchcraftStore\n .getState()\n .setPopoverVisibility(!this.isPopoverVisibleInState);\n }\n }\n }\n\n handleCancelButtonClick() {\n useSearchcraftStore.getState().setPopoverVisibility(false);\n }\n\n /**\n * Moves focus to the next/previous list item in the list view. If you are at the top\n * of the list view, it moves focus back to the input.\n *\n * @param direction\n */\n focusOnNextListItem(direction: 'ArrowDown' | 'ArrowUp') {\n const listItems = Array.from(\n document.querySelectorAll<HTMLAnchorElement>(\n 'a.searchcraft-popover-list-item',\n ),\n ).filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);\n\n const currentIndex = listItems.indexOf(\n document.activeElement as HTMLAnchorElement,\n );\n\n if (direction === 'ArrowDown') {\n listItems[(currentIndex + 1) % listItems.length]?.focus();\n } else if (direction === 'ArrowUp') {\n if (currentIndex >= 1) {\n listItems[currentIndex - 1]?.focus();\n } else {\n const input = document.querySelector('.searchcraft-input') as\n | HTMLInputElement\n | undefined;\n\n if (input) {\n input.focus();\n requestAnimationFrame(() => {\n input.selectionEnd = input.value.length;\n input.selectionStart = input.value.length;\n });\n }\n }\n }\n }\n\n get hasResultsToShow() {\n return (\n this.searchTerm &&\n this.searchTerm?.trim()?.length > 0 &&\n (this.searchResults?.data?.hits?.length || 0) > 0\n );\n }\n\n renderInlinePopover(documents: Record<string, unknown>[]) {\n const isListViewVisible = this.hasResultsToShow && this.isFocused;\n\n const popoverFormClassNames = classNames(\n 'searchcraft-popover-form searchcraft-popover-form-inline',\n {\n 'searchcraft-popover-form-active': isListViewVisible,\n },\n );\n\n return (\n <div class={popoverFormClassNames}>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n />\n {isListViewVisible && (\n <div class='searchcraft-popover-inline-wrapper-outer'>\n <div class='searchcraft-popover-inline-wrapper-inner'>\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n </div>\n </div>\n )}\n </div>\n );\n }\n\n renderModalPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n const popoverFormClassNames = classNames('searchcraft-popover-form', {\n 'searchcraft-popover-form-active': this.hasResultsToShow,\n });\n\n return (\n <div class='searchcraft-popover-form-modal'>\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}\n <div\n class='searchcraft-popover-form-modal-backdrop'\n onClick={this.handleModalBackdropClick}\n />\n <div class='searchcraft-popover-form-modal-inner'>\n <div class={popoverFormClassNames}>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n </div>\n );\n }\n }\n\n renderFullscreenPopover(documents: Record<string, unknown>[]) {\n if (this.isPopoverVisibleInState) {\n return (\n <div class='searchcraft-popover-form-fullscreen'>\n <div class='searchcraft-popover-form'>\n <div class='searchcraft-popover-form-input-wrapper'>\n <searchcraft-input-form\n config={this.config}\n onInputFocus={this.handleInputFocus.bind(this)}\n onInputInit={this.handleInputInit.bind(this)}\n />\n <button\n type='button'\n class='searchcraft-popover-form-cancel-button'\n onClick={this.handleCancelButtonClick.bind(this)}\n >\n Cancel\n </button>\n </div>\n {this.hasResultsToShow && (\n <searchcraft-popover-list-view\n popoverResultMappings={this.popoverResultMappings}\n documents={documents}\n />\n )}\n </div>\n </div>\n );\n }\n }\n\n render() {\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n }) as Record<string, unknown>[];\n\n switch (this.type) {\n case 'inline':\n return this.renderInlinePopover(documents);\n case 'modal':\n return this.renderModalPopover(documents);\n case 'fullscreen':\n return this.renderFullscreenPopover(documents);\n }\n }\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
- import { S as SearchcraftPopoverListItem$1, d as defineCustomElement$1 } from './p-1ae87308.js';
1
+ import { S as SearchcraftPopoverListItem$1, d as defineCustomElement$1 } from './p-0ef4ab33.js';
2
2
 
3
3
  const SearchcraftPopoverListItem = SearchcraftPopoverListItem$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { S as SearchcraftPopoverListView$1, d as defineCustomElement$1 } from './p-e1cf5f9d.js';
1
+ import { S as SearchcraftPopoverListView$1, d as defineCustomElement$1 } from './p-506cdac1.js';
2
2
 
3
3
  const SearchcraftPopoverListView = SearchcraftPopoverListView$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,25 +1,22 @@
1
- import { p as proxyCustomElement, H, h } from './p-6cafd48d.js';
2
- import { u as useSearchcraftStore } from './p-01dc5b3b.js';
1
+ import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
+ import { u as useSearchcraftStore } from './p-936e2ed4.js';
3
3
  import { f as formatNumberWithCommas } from './p-755f491b.js';
4
4
 
5
- const searchcraftResultsInfoModuleCss = ":root{--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px;--sc-popover-form-border-radius:8px;--sc-popover-list-view-height:400px;--sc-popover-list-item-image-size:60px;--sc-popover-list-item-padding-horizontal:8px;--sc-popover-list-item-padding-vertical:8px;--sc-popover-modal-max-width:570px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}:root{--sc-breakpoint-sm:576px;--sc-breakpoint-md:768px;--sc-breakpoint-lg:992px}.searchcraft-results-info-container{border-bottom:1px solid var(--sc-surface-disabled);display:flex;justify-content:flex-start}.searchcraft-results-info-content{color:var(--sc-content-primary);font-family:var(--sc-font-family);font-size:18px;font-weight:600;line-height:20px;margin:0px 0 8px}@media (max-width: 768px){.searchcraft-results-info-content{margin:0;margin-bottom:8px}}";
6
- const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
7
-
8
5
  const SearchcraftResultsInfo$1 = /*@__PURE__*/ proxyCustomElement(class SearchcraftResultsInfo extends H {
9
6
  constructor() {
10
7
  super();
11
8
  this.__registerHost();
12
- this.isRequesting = false;
13
- this.resultsCount = 0;
14
- this.responseTime = '';
15
- this.query = '';
16
9
  }
10
+ isRequesting = false;
11
+ resultsCount = 0;
12
+ responseTime = '';
13
+ query = '';
14
+ unsubscribe = () => { };
17
15
  connectedCallback() {
18
16
  this.unsubscribe = useSearchcraftStore.subscribe((state) => {
19
- var _a, _b, _c, _d;
20
17
  this.isRequesting = state.isRequesting;
21
- this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
22
- this.responseTime = ((((_d = (_c = state.searchResults) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.time_taken) || 0) * 1000).toFixed(2);
18
+ this.resultsCount = state.searchResults?.data?.count || 0;
19
+ this.responseTime = ((state.searchResults?.data?.time_taken || 0) * 1000).toFixed(2);
23
20
  this.query = state.query || '';
24
21
  });
25
22
  }
@@ -35,7 +32,6 @@ const SearchcraftResultsInfo$1 = /*@__PURE__*/ proxyCustomElement(class Searchcr
35
32
  const formattedResults = formatNumberWithCommas(this.resultsCount);
36
33
  return (h("div", { class: 'searchcraft-results-info-container' }, h("p", { class: 'searchcraft-results-info-content' }, formattedResults, " results found in ", this.responseTime, "ms")));
37
34
  }
38
- static get style() { return SearchcraftResultsInfoStyle0; }
39
35
  }, [0, "searchcraft-results-info", {
40
36
  "isRequesting": [32],
41
37
  "resultsCount": [32],
@@ -1 +1 @@
1
- {"file":"searchcraft-results-info.js","mappings":";;;;AAAA,MAAM,+BAA+B,GAAG,6rHAA6rH,CAAC;AACtuH,qCAAe,+BAA+B;;MCoBjCA,wBAAsB;IALnC;;;QAMW,iBAAY,GAAG,KAAK,CAAC;QACrB,iBAAY,GAAG,CAAC,CAAC;QACjB,iBAAY,GAAG,EAAE,CAAC;QAClB,UAAK,GAAG,EAAE,CAAC;KAkCrB;IA9BC,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK;;YACrD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,CAAA,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,IAAI,0CAAE,KAAK,KAAI,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,GAAG,CAClB,CAAC,CAAA,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,IAAI,0CAAE,UAAU,KAAI,CAAC,IAAI,IAAI,EACnD,OAAO,CAAC,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;SAChC,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;KACF;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE;YAC1C,OAAO,IAAI,CAAC;SACb;QACD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnE,QACE,WAAK,KAAK,EAAC,oCAAoC,IAC7C,SAAG,KAAK,EAAC,kCAAkC,IACxC,gBAAgB,wBAAoB,IAAI,CAAC,YAAY,OACpD,CACA,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SearchcraftResultsInfo"],"sources":["src/components/searchcraft-results-info/searchcraft-results-info.module.scss?tag=searchcraft-results-info","src/components/searchcraft-results-info/searchcraft-results-info.tsx"],"sourcesContent":[".searchcraft-results-info-container {\n border-bottom: 1px solid var(--sc-surface-disabled);\n display: flex;\n justify-content: flex-start;\n}\n\n.searchcraft-results-info-content {\n color: var(--sc-content-primary);\n font-family: var(--sc-font-family);\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n margin: 0px 0 8px;\n\n @media (max-width: $breakpoint-md) {\n margin: 0;\n margin-bottom: 8px;\n }\n}","import { Component, h, State } from '@stencil/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * This web component is designed to display the number of results returned from a search query.\n * It provides users with real-time feedback on the scale of the results, such as the total number of items found.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-results-info />\n * ```\n */\n@Component({\n tag: 'searchcraft-results-info',\n styleUrl: 'searchcraft-results-info.module.scss',\n shadow: false,\n})\nexport class SearchcraftResultsInfo {\n @State() isRequesting = false;\n @State() resultsCount = 0;\n @State() responseTime = '';\n @State() query = '';\n\n unsubscribe: () => void;\n\n connectedCallback() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.resultsCount = state.searchResults?.data?.count || 0;\n this.responseTime = (\n (state.searchResults?.data?.time_taken || 0) * 1000\n ).toFixed(2);\n this.query = state.query || '';\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n const formattedResults = formatNumberWithCommas(this.resultsCount);\n return (\n <div class='searchcraft-results-info-container'>\n <p class='searchcraft-results-info-content'>\n {formattedResults} results found in {this.responseTime}ms\n </p>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"searchcraft-results-info.js","mappings":";;;;MAoBaA,wBAAsB;;;;;IACxB,YAAY,GAAG,KAAK,CAAC;IACrB,YAAY,GAAG,CAAC,CAAC;IACjB,YAAY,GAAG,EAAE,CAAC;IAClB,KAAK,GAAG,EAAE,CAAC;IAEpB,WAAW,GAAe,SAAQ,CAAC;IAEnC,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAK;YACrD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,GAAG,CAClB,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,UAAU,IAAI,CAAC,IAAI,IAAI,EACnD,OAAO,CAAC,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;SAChC,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;KACF;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE;YAC1C,OAAO,IAAI,CAAC;SACb;QACD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnE,QACE,WAAK,KAAK,EAAC,oCAAoC,IAC7C,SAAG,KAAK,EAAC,kCAAkC,IACxC,gBAAgB,wBAAoB,IAAI,CAAC,YAAY,OACpD,CACA,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SearchcraftResultsInfo"],"sources":["src/components/searchcraft-results-info/searchcraft-results-info.tsx"],"sourcesContent":["import { Component, h, State } from '@stencil/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * This web component is designed to display the number of results returned from a search query.\n * It provides users with real-time feedback on the scale of the results, such as the total number of items found.\n *\n * ## Usage\n * ```html\n * <!-- index.html -->\n * <searchcraft-results-info />\n * ```\n */\n@Component({\n tag: 'searchcraft-results-info',\n shadow: false,\n})\nexport class SearchcraftResultsInfo {\n @State() isRequesting = false;\n @State() resultsCount = 0;\n @State() responseTime = '';\n @State() query = '';\n\n unsubscribe: () => void = () => {};\n\n connectedCallback() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.resultsCount = state.searchResults?.data?.count || 0;\n this.responseTime = (\n (state.searchResults?.data?.time_taken || 0) * 1000\n ).toFixed(2);\n this.query = state.query || '';\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n const formattedResults = formatNumberWithCommas(this.resultsCount);\n return (\n <div class='searchcraft-results-info-container'>\n <p class='searchcraft-results-info-content'>\n {formattedResults} results found in {this.responseTime}ms\n </p>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,4 +1,4 @@
1
- import { S as SearchcraftSlider$1, d as defineCustomElement$1 } from './p-cc9f8c61.js';
1
+ import { S as SearchcraftSlider$1, d as defineCustomElement$1 } from './p-4b92ae26.js';
2
2
 
3
3
  const SearchcraftSlider = SearchcraftSlider$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SearchcraftTheme extends Components.SearchcraftTheme, HTMLElement {}
4
+ export const SearchcraftTheme: {
5
+ prototype: SearchcraftTheme;
6
+ new (): SearchcraftTheme;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,51 @@
1
+ import { p as proxyCustomElement, H } from './p-5365011f.js';
2
+
3
+ const styles = `:root{--sc-font-family: sans-serif;--sc-heading-1-font-size: 32px;--sc-heading-1-line-height: 36px;--sc-heading-1-font-weight: 700;--sc-heading-2-font-size: 29px;--sc-heading-2-line-height: 32px;--sc-heading-2-font-weight: 700;--sc-heading-3-font-size: 26px;--sc-heading-3-line-height: 28px;--sc-heading-3-font-weight: 700;--sc-heading-4-font-size: 23px;--sc-heading-4-line-height: 24px;--sc-heading-4-font-weight: 700;--sc-heading-5-font-size: 20px;--sc-heading-5-line-height: 24px;--sc-heading-5-font-weight: 700;--sc-heading-6-font-size: 10px;--sc-heading-6-line-height: 12px;--sc-heading-6-font-weight: 700;--sc-body-bold-font-size: 16px;--sc-body-bold-line-height: 20px;--sc-body-bold-font-weight: 700;--sc-body-font-size: 16px;--sc-body-line-height: 20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size: 12px;--sc-body-small-bold-line-height: 16px;--sc-body-small-bold-font-weight: 700;--sc-body-small-font-size: 12px;--sc-body-small-line-height: 16px;--sc-body-small-font-weight: 400}:root{--sc-input-border-radius: 8px;--sc-input-search-icon-size: 20px;--sc-input-clear-icon-size: 20px;--sc-input-padding-left: 44px;--sc-input-padding-right: 44px;--sc-image-border-radius: 8px;--sc-popover-form-border-radius: 8px;--sc-popover-list-view-height: 400px;--sc-popover-list-item-image-size: 60px;--sc-popover-list-item-padding-horizontal: 8px;--sc-popover-list-item-padding-vertical: 8px;--sc-popover-modal-max-width: 570px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-disabled: #D9D9D9;--sc-surface-neutral-primary: #FFFFFF;--sc-surface-neutral-secondary: #F3F3F3;--sc-surface-neutral-light: #FFFFFF;--sc-surface-neutral-primary-hover: #FAFAFA;--sc-surface-neutral-primary-active: #F7F7F7;--sc-surface-neutral-secondary-hover: #EDEDED;--sc-surface-neutral-secondary-active: #E6E6E6;--sc-surface-brand-primary: #000000;--sc-surface-brand-secondary: #E6E6E6;--sc-surface-brand-primary-hover: #2E2E2E;--sc-surface-brand-primary-active: #292929;--sc-surface-brand-secondary-hover: #EBEBEB;--sc-surface-brand-secondary-active: #E0E0E0;--sc-surface-success-primary: #008000;--sc-surface-success-secondary: #CCFFCC;--sc-surface-success-primary-hover: #009900;--sc-surface-success-primary-active: #006600;--sc-surface-success-secondary-hover: #E6FFE6;--sc-surface-success-secondary-active: #E6FFE6;--sc-surface-caution-primary: #CC6600;--sc-surface-caution-secondary: #FFD9B3;--sc-surface-caution-primary-hover: #E57300;--sc-surface-caution-primary-active: #B25A00;--sc-surface-caution-secondary-hover: #FFE5CC;--sc-surface-caution-secondary-active: #FFCC99;--sc-surface-danger-primary: #CC0000;--sc-surface-danger-secondary: #FFCCCC;--sc-surface-danger-primary-hover: #E50000;--sc-surface-danger-primary-active: #B30000;--sc-surface-danger-secondary-hover: #FFE7E7;--sc-surface-danger-secondary-active: #FFB3B3;--sc-content-brand: #000000;--sc-content-success: #008000;--sc-content-caution: #994D00;--sc-content-danger: #990000;--sc-content-disabled: #737373;--sc-content-neutral-primary: #292929;--sc-content-neutral-secondary: #404040;--sc-content-brand-on-primary: #FFFFFF;--sc-content-success-on-primary: #FFFFFF;--sc-content-caution-on-primary: #FFFFFF;--sc-content-danger-on-primary: #FFFFFF;--sc-content-disabled-on-disabled: #737373;--sc-border-neutral: rgba(0,0,0, 0.1);--sc-border-brand: #000000;--sc-border-success: #008000;--sc-border-caution: #CC6600;--sc-border-danger: #CC0000;--sc-border-disabled: #737373}.searchcraft-search-result-container{all:unset;align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;color:inherit;background-color:var(--sc-surface-neutral-primary)}@media(min-width: 768px){.searchcraft-search-result-container{flex-direction:row}}a.searchcraft-search-result-container{cursor:pointer;transition:background-color 100ms}.searchcraft-base-search-result-content-container{flex:1;display:flex;flex-direction:column;gap:8px}.searchcraft-search-result-image{border-radius:var(--sc-image-border-radius);width:100%}@media(min-width: 768px){.searchcraft-search-result-image{width:200px}}.searchcraft-base-search-result-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-base-search-result-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-base-search-result-body-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-base-search-result-footer-content{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#f1f1f1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-bold-font-size);font-weight:var(--sc-body-bold-font-weight);line-height:var(--sc-body-bold-line-height);border-radius:8px;display:flex;padding:12px 20px;position:relative;background-color:var(--sc-surface-brand-primary);border:1px solid var(--sc-border-primary);color:var(--sc-content-brand-on-primary)}.searchcraft-button:hover{cursor:pointer;background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button:focus{outline:2px solid var(--sc-surface-brand-primary)}.buttonLabel{position:relative}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger);margin:0}.filtersListContainer{width:100%}.filterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:14px;position:relative;-webkit-font-smoothing:antialiased}.filterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.filterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.filterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.filterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.filterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.childFilterCheckboxLabel{align-items:center;color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);font-size:14px;font-weight:600;gap:12px;margin-left:24px;position:relative}.childFilterCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:var(--sc-surface-brand-secondary-hover);border:1px solid var(--sc-surface-disabled);border-radius:8px;cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px;-webkit-font-smoothing:antialiased}.childFilterCheckboxLabel input[type=checkbox]:focus{outline:2px solid var(--sc-surface-brand-primary)}.childFilterCheckboxLabel input[type=checkbox]:checked{background-color:var(--sc-surface-brand-primary);position:relative}.childFilterCheckboxLabel input[type=checkbox]:checked+.checkContainer{display:block}.childFilterCheckboxLabel input[type=checkbox]:checked+.dashContainer{display:block}.checkContainer{display:none;height:16px;width:16px;position:absolute;top:9px;left:8px}.dashContainer{display:none;height:3px;width:14px;position:absolute;top:3px;left:9px}.searchcraft-facet-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-disabled);text-align:center}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height)}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-border-radius);border:none;color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}.searchcraft-popover-form{display:flex;flex-direction:column;flex:1}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper{padding:12px;background-color:var(--sc-surface-neutral-secondary);display:flex;flex-direction:row;gap:4px}.searchcraft-popover-form .searchcraft-popover-form-input-wrapper>searchcraft-input-form{flex:1}.searchcraft-popover-form .searchcraft-popover-form-cancel-button{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);border:0;outline:0;padding:0;flex-shrink:0;background:none;cursor:pointer;padding-left:12px;padding-right:12px;border-radius:calc(var(--sc-popover-form-border-radius)*.8)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-popover-form .searchcraft-popover-form-cancel-button:focus{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-popover-form-inline .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);border:none;outline:none}.searchcraft-popover-form-inline.searchcraft-popover-form-active .searchcraft-input{border-top-left-radius:var(--sc-popover-form-border-radius);border-top-right-radius:var(--sc-popover-form-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-outer{position:relative}.searchcraft-popover-form-inline .searchcraft-popover-inline-wrapper-inner{position:absolute;height:var(--sc-popover-list-view-height);z-index:1000;width:100%}.searchcraft-popover-form-inline .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:var(--sc-popover-form-border-radius);border-bottom-right-radius:var(--sc-popover-form-border-radius);max-height:var(--sc-popover-list-view-height)}.searchcraft-popover-form-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:0;background-color:var(--sc-surface-neutral-secondary)}@media(min-width: 576px){.searchcraft-popover-form-modal{padding:16px;background-color:rgba(0,0,0,0)}}.searchcraft-popover-form-modal .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{position:absolute;inset:0;background-color:rgba(0,0,0,.5);display:none}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{position:absolute;inset:0;z-index:1002;margin-top:0px;display:flex;border-radius:var(--sc-popover-form-border-radius);overflow:hidden}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-form-modal-inner{inset:auto;position:relative;width:100%;margin-top:100px;max-width:var(--sc-popover-modal-max-width)}}.searchcraft-popover-form-modal .searchcraft-popover-list-view{display:flex;flex-direction:column;overflow:auto;background-color:var(--sc-surface-neutral-secondary);border-bottom-left-radius:0;border-bottom-right-radius:0}@media(min-width: 576px){.searchcraft-popover-form-modal .searchcraft-popover-list-view{max-height:var(--sc-popover-list-view-height)}}.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:scroll}@media(min-width: 576px){.searchcraft-popover-form-modal searchcraft-popover-list-view{overflow:auto}}.searchcraft-popover-form-fullscreen{position:fixed;inset:0;z-index:1000;background-color:var(--sc-surface-neutral-secondary)}.searchcraft-popover-form-fullscreen .searchcraft-popover-form{position:absolute;inset:0}.searchcraft-popover-form-fullscreen .searchcraft-input{border-radius:calc(var(--sc-popover-form-border-radius)*.8);outline-width:1px;outline-color:var(--sc-border-neutral)}.searchcraft-popover-form-fullscreen searchcraft-popover-list-view{overflow:scroll}.searchcraft-popover-list-item{all:unset;display:flex;flex-direction:row;cursor:pointer;gap:8px;padding-right:var(--sc-popover-list-item-padding-horizontal);padding-left:var(--sc-popover-list-item-padding-horizontal);padding-top:var(--sc-popover-list-item-padding-vertical);padding-bottom:var(--sc-popover-list-item-padding-vertical)}.searchcraft-popover-list-item:focus{background-color:var(--sc-surface-neutral-secondary-active);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item:hover{background-color:var(--sc-surface-neutral-secondary-hover);color:var(--sc-content-neutral-secondary)}.searchcraft-popover-list-item-title{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-subtitle{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:inherit}.searchcraft-popover-list-item-image-wrapper{width:var(--sc-popover-list-item-image-size);height:var(--sc-popover-list-item-image-size);display:flex;align-items:center;justify-content:center;flex-shrink:0}.searchcraft-popover-list-item-image{max-width:var(--sc-popover-list-item-image-size);max-height:var(--sc-popover-list-item-image-size)}.searchcraft-popover-list-item-info-wrapper{display:flex;flex-direction:column;gap:8px;justify-content:center}.searchcraft-results-info-container{border-bottom:1px solid var(--sc-surface-disabled);display:flex;justify-content:flex-start}.searchcraft-results-info-content{color:var(--sc-content-primary);font-family:var(--sc-font-family);font-size:18px;font-weight:600;line-height:20px;margin:0px 0 8px}@media(max-width: 768px){.searchcraft-results-info-content{margin:0;margin-bottom:8px}}.searchcraft-slider-container{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%}.searchcraft-slider-range-container{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range-container::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range-container .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range-container .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px;-webkit-appearance:none}.searchcraft-slider-range-container .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:2px solid var(--sc-border-neutral);cursor:pointer;height:20px;pointer-events:all;width:20px}.searchcraft-slider-label-container{color:var(--sc-content-primary);display:flex;font-family:"Source Sans Pro",sans-serif;font-size:15px;font-weight:600;justify-content:space-between;margin-top:10px;width:100%}.searchcraft-slider-label{min-width:30px;text-align:center}.searchcraft-toggle-button-container{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);margin:0;color:var(--sc-content-neutral-primary)}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);margin:0;color:var(--sc-content-neutral-secondary)}.searchcraft-toggle-button-background{transition:background-color .2s;background:var(--sc-surface-disabled);border:none;border-radius:16px;cursor:pointer;height:26px;position:relative;width:44px;flex-shrink:0}.searchcraft-toggle-button-background.active{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-handle.active{transform:translateX(16px)}/*# sourceMappingURL=hologram.css.map */
4
+ `;
5
+
6
+ const SearchcraftErrorMessage = /*@__PURE__*/ proxyCustomElement(class SearchcraftErrorMessage extends H {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ }
11
+ componentDidLoad() {
12
+ console.log('Loading theme...');
13
+ console.log(styles);
14
+ const styleTag = document.querySelector('#searchcraft-theme') ||
15
+ document.createElement('style');
16
+ styleTag.innerHTML = styles;
17
+ styleTag.id = 'searchcraft-theme';
18
+ const head = document.head || document.getElementsByTagName('head')[0];
19
+ if (!head.contains(styleTag)) {
20
+ if (head.firstChild) {
21
+ head.insertBefore(styleTag, head.firstChild);
22
+ }
23
+ else {
24
+ head.appendChild(styleTag);
25
+ }
26
+ }
27
+ }
28
+ render() {
29
+ return;
30
+ }
31
+ }, [0, "searchcraft-theme"]);
32
+ function defineCustomElement$1() {
33
+ if (typeof customElements === "undefined") {
34
+ return;
35
+ }
36
+ const components = ["searchcraft-theme"];
37
+ components.forEach(tagName => { switch (tagName) {
38
+ case "searchcraft-theme":
39
+ if (!customElements.get(tagName)) {
40
+ customElements.define(tagName, SearchcraftErrorMessage);
41
+ }
42
+ break;
43
+ } });
44
+ }
45
+
46
+ const SearchcraftTheme = SearchcraftErrorMessage;
47
+ const defineCustomElement = defineCustomElement$1;
48
+
49
+ export { SearchcraftTheme, defineCustomElement };
50
+
51
+ //# sourceMappingURL=searchcraft-theme.js.map