@bonniernews/dn-design-system-web 32.4.9 → 32.5.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [32.5.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.5.0...@bonniernews/dn-design-system-web@32.5.1) (2025-06-02)
8
+
9
+
10
+ ### Maintenance
11
+
12
+ * **foundations:** sort typography variables ([#1762](https://github.com/BonnierNews/dn-design-system/issues/1762)) ([36caa8b](https://github.com/BonnierNews/dn-design-system/commit/36caa8b83ac73bd9f148b2fe62b9f70cbaa98ea7))
13
+ * prerelease packages ([f9cfd76](https://github.com/BonnierNews/dn-design-system/commit/f9cfd764d36094c7001c029ee1b8563442dab866))
14
+
15
+ ## [32.5.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.4.9...@bonniernews/dn-design-system-web@32.5.0) (2025-06-02)
16
+
17
+
18
+ ### Features
19
+
20
+ * **web:** byline list item tsx ([#1749](https://github.com/BonnierNews/dn-design-system/issues/1749)) ([93d50b8](https://github.com/BonnierNews/dn-design-system/commit/93d50b8832afba8383396a65dc60e73d536385e1))
21
+
22
+
23
+ ### Maintenance
24
+
25
+ * **web:** add cloudflare to white lists ([#1761](https://github.com/BonnierNews/dn-design-system/issues/1761)) ([0046451](https://github.com/BonnierNews/dn-design-system/commit/0046451d880d3a7910fbc0e4411e5ba0fba480a1))
26
+
7
27
  ## [32.4.9](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.4.8...@bonniernews/dn-design-system-web@32.4.9) (2025-05-30)
8
28
 
9
29
 
@@ -0,0 +1,31 @@
1
+ BylineList
2
+ ==========
3
+
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/byline-list](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/byline-list)
5
+ * Storybook: [Byline-list](https://designsystem.dn.se/?path=/docs/article-byline-list--docs)
6
+
7
+ BylineList is a component that renders a list of bylines with optional media and titles. It is used for the sheet that displays if we click a byline with more than one author.
8
+
9
+ **This is only implemented in tsx. Nkj files are not implemented. They are still using the old list item component.**
10
+
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/byline-list/byline-list.scss'`
12
+
13
+ | Name | Description | Default |
14
+ |:--- | :--- | :--- |
15
+ | bylines\* | { authorName?: string; bylineImage?: string; authorPageUrl?: string; role?: string; border?: boolean; followable?: boolean; followed?: boolean; listItemClassNames?: string; attributes?: { \[key: string\]: string; }; linkAttributes?: { ...; }; buttonAttributes?: { ...; }; buttonClassNames?: string; }\[\] | \- |
16
+ | attributes | { \[key: string\]: string; } | \- |
17
+ | forcePx | boolean | \- |
18
+ | classNames | string | \- |
19
+
20
+ ```jsx
21
+ <BylineList
22
+ bylines={[
23
+ {
24
+ authorName: 'Byline link',
25
+ authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
26
+ bylineImage: '<div class="picture lazy-image" style="aspect-ratio: 1 / 1"><img class="picture__img picture__img--fullheight" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&amp;crop=261:261;81,2&amp;resize=44:44&amp;output-quality=80" srcset="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&amp;crop=261:261;81,2&amp;resize=44:44&amp;output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&amp;crop=261:261;81,2&amp;resize=88:88&amp;output-quality=60 88w" sizes="44px" alt="" aria-hidden="true"></div>',
27
+ role: 'Grafik'
28
+ }
29
+ ]}
30
+ />
31
+ ```
@@ -0,0 +1,22 @@
1
+ import { dsButtonToggle } from '@bonniernews/dn-design-system-web/components/button/button-interactions.js';
2
+
3
+ export {
4
+ dsBylineList,
5
+ dsBylineListAll
6
+ };
7
+
8
+ function dsBylineList(listElements = []) {
9
+ if (!listElements.length) return;
10
+ listElements.forEach((listEl) => {
11
+ const toggleElements = Array.from(listEl.getElementsByClassName("ds-btn--toggle"));
12
+ dsButtonToggle(toggleElements);
13
+ if (listEl.classList.contains('ds-btn--toggle')) {
14
+ dsButtonToggle(listEl);
15
+ }
16
+ });
17
+ }
18
+
19
+ function dsBylineListAll() {
20
+ const listElements = Array.from(document.getElementsByClassName("ds-byline-list__item__content"));
21
+ dsBylineList(listElements);
22
+ }
@@ -0,0 +1,160 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../icon-sprite/icon-sprite.scss";
3
+ @use "../button-toggle/button-toggle.scss" as *;
4
+
5
+ $ds-byline-list__icon-size: 24px;
6
+ $ds-byline-list__portrait-size: 44px;
7
+
8
+ .ds-byline-list {
9
+ list-style: none;
10
+ margin: 0;
11
+ padding: ds-spacing(0 $ds-s-100);
12
+
13
+ .ds-byline-list__item {
14
+ background-color: transparent;
15
+ border: 0;
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: center;
19
+ justify-content: center;
20
+ width: 100%;
21
+ list-style: none;
22
+ line-height: 0;
23
+ position: relative;
24
+
25
+ &.ds-byline-list__item--border::after {
26
+ content: "";
27
+ width: 100%;
28
+ height: ds-border-width(xxs);
29
+ background: $ds-color-border-primary;
30
+ position: absolute;
31
+ bottom: 0;
32
+ }
33
+
34
+ .ds-byline-list__item__content {
35
+ box-sizing: border-box;
36
+ border-radius: 0;
37
+ margin: 0;
38
+ display: flex;
39
+ gap: ds-spacing($ds-s-100);
40
+ align-items: center;
41
+ justify-content: space-between;
42
+ padding: ds-spacing($ds-s-100 0);
43
+ width: 100%;
44
+ border: none;
45
+ background: none;
46
+ }
47
+
48
+ a.ds-byline-list__item__content {
49
+ cursor: pointer;
50
+ color: $ds-color-text-primary;
51
+ text-decoration: none;
52
+ /* full-element links are covered by the opacity hover effect - adding underlines makes it too busy */
53
+
54
+ @include ds-hover(true) {
55
+ opacity: 0.6;
56
+ }
57
+
58
+ &:active {
59
+ opacity: 0.6;
60
+ }
61
+ &:focus-visible {
62
+ outline: ds-border-width(xs) solid $ds-color-border-primary-strongest;
63
+ outline-offset: -2px;
64
+ }
65
+ }
66
+
67
+ .ds-byline-list__item__icon-right {
68
+ color: $ds-color-text-primary;
69
+ display: inline-flex;
70
+
71
+ .ds-icon {
72
+ position: relative;
73
+ display: flex;
74
+ height: ds-px-to-rem($ds-byline-list__icon-size);
75
+ width: ds-px-to-rem($ds-byline-list__icon-size);
76
+ margin: 0;
77
+
78
+ @at-root .ds-force-px#{&} {
79
+ height: $ds-byline-list__icon-size;
80
+ width: $ds-byline-list__icon-size;
81
+ }
82
+
83
+ svg {
84
+ fill: currentColor;
85
+ }
86
+ }
87
+ }
88
+
89
+ .ds-byline-list__item__titles {
90
+ display: flex;
91
+ flex-direction: column;
92
+ flex-grow: 1;
93
+ align-items: flex-start;
94
+ overflow-wrap: anywhere;
95
+
96
+ .ds-byline-list__item__title {
97
+ text-align: left;
98
+
99
+ @include ds-typography(
100
+ $ds-typography-functional-body-md,
101
+ $lineHeight: $ds-lineheight-md,
102
+ $fontWeight: $ds-fontweight-semibold
103
+ );
104
+
105
+ @at-root .ds-force-px#{&} {
106
+ @include ds-typography(
107
+ $ds-typography-functional-body-md,
108
+ $lineHeight: $ds-lineheight-md,
109
+ $forcePx: true,
110
+ $fontWeight: $ds-fontweight-semibold
111
+ );
112
+ }
113
+ }
114
+
115
+ a.ds-byline-list__item__title {
116
+ @include ds-link($ds-link-list);
117
+
118
+ &:focus-visible {
119
+ outline: ds-border-width(xs) solid $ds-color-border-primary-strongest;
120
+ outline-offset: 2px;
121
+ }
122
+ }
123
+ }
124
+
125
+ .ds-byline-list__item__role {
126
+ text-align: left;
127
+ text-transform: capitalize;
128
+ @include ds-typography($ds-typography-functional-body-md) {
129
+ color: $ds-color-text-primary-subtle;
130
+ }
131
+ @at-root .ds-force-px#{&} {
132
+ @include ds-typography($ds-typography-functional-body-md, true) {
133
+ color: $ds-color-text-primary-subtle;
134
+ }
135
+ }
136
+ }
137
+
138
+ .ds-byline-list__item__portrait {
139
+ border-radius: 50%;
140
+ overflow: hidden;
141
+ background-color: $ds-color-surface-primary-raised-soft;
142
+ flex-shrink: 0;
143
+
144
+ .picture,
145
+ img {
146
+ width: $ds-byline-list__portrait-size;
147
+ }
148
+ }
149
+
150
+ &:active .ds-byline-list__item::before {
151
+ background-color: $ds-color-surface-primary-raised-soft;
152
+ }
153
+
154
+ @at-root a#{&} {
155
+ box-sizing: border-box;
156
+ text-align: center;
157
+ text-decoration: none;
158
+ }
159
+ }
160
+ }
@@ -2,8 +2,6 @@
2
2
 
3
3
  ## Anatomy
4
4
 
5
- <img src="/images/uxd/list-item.png">
6
-
7
5
  - **Title:** The primary content of the list item, providing a brief description or label. Titles can have various font weights including regular, semibold, or bold.
8
6
  - **Subtitle:** Additional information accompanying the title (optional).
9
7
  - **Expanded Content:** Additional content that can be toggled or expanded upon user interaction, such as text paragraphs.
@@ -18,7 +18,7 @@ export interface ListItemSharedProps {
18
18
  }
19
19
 
20
20
  export interface ListItemBaseProps extends ListItemSharedProps {
21
- listItemType: 'accordion' | 'checkbox' | 'radio' | 'switch' | 'image' | 'byline' | 'standard' | 'toggle'
21
+ listItemType: 'accordion' | 'checkbox' | 'radio' | 'switch' | 'image' | 'standard' | 'toggle'
22
22
  radioButtons?: ButtonProps[]
23
23
  href?: string
24
24
  leadingIcon?: DsIcon
@@ -31,8 +31,6 @@ export interface ListItemBaseProps extends ListItemSharedProps {
31
31
  checked?: boolean
32
32
  selected?: boolean
33
33
  stripLabel?: boolean
34
- toggleText?: string
35
- toggleSelectedText?: string
36
34
  disabled?: boolean
37
35
  }
38
36
 
@@ -75,8 +73,6 @@ export interface ToggleListItemProps
75
73
  toggleSelectedText: string
76
74
  }
77
75
 
78
- export interface BylineListItemProps extends ToggleListItemProps, Pick<ListItemBaseProps, 'mediaHtml'> {}
79
-
80
76
  export type ListItemProps =
81
77
  | ({ listItemType: 'accordion' } & AccordionListItemProps)
82
78
  | ({ listItemType: 'checkbox' } & CheckboxListItemProps)
@@ -85,7 +81,6 @@ export type ListItemProps =
85
81
  | ({ listItemType: 'standard' } & StandardListItemProps)
86
82
  | ({ listItemType: 'switch' } & SwitchListItemProps)
87
83
  | ({ listItemType: 'toggle' } & ToggleListItemProps)
88
- | ({ listItemType: 'byline' } & BylineListItemProps)
89
84
 
90
85
  export interface InnerListItemProps
91
86
  extends ListItemSharedProps,
@@ -100,12 +95,12 @@ export interface InnerListItemProps
100
95
  | 'selected'
101
96
  | 'value'
102
97
  | 'forcePx'
103
- | 'toggleText'
104
- | 'toggleSelectedText'
105
98
  | 'disabled'
106
99
  >,
107
100
  Pick<ButtonToggleStandardProps, 'variant'> {
108
101
  componentClassName: string
102
+ toggleText?: string
103
+ toggleSelectedText?: string
109
104
  }
110
105
 
111
106
  export type TitleProps = Pick<ListItemBaseProps, 'title' | 'subtitle' | 'fontWeight' | 'attributes'> & {
@@ -1,56 +1,56 @@
1
- $ds-typography-expressive-ingress-md: 'expressive-ingress-md';
2
- $ds-typography-expressive-body-sm: 'expressive-body-sm';
3
- $ds-typography-expressive-body-lg: 'expressive-body-lg';
4
- $ds-typography-expressive-heading-xl: 'expressive-heading-xl';
5
- $ds-typography-expressive-heading-xs: 'expressive-heading-xs';
6
- $ds-typography-expressive-heading-lg: 'expressive-heading-lg';
7
- $ds-typography-expressive-heading-md: 'expressive-heading-md';
8
- $ds-typography-expressive-ingress-sm: 'expressive-ingress-sm';
9
- $ds-typography-expressive-heading-xxs: 'expressive-heading-xxs';
10
- $ds-typography-expressive-heading-sm: 'expressive-heading-sm';
11
- $ds-typography-expressive-body-md: 'expressive-body-md';
12
- $ds-typography-functional-heading-xxs: 'functional-heading-xxs';
13
- $ds-typography-functional-heading-lg: 'functional-heading-lg';
14
- $ds-typography-functional-heading-xs: 'functional-heading-xs';
15
- $ds-typography-functional-meta-sm: 'functional-meta-sm';
16
- $ds-typography-functional-label-sm: 'functional-label-sm';
17
- $ds-typography-functional-meta-md: 'functional-meta-md';
18
- $ds-typography-functional-heading-sm: 'functional-heading-sm';
19
- $ds-typography-functional-body-sm: 'functional-body-sm';
20
- $ds-typography-functional-ingress-md: 'functional-ingress-md';
21
- $ds-typography-functional-body-md: 'functional-body-md';
22
- $ds-typography-functional-heading-md: 'functional-heading-md';
23
- $ds-typography-functional-label-md: 'functional-label-md';
24
- $ds-typography-functional-heading-xl: 'functional-heading-xl';
25
- $ds-typography-functional-body-lg: 'functional-body-lg';
26
- $ds-typography-functional-ingress-sm: 'functional-ingress-sm';
27
- $ds-typography-detail-teaser-large: 'detail-teaser-large';
28
- $ds-typography-detail-teaser-longlife: 'detail-teaser-longlife';
1
+ $ds-typography-detail-article-direct-opinion: 'detail-article-direct-opinion';
2
+ $ds-typography-detail-article-direkt: 'detail-article-direkt';
3
+ $ds-typography-detail-article-longread: 'detail-article-longread';
4
+ $ds-typography-detail-article-longread-premium: 'detail-article-longread-premium';
5
+ $ds-typography-detail-article-opinion: 'detail-article-opinion';
6
+ $ds-typography-detail-article-quote: 'detail-article-quote';
7
+ $ds-typography-detail-article-standard: 'detail-article-standard';
8
+ $ds-typography-detail-direkt-body: 'detail-direkt-body';
9
+ $ds-typography-detail-direkt-header: 'detail-direkt-header';
10
+ $ds-typography-detail-direkt-header-v2: 'detail-direkt-header-v2';
11
+ $ds-typography-detail-dropcap: 'detail-dropcap';
12
+ $ds-typography-detail-gameheader: 'detail-gameheader';
13
+ $ds-typography-detail-medryckare: 'detail-medryckare';
14
+ $ds-typography-detail-mellanrubrik: 'detail-mellanrubrik';
15
+ $ds-typography-detail-teaser-baotaxl: 'detail-teaser-baotaxl';
29
16
  $ds-typography-detail-teaser-centrerad: 'detail-teaser-centrerad';
30
- $ds-typography-detail-teaser-standard: 'detail-teaser-standard';
17
+ $ds-typography-detail-teaser-large: 'detail-teaser-large';
31
18
  $ds-typography-detail-teaser-large-compact: 'detail-teaser-large-compact';
32
- $ds-typography-detail-teaser-baotaxl: 'detail-teaser-baotaxl';
19
+ $ds-typography-detail-teaser-large-opinion: 'detail-teaser-large-opinion';
33
20
  $ds-typography-detail-teaser-large-rightcol: 'detail-teaser-large-rightcol';
21
+ $ds-typography-detail-teaser-longlife: 'detail-teaser-longlife';
22
+ $ds-typography-detail-teaser-standard: 'detail-teaser-standard';
23
+ $ds-typography-detail-teaser-standard-compact: 'detail-teaser-standard-compact';
34
24
  $ds-typography-detail-teaser-standard-compact-opinion: 'detail-teaser-standard-compact-opinion';
35
- $ds-typography-detail-teaser-twin: 'detail-teaser-twin';
36
25
  $ds-typography-detail-teaser-standard-opinion: 'detail-teaser-standard-opinion';
37
- $ds-typography-detail-teaser-tipsa: 'detail-teaser-tipsa';
38
26
  $ds-typography-detail-teaser-storrubrik: 'detail-teaser-storrubrik';
39
- $ds-typography-detail-teaser-standard-compact: 'detail-teaser-standard-compact';
40
27
  $ds-typography-detail-teaser-storrubrik-opinion: 'detail-teaser-storrubrik-opinion';
41
- $ds-typography-detail-teaser-large-opinion: 'detail-teaser-large-opinion';
42
28
  $ds-typography-detail-teaser-text-i-bild: 'detail-teaser-text-i-bild';
43
- $ds-typography-detail-article-quote: 'detail-article-quote';
44
- $ds-typography-detail-article-standard: 'detail-article-standard';
45
- $ds-typography-detail-article-direkt: 'detail-article-direkt';
46
- $ds-typography-detail-article-longread: 'detail-article-longread';
47
- $ds-typography-detail-article-longread-premium: 'detail-article-longread-premium';
48
- $ds-typography-detail-article-direct-opinion: 'detail-article-direct-opinion';
49
- $ds-typography-detail-article-opinion: 'detail-article-opinion';
50
- $ds-typography-detail-mellanrubrik: 'detail-mellanrubrik';
51
- $ds-typography-detail-gameheader: 'detail-gameheader';
52
- $ds-typography-detail-dropcap: 'detail-dropcap';
53
- $ds-typography-detail-direkt-header: 'detail-direkt-header';
54
- $ds-typography-detail-medryckare: 'detail-medryckare';
55
- $ds-typography-detail-direkt-body: 'detail-direkt-body';
56
- $ds-typography-detail-direkt-header-v2: 'detail-direkt-header-v2';
29
+ $ds-typography-detail-teaser-tipsa: 'detail-teaser-tipsa';
30
+ $ds-typography-detail-teaser-twin: 'detail-teaser-twin';
31
+ $ds-typography-expressive-body-lg: 'expressive-body-lg';
32
+ $ds-typography-expressive-body-md: 'expressive-body-md';
33
+ $ds-typography-expressive-body-sm: 'expressive-body-sm';
34
+ $ds-typography-expressive-heading-lg: 'expressive-heading-lg';
35
+ $ds-typography-expressive-heading-md: 'expressive-heading-md';
36
+ $ds-typography-expressive-heading-sm: 'expressive-heading-sm';
37
+ $ds-typography-expressive-heading-xl: 'expressive-heading-xl';
38
+ $ds-typography-expressive-heading-xs: 'expressive-heading-xs';
39
+ $ds-typography-expressive-heading-xxs: 'expressive-heading-xxs';
40
+ $ds-typography-expressive-ingress-md: 'expressive-ingress-md';
41
+ $ds-typography-expressive-ingress-sm: 'expressive-ingress-sm';
42
+ $ds-typography-functional-body-lg: 'functional-body-lg';
43
+ $ds-typography-functional-body-md: 'functional-body-md';
44
+ $ds-typography-functional-body-sm: 'functional-body-sm';
45
+ $ds-typography-functional-heading-lg: 'functional-heading-lg';
46
+ $ds-typography-functional-heading-md: 'functional-heading-md';
47
+ $ds-typography-functional-heading-sm: 'functional-heading-sm';
48
+ $ds-typography-functional-heading-xl: 'functional-heading-xl';
49
+ $ds-typography-functional-heading-xs: 'functional-heading-xs';
50
+ $ds-typography-functional-heading-xxs: 'functional-heading-xxs';
51
+ $ds-typography-functional-ingress-md: 'functional-ingress-md';
52
+ $ds-typography-functional-ingress-sm: 'functional-ingress-sm';
53
+ $ds-typography-functional-label-md: 'functional-label-md';
54
+ $ds-typography-functional-label-sm: 'functional-label-sm';
55
+ $ds-typography-functional-meta-md: 'functional-meta-md';
56
+ $ds-typography-functional-meta-sm: 'functional-meta-sm';