@bonniernews/dn-design-system-web 20.4.5 → 20.5.1-beta.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 CHANGED
@@ -4,6 +4,15 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [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)
8
+
9
+ ## [20.5.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.4.5...@bonniernews/dn-design-system-web@20.5.0) (2024-09-26)
10
+
11
+
12
+ ### Features
13
+
14
+ * **web:** empty state component ([#1411](https://github.com/BonnierNews/dn-design-system/issues/1411)) ([41e01c9](https://github.com/BonnierNews/dn-design-system/commit/41e01c9ca7bf102596249ffc579128e38a9bd533))
15
+
7
16
  ## [20.4.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.4.4...@bonniernews/dn-design-system-web@20.4.5) (2024-09-26)
8
17
 
9
18
 
@@ -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;
File without changes
@@ -0,0 +1,40 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/basic/empty-state](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/basic/empty-state)
2
+ - Storybook: [EmptyState](https://designsystem.dn.se/?path=/docs/basic-emptystate--docs)
3
+ - Storybook (Latest): [EmptyState](https://designsystem-latest.dn.se/?path=/docs/basic-emptystate--docs)
4
+
5
+ ----
6
+
7
+ # Empty state
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ | iconName | String | no | add, arrow_back, delete etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icons--all-icons |
14
+ | title | String | no | | | Title for empty state |
15
+ | body | String | no | | | Describing text |
16
+ | brandButton | Object | no | text | | Object with text, href (optional), classNames (optional) and attributes (optional).|
17
+ | primaryButton | Object | no | text | | Object with text, href (optional), classNames (optional) and attributes (optional) |
18
+ | classNames | String | no | | | Ex. "my-special-class" |
19
+ | attributes | Object | no | | | Ex. { data-prop: value } |
20
+
21
+ ## Minimum requirement example
22
+
23
+ ### Nunjucks
24
+
25
+ These are copy paste friendly examples to quickliy get started using a component.
26
+
27
+ ```html
28
+ {% from '@bonniernews/dn-design-system-web/components/empty-state/empty-state.njk' import EmptyState %}
29
+
30
+ {{ EmptyState({
31
+ iconName: "delete",
32
+ title: "Attans då...",
33
+ body: "Din sökning gav tyvärr inga träffar.",
34
+ })}}
35
+ ```
36
+
37
+ ### SCSS
38
+ ```scss
39
+ @use "@bonniernews/dn-design-system-web/basic/empty-state/empty-state" as *;
40
+ ```
@@ -0,0 +1,62 @@
1
+ {% from '@bonniernews/dn-design-system-web/components/pictogram/pictogram.njk' import Pictogram %}
2
+ {% from '@bonniernews/dn-design-system-web/components/button/button.njk' import Button %}
3
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
4
+
5
+ {% macro EmptyState(params) %}
6
+ {% set componentClassName = "ds-empty-state" %}
7
+
8
+ {%- set classes = [
9
+ componentClassName,
10
+ params.classNames if params.classNames
11
+ ] | join(" ") %}
12
+ {% set attributes = getAttributes(params.attributes) %}
13
+
14
+ <div class="{{ classes }}" {{- attributes | safe }}>
15
+ {% if params.iconName %}
16
+ {{ Pictogram({
17
+ variant: "brand",
18
+ size: "large",
19
+ iconName: params.iconName,
20
+ attributes: { "aria-label": params.body if params.body else "" }
21
+ })}}
22
+ {% endif %}
23
+
24
+ <div class="{{ componentClassName + '__text' }}">
25
+ {% if params.title %}
26
+ <h2>{{ params.title }}</h2>
27
+ {% endif %}
28
+ {% if params.body %}
29
+ <span class="{{ componentClassName + '__body' }}">{{ params.body }}</span>
30
+ {% endif %}
31
+ </div>
32
+
33
+ {% if params.brandButton or params.primaryButton %}
34
+ <div class="{{ componentClassName + '__button-wrapper' }}">
35
+ {% if params.brandButton %}
36
+ {{ Button({
37
+ text: params.brandButton.text,
38
+ variant: "brand",
39
+ href: params.brandButton.href,
40
+ classNames: params.brandButton.classNames,
41
+ attributes: params.brandButton.attributes,
42
+ forcePx: params.forcePx,
43
+ fullWidth: true
44
+ })}}
45
+ {% endif %}
46
+
47
+ {% if params.primaryButton %}
48
+ {{ Button({
49
+ text: params.primaryButton.text,
50
+ variant: "primary",
51
+ emphasis: "outline",
52
+ href: params.primaryButton.href,
53
+ classNames: params.primaryButton.classNames,
54
+ attributes: params.primaryButton.attributes,
55
+ forcePx: params.forcePx,
56
+ fullWidth: true
57
+ })}}
58
+ {% endif %}
59
+ </div>
60
+ {% endif %}
61
+ </div>
62
+ {% endmacro %}
@@ -0,0 +1,35 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../components/pictogram/pictogram.scss" as *;
3
+ @use "../../components/button/button.scss" as *;
4
+
5
+ .ds-empty-state {
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ text-align: center;
10
+
11
+ .ds-empty-state__text {
12
+ margin-top: ds-spacing($ds-s-100);
13
+
14
+ h2 {
15
+ @include ds-typography($ds-typography-functionalheading03);
16
+ color: $ds-color-text-primary;
17
+ margin: 0;
18
+ }
19
+
20
+ .ds-empty-state__body {
21
+ @include ds-typography($ds-typography-functionalbody02);
22
+ display: block;
23
+ color: $ds-color-text-primary-02;
24
+ margin-top: ds-spacing($ds-s-025);
25
+ }
26
+ }
27
+
28
+ .ds-empty-state__button-wrapper {
29
+ margin-top: ds-spacing($ds-s-100);
30
+
31
+ .ds-btn + .ds-btn {
32
+ margin-top: ds-spacing($ds-s-050);
33
+ }
34
+ }
35
+ }
@@ -1,4 +1,4 @@
1
- import {dsButtonToggle} from '@bonniernews/dn-design-system-web/components/button/button';
1
+ import {dsButtonToggle} from '@bonniernews/dn-design-system-web/components/button/button.js';
2
2
 
3
3
  export {
4
4
  dsListItem,
@@ -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
@@ -0,0 +1,5 @@
1
+ import { Divider } from "./components/divider/divider";
2
+ export { Divider };
3
+
4
+ import { ThematicBreak } from "./components/thematic-break/thematic-break";
5
+ export { ThematicBreak };
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "20.4.5",
3
+ "version": "20.5.1-beta.0",
4
4
  "description": "DN design system for web.",
5
- "main": "index.js",
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,63 @@
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",
64
+ "esbuild": "^0.24.0",
22
65
  "postcss": "8.4.31",
66
+ "preact": "^10.24.0",
67
+ "react": "^18.3.1",
68
+ "react-dom": "^18.3.1",
23
69
  "release-it": "^17.0.0",
24
70
  "stylelint": "^15.11.0",
25
71
  "stylelint-config-recommended-scss": "^13.1.0",
26
72
  "stylelint-prettier": "^4.0.2",
27
73
  "stylelint-sass-render-errors": "^3.0.1",
28
- "stylelint-selector-bem-pattern": "^2.1.1"
74
+ "stylelint-selector-bem-pattern": "^2.1.1",
75
+ "typescript": "^5.6.2"
29
76
  },
30
77
  "scripts": {
31
78
  "lint:styles": "yarn stylelint \"**/*.scss\" \"!node_modules/\"",
@@ -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("preact").JSX.Element;
7
+ export default Divider;
@@ -0,0 +1,6 @@
1
+ export interface ThematicBreakProps {
2
+ classNames?: string;
3
+ attributes?: object;
4
+ }
5
+ export declare const ThematicBreak: ({ classNames, attributes }: ThematicBreakProps) => import("preact").JSX.Element;
6
+ export default ThematicBreak;
@@ -0,0 +1,51 @@
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
+ ThematicBreak: () => ThematicBreak
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+
28
+ // ../src/components/divider/divider.tsx
29
+ var import_jsx_runtime = require("preact/jsx-runtime");
30
+ var Divider = ({ variant = "soft", classNames, attributes }) => {
31
+ const componentClassName = "ds-divider";
32
+ const classNamePrefix = `${componentClassName}--`;
33
+ const classes = [
34
+ componentClassName,
35
+ `${classNamePrefix}${variant}`,
36
+ classNames
37
+ ].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", {}) });
39
+ };
40
+
41
+ // ../src/components/thematic-break/thematic-break.tsx
42
+ var import_jsx_runtime2 = require("preact/jsx-runtime");
43
+ var ThematicBreak = ({ classNames, attributes }) => {
44
+ const componentClassName = "ds-thematic-break";
45
+ const classes = [
46
+ componentClassName,
47
+ classNames
48
+ ].filter(Boolean).join(" ");
49
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {}) });
50
+ };
51
+ //# 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"],
4
+ "sourcesContent": ["import { Divider } from \"./components/divider/divider\";\nexport { Divider };\n\nimport { ThematicBreak } from \"./components/thematic-break/thematic-break\";\nexport { ThematicBreak };\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgB6C;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,4CAAC,SAAI,WAAW,SAAU,GAAG,YAAY,sDAAC,QAAG,GAAE;AAEnD;;;ACL6C,IAAAA,sBAAA;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,6CAAC,SAAI,WAAW,SAAU,GAAG,YAAY,uDAAC,QAAG,GAAE;AAEnD;",
6
+ "names": ["import_jsx_runtime"]
7
+ }
@@ -0,0 +1,28 @@
1
+ // ../src/components/divider/divider.tsx
2
+ import { jsx } from "preact/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 "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
+ export {
25
+ Divider,
26
+ ThematicBreak
27
+ };
28
+ //# 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"],
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"],
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;",
6
+ "names": ["jsx"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Divider } from "./components/divider/divider";
2
+ export { Divider };
3
+ import { ThematicBreak } from "./components/thematic-break/thematic-break";
4
+ export { ThematicBreak };
@@ -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,6 @@
1
+ export interface ThematicBreakProps {
2
+ classNames?: string;
3
+ attributes?: object;
4
+ }
5
+ export declare const ThematicBreak: ({ classNames, attributes }: ThematicBreakProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default ThematicBreak;
@@ -0,0 +1,51 @@
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
+ ThematicBreak: () => ThematicBreak
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+
28
+ // ../src/components/divider/divider.tsx
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ var Divider = ({ variant = "soft", classNames, attributes }) => {
31
+ const componentClassName = "ds-divider";
32
+ const classNamePrefix = `${componentClassName}--`;
33
+ const classes = [
34
+ componentClassName,
35
+ `${classNamePrefix}${variant}`,
36
+ classNames
37
+ ].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", {}) });
39
+ };
40
+
41
+ // ../src/components/thematic-break/thematic-break.tsx
42
+ var import_jsx_runtime2 = require("react/jsx-runtime");
43
+ var ThematicBreak = ({ classNames, attributes }) => {
44
+ const componentClassName = "ds-thematic-break";
45
+ const classes = [
46
+ componentClassName,
47
+ classNames
48
+ ].filter(Boolean).join(" ");
49
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: classes, ...attributes, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {}) });
50
+ };
51
+ //# 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"],
4
+ "sourcesContent": ["import { Divider } from \"./components/divider/divider\";\nexport { Divider };\n\nimport { ThematicBreak } from \"./components/thematic-break/thematic-break\";\nexport { ThematicBreak };\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgB6C;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,4CAAC,SAAI,WAAW,SAAU,GAAG,YAAY,sDAAC,QAAG,GAAE;AAEnD;;;ACL6C,IAAAA,sBAAA;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,6CAAC,SAAI,WAAW,SAAU,GAAG,YAAY,uDAAC,QAAG,GAAE;AAEnD;",
6
+ "names": ["import_jsx_runtime"]
7
+ }
@@ -0,0 +1,28 @@
1
+ // ../src/components/divider/divider.tsx
2
+ 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
+ export {
25
+ Divider,
26
+ ThematicBreak
27
+ };
28
+ //# 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"],
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"],
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;",
6
+ "names": ["jsx"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Divider } from "./components/divider/divider";
2
+ export { Divider };
3
+ import { ThematicBreak } from "./components/thematic-break/thematic-break";
4
+ export { ThematicBreak };
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "jsxFactory": "",
6
+ "jsxFragmentFactory": "",
7
+ "jsxImportSource": "preact",
8
+ "declaration": true,
9
+ "emitDeclarationOnly": true,
10
+ "outDir": "./preact",
11
+ },
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "jsxFactory": "",
6
+ "jsxFragmentFactory": "",
7
+ "declaration": true,
8
+ "emitDeclarationOnly": true,
9
+ "outDir": "./react",
10
+ },
11
+ }
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