@searchcraft/javascript-sdk 0.6.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 (271) hide show
  1. package/README.md +59 -55
  2. package/dist/cjs/{index-b3b77ea2.js → index-a81df4f0.js} +258 -239
  3. package/dist/cjs/index-a81df4f0.js.map +1 -0
  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 -48
  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 -37
  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 -27
  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 -117
  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 -13
  15. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
  16. package/dist/cjs/searchcraft-input-form_2.cjs.entry.js +128 -82
  17. package/dist/cjs/searchcraft-input-form_2.cjs.entry.js.map +1 -1
  18. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +3 -3
  19. package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +1 -1
  20. package/dist/cjs/searchcraft-popover-button.cjs.entry.js +3 -7
  21. package/dist/cjs/searchcraft-popover-button.cjs.entry.js.map +1 -1
  22. package/dist/cjs/searchcraft-popover-form.cjs.entry.js +81 -68
  23. package/dist/cjs/searchcraft-popover-form.cjs.entry.js.map +1 -1
  24. package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js +29 -12
  25. package/dist/cjs/searchcraft-popover-list-item.cjs.entry.js.map +1 -1
  26. package/dist/cjs/searchcraft-results-info.cjs.entry.js +9 -13
  27. package/dist/cjs/searchcraft-results-info.cjs.entry.js.map +1 -1
  28. package/dist/cjs/searchcraft-theme.cjs.entry.js +38 -0
  29. package/dist/cjs/searchcraft-theme.cjs.entry.js.map +1 -0
  30. package/dist/cjs/{store-d7ebcf7a.js → store-f6ba3dfb.js} +633 -107
  31. package/dist/cjs/store-f6ba3dfb.js.map +1 -0
  32. package/dist/collection/collection-manifest.json +2 -1
  33. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +134 -66
  34. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
  35. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +100 -49
  36. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  37. package/dist/collection/components/searchcraft-button/searchcraft-button.js +35 -23
  38. package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +1 -1
  39. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +8 -15
  40. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +1 -1
  41. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +61 -59
  42. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
  43. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +11 -19
  44. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
  45. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js +126 -76
  46. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.js.map +1 -1
  47. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +14 -18
  48. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +1 -1
  49. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js +1 -11
  50. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.js.map +1 -1
  51. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js +93 -77
  52. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.js.map +1 -1
  53. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js +47 -25
  54. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.js.map +1 -1
  55. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js +23 -25
  56. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.js.map +1 -1
  57. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js +7 -19
  58. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.js.map +1 -1
  59. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +65 -55
  60. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
  61. package/dist/collection/components/searchcraft-theme/searchcraft-theme.js +27 -0
  62. package/dist/collection/components/searchcraft-theme/searchcraft-theme.js.map +1 -0
  63. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +27 -26
  64. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
  65. package/dist/collection/index.js.map +1 -1
  66. package/dist/collection/provider/store.js +25 -9
  67. package/dist/collection/provider/store.js.map +1 -1
  68. package/dist/collection/utils/facets.js +5 -3
  69. package/dist/collection/utils/facets.js.map +1 -1
  70. package/dist/components/index.js +4 -2
  71. package/dist/components/index.js.map +1 -1
  72. package/dist/components/p-0ef4ab33.js +66 -0
  73. package/dist/components/p-0ef4ab33.js.map +1 -0
  74. package/dist/components/p-1234974c.js +72 -0
  75. package/dist/components/p-1234974c.js.map +1 -0
  76. package/dist/components/p-4b92ae26.js +109 -0
  77. package/dist/components/p-4b92ae26.js.map +1 -0
  78. package/dist/components/{p-85765b81.js → p-506cdac1.js} +18 -16
  79. package/dist/components/p-506cdac1.js.map +1 -0
  80. package/dist/components/p-521fe971.js +60 -0
  81. package/dist/components/p-521fe971.js.map +1 -0
  82. package/dist/components/{p-e4846fa2.js → p-5365011f.js} +215 -231
  83. package/dist/components/p-5365011f.js.map +1 -0
  84. package/dist/components/p-54998882.js +285 -0
  85. package/dist/components/p-54998882.js.map +1 -0
  86. package/dist/components/{p-d6a88eed.js → p-936e2ed4.js} +633 -107
  87. package/dist/components/p-936e2ed4.js.map +1 -0
  88. package/dist/components/p-a75ef832.js +34 -0
  89. package/dist/components/p-a75ef832.js.map +1 -0
  90. package/dist/components/p-b4a8fcbe.js +144 -0
  91. package/dist/components/p-b4a8fcbe.js.map +1 -0
  92. package/dist/components/p-ca881e5c.js +37 -0
  93. package/dist/components/p-ca881e5c.js.map +1 -0
  94. package/dist/components/p-d95bc2a0.js +284 -0
  95. package/dist/components/p-d95bc2a0.js.map +1 -0
  96. package/dist/components/searchcraft-base-search-result.js +1 -1
  97. package/dist/components/searchcraft-base-search-results.js +76 -39
  98. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  99. package/dist/components/searchcraft-button.js +1 -1
  100. package/dist/components/searchcraft-error-message.js +1 -1
  101. package/dist/components/searchcraft-facet-list.js +1 -1
  102. package/dist/components/searchcraft-filter-panel.js +14 -16
  103. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  104. package/dist/components/searchcraft-input-form.js +1 -1
  105. package/dist/components/searchcraft-input-label.js +1 -1
  106. package/dist/components/searchcraft-popover-button.js +3 -7
  107. package/dist/components/searchcraft-popover-button.js.map +1 -1
  108. package/dist/components/searchcraft-popover-form.js +87 -74
  109. package/dist/components/searchcraft-popover-form.js.map +1 -1
  110. package/dist/components/searchcraft-popover-list-item.js +1 -1
  111. package/dist/components/searchcraft-popover-list-view.js +1 -1
  112. package/dist/components/searchcraft-results-info.js +9 -13
  113. package/dist/components/searchcraft-results-info.js.map +1 -1
  114. package/dist/components/searchcraft-slider.js +1 -1
  115. package/dist/components/searchcraft-theme.d.ts +11 -0
  116. package/dist/components/searchcraft-theme.js +51 -0
  117. package/dist/components/searchcraft-theme.js.map +1 -0
  118. package/dist/components/searchcraft-toggle-button.js +1 -1
  119. package/dist/esm/{index-11551663.js → index-3608c57d.js} +258 -239
  120. package/dist/esm/index-3608c57d.js.map +1 -0
  121. package/dist/esm/index.js +1 -1
  122. package/dist/esm/loader.js +3 -3
  123. package/dist/esm/searchcraft-base-search-result.entry.js +91 -48
  124. package/dist/esm/searchcraft-base-search-result.entry.js.map +1 -1
  125. package/dist/esm/searchcraft-base-search-results.entry.js +74 -37
  126. package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
  127. package/dist/esm/searchcraft-button_3.entry.js +37 -27
  128. package/dist/esm/searchcraft-button_3.entry.js.map +1 -1
  129. package/dist/esm/searchcraft-facet-list_3.entry.js +141 -117
  130. package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
  131. package/dist/esm/searchcraft-filter-panel.entry.js +11 -13
  132. package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
  133. package/dist/esm/searchcraft-input-form_2.entry.js +128 -82
  134. package/dist/esm/searchcraft-input-form_2.entry.js.map +1 -1
  135. package/dist/esm/searchcraft-javascript-sdk.js +4 -4
  136. package/dist/esm/searchcraft-javascript-sdk.js.map +1 -1
  137. package/dist/esm/searchcraft-popover-button.entry.js +3 -7
  138. package/dist/esm/searchcraft-popover-button.entry.js.map +1 -1
  139. package/dist/esm/searchcraft-popover-form.entry.js +81 -68
  140. package/dist/esm/searchcraft-popover-form.entry.js.map +1 -1
  141. package/dist/esm/searchcraft-popover-list-item.entry.js +29 -12
  142. package/dist/esm/searchcraft-popover-list-item.entry.js.map +1 -1
  143. package/dist/esm/searchcraft-results-info.entry.js +9 -13
  144. package/dist/esm/searchcraft-results-info.entry.js.map +1 -1
  145. package/dist/esm/searchcraft-theme.entry.js +34 -0
  146. package/dist/esm/searchcraft-theme.entry.js.map +1 -0
  147. package/dist/esm/{store-1058f7b0.js → store-aa071d9c.js} +633 -107
  148. package/dist/esm/store-aa071d9c.js.map +1 -0
  149. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  150. package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js +2 -0
  151. package/dist/searchcraft-javascript-sdk/p-26f5263d.entry.js.map +1 -0
  152. package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js +2 -0
  153. package/dist/searchcraft-javascript-sdk/p-2ff7eb35.entry.js.map +1 -0
  154. package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js +2 -0
  155. package/dist/searchcraft-javascript-sdk/p-36f0532e.entry.js.map +1 -0
  156. package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js +2 -0
  157. package/dist/searchcraft-javascript-sdk/p-41b6bc5d.entry.js.map +1 -0
  158. package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js +2 -0
  159. package/dist/searchcraft-javascript-sdk/p-57eddb07.entry.js.map +1 -0
  160. package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js +2 -0
  161. package/dist/searchcraft-javascript-sdk/p-5d6fbee0.entry.js.map +1 -0
  162. package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js +2 -0
  163. package/dist/searchcraft-javascript-sdk/p-64c5a1d2.entry.js.map +1 -0
  164. package/dist/searchcraft-javascript-sdk/p-7e13c128.js +3 -0
  165. package/dist/searchcraft-javascript-sdk/p-7e13c128.js.map +1 -0
  166. package/dist/searchcraft-javascript-sdk/p-8b0a60b3.entry.js +2 -0
  167. package/dist/searchcraft-javascript-sdk/p-8b0a60b3.entry.js.map +1 -0
  168. package/dist/searchcraft-javascript-sdk/p-936e2ed4.js +11 -0
  169. package/dist/searchcraft-javascript-sdk/p-936e2ed4.js.map +1 -0
  170. package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js +2 -0
  171. package/dist/searchcraft-javascript-sdk/p-c7df8be6.entry.js.map +1 -0
  172. package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js +2 -0
  173. package/dist/searchcraft-javascript-sdk/p-eb6058e8.entry.js.map +1 -0
  174. package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js +2 -0
  175. package/dist/searchcraft-javascript-sdk/p-faaa4394.entry.js.map +1 -0
  176. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  177. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  178. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +1 -0
  179. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +2 -1
  180. package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +1 -0
  181. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +1 -0
  182. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +2 -1
  183. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +1 -0
  184. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +7 -10
  185. package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +2 -1
  186. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -0
  187. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +2 -1
  188. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +2 -0
  189. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -0
  190. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +1 -0
  191. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +2 -1
  192. package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +5 -0
  193. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
  194. package/dist/types/components.d.ts +17 -4
  195. package/dist/types/index.d.ts +2 -1
  196. package/dist/types/provider/store.d.ts +1 -0
  197. package/dist/types/types/_shared.types.d.ts +1 -0
  198. package/dist/types/types/index.d.ts +1 -0
  199. package/dist/types/types/raw.d.ts +4 -0
  200. package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -0
  201. package/dist/types/types/searchcraft-filter-panel.types.d.ts +1 -0
  202. package/dist/types/types/searchcraft-popover-form.types.d.ts +1 -0
  203. package/dist/types/utils/facets.d.ts +1 -0
  204. package/dist/types/utils/index.d.ts +1 -0
  205. package/dist/types/utils/styles.d.ts +1 -0
  206. package/dist/types/utils/units.d.ts +1 -0
  207. package/package.json +6 -4
  208. package/dist/cjs/index-b3b77ea2.js.map +0 -1
  209. package/dist/cjs/store-d7ebcf7a.js.map +0 -1
  210. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -227
  211. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -179
  212. package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -174
  213. package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -158
  214. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.module.css +0 -266
  215. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.module.css +0 -168
  216. package/dist/collection/components/searchcraft-input-form/searchcraft-input-form.module.css +0 -293
  217. package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -159
  218. package/dist/collection/components/searchcraft-popover-button/searchcraft-popover-button.module.css +0 -0
  219. package/dist/collection/components/searchcraft-popover-form/searchcraft-popover-form.module.css +0 -322
  220. package/dist/collection/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.css +0 -209
  221. package/dist/collection/components/searchcraft-popover-list-view/searchcraft-popover-list-view.module.css +0 -0
  222. package/dist/collection/components/searchcraft-results-info/searchcraft-results-info.module.css +0 -169
  223. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +0 -231
  224. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.module.css +0 -207
  225. package/dist/components/p-02a16e53.js +0 -240
  226. package/dist/components/p-02a16e53.js.map +0 -1
  227. package/dist/components/p-04c46179.js +0 -101
  228. package/dist/components/p-04c46179.js.map +0 -1
  229. package/dist/components/p-0e38a723.js +0 -99
  230. package/dist/components/p-0e38a723.js.map +0 -1
  231. package/dist/components/p-4c45ef80.js +0 -67
  232. package/dist/components/p-4c45ef80.js.map +0 -1
  233. package/dist/components/p-85765b81.js.map +0 -1
  234. package/dist/components/p-953f4238.js +0 -35
  235. package/dist/components/p-953f4238.js.map +0 -1
  236. package/dist/components/p-a248ad69.js +0 -276
  237. package/dist/components/p-a248ad69.js.map +0 -1
  238. package/dist/components/p-a9bd1872.js +0 -38
  239. package/dist/components/p-a9bd1872.js.map +0 -1
  240. package/dist/components/p-cf4ced92.js +0 -49
  241. package/dist/components/p-cf4ced92.js.map +0 -1
  242. package/dist/components/p-d6a88eed.js.map +0 -1
  243. package/dist/components/p-e4846fa2.js.map +0 -1
  244. package/dist/components/p-f9d778b3.js +0 -48
  245. package/dist/components/p-f9d778b3.js.map +0 -1
  246. package/dist/esm/index-11551663.js.map +0 -1
  247. package/dist/esm/store-1058f7b0.js.map +0 -1
  248. package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js +0 -2
  249. package/dist/searchcraft-javascript-sdk/p-4580e8a4.entry.js.map +0 -1
  250. package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js +0 -2
  251. package/dist/searchcraft-javascript-sdk/p-7049b93d.entry.js.map +0 -1
  252. package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js +0 -2
  253. package/dist/searchcraft-javascript-sdk/p-8e539d62.entry.js.map +0 -1
  254. package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js +0 -2
  255. package/dist/searchcraft-javascript-sdk/p-98640a6a.entry.js.map +0 -1
  256. package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js +0 -2
  257. package/dist/searchcraft-javascript-sdk/p-9d0f5c89.entry.js.map +0 -1
  258. package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js +0 -2
  259. package/dist/searchcraft-javascript-sdk/p-b8bd53ce.entry.js.map +0 -1
  260. package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js +0 -2
  261. package/dist/searchcraft-javascript-sdk/p-c27a3673.entry.js.map +0 -1
  262. package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js +0 -2
  263. package/dist/searchcraft-javascript-sdk/p-cd852b84.entry.js.map +0 -1
  264. package/dist/searchcraft-javascript-sdk/p-d6a88eed.js +0 -11
  265. package/dist/searchcraft-javascript-sdk/p-d6a88eed.js.map +0 -1
  266. package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js +0 -2
  267. package/dist/searchcraft-javascript-sdk/p-e042deb9.entry.js.map +0 -1
  268. package/dist/searchcraft-javascript-sdk/p-e0be53df.js +0 -3
  269. package/dist/searchcraft-javascript-sdk/p-e0be53df.js.map +0 -1
  270. package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js +0 -2
  271. package/dist/searchcraft-javascript-sdk/p-efab9f3c.entry.js.map +0 -1
@@ -2,66 +2,48 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b3b77ea2.js');
5
+ const index = require('./index-a81df4f0.js');
6
6
  const index$1 = require('./index-5b0b9d4c.js');
7
- const store = require('./store-d7ebcf7a.js');
8
-
9
- 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}";
10
- const SearchcraftPopoverFormStyle0 = searchcraftPopoverFormModuleCss;
7
+ const store = require('./store-f6ba3dfb.js');
11
8
 
12
9
  const SearchcraftPopoverForm = class {
13
10
  constructor(hostRef) {
14
11
  index.registerInstance(this, hostRef);
15
- this.handleDocumentClick = (event) => {
16
- if (!this.hostElement.contains(event.target)) {
17
- this.isFocused = false;
18
- }
19
- };
20
- /**
21
- * Actions to perform when various keys are pressed within the popover form.
22
- */
23
- this.handleDocumentKeyDown = (event) => {
24
- // Document-scoped actions
25
- if (event.key === this.hotkey) {
26
- this.handleHotkeyPressed(event);
27
- }
28
- // Document-scoped -> Popover-scoped keyboard event boundary
29
- if (!this.hostElement.contains(document.activeElement)) {
30
- return;
31
- }
32
- // Popover-scoped actions
33
- switch (event.key) {
34
- case 'ArrowDown':
35
- case 'ArrowUp':
36
- event.preventDefault();
37
- this.focusOnNextListItem(event.key);
38
- break;
39
- case 'Escape':
40
- store.useSearchcraftStore.getState().setPopoverVisibility(false);
41
- break;
42
- default:
43
- return;
44
- }
45
- };
46
- this.handleInputInit = () => {
47
- const input = this.hostElement.querySelector('.searchcraft-input');
48
- input === null || input === void 0 ? void 0 : input.focus();
49
- };
50
- this.config = undefined;
51
- this.type = 'inline';
52
- this.popoverResultMappings = undefined;
53
- this.hotkey = 'k';
54
- this.hotkeyModifier = 'meta';
55
- this.isPopoverVisibleInState = false;
56
- this.unsubscribe = undefined;
57
- this.searchResults = undefined;
58
- this.searchTerm = undefined;
59
- this.isFocused = false;
60
- this.breakpointSm = 576;
61
- this.breakpointMd = 768;
62
- this.breakpointLg = 992;
63
- this.modalElement = undefined;
64
12
  }
13
+ /**
14
+ * The Searchcraft config object.
15
+ */
16
+ config;
17
+ /**
18
+ * The type of popover form to render.
19
+ *
20
+ * - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content.
21
+ * - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component.
22
+ * - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
23
+ */
24
+ type = 'inline';
25
+ /**
26
+ * Formats the content rendered for each result.
27
+ */
28
+ popoverResultMappings;
29
+ /**
30
+ * The hotkey that activates the popover.
31
+ */
32
+ hotkey = 'k';
33
+ /**
34
+ * The hotkey modifier that activates the popover. Used together with the `hotkey` prop.
35
+ */
36
+ hotkeyModifier = 'meta';
37
+ isPopoverVisibleInState = false;
38
+ unsubscribe;
39
+ searchResults;
40
+ searchTerm;
41
+ isFocused = false;
42
+ breakpointSm = 576;
43
+ breakpointMd = 768;
44
+ breakpointLg = 992;
45
+ modalElement;
46
+ get hostElement() { return index.getElement(this); }
65
47
  componentDidLoad() {
66
48
  // Loads the breakpoint values into state
67
49
  const computedStyle = getComputedStyle(document.documentElement);
@@ -79,16 +61,20 @@ const SearchcraftPopoverForm = class {
79
61
  if (this.isPopoverVisibleInState !== state.isPopoverVisible) {
80
62
  this.handlePopoverVisibilityChange(state.isPopoverVisible);
81
63
  }
82
- this.searchResults = Object.assign({}, state.searchResults);
64
+ this.searchResults = { ...state.searchResults };
83
65
  this.searchTerm = state.query;
84
66
  });
85
67
  }
86
68
  disconnectedCallback() {
87
- var _a;
88
- (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
69
+ this.unsubscribe?.();
89
70
  document.removeEventListener('click', this.handleDocumentClick);
90
71
  document.removeEventListener('keydown', this.handleDocumentKeyDown);
91
72
  }
73
+ handleDocumentClick = (event) => {
74
+ if (!this.hostElement.contains(event.target)) {
75
+ this.isFocused = false;
76
+ }
77
+ };
92
78
  /**
93
79
  * Handles when popover visibility is changed in state
94
80
  */
@@ -96,6 +82,36 @@ const SearchcraftPopoverForm = class {
96
82
  this.isPopoverVisibleInState = isVisible;
97
83
  document.body.style.overflow = isVisible ? 'hidden' : 'auto';
98
84
  }
85
+ /**
86
+ * Actions to perform when various keys are pressed within the popover form.
87
+ */
88
+ handleDocumentKeyDown = (event) => {
89
+ // Document-scoped actions
90
+ if (event.key === this.hotkey) {
91
+ this.handleHotkeyPressed(event);
92
+ }
93
+ // Document-scoped -> Popover-scoped keyboard event boundary
94
+ if (!this.hostElement.contains(document.activeElement)) {
95
+ return;
96
+ }
97
+ // Popover-scoped actions
98
+ switch (event.key) {
99
+ case 'ArrowDown':
100
+ case 'ArrowUp':
101
+ event.preventDefault();
102
+ this.focusOnNextListItem(event.key);
103
+ break;
104
+ case 'Escape':
105
+ store.useSearchcraftStore.getState().setPopoverVisibility(false);
106
+ break;
107
+ default:
108
+ return;
109
+ }
110
+ };
111
+ handleInputInit = () => {
112
+ const input = this.hostElement.querySelector('.searchcraft-input');
113
+ input?.focus();
114
+ };
99
115
  /**
100
116
  * When popover is `inline` and the viewport is at the smallest breakpoint,
101
117
  * focusing on the input will open a modal version of the popover form.
@@ -103,6 +119,7 @@ const SearchcraftPopoverForm = class {
103
119
  handleInputFocus() {
104
120
  this.isFocused = true;
105
121
  if (this.type === 'inline' &&
122
+ window.visualViewport &&
106
123
  window.visualViewport.width < this.breakpointSm) {
107
124
  store.useSearchcraftStore.getState().setPopoverVisibility(true);
108
125
  // Appends a popover form of type=`modal` to the body
@@ -129,7 +146,7 @@ const SearchcraftPopoverForm = class {
129
146
  event.preventDefault();
130
147
  if (this.type === 'inline' && !this.isPopoverVisibleInState) {
131
148
  const hostElementInput = this.hostElement.querySelector('.searchcraft-input');
132
- hostElementInput === null || hostElementInput === void 0 ? void 0 : hostElementInput.focus();
149
+ hostElementInput?.focus();
133
150
  }
134
151
  else {
135
152
  store.useSearchcraftStore
@@ -148,15 +165,14 @@ const SearchcraftPopoverForm = class {
148
165
  * @param direction
149
166
  */
150
167
  focusOnNextListItem(direction) {
151
- var _a, _b;
152
168
  const listItems = Array.from(document.querySelectorAll('a.searchcraft-popover-list-item')).filter((el) => !el.hasAttribute('disabled') && el.offsetParent !== null);
153
169
  const currentIndex = listItems.indexOf(document.activeElement);
154
170
  if (direction === 'ArrowDown') {
155
- (_a = listItems[(currentIndex + 1) % listItems.length]) === null || _a === void 0 ? void 0 : _a.focus();
171
+ listItems[(currentIndex + 1) % listItems.length]?.focus();
156
172
  }
157
173
  else if (direction === 'ArrowUp') {
158
174
  if (currentIndex >= 1) {
159
- (_b = listItems[currentIndex - 1]) === null || _b === void 0 ? void 0 : _b.focus();
175
+ listItems[currentIndex - 1]?.focus();
160
176
  }
161
177
  else {
162
178
  const input = document.querySelector('.searchcraft-input');
@@ -171,9 +187,9 @@ const SearchcraftPopoverForm = class {
171
187
  }
172
188
  }
173
189
  get hasResultsToShow() {
174
- var _a, _b, _c, _d, _e;
175
- return (((_b = (_a = this.searchTerm) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
176
- ((_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);
190
+ return (this.searchTerm &&
191
+ this.searchTerm?.trim()?.length > 0 &&
192
+ (this.searchResults?.data?.hits?.length || 0) > 0);
177
193
  }
178
194
  renderInlinePopover(documents) {
179
195
  const isListViewVisible = this.hasResultsToShow && this.isFocused;
@@ -196,8 +212,7 @@ const SearchcraftPopoverForm = class {
196
212
  }
197
213
  }
198
214
  render() {
199
- var _a, _b, _c;
200
- 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) => {
215
+ const documents = this.searchResults?.data?.hits?.map((data, _index) => {
201
216
  const { doc: result } = data;
202
217
  return result;
203
218
  });
@@ -210,9 +225,7 @@ const SearchcraftPopoverForm = class {
210
225
  return this.renderFullscreenPopover(documents);
211
226
  }
212
227
  }
213
- get hostElement() { return index.getElement(this); }
214
228
  };
215
- SearchcraftPopoverForm.style = SearchcraftPopoverFormStyle0;
216
229
 
217
230
  exports.searchcraft_popover_form = SearchcraftPopoverForm;
218
231
 
@@ -1 +1 @@
1
- {"file":"searchcraft-popover-form.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,+BAA+B,GAAG,+iPAA+iP,CAAC;AACxlP,qCAAe,+BAA+B;;MCyCjC,sBAAsB;;;QA4EjC,wBAAmB,GAAG,CAAC,KAAiB;YACtC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;gBACpD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;SACF,CAAC;;;;QAaF,0BAAqB,GAAG,CAAC,KAAoB;;YAE3C,IAAI,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE;gBAC7B,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACjC;;YAGD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;gBACtD,OAAO;aACR;;YAGD,QAAQ,KAAK,CAAC,GAAG;gBACf,KAAK,WAAW,CAAC;gBACjB,KAAK,SAAS;oBACZ,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBACpC,MAAM;gBACR,KAAK,QAAQ;oBACXA,yBAAmB,CAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;oBAC3D,MAAM;gBACR;oBACE,OAAO;aACV;SACF,CAAC;QAEF,oBAAe,GAAG;YAChB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,oBAAoB,CAE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,EACFA,oBACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,wCAAwC,EAC9C,OAAO,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,aAGzC,CACL,EACL,IAAI,CAAC,gBAAgB,KACpBA,2CACE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,SAAS,EAAE,SAAS,GACpB,CACH,CACG,CACF,EACN;SACH;KACF;IAED,MAAM;;QACJ,MAAM,SAAS,GACb,MAAA,MAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,0CAAE,IAAI,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM;YAC/C,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,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":["useSearchcraftStore","classNames","h"],"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.entry.cjs.js","mappings":";;;;;;;;MAyCa,sBAAsB;;;;;;;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,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ore","classNames","h"],"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}
@@ -2,30 +2,47 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b3b77ea2.js');
6
-
7
- const searchcraftPopoverListItemModuleCss = ":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-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}";
8
- const SearchcraftPopoverListItemStyle0 = searchcraftPopoverListItemModuleCss;
5
+ const index = require('./index-a81df4f0.js');
6
+ const store = require('./store-f6ba3dfb.js');
9
7
 
10
8
  const SearchcraftPopoverListItem = class {
11
9
  constructor(hostRef) {
12
10
  index.registerInstance(this, hostRef);
13
- this.titleContent = undefined;
14
- this.subtitleContent = undefined;
15
- this.imageSrc = undefined;
16
- this.imageAlt = undefined;
17
- this.href = undefined;
18
- this.documentPosition = undefined;
19
11
  }
12
+ /** The result title */
13
+ titleContent;
14
+ /** The result subtitle */
15
+ subtitleContent;
16
+ /** The source of the image. If not included, no item will be rendered. */
17
+ imageSrc;
18
+ /** The image alt tag. */
19
+ imageAlt;
20
+ /** The link href */
21
+ href;
22
+ /** The document position relative to the search results (For Measure) */
23
+ documentPosition = 0;
20
24
  componentDidLoad() { }
21
25
  connectedCallback() { }
22
26
  disconnectedCallback() { }
23
27
  handleButtonClick() { }
28
+ handleLinkClick = () => {
29
+ const state = store.useSearchcraftStore.getState();
30
+ const searchcraft = state.getSearchcraftInstance();
31
+ if (searchcraft) {
32
+ const document_position = this.documentPosition;
33
+ const search_term = state.query;
34
+ const number_of_documents = state.searchResults?.data?.hits?.length || 0;
35
+ searchcraft.sendMeasureEvent('document_clicked', {
36
+ document_position,
37
+ number_of_documents,
38
+ search_term,
39
+ });
40
+ }
41
+ };
24
42
  render() {
25
- return (index.h("a", { key: 'b7a590e92994869477825dd17545e8d4e05d1d07', class: 'searchcraft-popover-list-item', href: this.href }, this.imageSrc && (index.h("div", { key: '129525e50ec17dce052f503af318b56e06c900ef', class: 'searchcraft-popover-list-item-image-wrapper' }, index.h("img", { key: '4ba701f35cbf7e167e7edd63ba19e3576e620c26', alt: this.imageAlt, src: this.imageSrc, class: 'searchcraft-popover-list-item-image' }))), index.h("div", { key: '6a6ab09451f5d9d4e554dc1f1fcd57ec13adf2f2', class: 'searchcraft-popover-list-item-info-wrapper' }, index.h("p", { key: '476fdefff6cb35167fb00f24cdf03b9f8d826ba5', class: 'searchcraft-popover-list-item-title' }, this.titleContent), index.h("p", { key: 'b43fd584bfcc8efc7d50d7220b649fafc8bba244', class: 'searchcraft-popover-list-item-subtitle' }, this.subtitleContent))));
43
+ return (index.h("a", { key: 'b20aae2fc421323774a5129dde7d53d4ae3283fb', class: 'searchcraft-popover-list-item', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSrc && (index.h("div", { key: '79541d12ea3adafff2e141cb8946aa3feaea51df', class: 'searchcraft-popover-list-item-image-wrapper' }, index.h("img", { key: '3e6368a0f544a58ee0af9d1c15d0c909c6231842', alt: this.imageAlt, src: this.imageSrc, class: 'searchcraft-popover-list-item-image' }))), index.h("div", { key: '87e7a9dcc8b868af259b4456e9962af9d8dee498', class: 'searchcraft-popover-list-item-info-wrapper' }, index.h("p", { key: 'e5b63b4c2752573d0ee0ef52c2903b593a8b94a0', class: 'searchcraft-popover-list-item-title' }, this.titleContent), index.h("p", { key: 'c506d5d7e569ec20885eb65cdc6476dfb8895a13', class: 'searchcraft-popover-list-item-subtitle' }, this.subtitleContent))));
26
44
  }
27
45
  };
28
- SearchcraftPopoverListItem.style = SearchcraftPopoverListItemStyle0;
29
46
 
30
47
  exports.searchcraft_popover_list_item = SearchcraftPopoverListItem;
31
48
 
@@ -1 +1 @@
1
- {"file":"searchcraft-popover-list-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mCAAmC,GAAG,g2JAAg2J,CAAC;AAC74J,yCAAe,mCAAmC;;MCSrC,0BAA0B;;;;;;;;;;IAcrC,gBAAgB,MAAK;IAErB,iBAAiB,MAAK;IAEtB,oBAAoB,MAAK;IAEzB,iBAAiB,MAAK;IAEtB,MAAM;QACJ,QACEA,gEAAG,KAAK,EAAC,+BAA+B,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IACrD,IAAI,CAAC,QAAQ,KACZA,kEAAK,KAAK,EAAC,6CAA6C,IACtDA,kEACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,KAAK,EAAC,qCAAqC,GAC3C,CACE,CACP,EACDA,kEAAK,KAAK,EAAC,4CAA4C,IACrDA,gEAAG,KAAK,EAAC,qCAAqC,IAAE,IAAI,CAAC,YAAY,CAAK,EACtEA,gEAAG,KAAK,EAAC,wCAAwC,IAC9C,IAAI,CAAC,eAAe,CACnB,CACA,CACJ,EACJ;KACH;;;;;;","names":["h"],"sources":["src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.module.scss?tag=searchcraft-popover-list-item","src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.tsx"],"sourcesContent":[".searchcraft-popover-list-item {\n all: unset;\n display: flex;\n flex-direction: row;\n cursor: pointer;\n gap: 8px;\n padding-right: var(--sc-popover-list-item-padding-horizontal);\n padding-left: var(--sc-popover-list-item-padding-horizontal);\n padding-top: var(--sc-popover-list-item-padding-vertical);\n padding-bottom: var(--sc-popover-list-item-padding-vertical);\n\n &:focus {\n background-color: var(--sc-surface-neutral-secondary-active);\n color: var(--sc-content-neutral-secondary);\n }\n\n &:hover {\n background-color: var(--sc-surface-neutral-secondary-hover);\n color: var(--sc-content-neutral-secondary);\n }\n}\n\n.searchcraft-popover-list-item-title {\n @include body();\n margin: 0;\n color: inherit;\n}\n\n.searchcraft-popover-list-item-subtitle {\n @include body-small();\n margin: 0;\n color: inherit;\n}\n\n.searchcraft-popover-list-item-image-wrapper {\n width: var(--sc-popover-list-item-image-size);\n height: var(--sc-popover-list-item-image-size);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.searchcraft-popover-list-item-image {\n max-width: var(--sc-popover-list-item-image-size);\n max-height: var(--sc-popover-list-item-image-size);\n}\n\n.searchcraft-popover-list-item-info-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n justify-content: center;\n}","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n */\n@Component({\n tag: 'searchcraft-popover-list-item',\n styleUrl: 'searchcraft-popover-list-item.module.scss',\n shadow: false,\n})\nexport class SearchcraftPopoverListItem {\n /** The result title */\n @Prop() titleContent: string | undefined;\n /** The result subtitle */\n @Prop() subtitleContent: string | undefined;\n /** The source of the image. If not included, no item will be rendered. */\n @Prop() imageSrc: string | undefined;\n /** The image alt tag. */\n @Prop() imageAlt: string | undefined;\n /** The link href */\n @Prop() href: string | undefined;\n /** The document position relative to the search results (For Measure) */\n @Prop() documentPosition: number;\n\n componentDidLoad() {}\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n handleButtonClick() {}\n\n render() {\n return (\n <a class='searchcraft-popover-list-item' href={this.href}>\n {this.imageSrc && (\n <div class='searchcraft-popover-list-item-image-wrapper'>\n <img\n alt={this.imageAlt}\n src={this.imageSrc}\n class='searchcraft-popover-list-item-image'\n />\n </div>\n )}\n <div class='searchcraft-popover-list-item-info-wrapper'>\n <p class='searchcraft-popover-list-item-title'>{this.titleContent}</p>\n <p class='searchcraft-popover-list-item-subtitle'>\n {this.subtitleContent}\n </p>\n </div>\n </a>\n );\n }\n}\n"],"version":3}
1
+ {"file":"searchcraft-popover-list-item.entry.cjs.js","mappings":";;;;;;;MAUa,0BAA0B;;;;;IAE7B,YAAY,CAAqB;;IAEjC,eAAe,CAAqB;;IAEpC,QAAQ,CAAqB;;IAE7B,QAA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tsx"],"sourcesContent":["import { useSearchcraftStore } from '@provider/store';\nimport { Component, h, Prop } from '@stencil/core';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n */\n@Component({\n tag: 'searchcraft-popover-list-item',\n shadow: false,\n})\nexport class SearchcraftPopoverListItem {\n /** The result title */\n @Prop() titleContent: string | undefined;\n /** The result subtitle */\n @Prop() subtitleContent: string | undefined;\n /** The source of the image. If not included, no item will be rendered. */\n @Prop() imageSrc: string | undefined;\n /** The image alt tag. */\n @Prop() imageAlt: string | undefined;\n /** The link href */\n @Prop() href: string | undefined;\n /** The document position relative to the search results (For Measure) */\n @Prop() documentPosition = 0;\n\n componentDidLoad() {}\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n handleButtonClick() {}\n\n handleLinkClick = () => {\n const state = useSearchcraftStore.getState();\n const searchcraft = state.getSearchcraftInstance();\n\n if (searchcraft) {\n const document_position = this.documentPosition;\n const search_term = state.query;\n const number_of_documents = state.searchResults?.data?.hits?.length || 0;\n\n searchcraft.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n render() {\n return (\n <a\n class='searchcraft-popover-list-item'\n href={this.href}\n onClick={this.handleLinkClick.bind(this)}\n >\n {this.imageSrc && (\n <div class='searchcraft-popover-list-item-image-wrapper'>\n <img\n alt={this.imageAlt}\n src={this.imageSrc}\n class='searchcraft-popover-list-item-image'\n />\n </div>\n )}\n <div class='searchcraft-popover-list-item-info-wrapper'>\n <p class='searchcraft-popover-list-item-title'>{this.titleContent}</p>\n <p class='searchcraft-popover-list-item-subtitle'>\n {this.subtitleContent}\n </p>\n </div>\n </a>\n );\n }\n}\n"],"version":3}
@@ -2,27 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b3b77ea2.js');
6
- const store = require('./store-d7ebcf7a.js');
5
+ const index = require('./index-a81df4f0.js');
6
+ const store = require('./store-f6ba3dfb.js');
7
7
  const units = require('./units-fe4d8083.js');
8
8
 
9
- 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}}";
10
- const SearchcraftResultsInfoStyle0 = searchcraftResultsInfoModuleCss;
11
-
12
9
  const SearchcraftResultsInfo = class {
13
10
  constructor(hostRef) {
14
11
  index.registerInstance(this, hostRef);
15
- this.isRequesting = false;
16
- this.resultsCount = 0;
17
- this.responseTime = '';
18
- this.query = '';
19
12
  }
13
+ isRequesting = false;
14
+ resultsCount = 0;
15
+ responseTime = '';
16
+ query = '';
17
+ unsubscribe = () => { };
20
18
  connectedCallback() {
21
19
  this.unsubscribe = store.useSearchcraftStore.subscribe((state) => {
22
- var _a, _b, _c, _d;
23
20
  this.isRequesting = state.isRequesting;
24
- this.resultsCount = ((_b = (_a = state.searchResults) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.count) || 0;
25
- 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);
21
+ this.resultsCount = state.searchResults?.data?.count || 0;
22
+ this.responseTime = ((state.searchResults?.data?.time_taken || 0) * 1000).toFixed(2);
26
23
  this.query = state.query || '';
27
24
  });
28
25
  }
@@ -39,7 +36,6 @@ const SearchcraftResultsInfo = class {
39
36
  return (index.h("div", { class: 'searchcraft-results-info-container' }, index.h("p", { class: 'searchcraft-results-info-content' }, formattedResults, " results found in ", this.responseTime, "ms")));
40
37
  }
41
38
  };
42
- SearchcraftResultsInfo.style = SearchcraftResultsInfoStyle0;
43
39
 
44
40
  exports.searchcraft_results_info = SearchcraftResultsInfo;
45
41
 
@@ -1 +1 @@
1
- {"file":"searchcraft-results-info.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,+BAA+B,GAAG,6rHAA6rH,CAAC;AACtuH,qCAAe,+BAA+B;;MCoBjC,sBAAsB;;;4BACT,KAAK;4BACL,CAAC;4BACD,EAAE;qBACT,EAAE;;IAInB,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAGA,yBAAmB,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,GAAGC,4BAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnE,QACEC,iBAAK,KAAK,EAAC,oCAAoC,IAC7CA,eAAG,KAAK,EAAC,kCAAkC,IACxC,gBAAgB,wBAAoB,IAAI,CAAC,YAAY,OACpD,CACA,EACN;KACH;;;;;;","names":["useSearchcraftStore","formatNumberWithCommas","h"],"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.entry.cjs.js","mappings":";;;;;;;;MAoBa,sBAAsB;;;;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,GAAGA,yBAAmB,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,GAAGC,4BAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnE,QACEC,iBAAK,KAAK,EAAC,oCAAoC,IAC7CA,eAAG,KAAK,EAAC,kCAAkC,IACxC,gBAAgB,wBAAoB,IAAI,CAAC,YAAY,OACpD,CACA,EACN;KACH;;;;;","names":["useSearchcraftStore","formatNumberWithCommas","h"],"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}
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-a81df4f0.js');
6
+
7
+ 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 */
8
+ `;
9
+
10
+ const SearchcraftErrorMessage = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ }
14
+ componentDidLoad() {
15
+ console.log('Loading theme...');
16
+ console.log(styles);
17
+ const styleTag = document.querySelector('#searchcraft-theme') ||
18
+ document.createElement('style');
19
+ styleTag.innerHTML = styles;
20
+ styleTag.id = 'searchcraft-theme';
21
+ const head = document.head || document.getElementsByTagName('head')[0];
22
+ if (!head.contains(styleTag)) {
23
+ if (head.firstChild) {
24
+ head.insertBefore(styleTag, head.firstChild);
25
+ }
26
+ else {
27
+ head.appendChild(styleTag);
28
+ }
29
+ }
30
+ }
31
+ render() {
32
+ return;
33
+ }
34
+ };
35
+
36
+ exports.searchcraft_theme = SearchcraftErrorMessage;
37
+
38
+ //# sourceMappingURL=searchcraft-theme.cjs.entry.js.map