@reykjavik/hanna-react 0.10.99 → 0.10.101

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 (344) hide show
  1. package/AccordionList.d.ts +2 -2
  2. package/AccordionList.js +2 -2
  3. package/ActionCards.d.ts +2 -1
  4. package/ActionCards.js +1 -1
  5. package/Alert.d.ts +2 -2
  6. package/Alert.js +20 -12
  7. package/ArticleCards.d.ts +4 -1
  8. package/ArticleCards.js +1 -1
  9. package/ArticleCarousel/_ArticleCarouselCard.js +1 -2
  10. package/ArticleCarousel.d.ts +2 -2
  11. package/ArticleCarousel.js +1 -1
  12. package/ArticleMeta.d.ts +2 -1
  13. package/ArticleMeta.js +2 -2
  14. package/Attention.d.ts +2 -1
  15. package/Attention.js +4 -1
  16. package/BasicTable.d.ts +2 -1
  17. package/BgBox.d.ts +2 -1
  18. package/BgBox.js +4 -2
  19. package/Bling.d.ts +2 -1
  20. package/Bling.js +5 -3
  21. package/BlockBreak.js +1 -0
  22. package/BreadCrumbs.d.ts +2 -1
  23. package/BreadCrumbs.js +3 -2
  24. package/ButtonBack.js +2 -0
  25. package/ButtonBar.d.ts +4 -3
  26. package/ButtonBar.js +3 -3
  27. package/ButtonPrimary.js +2 -0
  28. package/ButtonSecondary.js +2 -0
  29. package/ButtonTertiary.js +2 -0
  30. package/CHANGELOG.md +14 -1
  31. package/CarouselStepper.d.ts +2 -1
  32. package/CenterColumn.d.ts +2 -1
  33. package/CenterColumn.js +4 -2
  34. package/CheckboxButton.d.ts +4 -2
  35. package/CheckboxButtonsGroup.js +2 -2
  36. package/CityBlock.d.ts +2 -1
  37. package/CityBlock.js +1 -1
  38. package/ContactBubble.d.ts +2 -2
  39. package/ContactBubble.js +5 -4
  40. package/ContentArticle.d.ts +2 -1
  41. package/ContentArticle.js +3 -2
  42. package/ContentImage.d.ts +2 -1
  43. package/ContentImage.js +4 -3
  44. package/Datepicker.js +6 -6
  45. package/ExtraLinks.d.ts +2 -1
  46. package/ExtraLinks.js +4 -2
  47. package/FeatureList.d.ts +2 -1
  48. package/FeatureList.js +3 -2
  49. package/FieldGroup.d.ts +2 -1
  50. package/FieldGroup.js +4 -2
  51. package/FileInput.d.ts +2 -2
  52. package/FileInput.js +10 -5
  53. package/Foonote.js +3 -4
  54. package/Footnote.d.ts +2 -1
  55. package/Footnote.js +2 -1
  56. package/Form.js +4 -5
  57. package/FormField.d.ts +25 -5
  58. package/FormField.js +32 -7
  59. package/Gallery/_GalleryItem.js +2 -2
  60. package/Gallery/_GalleryModalItem.js +1 -1
  61. package/Gallery.d.ts +2 -2
  62. package/Gallery.js +5 -4
  63. package/GridBlocks.d.ts +2 -5
  64. package/GridBlocks.js +3 -3
  65. package/Heading.d.ts +2 -1
  66. package/Heading.js +3 -3
  67. package/HeroBlock.d.ts +2 -1
  68. package/HeroBlock.js +4 -3
  69. package/IframeBlock.d.ts +9 -4
  70. package/IframeBlock.js +13 -12
  71. package/Illustration.d.ts +2 -1
  72. package/Illustration.js +1 -1
  73. package/ImageCards.d.ts +2 -1
  74. package/ImageCards.js +2 -2
  75. package/InfoBlock.d.ts +2 -1
  76. package/InfoBlock.js +3 -2
  77. package/InfoHero.d.ts +2 -1
  78. package/InfoHero.js +3 -3
  79. package/IslandBlock.d.ts +2 -1
  80. package/IslandBlock.js +2 -2
  81. package/IslandPageBlock.d.ts +2 -1
  82. package/IslandPageBlock.js +2 -2
  83. package/LabeledTextBlock.d.ts +2 -1
  84. package/LabeledTextBlock.js +2 -2
  85. package/Layout.d.ts +2 -2
  86. package/Layout.js +3 -3
  87. package/MainMenu.d.ts +2 -2
  88. package/MainMenu.js +4 -3
  89. package/MiniMetrics.d.ts +2 -1
  90. package/MiniMetrics.js +3 -2
  91. package/Modal.d.ts +2 -1
  92. package/Multiselect.d.ts +11 -6
  93. package/Multiselect.js +15 -11
  94. package/NameCard.d.ts +2 -1
  95. package/NameCard.js +10 -6
  96. package/NameCards.d.ts +3 -2
  97. package/NameCards.js +3 -2
  98. package/NewsHero.d.ts +2 -1
  99. package/NewsHero.js +3 -3
  100. package/PageFilter.d.ts +2 -1
  101. package/PageFilter.js +2 -2
  102. package/PageHeading.d.ts +2 -1
  103. package/PageHeading.js +2 -5
  104. package/Picture.d.ts +2 -1
  105. package/Picture.js +1 -5
  106. package/ProcessOverview.d.ts +2 -1
  107. package/ProcessOverview.js +2 -5
  108. package/RadioButtonsGroup.js +2 -2
  109. package/RadioGroup.js +1 -1
  110. package/ReadSpeakerPlayer.d.ts +1 -1
  111. package/ReadSpeakerPlayer.js +2 -2
  112. package/RelatedLinks.d.ts +2 -1
  113. package/RelatedLinks.js +3 -2
  114. package/RowBlock.d.ts +2 -1
  115. package/RowBlock.js +2 -2
  116. package/RowBlockColumn.d.ts +2 -1
  117. package/RowBlockColumn.js +3 -3
  118. package/SearchInput.d.ts +3 -9
  119. package/SearchInput.js +4 -5
  120. package/SearchResults/_SearchResultsItem.js +1 -1
  121. package/SearchResults.d.ts +2 -1
  122. package/SearchResults.js +2 -2
  123. package/SeenEffect.js +2 -0
  124. package/Selectbox.js +3 -4
  125. package/ShareButtons.d.ts +2 -2
  126. package/ShareButtons.js +5 -3
  127. package/Sharpie.d.ts +2 -1
  128. package/Sharpie.js +2 -2
  129. package/SiteSearchAutocomplete.d.ts +2 -1
  130. package/SiteSearchAutocomplete.js +4 -4
  131. package/SiteSearchCurtain.js +2 -0
  132. package/SiteSearchInput.d.ts +3 -6
  133. package/SiteSearchInput.js +4 -4
  134. package/Skeleton.d.ts +4 -1
  135. package/Skeleton.js +15 -18
  136. package/SubHeading.d.ts +2 -1
  137. package/SubHeading.js +3 -3
  138. package/Tabs.d.ts +2 -2
  139. package/Tabs.js +5 -5
  140. package/TagPill.js +2 -0
  141. package/TextBlock.d.ts +2 -1
  142. package/TextBlock.js +3 -3
  143. package/TextButton.js +2 -0
  144. package/TextInput.d.ts +2 -2
  145. package/TextInput.js +3 -4
  146. package/Tooltip.d.ts +2 -1
  147. package/Tooltip.js +28 -15
  148. package/VSpacer.d.ts +2 -1
  149. package/VSpacer.js +3 -7
  150. package/VerticalTabsTOC.d.ts +1 -1
  151. package/VerticalTabsTOC.js +1 -1
  152. package/WizardLayout.d.ts +2 -2
  153. package/WizardLayout.js +4 -3
  154. package/WizardLayoutClose.js +2 -0
  155. package/WizardStepper.d.ts +2 -1
  156. package/WizardStepper.js +2 -2
  157. package/_abstract/_AbstractCarousel.d.ts +2 -2
  158. package/_abstract/_AbstractCarousel.js +6 -3
  159. package/_abstract/_Block.d.ts +2 -1
  160. package/_abstract/_Block.js +3 -3
  161. package/_abstract/_Button.js +4 -1
  162. package/_abstract/_CardList.d.ts +3 -1
  163. package/_abstract/_CardList.js +6 -3
  164. package/_abstract/_Image.d.ts +6 -3
  165. package/_abstract/_Image.js +11 -4
  166. package/_abstract/_Quote.d.ts +2 -1
  167. package/_abstract/_Quote.js +3 -2
  168. package/_abstract/_TogglerGroup.js +1 -1
  169. package/_abstract/_TogglerGroupField.js +5 -5
  170. package/_abstract/_TogglerInput.d.ts +2 -2
  171. package/_abstract/_TogglerInput.js +4 -2
  172. package/esm/AccordionList.d.ts +2 -2
  173. package/esm/AccordionList.js +3 -3
  174. package/esm/ActionCards.d.ts +2 -1
  175. package/esm/ActionCards.js +1 -1
  176. package/esm/Alert.d.ts +2 -2
  177. package/esm/Alert.js +21 -13
  178. package/esm/ArticleCards.d.ts +4 -1
  179. package/esm/ArticleCards.js +1 -1
  180. package/esm/ArticleCarousel/_ArticleCarouselCard.js +1 -2
  181. package/esm/ArticleCarousel.d.ts +2 -2
  182. package/esm/ArticleCarousel.js +1 -1
  183. package/esm/ArticleMeta.d.ts +2 -1
  184. package/esm/ArticleMeta.js +2 -2
  185. package/esm/Attention.d.ts +2 -1
  186. package/esm/Attention.js +4 -1
  187. package/esm/BasicTable.d.ts +2 -1
  188. package/esm/BgBox.d.ts +2 -1
  189. package/esm/BgBox.js +4 -2
  190. package/esm/Bling.d.ts +2 -1
  191. package/esm/Bling.js +5 -3
  192. package/esm/BlockBreak.js +1 -0
  193. package/esm/BreadCrumbs.d.ts +2 -1
  194. package/esm/BreadCrumbs.js +3 -2
  195. package/esm/ButtonBack.js +2 -0
  196. package/esm/ButtonBar.d.ts +4 -3
  197. package/esm/ButtonBar.js +3 -3
  198. package/esm/ButtonPrimary.js +2 -0
  199. package/esm/ButtonSecondary.js +2 -0
  200. package/esm/ButtonTertiary.js +2 -0
  201. package/esm/CarouselStepper.d.ts +2 -1
  202. package/esm/CenterColumn.d.ts +2 -1
  203. package/esm/CenterColumn.js +4 -2
  204. package/esm/CheckboxButton.d.ts +4 -2
  205. package/esm/CheckboxButtonsGroup.js +2 -2
  206. package/esm/CityBlock.d.ts +2 -1
  207. package/esm/CityBlock.js +1 -1
  208. package/esm/ContactBubble.d.ts +2 -2
  209. package/esm/ContactBubble.js +5 -4
  210. package/esm/ContentArticle.d.ts +2 -1
  211. package/esm/ContentArticle.js +3 -2
  212. package/esm/ContentImage.d.ts +2 -1
  213. package/esm/ContentImage.js +4 -3
  214. package/esm/Datepicker.js +7 -7
  215. package/esm/ExtraLinks.d.ts +2 -1
  216. package/esm/ExtraLinks.js +4 -2
  217. package/esm/FeatureList.d.ts +2 -1
  218. package/esm/FeatureList.js +3 -2
  219. package/esm/FieldGroup.d.ts +2 -1
  220. package/esm/FieldGroup.js +4 -2
  221. package/esm/FileInput.d.ts +2 -2
  222. package/esm/FileInput.js +10 -5
  223. package/esm/Foonote.js +2 -2
  224. package/esm/Footnote.d.ts +2 -1
  225. package/esm/Footnote.js +2 -1
  226. package/esm/Form.js +5 -5
  227. package/esm/FormField.d.ts +25 -5
  228. package/esm/FormField.js +30 -6
  229. package/esm/Gallery/_GalleryItem.js +2 -2
  230. package/esm/Gallery/_GalleryModalItem.js +1 -1
  231. package/esm/Gallery.d.ts +2 -2
  232. package/esm/Gallery.js +6 -5
  233. package/esm/GridBlocks.d.ts +2 -5
  234. package/esm/GridBlocks.js +3 -3
  235. package/esm/Heading.d.ts +2 -1
  236. package/esm/Heading.js +3 -3
  237. package/esm/HeroBlock.d.ts +2 -1
  238. package/esm/HeroBlock.js +4 -3
  239. package/esm/IframeBlock.d.ts +9 -4
  240. package/esm/IframeBlock.js +13 -12
  241. package/esm/Illustration.d.ts +2 -1
  242. package/esm/Illustration.js +1 -1
  243. package/esm/ImageCards.d.ts +2 -1
  244. package/esm/ImageCards.js +2 -2
  245. package/esm/InfoBlock.d.ts +2 -1
  246. package/esm/InfoBlock.js +3 -2
  247. package/esm/InfoHero.d.ts +2 -1
  248. package/esm/InfoHero.js +3 -3
  249. package/esm/IslandBlock.d.ts +2 -1
  250. package/esm/IslandBlock.js +2 -2
  251. package/esm/IslandPageBlock.d.ts +2 -1
  252. package/esm/IslandPageBlock.js +2 -2
  253. package/esm/LabeledTextBlock.d.ts +2 -1
  254. package/esm/LabeledTextBlock.js +2 -2
  255. package/esm/Layout.d.ts +2 -2
  256. package/esm/Layout.js +3 -3
  257. package/esm/MainMenu.d.ts +2 -2
  258. package/esm/MainMenu.js +4 -3
  259. package/esm/MiniMetrics.d.ts +2 -1
  260. package/esm/MiniMetrics.js +3 -2
  261. package/esm/Modal.d.ts +2 -1
  262. package/esm/Multiselect.d.ts +11 -6
  263. package/esm/Multiselect.js +15 -11
  264. package/esm/NameCard.d.ts +2 -1
  265. package/esm/NameCard.js +10 -6
  266. package/esm/NameCards.d.ts +3 -2
  267. package/esm/NameCards.js +3 -2
  268. package/esm/NewsHero.d.ts +2 -1
  269. package/esm/NewsHero.js +3 -3
  270. package/esm/PageFilter.d.ts +2 -1
  271. package/esm/PageFilter.js +2 -2
  272. package/esm/PageHeading.d.ts +2 -1
  273. package/esm/PageHeading.js +2 -5
  274. package/esm/Picture.d.ts +2 -1
  275. package/esm/Picture.js +1 -5
  276. package/esm/ProcessOverview.d.ts +2 -1
  277. package/esm/ProcessOverview.js +2 -5
  278. package/esm/RadioButtonsGroup.js +2 -2
  279. package/esm/RadioGroup.js +1 -1
  280. package/esm/ReadSpeakerPlayer.d.ts +1 -1
  281. package/esm/ReadSpeakerPlayer.js +2 -2
  282. package/esm/RelatedLinks.d.ts +2 -1
  283. package/esm/RelatedLinks.js +3 -2
  284. package/esm/RowBlock.d.ts +2 -1
  285. package/esm/RowBlock.js +2 -2
  286. package/esm/RowBlockColumn.d.ts +2 -1
  287. package/esm/RowBlockColumn.js +3 -3
  288. package/esm/SearchInput.d.ts +3 -9
  289. package/esm/SearchInput.js +4 -5
  290. package/esm/SearchResults/_SearchResultsItem.js +1 -1
  291. package/esm/SearchResults.d.ts +2 -1
  292. package/esm/SearchResults.js +2 -2
  293. package/esm/SeenEffect.js +2 -0
  294. package/esm/Selectbox.js +3 -4
  295. package/esm/ShareButtons.d.ts +2 -2
  296. package/esm/ShareButtons.js +5 -3
  297. package/esm/Sharpie.d.ts +2 -1
  298. package/esm/Sharpie.js +2 -2
  299. package/esm/SiteSearchAutocomplete.d.ts +2 -1
  300. package/esm/SiteSearchAutocomplete.js +4 -4
  301. package/esm/SiteSearchCurtain.js +2 -0
  302. package/esm/SiteSearchInput.d.ts +3 -6
  303. package/esm/SiteSearchInput.js +4 -4
  304. package/esm/Skeleton.d.ts +4 -1
  305. package/esm/Skeleton.js +15 -18
  306. package/esm/SubHeading.d.ts +2 -1
  307. package/esm/SubHeading.js +3 -3
  308. package/esm/Tabs.d.ts +2 -2
  309. package/esm/Tabs.js +5 -5
  310. package/esm/TagPill.js +2 -0
  311. package/esm/TextBlock.d.ts +2 -1
  312. package/esm/TextBlock.js +3 -3
  313. package/esm/TextButton.js +2 -0
  314. package/esm/TextInput.d.ts +2 -2
  315. package/esm/TextInput.js +3 -4
  316. package/esm/Tooltip.d.ts +2 -1
  317. package/esm/Tooltip.js +28 -15
  318. package/esm/VSpacer.d.ts +2 -1
  319. package/esm/VSpacer.js +3 -7
  320. package/esm/VerticalTabsTOC.d.ts +1 -1
  321. package/esm/VerticalTabsTOC.js +1 -1
  322. package/esm/WizardLayout.d.ts +2 -2
  323. package/esm/WizardLayout.js +4 -3
  324. package/esm/WizardLayoutClose.js +2 -0
  325. package/esm/WizardStepper.d.ts +2 -1
  326. package/esm/WizardStepper.js +2 -2
  327. package/esm/_abstract/_AbstractCarousel.d.ts +2 -2
  328. package/esm/_abstract/_AbstractCarousel.js +6 -3
  329. package/esm/_abstract/_Block.d.ts +2 -1
  330. package/esm/_abstract/_Block.js +3 -3
  331. package/esm/_abstract/_Button.js +4 -1
  332. package/esm/_abstract/_CardList.d.ts +3 -1
  333. package/esm/_abstract/_CardList.js +6 -3
  334. package/esm/_abstract/_Image.d.ts +6 -3
  335. package/esm/_abstract/_Image.js +12 -5
  336. package/esm/_abstract/_Quote.d.ts +2 -1
  337. package/esm/_abstract/_Quote.js +3 -2
  338. package/esm/_abstract/_TogglerGroup.js +1 -1
  339. package/esm/_abstract/_TogglerGroupField.js +5 -5
  340. package/esm/_abstract/_TogglerInput.d.ts +2 -2
  341. package/esm/_abstract/_TogglerInput.js +4 -2
  342. package/esm/utils.d.ts +25 -2
  343. package/package.json +1 -1
  344. package/utils.d.ts +25 -2
@@ -3,9 +3,9 @@ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
3
  import { useSeenEffect } from './utils/seenEffect.js';
4
4
  import ButtonTertiary from './ButtonTertiary.js';
5
5
  export const LabeledTextBlock = (props) => {
6
- const { label, summary, wide, buttons = [], startSeen } = props;
6
+ const { label, summary, wide, buttons = [], startSeen, wrapperProps } = props;
7
7
  const [ref] = useSeenEffect(startSeen);
8
- return (React.createElement("div", { className: modifiedClass('LabeledTextBlock', wide && 'wide'), ref: ref },
8
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('LabeledTextBlock', wide && 'wide', (wrapperProps || {}).className), ref: ref }),
9
9
  React.createElement("h2", { className: "LabeledTextBlock__label" }, label),
10
10
  React.createElement("div", { className: "LabeledTextBlock__summary" },
11
11
  summary,
package/esm/Layout.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { HannaColorTheme } from '@reykjavik/hanna-css';
3
3
  import { EitherObj } from '@reykjavik/hanna-utils';
4
4
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
5
5
  import { BemModifierProps } from './utils/types.js';
6
- import { SSRSupportProps } from './utils.js';
6
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
7
7
  export type LayoutI18n = {
8
8
  lang?: string;
9
9
  skipLinkLabel: string;
@@ -20,7 +20,7 @@ type LayoutProps = {
20
20
  siteName?: string;
21
21
  texts?: LayoutI18n;
22
22
  lang?: string;
23
- } & SSRSupportProps & BemModifierProps & EitherObj<{
23
+ } & SSRSupportProps & WrapperElmProps & BemModifierProps & EitherObj<{
24
24
  mainChildren: ReactNode;
25
25
  }, {
26
26
  children: ReactNode;
package/esm/Layout.js CHANGED
@@ -27,16 +27,16 @@ export const defaultLayoutTexts = {
27
27
  };
28
28
  export const Layout = (props) => {
29
29
  useScrollbarWidthCSSVar();
30
- const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = '', logoLink = '/', } = props;
30
+ const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = '', logoLink = '/', wrapperProps, } = props;
31
31
  const { isMenuActive, uiState, closeMenu, toggleMenu } = useMenuToggling(ssr !== 'ssr-only');
32
32
  const txt = getTexts(props, defaultLayoutTexts);
33
- return (React.createElement("div", { className: modifiedClass('Layout', props.modifier), "data-color-theme": colorTheme },
33
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('Layout', props.modifier, (wrapperProps || {}).className), "data-color-theme": colorTheme }),
34
34
  globalAlerts && (React.createElement("div", { className: "Layout__alerts", role: "alert" }, globalAlerts)),
35
35
  React.createElement("div", { className: "Layout__content" },
36
36
  React.createElement("div", { className: "Layout__header", role: "banner" },
37
37
  React.createElement(Link, { className: "Layout__header__logo", href: logoLink },
38
38
  ' ',
39
- React.createElement(Image, { className: undefined, inline: true, src: getAssetUrl('reykjavik-logo.svg'), altText: "Reykjav\u00EDk" }),
39
+ React.createElement(Image, { bem: undefined, inline: true, src: getAssetUrl('reykjavik-logo.svg'), altText: "Reykjav\u00EDk" }),
40
40
  ' ',
41
41
  siteName,
42
42
  ' '),
package/esm/MainMenu.d.ts CHANGED
@@ -3,7 +3,7 @@ import { Cleanup } from '@reykjavik/hanna-utils';
3
3
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
4
4
  import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary.js';
5
5
  import { MegaMenuItem, MegaMenuPanel, PrimaryPanelI18n } from './MainMenu/_PrimaryPanel.js';
6
- import { SSRSupportProps } from './utils.js';
6
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
7
7
  export type MainMenuI18n = Cleanup<{
8
8
  lang?: string;
9
9
  homeLabel?: string;
@@ -63,6 +63,6 @@ export type MainMenuProps = {
63
63
  activePanelId?: string;
64
64
  texts?: MainMenuI18n;
65
65
  lang?: string;
66
- } & SSRSupportProps;
66
+ } & SSRSupportProps & WrapperElmProps<null, 'aria-label'>;
67
67
  export declare const MainMenu: (props: MainMenuProps) => JSX.Element | null;
68
68
  export default MainMenu;
package/esm/MainMenu.js CHANGED
@@ -85,12 +85,13 @@ const normalizeMenuItems = (itemsProp, megaPanels, homeLink, texts) => {
85
85
  // ---------------------------------------------------------------------------
86
86
  const emptyPanelList = [];
87
87
  export const MainMenu = (props) => {
88
- const { megaPanels = emptyPanelList, onItemClick, ssr, auxiliaryPanel } = props;
88
+ const { megaPanels = emptyPanelList, onItemClick, ssr, auxiliaryPanel, wrapperProps = {}, } = props;
89
89
  const texts = getTexts(props, defaultMainMenuTexts);
90
90
  const title = props.title || texts.title;
91
91
  const { closeHamburgerMenu } = useHannaUIState();
92
92
  const isBrowser = useIsBrowserSide(ssr);
93
- const menuElmRef = useRef(null);
93
+ const _menuElmRef = useRef(null);
94
+ const menuElmRef = wrapperProps.ref || _menuElmRef;
94
95
  const pressedLinkRef = useRef(null);
95
96
  const activePanelRef = useRef(null);
96
97
  const [activePanel, _setActivePanel] = useState(() => isBrowser && findActivePanel(megaPanels, props.activePanelId));
@@ -180,7 +181,7 @@ export const MainMenu = (props) => {
180
181
  closeHamburgerMenu();
181
182
  }
182
183
  };
183
- return (React.createElement("nav", { className: "MainMenu", "aria-label": title, "data-sprinkled": isBrowser, ref: menuElmRef },
184
+ return (React.createElement("nav", Object.assign({}, props.wrapperProps, { className: modifiedClass('MainMenu', null, wrapperProps.className), "aria-label": title, "data-sprinkled": isBrowser, ref: menuElmRef }),
184
185
  React.createElement("h2", { className: "MainMenu__title" }, title),
185
186
  React.createElement("ul", { className: "MainMenu__items" }, menuItems.map((item, i) => {
186
187
  if (item === '---') {
@@ -1,8 +1,9 @@
1
1
  import { ButtonProps } from './_abstract/_Button.js';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type MiniMetricsProps = {
4
5
  text: string;
5
6
  moreButton: ButtonProps;
6
- } & SeenProp;
7
+ } & WrapperElmProps & SeenProp;
7
8
  export declare const MiniMetrics: (props: MiniMetricsProps) => JSX.Element;
8
9
  export default MiniMetrics;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
2
3
  import { Button } from './_abstract/_Button.js';
3
4
  import SeenEffect from './SeenEffect.js';
4
5
  export const MiniMetrics = (props) => {
5
- const { text, moreButton, startSeen } = props;
6
- return (React.createElement(SeenEffect, { className: "MiniMetrics", startSeen: startSeen },
6
+ const { text, moreButton, startSeen, wrapperProps } = props;
7
+ return (React.createElement(SeenEffect, Object.assign({}, wrapperProps, { className: modifiedClass('MiniMetrics', null, (wrapperProps || {}).className), startSeen: startSeen }),
7
8
  React.createElement("strong", { className: "MiniMetrics__text" }, text),
8
9
  " ",
9
10
  '\n',
package/esm/Modal.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ModalProps as _ModalProps } from '@hugsmidjan/react/Modal';
3
+ import { MissingWrapperElmProps } from './utils.js';
3
4
  export type ModalProps = Omit<_ModalProps, 'bem' | 'bodyWrap' | 'modifier'> & {
4
5
  modifier?: 'w6' | 'w8' | 'w10';
5
6
  bling?: ReactElement;
6
- };
7
+ } & MissingWrapperElmProps;
7
8
  export declare const Modal: (props: ModalProps) => JSX.Element;
8
9
  export default Modal;
@@ -28,14 +28,18 @@ export type MultiselectProps = TogglerGroupFieldProps<string> & {
28
28
  * even when the total options are fewer than
29
29
  * `Multiselect.meta.summaryLimit`.
30
30
  *
31
- * NOTE: Using this option is generally not recommended.
31
+ * NOTE: Using this option is generally not recommended,
32
+ * because the search UI (i.e. the on-screen keyboard), takes up a lot of
33
+ * space on mobile devices.
32
34
  */
33
35
  forceSummary?: boolean;
34
36
  /**
35
37
  * Force the options to be searchable, even when they're
36
38
  * fewer than `Multiselect.meta.searchableLimit`.
37
39
  *
38
- * NOTE: Using this option is generally not recommended.
40
+ * NOTE: Using this option is generally not recommended,
41
+ * because the summary takes up valuable space when there are only a few
42
+ * items.
39
43
  */
40
44
  forceSearchable?: boolean;
41
45
  texts?: MultiselectI18n;
@@ -49,16 +53,17 @@ export declare const Multiselect: {
49
53
  /**
50
54
  * The item-count where the list becomes searchable.
51
55
  *
52
- * (The search UI, including the on-screen keyboard, takes up a lot of space
56
+ * (The search UI (on-screen keyboard), takes up a lot of space
53
57
  * on mobile devices, so there's a balance that we want to strike.)
54
58
  */
55
- searchableLimit: number;
59
+ readonly searchableLimit: number;
56
60
  /**
57
61
  * The item-count above which we display a summary of "current" values
58
62
  * at the top of the drop-down list.
59
63
  *
60
- * (This summary just gets in the way with ultra short option lists.)
64
+ * (The summary is pointless and takes up valuable space,
65
+ * when there are only a few items.)
61
66
  */
62
- summaryLimit: number;
67
+ readonly summaryLimit: number;
63
68
  };
64
69
  };
@@ -7,14 +7,14 @@ import { getTexts } from '@reykjavik/hanna-utils/i18n';
7
7
  import { FocusTrap } from './_abstract/_FocusTrap.js';
8
8
  import { filterItems } from './Multiselect/_Multiselect.search.js';
9
9
  import Checkbox from './Checkbox.js';
10
- import FormField from './FormField.js';
10
+ import FormField, { getFormFieldWrapperProps } from './FormField.js';
11
11
  import TagPill from './TagPill.js';
12
12
  import { useMixedControlState } from './utils.js';
13
13
  const metaData = {
14
14
  /**
15
15
  * The item-count where the list becomes searchable.
16
16
  *
17
- * (The search UI, including the on-screen keyboard, takes up a lot of space
17
+ * (The search UI (on-screen keyboard), takes up a lot of space
18
18
  * on mobile devices, so there's a balance that we want to strike.)
19
19
  */
20
20
  searchableLimit: 20,
@@ -22,10 +22,14 @@ const metaData = {
22
22
  * The item-count above which we display a summary of "current" values
23
23
  * at the top of the drop-down list.
24
24
  *
25
- * (This summary just gets in the way with ultra short option lists.)
25
+ * (The summary is pointless and takes up valuable space,
26
+ * when there are only a few items.)
26
27
  */
28
+ // NOTE: First we tried 10, which felt way too low, now we're trying 20.
29
+ // Maybe the "sweet-spot" is closer to 15 ? — We'll see.
27
30
  summaryLimit: 20,
28
31
  };
32
+ // Extract the values up front, to prevent runtime changes of these values.
29
33
  const { searchableLimit, summaryLimit } = metaData;
30
34
  const defaultTexts = {
31
35
  pl: {
@@ -61,7 +65,7 @@ export const Multiselect = (props) => {
61
65
  const placeholderText = !values.length ? props.placeholder : undefined;
62
66
  const texts = getTexts(props, defaultTexts);
63
67
  const inputRef = useRef(null);
64
- const wrapperRef = useRef(null);
68
+ const inputWrapperRef = useRef(null);
65
69
  const [activeItemIndex, setActiveItemIndex] = useState(-1);
66
70
  const [searchQuery, setSearchQuery] = useState('');
67
71
  const [isOpen, setIsOpen] = useState(false);
@@ -69,14 +73,14 @@ export const Multiselect = (props) => {
69
73
  setIsOpen((isOpen) => {
70
74
  newIsOpen = typeof newIsOpen === 'boolean' ? newIsOpen : !isOpen;
71
75
  if (!newIsOpen) {
72
- wrapperRef.current.querySelector('.Multiselect__choices').scrollTo(0, 0);
76
+ inputWrapperRef.current.querySelector('.Multiselect__choices').scrollTo(0, 0);
73
77
  setSearchQuery('');
74
78
  setActiveItemIndex(-1);
75
79
  }
76
80
  return newIsOpen;
77
81
  });
78
82
  };
79
- useOnClickOutside(wrapperRef, () => toggleOpen(false));
83
+ useOnClickOutside(inputWrapperRef, () => toggleOpen(false));
80
84
  const options = useMemo(() => _options.map((item) => (typeof item === 'string' ? { value: item } : item)), [_options]);
81
85
  const isSearchable = props.forceSearchable || options.length >= searchableLimit;
82
86
  /*
@@ -164,7 +168,7 @@ export const Multiselect = (props) => {
164
168
  }, [activeItemIndex, filteredOptions, isOpen, handleCheckboxSelection, inputRef]);
165
169
  // Auto-close the dropdown when focus has left the building
166
170
  useEffect(() => {
167
- const wrapperDiv = wrapperRef.current;
171
+ const wrapperDiv = inputWrapperRef.current;
168
172
  if (!wrapperDiv) {
169
173
  return;
170
174
  }
@@ -182,14 +186,14 @@ export const Multiselect = (props) => {
182
186
  }, []);
183
187
  useEffect(() => {
184
188
  var _a, _b;
185
- (_b = (_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.Multiselect__option')[activeItemIndex]) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
189
+ (_b = (_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.Multiselect__option')[activeItemIndex]) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
186
190
  behavior: 'smooth',
187
191
  block: 'nearest',
188
192
  });
189
193
  }, [activeItemIndex]);
190
- return (React.createElement(FormField, { className: modifiedClass('Multiselect', props.nowrap && 'nowrap', props.className), ssr: props.ssr, group: "inputlike", label: props.label, LabelTag: props.LabelTag, hideLabel: props.hideLabel, small: props.small, filled: filled, empty: empty, disabled: disabled, invalid: props.invalid, errorMessage: props.errorMessage, assistText: props.assistText, readOnly: readOnly, required: props.required, reqText: props.reqText, id: props.id, renderInput: (className, inputProps, addFocusProps, isBrowser) => {
194
+ return (React.createElement(FormField, Object.assign({ extraClassName: modifiedClass('Multiselect', props.nowrap && 'nowrap'), group: "inputlike", filled: filled, empty: empty }, getFormFieldWrapperProps(props), { renderInput: (className, inputProps, addFocusProps, isBrowser) => {
191
195
  const { id } = inputProps;
192
- return (React.createElement("div", Object.assign({ className: modifiedClass('Multiselect__input', [isOpen && 'open'], className.input) }, addFocusProps(), { "data-sprinkled": isBrowser, ref: wrapperRef }),
196
+ return (React.createElement("div", Object.assign({ className: modifiedClass('Multiselect__input', [isOpen && 'open'], className.input) }, addFocusProps(), { "data-sprinkled": isBrowser, ref: inputWrapperRef }),
193
197
  !isBrowser ? null : isSearchable ? (React.createElement("input", { className: "Multiselect__search", id: `toggler:${id}`, "aria-label": texts.search, "aria-controls": domId(), "data-expanded": isOpen || undefined, onChange: handleInputChange, onKeyDown: handleInputKeyDown, onClick: () => toggleOpen(), value: searchQuery,
194
198
  // onFocus={handleInputFocus}
195
199
  placeholder: placeholderText, disabled: disabled, ref: inputRef })) : (React.createElement("button", { className: "Multiselect__toggler", id: `toggler:${id}`, type: "button", "aria-label": texts.buttonShow, "aria-controls": domId(), "aria-expanded": isOpen, onClick: () => toggleOpen(), disabled: disabled,
@@ -225,7 +229,7 @@ export const Multiselect = (props) => {
225
229
  } })));
226
230
  })) : searchQuery ? (React.createElement("li", { className: "Multiselect__noresults" }, texts.noneFoundMsg)) : undefined,
227
231
  React.createElement(FocusTrap, { Tag: "li" })))));
228
- } }));
232
+ } })));
229
233
  };
230
234
  /** Configuration constants for the Multiselect components */
231
235
  Multiselect.meta = metaData;
package/esm/NameCard.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { WrapperElmProps } from './utils.js';
1
2
  export type NameCardI18n = {
2
3
  updatedLabel: string;
3
4
  availableLabel: string;
@@ -59,6 +60,6 @@ export type NameCardProps = {
59
60
  vacancy?: boolean;
60
61
  /** @deprecated Use `contactInfo` instead (will be removed in v0.11) */
61
62
  tel?: string | Array<string>;
62
- };
63
+ } & WrapperElmProps;
63
64
  export declare const NameCard: (props: NameCardProps) => JSX.Element;
64
65
  export default NameCard;
package/esm/NameCard.js CHANGED
@@ -36,7 +36,8 @@ const defaultTexts = {
36
36
  },
37
37
  };
38
38
  export const NameCard = (props) => {
39
- const { name, location, hours, aboutText, available = props.vacancy, updated } = props;
39
+ const { name, location, hours, aboutText, available = props.vacancy, // eslint-disable-line deprecation/deprecation
40
+ updated, wrapperProps, } = props;
40
41
  const renderMeta = () => {
41
42
  if (available == null && !updated) {
42
43
  return;
@@ -46,8 +47,9 @@ export const NameCard = (props) => {
46
47
  return (React.createElement("div", { className: "NameCard__meta" },
47
48
  available != null && (React.createElement("span", { className: modifiedClass('NameCard__availability', available && 'available') },
48
49
  available
49
- ? availableLabel || texts.vacancyLabel
50
- : unavailableLabel || texts.noVacancyLabel,
50
+ ? availableLabel || texts.vacancyLabel // eslint-disable-line deprecation/deprecation
51
+ : unavailableLabel || texts.noVacancyLabel // eslint-disable-line deprecation/deprecation
52
+ ,
51
53
  ' ')),
52
54
  updated != null && (React.createElement("span", { className: "NameCard__updated" },
53
55
  updatedLabel,
@@ -56,10 +58,12 @@ export const NameCard = (props) => {
56
58
  };
57
59
  let contactInfo = props.contactInfo;
58
60
  if (!contactInfo) {
59
- contactInfo = _telToContactInfo(props.tel) || [];
61
+ contactInfo = _telToContactInfo(props.tel) || []; // eslint-disable-line deprecation/deprecation
60
62
  }
61
63
  // Remove/map @deprecated contactinfo items
62
- const cleanContactInfo = contactInfo.map((item) => {
64
+ const cleanContactInfo = contactInfo.map(
65
+ // eslint-disable-next-line deprecation/deprecation
66
+ (item) => {
63
67
  if (typeof item !== 'string' && 'value' in item) {
64
68
  return {
65
69
  href: item.href,
@@ -69,7 +73,7 @@ export const NameCard = (props) => {
69
73
  }
70
74
  return item;
71
75
  });
72
- return (React.createElement("div", { className: "NameCard" },
76
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('NameCard', null, (wrapperProps || {}).className) }),
73
77
  React.createElement("div", { className: "NameCard__name" }, name),
74
78
  contactInfo.length > 0 && (React.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (React.createElement(React.Fragment, null,
75
79
  typeof item === 'string' ? (React.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (React.createElement(Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
@@ -1,6 +1,7 @@
1
1
  import { NameCardProps } from './NameCard.js';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  type NameCardsProps = {
3
- items: Array<NameCardProps>;
4
- };
4
+ items: Array<Omit<NameCardProps, 'wrapperProps'>>;
5
+ } & WrapperElmProps;
5
6
  export declare const NameCards: (props: NameCardsProps) => JSX.Element;
6
7
  export default NameCards;
package/esm/NameCards.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
2
3
  import NameCard from './NameCard.js';
3
4
  export const NameCards = (props) => {
4
- const { items } = props;
5
- return (React.createElement("div", { className: "NameCards" }, items.map((item, i) => (React.createElement(NameCard, Object.assign({ key: i }, item))))));
5
+ const { items, wrapperProps } = props;
6
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('NameCards', null, (wrapperProps || {}).className) }), items.map((item, i) => (React.createElement(NameCard, Object.assign({ key: i }, item))))));
6
7
  };
7
8
  export default NameCards;
package/esm/NewsHero.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ImageProps } from './_abstract/_Image.js';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  type BlingOptions = 'interesting' | 'snake' | 'pentagon' | 'dome' | 'balls-small' | 'balls-large';
4
5
  export type NewsHeroProps = {
5
6
  title: string;
@@ -9,6 +10,6 @@ export type NewsHeroProps = {
9
10
  sharing?: boolean | (() => JSX.Element);
10
11
  image?: ImageProps;
11
12
  blingType?: BlingOptions;
12
- } & SeenProp;
13
+ } & WrapperElmProps & SeenProp;
13
14
  export declare const NewsHero: (props: NewsHeroProps) => JSX.Element;
14
15
  export default NewsHero;
package/esm/NewsHero.js CHANGED
@@ -72,15 +72,15 @@ const blingOptions = {
72
72
  ],
73
73
  };
74
74
  export const NewsHero = (props) => {
75
- const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
75
+ const { title, sharing = true, meta, summary, image, blingType, startSeen, wrapperProps, } = props;
76
76
  const [ref] = useSeenEffect(startSeen);
77
77
  const blings = (blingType && blingOptions[blingType]) || getStableRandomItem(blingOptions, title);
78
- return (React.createElement("div", { className: modifiedClass('NewsHero', [!image && 'align--right']), ref: ref },
78
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('NewsHero', [!image && 'align--right'], (wrapperProps || {}).className), ref: ref }),
79
79
  React.createElement("div", { className: "NewsHero__content" },
80
80
  React.createElement("h1", { className: "NewsHero__title" }, title),
81
81
  meta && React.createElement("span", { className: "NewsHero__meta" }, meta),
82
82
  React.createElement("div", { className: "NewsHero__summary" }, summary),
83
83
  sharing === true ? React.createElement(ShareButtons, null) : sharing && sharing()),
84
- image ? (React.createElement(Image, Object.assign({ className: "NewsHero__image" }, image))) : (React.createElement(Blings, { blings: blings }))));
84
+ image ? React.createElement(Image, Object.assign({ bem: "NewsHero__image" }, image)) : React.createElement(Blings, { blings: blings })));
85
85
  };
86
86
  export default NewsHero;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { EitherObj } from '@reykjavik/hanna-utils';
3
3
  import { SeenProp } from './utils/seenEffect.js';
4
+ import { WrapperElmProps } from './utils.js';
4
5
  export type PageFilterProps = {
5
6
  title: string;
6
7
  summary?: React.ReactNode;
@@ -11,6 +12,6 @@ export type PageFilterProps = {
11
12
  filters: React.ReactNode;
12
13
  }, {
13
14
  children: React.ReactNode;
14
- }> & SeenProp;
15
+ }> & WrapperElmProps & SeenProp;
15
16
  export declare const PageFilter: (props: PageFilterProps) => JSX.Element;
16
17
  export default PageFilter;
package/esm/PageFilter.js CHANGED
@@ -3,9 +3,9 @@ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
3
  import { useSeenEffect } from './utils/seenEffect.js';
4
4
  import Footnote from './Footnote.js';
5
5
  export const PageFilter = (props) => {
6
- const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
6
+ const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen, wrapperProps, } = props;
7
7
  const [ref] = useSeenEffect(startSeen);
8
- return (React.createElement("div", { className: modifiedClass('PageFilter', underlap && 'underlap'), ref: ref },
8
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('PageFilter', underlap && 'underlap', (wrapperProps || {}).className), ref: ref }),
9
9
  React.createElement("h2", { className: "PageFilter__title" }, title),
10
10
  summary && React.createElement("div", { className: "PageFilter__summary" }, summary),
11
11
  React.createElement("div", { className: "PageFilter__filters" }, filters || children),
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type PageHeadingProps = {
4
5
  Tag?: 'h1' | 'h2';
5
6
  align?: 'right';
6
7
  small?: boolean;
7
8
  children: ReactNode;
8
- } & SeenProp;
9
+ } & WrapperElmProps & SeenProp;
9
10
  export declare const PageHeading: (props: PageHeadingProps) => JSX.Element;
10
11
  export default PageHeading;
@@ -2,11 +2,8 @@ import React from 'react';
2
2
  import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
3
  import { useSeenEffect } from './utils/seenEffect.js';
4
4
  export const PageHeading = (props) => {
5
- const { Tag = 'h1', align, small, children, startSeen } = props;
5
+ const { Tag = 'h1', align, small, children, startSeen, wrapperProps } = props;
6
6
  const [ref] = useSeenEffect(startSeen);
7
- return (React.createElement(Tag, { className: modifiedClass('PageHeading', [
8
- small && 'small',
9
- align === 'right' && 'align--' + align,
10
- ]), ref: ref }, children));
7
+ return (React.createElement(Tag, Object.assign({}, wrapperProps, { className: modifiedClass('PageHeading', [small && 'small', align === 'right' && 'align--' + align], (wrapperProps || {}).className), ref: ref }), children));
11
8
  };
12
9
  export default PageHeading;
package/esm/Picture.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { ImagePropsLinked } from './_abstract/_Image.js';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type PictureProps = ImagePropsLinked & {
3
4
  contain?: boolean;
4
5
  className?: string;
5
- };
6
+ } & WrapperElmProps;
6
7
  export declare const Picture: (props: PictureProps) => JSX.Element;
7
8
  export default Picture;
package/esm/Picture.js CHANGED
@@ -1,8 +1,4 @@
1
1
  import React from 'react';
2
- import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
2
  import { Image } from './_abstract/_Image.js';
4
- export const Picture = (props) => {
5
- const { contain, className } = props;
6
- return (React.createElement(Image, Object.assign({}, props, { className: modifiedClass('Picture', contain && 'contain', className) })));
7
- };
3
+ export const Picture = (props) => (React.createElement(Image, Object.assign({}, props, { bem: "Picture", modifier: props.contain && 'contain' })));
8
4
  export default Picture;
@@ -1,3 +1,4 @@
1
+ import { WrapperElmProps } from './utils.js';
1
2
  export type ProcessOverviewItemProps = {
2
3
  title: string;
3
4
  content: string | JSX.Element;
@@ -8,6 +9,6 @@ export type ProcessOverviewProps = {
8
9
  attention?: string | JSX.Element;
9
10
  transparent?: boolean;
10
11
  narrow?: boolean;
11
- };
12
+ } & WrapperElmProps;
12
13
  export declare const ProcessOverview: (props: ProcessOverviewProps) => JSX.Element;
13
14
  export default ProcessOverview;
@@ -1,11 +1,8 @@
1
1
  import React from 'react';
2
2
  import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
3
  export const ProcessOverview = (props) => {
4
- const { title, items, attention, transparent, narrow } = props;
5
- return (React.createElement("div", { className: modifiedClass('ProcessOverview', [
6
- transparent && 'transparent',
7
- narrow && 'narrow',
8
- ]) },
4
+ const { title, items, attention, transparent, narrow, wrapperProps } = props;
5
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ProcessOverview', [transparent && 'transparent', narrow && 'narrow'], (wrapperProps || {}).className) }),
9
6
  React.createElement("h2", { className: "ProcessOverview__title" }, title),
10
7
  items.map(({ title, content }, i) => {
11
8
  return (React.createElement("div", { key: i, className: "ProcessOverview__item" },
@@ -3,10 +3,10 @@ import { TogglerGroupField, } from './_abstract/_TogglerGroupField.js';
3
3
  import { TogglerInput } from './_abstract/_TogglerInput.js';
4
4
  const RadioButton = (props) => (React.createElement(TogglerInput, Object.assign({}, props, { bem: "RadioButton", type: "radio", innerWrap: true })));
5
5
  export const RadioButtonsGroup = (props) => {
6
- if (props.layout) {
6
+ if (props.layout /* eslint-disable-line deprecation/deprecation */) {
7
7
  console.warn('`RadioButtonsGroupProps.layout` is deprecated.');
8
8
  }
9
- if (props.columns) {
9
+ if (props.columns /* eslint-disable-line deprecation/deprecation */) {
10
10
  console.warn('`RadioButtonsGroupProps.columns` is deprecated.');
11
11
  }
12
12
  return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "RadioButtonsGroup", Toggler: RadioButton, isRadio: true })));
package/esm/RadioGroup.js CHANGED
@@ -4,5 +4,5 @@ import { TogglerInput } from './_abstract/_TogglerInput.js';
4
4
  const Radio = (props) => React.createElement(TogglerInput, Object.assign({}, props, { bem: "Radio", type: "radio" }));
5
5
  export const RadioGroup = (props) => (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "RadioGroup", modifier: props.layout, isRadio: true, Toggler: Radio })));
6
6
  /** @deprecated Exposed for testing purposes only. This may disappear at any time. */
7
- RadioGroup.__Radio = Radio;
7
+ RadioGroup.__Radio = Radio; // eslint-disable-line deprecation/deprecation
8
8
  export default RadioGroup;
@@ -49,7 +49,7 @@ export type ReadSpeakerPlayerProps = {
49
49
  /** Tooggles CSS float layout */
50
50
  float?: boolean;
51
51
  /** Custom HTML attributes for the wrapper element. */
52
- wrapperProps?: HTMLProps<'div'>;
52
+ wrapperProps?: HTMLProps;
53
53
  };
54
54
  /**
55
55
  * Embeds a ReadSpeaker player in the page
@@ -15,7 +15,7 @@ export const defaultReadSpeakerPlayerTexts = {
15
15
  * @see https://docs.typo3.org/p/readspeaker/readspeaker-services/main/en-us/Configuration/Index.html
16
16
  */
17
17
  export const ReadSpeakerPlayer = (props) => {
18
- const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps = {}, texts, } = props;
18
+ const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps, texts, } = props;
19
19
  const { linkText, linkLabel } = getTexts({ lang: lang.slice(0, 2), texts }, defaultReadSpeakerPlayerTexts);
20
20
  useEffect(() => {
21
21
  var _a, _b;
@@ -50,7 +50,7 @@ export const ReadSpeakerPlayer = (props) => {
50
50
  // or multiple different `customerId`s on the same page.
51
51
  // If you try that, things will be weird and wonky.
52
52
  ]);
53
- return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], wrapperProps.className) }),
53
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], (wrapperProps || {}).className) }),
54
54
  React.createElement("div", { id: "readspeaker_button1", className: "rs_skip rsbtn rs_preserve" },
55
55
  React.createElement("a", { rel: "nofollow", className: "rsbtn_play", accessKey: "L", title: linkLabel || linkText, href: `https://app-eu.readspeaker.com/cgi-bin/rsent?${new URLSearchParams({
56
56
  customerid: customerId,
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  declare const types: {
3
4
  readonly external: 1;
4
5
  readonly document: 1;
@@ -16,6 +17,6 @@ export type RelatedLinksProps = {
16
17
  title?: string;
17
18
  titleTag?: 'h2' | 'h3' | 'h4' | 'h5';
18
19
  links: Array<RelatedLinkItem>;
19
- };
20
+ } & WrapperElmProps;
20
21
  export declare const RelatedLinks: (props: RelatedLinksProps) => JSX.Element | null;
21
22
  export default RelatedLinks;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { modifiedClass } from '@hugsmidjan/qj/classUtils';
2
3
  import { Link } from './_abstract/_Link.js';
3
4
  const types = {
4
5
  external: 1,
@@ -7,12 +8,12 @@ const types = {
7
8
  link: 0,
8
9
  };
9
10
  export const RelatedLinks = (props) => {
10
- const { title, links } = props;
11
+ const { title, links, wrapperProps } = props;
11
12
  if (links.length === 0) {
12
13
  return null;
13
14
  }
14
15
  const TitleTag = props.titleTag || 'h3';
15
- return (React.createElement("div", { className: "RelatedLinks" },
16
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('RelatedLinks', null, (wrapperProps || {}).className) }),
16
17
  title && React.createElement(TitleTag, { className: "RelatedLinks__title" }, title),
17
18
  React.createElement("ul", { className: "RelatedLinks__list" }, links.map(({ href, label, type, target }, i) => {
18
19
  type = type && types[type] ? type : undefined;
package/esm/RowBlock.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
3
  import { BemModifierProps } from './utils/types.js';
4
+ import { WrapperElmProps } from './utils.js';
4
5
  export type RowBlockProps = {
5
6
  /** Float the first RowBlockColumn to the right on larger screens. */
6
7
  right?: boolean;
7
8
  /** Custom **additional** class-name */
8
9
  className?: string;
9
10
  children: ReactNode;
10
- } & BemModifierProps & SeenProp;
11
+ } & BemModifierProps & WrapperElmProps & SeenProp;
11
12
  export declare const RowBlock: (props: RowBlockProps) => JSX.Element;
12
13
  export default RowBlock;
package/esm/RowBlock.js CHANGED
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { modifiedClass } from '@hugsmidjan/qj/classUtils';
3
3
  import { useSeenEffect } from './utils/seenEffect.js';
4
4
  export const RowBlock = (props) => {
5
- const { right, modifier, className, children, startSeen } = props;
5
+ const { right, modifier, className, children, startSeen, wrapperProps } = props;
6
6
  const [ref] = useSeenEffect(startSeen);
7
- return (React.createElement("div", { className: modifiedClass('RowBlock', [modifier, right && 'align--right'], className), ref: ref }, children));
7
+ return (React.createElement("div", Object.assign({}, wrapperProps, { className: modifiedClass('RowBlock', [modifier, right && 'align--right'], className || (wrapperProps || {}).className), ref: ref }), children));
8
8
  };
9
9
  export default RowBlock;