@bonniernews/dn-design-system-web 32.1.2-beta.0 → 32.1.2-beta.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,20 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [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
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** direkt circle as TSX ([#1732](https://github.com/BonnierNews/dn-design-system/issues/1732)) ([2bfaf60](https://github.com/BonnierNews/dn-design-system/commit/2bfaf608dd2b20618ccc5790eb3b783009273a91))
13
+
14
+ ## [32.2.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.1.1...@bonniernews/dn-design-system-web@32.2.0) (2025-05-12)
15
+
16
+
17
+ ### Features
18
+
19
+ * **web:** imagecaption tsx ([#1731](https://github.com/BonnierNews/dn-design-system/issues/1731)) ([c624840](https://github.com/BonnierNews/dn-design-system/commit/c62484032ce948d3ca12468e04467aa286d9082f))
20
+
7
21
  ## [32.1.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.1.0...@bonniernews/dn-design-system-web@32.1.1) (2025-05-07)
8
22
 
9
23
 
@@ -0,0 +1,32 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/direkt-circle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/direkt-circle)
2
+ - Storybook: [Subcomponents > DirektCircle](https://designsystem.dn.se/?path=/docs/section-subcomponents-direkt-circle--docs)
3
+ - Storybook (Latest): [Subcomponents > DirektCircle](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-direkt-circle--docs)
4
+
5
+ ----
6
+
7
+ # DirektCircle
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |circleColor | String | no | | | Hex code or supported color name |
14
+ |classNames | String | no | | | Ex. "my-special-class" |
15
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
16
+
17
+
18
+ ## Minimum requirement example
19
+
20
+ ### Nunjucks
21
+
22
+ These are copy paste friendly examples to quickliy get started using a component.
23
+
24
+ ```html
25
+ {% from '@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle.njk' import DirektCircle %}
26
+
27
+ {{ DirektCircle() }}
28
+ ```
29
+
30
+ ### SCSS
31
+ ```scss
32
+ @use "@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle";
@@ -1,32 +1,15 @@
1
- - GitHub: [BonnierNews/dn-design-system/../web/src/components/direkt-circle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/direkt-circle)
2
- - Storybook: [Subcomponents > DirektCircle](https://designsystem.dn.se/?path=/docs/section-subcomponents-direkt-circle--docs)
3
- - Storybook (Latest): [Subcomponents > DirektCircle](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-direkt-circle--docs)
1
+ DirektCircle
2
+ ============
4
3
 
5
- ----
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/direkt-circle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/direkt-circle)
5
+ * Storybook: [DirektCircle](https://designsystem.dn.se/?path=/docs/section-subcomponents-direktcircle--docs)
6
6
 
7
- # DirektCircle
7
+ | Name | Description | Default |
8
+ |:--- | :--- | :--- |
9
+ | circleColor | Hex code or supported color name<br />string | "white" |
10
+ | classNames | string | \- |
11
+ | attributes | object | { } |
8
12
 
9
- ## Parameters
10
-
11
- |parameter | type | required | options | default | description |
12
- |:--- | :--- | :--- | :--- | :--- | :--- |
13
- |circleColor | String | no | | | Hex code or supported color name |
14
- |classNames | String | no | | | Ex. "my-special-class" |
15
- |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
16
-
17
-
18
- ## Minimum requirement example
19
-
20
- ### Nunjucks
21
-
22
- These are copy paste friendly examples to quickliy get started using a component.
23
-
24
- ```html
25
- {% from '@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle.njk' import DirektCircle %}
26
-
27
- {{ DirektCircle() }}
28
- ```
29
-
30
- ### SCSS
31
- ```scss
32
- @use "@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle";
13
+ ```jsx
14
+ <DirektCircle />
15
+ ```
@@ -0,0 +1,39 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)
2
+ - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-imagecaption--docs)
3
+ - Storybook (Latest): [ImageCaption](https://designsystem-latest.dn.se/?path=/docs/article-imagecaption--docs)
4
+
5
+ ----
6
+
7
+ # ImageCaption
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |caption | String | no | | | Ex "Detta är en bildtext" |
14
+ |imageType | String | no | | | Type of image. Ex "Foto" |
15
+ |author | String | no | | | Ex "Paul Hansen" |
16
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
17
+ |classNames | String | no | | | Ex. "my-special-class" |
18
+ |forcePx | Bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
19
+
20
+ ## Minimum requirement example
21
+
22
+ ### Nunjucks
23
+
24
+ These are copy paste friendly examples to quickliy get started using a component.
25
+
26
+ ```html
27
+ {% from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.njk' import ImageCaption %}
28
+
29
+ {{ ImageCaption({
30
+ caption: "En bildtext",
31
+ imageType: "Foto",
32
+ author: "Paul Hansen"
33
+ })}}
34
+ ```
35
+
36
+ ### SCSS
37
+ ```scss
38
+ @use "@bonniernews/dn-design-system-web/components/image-caption/image-caption";
39
+ ```
@@ -1,39 +1,24 @@
1
- - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)
2
- - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-imagecaption--docs)
3
- - Storybook (Latest): [ImageCaption](https://designsystem-latest.dn.se/?path=/docs/article-imagecaption--docs)
4
-
5
- ----
6
-
7
- # ImageCaption
8
-
9
- ## Parameters
10
-
11
- |parameter | type | required | options | default | description |
12
- |:--- | :--- | :--- | :--- | :--- | :--- |
13
- |caption | String | no | | | Ex "Detta är en bildtext" |
14
- |imageType | String | no | | | Type of image. Ex "Foto" |
15
- |author | String | no | | | Ex "Paul Hansen" |
16
- |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
17
- |classNames | String | no | | | Ex. "my-special-class" |
18
- |forcePx | Bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
19
-
20
- ## Minimum requirement example
21
-
22
- ### Nunjucks
23
-
24
- These are copy paste friendly examples to quickliy get started using a component.
25
-
26
- ```html
27
- {% from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.njk' import ImageCaption %}
28
-
29
- {{ ImageCaption({
30
- caption: "En bildtext",
31
- imageType: "Foto",
32
- author: "Paul Hansen"
33
- })}}
34
- ```
35
-
36
- ### SCSS
37
- ```scss
38
- @use "@bonniernews/dn-design-system-web/components/image-caption/image-caption";
39
- ```
1
+ ImageCaption
2
+ ============
3
+
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)
5
+ * Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--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/image-caption/image-caption.scss'`
8
+
9
+ | Name | Description | Default |
10
+ |:--- | :--- | :--- |
11
+ | caption | Ex "Detta är en bildtext"<br />string | \- |
12
+ | author | Ex "Paul Hansen"<br />string | \- |
13
+ | imageType | Type of image. Ex "Foto" or "Illustration"<br />string | \- |
14
+ | classNames | Ex. "my-special-class another-class"<br />string | \- |
15
+ | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
16
+ | forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | \- |
17
+
18
+ ```jsx
19
+ <ImageCaption
20
+ author="Paul Hansen"
21
+ caption="Detta är en bildtext"
22
+ imageType="Foto"
23
+ />
24
+ ```
@@ -21,7 +21,7 @@
21
21
  {# Low estimate of how much will fit on tablet/desktop #}
22
22
  {% if (authorText | length) >= 27 and (authorText | length) < 60 %}
23
23
  {% set authorClasses = (authorClasses.push("ds-article-image__credits--nowrap-bigscreen"), authorClasses) %}
24
- {# Low estimate of how much will fit on iphone4 #}
24
+ {# Low estimate of how much will fit on 320px mobile #}
25
25
  {% elif (authorText | length) < 27 %}
26
26
  {% set authorClasses = (authorClasses.push("ds-article-image__credits--nowrap"), authorClasses) %}
27
27
  {% endif %}
@@ -0,0 +1,36 @@
1
+ TeaserCounter
2
+ =============
3
+
4
+ Also known as "På Plats-puffen".
5
+
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
+
8
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-counter)
9
+ * Storybook: [TeaserCounter](https://designsystem.dn.se/?path=/docs/section-teaser-counter--docs)
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/teaser-counter/teaser-counter.scss'`
12
+
13
+ | Name | Description | Default |
14
+ |:--- | :--- | :--- |
15
+ | title\* | string | \- |
16
+ | counterText\* | string | \- |
17
+ | subtitle | string | \- |
18
+ | areaType | "right", "bauta" | \- |
19
+ | targetLink | string | \- |
20
+ | mediaHtml | string | \- |
21
+ | counterDate | string | \- |
22
+ | countdown | boolean | \- |
23
+ | counterNumber | number | \- |
24
+ | classNames | string | \- |
25
+ | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
26
+
27
+ ```jsx
28
+ <TeaserCounter
29
+ counterDate="2023-10-01T12:00:00Z"
30
+ counterNumber={124}
31
+ counterText="DAGAR I <br> FÄNGELSE"
32
+ mediaHtml="<figure class='ds-teaser-image'><div class='picture picture--placeholder' style='aspect-ratio: 3 / 4;'><img class='picture__img' src='https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/d5e4cd87-61a5-40fc-8060-c4ad5019a9f3.jpeg?interpolation=lanczos-none&fit=around%7C65:87&crop=65:h;center,top&output-quality=80' alt='' aria-hidden='true'></div></figure>"
33
+ subtitle="fängslad i Turkiet för sin journalistik"
34
+ title="Joakim Medin"
35
+ />
36
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "32.1.2-beta.0",
3
+ "version": "32.1.2-beta.1",
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",
@@ -0,0 +1,12 @@
1
+ interface DirektCircleProps {
2
+ /** Hex code or supported color name */
3
+ circleColor?: string;
4
+ classNames?: string;
5
+ attributes?: object;
6
+ }
7
+ /**
8
+ * - GitHub: [BonnierNews/dn-design-system/../web/src/components/direkt-circle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/direkt-circle)
9
+ * - Storybook: [DirektCircle](https://designsystem.dn.se/?path=/docs/section-subcomponents-direktcircle--docs)
10
+ */
11
+ export declare const DirektCircle: ({ circleColor, classNames, attributes }: DirektCircleProps) => import("preact").JSX.Element;
12
+ export {};
@@ -0,0 +1,60 @@
1
+ // ../src/components/direkt-circle/direkt-circle.tsx
2
+ import { jsx, jsxs } from "preact/jsx-runtime";
3
+ var DirektCircle = ({ circleColor = "white", classNames, attributes = {} }) => {
4
+ const componentClassName = "ds-direkt-circle";
5
+ const circleOpacity = [
6
+ 0.25,
7
+ 0.25,
8
+ 0.25,
9
+ 0.25,
10
+ 0.25,
11
+ 0.25,
12
+ 0.25,
13
+ 0.25,
14
+ 0.24,
15
+ 0.235,
16
+ 0.222,
17
+ 0.218,
18
+ 0.212,
19
+ 0.202,
20
+ 0.19,
21
+ 0.178,
22
+ 0.165,
23
+ 0.155,
24
+ 0.145,
25
+ 0.135,
26
+ 0.12,
27
+ 0.107,
28
+ 0.095,
29
+ 0.083,
30
+ 0.07,
31
+ 0.06,
32
+ 0.047,
33
+ 0.035,
34
+ 0.023,
35
+ 0.02
36
+ ];
37
+ const classes = [componentClassName, classNames].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ jsxs(
39
+ "svg",
40
+ {
41
+ className: classes,
42
+ width: "500",
43
+ height: "500",
44
+ viewBox: "-250 -250 500 500",
45
+ fill: "none",
46
+ ...attributes,
47
+ children: [
48
+ /* @__PURE__ */ jsx("circle", { r: "5", fill: circleColor }),
49
+ circleOpacity.map((opacity, index) => {
50
+ const radius = (index + 1) * 8 + 5;
51
+ return /* @__PURE__ */ jsx("circle", { opacity, r: radius, stroke: circleColor, strokeWidth: "1.5" }, index);
52
+ })
53
+ ]
54
+ }
55
+ );
56
+ };
57
+ export {
58
+ DirektCircle
59
+ };
60
+ //# sourceMappingURL=direkt-circle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../components/direkt-circle/direkt-circle.tsx"],
4
+ "sourcesContent": ["interface DirektCircleProps {\n /** Hex code or supported color name */\n circleColor?: string\n classNames?: string\n attributes?: object\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/direkt-circle](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/direkt-circle)\n * - Storybook: [DirektCircle](https://designsystem.dn.se/?path=/docs/section-subcomponents-direktcircle--docs)\n */\nexport const DirektCircle = ({ circleColor = 'white', classNames, attributes = {} }: DirektCircleProps) => {\n const componentClassName = 'ds-direkt-circle'\n const circleOpacity = [\n 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.24, 0.235, 0.222, 0.218, 0.212, 0.202, 0.19, 0.178, 0.165, 0.155,\n 0.145, 0.135, 0.12, 0.107, 0.095, 0.083, 0.07, 0.06, 0.047, 0.035, 0.023, 0.02,\n ];\n\n const classes = [componentClassName, classNames].filter(Boolean).join(' ')\n\n return (\n <svg\n className={classes}\n width='500'\n height='500'\n viewBox='-250 -250 500 500'\n fill='none'\n {...attributes}\n >\n <circle r='5' fill={circleColor} />\n {circleOpacity.map((opacity, index) => {\n const radius = (index + 1) * 8 + 5\n return <circle key={index} opacity={opacity} r={radius} stroke={circleColor} strokeWidth='1.5' />\n })}\n </svg>\n )\n}\n"],
5
+ "mappings": ";AAqBI,SAQE,KARF;AAVG,IAAM,eAAe,CAAC,EAAE,cAAc,SAAS,YAAY,aAAa,CAAC,EAAE,MAAyB;AACzG,QAAM,qBAAqB;AAC3B,QAAM,gBAAgB;AAAA,IACpB;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,IAAM;AAAA,IAAO;AAAA,IAAO;AAAA,IAC7G;AAAA,IAAO;AAAA,IAAO;AAAA,IAAM;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,IAAM;AAAA,IAAM;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,EAC5E;AAEA,QAAM,UAAU,CAAC,oBAAoB,UAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACJ,GAAG;AAAA,MAEJ;AAAA,4BAAC,YAAO,GAAE,KAAI,MAAM,aAAa;AAAA,QAChC,cAAc,IAAI,CAAC,SAAS,UAAU;AACrC,gBAAM,UAAU,QAAQ,KAAK,IAAI;AACjC,iBAAO,oBAAC,YAAmB,SAAkB,GAAG,QAAQ,QAAQ,aAAa,aAAY,SAArE,KAA2E;AAAA,QACjG,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ export interface ImageCaptionProps {
2
+ /** Ex "Detta är en bildtext" */
3
+ caption?: string;
4
+ /** Ex "Paul Hansen" */
5
+ author?: string;
6
+ /** Type of image. Ex "Foto" or "Illustration" */
7
+ imageType?: string;
8
+ /** Ex. "my-special-class another-class" */
9
+ classNames?: string;
10
+ /** Ex. { target: "_blank", "data-test": "lorem ipsum" } */
11
+ attributes?: object;
12
+ /** Fixed pixel value is used for typography to prevent scaling based on html font-size */
13
+ forcePx?: boolean;
14
+ }
15
+ /**
16
+ * - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)
17
+ * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)
18
+ *
19
+ * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
20
+ * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`
21
+ */
22
+ export declare const ImageCaption: ({ caption, author, imageType, classNames, attributes, forcePx }: ImageCaptionProps) => import("preact").JSX.Element;
@@ -0,0 +1,28 @@
1
+ // ../src/helpers/formatClassString.ts
2
+ var formatClassString = (classesArray) => {
3
+ return classesArray.filter((x) => !!x).join(" ");
4
+ };
5
+
6
+ // ../src/components/image-caption/image-caption.tsx
7
+ import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
8
+ var ImageCaption = ({ caption, author, imageType, classNames, attributes, forcePx }) => {
9
+ const classes = formatClassString([
10
+ "ds-image-caption",
11
+ forcePx && "ds-force-px",
12
+ classNames
13
+ ]);
14
+ const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;
15
+ const authorClasses = [
16
+ "ds-article-image__credits",
17
+ authorText && authorText.length >= 27 && authorText.length < 60 ? "ds-article-image__credits--nowrap-bigscreen" : authorText && authorText.length < 27 ? "ds-article-image__credits--nowrap" : null
18
+ ].filter(Boolean).join(" ");
19
+ return /* @__PURE__ */ jsxs("figcaption", { className: classes, "aria-hidden": "true", ...attributes, children: [
20
+ caption && /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: caption } }),
21
+ caption && authorText && "\xA0",
22
+ authorText && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("span", { className: authorClasses, children: authorText }) })
23
+ ] });
24
+ };
25
+ export {
26
+ ImageCaption
27
+ };
28
+ //# sourceMappingURL=image-caption.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../helpers/formatClassString.ts", "../../../components/image-caption/image-caption.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';\n\nexport interface ImageCaptionProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string;\n /** Ex \"Paul Hansen\" */\n author?: string;\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string;\n /** Ex. \"my-special-class another-class\" */\n classNames?: string;\n /** Ex. { target: \"_blank\", \"data-test\": \"lorem ipsum\" } */\n attributes?: object;\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean;\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({caption, author, imageType, classNames, attributes, forcePx}: ImageCaptionProps) => {\n const classes = formatClassString([\n 'ds-image-caption',\n forcePx && 'ds-force-px',\n classNames,\n ]);\n\n const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen' : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap' : null,\n ].filter(Boolean).join(' ');\n\n return (\n <figcaption className={classes} aria-hidden=\"true\" {...attributes} >\n {caption && <span dangerouslySetInnerHTML={{ __html: caption }} />}\n\n {/* non-breaking space between the caption-span and author-span */}\n {caption && authorText && '\\u00A0'}\n\n {authorText && (\n <>\n <span className={authorClasses}>\n {authorText}\n </span>\n </>\n )}\n </figcaption>\n );\n};\n"],
5
+ "mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;ACuCI,SAOE,UANY,KADd;AAjBG,IAAM,eAAe,CAAC,EAAC,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAO,MAAyB;AAChH,QAAM,UAAU,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAED,QAAM,aAAa,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAElH,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDAAgD,cAAc,WAAW,SAAS,KAClF,sCAAsC;AAAA,EAC5C,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YACpD;AAAA,eAAW,oBAAC,UAAK,yBAAyB,EAAE,QAAQ,QAAQ,GAAG;AAAA,IAG/D,WAAW,cAAc;AAAA,IAEzB,cACD,gCACE,8BAAC,UAAK,WAAW,eACd,sBACH,GACF;AAAA,KAEF;AAEJ;",
6
+ "names": []
7
+ }