@bonniernews/dn-design-system-web 32.2.1 → 32.3.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 +25 -0
- package/README.md +1 -1
- package/components/teaser-counter/README.md +30 -0
- package/components/teaser-counter/teaser-counter.njk +69 -0
- package/components/teaser-counter/teaser-counter.scss +92 -0
- package/package.json +1 -1
- package/preact/components/teaser-counter/teaser-counter.d.ts +20 -0
- package/preact/components/teaser-counter/teaser-counter.js +72 -0
- package/preact/components/teaser-counter/teaser-counter.js.map +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [32.3.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.3.0...@bonniernews/dn-design-system-web@32.3.1) (2025-05-16)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** change teaser counter to flex ([#1743](https://github.com/BonnierNews/dn-design-system/issues/1743)) ([94c8591](https://github.com/BonnierNews/dn-design-system/commit/94c8591a970a142105376b095dfb2662a0252dd1))
|
|
13
|
+
|
|
14
|
+
## [32.3.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.2.1...@bonniernews/dn-design-system-web@32.3.0) (2025-05-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **web:** add teaser counter ([#1736](https://github.com/BonnierNews/dn-design-system/issues/1736)) ([a93f320](https://github.com/BonnierNews/dn-design-system/commit/a93f320f735e40c066cca39b6ba8c3d41454d5e9))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* app delete letter spacing if 0 ([#1739](https://github.com/BonnierNews/dn-design-system/issues/1739)) ([55dd0e4](https://github.com/BonnierNews/dn-design-system/commit/55dd0e4693ae4d4d7cb7112042b9626b6ff3f03e))
|
|
25
|
+
* **web:** bump package version after merge ([#1741](https://github.com/BonnierNews/dn-design-system/issues/1741)) ([7c85270](https://github.com/BonnierNews/dn-design-system/commit/7c8527025485b57ef917c0cb951c6588fd8c6774))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Maintenance
|
|
29
|
+
|
|
30
|
+
* prerelease packages ([25f639c](https://github.com/BonnierNews/dn-design-system/commit/25f639ce15dc02c8fa9516272e316cde81136e34))
|
|
31
|
+
|
|
7
32
|
## [32.2.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.2.0...@bonniernews/dn-design-system-web@32.2.1) (2025-05-13)
|
|
8
33
|
|
|
9
34
|
|
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ Github: [https://github.com/BonnierNews/dn-design-system/tree/main/web/src](http
|
|
|
12
12
|
|
|
13
13
|
Changelog: [https://github.com/BonnierNews/dn-design-system/blob/main/web/src/CHANGELOG.md](https://github.com/BonnierNews/dn-design-system/blob/main/web/src/CHANGELOG.md)
|
|
14
14
|
|
|
15
|
-
For specific instructions see each component or helper
|
|
15
|
+
For specific instructions see each component or helper readmes.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
TeaserCounter
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-counter)
|
|
5
|
+
* Storybook: [TeaserCounter](https://designsystem.dn.se/?path=/docs/section-teaser-counter--docs)
|
|
6
|
+
|
|
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-counter/teaser-counter.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | string | \- |
|
|
12
|
+
| counterText\* | string | \- |
|
|
13
|
+
| counterNumber\* | number | \- |
|
|
14
|
+
| subtitle | string | \- |
|
|
15
|
+
| areaType | "right", "bauta" | \- |
|
|
16
|
+
| targetLink | string | \- |
|
|
17
|
+
| mediaHtml | string | \- |
|
|
18
|
+
| classNames | string | \- |
|
|
19
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
<TeaserCounter
|
|
23
|
+
classNames="test-class"
|
|
24
|
+
counterNumber={124}
|
|
25
|
+
counterText="DAGAR I <br> FÄNGELSE"
|
|
26
|
+
mediaHtml="<div class='picture picture--placeholder' style='aspect-ratio: 3 / 4;'><img class='picture__img' src='https://dev.static.bonniernews.se/gcs/patron/2025/05/afa4321ec1db2abce9d2c85d5d8176d4431faeb8-1747137466945.jpg?io=1&crop=3:4,smart&height=184' alt='' aria-hidden='true'></div>"
|
|
27
|
+
subtitle="fängslad i Turkiet för sin journalistik"
|
|
28
|
+
title="Joakim Medin"
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
|
+
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
3
|
+
|
|
4
|
+
{% macro TeaserCounter(params) %}
|
|
5
|
+
{% set componentClassName = "ds-teaser--counter" %}
|
|
6
|
+
|
|
7
|
+
{% set extraClasses = [
|
|
8
|
+
componentClassName,
|
|
9
|
+
params.classNames if params.classNames
|
|
10
|
+
] | join(" ") %}
|
|
11
|
+
|
|
12
|
+
{% call TeaserCard({
|
|
13
|
+
targetLink: params.targetLink,
|
|
14
|
+
areaType: params.areaType,
|
|
15
|
+
attributes: params.attributes,
|
|
16
|
+
classNames: extraClasses
|
|
17
|
+
}) %}
|
|
18
|
+
<div class="ds-teaser__content">
|
|
19
|
+
{% if params.title %}
|
|
20
|
+
<h2 class="{{ componentClassName + '__title' }}">
|
|
21
|
+
<span class="{{ componentClassName + '__title--highlighted' }}">{{ params.title }}</span>
|
|
22
|
+
{% if params.subtitle %}
|
|
23
|
+
– {{ params.subtitle }}
|
|
24
|
+
{% endif %}
|
|
25
|
+
</h2>
|
|
26
|
+
{% endif %}
|
|
27
|
+
|
|
28
|
+
{% if params.counterNumber is not null or params.counterText %}
|
|
29
|
+
<div class="{{ componentClassName + '__counter-wrapper' }}">
|
|
30
|
+
{% if params.counterNumber is not null %}
|
|
31
|
+
<ul class="{{ componentClassName + '__list' }}">
|
|
32
|
+
{% for digit in params.counterNumber | string %}
|
|
33
|
+
<li class="{{ componentClassName + '__item' }}">{{ digit }}</li>
|
|
34
|
+
{% endfor %}
|
|
35
|
+
</ul>
|
|
36
|
+
{% endif %}
|
|
37
|
+
|
|
38
|
+
{% if params.counterText %}
|
|
39
|
+
<p class="{{ componentClassName + '__counter-text' }}">
|
|
40
|
+
{{ params.counterText | safe }}
|
|
41
|
+
</p>
|
|
42
|
+
{% endif %}
|
|
43
|
+
</div>
|
|
44
|
+
{% endif %}
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
{% if params.countdown %}
|
|
48
|
+
<div class="{{ componentClassName + '__countdown' }}">
|
|
49
|
+
{{ IconUse({ icon: "clock" }) }}
|
|
50
|
+
<span class="{{ componentClassName + '__countdown-text' }}">
|
|
51
|
+
{{ params.countdown }}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
{% endif %}
|
|
55
|
+
|
|
56
|
+
{% if params.sectionName %}
|
|
57
|
+
<div class="{{ componentClassName + '__section-name' }}">
|
|
58
|
+
{{ params.sectionName }}
|
|
59
|
+
</div>
|
|
60
|
+
{% endif %}
|
|
61
|
+
|
|
62
|
+
{% if params.mediaHtml %}
|
|
63
|
+
<div class="ds-teaser__media">
|
|
64
|
+
{{ params.mediaHtml | safe }}
|
|
65
|
+
</div>
|
|
66
|
+
{% endif %}
|
|
67
|
+
|
|
68
|
+
{% endcall %}
|
|
69
|
+
{% endmacro %}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
|
+
|
|
4
|
+
a.ds-teaser--counter.ds-teaser {
|
|
5
|
+
color: inherit;
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ds-teaser--counter.ds-teaser {
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: ds-spacing($ds-s-075);
|
|
12
|
+
padding: ds-spacing($ds-s-075);
|
|
13
|
+
|
|
14
|
+
.ds-teaser__content {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: ds-spacing($ds-s-100);
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ds-teaser--counter__title,
|
|
22
|
+
.ds-teaser--counter__counter-text {
|
|
23
|
+
color: $ds-color-text-primary;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ds-teaser--counter__title {
|
|
27
|
+
margin: 0;
|
|
28
|
+
@include ds-typography(
|
|
29
|
+
$ds-typography-functional-heading-xs,
|
|
30
|
+
$fontWeight: $ds-fontweight-regular,
|
|
31
|
+
$lineHeight: $ds-lineheight-md
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ds-teaser--counter__title--highlighted {
|
|
36
|
+
font-weight: $ds-fontweight-bold;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ds-teaser--counter__counter-wrapper {
|
|
40
|
+
align-items: center;
|
|
41
|
+
display: flex;
|
|
42
|
+
gap: ds-spacing($ds-s-050);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ds-teaser--counter__list {
|
|
46
|
+
display: flex;
|
|
47
|
+
font-variant-numeric: tabular-nums;
|
|
48
|
+
gap: ds-spacing($ds-s-012);
|
|
49
|
+
list-style: none;
|
|
50
|
+
margin: 0;
|
|
51
|
+
padding: 0;
|
|
52
|
+
@include ds-typography($ds-typography-functional-heading-sm, $fontWeight: $ds-fontweight-regular);
|
|
53
|
+
|
|
54
|
+
.ds-teaser--counter__item {
|
|
55
|
+
align-items: center;
|
|
56
|
+
background-color: $ds-color-brand-600;
|
|
57
|
+
border-radius: ds-border-radius($ds-s-025);
|
|
58
|
+
color: $ds-color-text-on-brand;
|
|
59
|
+
display: flex;
|
|
60
|
+
height: ds-spacing($ds-s-200);
|
|
61
|
+
justify-content: center;
|
|
62
|
+
width: ds-spacing($ds-s-150);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ds-teaser--counter__counter-text {
|
|
67
|
+
margin: 0;
|
|
68
|
+
@include ds-typography($ds-typography-functional-meta-md);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ds-teaser__media {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-end;
|
|
74
|
+
width: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Mobile width is hardcoded based on 2 rows of text content and desktop for 1 row
|
|
78
|
+
.picture--placeholder {
|
|
79
|
+
max-height: 82px;
|
|
80
|
+
min-width: 62px;
|
|
81
|
+
|
|
82
|
+
@include ds-mq-only-breakpoint(mobile) {
|
|
83
|
+
max-height: 92px;
|
|
84
|
+
min-width: 69px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.picture--placeholder,
|
|
89
|
+
.picture__img {
|
|
90
|
+
border-radius: ds-border-radius($ds-s-025);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TeaserCounterProps {
|
|
2
|
+
title: string;
|
|
3
|
+
counterText: string;
|
|
4
|
+
counterNumber: number;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
areaType?: 'right' | 'bauta';
|
|
7
|
+
targetLink?: string;
|
|
8
|
+
mediaHtml?: string;
|
|
9
|
+
classNames?: string;
|
|
10
|
+
/** Ex. { target: "_blank", "data-test": "lorem ipsum" } */
|
|
11
|
+
attributes?: object;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-counter)
|
|
15
|
+
* - Storybook: [TeaserCounter](https://designsystem.dn.se/?path=/docs/section-teaser-counter--docs)
|
|
16
|
+
*
|
|
17
|
+
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
18
|
+
* `@use '@bonniernews/dn-design-system-web/components/teaser-counter/teaser-counter.scss'`
|
|
19
|
+
*/
|
|
20
|
+
export declare const TeaserCounter: ({ areaType, targetLink, classNames, attributes, mediaHtml, counterText, counterNumber, title, subtitle, }: TeaserCounterProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// ../src/helpers/formatClassString.ts
|
|
2
|
+
var formatClassString = (classesArray) => {
|
|
3
|
+
return classesArray.filter((x) => !!x).join(" ");
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
// ../src/components/teaser-card/teaser-card.tsx
|
|
7
|
+
import { jsx } from "preact/jsx-runtime";
|
|
8
|
+
var TeaserCard = ({ areaType, targetLink, theme = "nyheter", classes, attributes, children }) => {
|
|
9
|
+
const componentClassName = "ds-teaser";
|
|
10
|
+
const classNames = formatClassString([
|
|
11
|
+
componentClassName,
|
|
12
|
+
areaType && `${componentClassName}--${areaType}`,
|
|
13
|
+
areaType == "bauta" && "ds-dark",
|
|
14
|
+
`ds-theme--${theme}`,
|
|
15
|
+
classes
|
|
16
|
+
]);
|
|
17
|
+
if (targetLink) {
|
|
18
|
+
return /* @__PURE__ */ jsx("a", { className: classNames, href: targetLink, ...attributes, children });
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { className: classNames, ...attributes, children });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// ../src/helpers/teaser.tsx
|
|
24
|
+
import { jsx as jsx2 } from "preact/jsx-runtime";
|
|
25
|
+
var Media = ({ mediaHtml, rounded }) => {
|
|
26
|
+
const classNames = "ds-teaser__media" + (rounded ? " ds-teaser__media--rounded" : "");
|
|
27
|
+
return mediaHtml ? /* @__PURE__ */ jsx2("div", { className: classNames, dangerouslySetInnerHTML: { __html: mediaHtml } }) : null;
|
|
28
|
+
};
|
|
29
|
+
var Content = ({ children }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx2("div", { className: "ds-teaser__content", children });
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// ../src/components/teaser-counter/teaser-counter.tsx
|
|
34
|
+
import { jsx as jsx3, jsxs } from "preact/jsx-runtime";
|
|
35
|
+
var TeaserCounter = ({
|
|
36
|
+
areaType,
|
|
37
|
+
targetLink,
|
|
38
|
+
classNames,
|
|
39
|
+
attributes,
|
|
40
|
+
mediaHtml,
|
|
41
|
+
counterText,
|
|
42
|
+
counterNumber,
|
|
43
|
+
title,
|
|
44
|
+
subtitle
|
|
45
|
+
}) => {
|
|
46
|
+
const componentClassName = "ds-teaser--counter";
|
|
47
|
+
const classes = formatClassString([componentClassName, classNames]);
|
|
48
|
+
const counterNumberIsValid = counterNumber !== void 0 && counterNumber !== null;
|
|
49
|
+
return /* @__PURE__ */ jsxs(TeaserCard, { ...{ areaType, targetLink, classes, attributes }, children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(Content, { children: [
|
|
51
|
+
title && /* @__PURE__ */ jsxs("h2", { className: `${componentClassName}__title`, children: [
|
|
52
|
+
/* @__PURE__ */ jsx3("span", { className: `${componentClassName}__title--highlighted`, children: title }),
|
|
53
|
+
subtitle && ` \u2013 ${subtitle}`
|
|
54
|
+
] }),
|
|
55
|
+
(counterNumberIsValid || counterText) && /* @__PURE__ */ jsxs("div", { className: `${componentClassName}__counter-wrapper`, children: [
|
|
56
|
+
counterNumberIsValid && /* @__PURE__ */ jsx3("ul", { className: `${componentClassName}__list`, children: counterNumber.toString().split("").map((digit, index) => /* @__PURE__ */ jsx3("li", { className: `${componentClassName}__item`, children: digit }, index)) }),
|
|
57
|
+
counterText && /* @__PURE__ */ jsx3(
|
|
58
|
+
"p",
|
|
59
|
+
{
|
|
60
|
+
className: `${componentClassName}__counter-text`,
|
|
61
|
+
dangerouslySetInnerHTML: { __html: counterText }
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx3(Media, { ...{ mediaHtml } })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
TeaserCounter
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=teaser-counter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../helpers/formatClassString.ts", "../../../components/teaser-card/teaser-card.tsx", "../../../helpers/teaser.tsx", "../../../components/teaser-counter/teaser-counter.tsx"],
|
|
4
|
+
"sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "import { formatClassString } from \"@bonniernews/dn-design-system-web/helpers/formatClassString.ts\";\nimport { ComponentChildren } from \"preact\";\n\nexport interface TeaserCardsProps {\n areaType?: 'right' | 'bauta' | 'bautaxl';\n targetLink?: string;\n theme?: 'kultur' | 'nyheter';\n classes?: string;\n /** Ex. { target: \"_blank\", \"data-test\": \"lorem ipsum\" } */\n attributes?: object;\n children: ComponentChildren;\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-card)\n * - Storybook: [Subcomponents > TeaserCard](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserdot--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/assets/teaser/teaser.scss'`\n */\nexport const TeaserCard = ({ areaType, targetLink, theme = 'nyheter', classes, attributes, children }: TeaserCardsProps) => {\n const componentClassName = 'ds-teaser';\n\n const classNames = formatClassString([\n componentClassName,\n areaType && `${componentClassName}--${areaType}`,\n areaType == 'bauta' && 'ds-dark',\n `ds-theme--${theme}`,\n classes,\n ])\n\n if (targetLink) {\n return (\n <a className={classNames} href={targetLink } {...attributes}>\n { children }\n </a>\n );\n }\n\n return (\n <div className={classNames}{...attributes}>\n { children }\n </div>\n );\n};\n", "import { ComponentChildren } from \"preact\";\n\ninterface MediaProps {\n mediaHtml?: string;\n rounded?: boolean;\n}\n\nexport const Media = ({ mediaHtml, rounded }: MediaProps) => {\n const classNames = 'ds-teaser__media' + (rounded ? ' ds-teaser__media--rounded' : '');\n return mediaHtml ? (<div className={classNames} dangerouslySetInnerHTML={{ __html: mediaHtml }} />) : (null)\n}\n\ninterface ContentProps {\n children: ComponentChildren;\n}\nexport const Content = ({ children }: ContentProps) => {\n return (<div className=\"ds-teaser__content\">\n {children}\n </div>)\n}\n\ninterface TitleProps {\n title?: string;\n}\nexport const Title = ({ title }: TitleProps) => {\n return title ? (<h2 className=\"ds-teaser__title\">{title}</h2>) : (null)\n}\n\ninterface BodyProps {\n text?: string;\n}\nexport const Body = ({ text }: BodyProps) => {\n return text ? (<p className=\"ds-teaser__text\">{text}</p>) : (null)\n}\n", "import { TeaserCard } from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.tsx'\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\nimport { Content, Media } from '@bonniernews/dn-design-system-web/helpers/teaser.tsx'\nexport interface TeaserCounterProps {\n title: string\n counterText: string\n counterNumber: number\n subtitle?: string\n areaType?: 'right' | 'bauta'\n targetLink?: string\n mediaHtml?: string\n classNames?: string\n /** Ex. { target: \"_blank\", \"data-test\": \"lorem ipsum\" } */\n attributes?: object\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-counter)\n * - Storybook: [TeaserCounter](https://designsystem.dn.se/?path=/docs/section-teaser-counter--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/teaser-counter/teaser-counter.scss'`\n */\nexport const TeaserCounter = ({\n areaType,\n targetLink,\n classNames,\n attributes,\n mediaHtml,\n counterText,\n counterNumber,\n title,\n subtitle,\n}: TeaserCounterProps) => {\n const componentClassName = 'ds-teaser--counter'\n const classes = formatClassString([componentClassName, classNames])\n\n const counterNumberIsValid = counterNumber !== undefined && counterNumber !== null\n\n return (\n <TeaserCard {...{ areaType, targetLink, classes, attributes }}>\n <Content>\n {title && (\n <h2 className={`${componentClassName}__title`}>\n <span className={`${componentClassName}__title--highlighted`}>{title}</span>\n {subtitle && ` \u2013 ${subtitle}`}\n </h2>\n )}\n\n {(counterNumberIsValid || counterText) && (\n <div className={`${componentClassName}__counter-wrapper`}>\n {counterNumberIsValid && (\n <ul className={`${componentClassName}__list`}>\n {counterNumber\n .toString()\n .split('')\n .map((digit, index) => (\n <li key={index} className={`${componentClassName}__item`}>\n {digit}\n </li>\n ))}\n </ul>\n )}\n\n {counterText && (\n <p\n className={`${componentClassName}__counter-text`}\n dangerouslySetInnerHTML={{ __html: counterText }}\n ></p>\n )}\n </div>\n )}\n </Content>\n <Media {...{ mediaHtml }} />\n </TeaserCard>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;AC+BM;AAbC,IAAM,aAAa,CAAC,EAAE,UAAU,YAAY,QAAQ,WAAW,SAAS,YAAY,SAAS,MAAwB;AAC1H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