@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.
- package/.prettierignore +10 -0
- package/.prettierrc +20 -1
- package/CHANGELOG.md +14 -0
- package/assets/types/shared-props.ts +6 -6
- package/assets/types/teaser-props.ts +20 -20
- package/components/article-body-image/README.md +1 -1
- package/components/article-top-image/README.md +1 -1
- package/components/blocked-content/README.md +1 -1
- package/components/blocked-content/blocked-content.js +16 -19
- package/components/buddy-menu/README.md +1 -1
- package/components/button/README.md +3 -4
- package/components/button/button-interactions.js +11 -14
- package/components/button/button-types.ts +29 -36
- package/components/button-toggle/README.md +1 -1
- package/components/byline/README.md +1 -1
- package/components/byline/byline-interaction.js +5 -5
- package/components/byline-list/README.md +1 -1
- package/components/byline-list/byline-list.js +3 -6
- package/components/checkbox/README.md +1 -1
- package/components/direkt-circle/README.md +1 -1
- package/components/direkt-header/README.md +1 -1
- package/components/disclaimer/README.md +1 -1
- package/components/divider/README.md +1 -1
- package/components/empty-state/README.md +1 -1
- package/components/factbox/README.md +35 -0
- package/components/factbox/factbox.js +6 -9
- package/components/footer/README.md +1 -1
- package/components/game-header/README.md +1 -1
- package/components/group-header/README-njk.md +2 -2
- package/components/group-header/README.md +2 -2
- package/components/image-caption/README.md +1 -1
- package/components/link-box/README.md +1 -1
- package/components/list-item/README.md +70 -0
- package/components/list-item/list-item-types.ts +4 -3
- package/components/list-item/list-item.js +5 -8
- package/components/mask/README.md +1 -1
- package/components/modal/README.md +1 -1
- package/components/modal/modal.js +20 -24
- package/components/pagination/README.md +1 -1
- package/components/pictogram/README.md +1 -1
- package/components/pill/README.md +1 -1
- package/components/profile-header/README.md +1 -1
- package/components/quote/README.md +1 -1
- package/components/radio-button/README.md +1 -1
- package/components/spinner/README.md +1 -1
- package/components/switch/README.md +1 -1
- package/components/tag-header/README.md +1 -1
- package/components/teaser-card/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-card/README.md +2 -2
- package/components/teaser-centered/README.md +2 -2
- package/components/teaser-counter/README.md +2 -2
- package/components/teaser-dot/README.md +1 -1
- package/components/teaser-footer/README.md +1 -1
- package/components/teaser-image/README.md +1 -1
- package/components/teaser-large/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-large/README.md +2 -2
- package/components/teaser-list-swipe/README.md +2 -2
- package/components/teaser-list-vertical/README-njk.md +0 -1
- package/components/teaser-list-vertical/README.md +1 -1
- package/components/teaser-list-vertical/teaser-list-vertical.js +7 -10
- package/components/teaser-longlife/README.md +1 -1
- package/components/teaser-native/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-native/README.md +1 -1
- package/components/teaser-onsite/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-onsite/README.md +2 -2
- package/components/teaser-package/README.md +1 -1
- package/components/teaser-right-now/README.md +2 -2
- package/components/teaser-slideshow/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-slideshow/README.md +3 -3
- package/components/teaser-split/README-container-njk.md +1 -1
- package/components/teaser-split/README-njk.md +2 -2
- package/components/teaser-standard/README-njk.md +1 -1
- package/components/teaser-standard/README.md +2 -2
- package/components/teaser-standard/teaser-standard.js +11 -14
- package/components/teaser-swipe-card/README.md +2 -2
- package/components/teaser-text-on-image/README.md +2 -2
- package/components/teaser-tipsa/{README-NJK.md → README-njk.md} +1 -1
- package/components/teaser-tipsa/README.md +2 -2
- package/components/text-button/README.md +1 -1
- package/components/text-button-toggle/README.md +1 -1
- package/components/text-button-toggle/text-button-toggle.js +7 -10
- package/components/text-input/README.md +1 -1
- package/components/text-input/text-input-interactions.js +16 -16
- package/components/text-input/text-input.js +10 -10
- package/components/thematic-break/README.md +1 -1
- package/components/tooltip/README.md +13 -5
- package/components/tooltip/tooltip.js +11 -17
- package/components/video-caption/README.md +1 -1
- package/helpers/formatClassString.ts +2 -2
- package/index.d.ts +1 -1
- package/package.json +5 -1
- package/preact/assets/article-image/article-image.d.ts +1 -1
- package/preact/assets/form-field/form-field.d.ts +2 -2
- package/preact/components/article-body-image/article-body-image.d.ts +2 -2
- package/preact/components/article-body-image/article-body-image.js +1 -5
- package/preact/components/article-body-image/article-body-image.js.map +2 -2
- package/preact/components/article-top-image/article-top-image.d.ts +2 -2
- package/preact/components/article-top-image/article-top-image.js +10 -6
- package/preact/components/article-top-image/article-top-image.js.map +2 -2
- package/preact/components/blocked-content/blocked-content.d.ts +2 -2
- package/preact/components/blocked-content/blocked-content.js +23 -22
- package/preact/components/blocked-content/blocked-content.js.map +2 -2
- package/preact/components/buddy-menu/buddy-menu.d.ts +2 -2
- package/preact/components/buddy-menu/buddy-menu.js +22 -17
- package/preact/components/buddy-menu/buddy-menu.js.map +2 -2
- package/preact/components/button/button-base.js.map +2 -2
- package/preact/components/button/button.d.ts +4 -4
- package/preact/components/button/button.js +22 -17
- package/preact/components/button/button.js.map +2 -2
- package/preact/components/button-toggle/button-toggle.d.ts +2 -2
- package/preact/components/button-toggle/button-toggle.js.map +2 -2
- package/preact/components/byline/byline.d.ts +2 -2
- package/preact/components/byline/byline.js +185 -170
- package/preact/components/byline/byline.js.map +3 -3
- package/preact/components/byline-list/byline-list.d.ts +4 -4
- package/preact/components/byline-list/byline-list.js +32 -21
- package/preact/components/byline-list/byline-list.js.map +2 -2
- package/preact/components/checkbox/checkbox.d.ts +2 -2
- package/preact/components/checkbox/checkbox.js +9 -1
- package/preact/components/checkbox/checkbox.js.map +2 -2
- package/preact/components/direkt-circle/direkt-circle.d.ts +2 -2
- package/preact/components/direkt-circle/direkt-circle.js.map +2 -2
- package/preact/components/direkt-header/direkt-header.d.ts +2 -2
- package/preact/components/direkt-header/direkt-header.js.map +2 -2
- package/preact/components/disclaimer/disclaimer.d.ts +3 -3
- package/preact/components/disclaimer/disclaimer.js.map +2 -2
- package/preact/components/divider/divider.d.ts +2 -2
- package/preact/components/divider/divider.js +1 -5
- package/preact/components/divider/divider.js.map +2 -2
- package/preact/components/empty-state/empty-state.d.ts +2 -2
- package/preact/components/empty-state/empty-state.js +31 -23
- package/preact/components/empty-state/empty-state.js.map +2 -2
- package/preact/components/factbox/factbox.d.ts +5 -5
- package/preact/components/factbox/factbox.js +448 -293
- package/preact/components/factbox/factbox.js.map +4 -4
- package/preact/components/footer/footer.d.ts +2 -2
- package/preact/components/footer/footer.js +18 -9
- package/preact/components/footer/footer.js.map +2 -2
- package/preact/components/game-header/game-header.d.ts +3 -3
- package/preact/components/game-header/game-header.js +17 -6
- package/preact/components/game-header/game-header.js.map +2 -2
- package/preact/components/group-header/group-header.d.ts +4 -4
- package/preact/components/group-header/group-header.js +23 -17
- package/preact/components/group-header/group-header.js.map +2 -2
- package/preact/components/icon-sprite/icon-sprite.d.ts +2 -2
- package/preact/components/icon-sprite/icon-sprite.js +5 -5
- package/preact/components/icon-sprite/icon-sprite.js.map +3 -3
- package/preact/components/icon-with-wrapper/icon-with-wrapper.d.ts +3 -3
- package/preact/components/icon-with-wrapper/icon-with-wrapper.js +13 -6
- package/preact/components/icon-with-wrapper/icon-with-wrapper.js.map +3 -3
- package/preact/components/image-caption/image-caption.d.ts +2 -2
- package/preact/components/image-caption/image-caption.js +1 -5
- package/preact/components/image-caption/image-caption.js.map +2 -2
- package/preact/components/link-box/link-box-item.d.ts +1 -1
- package/preact/components/link-box/link-box-item.js.map +2 -2
- package/preact/components/link-box/link-box.d.ts +3 -3
- package/preact/components/link-box/link-box.js +24 -21
- package/preact/components/link-box/link-box.js.map +2 -2
- package/preact/components/list-item/list-item-types.d.ts +3 -3
- package/preact/components/list-item/list-item.d.ts +19 -1
- package/preact/components/list-item/list-item.js +208 -206
- package/preact/components/list-item/list-item.js.map +4 -4
- package/preact/components/mask/mask.d.ts +3 -3
- package/preact/components/mask/mask.js.map +2 -2
- package/preact/components/modal/modal.d.ts +2 -2
- package/preact/components/modal/modal.js +22 -17
- package/preact/components/modal/modal.js.map +2 -2
- package/preact/components/pagination/pagination.d.ts +1 -1
- package/preact/components/pagination/pagination.js +3 -20
- package/preact/components/pagination/pagination.js.map +2 -2
- package/preact/components/pictogram/pictogram.d.ts +2 -2
- package/preact/components/pictogram/pictogram.js +8 -1
- package/preact/components/pictogram/pictogram.js.map +2 -2
- package/preact/components/pill/pill.d.ts +3 -3
- package/preact/components/pill/pill.js +1 -8
- package/preact/components/pill/pill.js.map +2 -2
- package/preact/components/profile-header/profile-header.d.ts +3 -3
- package/preact/components/profile-header/profile-header.js.map +2 -2
- package/preact/components/quote/quote.d.ts +2 -2
- package/preact/components/quote/quote.js +1 -6
- package/preact/components/quote/quote.js.map +2 -2
- package/preact/components/radio-button/radio-button.d.ts +2 -2
- package/preact/components/radio-button/radio-button.js +9 -1
- package/preact/components/radio-button/radio-button.js.map +2 -2
- package/preact/components/spinner/spinner.d.ts +2 -2
- package/preact/components/spinner/spinner.js.map +2 -2
- package/preact/components/switch/switch.d.ts +2 -2
- package/preact/components/switch/switch.js.map +2 -2
- package/preact/components/tag-header/tag-header.d.ts +2 -2
- package/preact/components/tag-header/tag-header.js.map +2 -2
- package/preact/components/teaser-card/teaser-card.d.ts +5 -5
- package/preact/components/teaser-card/teaser-card.js +9 -2
- package/preact/components/teaser-card/teaser-card.js.map +2 -2
- package/preact/components/teaser-centered/teaser-centered.d.ts +4 -4
- package/preact/components/teaser-centered/teaser-centered.js +48 -40
- package/preact/components/teaser-centered/teaser-centered.js.map +4 -4
- package/preact/components/teaser-counter/teaser-counter.d.ts +2 -2
- package/preact/components/teaser-counter/teaser-counter.js +31 -24
- package/preact/components/teaser-counter/teaser-counter.js.map +4 -4
- package/preact/components/teaser-dot/teaser-dot.d.ts +3 -3
- package/preact/components/teaser-dot/teaser-dot.js +1 -6
- package/preact/components/teaser-dot/teaser-dot.js.map +2 -2
- package/preact/components/teaser-footer/teaser-footer.d.ts +2 -2
- package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
- package/preact/components/teaser-image/teaser-image.d.ts +3 -3
- package/preact/components/teaser-image/teaser-image.js +1 -5
- package/preact/components/teaser-image/teaser-image.js.map +2 -2
- package/preact/components/teaser-large/teaser-large.d.ts +3 -3
- package/preact/components/teaser-large/teaser-large.js +72 -73
- package/preact/components/teaser-large/teaser-large.js.map +4 -4
- package/preact/components/teaser-list-swipe/teaser-list-swipe.d.ts +2 -2
- package/preact/components/teaser-list-swipe/teaser-list-swipe.js +60 -48
- package/preact/components/teaser-list-swipe/teaser-list-swipe.js.map +4 -4
- package/preact/components/teaser-list-vertical/teaser-list-vertical.d.ts +2 -2
- package/preact/components/teaser-list-vertical/teaser-list-vertical.js +23 -17
- package/preact/components/teaser-list-vertical/teaser-list-vertical.js.map +2 -2
- package/preact/components/teaser-longlife/teaser-longlife.d.ts +1 -1
- package/preact/components/teaser-longlife/teaser-longlife.js +33 -27
- package/preact/components/teaser-longlife/teaser-longlife.js.map +4 -4
- package/preact/components/teaser-native/teaser-native.d.ts +2 -2
- package/preact/components/teaser-native/teaser-native.js +36 -35
- package/preact/components/teaser-native/teaser-native.js.map +4 -4
- package/preact/components/teaser-onsite/teaser-onsite.d.ts +4 -4
- package/preact/components/teaser-onsite/teaser-onsite.js +44 -37
- package/preact/components/teaser-onsite/teaser-onsite.js.map +4 -4
- package/preact/components/teaser-package/teaser-package.d.ts +2 -2
- package/preact/components/teaser-package/teaser-package.js +33 -18
- package/preact/components/teaser-package/teaser-package.js.map +2 -2
- package/preact/components/teaser-right-now/teaser-right-now.d.ts +4 -4
- package/preact/components/teaser-right-now/teaser-right-now.js +37 -28
- package/preact/components/teaser-right-now/teaser-right-now.js.map +4 -4
- package/preact/components/teaser-slideshow/teaser-slideshow.d.ts +3 -3
- package/preact/components/teaser-slideshow/teaser-slideshow.js +43 -34
- package/preact/components/teaser-slideshow/teaser-slideshow.js.map +4 -4
- package/preact/components/teaser-split/teaser-split.d.ts +4 -4
- package/preact/components/teaser-split/teaser-split.js +10 -9
- package/preact/components/teaser-split/teaser-split.js.map +2 -2
- package/preact/components/teaser-standard/teaser-standard.d.ts +1 -1
- package/preact/components/teaser-standard/teaser-standard.js +10 -9
- package/preact/components/teaser-standard/teaser-standard.js.map +2 -2
- package/preact/components/teaser-swipe-card/teaser-swipe-card.d.ts +1 -1
- package/preact/components/teaser-swipe-card/teaser-swipe-card.js +30 -24
- package/preact/components/teaser-swipe-card/teaser-swipe-card.js.map +4 -4
- package/preact/components/teaser-text-on-image/teaser-text-on-image.d.ts +4 -4
- package/preact/components/teaser-text-on-image/teaser-text-on-image.js +45 -37
- package/preact/components/teaser-text-on-image/teaser-text-on-image.js.map +4 -4
- package/preact/components/teaser-tipsa/teaser-tipsa.d.ts +2 -2
- package/preact/components/teaser-tipsa/teaser-tipsa.js +33 -32
- package/preact/components/teaser-tipsa/teaser-tipsa.js.map +4 -4
- package/preact/components/text-button/text-button.d.ts +2 -2
- package/preact/components/text-button/text-button.js +4 -4
- package/preact/components/text-button/text-button.js.map +3 -3
- package/preact/components/text-button-toggle/text-button-toggle.d.ts +3 -3
- package/preact/components/text-button-toggle/text-button-toggle.js.map +2 -2
- package/preact/components/text-input/text-input.d.ts +2 -2
- package/preact/components/text-input/text-input.js +9 -1
- package/preact/components/text-input/text-input.js.map +2 -2
- package/preact/components/thematic-break/thematic-break.d.ts +2 -2
- package/preact/components/thematic-break/thematic-break.js +1 -4
- package/preact/components/thematic-break/thematic-break.js.map +2 -2
- package/preact/components/tooltip/tooltip.d.ts +2 -2
- package/preact/components/tooltip/tooltip.js +22 -17
- package/preact/components/tooltip/tooltip.js.map +2 -2
- package/preact/components/video-caption/video-caption.d.ts +2 -2
- package/preact/components/video-caption/video-caption.js +6 -10
- package/preact/components/video-caption/video-caption.js.map +3 -3
- package/types-lib/ds-color.d.ts +95 -95
- package/types-lib/ds-icon.d.ts +98 -98
- package/components/article-body-image/README-UXD.md +0 -0
- package/components/article-top-image/README-UXD.md +0 -0
- package/components/blocked-content/README-UXD.md +0 -0
- package/components/buddy-menu/README-UXD.md +0 -0
- package/components/byline/README-UXD.md +0 -0
- package/components/byline-list-item/README-UXD.md +0 -0
- package/components/checkbox/README-UXD.md +0 -0
- package/components/direkt-circle/README-UXD.md +0 -0
- package/components/divider/README-UXD.md +0 -0
- package/components/floating-button/README-UXD.md +0 -0
- package/components/footer/README-UXD.md +0 -0
- package/components/game-header/README-UXD.md +0 -0
- package/components/icon-sprite/README-UXD.md +0 -0
- package/components/icon-with-wrapper/README-UXD.md +0 -0
- package/components/image-caption/README-UXD.md +0 -0
- package/components/modal/README-UXD.md +0 -0
- package/components/profile-header/README-UXD.md +0 -0
- package/components/quote/README-UXD.md +0 -0
- package/components/radio-button/README-UXD.md +0 -0
- package/components/spinner/README-UXD.md +0 -0
- package/components/switch/README-UXD.md +0 -0
- package/components/teaser-card/README-UXD.md +0 -0
- package/components/teaser-footer/README-UXD.md +0 -0
- package/components/teaser-onsite/README-UXD.md +0 -0
- package/components/text-input/README-UXD.md +0 -0
- package/components/thematic-break/README-UXD.md +0 -0
- package/components/video-caption/README-UXD.md +0 -0
- package/foundations/helpers/README-UXD.md +0 -0
- package/foundations/typography/README-UXD.md +0 -0
- package/introduction/README-UXD.md +0 -1
- package/preact/assets/types/shared-props.d.ts +0 -6
- package/preact/assets/types/teaser-props.d.ts +0 -44
- package/preact/foundations/a11y/visually-hidden.d.ts +0 -4
- package/preact/foundations/icons/grade-icon.d.ts +0 -9
- package/preact/helpers/formatClassString.d.ts +0 -1
- package/preact/helpers/stringToHtml.d.ts +0 -6
- package/preact/helpers/teaser.d.ts +0 -21
- /package/components/article-body-image/{README-NJK.md → README-njk.md} +0 -0
- /package/components/blocked-content/{README-NJK.md → README-njk.md} +0 -0
- /package/components/buddy-menu/{README-NJK.md → README-njk.md} +0 -0
- /package/components/button/{README-NJK.md → README-njk.md} +0 -0
- /package/components/button-toggle/{README-NJK.md → README-njk.md} +0 -0
- /package/components/byline/{README-NJK.md → README-njk.md} +0 -0
- /package/components/checkbox/{README-NJK.md → README-njk.md} +0 -0
- /package/components/direkt-circle/{README-NJK.md → README-njk.md} +0 -0
- /package/components/divider/{README-NJK.md → README-njk.md} +0 -0
- /package/components/empty-state/{README-NJK.md → README-njk.md} +0 -0
- /package/components/factbox/{README-NJK.md → README-njk.md} +0 -0
- /package/components/footer/{README-NJK.md → README-njk.md} +0 -0
- /package/components/icon-sprite/{README-NJK.md → README-njk.md} +0 -0
- /package/components/image-caption/{README-NJK.md → README-njk.md} +0 -0
- /package/components/list-item/{README-NJK.md → README-njk.md} +0 -0
- /package/components/mask/{README-NJK.md → README-njk.md} +0 -0
- /package/components/modal/{README-NJK.md → README-njk.md} +0 -0
- /package/components/pagination/{README-NJK.md → README-njk.md} +0 -0
- /package/components/pictogram/{README-NJK.md → README-njk.md} +0 -0
- /package/components/quote/{README-NJK.md → README-njk.md} +0 -0
- /package/components/radio-button/{README-NJK.md → README-njk.md} +0 -0
- /package/components/spinner/{README-NJK.md → README-njk.md} +0 -0
- /package/components/switch/{README-NJK.md → README-njk.md} +0 -0
- /package/components/teaser-centered/{README-NJK.md → README-njk.md} +0 -0
- /package/components/teaser-dot/{README-NJK.md → README-njk.md} +0 -0
- /package/components/teaser-image/{README-NJK.md → README-njk.md} +0 -0
- /package/components/teaser-right-now/{README-NJK.md → README-njk.md} +0 -0
- /package/components/teaser-text-on-image/{README-NJK.md → README-njk.md} +0 -0
- /package/components/text-button/{README-NJK.md → README-njk.md} +0 -0
- /package/components/text-input/{README-NJK.md → README-njk.md} +0 -0
- /package/components/thematic-break/{README-NJK.md → README-njk.md} +0 -0
- /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"
|
|
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"
|
|
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"
|
|
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
|
|
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", "
|
|
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
|
|
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
|
|
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", "
|
|
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"
|
|
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
|
|
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", "
|
|
13
|
+
| areaType | "right", "bauta", "main" | \- |
|
|
14
14
|
| targetLink | string | \- |
|
|
15
|
-
| theme | "
|
|
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"
|
|
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
|
-
|
|
16
|
-
|areaType | String | no | "right" or "bauta"
|
|
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"
|
|
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
|
|
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", "
|
|
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(
|
|
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(
|
|
17
|
-
teaser.classList.add(
|
|
18
|
-
teaser.classList.add(
|
|
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(
|
|
18
|
+
teaser.setAttribute('href', params.targetLink);
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
if (params.title) {
|
|
25
|
-
const titleEl = teaser.getElementsByClassName(
|
|
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(
|
|
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(
|
|
46
|
+
const jsTeasers = Array.from(document.getElementsByClassName('js-ds-teaser-standard-story'));
|
|
50
47
|
jsTeasers.forEach((teaserEl) => {
|
|
51
|
-
const params = JSON.parse(teaserEl.getAttribute(
|
|
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
|
|
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", "
|
|
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
|
|
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 | \- |
|
|
@@ -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"
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
10
|
-
if (toggleEl.classList.contains(
|
|
11
|
-
toggleEl.classList.toggle(
|
|
12
|
-
const ariaChecked = toggleEl.getAttribute(
|
|
13
|
-
toggleEl.setAttribute(
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
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 =
|
|
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(
|
|
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(
|
|
20
|
-
const tooltipClick = e.target.closest(
|
|
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(
|
|
24
|
+
const closeButtons = Array.from(tooltipEl.getElementsByClassName('ds-tooltip__close'));
|
|
31
25
|
closeButtons.forEach((button) => {
|
|
32
|
-
button.addEventListener(
|
|
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(
|
|
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
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "32.7.
|
|
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
|
|
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
|
|
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 '
|
|
1
|
+
import { ArticleImageProps } from '@bonniernews/dn-design-system-web/assets/article-image/article-image.tsx';
|
|
2
2
|
/**
|
|
3
|
-
* - GitHub: [BonnierNews/dn-design-system
|
|
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:
|