@bonniernews/dn-design-system-web 32.6.0 → 32.6.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 +12 -0
- package/components/direkt-header/README.md +2 -1
- package/components/direkt-header/direkt-header.scss +1 -0
- package/package.json +1 -1
- package/preact/components/direkt-header/direkt-header.d.ts +3 -2
- package/preact/components/direkt-header/direkt-header.js +6 -5
- package/preact/components/direkt-header/direkt-header.js.map +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [32.6.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.6.0...@bonniernews/dn-design-system-web@32.6.1) (2025-06-10)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** add prop to direkt header ([#1773](https://github.com/BonnierNews/dn-design-system/issues/1773)) ([294671f](https://github.com/BonnierNews/dn-design-system/commit/294671f7e407a4323f663d3ace3fae0e02e1eda3))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
* **deps-dev:** bump @babel/runtime from 7.27.4 to 7.27.6 ([#1772](https://github.com/BonnierNews/dn-design-system/issues/1772)) ([94c018f](https://github.com/BonnierNews/dn-design-system/commit/94c018fea1cf4dc14263239d401eb8f2fd4e03b8))
|
|
18
|
+
|
|
7
19
|
## [32.6.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.5.1...@bonniernews/dn-design-system-web@32.6.0) (2025-06-09)
|
|
8
20
|
|
|
9
21
|
|
|
@@ -10,8 +10,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| title\* | string | \- |
|
|
12
12
|
| subtitle | string | \- |
|
|
13
|
-
|
|
|
13
|
+
| pretitle | string | "Direkt" |
|
|
14
14
|
| isAnimated | boolean | true |
|
|
15
|
+
| renderAsH2 | boolean | false |
|
|
15
16
|
| classNames | string | \- |
|
|
16
17
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | { } |
|
|
17
18
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export interface DirektHeaderProps {
|
|
2
2
|
title: string;
|
|
3
3
|
subtitle?: string;
|
|
4
|
-
|
|
4
|
+
pretitle?: string;
|
|
5
5
|
isAnimated?: boolean;
|
|
6
|
+
renderAsH2?: boolean;
|
|
6
7
|
classNames?: string;
|
|
7
8
|
/** Ex. { target: "_blank", "data-test": "lorem ipsum" } */
|
|
8
9
|
attributes?: object;
|
|
@@ -14,4 +15,4 @@ export interface DirektHeaderProps {
|
|
|
14
15
|
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
15
16
|
* `@use '@bonniernews/dn-design-system-web/components/direkt-header/direkt-header.scss'`
|
|
16
17
|
*/
|
|
17
|
-
export declare const DirektHeader: ({ classNames, attributes, title, subtitle,
|
|
18
|
+
export declare const DirektHeader: ({ classNames, attributes, title, subtitle, pretitle, isAnimated, renderAsH2, }: DirektHeaderProps) => import("preact").JSX.Element;
|
|
@@ -62,18 +62,19 @@ var DirektHeader = ({
|
|
|
62
62
|
attributes = {},
|
|
63
63
|
title,
|
|
64
64
|
subtitle,
|
|
65
|
-
|
|
66
|
-
isAnimated = true
|
|
65
|
+
pretitle = "Direkt",
|
|
66
|
+
isAnimated = true,
|
|
67
|
+
renderAsH2 = false
|
|
67
68
|
}) => {
|
|
68
69
|
const componentClassName = "ds-direkt-header";
|
|
69
70
|
const classes = formatClassString([componentClassName, classNames]);
|
|
70
71
|
return /* @__PURE__ */ jsxs2("header", { className: classes, ...attributes, children: [
|
|
71
72
|
/* @__PURE__ */ jsxs2("p", { className: `${componentClassName}__pre-title`, children: [
|
|
72
73
|
/* @__PURE__ */ jsx2("span", { className: `${componentClassName}__circle-wrapper`, children: /* @__PURE__ */ jsx2(DirektCircle, { classNames: `${componentClassName}__circle`, isAnimated }) }),
|
|
73
|
-
|
|
74
|
+
pretitle
|
|
74
75
|
] }),
|
|
75
|
-
/* @__PURE__ */ jsx2("h2", { className: `${componentClassName}__title`, children: title }),
|
|
76
|
-
subtitle && /* @__PURE__ */ jsx2("h3", { className: `${componentClassName}__sub-title`, children: subtitle })
|
|
76
|
+
renderAsH2 ? /* @__PURE__ */ jsx2("h2", { className: `${componentClassName}__title`, children: title }) : /* @__PURE__ */ jsx2("h1", { className: `${componentClassName}__title`, children: title }),
|
|
77
|
+
subtitle && (renderAsH2 ? /* @__PURE__ */ jsx2("h3", { className: `${componentClassName}__sub-title`, children: subtitle }) : /* @__PURE__ */ jsx2("h2", { className: `${componentClassName}__sub-title`, children: subtitle }))
|
|
77
78
|
] });
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../helpers/formatClassString.ts", "../../../components/direkt-circle/direkt-circle.tsx", "../../../components/direkt-header/direkt-header.tsx"],
|
|
4
|
-
"sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "interface DirektCircleProps {\n /** Hex code or supported color name */\n circleColor?: string\n classNames?: string\n isAnimated?: boolean\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 * * 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/direkt-circle/direkt-circle.scss'`\n */\nexport const DirektCircle = ({\n circleColor = 'white',\n classNames,\n attributes = {},\n isAnimated = false,\n}: DirektCircleProps) => {\n const componentClassName = 'ds-direkt-circle'\n const animatedClassName = isAnimated ? `${componentClassName}--animated` : ''\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, animatedClassName].filter(Boolean).join(' ')\n\n return (\n <svg className={classes} width='500' height='500' viewBox='-250 -250 500 500' fill='none' {...attributes}>\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", "import { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\nimport { DirektCircle } from '@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle.tsx'\nexport interface DirektHeaderProps {\n title: string\n subtitle?: string\n
|
|
5
|
-
"mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;AC4BI,SACE,KADF;AAhBG,IAAM,eAAe,CAAC;AAAA,EAC3B,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC;AAAA,EACd,aAAa;AACf,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,oBAAoB,aAAa,GAAG,kBAAkB,eAAe;AAC3E,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,YAAY,iBAAiB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE5F,SACE,qBAAC,SAAI,WAAW,SAAS,OAAM,OAAM,QAAO,OAAM,SAAQ,qBAAoB,MAAK,QAAQ,GAAG,YAC5F;AAAA,wBAAC,YAAO,GAAE,KAAI,MAAM,aAAa;AAAA,IAChC,cAAc,IAAI,CAAC,SAAS,UAAU;AACrC,YAAM,UAAU,QAAQ,KAAK,IAAI;AACjC,aAAO,oBAAC,YAAmB,SAAkB,GAAG,QAAQ,QAAQ,aAAa,aAAY,SAArE,KAA2E;AAAA,IACjG,CAAC;AAAA,KACH;AAEJ;;;
|
|
4
|
+
"sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "interface DirektCircleProps {\n /** Hex code or supported color name */\n circleColor?: string\n classNames?: string\n isAnimated?: boolean\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 * * 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/direkt-circle/direkt-circle.scss'`\n */\nexport const DirektCircle = ({\n circleColor = 'white',\n classNames,\n attributes = {},\n isAnimated = false,\n}: DirektCircleProps) => {\n const componentClassName = 'ds-direkt-circle'\n const animatedClassName = isAnimated ? `${componentClassName}--animated` : ''\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, animatedClassName].filter(Boolean).join(' ')\n\n return (\n <svg className={classes} width='500' height='500' viewBox='-250 -250 500 500' fill='none' {...attributes}>\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", "import { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts'\nimport { DirektCircle } from '@bonniernews/dn-design-system-web/components/direkt-circle/direkt-circle.tsx'\nexport interface DirektHeaderProps {\n title: string\n subtitle?: string\n pretitle?: string\n isAnimated?: boolean\n renderAsH2?: boolean\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/direkt-header)\n * - Storybook: [DirektHeader](https://designsystem.dn.se/?path=/docs/section-direkt-header--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/direkt-header/direkt-header.scss'`\n */\nexport const DirektHeader = ({\n classNames,\n attributes = {},\n title,\n subtitle,\n pretitle = 'Direkt',\n isAnimated = true,\n renderAsH2 = false,\n}: DirektHeaderProps) => {\n const componentClassName = 'ds-direkt-header'\n const classes = formatClassString([componentClassName, classNames])\n\n return (\n <header className={classes} {...attributes}>\n <p className={`${componentClassName}__pre-title`}>\n <span className={`${componentClassName}__circle-wrapper`}>\n <DirektCircle classNames={`${componentClassName}__circle`} isAnimated={isAnimated} />\n </span>\n {pretitle}\n </p>\n {renderAsH2 ? (\n <h2 className={`${componentClassName}__title`}>{title}</h2>\n ) : (\n <h1 className={`${componentClassName}__title`}>{title}</h1>\n )}\n {subtitle &&\n (renderAsH2 ? (\n <h3 className={`${componentClassName}__sub-title`}>{subtitle}</h3>\n ) : (\n <h2 className={`${componentClassName}__sub-title`}>{subtitle}</h2>\n ))}\n </header>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;AC4BI,SACE,KADF;AAhBG,IAAM,eAAe,CAAC;AAAA,EAC3B,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC;AAAA,EACd,aAAa;AACf,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,oBAAoB,aAAa,GAAG,kBAAkB,eAAe;AAC3E,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,YAAY,iBAAiB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE5F,SACE,qBAAC,SAAI,WAAW,SAAS,OAAM,OAAM,QAAO,OAAM,SAAQ,qBAAoB,MAAK,QAAQ,GAAG,YAC5F;AAAA,wBAAC,YAAO,GAAE,KAAI,MAAM,aAAa;AAAA,IAChC,cAAc,IAAI,CAAC,SAAS,UAAU;AACrC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