@bonniernews/dn-design-system-web 32.7.44 → 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 (263) hide show
  1. package/.prettierignore +10 -0
  2. package/.prettierrc +20 -1
  3. package/CHANGELOG.md +7 -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 +1 -1
  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.md +1 -1
  30. package/components/image-caption/README.md +1 -1
  31. package/components/link-box/README.md +1 -1
  32. package/components/list-item/README.md +1 -1
  33. package/components/list-item/list-item-types.ts +4 -3
  34. package/components/list-item/list-item.js +5 -8
  35. package/components/mask/README.md +1 -1
  36. package/components/modal/README.md +1 -1
  37. package/components/modal/modal.js +20 -24
  38. package/components/pagination/README.md +1 -1
  39. package/components/pictogram/README.md +1 -1
  40. package/components/pill/README.md +1 -1
  41. package/components/profile-header/README.md +1 -1
  42. package/components/quote/README.md +1 -1
  43. package/components/radio-button/README.md +1 -1
  44. package/components/spinner/README.md +1 -1
  45. package/components/switch/README.md +1 -1
  46. package/components/tag-header/README.md +1 -1
  47. package/components/teaser-card/README.md +1 -1
  48. package/components/teaser-centered/README.md +2 -2
  49. package/components/teaser-counter/README.md +2 -2
  50. package/components/teaser-dot/README.md +1 -1
  51. package/components/teaser-footer/README.md +1 -1
  52. package/components/teaser-image/README.md +1 -1
  53. package/components/teaser-large/README.md +2 -2
  54. package/components/teaser-list-swipe/README.md +1 -1
  55. package/components/teaser-list-vertical/README.md +1 -1
  56. package/components/teaser-list-vertical/teaser-list-vertical.js +7 -10
  57. package/components/teaser-longlife/README.md +1 -1
  58. package/components/teaser-onsite/README.md +2 -2
  59. package/components/teaser-package/README.md +1 -1
  60. package/components/teaser-right-now/README.md +2 -2
  61. package/components/teaser-slideshow/README.md +1 -1
  62. package/components/teaser-standard/README.md +2 -2
  63. package/components/teaser-standard/teaser-standard.js +11 -14
  64. package/components/teaser-swipe-card/README.md +2 -2
  65. package/components/teaser-text-on-image/README.md +2 -2
  66. package/components/teaser-tipsa/README.md +2 -2
  67. package/components/text-button/README.md +1 -1
  68. package/components/text-button-toggle/README.md +1 -1
  69. package/components/text-button-toggle/text-button-toggle.js +7 -10
  70. package/components/text-input/README.md +1 -1
  71. package/components/text-input/text-input-interactions.js +16 -16
  72. package/components/text-input/text-input.js +10 -10
  73. package/components/thematic-break/README.md +1 -1
  74. package/components/tooltip/README.md +1 -1
  75. package/components/tooltip/tooltip.js +11 -17
  76. package/components/video-caption/README.md +1 -1
  77. package/helpers/formatClassString.ts +2 -2
  78. package/index.d.ts +1 -1
  79. package/package.json +5 -1
  80. package/preact/assets/article-image/article-image.d.ts +1 -1
  81. package/preact/assets/form-field/form-field.d.ts +2 -2
  82. package/preact/components/article-body-image/article-body-image.d.ts +2 -2
  83. package/preact/components/article-body-image/article-body-image.js +1 -5
  84. package/preact/components/article-body-image/article-body-image.js.map +2 -2
  85. package/preact/components/article-top-image/article-top-image.d.ts +2 -2
  86. package/preact/components/article-top-image/article-top-image.js +10 -6
  87. package/preact/components/article-top-image/article-top-image.js.map +2 -2
  88. package/preact/components/blocked-content/blocked-content.d.ts +2 -2
  89. package/preact/components/blocked-content/blocked-content.js +23 -22
  90. package/preact/components/blocked-content/blocked-content.js.map +2 -2
  91. package/preact/components/buddy-menu/buddy-menu.d.ts +2 -2
  92. package/preact/components/buddy-menu/buddy-menu.js +22 -17
  93. package/preact/components/buddy-menu/buddy-menu.js.map +2 -2
  94. package/preact/components/button/button-base.js.map +2 -2
  95. package/preact/components/button/button.d.ts +4 -4
  96. package/preact/components/button/button.js +22 -17
  97. package/preact/components/button/button.js.map +2 -2
  98. package/preact/components/button-toggle/button-toggle.d.ts +2 -2
  99. package/preact/components/button-toggle/button-toggle.js.map +2 -2
  100. package/preact/components/byline/byline.d.ts +2 -2
  101. package/preact/components/byline/byline.js +185 -170
  102. package/preact/components/byline/byline.js.map +3 -3
  103. package/preact/components/byline-list/byline-list.d.ts +4 -4
  104. package/preact/components/byline-list/byline-list.js +32 -21
  105. package/preact/components/byline-list/byline-list.js.map +2 -2
  106. package/preact/components/checkbox/checkbox.d.ts +2 -2
  107. package/preact/components/checkbox/checkbox.js +9 -1
  108. package/preact/components/checkbox/checkbox.js.map +2 -2
  109. package/preact/components/direkt-circle/direkt-circle.d.ts +2 -2
  110. package/preact/components/direkt-circle/direkt-circle.js.map +2 -2
  111. package/preact/components/direkt-header/direkt-header.d.ts +2 -2
  112. package/preact/components/direkt-header/direkt-header.js.map +2 -2
  113. package/preact/components/disclaimer/disclaimer.d.ts +3 -3
  114. package/preact/components/disclaimer/disclaimer.js.map +2 -2
  115. package/preact/components/divider/divider.d.ts +2 -2
  116. package/preact/components/divider/divider.js +1 -5
  117. package/preact/components/divider/divider.js.map +2 -2
  118. package/preact/components/empty-state/empty-state.d.ts +2 -2
  119. package/preact/components/empty-state/empty-state.js +31 -23
  120. package/preact/components/empty-state/empty-state.js.map +2 -2
  121. package/preact/components/factbox/factbox.d.ts +5 -5
  122. package/preact/components/factbox/factbox.js +448 -293
  123. package/preact/components/factbox/factbox.js.map +4 -4
  124. package/preact/components/footer/footer.d.ts +2 -2
  125. package/preact/components/footer/footer.js +18 -9
  126. package/preact/components/footer/footer.js.map +2 -2
  127. package/preact/components/game-header/game-header.d.ts +3 -3
  128. package/preact/components/game-header/game-header.js +17 -6
  129. package/preact/components/game-header/game-header.js.map +2 -2
  130. package/preact/components/group-header/group-header.d.ts +2 -2
  131. package/preact/components/group-header/group-header.js +22 -17
  132. package/preact/components/group-header/group-header.js.map +2 -2
  133. package/preact/components/icon-sprite/icon-sprite.d.ts +2 -2
  134. package/preact/components/icon-sprite/icon-sprite.js +5 -5
  135. package/preact/components/icon-sprite/icon-sprite.js.map +3 -3
  136. package/preact/components/icon-with-wrapper/icon-with-wrapper.d.ts +3 -3
  137. package/preact/components/icon-with-wrapper/icon-with-wrapper.js +13 -6
  138. package/preact/components/icon-with-wrapper/icon-with-wrapper.js.map +3 -3
  139. package/preact/components/image-caption/image-caption.d.ts +2 -2
  140. package/preact/components/image-caption/image-caption.js +1 -5
  141. package/preact/components/image-caption/image-caption.js.map +2 -2
  142. package/preact/components/link-box/link-box-item.d.ts +1 -1
  143. package/preact/components/link-box/link-box-item.js.map +2 -2
  144. package/preact/components/link-box/link-box.d.ts +3 -3
  145. package/preact/components/link-box/link-box.js +23 -21
  146. package/preact/components/link-box/link-box.js.map +2 -2
  147. package/preact/components/list-item/list-item-types.d.ts +3 -3
  148. package/preact/components/list-item/list-item.d.ts +1 -1
  149. package/preact/components/list-item/list-item.js +208 -206
  150. package/preact/components/list-item/list-item.js.map +4 -4
  151. package/preact/components/mask/mask.d.ts +3 -3
  152. package/preact/components/mask/mask.js.map +2 -2
  153. package/preact/components/modal/modal.d.ts +2 -2
  154. package/preact/components/modal/modal.js +22 -17
  155. package/preact/components/modal/modal.js.map +2 -2
  156. package/preact/components/pagination/pagination.d.ts +1 -1
  157. package/preact/components/pagination/pagination.js +3 -20
  158. package/preact/components/pagination/pagination.js.map +2 -2
  159. package/preact/components/pictogram/pictogram.d.ts +2 -2
  160. package/preact/components/pictogram/pictogram.js +8 -1
  161. package/preact/components/pictogram/pictogram.js.map +2 -2
  162. package/preact/components/pill/pill.d.ts +3 -3
  163. package/preact/components/pill/pill.js +1 -8
  164. package/preact/components/pill/pill.js.map +2 -2
  165. package/preact/components/profile-header/profile-header.d.ts +3 -3
  166. package/preact/components/profile-header/profile-header.js.map +2 -2
  167. package/preact/components/quote/quote.d.ts +2 -2
  168. package/preact/components/quote/quote.js +1 -6
  169. package/preact/components/quote/quote.js.map +2 -2
  170. package/preact/components/radio-button/radio-button.d.ts +2 -2
  171. package/preact/components/radio-button/radio-button.js +9 -1
  172. package/preact/components/radio-button/radio-button.js.map +2 -2
  173. package/preact/components/spinner/spinner.d.ts +2 -2
  174. package/preact/components/spinner/spinner.js.map +2 -2
  175. package/preact/components/switch/switch.d.ts +2 -2
  176. package/preact/components/switch/switch.js.map +2 -2
  177. package/preact/components/tag-header/tag-header.d.ts +2 -2
  178. package/preact/components/tag-header/tag-header.js.map +2 -2
  179. package/preact/components/teaser-card/teaser-card.d.ts +4 -4
  180. package/preact/components/teaser-card/teaser-card.js +9 -2
  181. package/preact/components/teaser-card/teaser-card.js.map +2 -2
  182. package/preact/components/teaser-centered/teaser-centered.d.ts +4 -4
  183. package/preact/components/teaser-centered/teaser-centered.js +48 -40
  184. package/preact/components/teaser-centered/teaser-centered.js.map +4 -4
  185. package/preact/components/teaser-counter/teaser-counter.d.ts +2 -2
  186. package/preact/components/teaser-counter/teaser-counter.js +31 -24
  187. package/preact/components/teaser-counter/teaser-counter.js.map +4 -4
  188. package/preact/components/teaser-dot/teaser-dot.d.ts +3 -3
  189. package/preact/components/teaser-dot/teaser-dot.js +1 -6
  190. package/preact/components/teaser-dot/teaser-dot.js.map +2 -2
  191. package/preact/components/teaser-footer/teaser-footer.d.ts +2 -2
  192. package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
  193. package/preact/components/teaser-image/teaser-image.d.ts +3 -3
  194. package/preact/components/teaser-image/teaser-image.js +1 -5
  195. package/preact/components/teaser-image/teaser-image.js.map +2 -2
  196. package/preact/components/teaser-large/teaser-large.d.ts +3 -3
  197. package/preact/components/teaser-large/teaser-large.js +72 -73
  198. package/preact/components/teaser-large/teaser-large.js.map +4 -4
  199. package/preact/components/teaser-list-swipe/teaser-list-swipe.d.ts +1 -1
  200. package/preact/components/teaser-list-swipe/teaser-list-swipe.js +59 -48
  201. package/preact/components/teaser-list-swipe/teaser-list-swipe.js.map +4 -4
  202. package/preact/components/teaser-list-vertical/teaser-list-vertical.d.ts +2 -2
  203. package/preact/components/teaser-list-vertical/teaser-list-vertical.js +22 -17
  204. package/preact/components/teaser-list-vertical/teaser-list-vertical.js.map +2 -2
  205. package/preact/components/teaser-longlife/teaser-longlife.d.ts +1 -1
  206. package/preact/components/teaser-longlife/teaser-longlife.js +33 -27
  207. package/preact/components/teaser-longlife/teaser-longlife.js.map +4 -4
  208. package/preact/components/teaser-native/teaser-native.d.ts +2 -2
  209. package/preact/components/teaser-native/teaser-native.js +36 -35
  210. package/preact/components/teaser-native/teaser-native.js.map +4 -4
  211. package/preact/components/teaser-onsite/teaser-onsite.d.ts +4 -4
  212. package/preact/components/teaser-onsite/teaser-onsite.js +44 -37
  213. package/preact/components/teaser-onsite/teaser-onsite.js.map +4 -4
  214. package/preact/components/teaser-package/teaser-package.d.ts +2 -2
  215. package/preact/components/teaser-package/teaser-package.js +32 -18
  216. package/preact/components/teaser-package/teaser-package.js.map +2 -2
  217. package/preact/components/teaser-right-now/teaser-right-now.d.ts +4 -4
  218. package/preact/components/teaser-right-now/teaser-right-now.js +37 -28
  219. package/preact/components/teaser-right-now/teaser-right-now.js.map +4 -4
  220. package/preact/components/teaser-slideshow/teaser-slideshow.d.ts +3 -3
  221. package/preact/components/teaser-slideshow/teaser-slideshow.js +43 -34
  222. package/preact/components/teaser-slideshow/teaser-slideshow.js.map +4 -4
  223. package/preact/components/teaser-split/teaser-split.d.ts +3 -3
  224. package/preact/components/teaser-split/teaser-split.js +10 -9
  225. package/preact/components/teaser-split/teaser-split.js.map +2 -2
  226. package/preact/components/teaser-standard/teaser-standard.d.ts +1 -1
  227. package/preact/components/teaser-standard/teaser-standard.js +10 -9
  228. package/preact/components/teaser-standard/teaser-standard.js.map +2 -2
  229. package/preact/components/teaser-swipe-card/teaser-swipe-card.d.ts +1 -1
  230. package/preact/components/teaser-swipe-card/teaser-swipe-card.js +30 -24
  231. package/preact/components/teaser-swipe-card/teaser-swipe-card.js.map +4 -4
  232. package/preact/components/teaser-text-on-image/teaser-text-on-image.d.ts +4 -4
  233. package/preact/components/teaser-text-on-image/teaser-text-on-image.js +45 -37
  234. package/preact/components/teaser-text-on-image/teaser-text-on-image.js.map +4 -4
  235. package/preact/components/teaser-tipsa/teaser-tipsa.d.ts +2 -2
  236. package/preact/components/teaser-tipsa/teaser-tipsa.js +33 -32
  237. package/preact/components/teaser-tipsa/teaser-tipsa.js.map +4 -4
  238. package/preact/components/text-button/text-button.d.ts +2 -2
  239. package/preact/components/text-button/text-button.js +4 -4
  240. package/preact/components/text-button/text-button.js.map +3 -3
  241. package/preact/components/text-button-toggle/text-button-toggle.d.ts +3 -3
  242. package/preact/components/text-button-toggle/text-button-toggle.js.map +2 -2
  243. package/preact/components/text-input/text-input.d.ts +2 -2
  244. package/preact/components/text-input/text-input.js +9 -1
  245. package/preact/components/text-input/text-input.js.map +2 -2
  246. package/preact/components/thematic-break/thematic-break.d.ts +2 -2
  247. package/preact/components/thematic-break/thematic-break.js +1 -4
  248. package/preact/components/thematic-break/thematic-break.js.map +2 -2
  249. package/preact/components/tooltip/tooltip.d.ts +2 -2
  250. package/preact/components/tooltip/tooltip.js +22 -17
  251. package/preact/components/tooltip/tooltip.js.map +2 -2
  252. package/preact/components/video-caption/video-caption.d.ts +2 -2
  253. package/preact/components/video-caption/video-caption.js +6 -10
  254. package/preact/components/video-caption/video-caption.js.map +3 -3
  255. package/types-lib/ds-color.d.ts +95 -95
  256. package/types-lib/ds-icon.d.ts +98 -98
  257. package/preact/assets/types/shared-props.d.ts +0 -6
  258. package/preact/assets/types/teaser-props.d.ts +0 -44
  259. package/preact/foundations/a11y/visually-hidden.d.ts +0 -4
  260. package/preact/foundations/icons/grade-icon.d.ts +0 -9
  261. package/preact/helpers/formatClassString.d.ts +0 -1
  262. package/preact/helpers/stringToHtml.d.ts +0 -6
  263. package/preact/helpers/teaser.d.ts +0 -21
@@ -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" | \- |
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 | \- |
@@ -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" | \- |
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'`
@@ -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.44",
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:
@@ -6,11 +6,7 @@ var formatClassString = (classesArray) => {
6
6
  // ../src/components/image-caption/image-caption.tsx
7
7
  import { jsx, jsxs } from "preact/jsx-runtime";
8
8
  var ImageCaption = ({ caption, author, imageType, classNames, attributes, forcePx }) => {
9
- const classes = formatClassString([
10
- "ds-image-caption",
11
- forcePx && "ds-force-px",
12
- classNames
13
- ]);
9
+ const classes = formatClassString(["ds-image-caption", forcePx && "ds-force-px", classNames]);
14
10
  const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;
15
11
  const authorClasses = [
16
12
  "ds-article-image__credits",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../helpers/formatClassString.ts", "../../../components/image-caption/image-caption.tsx", "../../../assets/article-image/article-image.tsx", "../../../components/article-body-image/article-body-image.tsx"],
4
- "sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "import type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts';\n\nexport interface ImageCaptionProps extends SharedProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string;\n /** Ex \"Paul Hansen\" */\n author?: string;\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string;\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean;\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({caption, author, imageType, classNames, attributes, forcePx}: ImageCaptionProps) => {\n const classes = formatClassString([\n 'ds-image-caption',\n forcePx && 'ds-force-px',\n classNames,\n ]);\n\n const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen' : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap' : null,\n ].filter(Boolean).join(' ');\n\n return (\n <figcaption className={classes} aria-hidden='true' {...attributes} >\n {/* This needs to be on the same line to maintain a space between the caption-span and author-span */}\n {caption && <span>{caption}</span>} {authorText && <span className={authorClasses}>{authorText}</span>}\n </figcaption>\n );\n};\n", "import { ComponentChild } from 'preact'\nimport type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { ImageCaption } from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.tsx'\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nexport interface ArticleImageProps extends SharedProps {\n image: ComponentChild\n caption?: string\n author?: string\n imageType?: string\n fullWidth?: boolean\n forcePx?: boolean\n}\n\nexport const ArticleImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image'\n const classes = formatClassString([componentClassName, forcePx && 'ds-force-px', classNames])\n const showCaption = !!caption || !!author\n\n return (\n <figure className={classes} {...attributes}>\n {fullWidth ? (\n <div className='ds-full-width-element'>{image}</div>\n ) : (\n image\n )}\n {showCaption && <ImageCaption caption={caption} author={author} imageType={imageType} forcePx={forcePx} />}\n </figure>\n )\n}\n", "import { ArticleImage, ArticleImageProps } from '../../assets/article-image/article-image'\nimport { formatClassString } from '../../helpers/formatClassString'\n\n/**\n * - 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)\n * - Storybook: [ArticleBodyImage](https://designsystem.dn.se/?path=/docs/article-articlebodyimage--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/article-body-image/article-body-image.scss'`\n */\nexport const ArticleBodyImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image--body'\n const classes = formatClassString([componentClassName, classNames])\n\n return (\n <ArticleImage\n image={image}\n caption={caption}\n author={author}\n imageType={imageType}\n fullWidth={fullWidth}\n forcePx={forcePx}\n classNames={classes}\n attributes={attributes}\n />\n )\n}\n"],
5
- "mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;ACoCI,SAEc,KAFd;AAjBG,IAAM,eAAe,CAAC,EAAC,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAO,MAAyB;AAChH,QAAM,UAAU,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAED,QAAM,aAAa,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAElH,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDAAgD,cAAc,WAAW,SAAS,KAClF,sCAAsC;AAAA,EAC5C,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YAEpD;AAAA,eAAW,oBAAC,UAAM,mBAAQ;AAAA,IAAQ;AAAA,IAAE,cAAc,oBAAC,UAAK,WAAW,eAAgB,sBAAW;AAAA,KACjG;AAEJ;;;ACdI,SAEI,OAAAA,MAFJ,QAAAC,aAAA;AAfG,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAC5F,QAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAEnC,SACE,gBAAAA,MAAC,YAAO,WAAW,SAAU,GAAG,YAC7B;AAAA,gBACC,gBAAAD,KAAC,SAAI,WAAU,yBAAyB,iBAAM,IAE9C;AAAA,IAED,eAAe,gBAAAA,KAAC,gBAAa,SAAkB,QAAgB,WAAsB,SAAkB;AAAA,KAC1G;AAEJ;;;ACdI,gBAAAE,YAAA;AAdG,IAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,UAAU,CAAC;AAElE,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["export const formatClassString = (classesArray: (string | undefined | false)[]): string => {\n return classesArray.filter((x) => !!x).join(' ')\n}\n", "import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nexport interface ImageCaptionProps extends SharedProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string\n /** Ex \"Paul Hansen\" */\n author?: string\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({ caption, author, imageType, classNames, attributes, forcePx }: ImageCaptionProps) => {\n const classes = formatClassString(['ds-image-caption', forcePx && 'ds-force-px', classNames])\n\n const authorText =\n imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen'\n : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap'\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <figcaption className={classes} aria-hidden='true' {...attributes}>\n {/* This needs to be on the same line to maintain a space between the caption-span and author-span */}\n {caption && <span>{caption}</span>} {authorText && <span className={authorClasses}>{authorText}</span>}\n </figcaption>\n )\n}\n", "import { ComponentChild } from 'preact'\n\nimport type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nimport { ImageCaption } from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.tsx'\n\nexport interface ArticleImageProps extends SharedProps {\n image: ComponentChild\n caption?: string\n author?: string\n imageType?: string\n fullWidth?: boolean\n forcePx?: boolean\n}\n\nexport const ArticleImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image'\n const classes = formatClassString([componentClassName, forcePx && 'ds-force-px', classNames])\n const showCaption = !!caption || !!author\n\n return (\n <figure className={classes} {...attributes}>\n {fullWidth ? <div className='ds-full-width-element'>{image}</div> : image}\n {showCaption && <ImageCaption caption={caption} author={author} imageType={imageType} forcePx={forcePx} />}\n </figure>\n )\n}\n", "import {\n ArticleImage,\n ArticleImageProps,\n} from '@bonniernews/dn-design-system-web/assets/article-image/article-image.tsx'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\n/**\n * - 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)\n * - Storybook: [ArticleBodyImage](https://designsystem.dn.se/?path=/docs/article-articlebodyimage--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/article-body-image/article-body-image.scss'`\n */\nexport const ArticleBodyImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image--body'\n const classes = formatClassString([componentClassName, classNames])\n\n return (\n <ArticleImage\n image={image}\n caption={caption}\n author={author}\n imageType={imageType}\n fullWidth={fullWidth}\n forcePx={forcePx}\n classNames={classes}\n attributes={attributes}\n />\n )\n}\n"],
5
+ "mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAyD;AACzF,SAAO,aAAa,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AACjD;;;ACsCI,SAEc,KAFd;AAlBG,IAAM,eAAe,CAAC,EAAE,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAQ,MAAyB;AAClH,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAE5F,QAAM,aACJ,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAEjG,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDACA,cAAc,WAAW,SAAS,KAChC,sCACA;AAAA,EACR,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YAEpD;AAAA,eAAW,oBAAC,UAAM,mBAAQ;AAAA,IAAQ;AAAA,IAAE,cAAc,oBAAC,UAAK,WAAW,eAAgB,sBAAW;AAAA,KACjG;AAEJ;;;ACbI,SACe,OAAAA,MADf,QAAAC,aAAA;AAfG,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAC5F,QAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAEnC,SACE,gBAAAA,MAAC,YAAO,WAAW,SAAU,GAAG,YAC7B;AAAA,gBAAY,gBAAAD,KAAC,SAAI,WAAU,yBAAyB,iBAAM,IAAS;AAAA,IACnE,eAAe,gBAAAA,KAAC,gBAAa,SAAkB,QAAgB,WAAsB,SAAkB;AAAA,KAC1G;AAEJ;;;ACTI,gBAAAE,YAAA;AAdG,IAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,UAAU,CAAC;AAElE,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": ["jsx", "jsxs", "jsx"]
7
7
  }
@@ -1,9 +1,9 @@
1
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-top-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-top-image)
3
+ * - GitHub: [BonnierNews/dn-design-system/web/src/components/article-top-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-top-image)
4
4
  * - Storybook: [ArticleTopImage](https://designsystem.dn.se/?path=/docs/article-articletopimage--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:
7
7
  * `@use '@bonniernews/dn-design-system-web/components/article-top-image/article-top-image.scss'`
8
8
  */
9
- export declare const ArticleTopImage: ({ caption, imageType, author, image, forcePx, classNames, attributes }: ArticleImageProps) => import("preact").JSX.Element;
9
+ export declare const ArticleTopImage: ({ caption, imageType, author, image, forcePx, classNames, attributes, }: ArticleImageProps) => import("preact").JSX.Element;
@@ -6,11 +6,7 @@ var formatClassString = (classesArray) => {
6
6
  // ../src/components/image-caption/image-caption.tsx
7
7
  import { jsx, jsxs } from "preact/jsx-runtime";
8
8
  var ImageCaption = ({ caption, author, imageType, classNames, attributes, forcePx }) => {
9
- const classes = formatClassString([
10
- "ds-image-caption",
11
- forcePx && "ds-force-px",
12
- classNames
13
- ]);
9
+ const classes = formatClassString(["ds-image-caption", forcePx && "ds-force-px", classNames]);
14
10
  const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;
15
11
  const authorClasses = [
16
12
  "ds-article-image__credits",
@@ -46,7 +42,15 @@ var ArticleImage = ({
46
42
 
47
43
  // ../src/components/article-top-image/article-top-image.tsx
48
44
  import { jsx as jsx3 } from "preact/jsx-runtime";
49
- var ArticleTopImage = ({ caption, imageType, author, image, forcePx, classNames, attributes }) => {
45
+ var ArticleTopImage = ({
46
+ caption,
47
+ imageType,
48
+ author,
49
+ image,
50
+ forcePx,
51
+ classNames,
52
+ attributes
53
+ }) => {
50
54
  const classes = formatClassString(["ds-article-image--top", classNames]);
51
55
  const imageParams = {
52
56
  fullWidth: true,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../helpers/formatClassString.ts", "../../../components/image-caption/image-caption.tsx", "../../../assets/article-image/article-image.tsx", "../../../components/article-top-image/article-top-image.tsx"],
4
- "sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "import type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts';\n\nexport interface ImageCaptionProps extends SharedProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string;\n /** Ex \"Paul Hansen\" */\n author?: string;\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string;\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean;\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({caption, author, imageType, classNames, attributes, forcePx}: ImageCaptionProps) => {\n const classes = formatClassString([\n 'ds-image-caption',\n forcePx && 'ds-force-px',\n classNames,\n ]);\n\n const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen' : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap' : null,\n ].filter(Boolean).join(' ');\n\n return (\n <figcaption className={classes} aria-hidden='true' {...attributes} >\n {/* This needs to be on the same line to maintain a space between the caption-span and author-span */}\n {caption && <span>{caption}</span>} {authorText && <span className={authorClasses}>{authorText}</span>}\n </figcaption>\n );\n};\n", "import { ComponentChild } from 'preact'\nimport type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { ImageCaption } from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.tsx'\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nexport interface ArticleImageProps extends SharedProps {\n image: ComponentChild\n caption?: string\n author?: string\n imageType?: string\n fullWidth?: boolean\n forcePx?: boolean\n}\n\nexport const ArticleImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image'\n const classes = formatClassString([componentClassName, forcePx && 'ds-force-px', classNames])\n const showCaption = !!caption || !!author\n\n return (\n <figure className={classes} {...attributes}>\n {fullWidth ? (\n <div className='ds-full-width-element'>{image}</div>\n ) : (\n image\n )}\n {showCaption && <ImageCaption caption={caption} author={author} imageType={imageType} forcePx={forcePx} />}\n </figure>\n )\n}\n", "import { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\nimport { ArticleImage, ArticleImageProps } from '@bonniernews/dn-design-system-web/assets/article-image/article-image.tsx'\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/article-top-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-top-image)\n * - Storybook: [ArticleTopImage](https://designsystem.dn.se/?path=/docs/article-articletopimage--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/article-top-image/article-top-image.scss'`\n */\nexport const ArticleTopImage = ({ caption, imageType, author, image, forcePx, classNames, attributes }: ArticleImageProps) => {\n const classes = formatClassString(['ds-article-image--top', classNames])\n\n const imageParams = {\n fullWidth: true,\n caption,\n imageType,\n author,\n image,\n forcePx,\n classNames: classes,\n attributes,\n }\n\n return (\n <ArticleImage {...imageParams} />\n )\n}\n"],
5
- "mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;ACoCI,SAEc,KAFd;AAjBG,IAAM,eAAe,CAAC,EAAC,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAO,MAAyB;AAChH,QAAM,UAAU,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAED,QAAM,aAAa,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAElH,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDAAgD,cAAc,WAAW,SAAS,KAClF,sCAAsC;AAAA,EAC5C,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YAEpD;AAAA,eAAW,oBAAC,UAAM,mBAAQ;AAAA,IAAQ;AAAA,IAAE,cAAc,oBAAC,UAAK,WAAW,eAAgB,sBAAW;AAAA,KACjG;AAEJ;;;ACdI,SAEI,OAAAA,MAFJ,QAAAC,aAAA;AAfG,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAC5F,QAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAEnC,SACE,gBAAAA,MAAC,YAAO,WAAW,SAAU,GAAG,YAC7B;AAAA,gBACC,gBAAAD,KAAC,SAAI,WAAU,yBAAyB,iBAAM,IAE9C;AAAA,IAED,eAAe,gBAAAA,KAAC,gBAAa,SAAkB,QAAgB,WAAsB,SAAkB;AAAA,KAC1G;AAEJ;;;ACbI,gBAAAE,YAAA;AAfG,IAAM,kBAAkB,CAAC,EAAE,SAAS,WAAW,QAAQ,OAAO,SAAS,YAAY,WAAW,MAAyB;AAC5H,QAAM,UAAU,kBAAkB,CAAC,yBAAyB,UAAU,CAAC;AAEvE,QAAM,cAAc;AAAA,IAClB,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACF;AAEA,SACE,gBAAAA,KAAC,gBAAc,GAAG,aAAa;AAEnC;",
4
+ "sourcesContent": ["export const formatClassString = (classesArray: (string | undefined | false)[]): string => {\n return classesArray.filter((x) => !!x).join(' ')\n}\n", "import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nexport interface ImageCaptionProps extends SharedProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string\n /** Ex \"Paul Hansen\" */\n author?: string\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({ caption, author, imageType, classNames, attributes, forcePx }: ImageCaptionProps) => {\n const classes = formatClassString(['ds-image-caption', forcePx && 'ds-force-px', classNames])\n\n const authorText =\n imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen'\n : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap'\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <figcaption className={classes} aria-hidden='true' {...attributes}>\n {/* This needs to be on the same line to maintain a space between the caption-span and author-span */}\n {caption && <span>{caption}</span>} {authorText && <span className={authorClasses}>{authorText}</span>}\n </figcaption>\n )\n}\n", "import { ComponentChild } from 'preact'\n\nimport type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\nimport { ImageCaption } from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.tsx'\n\nexport interface ArticleImageProps extends SharedProps {\n image: ComponentChild\n caption?: string\n author?: string\n imageType?: string\n fullWidth?: boolean\n forcePx?: boolean\n}\n\nexport const ArticleImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image'\n const classes = formatClassString([componentClassName, forcePx && 'ds-force-px', classNames])\n const showCaption = !!caption || !!author\n\n return (\n <figure className={classes} {...attributes}>\n {fullWidth ? <div className='ds-full-width-element'>{image}</div> : image}\n {showCaption && <ImageCaption caption={caption} author={author} imageType={imageType} forcePx={forcePx} />}\n </figure>\n )\n}\n", "import {\n ArticleImage,\n ArticleImageProps,\n} from '@bonniernews/dn-design-system-web/assets/article-image/article-image.tsx'\n\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/web/src/components/article-top-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-top-image)\n * - Storybook: [ArticleTopImage](https://designsystem.dn.se/?path=/docs/article-articletopimage--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/article-top-image/article-top-image.scss'`\n */\nexport const ArticleTopImage = ({\n caption,\n imageType,\n author,\n image,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const classes = formatClassString(['ds-article-image--top', classNames])\n\n const imageParams = {\n fullWidth: true,\n caption,\n imageType,\n author,\n image,\n forcePx,\n classNames: classes,\n attributes,\n }\n\n return <ArticleImage {...imageParams} />\n}\n"],
5
+ "mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAyD;AACzF,SAAO,aAAa,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AACjD;;;ACsCI,SAEc,KAFd;AAlBG,IAAM,eAAe,CAAC,EAAE,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAQ,MAAyB;AAClH,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAE5F,QAAM,aACJ,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAEjG,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDACA,cAAc,WAAW,SAAS,KAChC,sCACA;AAAA,EACR,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YAEpD;AAAA,eAAW,oBAAC,UAAM,mBAAQ;AAAA,IAAQ;AAAA,IAAE,cAAc,oBAAC,UAAK,WAAW,eAAgB,sBAAW;AAAA,KACjG;AAEJ;;;ACbI,SACe,OAAAA,MADf,QAAAC,aAAA;AAfG,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAC5F,QAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAEnC,SACE,gBAAAA,MAAC,YAAO,WAAW,SAAU,GAAG,YAC7B;AAAA,gBAAY,gBAAAD,KAAC,SAAI,WAAU,yBAAyB,iBAAM,IAAS;AAAA,IACnE,eAAe,gBAAAA,KAAC,gBAAa,SAAkB,QAAgB,WAAsB,SAAkB;AAAA,KAC1G;AAEJ;;;ACDS,gBAAAE,YAAA;AAtBF,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,UAAU,kBAAkB,CAAC,yBAAyB,UAAU,CAAC;AAEvE,QAAM,cAAc;AAAA,IAClB,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACF;AAEA,SAAO,gBAAAA,KAAC,gBAAc,GAAG,aAAa;AACxC;",
6
6
  "names": ["jsx", "jsxs", "jsx"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { SharedProps } from "@bonniernews/dn-design-system-web/assets/types/shared-props.ts";
1
+ import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts';
2
2
  export interface BlockedContentProps extends SharedProps {
3
3
  title: string;
4
4
  body: string;
@@ -9,7 +9,7 @@ export interface BlockedContentProps extends SharedProps {
9
9
  };
10
10
  }
11
11
  /**
12
- * - GitHub: [BonnierNews/dn-design-system/../web/src/components/blocked-content](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/blocked-content)
12
+ * - GitHub: [BonnierNews/dn-design-system/web/src/components/blocked-content](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/blocked-content)
13
13
  * - Storybook: [BlockedContent](https://designsystem.dn.se/?path=/docs/article-blockedcontent--docs)
14
14
  *
15
15
  * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
@@ -161,23 +161,28 @@ var Button = ({
161
161
  attributes,
162
162
  forcePx = false
163
163
  }) => {
164
- return /* @__PURE__ */ jsx5(ButtonBase, { ...{
165
- text,
166
- disabled,
167
- variant,
168
- size,
169
- fullWidth,
170
- mobileFullWidth,
171
- iconPosition,
172
- iconName,
173
- loading,
174
- type,
175
- href,
176
- isIconButton,
177
- classNames,
178
- attributes,
179
- forcePx
180
- } });
164
+ return /* @__PURE__ */ jsx5(
165
+ ButtonBase,
166
+ {
167
+ ...{
168
+ text,
169
+ disabled,
170
+ variant,
171
+ size,
172
+ fullWidth,
173
+ mobileFullWidth,
174
+ iconPosition,
175
+ iconName,
176
+ loading,
177
+ type,
178
+ href,
179
+ isIconButton,
180
+ classNames,
181
+ attributes,
182
+ forcePx
183
+ }
184
+ }
185
+ );
181
186
  };
182
187
 
183
188
  // ../src/components/blocked-content/blocked-content.tsx
@@ -192,11 +197,7 @@ var BlockedContent = ({
192
197
  elementAttributes = {}
193
198
  }) => {
194
199
  const componentClassName = "ds-blocked-content";
195
- const classes = [
196
- componentClassName,
197
- forcePx ? "ds-force-px" : "",
198
- classNames
199
- ].filter(Boolean).join(" ");
200
+ const classes = formatClassString([componentClassName, forcePx ? "ds-force-px" : "", classNames]);
200
201
  return /* @__PURE__ */ jsx6("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsxs3("div", { className: `${componentClassName}__inner`, children: [
201
202
  /* @__PURE__ */ jsxs3("div", { className: `${componentClassName}__content`, children: [
202
203
  /* @__PURE__ */ jsx6("h2", { className: `${componentClassName}__title`, children: title }),