@reykjavik/hanna-react 0.10.100 → 0.10.102

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 (387) hide show
  1. package/AccordionList.d.ts +3 -3
  2. package/AccordionList.js +2 -4
  3. package/ActionCards.d.ts +3 -2
  4. package/ActionCards.js +4 -4
  5. package/Alert.d.ts +2 -2
  6. package/Alert.js +20 -12
  7. package/ArticleCards.d.ts +2 -1
  8. package/ArticleCards.js +1 -1
  9. package/ArticleCarousel/_ArticleCarouselCard.js +1 -2
  10. package/ArticleCarousel.d.ts +3 -3
  11. package/ArticleCarousel.js +2 -2
  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 +3 -2
  17. package/BasicTable.js +2 -4
  18. package/BgBox.d.ts +3 -2
  19. package/BgBox.js +4 -4
  20. package/Bling.d.ts +2 -1
  21. package/Bling.js +5 -3
  22. package/BlockBreak.js +1 -0
  23. package/BreadCrumbs.d.ts +2 -1
  24. package/BreadCrumbs.js +3 -2
  25. package/ButtonBack.js +2 -0
  26. package/ButtonBar.d.ts +4 -3
  27. package/ButtonBar.js +3 -3
  28. package/ButtonPrimary.js +2 -0
  29. package/ButtonSecondary.js +2 -0
  30. package/ButtonTertiary.js +2 -0
  31. package/CHANGELOG.md +28 -0
  32. package/CarouselStepper.d.ts +10 -2
  33. package/CarouselStepper.js +14 -2
  34. package/CenterColumn.d.ts +3 -2
  35. package/CenterColumn.js +4 -4
  36. package/CheckboxButton.d.ts +4 -2
  37. package/CheckboxButtonsGroup.js +2 -2
  38. package/CityBlock.d.ts +3 -2
  39. package/CityBlock.js +1 -1
  40. package/ContactBubble.d.ts +3 -3
  41. package/ContactBubble.js +5 -4
  42. package/ContentArticle.d.ts +3 -2
  43. package/ContentArticle.js +4 -5
  44. package/ContentImage.d.ts +2 -1
  45. package/ContentImage.js +4 -3
  46. package/Datepicker.js +7 -7
  47. package/ExtraLinks.d.ts +3 -2
  48. package/ExtraLinks.js +4 -4
  49. package/FeatureList.d.ts +3 -2
  50. package/FeatureList.js +3 -4
  51. package/FieldGroup.d.ts +2 -1
  52. package/FieldGroup.js +4 -2
  53. package/FileInput.d.ts +2 -2
  54. package/FileInput.js +10 -5
  55. package/Foonote.js +3 -4
  56. package/Footnote.d.ts +2 -1
  57. package/Footnote.js +2 -1
  58. package/Form.js +4 -5
  59. package/FormField.d.ts +25 -5
  60. package/FormField.js +32 -7
  61. package/Gallery/_GalleryItem.js +2 -2
  62. package/Gallery/_GalleryModalItem.js +1 -1
  63. package/Gallery.d.ts +3 -3
  64. package/Gallery.js +6 -5
  65. package/GridBlocks.d.ts +3 -6
  66. package/GridBlocks.js +3 -5
  67. package/Heading.d.ts +2 -1
  68. package/Heading.js +3 -3
  69. package/HeroBlock.d.ts +3 -2
  70. package/HeroBlock.js +4 -5
  71. package/IframeBlock.d.ts +9 -4
  72. package/IframeBlock.js +13 -12
  73. package/Illustration.d.ts +2 -1
  74. package/Illustration.js +1 -1
  75. package/ImageCards.d.ts +3 -2
  76. package/ImageCards.js +2 -4
  77. package/InfoBlock.d.ts +3 -2
  78. package/InfoBlock.js +3 -4
  79. package/InfoHero.d.ts +2 -1
  80. package/InfoHero.js +3 -3
  81. package/IslandBlock.d.ts +3 -2
  82. package/IslandBlock.js +2 -2
  83. package/IslandPageBlock.d.ts +3 -2
  84. package/IslandPageBlock.js +2 -2
  85. package/LabeledTextBlock.d.ts +3 -2
  86. package/LabeledTextBlock.js +2 -4
  87. package/Layout.d.ts +2 -2
  88. package/Layout.js +3 -3
  89. package/MainMenu/_Auxiliary.d.ts +4 -2
  90. package/MainMenu/_Auxiliary.js +2 -2
  91. package/MainMenu/_PrimaryPanel.d.ts +11 -3
  92. package/MainMenu/_PrimaryPanel.js +5 -6
  93. package/MainMenu.d.ts +6 -5
  94. package/MainMenu.js +4 -3
  95. package/MiniMetrics.d.ts +3 -2
  96. package/MiniMetrics.js +3 -3
  97. package/Modal.d.ts +2 -1
  98. package/Multiselect.d.ts +14 -7
  99. package/Multiselect.js +17 -13
  100. package/NameCard.d.ts +2 -1
  101. package/NameCard.js +10 -6
  102. package/NameCards.d.ts +3 -2
  103. package/NameCards.js +3 -2
  104. package/NewsHero.d.ts +3 -2
  105. package/NewsHero.js +3 -5
  106. package/PageFilter.d.ts +3 -2
  107. package/PageFilter.js +2 -4
  108. package/PageHeading.d.ts +3 -2
  109. package/PageHeading.js +2 -7
  110. package/Pagination.d.ts +31 -0
  111. package/Pagination.js +104 -0
  112. package/Picture.d.ts +2 -1
  113. package/Picture.js +1 -5
  114. package/ProcessOverview.d.ts +2 -1
  115. package/ProcessOverview.js +2 -5
  116. package/RadioButtonsGroup.js +2 -2
  117. package/RadioGroup.js +1 -1
  118. package/ReadSpeakerPlayer.d.ts +1 -1
  119. package/ReadSpeakerPlayer.js +2 -2
  120. package/RelatedLinks.d.ts +2 -1
  121. package/RelatedLinks.js +3 -2
  122. package/RowBlock.d.ts +4 -3
  123. package/RowBlock.js +2 -4
  124. package/RowBlockColumn.d.ts +2 -1
  125. package/RowBlockColumn.js +3 -3
  126. package/SearchInput.d.ts +3 -9
  127. package/SearchInput.js +4 -5
  128. package/SearchResults/_SearchResultsItem.js +1 -1
  129. package/SearchResults.d.ts +2 -1
  130. package/SearchResults.js +2 -2
  131. package/SeenEffect.js +2 -0
  132. package/Selectbox.js +3 -4
  133. package/ShareButtons.d.ts +2 -2
  134. package/ShareButtons.js +5 -3
  135. package/Sharpie.d.ts +2 -1
  136. package/Sharpie.js +2 -2
  137. package/SiteSearchAutocomplete.d.ts +2 -1
  138. package/SiteSearchAutocomplete.js +4 -4
  139. package/SiteSearchCurtain.js +2 -0
  140. package/SiteSearchInput.d.ts +5 -8
  141. package/SiteSearchInput.js +4 -4
  142. package/Skeleton.d.ts +42 -6
  143. package/Skeleton.js +29 -20
  144. package/SubHeading.d.ts +3 -2
  145. package/SubHeading.js +3 -5
  146. package/Tabs.d.ts +3 -3
  147. package/Tabs.js +6 -8
  148. package/TagPill.js +2 -0
  149. package/TextBlock.d.ts +3 -2
  150. package/TextBlock.js +3 -5
  151. package/TextButton.js +2 -0
  152. package/TextInput.d.ts +2 -2
  153. package/TextInput.js +3 -4
  154. package/Tooltip.d.ts +2 -1
  155. package/Tooltip.js +28 -15
  156. package/VSpacer.d.ts +2 -1
  157. package/VSpacer.js +3 -7
  158. package/VerticalTabsTOC.d.ts +1 -1
  159. package/VerticalTabsTOC.js +1 -1
  160. package/WizardLayout.d.ts +2 -2
  161. package/WizardLayout.js +4 -3
  162. package/WizardLayoutClose.js +2 -0
  163. package/WizardStepper.d.ts +2 -1
  164. package/WizardStepper.js +2 -2
  165. package/_abstract/_AbstractCarousel.d.ts +3 -3
  166. package/_abstract/_AbstractCarousel.js +6 -5
  167. package/_abstract/_Block.d.ts +5 -4
  168. package/_abstract/_Block.js +3 -5
  169. package/_abstract/_Button.js +4 -1
  170. package/_abstract/_CardList.d.ts +2 -1
  171. package/_abstract/_CardList.js +5 -3
  172. package/_abstract/_Image.d.ts +6 -3
  173. package/_abstract/_Image.js +11 -4
  174. package/_abstract/_Link.d.ts +2 -3
  175. package/_abstract/_Link.js +2 -3
  176. package/_abstract/_Quote.d.ts +2 -1
  177. package/_abstract/_Quote.js +3 -2
  178. package/_abstract/_TogglerGroup.js +1 -1
  179. package/_abstract/_TogglerGroupField.js +5 -5
  180. package/_abstract/_TogglerInput.d.ts +2 -2
  181. package/_abstract/_TogglerInput.js +4 -2
  182. package/assets.d.ts +2 -1
  183. package/assets.js +3 -1
  184. package/constants.d.ts +5 -4
  185. package/esm/AccordionList.d.ts +3 -3
  186. package/esm/AccordionList.js +3 -5
  187. package/esm/ActionCards.d.ts +3 -2
  188. package/esm/ActionCards.js +4 -4
  189. package/esm/Alert.d.ts +2 -2
  190. package/esm/Alert.js +21 -13
  191. package/esm/ArticleCards.d.ts +2 -1
  192. package/esm/ArticleCards.js +1 -1
  193. package/esm/ArticleCarousel/_ArticleCarouselCard.js +1 -2
  194. package/esm/ArticleCarousel.d.ts +3 -3
  195. package/esm/ArticleCarousel.js +2 -2
  196. package/esm/ArticleMeta.d.ts +2 -1
  197. package/esm/ArticleMeta.js +2 -2
  198. package/esm/Attention.d.ts +2 -1
  199. package/esm/Attention.js +4 -1
  200. package/esm/BasicTable.d.ts +3 -2
  201. package/esm/BasicTable.js +2 -4
  202. package/esm/BgBox.d.ts +3 -2
  203. package/esm/BgBox.js +4 -4
  204. package/esm/Bling.d.ts +2 -1
  205. package/esm/Bling.js +5 -3
  206. package/esm/BlockBreak.js +1 -0
  207. package/esm/BreadCrumbs.d.ts +2 -1
  208. package/esm/BreadCrumbs.js +3 -2
  209. package/esm/ButtonBack.js +2 -0
  210. package/esm/ButtonBar.d.ts +4 -3
  211. package/esm/ButtonBar.js +3 -3
  212. package/esm/ButtonPrimary.js +2 -0
  213. package/esm/ButtonSecondary.js +2 -0
  214. package/esm/ButtonTertiary.js +2 -0
  215. package/esm/CarouselStepper.d.ts +10 -2
  216. package/esm/CarouselStepper.js +14 -2
  217. package/esm/CenterColumn.d.ts +3 -2
  218. package/esm/CenterColumn.js +4 -4
  219. package/esm/CheckboxButton.d.ts +4 -2
  220. package/esm/CheckboxButtonsGroup.js +2 -2
  221. package/esm/CityBlock.d.ts +3 -2
  222. package/esm/CityBlock.js +1 -1
  223. package/esm/ContactBubble.d.ts +3 -3
  224. package/esm/ContactBubble.js +5 -4
  225. package/esm/ContentArticle.d.ts +3 -2
  226. package/esm/ContentArticle.js +4 -5
  227. package/esm/ContentImage.d.ts +2 -1
  228. package/esm/ContentImage.js +4 -3
  229. package/esm/Datepicker.js +8 -8
  230. package/esm/ExtraLinks.d.ts +3 -2
  231. package/esm/ExtraLinks.js +4 -4
  232. package/esm/FeatureList.d.ts +3 -2
  233. package/esm/FeatureList.js +3 -4
  234. package/esm/FieldGroup.d.ts +2 -1
  235. package/esm/FieldGroup.js +4 -2
  236. package/esm/FileInput.d.ts +2 -2
  237. package/esm/FileInput.js +10 -5
  238. package/esm/Foonote.js +2 -2
  239. package/esm/Footnote.d.ts +2 -1
  240. package/esm/Footnote.js +2 -1
  241. package/esm/Form.js +5 -5
  242. package/esm/FormField.d.ts +25 -5
  243. package/esm/FormField.js +30 -6
  244. package/esm/Gallery/_GalleryItem.js +2 -2
  245. package/esm/Gallery/_GalleryModalItem.js +1 -1
  246. package/esm/Gallery.d.ts +3 -3
  247. package/esm/Gallery.js +7 -6
  248. package/esm/GridBlocks.d.ts +3 -6
  249. package/esm/GridBlocks.js +3 -5
  250. package/esm/Heading.d.ts +2 -1
  251. package/esm/Heading.js +3 -3
  252. package/esm/HeroBlock.d.ts +3 -2
  253. package/esm/HeroBlock.js +4 -5
  254. package/esm/IframeBlock.d.ts +9 -4
  255. package/esm/IframeBlock.js +13 -12
  256. package/esm/Illustration.d.ts +2 -1
  257. package/esm/Illustration.js +1 -1
  258. package/esm/ImageCards.d.ts +3 -2
  259. package/esm/ImageCards.js +2 -4
  260. package/esm/InfoBlock.d.ts +3 -2
  261. package/esm/InfoBlock.js +3 -4
  262. package/esm/InfoHero.d.ts +2 -1
  263. package/esm/InfoHero.js +3 -3
  264. package/esm/IslandBlock.d.ts +3 -2
  265. package/esm/IslandBlock.js +2 -2
  266. package/esm/IslandPageBlock.d.ts +3 -2
  267. package/esm/IslandPageBlock.js +2 -2
  268. package/esm/LabeledTextBlock.d.ts +3 -2
  269. package/esm/LabeledTextBlock.js +2 -4
  270. package/esm/Layout.d.ts +2 -2
  271. package/esm/Layout.js +3 -3
  272. package/esm/MainMenu/_Auxiliary.d.ts +4 -2
  273. package/esm/MainMenu/_Auxiliary.js +2 -2
  274. package/esm/MainMenu/_PrimaryPanel.d.ts +11 -3
  275. package/esm/MainMenu/_PrimaryPanel.js +5 -6
  276. package/esm/MainMenu.d.ts +6 -5
  277. package/esm/MainMenu.js +4 -3
  278. package/esm/MiniMetrics.d.ts +3 -2
  279. package/esm/MiniMetrics.js +3 -3
  280. package/esm/Modal.d.ts +2 -1
  281. package/esm/Multiselect.d.ts +14 -7
  282. package/esm/Multiselect.js +17 -13
  283. package/esm/NameCard.d.ts +2 -1
  284. package/esm/NameCard.js +10 -6
  285. package/esm/NameCards.d.ts +3 -2
  286. package/esm/NameCards.js +3 -2
  287. package/esm/NewsHero.d.ts +3 -2
  288. package/esm/NewsHero.js +3 -5
  289. package/esm/PageFilter.d.ts +3 -2
  290. package/esm/PageFilter.js +2 -4
  291. package/esm/PageHeading.d.ts +3 -2
  292. package/esm/PageHeading.js +2 -7
  293. package/esm/Pagination.d.ts +31 -0
  294. package/esm/Pagination.js +100 -0
  295. package/esm/Picture.d.ts +2 -1
  296. package/esm/Picture.js +1 -5
  297. package/esm/ProcessOverview.d.ts +2 -1
  298. package/esm/ProcessOverview.js +2 -5
  299. package/esm/RadioButtonsGroup.js +2 -2
  300. package/esm/RadioGroup.js +1 -1
  301. package/esm/ReadSpeakerPlayer.d.ts +1 -1
  302. package/esm/ReadSpeakerPlayer.js +2 -2
  303. package/esm/RelatedLinks.d.ts +2 -1
  304. package/esm/RelatedLinks.js +3 -2
  305. package/esm/RowBlock.d.ts +4 -3
  306. package/esm/RowBlock.js +2 -4
  307. package/esm/RowBlockColumn.d.ts +2 -1
  308. package/esm/RowBlockColumn.js +3 -3
  309. package/esm/SearchInput.d.ts +3 -9
  310. package/esm/SearchInput.js +4 -5
  311. package/esm/SearchResults/_SearchResultsItem.js +1 -1
  312. package/esm/SearchResults.d.ts +2 -1
  313. package/esm/SearchResults.js +2 -2
  314. package/esm/SeenEffect.js +2 -0
  315. package/esm/Selectbox.js +3 -4
  316. package/esm/ShareButtons.d.ts +2 -2
  317. package/esm/ShareButtons.js +5 -3
  318. package/esm/Sharpie.d.ts +2 -1
  319. package/esm/Sharpie.js +2 -2
  320. package/esm/SiteSearchAutocomplete.d.ts +2 -1
  321. package/esm/SiteSearchAutocomplete.js +4 -4
  322. package/esm/SiteSearchCurtain.js +2 -0
  323. package/esm/SiteSearchInput.d.ts +5 -8
  324. package/esm/SiteSearchInput.js +4 -4
  325. package/esm/Skeleton.d.ts +42 -6
  326. package/esm/Skeleton.js +29 -20
  327. package/esm/SubHeading.d.ts +3 -2
  328. package/esm/SubHeading.js +3 -5
  329. package/esm/Tabs.d.ts +3 -3
  330. package/esm/Tabs.js +6 -8
  331. package/esm/TagPill.js +2 -0
  332. package/esm/TextBlock.d.ts +3 -2
  333. package/esm/TextBlock.js +3 -5
  334. package/esm/TextButton.js +2 -0
  335. package/esm/TextInput.d.ts +2 -2
  336. package/esm/TextInput.js +3 -4
  337. package/esm/Tooltip.d.ts +2 -1
  338. package/esm/Tooltip.js +28 -15
  339. package/esm/VSpacer.d.ts +2 -1
  340. package/esm/VSpacer.js +3 -7
  341. package/esm/VerticalTabsTOC.d.ts +1 -1
  342. package/esm/VerticalTabsTOC.js +1 -1
  343. package/esm/WizardLayout.d.ts +2 -2
  344. package/esm/WizardLayout.js +4 -3
  345. package/esm/WizardLayoutClose.js +2 -0
  346. package/esm/WizardStepper.d.ts +2 -1
  347. package/esm/WizardStepper.js +2 -2
  348. package/esm/_abstract/_AbstractCarousel.d.ts +3 -3
  349. package/esm/_abstract/_AbstractCarousel.js +6 -5
  350. package/esm/_abstract/_Block.d.ts +5 -4
  351. package/esm/_abstract/_Block.js +3 -5
  352. package/esm/_abstract/_Button.js +4 -1
  353. package/esm/_abstract/_CardList.d.ts +2 -1
  354. package/esm/_abstract/_CardList.js +5 -3
  355. package/esm/_abstract/_Image.d.ts +6 -3
  356. package/esm/_abstract/_Image.js +12 -5
  357. package/esm/_abstract/_Link.d.ts +2 -3
  358. package/esm/_abstract/_Link.js +2 -3
  359. package/esm/_abstract/_Quote.d.ts +2 -1
  360. package/esm/_abstract/_Quote.js +3 -2
  361. package/esm/_abstract/_TogglerGroup.js +1 -1
  362. package/esm/_abstract/_TogglerGroupField.js +5 -5
  363. package/esm/_abstract/_TogglerInput.d.ts +2 -2
  364. package/esm/_abstract/_TogglerInput.js +4 -2
  365. package/esm/assets.d.ts +2 -1
  366. package/esm/assets.js +3 -1
  367. package/esm/constants.d.ts +5 -4
  368. package/esm/constants.js +1 -1
  369. package/esm/index.d.ts +1 -0
  370. package/esm/utils/Pagination.privates.d.ts +6 -0
  371. package/esm/utils/Pagination.privates.js +30 -0
  372. package/esm/utils/seenEffect.d.ts +11 -1
  373. package/esm/utils/seenEffect.js +4 -2
  374. package/esm/utils/useDidChange.d.ts +1 -1
  375. package/esm/utils/useDidChange.js +1 -1
  376. package/esm/utils/useMixedControlState.d.ts +4 -4
  377. package/esm/utils.d.ts +26 -3
  378. package/index.d.ts +1 -0
  379. package/package.json +9 -4
  380. package/utils/Pagination.privates.d.ts +6 -0
  381. package/utils/Pagination.privates.js +35 -0
  382. package/utils/seenEffect.d.ts +11 -1
  383. package/utils/seenEffect.js +4 -2
  384. package/utils/useDidChange.d.ts +1 -1
  385. package/utils/useDidChange.js +1 -1
  386. package/utils/useMixedControlState.d.ts +4 -4
  387. package/utils.d.ts +26 -3
@@ -1,5 +1,5 @@
1
- import { SeenProp } from './utils/seenEffect.js';
2
- import { SSRSupportProps } from './utils.js';
1
+ import { DeprecatedSeenProp } from './utils/seenEffect.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 & DeprecatedSeenProp;
23
23
  export declare const AccordionList: (props: AccordionListProps) => JSX.Element;
24
24
  export default AccordionList;
package/AccordionList.js CHANGED
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const hooks_1 = require("@hugsmidjan/react/hooks");
8
- const seenEffect_js_1 = require("./utils/seenEffect.js");
9
8
  const utils_js_1 = require("./utils.js");
10
9
  const AccordionListItem = (props) => {
11
10
  const { title, content, id, disabled = false, ssr, open, onToggle } = props;
@@ -18,8 +17,7 @@ const AccordionListItem = (props) => {
18
17
  react_1.default.createElement("div", { id: isBrowser && domid, className: "AccordionList__content", hidden: isBrowser && (!open || itemDisabled) }, content)));
19
18
  };
20
19
  const AccordionList = (props) => {
21
- const { items, ssr, wide, startSeen, defaultOpen } = props;
22
- const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
20
+ const { items, ssr, wide, defaultOpen, wrapperProps } = props;
23
21
  const [open, setOpenArray, mode] = (0, utils_js_1.useMixedControlState)(props, 'open', []);
24
22
  const onToggle = (index) => {
25
23
  setOpenArray((prevOpen) => {
@@ -31,7 +29,7 @@ const AccordionList = (props) => {
31
29
  return newOpen;
32
30
  });
33
31
  };
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) }))))));
32
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('AccordionList', [wide && 'wide'], (wrapperProps || {}).className) }), 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
33
  };
36
34
  exports.AccordionList = AccordionList;
37
35
  exports.default = exports.AccordionList;
package/ActionCards.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CardListSummaryProps, TextCardListProps, TextCardProps } from './_abstract/_CardList.js';
2
- import { SeenProp } from './utils/seenEffect.js';
3
- export type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
2
+ import { DeprecatedSeenProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
4
+ export type ActionCardsProps = TextCardListProps & CardListSummaryProps & WrapperElmProps & DeprecatedSeenProp;
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
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionCards = 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 _CardList_js_1 = require("./_abstract/_CardList.js");
7
- const seenEffect_js_1 = require("./utils/seenEffect.js");
8
8
  const ActionCards = (props) => {
9
- const [ref] = (0, seenEffect_js_1.useSeenEffect)(props.startSeen);
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" }))));
9
+ const { wrapperProps } = props;
10
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('ActionCards', null, (wrapperProps || {}).className) }),
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,9 +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
6
  export type ArticleCardsProps = Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'> & {
6
7
  size?: 'large' | 'normal';
7
- };
8
+ } & WrapperElmProps<'ul'>;
8
9
  export declare const ArticleCards: (props: ArticleCardsProps) => JSX.Element;
9
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", modifier: props.size === 'large' ? 'large' : undefined, 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
- import { SeenProp } from './utils/seenEffect.js';
3
- import { SSRSupportProps } from './utils.js';
2
+ import { DeprecatedSeenProp } from './utils/seenEffect.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 & DeprecatedSeenProp;
9
9
  export type { ArticleCarouselCardProps, ArticleCarouselImageProps };
10
10
  export declare const ArticleCarousel: (props: ArticleCarouselProps) => JSX.Element;
11
11
  export default ArticleCarousel;
@@ -6,8 +6,8 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _AbstractCarousel_js_1 = require("./_abstract/_AbstractCarousel.js");
7
7
  const _ArticleCarouselCard_js_1 = require("./ArticleCarousel/_ArticleCarouselCard.js");
8
8
  const ArticleCarousel = (props) => {
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 }));
9
+ const { title, items, moreLabel, ssr } = 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, 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
- import { SeenProp } from './utils/seenEffect.js';
3
+ import { DeprecatedSeenProp } 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 & DeprecatedSeenProp & Omit<TableProps, 'className' | 'children'>;
13
14
  export declare const BasicTable: (props: BasicTableProps) => JSX.Element;
14
15
  export default BasicTable;
package/BasicTable.js CHANGED
@@ -6,20 +6,18 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const Table_1 = tslib_1.__importDefault(require("@hugsmidjan/react/Table"));
8
8
  const TableWrapper_1 = tslib_1.__importDefault(require("@hugsmidjan/react/TableWrapper"));
9
- const seenEffect_js_1 = require("./utils/seenEffect.js");
10
9
  const BasicTable = (props) => {
11
- const { cols, caption, thead, tfoot, align, fullWidth, startSeen } = props;
10
+ const { cols, caption, thead, tfoot, align, fullWidth } = props;
12
11
  const tbodyProps = props.tbodies
13
12
  ? { tbodies: props.tbodies }
14
13
  : { tbody: props.tbody || [] };
15
14
  const modifier = props.modifier;
16
- const [ref] = (0, seenEffect_js_1.useSeenEffect)(startSeen);
17
15
  return (react_1.default.createElement(TableWrapper_1.default, { modifier: [
18
16
  'BasicTable',
19
17
  modifier && 'BasicTable--' + modifier,
20
18
  fullWidth && 'BasicTable--fullwidth',
21
19
  align === 'right' && !fullWidth && 'BasicTable--align--' + align,
22
- ], wrapperRef: ref },
20
+ ] },
23
21
  react_1.default.createElement(Table_1.default, Object.assign({ className: (0, classUtils_1.modifiedClass)('BasicTable', [
24
22
  props.compact && 'compact',
25
23
  modifier && modifier,
package/BgBox.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- import { EffectProp, SeenProp } from './utils/seenEffect.js';
2
+ import { DeprecatedSeenProp, EffectProp } 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 & DeprecatedSeenProp & EffectProp;
7
8
  export declare const BgBox: (props: BgBoxProps) => JSX.Element;
8
9
  export default BgBox;
package/BgBox.js CHANGED
@@ -4,11 +4,11 @@ exports.BgBox = 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 seenEffect_js_1 = require("./utils/seenEffect.js");
8
7
  const BgBox = (props) => {
9
- const { className, children, effectType, startSeen } = props;
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));
8
+ const { className, children, effectType, wrapperProps } = props;
9
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('BgBox', undefined,
10
+ // Prefer `className` over `wrapperProps.className`
11
+ className || (wrapperProps || {}).className) }), children));
12
12
  };
13
13
  exports.BgBox = BgBox;
14
14
  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,6 +4,34 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.102
8
+
9
+ _2023-09-04_
10
+
11
+ - feat: Add component `Pagination`
12
+ - `MegaPanelItem` type:
13
+ - feat: add prop `Content` for custom `*Panel__item` children
14
+ - feat: add prop `modifier`, similar to `MainMenuItem.modifier`
15
+ - feat: Export `MegaPanelItemList` from `MainMenu`
16
+ - feat: Expand `MainMenuItem.modifier` to accept falsy and array values
17
+ - feat: Add props `wrapperProps` to `CarouselStepper`
18
+ - feat: Remove defeault/implicit seen-effect styling from all
19
+ components(except `SeenEffect`, `BgBox` and `CenterColumn`) — flag
20
+ `startSeen` prop as deprecated.
21
+ - fix: Export type `MultiselectOption`, deprecate `MultiSelectOption`
22
+
23
+ ## 0.10.101
24
+
25
+ _2023-08-28_
26
+
27
+ - feat: Add prop `wrapperProps` to almost all components — excluding a few
28
+ low-level ones that already accept raw HTML props directly (e.g. most
29
+ button-like compoments).
30
+ _(Exeptions: `BasicTable`, `Modal` and `CarouselStepper`. They'll also get a
31
+ `wrapperProps` prop in a near-future release.)_
32
+ - feat: Deprecate prop, `wrapperRef` on all `FormField` related components
33
+ - fix: Export `CheckboxButtonProps` from `CheckboxButton`, deprecate old type
34
+
7
35
  ## 0.10.97 – 0.10.100
8
36
 
9
37
  _2023-08-22_
@@ -1,4 +1,12 @@
1
- import { Props } from '@hugsmidjan/react/CarouselStepper';
2
- type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
1
+ import { WrapperElmProps } from './utils.js';
2
+ type CarouselStepperProps = {
3
+ current: number;
4
+ itemCount: number;
5
+ setCurrent: (idx: number) => void;
6
+ 'aria-controls'?: string;
7
+ texts?: Readonly<{
8
+ prefix: string;
9
+ }>;
10
+ } & WrapperElmProps;
3
11
  export declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
4
12
  export default CarouselStepper;
@@ -3,7 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CarouselStepper = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const CarouselStepper_1 = tslib_1.__importDefault(require("@hugsmidjan/react/CarouselStepper"));
7
- const CarouselStepper = (props) => (react_1.default.createElement(CarouselStepper_1.default, Object.assign({}, props, { bem: undefined, modifier: undefined })));
6
+ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
+ const defaultTexts = {
8
+ prefix: '',
9
+ };
10
+ const array = new Array(50).join(' ').split('');
11
+ const CarouselStepper = (props) => {
12
+ const { current, itemCount, setCurrent, texts = defaultTexts, wrapperProps } = props;
13
+ const labelPrefix = texts.prefix ? texts.prefix + ' ' : '';
14
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('CarouselStepper', null, (wrapperProps || {}).className) }), array.slice(0, itemCount).map((_, i) => {
15
+ const isCurrent = current === i || undefined;
16
+ const label = labelPrefix + (i + 1);
17
+ return (react_1.default.createElement("button", { key: i, className: 'CarouselStepper__button', type: "button", disabled: isCurrent, "aria-pressed": isCurrent, "aria-controls": props['aria-controls'], onClick: () => setCurrent(i), "aria-label": label, title: label }, label));
18
+ })));
19
+ };
8
20
  exports.CarouselStepper = CarouselStepper;
9
21
  exports.default = exports.CarouselStepper;
package/CenterColumn.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
- import { EffectProp, SeenProp } from './utils/seenEffect.js';
2
+ import { DeprecatedSeenProp, EffectProp } from './utils/seenEffect.js';
3
+ import { WrapperElmProps } from './utils.js';
3
4
  export type CenterColumnProps = {
4
5
  children: ReactNode;
5
- } & SeenProp & EffectProp;
6
+ } & EffectProp & WrapperElmProps & DeprecatedSeenProp;
6
7
  export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
7
8
  export default CenterColumn;