@progressive-development/pd-content 0.1.71 → 0.1.73

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.
@@ -1,3 +1,17 @@
1
- module.exports = {
2
- stories: ['../stories/**/*.stories.{js,md,mdx}'],
1
+ /** @type { import('@storybook/web-components-vite').StorybookConfig } */
2
+ const config = {
3
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4
+ addons: [
5
+ '@storybook/addon-links',
6
+ '@storybook/addon-essentials',
7
+ '@chromatic-com/storybook',
8
+ ],
9
+ framework: {
10
+ name: '@storybook/web-components-vite',
11
+ options: {},
12
+ },
13
+ docs: {
14
+ autodocs: 'tag',
15
+ },
3
16
  };
17
+ export default config;
@@ -0,0 +1,13 @@
1
+ /** @type { import('@storybook/web-components').Preview } */
2
+ const preview = {
3
+ parameters: {
4
+ controls: {
5
+ matchers: {
6
+ color: /(background|color)$/i,
7
+ date: /Date$/i,
8
+ },
9
+ },
10
+ },
11
+ };
12
+
13
+ export default preview;
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
3
+ "sourceLocale": "dev",
4
+ "targetLocales": ["de", "en", "be"],
5
+ "inputFiles": [
6
+ "src/**/*.js"
7
+ ],
8
+ "output": {
9
+ "mode": "runtime",
10
+ "localeCodesModule": "src/generated/locale-codes.js",
11
+ "outputDir": "src/generated/locale"
12
+
13
+ },
14
+ "interchange": {
15
+ "format": "xliff",
16
+ "xliffDir": "./xliff/"
17
+ }
18
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Progressive Development content components. ",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development UG",
6
- "version": "0.1.71",
6
+ "version": "0.1.73",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -13,34 +13,47 @@
13
13
  "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
14
14
  "test": "web-test-runner --coverage",
15
15
  "test:watch": "web-test-runner --watch",
16
- "storybook": "npm run analyze -- --exclude dist && web-dev-server -c .storybook/server.mjs",
17
- "storybook:build": "npm run analyze -- --exclude dist && build-storybook"
16
+ "storybook": "storybook dev -p 6006",
17
+ "storybook:build": "npm run analyze -- --exclude dist && build-storybook",
18
+ "localizeExtract": "lit-localize extract",
19
+ "localizeBuild": "lit-localize build"
18
20
  },
19
21
  "dependencies": {
20
- "@progressive-development/pd-dialog": "^0.1.73",
22
+ "@lit/localize": "^0.12.1",
23
+ "@progressive-development/pd-dialog": "^0.1.74",
21
24
  "@progressive-development/pd-icon": "^0.1.20",
22
25
  "@progressive-development/pd-shared-styles": "^0.1.1",
23
- "lit": "^2.2.0",
24
- "pwa-helpers": "^0.9.0"
26
+ "lit": "^2.8.0",
27
+ "pwa-helpers": "^0.9.1"
25
28
  },
26
29
  "devDependencies": {
30
+ "@chromatic-com/storybook": "^1.3.4",
27
31
  "@custom-elements-manifest/analyzer": "^0.4.17",
32
+ "@lit/localize-tools": "^0.7.2",
28
33
  "@open-wc/eslint-config": "^4.3.0",
29
- "@open-wc/testing": "next",
30
- "@web/dev-server": "^0.1.30",
31
- "@web/dev-server-storybook": "next",
32
- "@web/test-runner": "^0.13.27",
34
+ "@open-wc/testing": "^3.2.2",
35
+ "@storybook/addon-essentials": "^8.0.10",
36
+ "@storybook/addon-links": "^8.0.10",
37
+ "@storybook/blocks": "^8.0.10",
38
+ "@storybook/test": "^8.0.10",
39
+ "@storybook/web-components": "^8.0.10",
40
+ "@storybook/web-components-vite": "^8.0.10",
41
+ "@web/dev-server": "^0.1.38",
42
+ "@web/test-runner": "^0.13.31",
33
43
  "eslint": "^7.32.0",
34
- "eslint-config-prettier": "^8.4.0",
44
+ "eslint-config-prettier": "^8.10.0",
45
+ "eslint-plugin-storybook": "^0.8.0",
35
46
  "husky": "^4.3.8",
36
47
  "lint-staged": "^10.5.4",
37
- "prettier": "^2.5.1"
48
+ "prettier": "^2.8.8",
49
+ "storybook": "^8.0.10"
38
50
  },
39
51
  "customElements": "custom-elements.json",
40
52
  "eslintConfig": {
41
53
  "extends": [
42
54
  "@open-wc",
43
- "prettier"
55
+ "prettier",
56
+ "plugin:storybook/recommended"
44
57
  ]
45
58
  },
46
59
  "prettier": {
package/src/PdMoreInfo.js CHANGED
@@ -6,6 +6,8 @@
6
6
  */
7
7
 
8
8
  import { LitElement, html, css } from 'lit';
9
+ import { msg, updateWhenLocaleChanges } from '@lit/localize';
10
+
9
11
  import { PDFontStyles } from '@progressive-development/pd-shared-styles';
10
12
 
11
13
  /**
@@ -51,6 +53,7 @@ export class PdMoreInfo extends LitElement {
51
53
  constructor() {
52
54
  super();
53
55
  this._lessInfo = true;
56
+ updateWhenLocaleChanges(this);
54
57
  }
55
58
 
56
59
  render() {
@@ -58,14 +61,14 @@ export class PdMoreInfo extends LitElement {
58
61
  return html`
59
62
  <p>
60
63
  <slot name="small-view"></slot>
61
- <a @click="${this._showMoreInfo}">Meer informatie</a>
64
+ <a @click="${this._showMoreInfo}">${msg("More information", {id: "pd.moreInfo.more"})}</a>
62
65
  </p>
63
66
  `;
64
67
  }
65
68
  return html`
66
69
  <p>
67
70
  <slot name="large-view"></slot>
68
- <a @click="${this._showLessInfo}">Minder informatie</a>
71
+ <a @click="${this._showLessInfo}">${msg("Less information", {id: "pd.moreInfo.less"})}</a>
69
72
  </p>
70
73
  `;
71
74
  }
@@ -0,0 +1,15 @@
1
+
2
+ // Do not modify this file by hand!
3
+ // Re-generate this file by running lit-localize
4
+
5
+
6
+
7
+
8
+ /* eslint-disable no-irregular-whitespace */
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+
11
+ export const templates = {
12
+ 'pd.moreInfo.less': `Minder informatie`,
13
+ 'pd.moreInfo.more': `Meer informatie`,
14
+ };
15
+
@@ -0,0 +1,15 @@
1
+
2
+ // Do not modify this file by hand!
3
+ // Re-generate this file by running lit-localize
4
+
5
+
6
+
7
+
8
+ /* eslint-disable no-irregular-whitespace */
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+
11
+ export const templates = {
12
+ 'pd.moreInfo.less': `Text ausblenden`,
13
+ 'pd.moreInfo.more': `Mehr Informationen`,
14
+ };
15
+
@@ -0,0 +1,15 @@
1
+
2
+ // Do not modify this file by hand!
3
+ // Re-generate this file by running lit-localize
4
+
5
+
6
+
7
+
8
+ /* eslint-disable no-irregular-whitespace */
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+
11
+ export const templates = {
12
+ 'pd.moreInfo.more': `More information`,
13
+ 'pd.moreInfo.less': `Less information`,
14
+ };
15
+
@@ -0,0 +1,27 @@
1
+ // Do not modify this file by hand!
2
+ // Re-generate this file by running lit-localize.
3
+
4
+ /**
5
+ * The locale code that templates in this source code are written in.
6
+ */
7
+ export const sourceLocale = `dev`;
8
+
9
+ /**
10
+ * The other locale codes that this application is localized into. Sorted
11
+ * lexicographically.
12
+ */
13
+ export const targetLocales = [
14
+ `be`,
15
+ `de`,
16
+ `en`,
17
+ ];
18
+
19
+ /**
20
+ * All valid project locale codes. Sorted lexicographically.
21
+ */
22
+ export const allLocales = [
23
+ `be`,
24
+ `de`,
25
+ `dev`,
26
+ `en`,
27
+ ];
@@ -1,9 +1,13 @@
1
1
  import { html } from 'lit';
2
- import '../pd-box-view.js';
2
+ import '../../pd-box-view.js';
3
+
3
4
 
4
5
  export default {
5
6
  title: 'PdContent/Box View',
6
7
  component: 'pd-box-view',
8
+ parameters: {
9
+ actions: { argTypesRegex: '^on.*' },
10
+ },
7
11
  argTypes: {
8
12
 
9
13
  },
@@ -1,5 +1,5 @@
1
1
  import { html } from 'lit';
2
- import '../pd-collapse.js';
2
+ import '../../pd-collapse.js';
3
3
 
4
4
  export default {
5
5
  title: 'PdContent/Collapse',
@@ -1,5 +1,5 @@
1
1
  import { html } from 'lit';
2
- import '../pd-edit-content.js';
2
+ import '../../pd-edit-content.js';
3
3
 
4
4
  export default {
5
5
  title: 'PdContent/Edit Content',
@@ -1,5 +1,5 @@
1
1
  import { html } from 'lit';
2
- import '../pd-more-info.js';
2
+ import '../../pd-more-info.js';
3
3
 
4
4
  export default {
5
5
  title: 'PdContent/More Info',
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable lit-a11y/alt-text */
2
2
  import { html } from 'lit';
3
- import '../pd-resize-content.js';
3
+ import '../../pd-resize-content.js';
4
4
 
5
5
  export default {
6
6
  title: 'PdContent/Resize Content',
package/xliff/be.xlf ADDED
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+ <file target-language="be" source-language="dev" original="lit-localize-inputs" datatype="plaintext">
4
+ <body>
5
+ <trans-unit id="pd.moreInfo.more">
6
+ <source>More information</source>
7
+ <target>Meer informatie</target>
8
+ </trans-unit>
9
+ <trans-unit id="pd.moreInfo.less">
10
+ <source>Less information</source>
11
+ <target>Minder informatie</target>
12
+ </trans-unit>
13
+ </body>
14
+ </file>
15
+ </xliff>
package/xliff/de.xlf ADDED
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+ <file target-language="de" source-language="dev" original="lit-localize-inputs" datatype="plaintext">
4
+ <body>
5
+ <trans-unit id="pd.moreInfo.more">
6
+ <source>More information</source>
7
+ <target>Mehr Informationen</target>
8
+ </trans-unit>
9
+ <trans-unit id="pd.moreInfo.less">
10
+ <source>Less information</source>
11
+ <target>Text ausblenden</target>
12
+ </trans-unit>
13
+ </body>
14
+ </file>
15
+ </xliff>
package/xliff/en.xlf ADDED
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+ <file target-language="en" source-language="dev" original="lit-localize-inputs" datatype="plaintext">
4
+ <body>
5
+ <trans-unit id="pd.moreInfo.more">
6
+ <source>More information</source>
7
+ </trans-unit>
8
+ <trans-unit id="pd.moreInfo.less">
9
+ <source>Less information</source>
10
+ </trans-unit>
11
+ </body>
12
+ </file>
13
+ </xliff>
@@ -1,2 +0,0 @@
1
- <link rel="preconnect" href="https://fonts.gstatic.com">
2
- <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&family=Oswald:wght@700&display=swap" rel="stylesheet">
@@ -1,8 +0,0 @@
1
- import { storybookPlugin } from '@web/dev-server-storybook';
2
- import baseConfig from '../web-dev-server.config.mjs';
3
-
4
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5
- ...baseConfig,
6
- open: '/',
7
- plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
8
- });