@bonniernews/dn-design-system-web 32.7.43 → 32.7.45

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 (337) hide show
  1. package/.prettierignore +10 -0
  2. package/.prettierrc +20 -1
  3. package/CHANGELOG.md +14 -0
  4. package/assets/types/shared-props.ts +6 -6
  5. package/assets/types/teaser-props.ts +20 -20
  6. package/components/article-body-image/README.md +1 -1
  7. package/components/article-top-image/README.md +1 -1
  8. package/components/blocked-content/README.md +1 -1
  9. package/components/blocked-content/blocked-content.js +16 -19
  10. package/components/buddy-menu/README.md +1 -1
  11. package/components/button/README.md +3 -4
  12. package/components/button/button-interactions.js +11 -14
  13. package/components/button/button-types.ts +29 -36
  14. package/components/button-toggle/README.md +1 -1
  15. package/components/byline/README.md +1 -1
  16. package/components/byline/byline-interaction.js +5 -5
  17. package/components/byline-list/README.md +1 -1
  18. package/components/byline-list/byline-list.js +3 -6
  19. package/components/checkbox/README.md +1 -1
  20. package/components/direkt-circle/README.md +1 -1
  21. package/components/direkt-header/README.md +1 -1
  22. package/components/disclaimer/README.md +1 -1
  23. package/components/divider/README.md +1 -1
  24. package/components/empty-state/README.md +1 -1
  25. package/components/factbox/README.md +35 -0
  26. package/components/factbox/factbox.js +6 -9
  27. package/components/footer/README.md +1 -1
  28. package/components/game-header/README.md +1 -1
  29. package/components/group-header/README-njk.md +2 -2
  30. package/components/group-header/README.md +2 -2
  31. package/components/image-caption/README.md +1 -1
  32. package/components/link-box/README.md +1 -1
  33. package/components/list-item/README.md +70 -0
  34. package/components/list-item/list-item-types.ts +4 -3
  35. package/components/list-item/list-item.js +5 -8
  36. package/components/mask/README.md +1 -1
  37. package/components/modal/README.md +1 -1
  38. package/components/modal/modal.js +20 -24
  39. package/components/pagination/README.md +1 -1
  40. package/components/pictogram/README.md +1 -1
  41. package/components/pill/README.md +1 -1
  42. package/components/profile-header/README.md +1 -1
  43. package/components/quote/README.md +1 -1
  44. package/components/radio-button/README.md +1 -1
  45. package/components/spinner/README.md +1 -1
  46. package/components/switch/README.md +1 -1
  47. package/components/tag-header/README.md +1 -1
  48. package/components/teaser-card/{README-NJK.md → README-njk.md} +1 -1
  49. package/components/teaser-card/README.md +2 -2
  50. package/components/teaser-centered/README.md +2 -2
  51. package/components/teaser-counter/README.md +2 -2
  52. package/components/teaser-dot/README.md +1 -1
  53. package/components/teaser-footer/README.md +1 -1
  54. package/components/teaser-image/README.md +1 -1
  55. package/components/teaser-large/{README-NJK.md → README-njk.md} +1 -1
  56. package/components/teaser-large/README.md +2 -2
  57. package/components/teaser-list-swipe/README.md +2 -2
  58. package/components/teaser-list-vertical/README-njk.md +0 -1
  59. package/components/teaser-list-vertical/README.md +1 -1
  60. package/components/teaser-list-vertical/teaser-list-vertical.js +7 -10
  61. package/components/teaser-longlife/README.md +1 -1
  62. package/components/teaser-native/{README-NJK.md → README-njk.md} +1 -1
  63. package/components/teaser-native/README.md +1 -1
  64. package/components/teaser-onsite/{README-NJK.md → README-njk.md} +1 -1
  65. package/components/teaser-onsite/README.md +2 -2
  66. package/components/teaser-package/README.md +1 -1
  67. package/components/teaser-right-now/README.md +2 -2
  68. package/components/teaser-slideshow/{README-NJK.md → README-njk.md} +1 -1
  69. package/components/teaser-slideshow/README.md +3 -3
  70. package/components/teaser-split/README-container-njk.md +1 -1
  71. package/components/teaser-split/README-njk.md +2 -2
  72. package/components/teaser-standard/README-njk.md +1 -1
  73. package/components/teaser-standard/README.md +2 -2
  74. package/components/teaser-standard/teaser-standard.js +11 -14
  75. package/components/teaser-swipe-card/README.md +2 -2
  76. package/components/teaser-text-on-image/README.md +2 -2
  77. package/components/teaser-tipsa/{README-NJK.md → README-njk.md} +1 -1
  78. package/components/teaser-tipsa/README.md +2 -2
  79. package/components/text-button/README.md +1 -1
  80. package/components/text-button-toggle/README.md +1 -1
  81. package/components/text-button-toggle/text-button-toggle.js +7 -10
  82. package/components/text-input/README.md +1 -1
  83. package/components/text-input/text-input-interactions.js +16 -16
  84. package/components/text-input/text-input.js +10 -10
  85. package/components/thematic-break/README.md +1 -1
  86. package/components/tooltip/README.md +13 -5
  87. package/components/tooltip/tooltip.js +11 -17
  88. package/components/video-caption/README.md +1 -1
  89. package/helpers/formatClassString.ts +2 -2
  90. package/index.d.ts +1 -1
  91. package/package.json +5 -1
  92. package/preact/assets/article-image/article-image.d.ts +1 -1
  93. package/preact/assets/form-field/form-field.d.ts +2 -2
  94. package/preact/components/article-body-image/article-body-image.d.ts +2 -2
  95. package/preact/components/article-body-image/article-body-image.js +1 -5
  96. package/preact/components/article-body-image/article-body-image.js.map +2 -2
  97. package/preact/components/article-top-image/article-top-image.d.ts +2 -2
  98. package/preact/components/article-top-image/article-top-image.js +10 -6
  99. package/preact/components/article-top-image/article-top-image.js.map +2 -2
  100. package/preact/components/blocked-content/blocked-content.d.ts +2 -2
  101. package/preact/components/blocked-content/blocked-content.js +23 -22
  102. package/preact/components/blocked-content/blocked-content.js.map +2 -2
  103. package/preact/components/buddy-menu/buddy-menu.d.ts +2 -2
  104. package/preact/components/buddy-menu/buddy-menu.js +22 -17
  105. package/preact/components/buddy-menu/buddy-menu.js.map +2 -2
  106. package/preact/components/button/button-base.js.map +2 -2
  107. package/preact/components/button/button.d.ts +4 -4
  108. package/preact/components/button/button.js +22 -17
  109. package/preact/components/button/button.js.map +2 -2
  110. package/preact/components/button-toggle/button-toggle.d.ts +2 -2
  111. package/preact/components/button-toggle/button-toggle.js.map +2 -2
  112. package/preact/components/byline/byline.d.ts +2 -2
  113. package/preact/components/byline/byline.js +185 -170
  114. package/preact/components/byline/byline.js.map +3 -3
  115. package/preact/components/byline-list/byline-list.d.ts +4 -4
  116. package/preact/components/byline-list/byline-list.js +32 -21
  117. package/preact/components/byline-list/byline-list.js.map +2 -2
  118. package/preact/components/checkbox/checkbox.d.ts +2 -2
  119. package/preact/components/checkbox/checkbox.js +9 -1
  120. package/preact/components/checkbox/checkbox.js.map +2 -2
  121. package/preact/components/direkt-circle/direkt-circle.d.ts +2 -2
  122. package/preact/components/direkt-circle/direkt-circle.js.map +2 -2
  123. package/preact/components/direkt-header/direkt-header.d.ts +2 -2
  124. package/preact/components/direkt-header/direkt-header.js.map +2 -2
  125. package/preact/components/disclaimer/disclaimer.d.ts +3 -3
  126. package/preact/components/disclaimer/disclaimer.js.map +2 -2
  127. package/preact/components/divider/divider.d.ts +2 -2
  128. package/preact/components/divider/divider.js +1 -5
  129. package/preact/components/divider/divider.js.map +2 -2
  130. package/preact/components/empty-state/empty-state.d.ts +2 -2
  131. package/preact/components/empty-state/empty-state.js +31 -23
  132. package/preact/components/empty-state/empty-state.js.map +2 -2
  133. package/preact/components/factbox/factbox.d.ts +5 -5
  134. package/preact/components/factbox/factbox.js +448 -293
  135. package/preact/components/factbox/factbox.js.map +4 -4
  136. package/preact/components/footer/footer.d.ts +2 -2
  137. package/preact/components/footer/footer.js +18 -9
  138. package/preact/components/footer/footer.js.map +2 -2
  139. package/preact/components/game-header/game-header.d.ts +3 -3
  140. package/preact/components/game-header/game-header.js +17 -6
  141. package/preact/components/game-header/game-header.js.map +2 -2
  142. package/preact/components/group-header/group-header.d.ts +4 -4
  143. package/preact/components/group-header/group-header.js +23 -17
  144. package/preact/components/group-header/group-header.js.map +2 -2
  145. package/preact/components/icon-sprite/icon-sprite.d.ts +2 -2
  146. package/preact/components/icon-sprite/icon-sprite.js +5 -5
  147. package/preact/components/icon-sprite/icon-sprite.js.map +3 -3
  148. package/preact/components/icon-with-wrapper/icon-with-wrapper.d.ts +3 -3
  149. package/preact/components/icon-with-wrapper/icon-with-wrapper.js +13 -6
  150. package/preact/components/icon-with-wrapper/icon-with-wrapper.js.map +3 -3
  151. package/preact/components/image-caption/image-caption.d.ts +2 -2
  152. package/preact/components/image-caption/image-caption.js +1 -5
  153. package/preact/components/image-caption/image-caption.js.map +2 -2
  154. package/preact/components/link-box/link-box-item.d.ts +1 -1
  155. package/preact/components/link-box/link-box-item.js.map +2 -2
  156. package/preact/components/link-box/link-box.d.ts +3 -3
  157. package/preact/components/link-box/link-box.js +24 -21
  158. package/preact/components/link-box/link-box.js.map +2 -2
  159. package/preact/components/list-item/list-item-types.d.ts +3 -3
  160. package/preact/components/list-item/list-item.d.ts +19 -1
  161. package/preact/components/list-item/list-item.js +208 -206
  162. package/preact/components/list-item/list-item.js.map +4 -4
  163. package/preact/components/mask/mask.d.ts +3 -3
  164. package/preact/components/mask/mask.js.map +2 -2
  165. package/preact/components/modal/modal.d.ts +2 -2
  166. package/preact/components/modal/modal.js +22 -17
  167. package/preact/components/modal/modal.js.map +2 -2
  168. package/preact/components/pagination/pagination.d.ts +1 -1
  169. package/preact/components/pagination/pagination.js +3 -20
  170. package/preact/components/pagination/pagination.js.map +2 -2
  171. package/preact/components/pictogram/pictogram.d.ts +2 -2
  172. package/preact/components/pictogram/pictogram.js +8 -1
  173. package/preact/components/pictogram/pictogram.js.map +2 -2
  174. package/preact/components/pill/pill.d.ts +3 -3
  175. package/preact/components/pill/pill.js +1 -8
  176. package/preact/components/pill/pill.js.map +2 -2
  177. package/preact/components/profile-header/profile-header.d.ts +3 -3
  178. package/preact/components/profile-header/profile-header.js.map +2 -2
  179. package/preact/components/quote/quote.d.ts +2 -2
  180. package/preact/components/quote/quote.js +1 -6
  181. package/preact/components/quote/quote.js.map +2 -2
  182. package/preact/components/radio-button/radio-button.d.ts +2 -2
  183. package/preact/components/radio-button/radio-button.js +9 -1
  184. package/preact/components/radio-button/radio-button.js.map +2 -2
  185. package/preact/components/spinner/spinner.d.ts +2 -2
  186. package/preact/components/spinner/spinner.js.map +2 -2
  187. package/preact/components/switch/switch.d.ts +2 -2
  188. package/preact/components/switch/switch.js.map +2 -2
  189. package/preact/components/tag-header/tag-header.d.ts +2 -2
  190. package/preact/components/tag-header/tag-header.js.map +2 -2
  191. package/preact/components/teaser-card/teaser-card.d.ts +5 -5
  192. package/preact/components/teaser-card/teaser-card.js +9 -2
  193. package/preact/components/teaser-card/teaser-card.js.map +2 -2
  194. package/preact/components/teaser-centered/teaser-centered.d.ts +4 -4
  195. package/preact/components/teaser-centered/teaser-centered.js +48 -40
  196. package/preact/components/teaser-centered/teaser-centered.js.map +4 -4
  197. package/preact/components/teaser-counter/teaser-counter.d.ts +2 -2
  198. package/preact/components/teaser-counter/teaser-counter.js +31 -24
  199. package/preact/components/teaser-counter/teaser-counter.js.map +4 -4
  200. package/preact/components/teaser-dot/teaser-dot.d.ts +3 -3
  201. package/preact/components/teaser-dot/teaser-dot.js +1 -6
  202. package/preact/components/teaser-dot/teaser-dot.js.map +2 -2
  203. package/preact/components/teaser-footer/teaser-footer.d.ts +2 -2
  204. package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
  205. package/preact/components/teaser-image/teaser-image.d.ts +3 -3
  206. package/preact/components/teaser-image/teaser-image.js +1 -5
  207. package/preact/components/teaser-image/teaser-image.js.map +2 -2
  208. package/preact/components/teaser-large/teaser-large.d.ts +3 -3
  209. package/preact/components/teaser-large/teaser-large.js +72 -73
  210. package/preact/components/teaser-large/teaser-large.js.map +4 -4
  211. package/preact/components/teaser-list-swipe/teaser-list-swipe.d.ts +2 -2
  212. package/preact/components/teaser-list-swipe/teaser-list-swipe.js +60 -48
  213. package/preact/components/teaser-list-swipe/teaser-list-swipe.js.map +4 -4
  214. package/preact/components/teaser-list-vertical/teaser-list-vertical.d.ts +2 -2
  215. package/preact/components/teaser-list-vertical/teaser-list-vertical.js +23 -17
  216. package/preact/components/teaser-list-vertical/teaser-list-vertical.js.map +2 -2
  217. package/preact/components/teaser-longlife/teaser-longlife.d.ts +1 -1
  218. package/preact/components/teaser-longlife/teaser-longlife.js +33 -27
  219. package/preact/components/teaser-longlife/teaser-longlife.js.map +4 -4
  220. package/preact/components/teaser-native/teaser-native.d.ts +2 -2
  221. package/preact/components/teaser-native/teaser-native.js +36 -35
  222. package/preact/components/teaser-native/teaser-native.js.map +4 -4
  223. package/preact/components/teaser-onsite/teaser-onsite.d.ts +4 -4
  224. package/preact/components/teaser-onsite/teaser-onsite.js +44 -37
  225. package/preact/components/teaser-onsite/teaser-onsite.js.map +4 -4
  226. package/preact/components/teaser-package/teaser-package.d.ts +2 -2
  227. package/preact/components/teaser-package/teaser-package.js +33 -18
  228. package/preact/components/teaser-package/teaser-package.js.map +2 -2
  229. package/preact/components/teaser-right-now/teaser-right-now.d.ts +4 -4
  230. package/preact/components/teaser-right-now/teaser-right-now.js +37 -28
  231. package/preact/components/teaser-right-now/teaser-right-now.js.map +4 -4
  232. package/preact/components/teaser-slideshow/teaser-slideshow.d.ts +3 -3
  233. package/preact/components/teaser-slideshow/teaser-slideshow.js +43 -34
  234. package/preact/components/teaser-slideshow/teaser-slideshow.js.map +4 -4
  235. package/preact/components/teaser-split/teaser-split.d.ts +4 -4
  236. package/preact/components/teaser-split/teaser-split.js +10 -9
  237. package/preact/components/teaser-split/teaser-split.js.map +2 -2
  238. package/preact/components/teaser-standard/teaser-standard.d.ts +1 -1
  239. package/preact/components/teaser-standard/teaser-standard.js +10 -9
  240. package/preact/components/teaser-standard/teaser-standard.js.map +2 -2
  241. package/preact/components/teaser-swipe-card/teaser-swipe-card.d.ts +1 -1
  242. package/preact/components/teaser-swipe-card/teaser-swipe-card.js +30 -24
  243. package/preact/components/teaser-swipe-card/teaser-swipe-card.js.map +4 -4
  244. package/preact/components/teaser-text-on-image/teaser-text-on-image.d.ts +4 -4
  245. package/preact/components/teaser-text-on-image/teaser-text-on-image.js +45 -37
  246. package/preact/components/teaser-text-on-image/teaser-text-on-image.js.map +4 -4
  247. package/preact/components/teaser-tipsa/teaser-tipsa.d.ts +2 -2
  248. package/preact/components/teaser-tipsa/teaser-tipsa.js +33 -32
  249. package/preact/components/teaser-tipsa/teaser-tipsa.js.map +4 -4
  250. package/preact/components/text-button/text-button.d.ts +2 -2
  251. package/preact/components/text-button/text-button.js +4 -4
  252. package/preact/components/text-button/text-button.js.map +3 -3
  253. package/preact/components/text-button-toggle/text-button-toggle.d.ts +3 -3
  254. package/preact/components/text-button-toggle/text-button-toggle.js.map +2 -2
  255. package/preact/components/text-input/text-input.d.ts +2 -2
  256. package/preact/components/text-input/text-input.js +9 -1
  257. package/preact/components/text-input/text-input.js.map +2 -2
  258. package/preact/components/thematic-break/thematic-break.d.ts +2 -2
  259. package/preact/components/thematic-break/thematic-break.js +1 -4
  260. package/preact/components/thematic-break/thematic-break.js.map +2 -2
  261. package/preact/components/tooltip/tooltip.d.ts +2 -2
  262. package/preact/components/tooltip/tooltip.js +22 -17
  263. package/preact/components/tooltip/tooltip.js.map +2 -2
  264. package/preact/components/video-caption/video-caption.d.ts +2 -2
  265. package/preact/components/video-caption/video-caption.js +6 -10
  266. package/preact/components/video-caption/video-caption.js.map +3 -3
  267. package/types-lib/ds-color.d.ts +95 -95
  268. package/types-lib/ds-icon.d.ts +98 -98
  269. package/components/article-body-image/README-UXD.md +0 -0
  270. package/components/article-top-image/README-UXD.md +0 -0
  271. package/components/blocked-content/README-UXD.md +0 -0
  272. package/components/buddy-menu/README-UXD.md +0 -0
  273. package/components/byline/README-UXD.md +0 -0
  274. package/components/byline-list-item/README-UXD.md +0 -0
  275. package/components/checkbox/README-UXD.md +0 -0
  276. package/components/direkt-circle/README-UXD.md +0 -0
  277. package/components/divider/README-UXD.md +0 -0
  278. package/components/floating-button/README-UXD.md +0 -0
  279. package/components/footer/README-UXD.md +0 -0
  280. package/components/game-header/README-UXD.md +0 -0
  281. package/components/icon-sprite/README-UXD.md +0 -0
  282. package/components/icon-with-wrapper/README-UXD.md +0 -0
  283. package/components/image-caption/README-UXD.md +0 -0
  284. package/components/modal/README-UXD.md +0 -0
  285. package/components/profile-header/README-UXD.md +0 -0
  286. package/components/quote/README-UXD.md +0 -0
  287. package/components/radio-button/README-UXD.md +0 -0
  288. package/components/spinner/README-UXD.md +0 -0
  289. package/components/switch/README-UXD.md +0 -0
  290. package/components/teaser-card/README-UXD.md +0 -0
  291. package/components/teaser-footer/README-UXD.md +0 -0
  292. package/components/teaser-onsite/README-UXD.md +0 -0
  293. package/components/text-input/README-UXD.md +0 -0
  294. package/components/thematic-break/README-UXD.md +0 -0
  295. package/components/video-caption/README-UXD.md +0 -0
  296. package/foundations/helpers/README-UXD.md +0 -0
  297. package/foundations/typography/README-UXD.md +0 -0
  298. package/introduction/README-UXD.md +0 -1
  299. package/preact/assets/types/shared-props.d.ts +0 -6
  300. package/preact/assets/types/teaser-props.d.ts +0 -44
  301. package/preact/foundations/a11y/visually-hidden.d.ts +0 -4
  302. package/preact/foundations/icons/grade-icon.d.ts +0 -9
  303. package/preact/helpers/formatClassString.d.ts +0 -1
  304. package/preact/helpers/stringToHtml.d.ts +0 -6
  305. package/preact/helpers/teaser.d.ts +0 -21
  306. /package/components/article-body-image/{README-NJK.md → README-njk.md} +0 -0
  307. /package/components/blocked-content/{README-NJK.md → README-njk.md} +0 -0
  308. /package/components/buddy-menu/{README-NJK.md → README-njk.md} +0 -0
  309. /package/components/button/{README-NJK.md → README-njk.md} +0 -0
  310. /package/components/button-toggle/{README-NJK.md → README-njk.md} +0 -0
  311. /package/components/byline/{README-NJK.md → README-njk.md} +0 -0
  312. /package/components/checkbox/{README-NJK.md → README-njk.md} +0 -0
  313. /package/components/direkt-circle/{README-NJK.md → README-njk.md} +0 -0
  314. /package/components/divider/{README-NJK.md → README-njk.md} +0 -0
  315. /package/components/empty-state/{README-NJK.md → README-njk.md} +0 -0
  316. /package/components/factbox/{README-NJK.md → README-njk.md} +0 -0
  317. /package/components/footer/{README-NJK.md → README-njk.md} +0 -0
  318. /package/components/icon-sprite/{README-NJK.md → README-njk.md} +0 -0
  319. /package/components/image-caption/{README-NJK.md → README-njk.md} +0 -0
  320. /package/components/list-item/{README-NJK.md → README-njk.md} +0 -0
  321. /package/components/mask/{README-NJK.md → README-njk.md} +0 -0
  322. /package/components/modal/{README-NJK.md → README-njk.md} +0 -0
  323. /package/components/pagination/{README-NJK.md → README-njk.md} +0 -0
  324. /package/components/pictogram/{README-NJK.md → README-njk.md} +0 -0
  325. /package/components/quote/{README-NJK.md → README-njk.md} +0 -0
  326. /package/components/radio-button/{README-NJK.md → README-njk.md} +0 -0
  327. /package/components/spinner/{README-NJK.md → README-njk.md} +0 -0
  328. /package/components/switch/{README-NJK.md → README-njk.md} +0 -0
  329. /package/components/teaser-centered/{README-NJK.md → README-njk.md} +0 -0
  330. /package/components/teaser-dot/{README-NJK.md → README-njk.md} +0 -0
  331. /package/components/teaser-image/{README-NJK.md → README-njk.md} +0 -0
  332. /package/components/teaser-right-now/{README-NJK.md → README-njk.md} +0 -0
  333. /package/components/teaser-text-on-image/{README-NJK.md → README-njk.md} +0 -0
  334. /package/components/text-button/{README-NJK.md → README-njk.md} +0 -0
  335. /package/components/text-input/{README-NJK.md → README-njk.md} +0 -0
  336. /package/components/thematic-break/{README-NJK.md → README-njk.md} +0 -0
  337. /package/components/video-caption/{README-NJK.md → README-njk.md} +0 -0
@@ -13,7 +13,7 @@
13
13
  |title | String | yes | | | Heading of the teaser |
14
14
  |targetLink | String | yes | | | Target URL for the teaser |
15
15
  |nativeVariant | String | no | "standard" or "large" or "right" | "standard" | |
16
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
16
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
17
17
  |text | String | no | | | Teaser subtext |
18
18
  |vignette | String | no | | | Top text in the teaser |
19
19
  |mediaHtml | HTML String | no | | | Main image or other media |
@@ -13,7 +13,7 @@
13
13
  |title | String | yes | | | Heading of the teaser |
14
14
  |targetLink | String | yes | | | Target URL for the teaser |
15
15
  |nativeVariant | String | no | "standard" or "large" or "right" | "standard" | |
16
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
16
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
17
17
  |text | String | no | | | Teaser subtext |
18
18
  |vignette | String | no | | | Top text in the teaser |
19
19
  |mediaHtml | HTML String | no | | | Main image or other media |
@@ -16,7 +16,7 @@ In the CMS title will be set to a location like "Kiev, Ukraina" or "USA" and tex
16
16
  |:--- | :--- | :--- | :--- | :--- | :--- |
17
17
  |title | String | yes | | | Heading of the teaser |
18
18
  |targetLink | String | yes | | | Target URL for the teaser |
19
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
19
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
20
20
  |theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
21
21
  |text | String | no | | | Teaser subtext |
22
22
  |mediaHtml | HTML String | no | | | Main image or other media |
@@ -5,7 +5,7 @@ Also known as "På Plats-puffen".
5
5
 
6
6
  In the CMS title will be set to a location like "Kiev, Ukraina" or "USA" and text is usually set to some author names like "Jan Banan och Kalle Kula"
7
7
 
8
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
8
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
9
9
  * Storybook: [TeaserOnSite](https://designsystem.dn.se/?path=/docs/section-teaseronsite--docs)
10
10
 
11
11
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.scss'`
@@ -15,7 +15,7 @@ The component will not include styling by itself. Make sure to include the right
15
15
  | classNames | Ex. "my-special-class"<br />string | \- |
16
16
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
17
17
  | targetLink\* | Target URL for the teaser<br />string | \- |
18
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
18
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
19
19
  | title\* | Heading of the teaser<br />string | \- |
20
20
  | text | Teaser subtext<br />string | \- |
21
21
  | media | Main image or other media<br />ComponentChild | \- |
@@ -1,7 +1,7 @@
1
1
  TeaserPackage
2
2
  =============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-package](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-package)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-package](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-package)
5
5
  * Storybook: [TeaserPackage](https://designsystem.dn.se/?path=/docs/section-teaserpackage--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
@@ -1,7 +1,7 @@
1
1
  TeaserRightNow
2
2
  ==============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-right-now](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-right-now)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-right-now](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-right-now)
5
5
  * Storybook: [TeaserRightNow](https://designsystem.dn.se/?path=/docs/section-teaserrightnow--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-right-now)/teaser-right-now.scss'`
@@ -11,7 +11,7 @@ The component will not include styling by itself. Make sure to include the right
11
11
  | classNames | Ex. "my-special-class"<br />string | \- |
12
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
13
13
  | targetLink\* | Target URL for the teaser<br />string | \- |
14
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
14
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
15
15
  | title\* | Heading of the teaser<br />string | \- |
16
16
  | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | "nyheter" |
17
17
 
@@ -12,7 +12,7 @@
12
12
  |:--- | :--- | :--- | :--- | :--- | :--- |
13
13
  |title | String | yes | | | Heading of the teaser |
14
14
  |text | String | no | | | Teaser subtext |
15
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
15
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
16
16
  |theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
17
17
  |mediaHtml | HTML String | no | | | Gallery html |
18
18
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
@@ -1,7 +1,7 @@
1
1
  TeaserSlideshow
2
2
  ===============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-slideshow](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-slideshow)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-slideshow](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-slideshow)
5
5
  * Storybook: [TeaserSlideshow](https://designsystem.dn.se/?path=/docs/section-teaserslideshow--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-slideshow/teaser-slideshow.scss'`
@@ -10,9 +10,9 @@ The component will not include styling by itself. Make sure to include the right
10
10
  |:--- | :--- | :--- |
11
11
  | classNames | Ex. "my-special-class"<br />string | \- |
12
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
13
- | areaType | "right", "bauta", "bautaxl" | \- |
13
+ | areaType | "right", "bauta", "main" | \- |
14
14
  | targetLink | string | \- |
15
- | theme | "kultur", "nyheter" | \- |
15
+ | theme | "nyheter", "kultur" | \- |
16
16
  | title\* | Heading of the teaser<br />string | \- |
17
17
  | text | Teaser subtext<br />string | \- |
18
18
  | media | Main image or other media<br />ComponentChild | \- |
@@ -14,7 +14,7 @@
14
14
  |theme | String | no | nyheter, kultur | (empty) | The theme is applied to all teasers in the container |
15
15
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
16
16
  |classNames | String | no | | | Ex. "my-special-class" |
17
- |areaType | string | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
17
+ |areaType | string | no | "right" or "bauta" | | The area where the column is rendered |
18
18
  |~forcePx~ | | | | | Not supported |
19
19
 
20
20
  ## Minimum requirement example
@@ -12,8 +12,8 @@
12
12
  |:--- | :--- | :--- | :--- | :--- | :--- |
13
13
  |title | String | yes | | | Heading of the teaser |
14
14
  |targetLink | String | yes | | | Target URL for the teaser |
15
- |~variant~ | String | no | "default" or "podcast" | "default" | Not implemented |
16
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
15
+ |variant | String | no | "default" or "podcast" | "default" | |
16
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
17
17
  |theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
18
18
  |text | String | no | | | Teaser subtext |
19
19
  |vignette | String | no | | | Top text in the teaser |
@@ -13,7 +13,7 @@
13
13
  |title | String | yes | | | Heading of the teaser |
14
14
  |targetLink | String | yes | | | Target URL for the teaser |
15
15
  |variant | String | no | "default" or "podcast" | "default" | |
16
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
16
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
17
17
  |theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
18
18
  |text | String | no | | | Teaser subtext |
19
19
  |vignette | String | no | | | Top text in the teaser |
@@ -1,7 +1,7 @@
1
1
  TeaserStandard
2
2
  ==============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
5
5
  * Storybook: [TeaserStandard](https://designsystem.dn.se/?path=/docs/section-teaserstandard--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard.scss'`
@@ -44,7 +44,7 @@ const teaserStandardHtml = dsTeaserStandard(parameters);
44
44
  | vignette | Top text in the teaser<br />string | \- |
45
45
  | text | Teaser subtext<br />string | \- |
46
46
  | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
47
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
47
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
48
48
  | variant | Variant of the teaser<br />"default", "podcast", "insandare", "direkt" | \- |
49
49
  | targetLink\* | Target URL for the teaser<br />string | \- |
50
50
  | title\* | Heading of the teaser<br />string | \- |
@@ -1,10 +1,7 @@
1
- export {
2
- dsTeaserStandard,
3
- dsTeaserStandardStory
4
- };
1
+ export { dsTeaserStandard, dsTeaserStandardStory };
5
2
 
6
3
  function dsTeaserStandard(params = {}) {
7
- const teaser = document.createElement("a");
4
+ const teaser = document.createElement('a');
8
5
  // NOTE: this should match output of teaser-standard.tsx for a subset of the parameters
9
6
  teaser.innerHTML = `
10
7
  <div class="ds-teaser__content">
@@ -13,22 +10,22 @@ function dsTeaserStandard(params = {}) {
13
10
  <p class="ds-teaser__text"></p>
14
11
  </div>
15
12
  </div>`;
16
- teaser.classList.add("ds-teaser");
17
- teaser.classList.add("ds-teaser--standard");
18
- teaser.classList.add("ds-teaser--standard-without-byline");
13
+ teaser.classList.add('ds-teaser');
14
+ teaser.classList.add('ds-teaser--standard');
15
+ teaser.classList.add('ds-teaser--standard-without-byline');
19
16
 
20
17
  if (params.targetLink) {
21
- teaser.setAttribute("href", params.targetLink)
18
+ teaser.setAttribute('href', params.targetLink);
22
19
  }
23
20
 
24
21
  if (params.title) {
25
- const titleEl = teaser.getElementsByClassName("ds-teaser__title")[0];
22
+ const titleEl = teaser.getElementsByClassName('ds-teaser__title')[0];
26
23
  titleEl.textContent = params.title;
27
24
  }
28
25
 
29
26
  if (params.text) {
30
- const textEl = teaser.getElementsByClassName("ds-teaser__text")[0];
31
- textEl.appendChild(document.createTextNode(params.text))
27
+ const textEl = teaser.getElementsByClassName('ds-teaser__text')[0];
28
+ textEl.appendChild(document.createTextNode(params.text));
32
29
  }
33
30
 
34
31
  if (params.classNames) {
@@ -46,9 +43,9 @@ function dsTeaserStandard(params = {}) {
46
43
 
47
44
  /** only use in storybook */
48
45
  function dsTeaserStandardStory() {
49
- const jsTeasers = Array.from(document.getElementsByClassName("js-ds-teaser-standard-story"));
46
+ const jsTeasers = Array.from(document.getElementsByClassName('js-ds-teaser-standard-story'));
50
47
  jsTeasers.forEach((teaserEl) => {
51
- const params = JSON.parse(teaserEl.getAttribute("data-params"));
48
+ const params = JSON.parse(teaserEl.getAttribute('data-params'));
52
49
  teaserEl.replaceWith(dsTeaserStandard(params));
53
50
  });
54
51
  }
@@ -1,7 +1,7 @@
1
1
  TeaserSwipeCard
2
2
  ===============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-swipe-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-swipe-card)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-swipe-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-swipe-card)
5
5
  * Storybook: [TeaserSwipeCard](https://designsystem.dn.se/?path=/docs/section-teaserlistswipe-teaserswipecard--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-swipe-card/teaser-swipe-card.scss'`
@@ -27,7 +27,7 @@ The component will not include styling by itself. Make sure to include the right
27
27
  | vignette | Top text in the teaser<br />string | \- |
28
28
  | text | Teaser subtext<br />string | \- |
29
29
  | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
30
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
30
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
31
31
  | variant | Variant of the teaser<br />"default", "podcast", "insandare", "direkt" | \- |
32
32
  | targetLink\* | Target URL for the teaser<br />string | \- |
33
33
  | title\* | Heading of the teaser<br />string | \- |
@@ -1,7 +1,7 @@
1
1
  TeaserTextOnImage
2
2
  =================
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-text-on-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-text-on-image)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-text-on-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-text-on-image)
5
5
  * Storybook: [TeaserTextOnImage](https://designsystem.dn.se/?path=/docs/section-teasertextonimage--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-text-on-image)/teaser-text-on-image.scss'`
@@ -11,7 +11,7 @@ The component will not include styling by itself. Make sure to include the right
11
11
  | classNames | Ex. "my-special-class"<br />string | \- |
12
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
13
13
  | targetLink\* | Target URL for the teaser<br />string | \- |
14
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
14
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
15
15
  | title\* | Heading of the teaser<br />string | \- |
16
16
  | text | Teaser subtext<br />string | \- |
17
17
  | vignette | Top text in the teaser<br />string | \- |
@@ -15,7 +15,7 @@ It's quite common to include a dot in the title string, like "• This is a titl
15
15
  |title | String | yes | | | Heading of the teaser |
16
16
  |targetLink | String | yes | | | Target URL for the teaser |
17
17
  |text | String | no | | | Teaser subtext |
18
- |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
18
+ |areaType | String | no | "right" or "bauta" | | The area where the column is rendered |
19
19
  |theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
20
20
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
21
21
  |classNames | String | no | | | Ex. "my-special-class" |
@@ -1,7 +1,7 @@
1
1
  TeaserTipsa
2
2
  ===========
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-tipsa](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-tipsa)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-tipsa](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-tipsa)
5
5
  * Storybook: [TeaserTipsa](https://designsystem.dn.se/?path=/docs/section-teasertipsa--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa.scss'`
@@ -11,7 +11,7 @@ The component will not include styling by itself. Make sure to include the right
11
11
  | classNames | Ex. "my-special-class"<br />string | \- |
12
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
13
13
  | targetLink\* | Target URL for the teaser<br />string | \- |
14
- | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
14
+ | areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
15
15
  | title\* | Heading of the teaser<br />string | \- |
16
16
  | text | Teaser subtext<br />string | \- |
17
17
 
@@ -1,7 +1,7 @@
1
1
  TextButton
2
2
  ==========
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/text-button](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-button)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/text-button](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-button)
5
5
  * Storybook: [TextButton](https://designsystem.dn.se/?path=/docs/basic-buttons-textbutton--docs)
6
6
 
7
7
  | Name | Description | Default |
@@ -1,7 +1,7 @@
1
1
  TextButtonToggle
2
2
  ================
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/text-button-toggle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-button-toggle)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/text-button-toggle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-button-toggle)
5
5
  * Storybook: [TextButtonToggle](https://designsystem.dn.se/?path=/docs/basic-buttons-textbuttontoggle--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/text-button-toggle/text-button-toggle.scss'`
@@ -1,21 +1,18 @@
1
- export {
2
- dsTextButtonToggle,
3
- dsTextButtonToggleAll
4
- };
1
+ export { dsTextButtonToggle, dsTextButtonToggleAll };
5
2
 
6
3
  function dsTextButtonToggle(toggleElements = []) {
7
4
  if (!toggleElements.length) return;
8
5
  toggleElements.forEach((toggleEl) => {
9
- toggleEl.addEventListener("click", () => {
10
- if (toggleEl.classList.contains("ds-text-btn-toggle--disabled")) return;
11
- toggleEl.classList.toggle("ds-text-btn-toggle--selected");
12
- const ariaChecked = toggleEl.getAttribute("aria-checked") === "true" ? "false" : "true";
13
- toggleEl.setAttribute("aria-checked", ariaChecked);
6
+ toggleEl.addEventListener('click', () => {
7
+ if (toggleEl.classList.contains('ds-text-btn-toggle--disabled')) return;
8
+ toggleEl.classList.toggle('ds-text-btn-toggle--selected');
9
+ const ariaChecked = toggleEl.getAttribute('aria-checked') === 'true' ? 'false' : 'true';
10
+ toggleEl.setAttribute('aria-checked', ariaChecked);
14
11
  });
15
12
  });
16
13
  }
17
14
 
18
15
  function dsTextButtonToggleAll() {
19
- const toggleElements = Array.from(document.getElementsByClassName("ds-text-btn-toggle"));
16
+ const toggleElements = Array.from(document.getElementsByClassName('ds-text-btn-toggle'));
20
17
  dsTextButtonToggle(toggleElements);
21
18
  }
@@ -1,7 +1,7 @@
1
1
  TextInput
2
2
  =========
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/text-input](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-input)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/text-input](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-input)
5
5
  * Storybook: [Form > TextInput](https://designsystem.dn.se/?path=/docs/basic-form-textinput--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use "@bonniernews/dn-design-system-web/components/text-input/text-input";`
@@ -1,28 +1,28 @@
1
1
  export const textInput = () => {
2
2
  function passwordToggle(id, toggle) {
3
- var x = document.getElementById(id)
3
+ var x = document.getElementById(id);
4
4
  if (x.type === 'password') {
5
- x.type = 'text'
6
- toggle.classList.add('ds-btn--selected')
7
- toggle.setAttribute('aria-checked', 'true')
8
- toggle.setAttribute('aria-label', 'Dölj lösenord')
5
+ x.type = 'text';
6
+ toggle.classList.add('ds-btn--selected');
7
+ toggle.setAttribute('aria-checked', 'true');
8
+ toggle.setAttribute('aria-label', 'Dölj lösenord');
9
9
  } else {
10
- x.type = 'password'
11
- toggle.classList.remove('ds-btn--selected')
12
- toggle.setAttribute('aria-checked', 'false')
13
- toggle.setAttribute('aria-label', 'Visa lösenord')
10
+ x.type = 'password';
11
+ toggle.classList.remove('ds-btn--selected');
12
+ toggle.setAttribute('aria-checked', 'false');
13
+ toggle.setAttribute('aria-label', 'Visa lösenord');
14
14
  }
15
15
  }
16
16
 
17
- const passwordInputs = document.querySelectorAll('.ds-text-input [type=password]')
17
+ const passwordInputs = document.querySelectorAll('.ds-text-input [type=password]');
18
18
  passwordInputs.forEach((input) => {
19
- const toggle = document.getElementById(`${input.id}-password-toggle`)
19
+ const toggle = document.getElementById(`${input.id}-password-toggle`);
20
20
  if (toggle) {
21
21
  toggle.addEventListener('click', () => {
22
- passwordToggle(input.id, toggle)
23
- })
22
+ passwordToggle(input.id, toggle);
23
+ });
24
24
  }
25
- })
26
- }
25
+ });
26
+ };
27
27
 
28
- export default textInput
28
+ export default textInput;
@@ -1,22 +1,22 @@
1
1
  const textInput = () => {
2
2
  function passwordToggle(id) {
3
- var x = document.getElementById(id)
3
+ var x = document.getElementById(id);
4
4
  if (x.type === 'password') {
5
- x.type = 'text'
5
+ x.type = 'text';
6
6
  } else {
7
- x.type = 'password'
7
+ x.type = 'password';
8
8
  }
9
9
  }
10
10
 
11
- const passwordInputs = document.querySelectorAll('.ds-text-input [type=password]')
11
+ const passwordInputs = document.querySelectorAll('.ds-text-input [type=password]');
12
12
  passwordInputs.forEach((input) => {
13
- const toggle = document.getElementById(`${input.id}-password-toggle`)
13
+ const toggle = document.getElementById(`${input.id}-password-toggle`);
14
14
  if (toggle) {
15
15
  toggle.addEventListener('click', () => {
16
- passwordToggle(input.id)
17
- })
16
+ passwordToggle(input.id);
17
+ });
18
18
  }
19
- })
20
- }
19
+ });
20
+ };
21
21
 
22
- export default textInput
22
+ export default textInput;
@@ -1,7 +1,7 @@
1
1
  ThematicBreak
2
2
  =============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
5
5
  * Storybook: [ThematicBreak](https://designsystem.dn.se/?path=/docs/article-thematicbreak--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/thematic-break/thematic-break.scss'`
@@ -1,7 +1,7 @@
1
1
  Tooltip
2
2
  =======
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/tooltip](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/tooltip)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/tooltip](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/tooltip)
5
5
  * Storybook: [Tooltip](https://designsystem.dn.se/?path=/docs/basic-tooltip--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/tooltip/tooltip.scss'`
@@ -19,8 +19,16 @@ The component will not include styling by itself. Make sure to include the right
19
19
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
20
20
 
21
21
  ```jsx
22
- <RunComponentJs
23
- component={<div className="ds-tooltip ds-tooltip--arrow-top ds-tooltip--close-outside-click ds-tooltip--hidden"><div className="ds-tooltip__content"><React.Fragment key=".1"><h2>Senaste nytt</h2><p>Här är en text om en ny liten funktion vi har.</p></React.Fragment></div><Button attributes={{'aria-label': 'Stäng'}} classNames="ds-tooltip__close" iconName="close" isIconButton size="sm" variant="transparent"/></div>}
24
- jsFunction={() => {}}
25
- />
22
+ <Tooltip
23
+ arrowPosition="top"
24
+ closeButton
25
+ closeOnClickOutside
26
+ >
27
+ <React.Fragment key=".0">
28
+ <h2>
29
+ Senaste nytt </h2>
30
+ <p>
31
+ Här är en text om en ny liten funktion vi har. </p>
32
+ </React.Fragment>
33
+ </Tooltip>
26
34
  ```
@@ -1,35 +1,29 @@
1
- export {
2
- initTooltip,
3
- openTooltip,
4
- closeTooltip,
5
- toggleTooltip,
6
- initTooltipStorybook
7
- }
1
+ export { initTooltip, openTooltip, closeTooltip, toggleTooltip, initTooltipStorybook };
8
2
 
9
- const TOOLTIP_HIDDEN = "ds-tooltip--hidden";
3
+ const TOOLTIP_HIDDEN = 'ds-tooltip--hidden';
10
4
 
11
5
  let setupTooltipClickListener = true;
12
6
 
13
7
  function initTooltip(tooltipEl) {
14
- const tooltipsClosingOnOutsideClick = document.getElementsByClassName("ds-tooltip--close-outside-click");
15
-
8
+ const tooltipsClosingOnOutsideClick = document.getElementsByClassName('ds-tooltip--close-outside-click');
9
+
16
10
  if (setupTooltipClickListener && tooltipsClosingOnOutsideClick.length > 0) {
17
11
  setupTooltipClickListener = false;
18
12
 
19
- document.addEventListener("click", (e) => {
20
- const tooltipClick = e.target.closest(".ds-tooltip");
13
+ document.addEventListener('click', (e) => {
14
+ const tooltipClick = e.target.closest('.ds-tooltip');
21
15
  if (tooltipClick) return;
22
-
16
+
23
17
  const tooltipsToClose = document.getElementsByClassName('ds-tooltip--close-outside-click');
24
18
  for (const tooltip of tooltipsToClose) {
25
- closeTooltip(tooltip)
19
+ closeTooltip(tooltip);
26
20
  }
27
21
  });
28
22
  }
29
23
 
30
- const closeButtons = Array.from(tooltipEl.getElementsByClassName("ds-tooltip__close"));
24
+ const closeButtons = Array.from(tooltipEl.getElementsByClassName('ds-tooltip__close'));
31
25
  closeButtons.forEach((button) => {
32
- button.addEventListener("click", () => {
26
+ button.addEventListener('click', () => {
33
27
  closeTooltip(tooltipEl);
34
28
  });
35
29
  });
@@ -51,7 +45,7 @@ function closeTooltip(tooltipEl) {
51
45
  }
52
46
 
53
47
  function initTooltipStorybook() {
54
- const tooltips = Array.from(document.getElementsByClassName("ds-tooltip"));
48
+ const tooltips = Array.from(document.getElementsByClassName('ds-tooltip'));
55
49
  tooltips.forEach((tooltipEl) => {
56
50
  initTooltip(tooltipEl);
57
51
  openTooltip(tooltipEl);
@@ -1,7 +1,7 @@
1
1
  VideoCaption
2
2
  ============
3
3
 
4
- * GitHub: [BonnierNews/dn-design-system/../web/src/components/video-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/video-caption)
4
+ * GitHub: [BonnierNews/dn-design-system/web/src/components/video-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/video-caption)
5
5
  * Storybook: [VideoCaption](https://designsystem.dn.se/?path=/docs/article-videocaption--docs)
6
6
 
7
7
  The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/video-caption/video-caption.scss'`
@@ -1,3 +1,3 @@
1
- export const formatClassString = (classesArray: (string|undefined|false)[]): string => {
2
- return classesArray.filter(x => !!x).join(' ');
1
+ export const formatClassString = (classesArray: (string | undefined | false)[]): string => {
2
+ return classesArray.filter((x) => !!x).join(' ')
3
3
  }
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module '\*.svg' {
1
+ declare module '*.svg' {
2
2
  const filePathString: string
3
3
  export default filePathString
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "32.7.43",
3
+ "version": "32.7.45",
4
4
  "description": "DN design system for web.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
@@ -42,10 +42,12 @@
42
42
  "@commitlint/cli": "^18.4.3",
43
43
  "@commitlint/config-conventional": "^18.4.3",
44
44
  "@release-it/conventional-changelog": "^8.0.1",
45
+ "@trivago/prettier-plugin-sort-imports": "^5.2.2",
45
46
  "conventional-changelog-conventionalcommits": "^6.1.0",
46
47
  "node-html-parser": "^7.0.1",
47
48
  "postcss": "8.4.31",
48
49
  "preact": "^10.24.0",
50
+ "prettier": "^3.0.1",
49
51
  "release-it": "^17.0.0",
50
52
  "stylelint": "^15.11.0",
51
53
  "stylelint-config-recommended-scss": "^13.1.0",
@@ -56,6 +58,8 @@
56
58
  },
57
59
  "scripts": {
58
60
  "lint:styles": "yarn stylelint \"**/*.scss\" \"!node_modules/\"",
61
+ "prettier-src-check": "prettier --check . --config ./.prettierrc",
62
+ "prettier-src-fix": "prettier --write . --config ./.prettierrc",
59
63
  "release:web": "release-it --ci --vv",
60
64
  "prerelease:web": "release-it --preRelease=beta --ci --vv --config .release-it-beta.cjs"
61
65
  }
@@ -1,5 +1,5 @@
1
1
  import { ComponentChild } from 'preact';
2
- import type { SharedProps } from "@bonniernews/dn-design-system-web/assets/types/shared-props.ts";
2
+ import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts';
3
3
  export interface ArticleImageProps extends SharedProps {
4
4
  image: ComponentChild;
5
5
  caption?: string;
@@ -1,4 +1,4 @@
1
- import { ComponentChildren } from "preact";
1
+ import { ComponentChildren } from 'preact';
2
2
  export interface FormFieldProps {
3
3
  error?: boolean;
4
4
  errorMessage?: string;
@@ -8,5 +8,5 @@ export interface FormFieldProps {
8
8
  type?: string;
9
9
  children?: ComponentChildren;
10
10
  }
11
- export declare const FormField: ({ error, errorMessage, wrapperClasses, helpHtml, helpText, type, children }: FormFieldProps) => import("preact").JSX.Element;
11
+ export declare const FormField: ({ error, errorMessage, wrapperClasses, helpHtml, helpText, type, children, }: FormFieldProps) => import("preact").JSX.Element;
12
12
  export default FormField;
@@ -1,6 +1,6 @@
1
- import { ArticleImageProps } from '../../assets/article-image/article-image';
1
+ import { ArticleImageProps } from '@bonniernews/dn-design-system-web/assets/article-image/article-image.tsx';
2
2
  /**
3
- * - GitHub: [BonnierNews/dn-design-system/../web/src/components/article-body-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-body-image)
3
+ * - GitHub: [BonnierNews/dn-design-system/web/src/components/article-body-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-body-image)
4
4
  * - Storybook: [ArticleBodyImage](https://designsystem.dn.se/?path=/docs/article-articlebodyimage--docs)
5
5
  *
6
6
  * The component will not include styling by itself. Make sure to include the right styles for the component. See example below: