@bonniernews/dn-design-system-web 20.5.4 → 20.6.0
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 +13 -0
- package/components/divider/divider.tsx +21 -0
- package/components/list-item/list-item.js +1 -1
- package/components/quote/quote.tsx +23 -0
- package/components/teaser-image/teaser-image.scss +1 -3
- package/components/thematic-break/thematic-break.tsx +18 -0
- package/index.tsx +8 -0
- package/package.json +49 -3
- package/preact/components/divider/divider.d.ts +7 -0
- package/preact/components/quote/quote.d.ts +8 -0
- package/preact/components/thematic-break/thematic-break.d.ts +6 -0
- package/preact/components.cjs +66 -0
- package/preact/components.cjs.map +7 -0
- package/preact/components.esm.js +43 -0
- package/preact/components.esm.js.map +7 -0
- package/preact/index.d.ts +6 -0
- package/react/components/divider/divider.d.ts +7 -0
- package/react/components/quote/quote.d.ts +8 -0
- package/react/components/thematic-break/thematic-break.d.ts +6 -0
- package/react/components.cjs +66 -0
- package/react/components.cjs.map +7 -0
- package/react/components.esm.js +43 -0
- package/react/components.esm.js.map +7 -0
- package/react/index.d.ts +6 -0
- package/tsconfig-preact.json +12 -0
- package/tsconfig-react.json +11 -0
- package/tsconfig.json +21 -0
- /package/{.release-it.js → .release-it.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [20.6.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.4...@bonniernews/dn-design-system-web@20.6.0) (2024-10-09)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **web:** tsx components ([#1409](https://github.com/BonnierNews/dn-design-system/issues/1409)) ([27b6098](https://github.com/BonnierNews/dn-design-system/commit/27b6098b6cc2ae3ee8302f7b7f2bb598e687bcc6))
|
|
13
|
+
|
|
14
|
+
## [20.5.1-beta.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.1-beta.1...@bonniernews/dn-design-system-web@20.5.1-beta.2) (2024-10-02)
|
|
15
|
+
|
|
16
|
+
## [20.5.1-beta.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.1-beta.0...@bonniernews/dn-design-system-web@20.5.1-beta.1) (2024-10-02)
|
|
17
|
+
|
|
18
|
+
## [20.5.1-beta.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.0...@bonniernews/dn-design-system-web@20.5.1-beta.0) (2024-10-02)
|
|
19
|
+
|
|
7
20
|
## [20.5.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.3...@bonniernews/dn-design-system-web@20.5.4) (2024-10-09)
|
|
8
21
|
|
|
9
22
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DividerProps {
|
|
2
|
+
variant?: 'soft' | 'medium' | 'hard';
|
|
3
|
+
classNames?: string;
|
|
4
|
+
attributes?: object;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {
|
|
8
|
+
const componentClassName = 'ds-divider';
|
|
9
|
+
const classNamePrefix = `${componentClassName}--`;
|
|
10
|
+
const classes = [
|
|
11
|
+
componentClassName,
|
|
12
|
+
`${classNamePrefix}${variant}`,
|
|
13
|
+
classNames
|
|
14
|
+
].filter(Boolean).join(' ');
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className={classes} {...attributes}><hr /></div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default Divider;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface QuoteProps {
|
|
2
|
+
bodyHtml: string;
|
|
3
|
+
theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';
|
|
4
|
+
classNames?: string;
|
|
5
|
+
attributes?: object;
|
|
6
|
+
forcePx?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {
|
|
10
|
+
const componentClassName = 'ds-quote';
|
|
11
|
+
const classes = [
|
|
12
|
+
componentClassName,
|
|
13
|
+
`ds-theme--${theme}`,
|
|
14
|
+
forcePx && 'ds-force-px',
|
|
15
|
+
classNames
|
|
16
|
+
].filter(Boolean).join(' ');
|
|
17
|
+
|
|
18
|
+
const quoteHtml = `<span class="${componentClassName}__border"></span> ${bodyHtml}`
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<blockquote dangerouslySetInnerHTML={{ __html: quoteHtml }} className={classes} {...attributes} />
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -7,15 +7,13 @@
|
|
|
7
7
|
margin: 0;
|
|
8
8
|
|
|
9
9
|
.ds-teaser-image__byline {
|
|
10
|
+
@include ds-typography($ds-typography-functionalmeta01, $lineHeight: $ds-lineheight-l);
|
|
10
11
|
position: absolute;
|
|
11
12
|
bottom: 0;
|
|
12
13
|
right: 0;
|
|
13
14
|
padding: ds-spacing(0 $ds-s-025);
|
|
14
15
|
margin-left: ds-spacing($ds-s-050);
|
|
15
|
-
|
|
16
|
-
@include ds-typography($ds-typography-functionalmeta01, $lineHeight: $ds-lineheight-l);
|
|
17
16
|
color: $ds-color-static-white;
|
|
18
|
-
|
|
19
17
|
background-color: $ds-color-static-transparent-black;
|
|
20
18
|
z-index: 5;
|
|
21
19
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ThematicBreakProps {
|
|
2
|
+
classNames?: string;
|
|
3
|
+
attributes?: object;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {
|
|
7
|
+
const componentClassName = 'ds-thematic-break';
|
|
8
|
+
const classes = [
|
|
9
|
+
componentClassName,
|
|
10
|
+
classNames
|
|
11
|
+
].filter(Boolean).join(' ');
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={classes} {...attributes}><hr /></div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default ThematicBreak;
|
package/index.tsx
ADDED
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.6.0",
|
|
4
4
|
"description": "DN design system for web.",
|
|
5
|
-
"main": "index.
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"source": "index.tsx",
|
|
6
8
|
"homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
|
|
7
9
|
"repository": {
|
|
8
10
|
"type": "git",
|
|
@@ -14,18 +16,62 @@
|
|
|
14
16
|
"bugs": {
|
|
15
17
|
"url": "https://github.com/BonnierNews/dn-design-system/issues"
|
|
16
18
|
},
|
|
19
|
+
"exports": {
|
|
20
|
+
"./preact": {
|
|
21
|
+
"import": "./preact/components.esm.js",
|
|
22
|
+
"require": "./preact/components.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./react": {
|
|
25
|
+
"import": "./react/components.esm.js",
|
|
26
|
+
"require": "./react/components.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./assets/*.tsx": "./assets/*.tsx",
|
|
29
|
+
"./assets/*.njk": "./assets/*.njk",
|
|
30
|
+
"./assets/*.scss": "./assets/*.scss",
|
|
31
|
+
"./components/*.tsx": "./components/*.tsx",
|
|
32
|
+
"./components/*.njk": "./components/*.njk",
|
|
33
|
+
"./components/*.md": "./components/*.md",
|
|
34
|
+
"./components/*.js": "./components/*.js",
|
|
35
|
+
"./components/*.scss": "./components/*.scss",
|
|
36
|
+
"./components/*.css": "./components/*.css",
|
|
37
|
+
"./introduction/*.md": "./introduction/*.md",
|
|
38
|
+
"./foundations/*": "./foundations/*",
|
|
39
|
+
"./tokens/*.json": "./tokens/*.json",
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"preact": "^10.24.0",
|
|
44
|
+
"react": "^18.3.1",
|
|
45
|
+
"react-dom": "^18.3.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"preact": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"react": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"react-dom": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
17
58
|
"devDependencies": {
|
|
59
|
+
"@bonniernews/tsconfig": "^0.0.2",
|
|
18
60
|
"@commitlint/cli": "^18.4.3",
|
|
19
61
|
"@commitlint/config-conventional": "^18.4.3",
|
|
20
62
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
21
63
|
"conventional-changelog-conventionalcommits": "^6.1.0",
|
|
22
64
|
"postcss": "8.4.31",
|
|
65
|
+
"preact": "^10.24.0",
|
|
66
|
+
"react": "^18.3.1",
|
|
67
|
+
"react-dom": "^18.3.1",
|
|
23
68
|
"release-it": "^17.0.0",
|
|
24
69
|
"stylelint": "^15.11.0",
|
|
25
70
|
"stylelint-config-recommended-scss": "^13.1.0",
|
|
26
71
|
"stylelint-prettier": "^4.0.2",
|
|
27
72
|
"stylelint-sass-render-errors": "^3.0.1",
|
|
28
|
-
"stylelint-selector-bem-pattern": "^2.1.1"
|
|
73
|
+
"stylelint-selector-bem-pattern": "^2.1.1",
|
|
74
|
+
"typescript": "^5.6.2"
|
|
29
75
|
},
|
|
30
76
|
"scripts": {
|
|
31
77
|
"lint:styles": "yarn stylelint \"**/*.scss\" \"!node_modules/\"",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface QuoteProps {
|
|
2
|
+
bodyHtml: string;
|
|
3
|
+
theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';
|
|
4
|
+
classNames?: string;
|
|
5
|
+
attributes?: object;
|
|
6
|
+
forcePx?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Quote: ({ bodyHtml, theme, classNames, attributes, forcePx }: QuoteProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// ../src/index.tsx
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Divider: () => Divider,
|
|
24
|
+
Quote: () => Quote,
|
|
25
|
+
ThematicBreak: () => ThematicBreak
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
|
|
29
|
+
// ../src/components/divider/divider.tsx
|
|
30
|
+
var import_jsx_runtime = require("preact/jsx-runtime");
|
|
31
|
+
var Divider = ({ variant = "soft", classNames, attributes }) => {
|
|
32
|
+
const componentClassName = "ds-divider";
|
|
33
|
+
const classNamePrefix = `${componentClassName}--`;
|
|
34
|
+
const classes = [
|
|
35
|
+
componentClassName,
|
|
36
|
+
`${classNamePrefix}${variant}`,
|
|
37
|
+
classNames
|
|
38
|
+
].filter(Boolean).join(" ");
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", {}) });
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// ../src/components/thematic-break/thematic-break.tsx
|
|
43
|
+
var import_jsx_runtime2 = require("preact/jsx-runtime");
|
|
44
|
+
var ThematicBreak = ({ classNames, attributes }) => {
|
|
45
|
+
const componentClassName = "ds-thematic-break";
|
|
46
|
+
const classes = [
|
|
47
|
+
componentClassName,
|
|
48
|
+
classNames
|
|
49
|
+
].filter(Boolean).join(" ");
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {}) });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// ../src/components/quote/quote.tsx
|
|
54
|
+
var import_jsx_runtime3 = require("preact/jsx-runtime");
|
|
55
|
+
var Quote = ({ bodyHtml, theme = "nyheter", classNames, attributes, forcePx }) => {
|
|
56
|
+
const componentClassName = "ds-quote";
|
|
57
|
+
const classes = [
|
|
58
|
+
componentClassName,
|
|
59
|
+
`ds-theme--${theme}`,
|
|
60
|
+
forcePx && "ds-force-px",
|
|
61
|
+
classNames
|
|
62
|
+
].filter(Boolean).join(" ");
|
|
63
|
+
const quoteHtml = `<span class="${componentClassName}__border"></span> ${bodyHtml}`;
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("blockquote", { dangerouslySetInnerHTML: { __html: quoteHtml }, className: classes, ...attributes });
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=components.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../index.tsx", "../components/divider/divider.tsx", "../components/thematic-break/thematic-break.tsx", "../components/quote/quote.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Divider } from \"./components/divider/divider\";\nexport { Divider };\n\nimport { ThematicBreak } from \"./components/thematic-break/thematic-break\";\nexport { ThematicBreak };\n\nimport { Quote } from \"./components/quote/quote\";\nexport { Quote };\n", "export interface DividerProps {\n variant?: 'soft' | 'medium' | 'hard';\n classNames?: string;\n attributes?: object;\n}\n\nexport const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {\n const componentClassName = 'ds-divider';\n const classNamePrefix = `${componentClassName}--`;\n const classes = [\n componentClassName,\n `${classNamePrefix}${variant}`,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default Divider;\n", "export interface ThematicBreakProps {\n classNames?: string;\n attributes?: object;\n}\n\nexport const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {\n const componentClassName = 'ds-thematic-break';\n const classes = [\n componentClassName,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default ThematicBreak;\n", "export interface QuoteProps {\n bodyHtml: string;\n theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';\n classNames?: string;\n attributes?: object;\n forcePx?: boolean;\n}\n\nexport const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {\n const componentClassName = 'ds-quote';\n const classes = [\n componentClassName,\n `ds-theme--${theme}`,\n forcePx && 'ds-force-px',\n classNames\n ].filter(Boolean).join(' ');\n\n const quoteHtml = `<span class=\"${componentClassName}__border\"></span> ${bodyHtml}`\n\n return (\n <blockquote dangerouslySetInnerHTML={{ __html: quoteHtml }} className={classes} {...attributes} />\n );\n};\n"],
|
|
5
|
+
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ider = ({ variant = "soft", classNames, attributes }) => {
|
|
4
|
+
const componentClassName = "ds-divider";
|
|
5
|
+
const classNamePrefix = `${componentClassName}--`;
|
|
6
|
+
const classes = [
|
|
7
|
+
componentClassName,
|
|
8
|
+
`${classNamePrefix}${variant}`,
|
|
9
|
+
classNames
|
|
10
|
+
].filter(Boolean).join(" ");
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsx("hr", {}) });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// ../src/components/thematic-break/thematic-break.tsx
|
|
15
|
+
import { jsx as jsx2 } from "preact/jsx-runtime";
|
|
16
|
+
var ThematicBreak = ({ classNames, attributes }) => {
|
|
17
|
+
const componentClassName = "ds-thematic-break";
|
|
18
|
+
const classes = [
|
|
19
|
+
componentClassName,
|
|
20
|
+
classNames
|
|
21
|
+
].filter(Boolean).join(" ");
|
|
22
|
+
return /* @__PURE__ */ jsx2("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsx2("hr", {}) });
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ../src/components/quote/quote.tsx
|
|
26
|
+
import { jsx as jsx3 } from "preact/jsx-runtime";
|
|
27
|
+
var Quote = ({ bodyHtml, theme = "nyheter", classNames, attributes, forcePx }) => {
|
|
28
|
+
const componentClassName = "ds-quote";
|
|
29
|
+
const classes = [
|
|
30
|
+
componentClassName,
|
|
31
|
+
`ds-theme--${theme}`,
|
|
32
|
+
forcePx && "ds-force-px",
|
|
33
|
+
classNames
|
|
34
|
+
].filter(Boolean).join(" ");
|
|
35
|
+
const quoteHtml = `<span class="${componentClassName}__border"></span> ${bodyHtml}`;
|
|
36
|
+
return /* @__PURE__ */ jsx3("blockquote", { dangerouslySetInnerHTML: { __html: quoteHtml }, className: classes, ...attributes });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
Divider,
|
|
40
|
+
Quote,
|
|
41
|
+
ThematicBreak
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=components.esm.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../components/divider/divider.tsx", "../components/thematic-break/thematic-break.tsx", "../components/quote/quote.tsx"],
|
|
4
|
+
"sourcesContent": ["export interface DividerProps {\n variant?: 'soft' | 'medium' | 'hard';\n classNames?: string;\n attributes?: object;\n}\n\nexport const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {\n const componentClassName = 'ds-divider';\n const classNamePrefix = `${componentClassName}--`;\n const classes = [\n componentClassName,\n `${classNamePrefix}${variant}`,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default Divider;\n", "export interface ThematicBreakProps {\n classNames?: string;\n attributes?: object;\n}\n\nexport const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {\n const componentClassName = 'ds-thematic-break';\n const classes = [\n componentClassName,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default ThematicBreak;\n", "export interface QuoteProps {\n bodyHtml: string;\n theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';\n classNames?: string;\n attributes?: object;\n forcePx?: boolean;\n}\n\nexport const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {\n const componentClassName = 'ds-quote';\n const classes = [\n componentClassName,\n `ds-theme--${theme}`,\n forcePx && 'ds-force-px',\n classNames\n ].filter(Boolean).join(' ');\n\n const quoteHtml = `<span class=\"${componentClassName}__border\"></span> ${bodyHtml}`\n\n return (\n <blockquote dangerouslySetInnerHTML={{ __html: quoteHtml }} className={classes} {...attributes} />\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAgB6C;AAVtC,IAAM,UAAU,CAAC,EAAE,UAAU,QAAQ,YAAY,WAAW,MAAoB;AACrF,QAAM,qBAAqB;AAC3B,QAAM,kBAAkB,GAAG,kBAAkB;AAC7C,QAAM,UAAU;AAAA,IACd;AAAA,IACA,GAAG,eAAe,GAAG,OAAO;AAAA,IAC5B;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,oBAAC,SAAI,WAAW,SAAU,GAAG,YAAY,8BAAC,QAAG,GAAE;AAEnD;;;ACL6C,gBAAAA,YAAA;AARtC,IAAM,gBAAgB,CAAC,EAAE,YAAY,WAAW,MAA0B;AAC/E,QAAM,qBAAqB;AAC3B,QAAM,UAAU;AAAA,IACd;AAAA,IACA;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,gBAAAA,KAAC,SAAI,WAAW,SAAU,GAAG,YAAY,0BAAAA,KAAC,QAAG,GAAE;AAEnD;;;ACKI,gBAAAC,YAAA;AAZG,IAAM,QAAQ,CAAC,EAAE,UAAU,QAAQ,WAAW,YAAY,YAAY,QAAQ,MAAkB;AACrG,QAAM,qBAAqB;AAC3B,QAAM,UAAU;AAAA,IACd;AAAA,IACA,aAAa,KAAK;AAAA,IAClB,WAAW;AAAA,IACX;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,QAAM,YAAY,gBAAgB,kBAAkB,qBAAqB,QAAQ;AAEjF,SACE,gBAAAA,KAAC,gBAAW,yBAAyB,EAAE,QAAQ,UAAU,GAAG,WAAW,SAAU,GAAG,YAAY;AAEpG;",
|
|
6
|
+
"names": ["jsx", "jsx"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface DividerProps {
|
|
2
|
+
variant?: 'soft' | 'medium' | 'hard';
|
|
3
|
+
classNames?: string;
|
|
4
|
+
attributes?: object;
|
|
5
|
+
}
|
|
6
|
+
export declare const Divider: ({ variant, classNames, attributes }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Divider;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface QuoteProps {
|
|
2
|
+
bodyHtml: string;
|
|
3
|
+
theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';
|
|
4
|
+
classNames?: string;
|
|
5
|
+
attributes?: object;
|
|
6
|
+
forcePx?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Quote: ({ bodyHtml, theme, classNames, attributes, forcePx }: QuoteProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// ../src/index.tsx
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Divider: () => Divider,
|
|
24
|
+
Quote: () => Quote,
|
|
25
|
+
ThematicBreak: () => ThematicBreak
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
|
|
29
|
+
// ../src/components/divider/divider.tsx
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var Divider = ({ variant = "soft", classNames, attributes }) => {
|
|
32
|
+
const componentClassName = "ds-divider";
|
|
33
|
+
const classNamePrefix = `${componentClassName}--`;
|
|
34
|
+
const classes = [
|
|
35
|
+
componentClassName,
|
|
36
|
+
`${classNamePrefix}${variant}`,
|
|
37
|
+
classNames
|
|
38
|
+
].filter(Boolean).join(" ");
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", {}) });
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// ../src/components/thematic-break/thematic-break.tsx
|
|
43
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
44
|
+
var ThematicBreak = ({ classNames, attributes }) => {
|
|
45
|
+
const componentClassName = "ds-thematic-break";
|
|
46
|
+
const classes = [
|
|
47
|
+
componentClassName,
|
|
48
|
+
classNames
|
|
49
|
+
].filter(Boolean).join(" ");
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {}) });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// ../src/components/quote/quote.tsx
|
|
54
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
55
|
+
var Quote = ({ bodyHtml, theme = "nyheter", classNames, attributes, forcePx }) => {
|
|
56
|
+
const componentClassName = "ds-quote";
|
|
57
|
+
const classes = [
|
|
58
|
+
componentClassName,
|
|
59
|
+
`ds-theme--${theme}`,
|
|
60
|
+
forcePx && "ds-force-px",
|
|
61
|
+
classNames
|
|
62
|
+
].filter(Boolean).join(" ");
|
|
63
|
+
const quoteHtml = `<span class="${componentClassName}__border"></span> ${bodyHtml}`;
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("blockquote", { dangerouslySetInnerHTML: { __html: quoteHtml }, className: classes, ...attributes });
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=components.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../index.tsx", "../components/divider/divider.tsx", "../components/thematic-break/thematic-break.tsx", "../components/quote/quote.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Divider } from \"./components/divider/divider\";\nexport { Divider };\n\nimport { ThematicBreak } from \"./components/thematic-break/thematic-break\";\nexport { ThematicBreak };\n\nimport { Quote } from \"./components/quote/quote\";\nexport { Quote };\n", "export interface DividerProps {\n variant?: 'soft' | 'medium' | 'hard';\n classNames?: string;\n attributes?: object;\n}\n\nexport const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {\n const componentClassName = 'ds-divider';\n const classNamePrefix = `${componentClassName}--`;\n const classes = [\n componentClassName,\n `${classNamePrefix}${variant}`,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default Divider;\n", "export interface ThematicBreakProps {\n classNames?: string;\n attributes?: object;\n}\n\nexport const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {\n const componentClassName = 'ds-thematic-break';\n const classes = [\n componentClassName,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default ThematicBreak;\n", "export interface QuoteProps {\n bodyHtml: string;\n theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';\n classNames?: string;\n attributes?: object;\n forcePx?: boolean;\n}\n\nexport const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {\n const componentClassName = 'ds-quote';\n const classes = [\n componentClassName,\n `ds-theme--${theme}`,\n forcePx && 'ds-force-px',\n classNames\n ].filter(Boolean).join(' ');\n\n const quoteHtml = `<span class=\"${componentClassName}__border\"></span> ${bodyHtml}`\n\n return (\n <blockquote dangerouslySetInnerHTML={{ __html: quoteHtml }}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import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var Divider = ({ variant = "soft", classNames, attributes }) => {
|
|
4
|
+
const componentClassName = "ds-divider";
|
|
5
|
+
const classNamePrefix = `${componentClassName}--`;
|
|
6
|
+
const classes = [
|
|
7
|
+
componentClassName,
|
|
8
|
+
`${classNamePrefix}${variant}`,
|
|
9
|
+
classNames
|
|
10
|
+
].filter(Boolean).join(" ");
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsx("hr", {}) });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// ../src/components/thematic-break/thematic-break.tsx
|
|
15
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
16
|
+
var ThematicBreak = ({ classNames, attributes }) => {
|
|
17
|
+
const componentClassName = "ds-thematic-break";
|
|
18
|
+
const classes = [
|
|
19
|
+
componentClassName,
|
|
20
|
+
classNames
|
|
21
|
+
].filter(Boolean).join(" ");
|
|
22
|
+
return /* @__PURE__ */ jsx2("div", { className: classes, ...attributes, children: /* @__PURE__ */ jsx2("hr", {}) });
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ../src/components/quote/quote.tsx
|
|
26
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
27
|
+
var Quote = ({ bodyHtml, theme = "nyheter", classNames, attributes, forcePx }) => {
|
|
28
|
+
const componentClassName = "ds-quote";
|
|
29
|
+
const classes = [
|
|
30
|
+
componentClassName,
|
|
31
|
+
`ds-theme--${theme}`,
|
|
32
|
+
forcePx && "ds-force-px",
|
|
33
|
+
classNames
|
|
34
|
+
].filter(Boolean).join(" ");
|
|
35
|
+
const quoteHtml = `<span class="${componentClassName}__border"></span> ${bodyHtml}`;
|
|
36
|
+
return /* @__PURE__ */ jsx3("blockquote", { dangerouslySetInnerHTML: { __html: quoteHtml }, className: classes, ...attributes });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
Divider,
|
|
40
|
+
Quote,
|
|
41
|
+
ThematicBreak
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=components.esm.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../components/divider/divider.tsx", "../components/thematic-break/thematic-break.tsx", "../components/quote/quote.tsx"],
|
|
4
|
+
"sourcesContent": ["export interface DividerProps {\n variant?: 'soft' | 'medium' | 'hard';\n classNames?: string;\n attributes?: object;\n}\n\nexport const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {\n const componentClassName = 'ds-divider';\n const classNamePrefix = `${componentClassName}--`;\n const classes = [\n componentClassName,\n `${classNamePrefix}${variant}`,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default Divider;\n", "export interface ThematicBreakProps {\n classNames?: string;\n attributes?: object;\n}\n\nexport const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {\n const componentClassName = 'ds-thematic-break';\n const classes = [\n componentClassName,\n classNames\n ].filter(Boolean).join(' ');\n\n return (\n <div className={classes} {...attributes}><hr /></div>\n );\n};\n\nexport default ThematicBreak;\n", "export interface QuoteProps {\n bodyHtml: string;\n theme?: 'kultur' | 'nyheter' | 'sport' | 'ekonomi' | 'sthlm';\n classNames?: string;\n attributes?: object;\n forcePx?: boolean;\n}\n\nexport const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {\n const componentClassName = 'ds-quote';\n const classes = [\n componentClassName,\n `ds-theme--${theme}`,\n forcePx && 'ds-force-px',\n classNames\n ].filter(Boolean).join(' ');\n\n const quoteHtml = `<span class=\"${componentClassName}__border\"></span> ${bodyHtml}`\n\n return (\n <blockquote dangerouslySetInnerHTML={{ __html: quoteHtml }} className={classes} {...attributes} />\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAgB6C;AAVtC,IAAM,UAAU,CAAC,EAAE,UAAU,QAAQ,YAAY,WAAW,MAAoB;AACrF,QAAM,qBAAqB;AAC3B,QAAM,kBAAkB,GAAG,kBAAkB;AAC7C,QAAM,UAAU;AAAA,IACd;AAAA,IACA,GAAG,eAAe,GAAG,OAAO;AAAA,IAC5B;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,oBAAC,SAAI,WAAW,SAAU,GAAG,YAAY,8BAAC,QAAG,GAAE;AAEnD;;;ACL6C,gBAAAA,YAAA;AARtC,IAAM,gBAAgB,CAAC,EAAE,YAAY,WAAW,MAA0B;AAC/E,QAAM,qBAAqB;AAC3B,QAAM,UAAU;AAAA,IACd;AAAA,IACA;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,gBAAAA,KAAC,SAAI,WAAW,SAAU,GAAG,YAAY,0BAAAA,KAAC,QAAG,GAAE;AAEnD;;;ACKI,gBAAAC,YAAA;AAZG,IAAM,QAAQ,CAAC,EAAE,UAAU,QAAQ,WAAW,YAAY,YAAY,QAAQ,MAAkB;AACrG,QAAM,qBAAqB;AAC3B,QAAM,UAAU;AAAA,IACd;AAAA,IACA,aAAa,KAAK;AAAA,IAClB,WAAW;AAAA,IACX;AAAA,EACF,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,QAAM,YAAY,gBAAgB,kBAAkB,qBAAqB,QAAQ;AAEjF,SACE,gBAAAA,KAAC,gBAAW,yBAAyB,EAAE,QAAQ,UAAU,GAAG,WAAW,SAAU,GAAG,YAAY;AAEpG;",
|
|
6
|
+
"names": ["jsx", "jsx"]
|
|
7
|
+
}
|
package/react/index.d.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@bonniernews/tsconfig",
|
|
3
|
+
"include": ["index.tsx", "components/**/*.tsx"] ,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"skipLibCheck": false,
|
|
9
|
+
"rootDir": "./",
|
|
10
|
+
"allowUmdGlobalAccess": true,
|
|
11
|
+
"typeRoots": [
|
|
12
|
+
"node_modules/@types"
|
|
13
|
+
],
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"jsxFactory": "",
|
|
16
|
+
"jsxFragmentFactory": "",
|
|
17
|
+
},
|
|
18
|
+
"lib": [
|
|
19
|
+
"ES2022"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
File without changes
|