@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
@@ -1,5 +1,5 @@
1
1
  import { SeenProp } from './utils/seenEffect.js';
2
- import { SSRSupportProps } from './utils.js';
2
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
3
3
  export type AccordionListItemProps = {
4
4
  title: string | JSX.Element;
5
5
  content: string | JSX.Element | undefined;
@@ -19,6 +19,6 @@ export type AccordionListProps = {
19
19
  /** Index of those items that should start open (uncontrolled use) */
20
20
  defaultOpen?: Array<number>;
21
21
  wide?: boolean;
22
- } & SSRSupportProps & SeenProp;
22
+ } & WrapperElmProps & SSRSupportProps & SeenProp;
23
23
  export declare const AccordionList: (props: AccordionListProps) => JSX.Element;
24
24
  export default AccordionList;
package/AccordionList.js CHANGED
@@ -18,7 +18,7 @@ const AccordionListItem = (props) => {
18
18
  react_1.default.createElement("div", { id: isBrowser && domid, className: "AccordionList__content", hidden: isBrowser && (!open || itemDisabled) }, content)));
19
19
  };
20
20
  const AccordionList = (props) => {
21
- const { items, ssr, wide, startSeen, defaultOpen } = props;
21
+ const { items, ssr, wide, startSeen, defaultOpen, wrapperProps } = props;
22
22
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
23
23
  const [open, setOpenArray, mode] = (0, utils_js_1.useMixedControlState)(props, 'open', []);
24
24
  const onToggle = (index) => {
@@ -31,7 +31,7 @@ const AccordionList = (props) => {
31
31
  return newOpen;
32
32
  });
33
33
  };
34
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('AccordionList', [wide && 'wide']), ref: ref }, items.map((item, i) => (react_1.default.createElement(AccordionListItem, Object.assign({ key: i }, item, { ssr: ssr, open: open.includes(i), onToggle: () => onToggle(i), defaultOpen: defaultOpen && defaultOpen.includes(i) }))))));
34
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('AccordionList', [wide && 'wide'], (wrapperProps || {}).className), ref: ref }), items.map((item, i) => (react_1.default.createElement(AccordionListItem, Object.assign({ key: i }, item, { ssr: ssr, open: open.includes(i), onToggle: () => onToggle(i), defaultOpen: defaultOpen && defaultOpen.includes(i) }))))));
35
35
  };
36
36
  exports.AccordionList = AccordionList;
37
37
  exports.default = exports.AccordionList;
package/ActionCards.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CardListSummaryProps, TextCardListProps, TextCardProps } from './_abstract/_CardList.js';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
- export type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
3
+ import { WrapperElmProps } from './utils.js';
4
+ export type ActionCardsProps = TextCardListProps & CardListSummaryProps & WrapperElmProps & SeenProp;
4
5
  export type ActionCardsItemProps = TextCardProps;
5
6
  export declare const ActionCards: (props: ActionCardsProps) => JSX.Element;
6
7
  export default ActionCards;
package/ActionCards.js CHANGED
@@ -8,7 +8,7 @@ const seenEffect_js_1 = require("./utils/seenEffect.js");
8
8
  const ActionCards = (props) => {
9
9
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(props.startSeen);
10
10
  return (react_1.default.createElement("div", { className: "ActionCards", ref: ref },
11
- react_1.default.createElement(_CardList_js_1.CardList, Object.assign({}, props, { bemPrefix: "ActionCards" }))));
11
+ react_1.default.createElement(_CardList_js_1.CardList, Object.assign({ bemPrefix: "ActionCards" }, props, { wrapperProps: undefined }))));
12
12
  };
13
13
  exports.ActionCards = ActionCards;
14
14
  exports.default = exports.ActionCards;
package/Alert.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
2
  import { EitherObj } from '@reykjavik/hanna-utils';
3
3
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
4
- import { SSRSupportProps } from './utils.js';
4
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
5
5
  export type AlertI18n = {
6
6
  closeLabel: string;
7
7
  closeLabelLong?: string;
@@ -42,6 +42,6 @@ export type AlertProps = {
42
42
  onClose?(event: MouseEvent): void | boolean;
43
43
  /** Callback that fires after the alert has closed/transitoned out */
44
44
  onClosed?(): void;
45
- }>;
45
+ }> & WrapperElmProps<null, 'role' | 'hidden'>;
46
46
  export declare const Alert: (props: AlertProps) => JSX.Element;
47
47
  export default Alert;
package/Alert.js CHANGED
@@ -10,18 +10,28 @@ const env_js_1 = require("./utils/env.js");
10
10
  const utils_js_1 = require("./utils.js");
11
11
  // FIXME: Eventually import from @reykjavik/hanna-css
12
12
  const AlertCloseTransitionDuration = 400;
13
- const useAutoClosing = (autoClose) => {
13
+ const useAutoClosing = (autoClose, props) => {
14
14
  const [temp, setTemp] = (0, react_1.useState)(0);
15
15
  if (!autoClose) {
16
16
  return { autoClosing: false };
17
17
  }
18
- const thaw = () => setTemp((temp) => temp + 1);
19
- const freeze = () => setTemp((temp) => temp - 1);
18
+ const thaw = (e) => {
19
+ setTemp((temp) => temp + 1);
20
+ const handler = props[e.type.startsWith('blur') ? 'onBlur' : 'onMouseLeave'];
21
+ // @ts-expect-error (Proper fix ends up as too much code for this extreme edge case)
22
+ handler && handler(e);
23
+ };
24
+ const freeze = (e) => {
25
+ setTemp((temp) => temp - 1);
26
+ const handler = props[e.type.startsWith('focus') ? 'onFocus' : 'onMouseEnter'];
27
+ // @ts-expect-error (Resolving ends up as too much code for this extreme edge case)
28
+ handler && handler(e);
29
+ };
20
30
  return {
21
31
  autoClosing: temp === 0,
22
32
  autoClosingProps: Object.assign({ onMouseEnter: freeze, onMouseLeave: thaw, onFocus: freeze, onBlur: thaw }, (env_js_1.isPreact && {
23
- onfocusin: (e) => e.currentTarget !== e.target && freeze(),
24
- onfocusout: (e) => e.currentTarget !== e.target && thaw(),
33
+ onfocusin: (e) => e.currentTarget !== e.target && freeze(e),
34
+ onfocusout: (e) => e.currentTarget !== e.target && thaw(e),
25
35
  })),
26
36
  };
27
37
  };
@@ -37,7 +47,8 @@ exports.alertTypes = {
37
47
  critical: 1,
38
48
  };
39
49
  const Alert = (props) => {
40
- const { type, childrenHTML, children, onClose, closeUrl, closable = !!(onClose || closeUrl != null), ssr, onClosed, } = props;
50
+ const { type, childrenHTML, children, onClose, // eslint-disable-line deprecation/deprecation
51
+ closeUrl, closable = !!(onClose || closeUrl != null), ssr, onClosed, wrapperProps, } = props;
41
52
  const autoClose = Math.max(props.autoClose || 0, 0);
42
53
  const closing = (0, react_1.useRef)();
43
54
  const [open, setOpen] = (0, react_1.useState)(!!ssr);
@@ -50,7 +61,7 @@ const Alert = (props) => {
50
61
  const closeAlert = (0, react_1.useCallback)((event) => {
51
62
  const ret = onClose &&
52
63
  // @ts-expect-error (@deprecated `event` parameter will be removed in v0.11)
53
- onClose(event);
64
+ onClose(event); // eslint-disable-line deprecation/deprecation
54
65
  if (ret !== false) {
55
66
  setOpen(false);
56
67
  if (closing.current) {
@@ -62,7 +73,7 @@ const Alert = (props) => {
62
73
  }, AlertCloseTransitionDuration);
63
74
  }
64
75
  }, [onClose, onClosed]);
65
- const { autoClosing, autoClosingProps } = useAutoClosing(autoClose);
76
+ const { autoClosing, autoClosingProps } = useAutoClosing(autoClose, props);
66
77
  (0, react_1.useEffect)(() => {
67
78
  if (autoClosing) {
68
79
  let autoCloseTimeout;
@@ -81,10 +92,7 @@ const Alert = (props) => {
81
92
  };
82
93
  }
83
94
  }, [closeAlert, autoClosing, autoClose]);
84
- return (react_1.default.createElement("div", Object.assign({ className: (0, classUtils_1.modifiedClass)('Alert', [
85
- !!exports.alertTypes[type] && type,
86
- closable && 'closable',
87
- ]), role: "alert", hidden: !open || undefined }, autoClosingProps),
95
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Alert', [!!exports.alertTypes[type] && type, closable && 'closable'], (wrapperProps || {}).className), role: "alert", hidden: !open || undefined }, autoClosingProps),
88
96
  childrenHTML ? (react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: childrenHTML } })) : (children),
89
97
  ' ',
90
98
  showCloseButton && (react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "Alert__close" }, (closeUrl != null ? { href: closeUrl } : { type: 'button' }), { onClick: (e) => {
package/ArticleCards.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { ImageCardListProps, ImageCardProps } from './_abstract/_CardList.js';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type ArticleCardsItemProps = ImageCardProps;
3
4
  /** @deprecated Use `ArticleCardsItemProps` instead (Remove in v0.11) */
4
5
  export type ArticleCardProps = ArticleCardsItemProps;
5
- export type ArticleCardsProps = Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'>;
6
+ export type ArticleCardsProps = Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'> & {
7
+ size?: 'large' | 'normal';
8
+ } & WrapperElmProps<'ul'>;
6
9
  export declare const ArticleCards: (props: ArticleCardsProps) => JSX.Element;
7
10
  export default ArticleCards;
package/ArticleCards.js CHANGED
@@ -4,6 +4,6 @@ exports.ArticleCards = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _CardList_js_1 = require("./_abstract/_CardList.js");
7
- const ArticleCards = (props) => (react_1.default.createElement(_CardList_js_1.CardList, { bemPrefix: "ArticleCards", standalone: true, cards: props.cards, imgPlaceholder: props.imgPlaceholder || true }));
7
+ const ArticleCards = (props) => (react_1.default.createElement(_CardList_js_1.CardList, { bemPrefix: "ArticleCards", modifier: props.size === 'large' ? 'large' : undefined, standalone: true, cards: props.cards, imgPlaceholder: props.imgPlaceholder || true, wrapperProps: props.wrapperProps }));
8
8
  exports.ArticleCards = ArticleCards;
9
9
  exports.default = exports.ArticleCards;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ArticleCarouselCard = 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 assets_1 = require("@reykjavik/hanna-utils/assets");
8
7
  const _Image_js_1 = require("../_abstract/_Image.js");
9
8
  const _Link_js_1 = require("../_abstract/_Link.js");
@@ -15,7 +14,7 @@ const ArticleCarouselCard = (props) => {
15
14
  return (react_1.default.createElement("div", { className: "ArticleCarouselCard", "data-color": color && constants_js_1.colorFamilies[color], "data-color-theme": !color ? theme && constants_js_1.themeOptions[theme] : undefined },
16
15
  react_1.default.createElement(_Link_js_1.Link, { className: "ArticleCarouselCard__link", href: href, target: target },
17
16
  ' ',
18
- react_1.default.createElement(_Image_js_1.Image, Object.assign({ placeholder: true, className: (0, classUtils_1.modifiedClass)('ArticleCarouselCard__illustration', photo && 'photo') }, imageProps)),
17
+ react_1.default.createElement(_Image_js_1.Image, Object.assign({ bem: "ArticleCarouselCard__illustration", modifier: photo && 'photo', placeholder: true }, imageProps)),
19
18
  react_1.default.createElement("h3", { className: "ArticleCarouselCard__title" }, title),
20
19
  ' '),
21
20
  ' ',
@@ -1,11 +1,11 @@
1
1
  import { ArticleCarouselCardProps, ArticleCarouselImageProps } from './ArticleCarousel/_ArticleCarouselCard.js';
2
2
  import { SeenProp } from './utils/seenEffect.js';
3
- import { SSRSupportProps } from './utils.js';
3
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
4
4
  export type ArticleCarouselProps = {
5
5
  items: Array<ArticleCarouselCardProps>;
6
6
  title?: string;
7
7
  moreLabel?: string;
8
- } & SSRSupportProps & SeenProp;
8
+ } & WrapperElmProps & SSRSupportProps & SeenProp;
9
9
  export type { ArticleCarouselCardProps, ArticleCarouselImageProps };
10
10
  export declare const ArticleCarousel: (props: ArticleCarouselProps) => JSX.Element;
11
11
  export default ArticleCarousel;
@@ -7,7 +7,7 @@ const _AbstractCarousel_js_1 = require("./_abstract/_AbstractCarousel.js");
7
7
  const _ArticleCarouselCard_js_1 = require("./ArticleCarousel/_ArticleCarouselCard.js");
8
8
  const ArticleCarousel = (props) => {
9
9
  const { title, items, moreLabel, ssr, startSeen } = props;
10
- return (react_1.default.createElement(_AbstractCarousel_js_1.AbstractCarousel, { bem: "ArticleCarousel", title: title, items: items, Component: _ArticleCarouselCard_js_1.ArticleCarouselCard, ComponentProps: { moreLabel }, ssr: ssr, startSeen: startSeen }));
10
+ return (react_1.default.createElement(_AbstractCarousel_js_1.AbstractCarousel, { bem: "ArticleCarousel", title: title, items: items, Component: _ArticleCarouselCard_js_1.ArticleCarouselCard, ComponentProps: { moreLabel }, ssr: ssr, startSeen: startSeen, wrapperProps: props.wrapperProps }));
11
11
  };
12
12
  exports.ArticleCarousel = ArticleCarousel;
13
13
  exports.default = exports.ArticleCarousel;
package/ArticleMeta.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { WrapperElmProps } from './utils.js';
1
2
  export type ArticleMetaItem = {
2
3
  label: string;
3
4
  href?: string;
@@ -5,6 +6,6 @@ export type ArticleMetaItem = {
5
6
  export type ArticleMetaProps = {
6
7
  items: Array<ArticleMetaItem>;
7
8
  small?: boolean;
8
- };
9
+ } & WrapperElmProps;
9
10
  export declare const ArticleMeta: (props: ArticleMetaProps) => JSX.Element | null;
10
11
  export default ArticleMeta;
package/ArticleMeta.js CHANGED
@@ -6,11 +6,11 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const _Link_js_1 = require("./_abstract/_Link.js");
8
8
  const ArticleMeta = (props) => {
9
- const { items, small } = props;
9
+ const { items, small, wrapperProps } = props;
10
10
  if (items.length === 0) {
11
11
  return null;
12
12
  }
13
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('ArticleMeta', small && 'small') }, items.map(({ label, href }, i) => (react_1.default.createElement(react_1.Fragment, { key: i },
13
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ArticleMeta', small && 'small', (wrapperProps || {}).className) }), items.map(({ label, href }, i) => (react_1.default.createElement(react_1.Fragment, { key: i },
14
14
  href == null ? (react_1.default.createElement("span", { className: "ArticleMeta__item" },
15
15
  " ",
16
16
  label,
package/Attention.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type AttentionProps = {
3
4
  small?: boolean;
4
5
  children: ReactNode;
5
- };
6
+ } & WrapperElmProps;
6
7
  export declare const Attention: (props: AttentionProps) => JSX.Element;
7
8
  export default Attention;
package/Attention.js CHANGED
@@ -4,6 +4,9 @@ exports.Attention = void 0;
4
4
  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
- const Attention = (props) => (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('Attention', props.small && 'small') }, props.children));
7
+ const Attention = (props) => {
8
+ const { small, children, wrapperProps } = props;
9
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Attention', small && 'small', (wrapperProps || {}).className) }), children));
10
+ };
8
11
  exports.Attention = Attention;
9
12
  exports.default = exports.Attention;
package/BasicTable.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { TableProps } from '@hugsmidjan/react/Table';
2
2
  import { EitherObj } from '@reykjavik/hanna-utils';
3
3
  import { SeenProp } from './utils/seenEffect.js';
4
+ import { MissingWrapperElmProps } from './utils.js';
4
5
  export type BasicTableProps = {
5
6
  compact?: boolean;
6
7
  type?: 'text' | 'number';
@@ -9,6 +10,6 @@ export type BasicTableProps = {
9
10
  fullWidth?: boolean;
10
11
  }, {
11
12
  align?: 'right';
12
- }> & SeenProp & Omit<TableProps, 'className' | 'children'>;
13
+ }> & MissingWrapperElmProps & SeenProp & Omit<TableProps, 'className' | 'children'>;
13
14
  export declare const BasicTable: (props: BasicTableProps) => JSX.Element;
14
15
  export default BasicTable;
package/BgBox.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EffectProp, SeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type BgBoxProps = {
4
5
  className?: string;
5
6
  children: ReactNode;
6
- } & SeenProp & EffectProp;
7
+ } & WrapperElmProps & SeenProp & EffectProp;
7
8
  export declare const BgBox: (props: BgBoxProps) => JSX.Element;
8
9
  export default BgBox;
package/BgBox.js CHANGED
@@ -6,9 +6,11 @@ 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 BgBox = (props) => {
9
- const { className, children, effectType, startSeen } = props;
9
+ const { className, children, effectType, startSeen, wrapperProps } = props;
10
10
  const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
11
- return (react_1.default.createElement("div", Object.assign({ className: (0, classUtils_1.modifiedClass)('BgBox', undefined, className), ref: ref }, (0, seenEffect_js_1.getEffectAttr)(effectType)), children));
11
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('BgBox', undefined,
12
+ // Prefer `className` over `wrapperProps.className`
13
+ className || (wrapperProps || {}).className), ref: ref }, (0, seenEffect_js_1.getEffectAttr)(effectType)), children));
12
14
  };
13
15
  exports.BgBox = BgBox;
14
16
  exports.default = exports.BgBox;
package/Bling.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BlingType } from '@reykjavik/hanna-utils/assets';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  declare const colors: {
3
4
  tertiary: boolean;
4
5
  secondary: boolean;
@@ -76,6 +77,6 @@ export type BlingProps = {
76
77
  type?: undefined;
77
78
  /** Custom SVG URL to load (use sparingly) */
78
79
  blingUrl: string;
79
- });
80
+ }) & WrapperElmProps<null, 'data-bling-type' | 'data-bling-image'>;
80
81
  export declare const Bling: (props: BlingProps) => JSX.Element;
81
82
  export default Bling;
package/Bling.js CHANGED
@@ -34,16 +34,18 @@ const parentOffset = {
34
34
  bottom: true,
35
35
  };
36
36
  const Bling = (props) => {
37
- const { align, vertical, color, overlay, type, blingUrl, parent, className } = props;
37
+ const { align, vertical, color, overlay, type, blingUrl, parent, className, wrapperProps, } = props;
38
38
  const imageUrl = type ? (0, assets_1.getBlingUrl)(type) : blingUrl;
39
39
  const inlineSvg = (0, useGetSVGtext_js_1.useGetSVGtext)(imageUrl);
40
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('Bling', [
40
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Bling', [
41
41
  'align--' + (align && align in aligns ? align : 'left'),
42
42
  vertical && vertical in valigns && 'vertical--' + vertical,
43
43
  color && color in colors && 'color--' + color,
44
44
  parent && parent in parentOffset && 'parent--' + parent,
45
45
  overlay && 'overlay',
46
- ], className), "data-bling-type": type, "data-bling-image": !type ? blingUrl : undefined, dangerouslySetInnerHTML: inlineSvg && { __html: inlineSvg.code } }));
46
+ ],
47
+ // Prefer `className` over `wrapperProps.className`
48
+ className || (wrapperProps || {}).className), "data-bling-type": type, "data-bling-image": !type ? blingUrl : undefined, dangerouslySetInnerHTML: inlineSvg && { __html: inlineSvg.code } })));
47
49
  };
48
50
  exports.Bling = Bling;
49
51
  exports.default = exports.Bling;
package/BlockBreak.js CHANGED
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  /*
7
7
  TODO: Add story
8
8
  */
9
+ // NOTE: This component is too low-level to justify `wrapperProps`
9
10
  const BlockBreak = () => react_1.default.createElement("div", { className: "BlockBreak" });
10
11
  exports.BlockBreak = BlockBreak;
11
12
  exports.default = exports.BlockBreak;
package/BreadCrumbs.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type BreadCrumb = {
3
4
  href?: string;
4
5
  label: string;
@@ -11,6 +12,6 @@ export type BreadCrumbsProps = {
11
12
  title?: string;
12
13
  lang?: string;
13
14
  trail: BreadCrumbTrail;
14
- };
15
+ } & WrapperElmProps<null, 'aria-label'>;
15
16
  export declare const BreadCrumbs: (props: BreadCrumbsProps) => JSX.Element | null;
16
17
  export default BreadCrumbs;
package/BreadCrumbs.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BreadCrumbs = exports.defaultBreadCrumbsTexts = 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 i18n_1 = require("@reykjavik/hanna-utils/i18n");
7
8
  const _Link_js_1 = require("./_abstract/_Link.js");
8
9
  exports.defaultBreadCrumbsTexts = {
@@ -15,14 +16,14 @@ const BreadCrumbs__item = (props) => {
15
16
  return link.href != null ? (react_1.default.createElement(_Link_js_1.Link, { className: "BreadCrumbs__item", href: link.href, "aria-current": current || undefined }, link.label)) : (react_1.default.createElement("span", { className: "BreadCrumbs__item", "aria-current": current || undefined }, link.label));
16
17
  };
17
18
  const BreadCrumbs = (props) => {
18
- const { trail, title, lang } = props;
19
+ const { trail, title, lang, wrapperProps } = props;
19
20
  const texts = (0, i18n_1.getTexts)({ texts: title ? { title } : undefined, lang }, exports.defaultBreadCrumbsTexts);
20
21
  if (trail.length === 0) {
21
22
  return null;
22
23
  }
23
24
  const ancestors = trail.slice(0, -1);
24
25
  const current = trail[trail.length - 1];
25
- return (react_1.default.createElement("nav", { className: "BreadCrumbs", "aria-label": texts.title },
26
+ return (react_1.default.createElement("nav", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('BreadCrumbs', null, (wrapperProps || {}).className), "aria-label": texts.title }),
26
27
  react_1.default.createElement("span", { className: "BreadCrumbs__title" },
27
28
  texts.title,
28
29
  ":"),
package/ButtonBack.js CHANGED
@@ -4,6 +4,8 @@ exports.ButtonBack = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _Button_js_1 = require("./_abstract/_Button.js");
7
+ // NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
8
+ // `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
7
9
  const ButtonBack = (props) => (react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "ButtonBack" }, props)));
8
10
  exports.ButtonBack = ButtonBack;
9
11
  exports.default = exports.ButtonBack;
package/ButtonBar.d.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
+ import { WrapperElmProps } from './utils.js';
2
3
  export type ButtonBarProps = {
3
4
  align?: 'right';
4
5
  children: ReactNode;
5
- };
6
+ } & WrapperElmProps;
6
7
  export declare const ButtonBar: {
7
8
  (props: ButtonBarProps): JSX.Element;
8
9
  /** A Splitter token to use directly inside <ButtonBar/> wrappers */
9
- Split(): JSX.Element;
10
+ Split({ wrapperProps }: WrapperElmProps): JSX.Element;
10
11
  };
11
12
  /**
12
13
  * @deprecated Prefer using `ButtonBar.Split` instead.
13
14
  *
14
15
  * (This export token is only to aid discovery.)
15
16
  */
16
- export declare const ButtonBar__split: () => JSX.Element;
17
+ export declare const ButtonBar__split: ({ wrapperProps }: WrapperElmProps) => JSX.Element;
17
18
  export default ButtonBar;
package/ButtonBar.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 ButtonBar = (props) => {
8
- const { align, children } = props;
9
- return (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('ButtonBar', align === 'right' && 'align--right') }, children));
8
+ const { align, children, wrapperProps } = props;
9
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ButtonBar', align === 'right' && 'align--right', (wrapperProps || {}).className) }), children));
10
10
  };
11
11
  exports.ButtonBar = ButtonBar;
12
12
  /** A Splitter token to use directly inside <ButtonBar/> wrappers */
13
- exports.ButtonBar.Split = () => react_1.default.createElement("span", { className: "ButtonBar__split" });
13
+ exports.ButtonBar.Split = ({ wrapperProps }) => (react_1.default.createElement("span", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ButtonBar__split', null, (wrapperProps || {}).className) })));
14
14
  /**
15
15
  * @deprecated Prefer using `ButtonBar.Split` instead.
16
16
  *
package/ButtonPrimary.js CHANGED
@@ -4,6 +4,8 @@ exports.ButtonPrimary = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _Button_js_1 = require("./_abstract/_Button.js");
7
+ // NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
8
+ // `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
7
9
  const ButtonPrimary = (props) => (react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "ButtonPrimary" }, props)));
8
10
  exports.ButtonPrimary = ButtonPrimary;
9
11
  exports.default = exports.ButtonPrimary;
@@ -4,6 +4,8 @@ exports.ButtonSecondary = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _Button_js_1 = require("./_abstract/_Button.js");
7
+ // NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
8
+ // `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
7
9
  const ButtonSecondary = (props) => react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "ButtonSecondary" }, props));
8
10
  exports.ButtonSecondary = ButtonSecondary;
9
11
  exports.default = exports.ButtonSecondary;
package/ButtonTertiary.js CHANGED
@@ -12,6 +12,8 @@ const icons = {
12
12
  none: 'none',
13
13
  'go-back': 'go-back',
14
14
  };
15
+ // NOTE: As a `_abstract/_Button.tsx`-derived component, all `<button/>` and
16
+ // `<a/>` props are allowed directly, so adding `wrapperProps` makes no sense.
15
17
  const ButtonTertiary = (props) => {
16
18
  const { size = 'normal', icon = 'none' } = props;
17
19
  return react_1.default.createElement(_Button_js_1.Button, Object.assign({ bem: "ButtonTertiary" }, props, { size: sizes[size], icon: icons[icon] }));
package/CHANGELOG.md CHANGED
@@ -4,12 +4,25 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
- ## 0.10.97 – 0.10.99
7
+ ## 0.10.101
8
+
9
+ _2023-08-28_
10
+
11
+ - feat: Add prop `wrapperProps` to almost all components — excluding a few
12
+ low-level ones that already accept raw HTML props directly (e.g. most
13
+ button-like compoments).
14
+ _(Exeptions: `BasicTable`, `Modal` and `CarouselStepper`. They'll also get a
15
+ `wrapperProps` prop in a near-future release.)_
16
+ - feat: Deprecate prop, `wrapperRef` on all `FormField` related components
17
+ - fix: Export `CheckboxButtonProps` from `CheckboxButton`, deprecate old type
18
+
19
+ ## 0.10.97 – 0.10.100
8
20
 
9
21
  _2023-08-22_
10
22
 
11
23
  - feat: Add prop `meta` to items of `ActionCards`
12
24
  - feat: Add prop `summary` to items of `ArticleCards` and `ImageCards`
25
+ - feat: Add prop `size="large"` to `ArticleCards`
13
26
  - feat: Allow `JSX.Element` as item `meta` for accepting `*Cards` components
14
27
  - feat: Allow `JSX.Element` as item `summary` for all `*Cards` components
15
28
  - feat: Expand `MainMenuItemList` to allow components as custom
@@ -1,4 +1,5 @@
1
1
  import { Props } from '@hugsmidjan/react/CarouselStepper';
2
- type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
2
+ import { MissingWrapperElmProps } from './utils.js';
3
+ type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'> & MissingWrapperElmProps;
3
4
  export declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
4
5
  export default CarouselStepper;
package/CenterColumn.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EffectProp, SeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type CenterColumnProps = {
4
5
  children: ReactNode;
5
- } & SeenProp & EffectProp;
6
+ } & SeenProp & WrapperElmProps & EffectProp;
6
7
  export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
7
8
  export default CenterColumn;
package/CenterColumn.js CHANGED
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CenterColumn = 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 SeenEffect_js_1 = tslib_1.__importDefault(require("./SeenEffect.js"));
7
8
  const CenterColumn = (props) => {
8
- const { children, startSeen, effectType } = props;
9
- return startSeen == null ? (react_1.default.createElement("div", { className: "CenterColumn" }, children)) : (react_1.default.createElement(SeenEffect_js_1.default, { className: "CenterColumn", startSeen: startSeen, effectType: effectType }, children));
9
+ const { children, startSeen, effectType, wrapperProps } = props;
10
+ const className = (0, classUtils_1.modifiedClass)('CenterColumn', null, (wrapperProps || {}).className);
11
+ return startSeen == null ? (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: className }), children)) : (react_1.default.createElement(SeenEffect_js_1.default, Object.assign({}, wrapperProps, { className: className, startSeen: startSeen, effectType: effectType }), children));
10
12
  };
11
13
  exports.CenterColumn = CenterColumn;
12
14
  exports.default = exports.CenterColumn;
@@ -1,4 +1,6 @@
1
1
  import { TogglerInputProps } from './_abstract/_TogglerInput.js';
2
- export type CheckboxProps = TogglerInputProps;
3
- export declare const CheckboxButton: (props: CheckboxProps) => JSX.Element;
2
+ /** @deprecated Use `CheckboxButtonProps` instead (Will be removed in v0.11) */
3
+ export type CheckboxProps = CheckboxButtonProps;
4
+ export type CheckboxButtonProps = TogglerInputProps;
5
+ export declare const CheckboxButton: (props: CheckboxButtonProps) => JSX.Element;
4
6
  export default CheckboxButton;
@@ -6,10 +6,10 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _TogglerGroupField_js_1 = require("./_abstract/_TogglerGroupField.js");
7
7
  const CheckboxButton_js_1 = tslib_1.__importDefault(require("./CheckboxButton.js"));
8
8
  const CheckboxButtonsGroup = (props) => {
9
- if (props.layout) {
9
+ if (props.layout /* eslint-disable-line deprecation/deprecation */) {
10
10
  console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
11
11
  }
12
- if (props.columns) {
12
+ if (props.columns /* eslint-disable-line deprecation/deprecation */) {
13
13
  console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
14
14
  }
15
15
  return (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton_js_1.default })));
package/CityBlock.d.ts CHANGED
@@ -4,6 +4,7 @@ import { BlockItem } from './_abstract/_Block.js';
4
4
  import { ImageProps } from './_abstract/_Image.js';
5
5
  import { SeenProp } from './utils/seenEffect.js';
6
6
  import { Alignment } from './constants.js';
7
+ import { WrapperElmProps } from './utils.js';
7
8
  declare const types: {
8
9
  largebox: boolean;
9
10
  largeimage: boolean;
@@ -16,6 +17,6 @@ export type CityBlockProps = {
16
17
  illustration: Illustration;
17
18
  }, {
18
19
  image: ImageProps;
19
- }> & SeenProp;
20
+ }> & WrapperElmProps & SeenProp;
20
21
  export declare const CityBlock: (props: CityBlockProps) => JSX.Element;
21
22
  export default CityBlock;
package/CityBlock.js CHANGED
@@ -17,7 +17,7 @@ const CityBlock = (props) => {
17
17
  const imageProps = props.illustration != null
18
18
  ? { src: (0, assets_1.getIllustrationUrl)(props.illustration) }
19
19
  : props.image;
20
- return (react_1.default.createElement(_Block_js_1.Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, startSeen: props.startSeen }));
20
+ return (react_1.default.createElement(_Block_js_1.Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, wrapperProps: props.wrapperProps, startSeen: props.startSeen }));
21
21
  };
22
22
  exports.CityBlock = CityBlock;
23
23
  exports.default = exports.CityBlock;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
3
- import { SSRSupportProps } from './utils.js';
3
+ import { SSRSupportProps, WrapperElmProps } from './utils.js';
4
4
  export type ContactBubbleI18n = {
5
5
  lang?: string;
6
6
  openBtn: string;
@@ -47,7 +47,7 @@ export type ContactBubbleProps = {
47
47
  alwaysShow?: boolean;
48
48
  texts?: ContactBubbleI18n;
49
49
  lang?: string;
50
- } & SSRSupportProps & ({
50
+ } & SSRSupportProps & WrapperElmProps & ({
51
51
  open?: boolean;
52
52
  onToggle: (isOpen: boolean) => void;
53
53
  } | {