@reykjavik/hanna-react 0.10.84 → 0.10.85

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 (437) hide show
  1. package/AccordionList.d.ts +2 -2
  2. package/AccordionList.js +5 -5
  3. package/ActionCards.d.ts +2 -2
  4. package/ActionCards.js +4 -4
  5. package/Alert.d.ts +1 -1
  6. package/Alert.js +6 -6
  7. package/ArticleCards.d.ts +1 -1
  8. package/ArticleCards.js +2 -2
  9. package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
  10. package/ArticleCarousel/_ArticleCarouselCard.js +7 -7
  11. package/ArticleCarousel.d.ts +3 -3
  12. package/ArticleCarousel.js +3 -3
  13. package/ArticleMeta.js +2 -2
  14. package/BasicTable.d.ts +1 -1
  15. package/BasicTable.js +2 -2
  16. package/BgBox.d.ts +1 -1
  17. package/BgBox.js +3 -3
  18. package/Bling.js +2 -2
  19. package/BlockQuote.d.ts +1 -1
  20. package/BlockQuote.js +2 -2
  21. package/BreadCrumbs.js +2 -2
  22. package/ButtonBack.d.ts +1 -1
  23. package/ButtonBack.js +2 -2
  24. package/ButtonPrimary.d.ts +1 -1
  25. package/ButtonPrimary.js +2 -2
  26. package/ButtonSecondary.d.ts +1 -1
  27. package/ButtonSecondary.js +2 -2
  28. package/ButtonTertiary.d.ts +1 -1
  29. package/ButtonTertiary.js +2 -2
  30. package/CHANGELOG.md +7 -0
  31. package/Carousel.d.ts +2 -2
  32. package/Carousel.js +2 -2
  33. package/CenterColumn.d.ts +1 -1
  34. package/CenterColumn.js +2 -2
  35. package/Checkbox.d.ts +1 -1
  36. package/Checkbox.js +2 -2
  37. package/CheckboxButton.d.ts +1 -1
  38. package/CheckboxButton.js +2 -2
  39. package/CheckboxButtonsGroup.d.ts +1 -1
  40. package/CheckboxButtonsGroup.js +3 -3
  41. package/CheckboxGroup.d.ts +1 -1
  42. package/CheckboxGroup.js +3 -3
  43. package/CityBlock.d.ts +4 -4
  44. package/CityBlock.js +4 -4
  45. package/ContactBubble.d.ts +1 -1
  46. package/ContactBubble.js +6 -6
  47. package/ContentArticle.d.ts +4 -4
  48. package/ContentArticle.js +14 -14
  49. package/ContentImage.d.ts +1 -1
  50. package/ContentImage.js +2 -2
  51. package/Datepicker.d.ts +1 -1
  52. package/Datepicker.js +2 -2
  53. package/ExtraLinks.d.ts +2 -2
  54. package/ExtraLinks.js +6 -6
  55. package/FeatureList.d.ts +1 -1
  56. package/FeatureList.js +4 -4
  57. package/FileInput.d.ts +2 -2
  58. package/FileInput.js +4 -4
  59. package/Foonote.d.ts +1 -1
  60. package/Foonote.js +2 -2
  61. package/FooterBadges.js +2 -2
  62. package/Form.d.ts +1 -1
  63. package/FormField.d.ts +1 -1
  64. package/FormField.js +4 -4
  65. package/Gallery/_GalleryItem.d.ts +1 -1
  66. package/Gallery/_GalleryItem.js +7 -7
  67. package/Gallery/_GalleryModal.d.ts +1 -1
  68. package/Gallery/_GalleryModal.js +4 -4
  69. package/Gallery/_GalleryModalContext.d.ts +2 -2
  70. package/Gallery/_GalleryModalItem.d.ts +1 -1
  71. package/Gallery/_GalleryModalItem.js +2 -2
  72. package/Gallery.d.ts +4 -4
  73. package/Gallery.js +7 -7
  74. package/GridBlocks.d.ts +3 -3
  75. package/GridBlocks.js +8 -8
  76. package/Heading.d.ts +1 -1
  77. package/HeroBlock.d.ts +3 -3
  78. package/HeroBlock.js +8 -8
  79. package/Illustration.d.ts +1 -1
  80. package/Illustration.js +2 -2
  81. package/ImageCards.d.ts +2 -2
  82. package/ImageCards.js +4 -4
  83. package/InfoBlock.d.ts +1 -1
  84. package/InfoBlock.js +2 -2
  85. package/InfoHero.d.ts +3 -3
  86. package/InfoHero.js +10 -10
  87. package/IslandBlock.d.ts +4 -4
  88. package/IslandBlock.js +4 -4
  89. package/IslandPageBlock.d.ts +4 -4
  90. package/IslandPageBlock.js +4 -4
  91. package/LabeledTextBlock.d.ts +2 -2
  92. package/LabeledTextBlock.js +4 -4
  93. package/Layout.d.ts +1 -1
  94. package/Layout.js +13 -13
  95. package/MainMenu/_Auxiliary.d.ts +1 -1
  96. package/MainMenu/_Auxiliary.js +2 -2
  97. package/MainMenu/_PrimaryPanel.js +2 -2
  98. package/MainMenu.d.ts +3 -3
  99. package/MainMenu.js +15 -13
  100. package/MiniMetrics.d.ts +2 -2
  101. package/MiniMetrics.js +4 -4
  102. package/NameCard.js +4 -4
  103. package/NameCards.d.ts +1 -1
  104. package/NameCards.js +2 -2
  105. package/NewsHero.d.ts +2 -2
  106. package/NewsHero.js +7 -7
  107. package/PageFilter.d.ts +1 -1
  108. package/PageFilter.js +4 -4
  109. package/PageHeading.d.ts +1 -1
  110. package/PageHeading.js +2 -2
  111. package/Picture.d.ts +1 -1
  112. package/Picture.js +2 -2
  113. package/PullQuote.d.ts +1 -1
  114. package/PullQuote.js +2 -2
  115. package/RadioButtonsGroup.d.ts +1 -1
  116. package/RadioButtonsGroup.js +4 -4
  117. package/RadioGroup.d.ts +2 -2
  118. package/RadioGroup.js +4 -4
  119. package/RelatedLinks.js +2 -2
  120. package/RowBlock.d.ts +1 -1
  121. package/RowBlock.js +2 -2
  122. package/SearchInput.d.ts +1 -1
  123. package/SearchInput.js +2 -2
  124. package/SearchResults/_SearchResultsItem.js +4 -4
  125. package/SearchResults.d.ts +2 -2
  126. package/SearchResults.js +7 -7
  127. package/SeenEffect.d.ts +1 -1
  128. package/SeenEffect.js +3 -3
  129. package/Selectbox.d.ts +2 -2
  130. package/Selectbox.js +2 -2
  131. package/ShareButtons.d.ts +1 -1
  132. package/ShareButtons.js +2 -2
  133. package/SiteSearchAutocomplete.js +2 -2
  134. package/SiteSearchCurtain.js +2 -2
  135. package/SiteSearchInput.d.ts +2 -2
  136. package/SiteSearchInput.js +2 -2
  137. package/SubHeading.d.ts +2 -2
  138. package/SubHeading.js +2 -2
  139. package/Tabs.d.ts +2 -2
  140. package/Tabs.js +4 -4
  141. package/TagPill.d.ts +1 -1
  142. package/TagPill.js +3 -3
  143. package/TextBlock.d.ts +2 -2
  144. package/TextBlock.js +2 -2
  145. package/TextButton.d.ts +1 -1
  146. package/TextButton.js +2 -2
  147. package/TextInput.d.ts +1 -1
  148. package/TextInput.js +2 -2
  149. package/VerticalTabsTOC.d.ts +1 -1
  150. package/VerticalTabsTOC.js +2 -2
  151. package/WizardLayout.d.ts +1 -1
  152. package/WizardLayout.js +8 -8
  153. package/WizardLayoutClose.d.ts +1 -1
  154. package/WizardLayoutClose.js +2 -2
  155. package/_abstract/_AbstractCarousel.d.ts +2 -2
  156. package/_abstract/_AbstractCarousel.js +6 -6
  157. package/_abstract/_Blings.d.ts +1 -1
  158. package/_abstract/_Blings.js +2 -2
  159. package/_abstract/_Block.d.ts +3 -3
  160. package/_abstract/_Block.js +6 -6
  161. package/_abstract/_Button.js +2 -2
  162. package/_abstract/_CardList.d.ts +1 -1
  163. package/_abstract/_CardList.js +4 -4
  164. package/_abstract/_Image.js +2 -2
  165. package/_abstract/_Quote.js +2 -2
  166. package/_abstract/_TogglerGroup.d.ts +2 -2
  167. package/_abstract/_TogglerGroup.js +2 -2
  168. package/_abstract/_TogglerGroupField.d.ts +3 -3
  169. package/_abstract/_TogglerGroupField.js +4 -4
  170. package/assets.d.ts +2 -2
  171. package/esm/AccordionList.d.ts +25 -0
  172. package/esm/AccordionList.js +32 -0
  173. package/esm/ActionCards.d.ts +6 -0
  174. package/esm/ActionCards.js +9 -0
  175. package/esm/Alert.d.ts +48 -0
  176. package/esm/Alert.js +90 -0
  177. package/esm/ArticleCards.d.ts +8 -0
  178. package/esm/ArticleCards.js +4 -0
  179. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +28 -0
  180. package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
  181. package/esm/ArticleCarousel.d.ts +12 -0
  182. package/esm/ArticleCarousel.js +8 -0
  183. package/esm/ArticleMeta.d.ts +10 -0
  184. package/esm/ArticleMeta.js +19 -0
  185. package/esm/Attention.d.ts +7 -0
  186. package/esm/Attention.js +4 -0
  187. package/esm/BasicTable.d.ts +14 -0
  188. package/esm/BasicTable.js +29 -0
  189. package/esm/BgBox.d.ts +8 -0
  190. package/esm/BgBox.js +9 -0
  191. package/esm/Bling.d.ts +81 -0
  192. package/esm/Bling.js +44 -0
  193. package/esm/BlockBreak.d.ts +2 -0
  194. package/esm/BlockBreak.js +6 -0
  195. package/esm/BlockQuote.d.ts +4 -0
  196. package/esm/BlockQuote.js +4 -0
  197. package/esm/BreadCrumbs.d.ts +11 -0
  198. package/esm/BreadCrumbs.js +28 -0
  199. package/esm/ButtonBack.d.ts +7 -0
  200. package/esm/ButtonBack.js +4 -0
  201. package/esm/ButtonBar.d.ts +17 -0
  202. package/esm/ButtonBar.js +15 -0
  203. package/esm/ButtonPrimary.d.ts +7 -0
  204. package/esm/ButtonPrimary.js +4 -0
  205. package/esm/ButtonSecondary.d.ts +7 -0
  206. package/esm/ButtonSecondary.js +4 -0
  207. package/esm/ButtonTertiary.d.ts +12 -0
  208. package/esm/ButtonTertiary.js +15 -0
  209. package/esm/Carousel.d.ts +4 -0
  210. package/esm/Carousel.js +4 -0
  211. package/esm/CarouselStepper.d.ts +4 -0
  212. package/esm/CarouselStepper.js +4 -0
  213. package/esm/CenterColumn.d.ts +7 -0
  214. package/esm/CenterColumn.js +7 -0
  215. package/esm/Checkbox.d.ts +4 -0
  216. package/esm/Checkbox.js +4 -0
  217. package/esm/CheckboxButton.d.ts +4 -0
  218. package/esm/CheckboxButton.js +4 -0
  219. package/esm/CheckboxButtonsGroup.d.ts +12 -0
  220. package/esm/CheckboxButtonsGroup.js +13 -0
  221. package/esm/CheckboxGroup.d.ts +10 -0
  222. package/esm/CheckboxGroup.js +7 -0
  223. package/esm/CityBlock.d.ts +21 -0
  224. package/esm/CityBlock.js +18 -0
  225. package/esm/ContactBubble.d.ts +58 -0
  226. package/esm/ContactBubble.js +152 -0
  227. package/esm/ContentArticle.d.ts +16 -0
  228. package/esm/ContentArticle.js +24 -0
  229. package/esm/ContentImage.d.ts +8 -0
  230. package/esm/ContentImage.js +18 -0
  231. package/esm/Datepicker.d.ts +40 -0
  232. package/esm/Datepicker.js +78 -0
  233. package/esm/ExtraLinks.d.ts +18 -0
  234. package/esm/ExtraLinks.js +24 -0
  235. package/esm/FeatureList.d.ts +12 -0
  236. package/esm/FeatureList.js +16 -0
  237. package/esm/FieldGroup.d.ts +10 -0
  238. package/esm/FieldGroup.js +9 -0
  239. package/esm/FileInput/_FileInput.utils.d.ts +36 -0
  240. package/esm/FileInput/_FileInput.utils.js +69 -0
  241. package/esm/FileInput/_FileInputFileList.d.ts +11 -0
  242. package/esm/FileInput/_FileInputFileList.js +19 -0
  243. package/esm/FileInput.d.ts +48 -0
  244. package/esm/FileInput.js +130 -0
  245. package/esm/Foonote.d.ts +12 -0
  246. package/esm/Foonote.js +7 -0
  247. package/esm/FooterBadges.d.ts +9 -0
  248. package/esm/FooterBadges.js +12 -0
  249. package/esm/FooterInfo.d.ts +20 -0
  250. package/esm/FooterInfo.js +12 -0
  251. package/esm/Footnote.d.ts +6 -0
  252. package/esm/Footnote.js +3 -0
  253. package/esm/Form.d.ts +7 -0
  254. package/esm/Form.js +10 -0
  255. package/esm/FormField.d.ts +65 -0
  256. package/esm/FormField.js +92 -0
  257. package/esm/Gallery/_GalleryItem.d.ts +7 -0
  258. package/esm/Gallery/_GalleryItem.js +19 -0
  259. package/esm/Gallery/_GalleryModal.d.ts +6 -0
  260. package/esm/Gallery/_GalleryModal.js +53 -0
  261. package/esm/Gallery/_GalleryModalContext.d.ts +9 -0
  262. package/esm/Gallery/_GalleryModalContext.js +2 -0
  263. package/esm/Gallery/_GalleryModalItem.d.ts +2 -0
  264. package/esm/Gallery/_GalleryModalItem.js +11 -0
  265. package/esm/Gallery.d.ts +17 -0
  266. package/esm/Gallery.js +27 -0
  267. package/esm/GridBlocks.d.ts +26 -0
  268. package/esm/GridBlocks.js +24 -0
  269. package/esm/Heading.d.ts +22 -0
  270. package/esm/Heading.js +19 -0
  271. package/esm/HeroBlock.d.ts +19 -0
  272. package/esm/HeroBlock.js +21 -0
  273. package/esm/IframeBlock.d.ts +28 -0
  274. package/esm/IframeBlock.js +26 -0
  275. package/esm/Illustration.d.ts +10 -0
  276. package/esm/Illustration.js +8 -0
  277. package/esm/ImageCards.d.ts +10 -0
  278. package/esm/ImageCards.js +12 -0
  279. package/esm/InfoBlock.d.ts +13 -0
  280. package/esm/InfoBlock.js +13 -0
  281. package/esm/InfoHero.d.ts +18 -0
  282. package/esm/InfoHero.js +83 -0
  283. package/esm/IslandBlock.d.ts +25 -0
  284. package/esm/IslandBlock.js +16 -0
  285. package/esm/IslandPageBlock.d.ts +24 -0
  286. package/esm/IslandPageBlock.js +16 -0
  287. package/esm/LabeledTextBlock.d.ts +11 -0
  288. package/esm/LabeledTextBlock.js +14 -0
  289. package/esm/Layout.d.ts +32 -0
  290. package/esm/Layout.js +56 -0
  291. package/esm/MainMenu/_Auxiliary.d.ts +6 -0
  292. package/esm/MainMenu/_Auxiliary.js +13 -0
  293. package/esm/MainMenu/_PrimaryPanel.d.ts +29 -0
  294. package/esm/MainMenu/_PrimaryPanel.js +22 -0
  295. package/esm/MainMenu.d.ts +62 -0
  296. package/esm/MainMenu.js +221 -0
  297. package/esm/MiniMetrics.d.ts +8 -0
  298. package/esm/MiniMetrics.js +12 -0
  299. package/esm/Modal.d.ts +8 -0
  300. package/esm/Modal.js +14 -0
  301. package/esm/NameCard.d.ts +64 -0
  302. package/esm/NameCard.js +82 -0
  303. package/esm/NameCards.d.ts +6 -0
  304. package/esm/NameCards.js +7 -0
  305. package/esm/NewsHero.d.ts +14 -0
  306. package/esm/NewsHero.js +86 -0
  307. package/esm/PageFilter.d.ts +16 -0
  308. package/esm/PageFilter.js +15 -0
  309. package/esm/PageHeading.d.ts +10 -0
  310. package/esm/PageHeading.js +12 -0
  311. package/esm/Picture.d.ts +7 -0
  312. package/esm/Picture.js +8 -0
  313. package/esm/ProcessOverview.d.ts +13 -0
  314. package/esm/ProcessOverview.js +17 -0
  315. package/esm/PullQuote.d.ts +4 -0
  316. package/esm/PullQuote.js +4 -0
  317. package/esm/RadioButtonsGroup.d.ts +12 -0
  318. package/esm/RadioButtonsGroup.js +14 -0
  319. package/esm/RadioGroup.d.ts +16 -0
  320. package/esm/RadioGroup.js +8 -0
  321. package/esm/RelatedLinks.d.ts +20 -0
  322. package/esm/RelatedLinks.js +26 -0
  323. package/esm/RowBlock.d.ts +12 -0
  324. package/esm/RowBlock.js +9 -0
  325. package/esm/RowBlockColumn.d.ts +8 -0
  326. package/esm/RowBlockColumn.js +11 -0
  327. package/esm/SearchInput.d.ts +18 -0
  328. package/esm/SearchInput.js +23 -0
  329. package/esm/SearchResults/_SearchResultsItem.d.ts +18 -0
  330. package/esm/SearchResults/_SearchResultsItem.js +14 -0
  331. package/esm/SearchResults.d.ts +37 -0
  332. package/esm/SearchResults.js +108 -0
  333. package/esm/SeenEffect.d.ts +4 -0
  334. package/esm/SeenEffect.js +9 -0
  335. package/esm/Selectbox.d.ts +11 -0
  336. package/esm/Selectbox.js +40 -0
  337. package/esm/ShareButtons.d.ts +9 -0
  338. package/esm/ShareButtons.js +56 -0
  339. package/esm/Sharpie.d.ts +23 -0
  340. package/esm/Sharpie.js +22 -0
  341. package/esm/SiteSearchAutocomplete.d.ts +40 -0
  342. package/esm/SiteSearchAutocomplete.js +48 -0
  343. package/esm/SiteSearchCurtain.d.ts +6 -0
  344. package/esm/SiteSearchCurtain.js +28 -0
  345. package/esm/SiteSearchInput.d.ts +24 -0
  346. package/esm/SiteSearchInput.js +30 -0
  347. package/esm/Skeleton.d.ts +25 -0
  348. package/esm/Skeleton.js +30 -0
  349. package/esm/SubHeading.d.ts +10 -0
  350. package/esm/SubHeading.js +13 -0
  351. package/esm/Tabs.d.ts +35 -0
  352. package/esm/Tabs.js +94 -0
  353. package/esm/TagPill.d.ts +25 -0
  354. package/esm/TagPill.js +34 -0
  355. package/esm/TextBlock.d.ts +15 -0
  356. package/esm/TextBlock.js +15 -0
  357. package/esm/TextButton.d.ts +9 -0
  358. package/esm/TextButton.js +9 -0
  359. package/esm/TextInput.d.ts +16 -0
  360. package/esm/TextInput.js +32 -0
  361. package/esm/Tooltip.d.ts +7 -0
  362. package/esm/Tooltip.js +58 -0
  363. package/esm/VSpacer.d.ts +22 -0
  364. package/esm/VSpacer.js +41 -0
  365. package/esm/VerticalTabsTOC.d.ts +14 -0
  366. package/esm/VerticalTabsTOC.js +68 -0
  367. package/esm/WizardLayout.d.ts +15 -0
  368. package/esm/WizardLayout.js +30 -0
  369. package/esm/WizardLayoutClose.d.ts +3 -0
  370. package/esm/WizardLayoutClose.js +4 -0
  371. package/esm/WizardStepper.d.ts +36 -0
  372. package/esm/WizardStepper.js +26 -0
  373. package/esm/_abstract/_AbstractCarousel.d.ts +29 -0
  374. package/esm/_abstract/_AbstractCarousel.js +108 -0
  375. package/esm/_abstract/_Blings.d.ts +11 -0
  376. package/esm/_abstract/_Blings.js +11 -0
  377. package/esm/_abstract/_Block.d.ts +21 -0
  378. package/esm/_abstract/_Block.js +23 -0
  379. package/esm/_abstract/_Button.d.ts +40 -0
  380. package/esm/_abstract/_Button.js +36 -0
  381. package/esm/_abstract/_CardList.d.ts +34 -0
  382. package/esm/_abstract/_CardList.js +37 -0
  383. package/esm/_abstract/_Image.d.ts +36 -0
  384. package/esm/_abstract/_Image.js +26 -0
  385. package/esm/_abstract/_Link.d.ts +60 -0
  386. package/esm/_abstract/_Link.js +64 -0
  387. package/esm/_abstract/_Quote.d.ts +11 -0
  388. package/esm/_abstract/_Quote.js +8 -0
  389. package/esm/_abstract/_TogglerGroup.d.ts +32 -0
  390. package/esm/_abstract/_TogglerGroup.js +28 -0
  391. package/esm/_abstract/_TogglerGroupField.d.ts +19 -0
  392. package/esm/_abstract/_TogglerGroupField.js +17 -0
  393. package/esm/_abstract/_TogglerInput.d.ts +23 -0
  394. package/esm/_abstract/_TogglerInput.js +23 -0
  395. package/esm/_abstract/breakOnNL.d.ts +1 -0
  396. package/esm/_abstract/breakOnNL.js +7 -0
  397. package/esm/assets.d.ts +42 -0
  398. package/esm/assets.js +58 -0
  399. package/esm/constants.d.ts +19 -0
  400. package/esm/constants.js +22 -0
  401. package/esm/focus-visible.d.ts +1 -0
  402. package/esm/focus-visible.js +3 -0
  403. package/esm/index.d.ts +97 -0
  404. package/esm/index.js +1 -0
  405. package/esm/package.json +1 -0
  406. package/esm/utils/HannaUIState.d.ts +8 -0
  407. package/esm/utils/HannaUIState.js +7 -0
  408. package/esm/utils/browserSide.d.ts +1 -0
  409. package/esm/utils/browserSide.js +1 -0
  410. package/esm/utils/config.d.ts +4 -0
  411. package/esm/utils/config.js +2 -0
  412. package/esm/utils/env.d.ts +1 -0
  413. package/esm/utils/env.js +8 -0
  414. package/esm/utils/seenEffect.d.ts +27 -0
  415. package/esm/utils/seenEffect.js +75 -0
  416. package/esm/utils/useDidChange.d.ts +37 -0
  417. package/esm/utils/useDidChange.js +43 -0
  418. package/esm/utils/useFormatMonitor.d.ts +38 -0
  419. package/esm/utils/useFormatMonitor.js +41 -0
  420. package/esm/utils/useGetSVGtext.d.ts +10 -0
  421. package/esm/utils/useGetSVGtext.js +23 -0
  422. package/esm/utils/useMenuToggling.d.ts +8 -0
  423. package/esm/utils/useMenuToggling.js +62 -0
  424. package/esm/utils/useMixedControlState.d.ts +137 -0
  425. package/esm/utils/useMixedControlState.js +101 -0
  426. package/esm/utils/useScrollbarWidthCSSVar.d.ts +17 -0
  427. package/esm/utils/useScrollbarWidthCSSVar.js +19 -0
  428. package/esm/utils.d.ts +8 -0
  429. package/esm/utils.js +8 -0
  430. package/package.json +389 -3
  431. package/utils/config.d.ts +2 -2
  432. package/utils/config.js +2 -2
  433. package/utils/useDidChange.d.ts +1 -1
  434. package/utils/useDidChange.js +1 -1
  435. package/utils/useMenuToggling.js +2 -2
  436. package/utils.d.ts +8 -8
  437. package/utils.js +8 -8
@@ -0,0 +1,101 @@
1
+ import { useCallback, useRef, useState } from 'react';
2
+ import { capitalize } from '@reykjavik/hanna-utils';
3
+ // ---------------------------------------------------------------------------
4
+ export function useMixedControlState(props, name, emptyValue) {
5
+ const value = props[name];
6
+ const defaultValue = props[`default${capitalize(name)}`];
7
+ return useMixedControlState.raw(value, defaultValue, name, emptyValue);
8
+ }
9
+ // ===========================================================================
10
+ //
11
+ //
12
+ // ===========================================================================
13
+ const defaultWarningLogger = (message) => console.error(message);
14
+ useMixedControlState.$warningLogger = defaultWarningLogger;
15
+ /** Validate sane use of the component, during development. */
16
+ const validateSaneUse = ({ warningPropName, value, defaultValue, lastMode, }) => {
17
+ const warn = useMixedControlState.$warningLogger || defaultWarningLogger;
18
+ if (value !== undefined && defaultValue !== undefined) {
19
+ warn(`WARNING:` +
20
+ ` Don't mix` +
21
+ (warningPropName
22
+ ? ` \`${warningPropName}\` and \`default${capitalize(warningPropName)}\` props`
23
+ : 'controlled and uncontrolled mode') +
24
+ `\n` +
25
+ `Use one or the other.`);
26
+ return;
27
+ }
28
+ const C_to_U = lastMode === 'controlled' && defaultValue !== undefined;
29
+ const U_to_C = lastMode === 'uncontrolled' && value !== undefined;
30
+ if (C_to_U || U_to_C) {
31
+ warn(`WARNING:` +
32
+ (C_to_U
33
+ ? `A component seems to be attempting to change ` +
34
+ `from controlled to uncontrolled mode. ` +
35
+ `This is not possible.`
36
+ : `A component is changing ` + `from uncontrolled to controlled mode.`) +
37
+ `\n` +
38
+ `Decide between using ` +
39
+ (warningPropName
40
+ ? `\`${warningPropName}\` (controlled) prop` +
41
+ ` OR \`default${capitalize(warningPropName)}\` (uncontrolled)`
42
+ : `either controlled OR uncontrolled mode`) +
43
+ ` for the lifetime of the component.`);
44
+ }
45
+ };
46
+ // ---------------------------------------------------------------------------
47
+ function useRaw(value, defaultValue, warningPropName, emptyValue) {
48
+ const metaRef = useRef({
49
+ lastMode: undefined,
50
+ lastDefault: defaultValue,
51
+ // lastValue: value,
52
+ _emptyValue: emptyValue,
53
+ });
54
+ const meta = metaRef.current;
55
+ const { lastMode, lastDefault, _emptyValue /*, lastValue */ } = meta;
56
+ if (process.env.NODE_ENV !== 'production') {
57
+ validateSaneUse({ warningPropName, value, defaultValue, lastMode });
58
+ }
59
+ const mode = lastMode === 'controlled'
60
+ ? 'controlled'
61
+ : value !== undefined
62
+ ? 'controlled'
63
+ : defaultValue !== undefined
64
+ ? 'uncontrolled'
65
+ : lastMode;
66
+ const [localValue, _setLocalValue] = useState(defaultValue !== undefined ? defaultValue : _emptyValue);
67
+ const setLocalValue = useCallback((newState) => {
68
+ if (mode === 'controlled' && typeof newState === 'function') {
69
+ newState = newState(value !== undefined ? value : _emptyValue);
70
+ }
71
+ metaRef.current.lastMode = mode || 'uncontrolled';
72
+ const setterFn = typeof newState === 'function' ? newState : () => newState;
73
+ _setLocalValue((prevState) => {
74
+ let newState = setterFn(prevState);
75
+ newState = newState !== undefined ? newState : _emptyValue;
76
+ if (prevState !== newState) {
77
+ _setLocalValue.$isCalled = true;
78
+ }
79
+ return newState;
80
+ });
81
+ }, [value, mode, _emptyValue]);
82
+ // The mode can change but it should never go back to `undefined` state
83
+ // this is similar to what React does with <input/> and <select/> elements.
84
+ // In dev-mode an WARNING gets logged whenever the mode changes.
85
+ meta.lastMode = mode;
86
+ if (mode === 'uncontrolled') {
87
+ // only update lastDefault when in unconrolled mode
88
+ // to guarantee capture of changes that might happen during
89
+ // controlled mode. Something that should ideally not happen
90
+ // but is worth keeping as sane as possible nonetheless.
91
+ meta.lastDefault = defaultValue;
92
+ if (!_setLocalValue.$isCalled && defaultValue !== lastDefault) {
93
+ // Immediately exits and re-renders the component
94
+ _setLocalValue(defaultValue !== undefined ? defaultValue : _emptyValue);
95
+ }
96
+ }
97
+ // meta.lastValue = value;
98
+ const retValue = mode === 'controlled' ? value : localValue;
99
+ return [retValue, setLocalValue, mode];
100
+ }
101
+ useMixedControlState.raw = useRaw;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Measures the scrollbar width and sets it as a CSS variable on
3
+ * the `<html/>` element.
4
+ *
5
+ * Use this hook inside all of your top-level layout components
6
+ *
7
+ * The name of the variable is `--browser-scrollbar-width`, and you can
8
+ * reference it manually in your CSS, or via the hanna-css variable helper.
9
+ *
10
+ * ```ts
11
+ * import { hannaVars } from '@reykjavik/hanna-css';
12
+ *
13
+ * console.log(hannaVars.browser_scrollbar_width.toString())
14
+ * // "var(--browser-scrollbar-width)"
15
+ * ```
16
+ */
17
+ export declare const useScrollbarWidthCSSVar: () => void;
@@ -0,0 +1,19 @@
1
+ import { useEffect } from 'react';
2
+ import getScrollbarWidth from '@hugsmidjan/qj/getScrollbarWidth';
3
+ /**
4
+ * Measures the scrollbar width and sets it as a CSS variable on
5
+ * the `<html/>` element.
6
+ *
7
+ * Use this hook inside all of your top-level layout components
8
+ *
9
+ * The name of the variable is `--browser-scrollbar-width`, and you can
10
+ * reference it manually in your CSS, or via the hanna-css variable helper.
11
+ *
12
+ * ```ts
13
+ * import { hannaVars } from '@reykjavik/hanna-css';
14
+ *
15
+ * console.log(hannaVars.browser_scrollbar_width.toString())
16
+ * // "var(--browser-scrollbar-width)"
17
+ * ```
18
+ */
19
+ export const useScrollbarWidthCSSVar = () => useEffect(() => getScrollbarWidth.setCSSvar(), []);
package/esm/utils.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './utils/browserSide.js';
2
+ export * from './utils/config.js';
3
+ export * from './utils/HannaUIState.js';
4
+ export * from './utils/useDidChange.js';
5
+ export * from './utils/useFormatMonitor.js';
6
+ export * from './utils/useGetSVGtext.js';
7
+ export * from './utils/useMixedControlState.js';
8
+ export * from './utils/useScrollbarWidthCSSVar.js';
package/esm/utils.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './utils/browserSide.js';
2
+ export * from './utils/config.js';
3
+ export * from './utils/HannaUIState.js';
4
+ export * from './utils/useDidChange.js';
5
+ export * from './utils/useFormatMonitor.js';
6
+ export * from './utils/useGetSVGtext.js';
7
+ export * from './utils/useMixedControlState.js';
8
+ export * from './utils/useScrollbarWidthCSSVar.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.84",
3
+ "version": "0.10.85",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",
@@ -16,7 +16,7 @@
16
16
  "@floating-ui/react": "^0.19.2",
17
17
  "@hugsmidjan/qj": "^4.10.2",
18
18
  "@hugsmidjan/react": "^0.4.24",
19
- "@reykjavik/hanna-css": "^0.3.15",
19
+ "@reykjavik/hanna-css": "^0.3.17",
20
20
  "@reykjavik/hanna-utils": "^0.2.3",
21
21
  "@types/react": "^17.0.24",
22
22
  "@types/react-autosuggest": "^10.1.0",
@@ -39,5 +39,391 @@
39
39
  },
40
40
  "sideEffects": [
41
41
  "**/focus-visible.js"
42
- ]
42
+ ],
43
+ "exports": {
44
+ "./AccordionList": {
45
+ "import": "./esm/AccordionList.js",
46
+ "require": "./AccordionList.js"
47
+ },
48
+ "./ActionCards": {
49
+ "import": "./esm/ActionCards.js",
50
+ "require": "./ActionCards.js"
51
+ },
52
+ "./Alert": {
53
+ "import": "./esm/Alert.js",
54
+ "require": "./Alert.js"
55
+ },
56
+ "./ArticleCards": {
57
+ "import": "./esm/ArticleCards.js",
58
+ "require": "./ArticleCards.js"
59
+ },
60
+ "./ArticleCarousel": {
61
+ "import": "./esm/ArticleCarousel.js",
62
+ "require": "./ArticleCarousel.js"
63
+ },
64
+ "./ArticleMeta": {
65
+ "import": "./esm/ArticleMeta.js",
66
+ "require": "./ArticleMeta.js"
67
+ },
68
+ "./assets": {
69
+ "import": "./esm/assets.js",
70
+ "require": "./assets.js"
71
+ },
72
+ "./Attention": {
73
+ "import": "./esm/Attention.js",
74
+ "require": "./Attention.js"
75
+ },
76
+ "./BasicTable": {
77
+ "import": "./esm/BasicTable.js",
78
+ "require": "./BasicTable.js"
79
+ },
80
+ "./BgBox": {
81
+ "import": "./esm/BgBox.js",
82
+ "require": "./BgBox.js"
83
+ },
84
+ "./Bling": {
85
+ "import": "./esm/Bling.js",
86
+ "require": "./Bling.js"
87
+ },
88
+ "./BlockBreak": {
89
+ "import": "./esm/BlockBreak.js",
90
+ "require": "./BlockBreak.js"
91
+ },
92
+ "./BlockQuote": {
93
+ "import": "./esm/BlockQuote.js",
94
+ "require": "./BlockQuote.js"
95
+ },
96
+ "./BreadCrumbs": {
97
+ "import": "./esm/BreadCrumbs.js",
98
+ "require": "./BreadCrumbs.js"
99
+ },
100
+ "./ButtonBack": {
101
+ "import": "./esm/ButtonBack.js",
102
+ "require": "./ButtonBack.js"
103
+ },
104
+ "./ButtonBar": {
105
+ "import": "./esm/ButtonBar.js",
106
+ "require": "./ButtonBar.js"
107
+ },
108
+ "./ButtonPrimary": {
109
+ "import": "./esm/ButtonPrimary.js",
110
+ "require": "./ButtonPrimary.js"
111
+ },
112
+ "./ButtonSecondary": {
113
+ "import": "./esm/ButtonSecondary.js",
114
+ "require": "./ButtonSecondary.js"
115
+ },
116
+ "./ButtonTertiary": {
117
+ "import": "./esm/ButtonTertiary.js",
118
+ "require": "./ButtonTertiary.js"
119
+ },
120
+ "./Carousel": {
121
+ "import": "./esm/Carousel.js",
122
+ "require": "./Carousel.js"
123
+ },
124
+ "./CarouselStepper": {
125
+ "import": "./esm/CarouselStepper.js",
126
+ "require": "./CarouselStepper.js"
127
+ },
128
+ "./CenterColumn": {
129
+ "import": "./esm/CenterColumn.js",
130
+ "require": "./CenterColumn.js"
131
+ },
132
+ "./Checkbox": {
133
+ "import": "./esm/Checkbox.js",
134
+ "require": "./Checkbox.js"
135
+ },
136
+ "./CheckboxButton": {
137
+ "import": "./esm/CheckboxButton.js",
138
+ "require": "./CheckboxButton.js"
139
+ },
140
+ "./CheckboxButtonsGroup": {
141
+ "import": "./esm/CheckboxButtonsGroup.js",
142
+ "require": "./CheckboxButtonsGroup.js"
143
+ },
144
+ "./CheckboxGroup": {
145
+ "import": "./esm/CheckboxGroup.js",
146
+ "require": "./CheckboxGroup.js"
147
+ },
148
+ "./CityBlock": {
149
+ "import": "./esm/CityBlock.js",
150
+ "require": "./CityBlock.js"
151
+ },
152
+ "./constants": {
153
+ "import": "./esm/constants.js",
154
+ "require": "./constants.js"
155
+ },
156
+ "./ContactBubble": {
157
+ "import": "./esm/ContactBubble.js",
158
+ "require": "./ContactBubble.js"
159
+ },
160
+ "./ContentArticle": {
161
+ "import": "./esm/ContentArticle.js",
162
+ "require": "./ContentArticle.js"
163
+ },
164
+ "./ContentImage": {
165
+ "import": "./esm/ContentImage.js",
166
+ "require": "./ContentImage.js"
167
+ },
168
+ "./Datepicker": {
169
+ "import": "./esm/Datepicker.js",
170
+ "require": "./Datepicker.js"
171
+ },
172
+ "./ExtraLinks": {
173
+ "import": "./esm/ExtraLinks.js",
174
+ "require": "./ExtraLinks.js"
175
+ },
176
+ "./FeatureList": {
177
+ "import": "./esm/FeatureList.js",
178
+ "require": "./FeatureList.js"
179
+ },
180
+ "./FieldGroup": {
181
+ "import": "./esm/FieldGroup.js",
182
+ "require": "./FieldGroup.js"
183
+ },
184
+ "./FileInput": {
185
+ "import": "./esm/FileInput.js",
186
+ "require": "./FileInput.js"
187
+ },
188
+ "./focus-visible": {
189
+ "import": "./esm/focus-visible.js",
190
+ "require": "./focus-visible.js"
191
+ },
192
+ "./Foonote": {
193
+ "import": "./esm/Foonote.js",
194
+ "require": "./Foonote.js"
195
+ },
196
+ "./FooterBadges": {
197
+ "import": "./esm/FooterBadges.js",
198
+ "require": "./FooterBadges.js"
199
+ },
200
+ "./FooterInfo": {
201
+ "import": "./esm/FooterInfo.js",
202
+ "require": "./FooterInfo.js"
203
+ },
204
+ "./Footnote": {
205
+ "import": "./esm/Footnote.js",
206
+ "require": "./Footnote.js"
207
+ },
208
+ "./Form": {
209
+ "import": "./esm/Form.js",
210
+ "require": "./Form.js"
211
+ },
212
+ "./FormField": {
213
+ "import": "./esm/FormField.js",
214
+ "require": "./FormField.js"
215
+ },
216
+ "./Gallery": {
217
+ "import": "./esm/Gallery.js",
218
+ "require": "./Gallery.js"
219
+ },
220
+ "./GridBlocks": {
221
+ "import": "./esm/GridBlocks.js",
222
+ "require": "./GridBlocks.js"
223
+ },
224
+ "./Heading": {
225
+ "import": "./esm/Heading.js",
226
+ "require": "./Heading.js"
227
+ },
228
+ "./HeroBlock": {
229
+ "import": "./esm/HeroBlock.js",
230
+ "require": "./HeroBlock.js"
231
+ },
232
+ "./IframeBlock": {
233
+ "import": "./esm/IframeBlock.js",
234
+ "require": "./IframeBlock.js"
235
+ },
236
+ "./Illustration": {
237
+ "import": "./esm/Illustration.js",
238
+ "require": "./Illustration.js"
239
+ },
240
+ "./ImageCards": {
241
+ "import": "./esm/ImageCards.js",
242
+ "require": "./ImageCards.js"
243
+ },
244
+ ".": {
245
+ "import": "./esm/index.js",
246
+ "require": "./index.js"
247
+ },
248
+ "./InfoBlock": {
249
+ "import": "./esm/InfoBlock.js",
250
+ "require": "./InfoBlock.js"
251
+ },
252
+ "./InfoHero": {
253
+ "import": "./esm/InfoHero.js",
254
+ "require": "./InfoHero.js"
255
+ },
256
+ "./IslandBlock": {
257
+ "import": "./esm/IslandBlock.js",
258
+ "require": "./IslandBlock.js"
259
+ },
260
+ "./IslandPageBlock": {
261
+ "import": "./esm/IslandPageBlock.js",
262
+ "require": "./IslandPageBlock.js"
263
+ },
264
+ "./LabeledTextBlock": {
265
+ "import": "./esm/LabeledTextBlock.js",
266
+ "require": "./LabeledTextBlock.js"
267
+ },
268
+ "./Layout": {
269
+ "import": "./esm/Layout.js",
270
+ "require": "./Layout.js"
271
+ },
272
+ "./MainMenu": {
273
+ "import": "./esm/MainMenu.js",
274
+ "require": "./MainMenu.js"
275
+ },
276
+ "./MiniMetrics": {
277
+ "import": "./esm/MiniMetrics.js",
278
+ "require": "./MiniMetrics.js"
279
+ },
280
+ "./Modal": {
281
+ "import": "./esm/Modal.js",
282
+ "require": "./Modal.js"
283
+ },
284
+ "./NameCard": {
285
+ "import": "./esm/NameCard.js",
286
+ "require": "./NameCard.js"
287
+ },
288
+ "./NameCards": {
289
+ "import": "./esm/NameCards.js",
290
+ "require": "./NameCards.js"
291
+ },
292
+ "./NewsHero": {
293
+ "import": "./esm/NewsHero.js",
294
+ "require": "./NewsHero.js"
295
+ },
296
+ "./PageFilter": {
297
+ "import": "./esm/PageFilter.js",
298
+ "require": "./PageFilter.js"
299
+ },
300
+ "./PageHeading": {
301
+ "import": "./esm/PageHeading.js",
302
+ "require": "./PageHeading.js"
303
+ },
304
+ "./Picture": {
305
+ "import": "./esm/Picture.js",
306
+ "require": "./Picture.js"
307
+ },
308
+ "./ProcessOverview": {
309
+ "import": "./esm/ProcessOverview.js",
310
+ "require": "./ProcessOverview.js"
311
+ },
312
+ "./PullQuote": {
313
+ "import": "./esm/PullQuote.js",
314
+ "require": "./PullQuote.js"
315
+ },
316
+ "./RadioButtonsGroup": {
317
+ "import": "./esm/RadioButtonsGroup.js",
318
+ "require": "./RadioButtonsGroup.js"
319
+ },
320
+ "./RadioGroup": {
321
+ "import": "./esm/RadioGroup.js",
322
+ "require": "./RadioGroup.js"
323
+ },
324
+ "./RelatedLinks": {
325
+ "import": "./esm/RelatedLinks.js",
326
+ "require": "./RelatedLinks.js"
327
+ },
328
+ "./RowBlock": {
329
+ "import": "./esm/RowBlock.js",
330
+ "require": "./RowBlock.js"
331
+ },
332
+ "./RowBlockColumn": {
333
+ "import": "./esm/RowBlockColumn.js",
334
+ "require": "./RowBlockColumn.js"
335
+ },
336
+ "./SearchInput": {
337
+ "import": "./esm/SearchInput.js",
338
+ "require": "./SearchInput.js"
339
+ },
340
+ "./SearchResults": {
341
+ "import": "./esm/SearchResults.js",
342
+ "require": "./SearchResults.js"
343
+ },
344
+ "./SeenEffect": {
345
+ "import": "./esm/SeenEffect.js",
346
+ "require": "./SeenEffect.js"
347
+ },
348
+ "./Selectbox": {
349
+ "import": "./esm/Selectbox.js",
350
+ "require": "./Selectbox.js"
351
+ },
352
+ "./ShareButtons": {
353
+ "import": "./esm/ShareButtons.js",
354
+ "require": "./ShareButtons.js"
355
+ },
356
+ "./Sharpie": {
357
+ "import": "./esm/Sharpie.js",
358
+ "require": "./Sharpie.js"
359
+ },
360
+ "./SiteSearchAutocomplete": {
361
+ "import": "./esm/SiteSearchAutocomplete.js",
362
+ "require": "./SiteSearchAutocomplete.js"
363
+ },
364
+ "./SiteSearchCurtain": {
365
+ "import": "./esm/SiteSearchCurtain.js",
366
+ "require": "./SiteSearchCurtain.js"
367
+ },
368
+ "./SiteSearchInput": {
369
+ "import": "./esm/SiteSearchInput.js",
370
+ "require": "./SiteSearchInput.js"
371
+ },
372
+ "./Skeleton": {
373
+ "import": "./esm/Skeleton.js",
374
+ "require": "./Skeleton.js"
375
+ },
376
+ "./SubHeading": {
377
+ "import": "./esm/SubHeading.js",
378
+ "require": "./SubHeading.js"
379
+ },
380
+ "./Tabs": {
381
+ "import": "./esm/Tabs.js",
382
+ "require": "./Tabs.js"
383
+ },
384
+ "./TagPill": {
385
+ "import": "./esm/TagPill.js",
386
+ "require": "./TagPill.js"
387
+ },
388
+ "./TextBlock": {
389
+ "import": "./esm/TextBlock.js",
390
+ "require": "./TextBlock.js"
391
+ },
392
+ "./TextButton": {
393
+ "import": "./esm/TextButton.js",
394
+ "require": "./TextButton.js"
395
+ },
396
+ "./TextInput": {
397
+ "import": "./esm/TextInput.js",
398
+ "require": "./TextInput.js"
399
+ },
400
+ "./Tooltip": {
401
+ "import": "./esm/Tooltip.js",
402
+ "require": "./Tooltip.js"
403
+ },
404
+ "./utils": {
405
+ "import": "./esm/utils.js",
406
+ "require": "./utils.js"
407
+ },
408
+ "./VerticalTabsTOC": {
409
+ "import": "./esm/VerticalTabsTOC.js",
410
+ "require": "./VerticalTabsTOC.js"
411
+ },
412
+ "./VSpacer": {
413
+ "import": "./esm/VSpacer.js",
414
+ "require": "./VSpacer.js"
415
+ },
416
+ "./WizardLayout": {
417
+ "import": "./esm/WizardLayout.js",
418
+ "require": "./WizardLayout.js"
419
+ },
420
+ "./WizardLayoutClose": {
421
+ "import": "./esm/WizardLayoutClose.js",
422
+ "require": "./WizardLayoutClose.js"
423
+ },
424
+ "./WizardStepper": {
425
+ "import": "./esm/WizardStepper.js",
426
+ "require": "./WizardStepper.js"
427
+ }
428
+ }
43
429
  }
package/utils/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { LinkRenderer } from '../_abstract/_Link';
2
- export { setLinkRenderer } from '../_abstract/_Link';
1
+ export type { LinkRenderer } from '../_abstract/_Link.js';
2
+ export { setLinkRenderer } from '../_abstract/_Link.js';
3
3
  export type { SSRSupport } from '@hugsmidjan/react/hooks';
4
4
  export { setDefaultSSR } from '@hugsmidjan/react/hooks';
package/utils/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setDefaultSSR = exports.setLinkRenderer = void 0;
4
- var _Link_1 = require("../_abstract/_Link");
5
- Object.defineProperty(exports, "setLinkRenderer", { enumerable: true, get: function () { return _Link_1.setLinkRenderer; } });
4
+ var _Link_js_1 = require("../_abstract/_Link.js");
5
+ Object.defineProperty(exports, "setLinkRenderer", { enumerable: true, get: function () { return _Link_js_1.setLinkRenderer; } });
6
6
  var hooks_1 = require("@hugsmidjan/react/hooks");
7
7
  Object.defineProperty(exports, "setDefaultSSR", { enumerable: true, get: function () { return hooks_1.setDefaultSSR; } });
@@ -8,7 +8,7 @@
8
8
  * but resets/changes its internal state whenever a certain prop value changes.
9
9
  *
10
10
  * ```tsx
11
- * import { useDidChange } from './utils';
11
+ * import { useDidChange } from './utils.js';
12
12
  * // import { useDidChange } from '@reykjavik/hanna-react/utils';
13
13
  *
14
14
  * // inside your component/hook
@@ -12,7 +12,7 @@ const react_1 = require("react");
12
12
  * but resets/changes its internal state whenever a certain prop value changes.
13
13
  *
14
14
  * ```tsx
15
- * import { useDidChange } from './utils';
15
+ * import { useDidChange } from './utils.js';
16
16
  * // import { useDidChange } from '@reykjavik/hanna-react/utils';
17
17
  *
18
18
  * // inside your component/hook
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMenuToggling = void 0;
4
4
  const react_1 = require("react");
5
5
  const hanna_utils_1 = require("@reykjavik/hanna-utils");
6
- const useFormatMonitor_1 = require("./useFormatMonitor");
6
+ const useFormatMonitor_js_1 = require("./useFormatMonitor.js");
7
7
  const htmlClass = (className, add) => {
8
8
  document.documentElement.classList[add ? 'add' : 'remove'](className);
9
9
  };
@@ -31,7 +31,7 @@ const useMenuToggling = (doInitialize = true) => {
31
31
  (0, hanna_utils_1.focusElement)('.Layout__header__skiplink');
32
32
  }
33
33
  };
34
- (0, useFormatMonitor_1.useFormatMonitor)(doInitialize
34
+ (0, useFormatMonitor_js_1.useFormatMonitor)(doInitialize
35
35
  ? (media) => {
36
36
  if (media.becameHamburger) {
37
37
  setIsMenuActive(true);
package/utils.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from './utils/browserSide';
2
- export * from './utils/config';
3
- export * from './utils/HannaUIState';
4
- export * from './utils/useDidChange';
5
- export * from './utils/useFormatMonitor';
6
- export * from './utils/useGetSVGtext';
7
- export * from './utils/useMixedControlState';
8
- export * from './utils/useScrollbarWidthCSSVar';
1
+ export * from './utils/browserSide.js';
2
+ export * from './utils/config.js';
3
+ export * from './utils/HannaUIState.js';
4
+ export * from './utils/useDidChange.js';
5
+ export * from './utils/useFormatMonitor.js';
6
+ export * from './utils/useGetSVGtext.js';
7
+ export * from './utils/useMixedControlState.js';
8
+ export * from './utils/useScrollbarWidthCSSVar.js';
package/utils.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./utils/browserSide"), exports);
5
- tslib_1.__exportStar(require("./utils/config"), exports);
6
- tslib_1.__exportStar(require("./utils/HannaUIState"), exports);
7
- tslib_1.__exportStar(require("./utils/useDidChange"), exports);
8
- tslib_1.__exportStar(require("./utils/useFormatMonitor"), exports);
9
- tslib_1.__exportStar(require("./utils/useGetSVGtext"), exports);
10
- tslib_1.__exportStar(require("./utils/useMixedControlState"), exports);
11
- tslib_1.__exportStar(require("./utils/useScrollbarWidthCSSVar"), exports);
4
+ tslib_1.__exportStar(require("./utils/browserSide.js"), exports);
5
+ tslib_1.__exportStar(require("./utils/config.js"), exports);
6
+ tslib_1.__exportStar(require("./utils/HannaUIState.js"), exports);
7
+ tslib_1.__exportStar(require("./utils/useDidChange.js"), exports);
8
+ tslib_1.__exportStar(require("./utils/useFormatMonitor.js"), exports);
9
+ tslib_1.__exportStar(require("./utils/useGetSVGtext.js"), exports);
10
+ tslib_1.__exportStar(require("./utils/useMixedControlState.js"), exports);
11
+ tslib_1.__exportStar(require("./utils/useScrollbarWidthCSSVar.js"), exports);