@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
package/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/NameCard.js CHANGED
@@ -40,7 +40,8 @@ const defaultTexts = {
40
40
  },
41
41
  };
42
42
  const NameCard = (props) => {
43
- const { name, location, hours, aboutText, available = props.vacancy, updated } = props;
43
+ const { name, location, hours, aboutText, available = props.vacancy, // eslint-disable-line deprecation/deprecation
44
+ updated, wrapperProps, } = props;
44
45
  const renderMeta = () => {
45
46
  if (available == null && !updated) {
46
47
  return;
@@ -50,8 +51,9 @@ const NameCard = (props) => {
50
51
  return (react_1.default.createElement("div", { className: "NameCard__meta" },
51
52
  available != null && (react_1.default.createElement("span", { className: (0, classUtils_1.modifiedClass)('NameCard__availability', available && 'available') },
52
53
  available
53
- ? availableLabel || texts.vacancyLabel
54
- : unavailableLabel || texts.noVacancyLabel,
54
+ ? availableLabel || texts.vacancyLabel // eslint-disable-line deprecation/deprecation
55
+ : unavailableLabel || texts.noVacancyLabel // eslint-disable-line deprecation/deprecation
56
+ ,
55
57
  ' ')),
56
58
  updated != null && (react_1.default.createElement("span", { className: "NameCard__updated" },
57
59
  updatedLabel,
@@ -60,10 +62,12 @@ const NameCard = (props) => {
60
62
  };
61
63
  let contactInfo = props.contactInfo;
62
64
  if (!contactInfo) {
63
- contactInfo = _telToContactInfo(props.tel) || [];
65
+ contactInfo = _telToContactInfo(props.tel) || []; // eslint-disable-line deprecation/deprecation
64
66
  }
65
67
  // Remove/map @deprecated contactinfo items
66
- const cleanContactInfo = contactInfo.map((item) => {
68
+ const cleanContactInfo = contactInfo.map(
69
+ // eslint-disable-next-line deprecation/deprecation
70
+ (item) => {
67
71
  if (typeof item !== 'string' && 'value' in item) {
68
72
  return {
69
73
  href: item.href,
@@ -73,7 +77,7 @@ const NameCard = (props) => {
73
77
  }
74
78
  return item;
75
79
  });
76
- return (react_1.default.createElement("div", { className: "NameCard" },
80
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NameCard', null, (wrapperProps || {}).className) }),
77
81
  react_1.default.createElement("div", { className: "NameCard__name" }, name),
78
82
  contactInfo.length > 0 && (react_1.default.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (react_1.default.createElement(react_1.default.Fragment, null,
79
83
  typeof item === 'string' ? (react_1.default.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (react_1.default.createElement(_Button_js_1.Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
package/NameCards.d.ts CHANGED
@@ -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/NameCards.js CHANGED
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NameCards = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
+ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
6
7
  const NameCard_js_1 = tslib_1.__importDefault(require("./NameCard.js"));
7
8
  const NameCards = (props) => {
8
- const { items } = props;
9
- return (react_1.default.createElement("div", { className: "NameCards" }, items.map((item, i) => (react_1.default.createElement(NameCard_js_1.default, Object.assign({ key: i }, item))))));
9
+ const { items, wrapperProps } = props;
10
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NameCards', null, (wrapperProps || {}).className) }), items.map((item, i) => (react_1.default.createElement(NameCard_js_1.default, Object.assign({ key: i }, item))))));
10
11
  };
11
12
  exports.NameCards = NameCards;
12
13
  exports.default = exports.NameCards;
package/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/NewsHero.js CHANGED
@@ -76,16 +76,16 @@ const blingOptions = {
76
76
  ],
77
77
  };
78
78
  const NewsHero = (props) => {
79
- const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
79
+ const { title, sharing = true, meta, summary, image, blingType, startSeen, wrapperProps, } = props;
80
80
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
81
81
  const blings = (blingType && blingOptions[blingType]) || (0, hanna_utils_1.getStableRandomItem)(blingOptions, title);
82
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('NewsHero', [!image && 'align--right']), ref: ref },
82
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('NewsHero', [!image && 'align--right'], (wrapperProps || {}).className), ref: ref }),
83
83
  react_1.default.createElement("div", { className: "NewsHero__content" },
84
84
  react_1.default.createElement("h1", { className: "NewsHero__title" }, title),
85
85
  meta && react_1.default.createElement("span", { className: "NewsHero__meta" }, meta),
86
86
  react_1.default.createElement("div", { className: "NewsHero__summary" }, summary),
87
87
  sharing === true ? react_1.default.createElement(ShareButtons_js_1.default, null) : sharing && sharing()),
88
- image ? (react_1.default.createElement(_Image_js_1.Image, Object.assign({ className: "NewsHero__image" }, image))) : (react_1.default.createElement(_Blings_js_1.Blings, { blings: blings }))));
88
+ image ? react_1.default.createElement(_Image_js_1.Image, Object.assign({ bem: "NewsHero__image" }, image)) : react_1.default.createElement(_Blings_js_1.Blings, { blings: blings })));
89
89
  };
90
90
  exports.NewsHero = NewsHero;
91
91
  exports.default = exports.NewsHero;
package/PageFilter.d.ts CHANGED
@@ -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/PageFilter.js CHANGED
@@ -7,9 +7,9 @@ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const seenEffect_js_1 = require("./utils/seenEffect.js");
8
8
  const Footnote_js_1 = tslib_1.__importDefault(require("./Footnote.js"));
9
9
  const PageFilter = (props) => {
10
- const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
10
+ const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen, wrapperProps, } = props;
11
11
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
12
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('PageFilter', underlap && 'underlap'), ref: ref },
12
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageFilter', underlap && 'underlap', (wrapperProps || {}).className), ref: ref }),
13
13
  react_1.default.createElement("h2", { className: "PageFilter__title" }, title),
14
14
  summary && react_1.default.createElement("div", { className: "PageFilter__summary" }, summary),
15
15
  react_1.default.createElement("div", { className: "PageFilter__filters" }, filters || children),
package/PageHeading.d.ts CHANGED
@@ -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;
package/PageHeading.js CHANGED
@@ -6,12 +6,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const seenEffect_js_1 = require("./utils/seenEffect.js");
8
8
  const PageHeading = (props) => {
9
- const { Tag = 'h1', align, small, children, startSeen } = props;
9
+ const { Tag = 'h1', align, small, children, startSeen, wrapperProps } = props;
10
10
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
11
- return (react_1.default.createElement(Tag, { className: (0, classUtils_1.modifiedClass)('PageHeading', [
12
- small && 'small',
13
- align === 'right' && 'align--' + align,
14
- ]), ref: ref }, children));
11
+ return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageHeading', [small && 'small', align === 'right' && 'align--' + align], (wrapperProps || {}).className), ref: ref }), children));
15
12
  };
16
13
  exports.PageHeading = PageHeading;
17
14
  exports.default = exports.PageHeading;
package/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/Picture.js CHANGED
@@ -3,11 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Picture = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
6
  const _Image_js_1 = require("./_abstract/_Image.js");
8
- const Picture = (props) => {
9
- const { contain, className } = props;
10
- return (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { className: (0, classUtils_1.modifiedClass)('Picture', contain && 'contain', className) })));
11
- };
7
+ const Picture = (props) => (react_1.default.createElement(_Image_js_1.Image, Object.assign({}, props, { bem: "Picture", modifier: props.contain && 'contain' })));
12
8
  exports.Picture = Picture;
13
9
  exports.default = exports.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;
@@ -5,11 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const ProcessOverview = (props) => {
8
- const { title, items, attention, transparent, narrow } = props;
9
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('ProcessOverview', [
10
- transparent && 'transparent',
11
- narrow && 'narrow',
12
- ]) },
8
+ const { title, items, attention, transparent, narrow, wrapperProps } = props;
9
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ProcessOverview', [transparent && 'transparent', narrow && 'narrow'], (wrapperProps || {}).className) }),
13
10
  react_1.default.createElement("h2", { className: "ProcessOverview__title" }, title),
14
11
  items.map(({ title, content }, i) => {
15
12
  return (react_1.default.createElement("div", { key: i, className: "ProcessOverview__item" },
@@ -7,10 +7,10 @@ const _TogglerGroupField_js_1 = require("./_abstract/_TogglerGroupField.js");
7
7
  const _TogglerInput_js_1 = require("./_abstract/_TogglerInput.js");
8
8
  const RadioButton = (props) => (react_1.default.createElement(_TogglerInput_js_1.TogglerInput, Object.assign({}, props, { bem: "RadioButton", type: "radio", innerWrap: true })));
9
9
  const RadioButtonsGroup = (props) => {
10
- if (props.layout) {
10
+ if (props.layout /* eslint-disable-line deprecation/deprecation */) {
11
11
  console.warn('`RadioButtonsGroupProps.layout` is deprecated.');
12
12
  }
13
- if (props.columns) {
13
+ if (props.columns /* eslint-disable-line deprecation/deprecation */) {
14
14
  console.warn('`RadioButtonsGroupProps.columns` is deprecated.');
15
15
  }
16
16
  return (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioButtonsGroup", Toggler: RadioButton, isRadio: true })));
package/RadioGroup.js CHANGED
@@ -9,5 +9,5 @@ const Radio = (props) => react_1.default.createElement(_TogglerInput_js_1.Toggle
9
9
  const RadioGroup = (props) => (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioGroup", modifier: props.layout, isRadio: true, Toggler: Radio })));
10
10
  exports.RadioGroup = RadioGroup;
11
11
  /** @deprecated Exposed for testing purposes only. This may disappear at any time. */
12
- exports.RadioGroup.__Radio = Radio;
12
+ exports.RadioGroup.__Radio = Radio; // eslint-disable-line deprecation/deprecation
13
13
  exports.default = exports.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
@@ -19,7 +19,7 @@ exports.defaultReadSpeakerPlayerTexts = {
19
19
  * @see https://docs.typo3.org/p/readspeaker/readspeaker-services/main/en-us/Configuration/Index.html
20
20
  */
21
21
  const ReadSpeakerPlayer = (props) => {
22
- const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps = {}, texts, } = props;
22
+ const { align, float, customerId = '11315', lang = '', voice = /^is(?:_is)?$/i.test(lang) ? 'is_dora' : '', readId = '', readClass = readId ? '' : 'Layout__main', wrapperProps, texts, } = props;
23
23
  const { linkText, linkLabel } = (0, i18n_1.getTexts)({ lang: lang.slice(0, 2), texts }, exports.defaultReadSpeakerPlayerTexts);
24
24
  (0, react_1.useEffect)(() => {
25
25
  var _a, _b;
@@ -54,7 +54,7 @@ const ReadSpeakerPlayer = (props) => {
54
54
  // or multiple different `customerId`s on the same page.
55
55
  // If you try that, things will be weird and wonky.
56
56
  ]);
57
- return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], wrapperProps.className) }),
57
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ReadSpeakerPlayer', [align === 'right' && `align-${align}`, float && 'float'], (wrapperProps || {}).className) }),
58
58
  react_1.default.createElement("div", { id: "readspeaker_button1", className: "rs_skip rsbtn rs_preserve" },
59
59
  react_1.default.createElement("a", { rel: "nofollow", className: "rsbtn_play", accessKey: "L", title: linkLabel || linkText, href: `https://app-eu.readspeaker.com/cgi-bin/rsent?${new URLSearchParams({
60
60
  customerid: customerId,
package/RelatedLinks.d.ts CHANGED
@@ -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;
package/RelatedLinks.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RelatedLinks = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
+ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
6
7
  const _Link_js_1 = require("./_abstract/_Link.js");
7
8
  const types = {
8
9
  external: 1,
@@ -11,12 +12,12 @@ const types = {
11
12
  link: 0,
12
13
  };
13
14
  const RelatedLinks = (props) => {
14
- const { title, links } = props;
15
+ const { title, links, wrapperProps } = props;
15
16
  if (links.length === 0) {
16
17
  return null;
17
18
  }
18
19
  const TitleTag = props.titleTag || 'h3';
19
- return (react_1.default.createElement("div", { className: "RelatedLinks" },
20
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RelatedLinks', null, (wrapperProps || {}).className) }),
20
21
  title && react_1.default.createElement(TitleTag, { className: "RelatedLinks__title" }, title),
21
22
  react_1.default.createElement("ul", { className: "RelatedLinks__list" }, links.map(({ href, label, type, target }, i) => {
22
23
  type = type && types[type] ? type : undefined;
package/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/RowBlock.js CHANGED
@@ -6,9 +6,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const seenEffect_js_1 = require("./utils/seenEffect.js");
8
8
  const RowBlock = (props) => {
9
- const { right, modifier, className, children, startSeen } = props;
9
+ const { right, modifier, className, children, startSeen, wrapperProps } = props;
10
10
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
11
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('RowBlock', [modifier, right && 'align--right'], className), ref: ref }, children));
11
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RowBlock', [modifier, right && 'align--right'], className || (wrapperProps || {}).className), ref: ref }), children));
12
12
  };
13
13
  exports.RowBlock = RowBlock;
14
14
  exports.default = exports.RowBlock;
@@ -1,8 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type RowBlockColumnProps = {
3
4
  background?: boolean | 'primary';
4
5
  narrow?: boolean;
5
6
  children: ReactNode;
6
- };
7
+ } & WrapperElmProps;
7
8
  export declare const RowBlockColumn: (props: RowBlockColumnProps) => JSX.Element;
8
9
  export default RowBlockColumn;
package/RowBlockColumn.js CHANGED
@@ -5,12 +5,12 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const RowBlockColumn = (props) => {
8
- const { background, narrow, children } = props;
9
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('RowBlockColumn', [
8
+ const { background, narrow, children, wrapperProps } = props;
9
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('RowBlockColumn', [
10
10
  narrow && 'narrow',
11
11
  background && 'background',
12
12
  background === 'primary' && 'background--primary',
13
- ]) }, children));
13
+ ], (wrapperProps || {}).className) }), children));
14
14
  };
15
15
  exports.RowBlockColumn = RowBlockColumn;
16
16
  exports.default = exports.RowBlockColumn;
package/SearchInput.d.ts CHANGED
@@ -1,18 +1,12 @@
1
1
  import { RefObject } from 'react';
2
2
  import { FormFieldWrappingProps } from './FormField.js';
3
- type InputElmProps = JSX.IntrinsicElements['input'];
4
- type BaseProps<Type extends {
5
- type?: string;
6
- }, InputProps extends object> = {
3
+ export type SearchInputProps = FormFieldWrappingProps & {
7
4
  small?: boolean;
8
- children?: never;
5
+ type?: string;
9
6
  onButtonClick?: () => void;
10
7
  buttonText?: string;
11
8
  inputRef?: RefObject<HTMLInputElement>;
12
9
  buttonRef?: RefObject<HTMLButtonElement>;
13
- } & Type & FormFieldWrappingProps & InputProps;
14
- export type SearchInputProps = BaseProps<{
15
- type?: 'text';
16
- }, InputElmProps>;
10
+ } & JSX.IntrinsicElements['input'];
17
11
  export declare const SearchInput: (props: SearchInputProps) => JSX.Element;
18
12
  export default SearchInput;
package/SearchInput.js CHANGED
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SearchInput = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
- const FormField_js_1 = tslib_1.__importDefault(require("./FormField.js"));
6
+ const FormField_js_1 = tslib_1.__importStar(require("./FormField.js"));
8
7
  const SearchInput = (props) => {
9
8
  var _a;
10
- const { className, label, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, onChange, small, onButtonClick, buttonText = 'Leita', ssr } = props, inputElementProps = tslib_1.__rest(props, ["className", "label", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "onChange", "small", "onButtonClick", "buttonText", "ssr"]);
9
+ const _b = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, onButtonClick, buttonText = 'Leita', fieldWrapperProps } = _b, inputElementProps = tslib_1.__rest(_b, ["onChange", "onButtonClick", "buttonText", "fieldWrapperProps"]);
11
10
  const { value, defaultValue, placeholder } = inputElementProps;
12
11
  const [hasValue, setHasValue] = (0, react_1.useState)(undefined);
13
12
  const filled = !!((_a = value !== null && value !== void 0 ? value : hasValue) !== null && _a !== void 0 ? _a : !!defaultValue);
@@ -18,10 +17,10 @@ const SearchInput = (props) => {
18
17
  setHasValue(!!e.target.value);
19
18
  onChange && onChange(e);
20
19
  };
21
- return (react_1.default.createElement(FormField_js_1.default, { className: (0, classUtils_1.modifiedClass)('SearchInput', [], className), ssr: ssr, small: small, label: label, empty: empty, filled: filled, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
20
+ return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: "SearchInput", empty: empty, filled: filled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
22
21
  react_1.default.createElement("input", Object.assign({ className: "SearchInput__input", onChange: _onChange }, inputProps, inputElementProps, { ref: props.inputRef })),
23
22
  ' ',
24
- onButtonClick && (react_1.default.createElement("button", { className: "SearchInput__button", type: "button", onClick: onButtonClick, title: buttonText, ref: props.buttonRef, disabled: disabled || readOnly }, buttonText)))) }));
23
+ onButtonClick && (react_1.default.createElement("button", { className: "SearchInput__button", type: "button", onClick: onButtonClick, title: buttonText, ref: props.buttonRef, disabled: props.disabled || props.readOnly }, buttonText)))) })));
25
24
  };
26
25
  exports.SearchInput = SearchInput;
27
26
  exports.default = exports.SearchInput;
@@ -13,7 +13,7 @@ const SearchResultsItem = (props) => {
13
13
  react_1.default.createElement(_Link_js_1.Link, { className: bem + '__link', href: href },
14
14
  react_1.default.createElement("h3", { className: bem + '__title' }, title),
15
15
  metaArr.length > 0 && (react_1.default.createElement("span", { className: bem + '__meta' }, metaArr.map((item, i) => typeof item === 'function' ? item() : item && react_1.default.createElement("span", { key: i }, item)))),
16
- highlight && image && react_1.default.createElement(_Image_js_1.Image, { className: bem + '__image', src: image }),
16
+ highlight && image && react_1.default.createElement(_Image_js_1.Image, { bem: bem + '__image', src: image }),
17
17
  react_1.default.createElement("div", { className: bem + '__summary', dangerouslySetInnerHTML: { __html: summary } }))));
18
18
  };
19
19
  exports.SearchResultsItem = SearchResultsItem;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SearchResultsItemProps } from './SearchResults/_SearchResultsItem.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type SearchReesultI18n = {
4
5
  lang: string;
5
6
  loadQueryTitle: string;
@@ -32,6 +33,6 @@ export type SearchResultsProps = {
32
33
  loadMore?: () => void;
33
34
  texts?: SearchReesultI18n;
34
35
  lang?: string;
35
- };
36
+ } & WrapperElmProps;
36
37
  export declare const SearchResults: (props: SearchResultsProps) => JSX.Element;
37
38
  export default SearchResults;
package/SearchResults.js CHANGED
@@ -98,10 +98,10 @@ const renderLoadMore = (props, texts) => {
98
98
  };
99
99
  // TODO: add plural translation thingy for result string
100
100
  const SearchResults = (props) => {
101
- const { filters, activeFilterIdx, setFilter, status, errorText } = props;
101
+ const { filters, activeFilterIdx, setFilter, status, errorText, wrapperProps } = props;
102
102
  const texts = (0, i18n_1.getTexts)(props, defaultTexts);
103
103
  const domid = (0, hooks_1.useDomid)();
104
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('SearchResults', status !== 'results' && status) },
104
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('SearchResults', status !== 'results' && status, (wrapperProps || {}).className) }),
105
105
  renderTitle(props, texts),
106
106
  react_1.default.createElement(SearchResults_Tabs, { domid: domid, filters: filters, activeIdx: activeFilterIdx, setFilter: setFilter, lang: texts.lang }),
107
107
  react_1.default.createElement("div", { className: "SearchResults__results", id: domid },
package/SeenEffect.js CHANGED
@@ -9,6 +9,8 @@ const _SeenEffect = (props) => {
9
9
  const [ref] = (0, seenEffect_js_1.useSeenEffect)();
10
10
  return react_1.default.createElement(Tag, Object.assign({}, tagProps, { ref: ref }, (0, seenEffect_js_1.getEffectAttr)(effectType)));
11
11
  };
12
+ // NOTE: As this component already accepts all `<div/>` props directly,
13
+ // it makes little sense to add support for `wrapperProps` on top.
12
14
  const SeenEffect = (props) => {
13
15
  const _a = props, { Tag = 'div', effectType, startSeen } = _a, tagProps = tslib_1.__rest(_a, ["Tag", "effectType", "startSeen"]);
14
16
  const addEffects = (effectType || '') !== 'none' || startSeen !== true;
package/Selectbox.js CHANGED
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Selectbox = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
6
  const Selectbox_1 = tslib_1.__importDefault(require("@hugsmidjan/react/Selectbox"));
8
- const FormField_js_1 = tslib_1.__importDefault(require("./FormField.js"));
7
+ const FormField_js_1 = tslib_1.__importStar(require("./FormField.js"));
9
8
  const getValue = (opt) => {
10
9
  const val = typeof opt === 'object' ? opt.value : opt;
11
10
  return typeof val === 'number' ? String(val) : val;
12
11
  };
13
12
  const Selectbox = (props) => {
14
- const { className, label, assistText, hideLabel, disabled, readOnly, reqText, invalid, errorMessage, required, id, ssr, onChange, small } = props, selectProps = tslib_1.__rest(props, ["className", "label", "assistText", "hideLabel", "disabled", "readOnly", "reqText", "invalid", "errorMessage", "required", "id", "ssr", "onChange", "small"]);
13
+ const _a = (0, FormField_js_1.groupFormFieldWrapperProps)(props), { onChange, fieldWrapperProps } = _a, selectProps = tslib_1.__rest(_a, ["onChange", "fieldWrapperProps"]);
15
14
  const { value, defaultValue, placeholder, options } = selectProps;
16
15
  const _selectRef = (0, react_1.useRef)(null);
17
16
  const selectRef = selectProps.selectRef || _selectRef;
@@ -35,7 +34,7 @@ const Selectbox = (props) => {
35
34
  setIsEmpty(!((_a = selectElm.selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.text));
36
35
  onChange && onChange(e);
37
36
  };
38
- return (react_1.default.createElement(FormField_js_1.default, { className: (0, classUtils_1.modifiedClass)('Selectbox', null, className), ssr: ssr, small: small, label: label, empty: isEmpty, filled: isFilled, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement(Selectbox_1.default, Object.assign({ bem: className.input, ssr: ssr, onChange: _onChange }, inputProps, addFocusProps(selectProps), { selectRef: selectRef }))) }));
37
+ return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: "Selectbox", empty: isEmpty, filled: isFilled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => (react_1.default.createElement(Selectbox_1.default, Object.assign({ bem: className.input, ssr: props.ssr, onChange: _onChange }, inputProps, addFocusProps(selectProps), { selectRef: selectRef }))) })));
39
38
  };
40
39
  exports.Selectbox = Selectbox;
41
40
  // /** @deprecated Use named export instead (The default export will be removed in v0.11+) */
package/ShareButtons.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ShareButtonI18n, ShareButtonPlatforms } from '@reykjavik/hanna-utils/shareButtonsUtils';
2
- import { SSRSupportProps } from './utils.js';
2
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
3
3
  export type ShareButtonsProps = {
4
4
  texts?: Readonly<ShareButtonI18n>;
5
5
  lang?: string;
6
- } & SSRSupportProps & Partial<Record<ShareButtonPlatforms, boolean>>;
6
+ } & SSRSupportProps & WrapperElmProps<null, 'aria-label'> & Partial<Record<ShareButtonPlatforms, boolean>>;
7
7
  export declare const ShareButtons: (props: ShareButtonsProps) => JSX.Element | null;
8
8
  export default ShareButtons;
package/ShareButtons.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ShareButtons = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
+ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
6
7
  const i18n_1 = require("@reykjavik/hanna-utils/i18n");
7
8
  const shareButtonsUtils_1 = require("@reykjavik/hanna-utils/shareButtonsUtils");
8
9
  const _Link_js_1 = require("./_abstract/_Link.js");
@@ -24,7 +25,7 @@ const ShareButtons__item = (props) => {
24
25
  react_1.default.createElement(_Link_js_1.Link, { className: 'ShareButtons__link ShareButtons__link--' + type, href: href, title: buttonText, rel: "noopener noreferrer", target: popup ? '_blank' : undefined, onClick: popup ? shareButtonsUtils_1.openInPopup : undefined }, buttonText)));
25
26
  };
26
27
  const ShareButtons = (props) => {
27
- const { texts, lang, ssr, facebook = true, twitter = true, linkedin, email, } = props;
28
+ const { texts, lang, ssr, facebook = true, twitter = true, linkedin, email, wrapperProps, } = props;
28
29
  const [docMeta, setDocMeta] = (0, react_1.useState)();
29
30
  const href = docLoc.href; // assign to local variable to silence `react-hooks/exhaustive-deps`
30
31
  (0, react_1.useEffect)(() => {
@@ -43,9 +44,10 @@ const ShareButtons = (props) => {
43
44
  (docMeta && (shareButtonsUtils_1.shareButtonTexts[docMeta.lang] || shareButtonsUtils_1.shareButtonTexts[i18n_1.DEFAULT_LANG])) ||
44
45
  {};
45
46
  const { label, buttonLabel, emailSubject } = txt;
47
+ const className = (0, classUtils_1.modifiedClass)('ShareButtons', null, (wrapperProps || {}).className);
46
48
  if (!docMeta || ssr === 'ssr-only') {
47
49
  // Generate SSR markup for hanna-sprinkles to pick up on.
48
- return (react_1.default.createElement("div", { className: "ShareButtons", "data-button-types": generateTypeList(facebook, twitter, linkedin, email), "data-label": label, "data-buttonlabel": buttonLabel, "data-emailsubject": emailSubject || undefined }));
50
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: className, "data-button-types": generateTypeList(facebook, twitter, linkedin, email), "data-label": label, "data-buttonlabel": buttonLabel, "data-emailsubject": emailSubject || undefined })));
49
51
  }
50
52
  const showTypes = {
51
53
  facebook,
@@ -53,7 +55,7 @@ const ShareButtons = (props) => {
53
55
  linkedin,
54
56
  email,
55
57
  };
56
- return (react_1.default.createElement("div", { className: "ShareButtons", "aria-label": label, "data-sprinkled": "true" },
58
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: className, "aria-label": label, "data-sprinkled": "true" }),
57
59
  label && react_1.default.createElement("strong", { className: "ShareButtons__label" }, label),
58
60
  react_1.default.createElement("ul", { className: "ShareButtons__list" }, shareButtonsUtils_1.shareButtonTypes.map((type) => showTypes[type] && (react_1.default.createElement(ShareButtons__item, { key: type, type: type, label: buttonLabel || '', href: docMeta.hrefs[type] }))))));
59
61
  };
package/Sharpie.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  declare const colors: {
3
4
  green: number;
4
5
  red: number;
@@ -18,6 +19,6 @@ export type SharpieProps = {
18
19
  color: SharpieColor;
19
20
  tag?: SharpieTag;
20
21
  children: ReactNode;
21
- };
22
+ } & WrapperElmProps;
22
23
  export declare const Sharpie: (props: SharpieProps) => JSX.Element;
23
24
  export default Sharpie;
package/Sharpie.js CHANGED
@@ -18,10 +18,10 @@ const tags = {
18
18
  s: 1,
19
19
  };
20
20
  const Sharpie = (props) => {
21
- const { color, tag, children } = props;
21
+ const { color, tag, children, wrapperProps } = props;
22
22
  const colorModifier = colors[color] ? color : 'green';
23
23
  const Tag = tag && tags[tag] ? tag : 'span';
24
- return react_1.default.createElement(Tag, { className: (0, classUtils_1.modifiedClass)('Sharpie', colorModifier) }, children);
24
+ return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Sharpie', colorModifier, (wrapperProps || {}).className) }), children));
25
25
  };
26
26
  exports.Sharpie = Sharpie;
27
27
  exports.default = exports.Sharpie;