@reykjavik/hanna-react 0.10.53

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 (357) hide show
  1. package/CHANGELOG.md +795 -0
  2. package/README.md +69 -0
  3. package/lib/AccordionList.cjs +91 -0
  4. package/lib/AccordionList.mjs +69 -0
  5. package/lib/ActionCards.cjs +57 -0
  6. package/lib/ActionCards.mjs +35 -0
  7. package/lib/Alert.cjs +159 -0
  8. package/lib/Alert.mjs +139 -0
  9. package/lib/ArticleCarousel/_ArticleCarouselCard.cjs +75 -0
  10. package/lib/ArticleCarousel/_ArticleCarouselCard.mjs +51 -0
  11. package/lib/ArticleCarousel.cjs +43 -0
  12. package/lib/ArticleCarousel.mjs +21 -0
  13. package/lib/ArticleMeta.cjs +46 -0
  14. package/lib/ArticleMeta.mjs +22 -0
  15. package/lib/Attention.cjs +33 -0
  16. package/lib/Attention.mjs +9 -0
  17. package/lib/BasicTable.cjs +72 -0
  18. package/lib/BasicTable.mjs +50 -0
  19. package/lib/Bling.cjs +76 -0
  20. package/lib/Bling.mjs +52 -0
  21. package/lib/BlockBreak.cjs +32 -0
  22. package/lib/BlockBreak.mjs +8 -0
  23. package/lib/BlockQuote.cjs +47 -0
  24. package/lib/BlockQuote.mjs +25 -0
  25. package/lib/BreadCrumbs.cjs +67 -0
  26. package/lib/BreadCrumbs.mjs +43 -0
  27. package/lib/ButtonBack.cjs +47 -0
  28. package/lib/ButtonBack.mjs +25 -0
  29. package/lib/ButtonBar.cjs +45 -0
  30. package/lib/ButtonBar.mjs +18 -0
  31. package/lib/ButtonPrimary.cjs +47 -0
  32. package/lib/ButtonPrimary.mjs +25 -0
  33. package/lib/ButtonSecondary.cjs +47 -0
  34. package/lib/ButtonSecondary.mjs +25 -0
  35. package/lib/ButtonTertiary.cjs +64 -0
  36. package/lib/ButtonTertiary.mjs +42 -0
  37. package/lib/Carousel.cjs +52 -0
  38. package/lib/Carousel.mjs +30 -0
  39. package/lib/CarouselStepper.cjs +51 -0
  40. package/lib/CarouselStepper.mjs +29 -0
  41. package/lib/CenterColumn.cjs +40 -0
  42. package/lib/CenterColumn.mjs +16 -0
  43. package/lib/Checkbox.cjs +52 -0
  44. package/lib/Checkbox.mjs +30 -0
  45. package/lib/CheckboxButtonsGroup.cjs +65 -0
  46. package/lib/CheckboxButtonsGroup.mjs +43 -0
  47. package/lib/CheckboxGroup.cjs +55 -0
  48. package/lib/CheckboxGroup.mjs +33 -0
  49. package/lib/CityBlock.cjs +49 -0
  50. package/lib/CityBlock.mjs +25 -0
  51. package/lib/ContactBubble.cjs +200 -0
  52. package/lib/ContactBubble.mjs +173 -0
  53. package/lib/ContentArticle.cjs +63 -0
  54. package/lib/ContentArticle.mjs +41 -0
  55. package/lib/ContentImage.cjs +58 -0
  56. package/lib/ContentImage.mjs +36 -0
  57. package/lib/Datepicker.cjs +164 -0
  58. package/lib/Datepicker.mjs +142 -0
  59. package/lib/ExtraLinks.cjs +96 -0
  60. package/lib/ExtraLinks.mjs +74 -0
  61. package/lib/FeatureList.cjs +53 -0
  62. package/lib/FeatureList.mjs +29 -0
  63. package/lib/FieldGroup.cjs +40 -0
  64. package/lib/FieldGroup.mjs +16 -0
  65. package/lib/FileInput.cjs +256 -0
  66. package/lib/FileInput.mjs +234 -0
  67. package/lib/Foonote.cjs +30 -0
  68. package/lib/Foonote.mjs +6 -0
  69. package/lib/FooterBadges.cjs +49 -0
  70. package/lib/FooterBadges.mjs +25 -0
  71. package/lib/FooterInfo.cjs +47 -0
  72. package/lib/FooterInfo.mjs +23 -0
  73. package/lib/Footnote.cjs +32 -0
  74. package/lib/Footnote.mjs +8 -0
  75. package/lib/Form.cjs +56 -0
  76. package/lib/Form.mjs +34 -0
  77. package/lib/FormField.cjs +153 -0
  78. package/lib/FormField.mjs +131 -0
  79. package/lib/Gallery/_GalleryItem.cjs +83 -0
  80. package/lib/Gallery/_GalleryItem.mjs +61 -0
  81. package/lib/Gallery/_GalleryModal.cjs +104 -0
  82. package/lib/Gallery/_GalleryModal.mjs +82 -0
  83. package/lib/Gallery/_GalleryModalContext.cjs +30 -0
  84. package/lib/Gallery/_GalleryModalContext.mjs +6 -0
  85. package/lib/Gallery/_GalleryModalItem.cjs +59 -0
  86. package/lib/Gallery/_GalleryModalItem.mjs +36 -0
  87. package/lib/Gallery.cjs +79 -0
  88. package/lib/Gallery.mjs +57 -0
  89. package/lib/GridBlocks.cjs +81 -0
  90. package/lib/GridBlocks.mjs +59 -0
  91. package/lib/Heading.cjs +45 -0
  92. package/lib/Heading.mjs +21 -0
  93. package/lib/HeroBlock.cjs +74 -0
  94. package/lib/HeroBlock.mjs +52 -0
  95. package/lib/IframeBlock.cjs +48 -0
  96. package/lib/IframeBlock.mjs +24 -0
  97. package/lib/Illustration.cjs +51 -0
  98. package/lib/Illustration.mjs +31 -0
  99. package/lib/ImageCards.cjs +72 -0
  100. package/lib/ImageCards.mjs +52 -0
  101. package/lib/InfoBlock.cjs +51 -0
  102. package/lib/InfoBlock.mjs +27 -0
  103. package/lib/InfoHero.cjs +150 -0
  104. package/lib/InfoHero.mjs +128 -0
  105. package/lib/IslandBlock.cjs +63 -0
  106. package/lib/IslandBlock.mjs +41 -0
  107. package/lib/IslandPageBlock.cjs +49 -0
  108. package/lib/IslandPageBlock.mjs +25 -0
  109. package/lib/LabeledTextBlock.cjs +60 -0
  110. package/lib/LabeledTextBlock.mjs +38 -0
  111. package/lib/Layout.cjs +113 -0
  112. package/lib/Layout.mjs +87 -0
  113. package/lib/MainMenu/_Auxiliary.cjs +54 -0
  114. package/lib/MainMenu/_Auxiliary.mjs +28 -0
  115. package/lib/MainMenu/_PrimaryPanel.cjs +74 -0
  116. package/lib/MainMenu/_PrimaryPanel.mjs +48 -0
  117. package/lib/MainMenu.cjs +209 -0
  118. package/lib/MainMenu.mjs +187 -0
  119. package/lib/MiniMetrics.cjs +56 -0
  120. package/lib/MiniMetrics.mjs +34 -0
  121. package/lib/Modal.cjs +70 -0
  122. package/lib/Modal.mjs +48 -0
  123. package/lib/NameCard.cjs +115 -0
  124. package/lib/NameCard.mjs +91 -0
  125. package/lib/NameCards.cjs +52 -0
  126. package/lib/NameCards.mjs +30 -0
  127. package/lib/NewsHero.cjs +136 -0
  128. package/lib/NewsHero.mjs +114 -0
  129. package/lib/PageFilter.cjs +48 -0
  130. package/lib/PageFilter.mjs +24 -0
  131. package/lib/PageHeading.cjs +42 -0
  132. package/lib/PageHeading.mjs +18 -0
  133. package/lib/ProcessOverview.cjs +52 -0
  134. package/lib/ProcessOverview.mjs +28 -0
  135. package/lib/PullQuote.cjs +47 -0
  136. package/lib/PullQuote.mjs +25 -0
  137. package/lib/RadioButtonsGroup.cjs +64 -0
  138. package/lib/RadioButtonsGroup.mjs +42 -0
  139. package/lib/RadioGroup.cjs +58 -0
  140. package/lib/RadioGroup.mjs +36 -0
  141. package/lib/RelatedLinks.cjs +61 -0
  142. package/lib/RelatedLinks.mjs +37 -0
  143. package/lib/RowBlock.cjs +39 -0
  144. package/lib/RowBlock.mjs +15 -0
  145. package/lib/RowBlockColumn.cjs +40 -0
  146. package/lib/RowBlockColumn.mjs +16 -0
  147. package/lib/SearchInput.cjs +136 -0
  148. package/lib/SearchInput.mjs +114 -0
  149. package/lib/SearchResults/_SearchResultsItem.cjs +54 -0
  150. package/lib/SearchResults/_SearchResultsItem.mjs +30 -0
  151. package/lib/SearchResults.cjs +172 -0
  152. package/lib/SearchResults.mjs +150 -0
  153. package/lib/SeenEffect.cjs +66 -0
  154. package/lib/SeenEffect.mjs +44 -0
  155. package/lib/Selectbox.cjs +144 -0
  156. package/lib/Selectbox.mjs +122 -0
  157. package/lib/ShareButtons.cjs +101 -0
  158. package/lib/ShareButtons.mjs +83 -0
  159. package/lib/Sharpie.cjs +51 -0
  160. package/lib/Sharpie.mjs +27 -0
  161. package/lib/SiteSearchAutocomplete.cjs +150 -0
  162. package/lib/SiteSearchAutocomplete.mjs +126 -0
  163. package/lib/SiteSearchCurtain.cjs +78 -0
  164. package/lib/SiteSearchCurtain.mjs +56 -0
  165. package/lib/SiteSearchInput.cjs +119 -0
  166. package/lib/SiteSearchInput.mjs +97 -0
  167. package/lib/Skeleton.cjs +63 -0
  168. package/lib/Skeleton.mjs +39 -0
  169. package/lib/SubHeading.cjs +43 -0
  170. package/lib/SubHeading.mjs +19 -0
  171. package/lib/Tabs.cjs +166 -0
  172. package/lib/Tabs.mjs +144 -0
  173. package/lib/TagPill.cjs +113 -0
  174. package/lib/TagPill.mjs +91 -0
  175. package/lib/TextBlock.cjs +45 -0
  176. package/lib/TextBlock.mjs +21 -0
  177. package/lib/TextButton.cjs +55 -0
  178. package/lib/TextButton.mjs +33 -0
  179. package/lib/TextInput.cjs +136 -0
  180. package/lib/TextInput.mjs +114 -0
  181. package/lib/VSpacer.cjs +70 -0
  182. package/lib/VSpacer.mjs +46 -0
  183. package/lib/VerticalTabsTOC.cjs +123 -0
  184. package/lib/VerticalTabsTOC.mjs +101 -0
  185. package/lib/WizardLayout.cjs +79 -0
  186. package/lib/WizardLayout.mjs +55 -0
  187. package/lib/WizardLayoutClose.cjs +47 -0
  188. package/lib/WizardLayoutClose.mjs +25 -0
  189. package/lib/WizardStepper.cjs +55 -0
  190. package/lib/WizardStepper.mjs +31 -0
  191. package/lib/_abstract/Button.cjs +114 -0
  192. package/lib/_abstract/Button.mjs +92 -0
  193. package/lib/_abstract/CardList.cjs +100 -0
  194. package/lib/_abstract/CardList.mjs +76 -0
  195. package/lib/_abstract/Image.cjs +75 -0
  196. package/lib/_abstract/Image.mjs +51 -0
  197. package/lib/_abstract/Link.cjs +37 -0
  198. package/lib/_abstract/Link.mjs +10 -0
  199. package/lib/_abstract/TogglerGroup.cjs +92 -0
  200. package/lib/_abstract/TogglerGroup.mjs +70 -0
  201. package/lib/_abstract/TogglerGroupField.cjs +121 -0
  202. package/lib/_abstract/TogglerGroupField.mjs +99 -0
  203. package/lib/_abstract/TogglerInput.cjs +105 -0
  204. package/lib/_abstract/TogglerInput.mjs +83 -0
  205. package/lib/_abstract/_AbstractCarousel.cjs +170 -0
  206. package/lib/_abstract/_AbstractCarousel.mjs +152 -0
  207. package/lib/_abstract/_Blings.cjs +47 -0
  208. package/lib/_abstract/_Blings.mjs +23 -0
  209. package/lib/_abstract/_Block.cjs +73 -0
  210. package/lib/_abstract/_Block.mjs +51 -0
  211. package/lib/_abstract/_Quote.cjs +43 -0
  212. package/lib/_abstract/_Quote.mjs +17 -0
  213. package/lib/_abstract/breakOnNL.cjs +30 -0
  214. package/lib/_abstract/breakOnNL.mjs +6 -0
  215. package/lib/assets.cjs +77 -0
  216. package/lib/assets.mjs +53 -0
  217. package/lib/constants.cjs +49 -0
  218. package/lib/constants.mjs +24 -0
  219. package/lib/focus-visible.cjs +1 -0
  220. package/lib/focus-visible.mjs +1 -0
  221. package/lib/utils/config.cjs +27 -0
  222. package/lib/utils/config.mjs +4 -0
  223. package/lib/utils/detectEdgeScroll.cjs +95 -0
  224. package/lib/utils/detectEdgeScroll.mjs +71 -0
  225. package/lib/utils/env.cjs +31 -0
  226. package/lib/utils/env.mjs +5 -0
  227. package/lib/utils/seenEffect.cjs +93 -0
  228. package/lib/utils/seenEffect.mjs +65 -0
  229. package/lib/utils/useFormatMonitor.cjs +29 -0
  230. package/lib/utils/useFormatMonitor.mjs +6 -0
  231. package/lib/utils/useGetSVGtext.cjs +44 -0
  232. package/lib/utils/useGetSVGtext.mjs +21 -0
  233. package/lib/utils/useMenuToggling.cjs +83 -0
  234. package/lib/utils/useMenuToggling.mjs +60 -0
  235. package/lib/utils/useScrollbarWidthCSSVar.cjs +32 -0
  236. package/lib/utils/useScrollbarWidthCSSVar.mjs +6 -0
  237. package/lib/utils.cjs +18 -0
  238. package/lib/utils.mjs +2 -0
  239. package/package.json +491 -0
  240. package/types/AccordionList.d.ts +17 -0
  241. package/types/ActionCards.d.ts +5 -0
  242. package/types/Alert.d.ts +49 -0
  243. package/types/ArticleCarousel/_ArticleCarouselCard.d.ts +27 -0
  244. package/types/ArticleCarousel.d.ts +12 -0
  245. package/types/ArticleMeta.d.ts +9 -0
  246. package/types/Attention.d.ts +7 -0
  247. package/types/BasicTable.d.ts +12 -0
  248. package/types/Bling.d.ts +81 -0
  249. package/types/BlockBreak.d.ts +2 -0
  250. package/types/BlockQuote.d.ts +4 -0
  251. package/types/BreadCrumbs.d.ts +11 -0
  252. package/types/ButtonBack.d.ts +7 -0
  253. package/types/ButtonBar.d.ts +16 -0
  254. package/types/ButtonPrimary.d.ts +7 -0
  255. package/types/ButtonSecondary.d.ts +7 -0
  256. package/types/ButtonTertiary.d.ts +12 -0
  257. package/types/Carousel.d.ts +4 -0
  258. package/types/CarouselStepper.d.ts +4 -0
  259. package/types/CenterColumn.d.ts +7 -0
  260. package/types/Checkbox.d.ts +4 -0
  261. package/types/CheckboxButtonsGroup.d.ts +11 -0
  262. package/types/CheckboxGroup.d.ts +9 -0
  263. package/types/CityBlock.d.ts +23 -0
  264. package/types/ContactBubble.d.ts +58 -0
  265. package/types/ContentArticle.d.ts +15 -0
  266. package/types/ContentImage.d.ts +8 -0
  267. package/types/Datepicker.d.ts +39 -0
  268. package/types/ExtraLinks.d.ts +18 -0
  269. package/types/FeatureList.d.ts +12 -0
  270. package/types/FieldGroup.d.ts +9 -0
  271. package/types/FileInput.d.ts +17 -0
  272. package/types/Foonote.d.ts +12 -0
  273. package/types/FooterBadges.d.ts +9 -0
  274. package/types/FooterInfo.d.ts +18 -0
  275. package/types/Footnote.d.ts +6 -0
  276. package/types/Form.d.ts +7 -0
  277. package/types/FormField.d.ts +65 -0
  278. package/types/Gallery/_GalleryItem.d.ts +8 -0
  279. package/types/Gallery/_GalleryModal.d.ts +6 -0
  280. package/types/Gallery/_GalleryModalContext.d.ts +9 -0
  281. package/types/Gallery/_GalleryModalItem.d.ts +3 -0
  282. package/types/Gallery.d.ts +17 -0
  283. package/types/GridBlocks.d.ts +26 -0
  284. package/types/Heading.d.ts +16 -0
  285. package/types/HeroBlock.d.ts +19 -0
  286. package/types/IframeBlock.d.ts +23 -0
  287. package/types/Illustration.d.ts +13 -0
  288. package/types/ImageCards.d.ts +8 -0
  289. package/types/InfoBlock.d.ts +17 -0
  290. package/types/InfoHero.d.ts +17 -0
  291. package/types/IslandBlock.d.ts +25 -0
  292. package/types/IslandPageBlock.d.ts +24 -0
  293. package/types/LabeledTextBlock.d.ts +11 -0
  294. package/types/Layout.d.ts +33 -0
  295. package/types/MainMenu/_Auxiliary.d.ts +6 -0
  296. package/types/MainMenu/_PrimaryPanel.d.ts +13 -0
  297. package/types/MainMenu.d.ts +48 -0
  298. package/types/MiniMetrics.d.ts +8 -0
  299. package/types/Modal.d.ts +10 -0
  300. package/types/NameCard.d.ts +64 -0
  301. package/types/NameCards.d.ts +6 -0
  302. package/types/NewsHero.d.ts +14 -0
  303. package/types/PageFilter.d.ts +17 -0
  304. package/types/PageHeading.d.ts +10 -0
  305. package/types/ProcessOverview.d.ts +13 -0
  306. package/types/PullQuote.d.ts +4 -0
  307. package/types/RadioButtonsGroup.d.ts +11 -0
  308. package/types/RadioGroup.d.ts +13 -0
  309. package/types/RelatedLinks.d.ts +20 -0
  310. package/types/RowBlock.d.ts +12 -0
  311. package/types/RowBlockColumn.d.ts +8 -0
  312. package/types/SearchInput.d.ts +18 -0
  313. package/types/SearchResults/_SearchResultsItem.d.ts +18 -0
  314. package/types/SearchResults.d.ts +33 -0
  315. package/types/SeenEffect.d.ts +4 -0
  316. package/types/Selectbox.d.ts +8 -0
  317. package/types/ShareButtons.d.ts +9 -0
  318. package/types/Sharpie.d.ts +23 -0
  319. package/types/SiteSearchAutocomplete.d.ts +40 -0
  320. package/types/SiteSearchCurtain.d.ts +6 -0
  321. package/types/SiteSearchInput.d.ts +24 -0
  322. package/types/Skeleton.d.ts +25 -0
  323. package/types/SubHeading.d.ts +10 -0
  324. package/types/Tabs.d.ts +35 -0
  325. package/types/TagPill.d.ts +27 -0
  326. package/types/TextBlock.d.ts +15 -0
  327. package/types/TextButton.d.ts +9 -0
  328. package/types/TextInput.d.ts +16 -0
  329. package/types/VSpacer.d.ts +24 -0
  330. package/types/VerticalTabsTOC.d.ts +14 -0
  331. package/types/WizardLayout.d.ts +15 -0
  332. package/types/WizardLayoutClose.d.ts +3 -0
  333. package/types/WizardStepper.d.ts +36 -0
  334. package/types/_abstract/Button.d.ts +40 -0
  335. package/types/_abstract/CardList.d.ts +29 -0
  336. package/types/_abstract/Image.d.ts +32 -0
  337. package/types/_abstract/Link.d.ts +27 -0
  338. package/types/_abstract/TogglerGroup.d.ts +31 -0
  339. package/types/_abstract/TogglerGroupField.d.ts +17 -0
  340. package/types/_abstract/TogglerInput.d.ts +22 -0
  341. package/types/_abstract/_AbstractCarousel.d.ts +25 -0
  342. package/types/_abstract/_Blings.d.ts +11 -0
  343. package/types/_abstract/_Block.d.ts +22 -0
  344. package/types/_abstract/_Quote.d.ts +9 -0
  345. package/types/_abstract/breakOnNL.d.ts +2 -0
  346. package/types/assets.d.ts +42 -0
  347. package/types/constants.d.ts +39 -0
  348. package/types/focus-visible.d.ts +1 -0
  349. package/types/utils/config.d.ts +2 -0
  350. package/types/utils/detectEdgeScroll.d.ts +52 -0
  351. package/types/utils/env.d.ts +1 -0
  352. package/types/utils/seenEffect.d.ts +28 -0
  353. package/types/utils/useFormatMonitor.d.ts +38 -0
  354. package/types/utils/useGetSVGtext.d.ts +6 -0
  355. package/types/utils/useMenuToggling.d.ts +8 -0
  356. package/types/utils/useScrollbarWidthCSSVar.d.ts +1 -0
  357. package/types/utils.d.ts +2 -0
@@ -0,0 +1,150 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, { get: all[name], enumerable: true });
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ }
46
+ return to;
47
+ };
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
49
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
+ var SiteSearchAutocomplete_exports = {};
51
+ __export(SiteSearchAutocomplete_exports, {
52
+ default: () => SiteSearchAutocomplete_default,
53
+ defaultSiteSearchACTexts: () => defaultSiteSearchACTexts
54
+ });
55
+ module.exports = __toCommonJS(SiteSearchAutocomplete_exports);
56
+ var import_react = __toESM(require("react"));
57
+ var import_react_autosuggest = __toESM(require("react-autosuggest"));
58
+ var import_i18n = require("@reykjavik/hanna-utils/i18n");
59
+ var import_SiteSearchInput = __toESM(require("./SiteSearchInput"));
60
+ const defaultSiteSearchACTexts = {
61
+ is: {
62
+ lang: "is",
63
+ label: "Leit \xE1 vefnum",
64
+ inputLabel: "Leitaror\xF0",
65
+ placeholder: "Sl\xE1\xF0u inn leitaror\xF0",
66
+ suggestionsLabel: "Till\xF6gur"
67
+ },
68
+ en: {
69
+ lang: "en",
70
+ label: "Site search",
71
+ inputLabel: "Search terms",
72
+ placeholder: "Enter search terms",
73
+ suggestionsLabel: "Suggestions"
74
+ }
75
+ };
76
+ const SiteSearchAutocomplete = (props) => {
77
+ const {
78
+ suggestions,
79
+ setSuggestions,
80
+ renderSuggestion,
81
+ getSuggestionValue,
82
+ onSuggestionsFetchRequested,
83
+ onSuggestionSelected,
84
+ onSuggestionHighlighted,
85
+ onSubmit,
86
+ onButtonClick = onSubmit,
87
+ bem = "SiteSearchAutocomplete"
88
+ } = props;
89
+ const [value, setValue] = (0, import_react.useState)("");
90
+ const inputRef = (0, import_react.createRef)();
91
+ const txt = (0, import_i18n.getTexts)(props, defaultSiteSearchACTexts);
92
+ return /* @__PURE__ */ import_react.default.createElement(import_react_autosuggest.default, {
93
+ theme: {
94
+ container: bem,
95
+ containerOpen: bem + "--open",
96
+ suggestionsContainer: bem + "__container",
97
+ suggestionsContainerOpen: bem + "__container--open",
98
+ suggestionsList: bem + "__list",
99
+ suggestion: bem + "__item",
100
+ suggestionHighlighted: bem + "__item--highlighted"
101
+ },
102
+ focusInputOnSuggestionClick: true,
103
+ suggestions,
104
+ onSuggestionsClearRequested: () => setSuggestions([]),
105
+ onSuggestionsFetchRequested,
106
+ getSuggestionValue,
107
+ onSuggestionSelected,
108
+ onSuggestionHighlighted,
109
+ renderSuggestion,
110
+ containerProps: { "aria-label": txt.label },
111
+ renderSuggestionsContainer: ({ containerProps, children }) => /* @__PURE__ */ import_react.default.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
112
+ "aria-label": txt.suggestionsLabel
113
+ }), children),
114
+ inputProps: {
115
+ ref: inputRef,
116
+ value,
117
+ onChange: (_, { newValue }) => {
118
+ setValue(newValue);
119
+ }
120
+ },
121
+ renderInputComponent: (inputProps) => {
122
+ const _a = inputProps, {
123
+ className,
124
+ type,
125
+ disabled,
126
+ readOnly,
127
+ required,
128
+ children
129
+ } = _a, siteSearchProps = __objRest(_a, [
130
+ "className",
131
+ "type",
132
+ "disabled",
133
+ "readOnly",
134
+ "required",
135
+ "children"
136
+ ]);
137
+ return /* @__PURE__ */ import_react.default.createElement(import_SiteSearchInput.default, __spreadProps(__spreadValues({}, siteSearchProps), {
138
+ label: props.label || txt.inputLabel,
139
+ placeholder: txt.placeholder,
140
+ onSubmit: onSubmit && (() => onSubmit(value)),
141
+ onButtonClick: onButtonClick && (() => onButtonClick(value))
142
+ }));
143
+ }
144
+ });
145
+ };
146
+ var SiteSearchAutocomplete_default = SiteSearchAutocomplete;
147
+ // Annotate the CommonJS export names for ESM import in node:
148
+ 0 && (module.exports = {
149
+ defaultSiteSearchACTexts
150
+ });
@@ -0,0 +1,126 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import React, { createRef, useState } from "react";
33
+ import Autosuggest from "react-autosuggest";
34
+ import { getTexts } from "@reykjavik/hanna-utils/i18n";
35
+ import SiteSearchInput from "./SiteSearchInput";
36
+ const defaultSiteSearchACTexts = {
37
+ is: {
38
+ lang: "is",
39
+ label: "Leit \xE1 vefnum",
40
+ inputLabel: "Leitaror\xF0",
41
+ placeholder: "Sl\xE1\xF0u inn leitaror\xF0",
42
+ suggestionsLabel: "Till\xF6gur"
43
+ },
44
+ en: {
45
+ lang: "en",
46
+ label: "Site search",
47
+ inputLabel: "Search terms",
48
+ placeholder: "Enter search terms",
49
+ suggestionsLabel: "Suggestions"
50
+ }
51
+ };
52
+ const SiteSearchAutocomplete = (props) => {
53
+ const {
54
+ suggestions,
55
+ setSuggestions,
56
+ renderSuggestion,
57
+ getSuggestionValue,
58
+ onSuggestionsFetchRequested,
59
+ onSuggestionSelected,
60
+ onSuggestionHighlighted,
61
+ onSubmit,
62
+ onButtonClick = onSubmit,
63
+ bem = "SiteSearchAutocomplete"
64
+ } = props;
65
+ const [value, setValue] = useState("");
66
+ const inputRef = createRef();
67
+ const txt = getTexts(props, defaultSiteSearchACTexts);
68
+ return /* @__PURE__ */ React.createElement(Autosuggest, {
69
+ theme: {
70
+ container: bem,
71
+ containerOpen: bem + "--open",
72
+ suggestionsContainer: bem + "__container",
73
+ suggestionsContainerOpen: bem + "__container--open",
74
+ suggestionsList: bem + "__list",
75
+ suggestion: bem + "__item",
76
+ suggestionHighlighted: bem + "__item--highlighted"
77
+ },
78
+ focusInputOnSuggestionClick: true,
79
+ suggestions,
80
+ onSuggestionsClearRequested: () => setSuggestions([]),
81
+ onSuggestionsFetchRequested,
82
+ getSuggestionValue,
83
+ onSuggestionSelected,
84
+ onSuggestionHighlighted,
85
+ renderSuggestion,
86
+ containerProps: { "aria-label": txt.label },
87
+ renderSuggestionsContainer: ({ containerProps, children }) => /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
88
+ "aria-label": txt.suggestionsLabel
89
+ }), children),
90
+ inputProps: {
91
+ ref: inputRef,
92
+ value,
93
+ onChange: (_, { newValue }) => {
94
+ setValue(newValue);
95
+ }
96
+ },
97
+ renderInputComponent: (inputProps) => {
98
+ const _a = inputProps, {
99
+ className,
100
+ type,
101
+ disabled,
102
+ readOnly,
103
+ required,
104
+ children
105
+ } = _a, siteSearchProps = __objRest(_a, [
106
+ "className",
107
+ "type",
108
+ "disabled",
109
+ "readOnly",
110
+ "required",
111
+ "children"
112
+ ]);
113
+ return /* @__PURE__ */ React.createElement(SiteSearchInput, __spreadProps(__spreadValues({}, siteSearchProps), {
114
+ label: props.label || txt.inputLabel,
115
+ placeholder: txt.placeholder,
116
+ onSubmit: onSubmit && (() => onSubmit(value)),
117
+ onButtonClick: onButtonClick && (() => onButtonClick(value))
118
+ }));
119
+ }
120
+ });
121
+ };
122
+ var SiteSearchAutocomplete_default = SiteSearchAutocomplete;
123
+ export {
124
+ SiteSearchAutocomplete_default as default,
125
+ defaultSiteSearchACTexts
126
+ };
@@ -0,0 +1,78 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __export = (target, all) => {
22
+ for (var name in all)
23
+ __defProp(target, name, { get: all[name], enumerable: true });
24
+ };
25
+ var __copyProps = (to, from, except, desc) => {
26
+ if (from && typeof from === "object" || typeof from === "function") {
27
+ for (let key of __getOwnPropNames(from))
28
+ if (!__hasOwnProp.call(to, key) && key !== except)
29
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30
+ }
31
+ return to;
32
+ };
33
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
34
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+ var SiteSearchCurtain_exports = {};
36
+ __export(SiteSearchCurtain_exports, {
37
+ default: () => SiteSearchCurtain_default
38
+ });
39
+ module.exports = __toCommonJS(SiteSearchCurtain_exports);
40
+ var import_react = __toESM(require("react"));
41
+ var import_hooks = require("@hugsmidjan/react/hooks");
42
+ var import_getBemClass = __toESM(require("@hugsmidjan/react/utils/getBemClass"));
43
+ var import_env = require("./utils/env");
44
+ const SiteSearchCurtain = (props) => {
45
+ const [focused, setFocused] = (0, import_react.useState)(false);
46
+ let blurTimeout;
47
+ (0, import_hooks.useOnMount)(() => {
48
+ const closeSearch = (e) => {
49
+ if (e.key === "Escape") {
50
+ setFocused(false);
51
+ }
52
+ };
53
+ document.addEventListener("keyup", closeSearch);
54
+ return () => {
55
+ document.removeEventListener("keyup", closeSearch);
56
+ };
57
+ });
58
+ const focusHandler = () => {
59
+ blurTimeout && clearTimeout(blurTimeout);
60
+ setFocused(true);
61
+ };
62
+ const blurHandler = (e) => {
63
+ if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
64
+ blurTimeout = setTimeout(() => {
65
+ setFocused(false);
66
+ blurTimeout = void 0;
67
+ }, 100);
68
+ }
69
+ };
70
+ return /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({
71
+ className: (0, import_getBemClass.default)("SiteSearchCurtain", [focused && "focused"]),
72
+ onFocus: focusHandler,
73
+ onBlur: blurHandler
74
+ }, import_env.isPreact && { onfocusin: focusHandler, onfocusout: blurHandler }), props.children);
75
+ };
76
+ var SiteSearchCurtain_default = SiteSearchCurtain;
77
+ // Annotate the CommonJS export names for ESM import in node:
78
+ 0 && (module.exports = {});
@@ -0,0 +1,56 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import React, { useState } from "react";
18
+ import { useOnMount } from "@hugsmidjan/react/hooks";
19
+ import getBemClass from "@hugsmidjan/react/utils/getBemClass";
20
+ import { isPreact } from "./utils/env";
21
+ const SiteSearchCurtain = (props) => {
22
+ const [focused, setFocused] = useState(false);
23
+ let blurTimeout;
24
+ useOnMount(() => {
25
+ const closeSearch = (e) => {
26
+ if (e.key === "Escape") {
27
+ setFocused(false);
28
+ }
29
+ };
30
+ document.addEventListener("keyup", closeSearch);
31
+ return () => {
32
+ document.removeEventListener("keyup", closeSearch);
33
+ };
34
+ });
35
+ const focusHandler = () => {
36
+ blurTimeout && clearTimeout(blurTimeout);
37
+ setFocused(true);
38
+ };
39
+ const blurHandler = (e) => {
40
+ if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
41
+ blurTimeout = setTimeout(() => {
42
+ setFocused(false);
43
+ blurTimeout = void 0;
44
+ }, 100);
45
+ }
46
+ };
47
+ return /* @__PURE__ */ React.createElement("div", __spreadValues({
48
+ className: getBemClass("SiteSearchCurtain", [focused && "focused"]),
49
+ onFocus: focusHandler,
50
+ onBlur: blurHandler
51
+ }, isPreact && { onfocusin: focusHandler, onfocusout: blurHandler }), props.children);
52
+ };
53
+ var SiteSearchCurtain_default = SiteSearchCurtain;
54
+ export {
55
+ SiteSearchCurtain_default as default
56
+ };
@@ -0,0 +1,119 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, { get: all[name], enumerable: true });
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ }
46
+ return to;
47
+ };
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
49
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
+ var SiteSearchInput_exports = {};
51
+ __export(SiteSearchInput_exports, {
52
+ default: () => SiteSearchInput_default
53
+ });
54
+ module.exports = __toCommonJS(SiteSearchInput_exports);
55
+ var import_react = __toESM(require("react"));
56
+ var import_FormField = __toESM(require("./FormField"));
57
+ const SiteSearchInput = import_react.default.forwardRef((props, ref) => {
58
+ const _a = props, {
59
+ label,
60
+ id,
61
+ onChange,
62
+ placeholder = typeof label === "string" ? label : void 0,
63
+ buttonText = "Leita",
64
+ onSubmit,
65
+ onButtonClick = onSubmit,
66
+ onKeyDown,
67
+ ssr
68
+ } = _a, inputElementProps = __objRest(_a, [
69
+ "label",
70
+ "id",
71
+ "onChange",
72
+ "placeholder",
73
+ "buttonText",
74
+ "onSubmit",
75
+ "onButtonClick",
76
+ "onKeyDown",
77
+ "ssr"
78
+ ]);
79
+ const { value, defaultValue } = inputElementProps;
80
+ const [hasValue, setHasValue] = (0, import_react.useState)(void 0);
81
+ const filled = !!(value ?? hasValue ?? !!defaultValue);
82
+ const empty = !filled && !placeholder;
83
+ const _onChange = value != null ? onChange : (e) => {
84
+ setHasValue(!!e.target.value);
85
+ onChange && onChange(e);
86
+ };
87
+ return /* @__PURE__ */ import_react.default.createElement(import_FormField.default, {
88
+ className: "SiteSearchInput",
89
+ ssr,
90
+ label,
91
+ empty,
92
+ filled,
93
+ id,
94
+ renderInput: (className, inputProps, addFocusProps) => /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({
95
+ className: className.input
96
+ }, addFocusProps()), /* @__PURE__ */ import_react.default.createElement("input", __spreadProps(__spreadValues(__spreadProps(__spreadValues({
97
+ className: "SiteSearchInput__input",
98
+ onChange: _onChange
99
+ }, inputProps), {
100
+ placeholder,
101
+ onKeyDown: onSubmit ? (e) => {
102
+ if (e.key === "Enter" && onSubmit() !== true) {
103
+ e.preventDefault();
104
+ }
105
+ onKeyDown && onKeyDown(e);
106
+ } : onKeyDown
107
+ }), inputElementProps), {
108
+ ref
109
+ })), " ", /* @__PURE__ */ import_react.default.createElement("button", {
110
+ className: "SiteSearchInput__button",
111
+ type: "submit",
112
+ onClick: onButtonClick && ((e) => !onButtonClick() && e.preventDefault()),
113
+ title: buttonText
114
+ }, buttonText))
115
+ });
116
+ });
117
+ var SiteSearchInput_default = SiteSearchInput;
118
+ // Annotate the CommonJS export names for ESM import in node:
119
+ 0 && (module.exports = {});
@@ -0,0 +1,97 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import React, { useState } from "react";
33
+ import FormField from "./FormField";
34
+ const SiteSearchInput = React.forwardRef((props, ref) => {
35
+ const _a = props, {
36
+ label,
37
+ id,
38
+ onChange,
39
+ placeholder = typeof label === "string" ? label : void 0,
40
+ buttonText = "Leita",
41
+ onSubmit,
42
+ onButtonClick = onSubmit,
43
+ onKeyDown,
44
+ ssr
45
+ } = _a, inputElementProps = __objRest(_a, [
46
+ "label",
47
+ "id",
48
+ "onChange",
49
+ "placeholder",
50
+ "buttonText",
51
+ "onSubmit",
52
+ "onButtonClick",
53
+ "onKeyDown",
54
+ "ssr"
55
+ ]);
56
+ const { value, defaultValue } = inputElementProps;
57
+ const [hasValue, setHasValue] = useState(void 0);
58
+ const filled = !!(value ?? hasValue ?? !!defaultValue);
59
+ const empty = !filled && !placeholder;
60
+ const _onChange = value != null ? onChange : (e) => {
61
+ setHasValue(!!e.target.value);
62
+ onChange && onChange(e);
63
+ };
64
+ return /* @__PURE__ */ React.createElement(FormField, {
65
+ className: "SiteSearchInput",
66
+ ssr,
67
+ label,
68
+ empty,
69
+ filled,
70
+ id,
71
+ renderInput: (className, inputProps, addFocusProps) => /* @__PURE__ */ React.createElement("div", __spreadValues({
72
+ className: className.input
73
+ }, addFocusProps()), /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues(__spreadProps(__spreadValues({
74
+ className: "SiteSearchInput__input",
75
+ onChange: _onChange
76
+ }, inputProps), {
77
+ placeholder,
78
+ onKeyDown: onSubmit ? (e) => {
79
+ if (e.key === "Enter" && onSubmit() !== true) {
80
+ e.preventDefault();
81
+ }
82
+ onKeyDown && onKeyDown(e);
83
+ } : onKeyDown
84
+ }), inputElementProps), {
85
+ ref
86
+ })), " ", /* @__PURE__ */ React.createElement("button", {
87
+ className: "SiteSearchInput__button",
88
+ type: "submit",
89
+ onClick: onButtonClick && ((e) => !onButtonClick() && e.preventDefault()),
90
+ title: buttonText
91
+ }, buttonText))
92
+ });
93
+ });
94
+ var SiteSearchInput_default = SiteSearchInput;
95
+ export {
96
+ SiteSearchInput_default as default
97
+ };
@@ -0,0 +1,63 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var Skeleton_exports = {};
22
+ __export(Skeleton_exports, {
23
+ default: () => Skeleton_default
24
+ });
25
+ module.exports = __toCommonJS(Skeleton_exports);
26
+ var import_react = __toESM(require("react"));
27
+ var import_range = __toESM(require("@hugsmidjan/qj/range"));
28
+ var import_getBemClass = __toESM(require("@hugsmidjan/react/utils/getBemClass"));
29
+ const makeRenderSkeleton = (props) => (key) => /* @__PURE__ */ import_react.default.createElement("span", {
30
+ key,
31
+ className: (0, import_getBemClass.default)("Skeleton", [
32
+ props.text && "text",
33
+ props.height && "height--" + props.height,
34
+ props.gap && "gap--" + props.gap
35
+ ])
36
+ });
37
+ const minmax = (num = 0, max = 100, min = 1) => {
38
+ num = Math.min(Math.max(Math.round(num), min), max);
39
+ return num > min ? num : void 0;
40
+ };
41
+ const Skeleton = (props) => {
42
+ const height = minmax(props.height, 40);
43
+ const renderSkeleton = makeRenderSkeleton({
44
+ height,
45
+ text: props.text,
46
+ gap: minmax(props.gap, 5, 0)
47
+ });
48
+ const items = minmax(props.items, 20) || 1;
49
+ if (items > 1) {
50
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (0, import_range.default)(1, items).map(renderSkeleton));
51
+ }
52
+ return renderSkeleton();
53
+ };
54
+ var Skeleton_default = Skeleton;
55
+ Skeleton.block = (height) => /* @__PURE__ */ import_react.default.createElement(Skeleton, {
56
+ height
57
+ });
58
+ Skeleton.text = (height) => /* @__PURE__ */ import_react.default.createElement(Skeleton, {
59
+ text: true,
60
+ height
61
+ });
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {});