@progressive-development/pd-page 0.1.127 → 0.5.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.
@@ -1,26 +1,15 @@
1
+ import { LitElement, css, html } from "lit";
2
+ import "@progressive-development/pd-icon/pd-icon";
3
+ import { PDColorStyles } from "@progressive-development/pd-shared-styles";
1
4
  /**
2
5
  * @license
3
6
  * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
4
7
  */
5
-
6
- import { LitElement, html, css } from 'lit';
7
-
8
- import '@progressive-development/pd-icon/pd-icon.js';
9
-
10
- import { PDColorStyles } from '@progressive-development/pd-shared-styles';
11
-
12
- /**
13
- * An example element.
14
- *
15
- * @slot - This element has a slot
16
- * @csspart button - The button
17
- */
18
- export class PdTeaser extends LitElement {
8
+ class PdTeaser extends LitElement {
19
9
  /**
20
10
  * Fired when free date clicked => At the moment only for freeDates
21
11
  * @event close-teaser
22
12
  */
23
-
24
13
  static get styles() {
25
14
  return [
26
15
  PDColorStyles,
@@ -156,9 +145,9 @@ export class PdTeaser extends LitElement {
156
145
  }
157
146
  }
158
147
 
159
- `];
148
+ `
149
+ ];
160
150
  }
161
-
162
151
  static get properties() {
163
152
  return {
164
153
  teaserObjects: { type: Array },
@@ -166,35 +155,28 @@ export class PdTeaser extends LitElement {
166
155
  _hideContent: { type: Boolean },
167
156
  _currentNumber: { type: Number },
168
157
  _slideDirection: { type: String },
169
- _visible: { type: Boolean },
158
+ _visible: { type: Boolean }
170
159
  };
171
160
  }
172
-
173
161
  constructor() {
174
162
  super();
175
163
  this.teaserObjects = [];
176
- this.resizeWidth = '1232px';
164
+ this.resizeWidth = "1232px";
177
165
  this._hideContent = false;
178
166
  this._currentNumber = 0;
179
-
180
- this._slideDirection = 'slide-rigth';
167
+ this._slideDirection = "slide-rigth";
181
168
  this._visible = true;
182
169
  }
183
-
184
170
  firstUpdated() {
185
- // dummy um content zu wechseln
186
- // window.setTimeout(() => this._nextContent(), 6000);
187
-
188
- const doSomething = scrollPos => {
171
+ const doSomething = (scrollPos) => {
189
172
  if (scrollPos <= 50) {
190
173
  this._visible = true;
191
174
  } else {
192
175
  this._visible = false;
193
176
  }
194
177
  };
195
-
196
178
  let ticking = false;
197
- document.addEventListener('scroll', () => {
179
+ document.addEventListener("scroll", () => {
198
180
  const lastKnownScrollPosition = window.scrollY;
199
181
  if (!ticking) {
200
182
  window.requestAnimationFrame(() => {
@@ -205,26 +187,21 @@ export class PdTeaser extends LitElement {
205
187
  }
206
188
  });
207
189
  }
208
-
209
190
  updated(changedProps) {
210
- if (changedProps.has('_visible')) {
211
- if (
212
- (changedProps.get('_visible') === true && this._visible === false) ||
213
- (changedProps.get('_visible') === false && this._visible === true)
214
- )
191
+ if (changedProps.has("_visible")) {
192
+ if (changedProps.get("_visible") === true && this._visible === false || changedProps.get("_visible") === false && this._visible === true)
215
193
  this.dispatchEvent(
216
- new CustomEvent('close-teaser', {
194
+ new CustomEvent("close-teaser", {
217
195
  detail: {
218
- value: this._visible,
219
- },
196
+ value: this._visible
197
+ }
220
198
  })
221
199
  );
222
200
  }
223
201
  }
224
-
225
202
  render() {
226
203
  return html`
227
- <div class="teaser-flex ${this._visible ? '' : 'in-active'}">
204
+ <div class="teaser-flex ${this._visible ? "" : "in-active"}">
228
205
  <pd-icon
229
206
  icon="previousArrow"
230
207
  class="previous"
@@ -237,31 +214,27 @@ export class PdTeaser extends LitElement {
237
214
  ></pd-icon>
238
215
 
239
216
  ${this.teaserObjects.map(
240
- (teaserObj, index) => html`
217
+ (teaserObj, index) => html`
241
218
  <div
242
- class="content ${this._currentNumber === index
243
- ? this._slideDirection
244
- : 'not-visible'}"
219
+ class="content ${this._currentNumber === index ? this._slideDirection : "not-visible"}"
245
220
  >
246
221
  <slot name="${teaserObj.name}"></slot>
247
222
  </div>
248
223
  `
249
- )}
224
+ )}
250
225
  </div>
251
226
  `;
252
227
  }
253
-
254
228
  _prevContent() {
255
- this._slideDirection = 'slide-left';
229
+ this._slideDirection = "slide-left";
256
230
  if (this._currentNumber === 0) {
257
231
  this._currentNumber = this.teaserObjects.length - 1;
258
232
  } else {
259
233
  this._currentNumber -= 1;
260
234
  }
261
235
  }
262
-
263
236
  _nextContent() {
264
- this._slideDirection = 'slide-rigth';
237
+ this._slideDirection = "slide-rigth";
265
238
  if (this._currentNumber === this.teaserObjects.length - 1) {
266
239
  this._currentNumber = 0;
267
240
  } else {
@@ -269,3 +242,6 @@ export class PdTeaser extends LitElement {
269
242
  }
270
243
  }
271
244
  }
245
+ export {
246
+ PdTeaser
247
+ };
@@ -1,27 +1,18 @@
1
+ import { LitElement, css, html } from "lit";
2
+ import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
1
3
  /**
2
4
  * @license
3
5
  * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
4
6
  */
5
-
6
- import { LitElement, html, css } from 'lit';
7
-
8
- import { PDColorStyles, PDFontStyles } from '@progressive-development/pd-shared-styles';
9
-
10
- /**
11
- * An example element.
12
- *
13
- * @slot - This element has a slot
14
- * @csspart button - The button
15
- */
16
- export class PdTeaserContent extends LitElement {
7
+ class PdTeaserContent extends LitElement {
17
8
  /**
18
9
  * Fired when free date clicked => At the moment only for freeDates
19
10
  * @event book-date
20
11
  */
21
-
22
- static get styles() {
12
+ static get styles() {
23
13
  return [
24
- PDColorStyles, PDFontStyles,
14
+ PDColorStyles,
15
+ PDFontStyles,
25
16
  css`
26
17
  :host {
27
18
  --my-background: var(--pd-teaser-image);
@@ -190,22 +181,20 @@ export class PdTeaserContent extends LitElement {
190
181
  line-height: 1;
191
182
  }
192
183
  }
193
- `];
184
+ `
185
+ ];
194
186
  }
195
-
196
187
  static get properties() {
197
188
  return {
198
189
  primaryTxt: { type: String },
199
- secondaryTxt: { type: String },
190
+ secondaryTxt: { type: String }
200
191
  };
201
192
  }
202
-
203
193
  constructor() {
204
194
  super();
205
- this.primaryTxt = '';
206
- this.secondaryTxt = '';
195
+ this.primaryTxt = "";
196
+ this.secondaryTxt = "";
207
197
  }
208
-
209
198
  render() {
210
199
  return html`
211
200
  <div class="t1">
@@ -217,3 +206,6 @@ export class PdTeaserContent extends LitElement {
217
206
  `;
218
207
  }
219
208
  }
209
+ export {
210
+ PdTeaserContent
211
+ };
package/package.json CHANGED
@@ -1,54 +1,71 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-page",
3
- "description": "Progressive development page helper, teaser, menu, footer.",
4
- "license": "SEE LICENSE IN LICENSE",
3
+ "description": "Progressive development page helper, teaser, menu, footer.",
5
4
  "author": "PD Progressive Development",
6
- "version": "0.1.127",
7
- "main": "index.js",
8
- "module": "index.js",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "version": "0.5.0",
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "exports": {
10
+ ".": "./dist/index.js",
11
+ "./pd-contact-us": "./dist/pd-contact-us.js",
12
+ "./pd-footer": "./dist/pd-footer.js",
13
+ "./pd-menu": "./dist/pd-menu.js",
14
+ "./pd-teaser": "./dist/pd-teaser.js",
15
+ "./locales/be": "./dist/locales/be.js",
16
+ "./locales/de": "./dist/locales/de.js",
17
+ "./locales/en": "./dist/locales/en.js"
18
+ },
19
+ "files": [
20
+ "dist/",
21
+ "package.json",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
9
25
  "scripts": {
10
26
  "analyze": "cem analyze --litelement",
11
- "start": "web-dev-server",
12
- "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
13
- "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
14
- "test": "web-test-runner --coverage",
15
- "test:watch": "web-test-runner --watch",
27
+ "start": "vite",
28
+ "build": "vite build",
29
+ "preview": "vite preview",
30
+ "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.{js,html}\" --check --ignore-path .gitignore",
31
+ "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.{js,html}\" --write --ignore-path .gitignore",
32
+ "test": "vitest run --coverage",
33
+ "test:watch": "vitest --watch",
16
34
  "localizeExtract": "lit-localize extract",
17
35
  "localizeBuild": "lit-localize build",
18
36
  "storybook": "storybook dev -p 6006",
19
37
  "build-storybook": "storybook build"
20
38
  },
21
39
  "dependencies": {
22
- "@lit/localize": "^0.11.4",
23
- "@progressive-development/pd-contact": "^0.1.69",
24
- "@progressive-development/pd-dialog": "^0.1.84",
25
- "@progressive-development/pd-forms": "^0.2.16",
26
- "@progressive-development/pd-icon": "^0.1.23",
40
+ "@lit/localize": "^0.12.2",
41
+ "@progressive-development/pd-contact": "^0.5.2",
42
+ "@progressive-development/pd-dialog": "^0.5.0",
43
+ "@progressive-development/pd-forms": "^0.5.0",
44
+ "@progressive-development/pd-icon": "^0.5.0",
27
45
  "@progressive-development/pd-shared-styles": "^0.1.1",
28
46
  "lit": "^2.8.0",
29
47
  "pwa-helpers": "^0.9.1"
30
48
  },
31
49
  "devDependencies": {
50
+ "@chromatic-com/storybook": "^1.3.4",
32
51
  "@custom-elements-manifest/analyzer": "^0.4.17",
33
- "@lit/localize-tools": "^0.6.10",
34
- "@open-wc/eslint-config": "^4.3.0",
35
- "@open-wc/testing": "^3.0.0-next.5",
36
- "@storybook/addon-essentials": "^7.5.3",
37
- "@storybook/addon-links": "^7.5.3",
38
- "@storybook/blocks": "^7.5.3",
39
- "@storybook/web-components": "^7.5.3",
40
- "@storybook/web-components-vite": "^7.5.3",
41
- "@web/dev-server": "^0.1.38",
42
- "@web/test-runner": "^0.13.31",
52
+ "@lit/localize-tools": "^0.7.2",
53
+ "@storybook/addon-essentials": "^8.0.10",
54
+ "@storybook/addon-links": "^8.0.10",
55
+ "@storybook/blocks": "^8.0.10",
56
+ "@storybook/test": "^8.0.10",
57
+ "@storybook/web-components": "^8.0.10",
58
+ "@storybook/web-components-vite": "^8.0.10",
43
59
  "eslint": "^7.32.0",
44
60
  "eslint-config-prettier": "^8.10.0",
45
- "eslint-plugin-storybook": "^0.6.15",
61
+ "eslint-plugin-storybook": "^0.8.0",
46
62
  "husky": "^4.3.8",
47
63
  "lint-staged": "^10.5.4",
48
64
  "prettier": "^2.8.8",
49
- "react": "^18.2.0",
50
- "react-dom": "^18.2.0",
51
- "storybook": "^7.5.3"
65
+ "rollup-plugin-visualizer": "^5.13.1",
66
+ "storybook": "^8.0.10",
67
+ "vite": "^5.4.11",
68
+ "vitest": "^2.1.8"
52
69
  },
53
70
  "customElements": "custom-elements.json",
54
71
  "eslintConfig": {
package/.editorconfig DELETED
@@ -1,29 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
-
8
- [*]
9
-
10
- # Change these settings to your own preference
11
- indent_style = space
12
- indent_size = 2
13
-
14
- # We recommend you to keep these unchanged
15
- end_of_line = lf
16
- charset = utf-8
17
- trim_trailing_whitespace = true
18
- insert_final_newline = true
19
-
20
- [*.md]
21
- trim_trailing_whitespace = false
22
-
23
- [*.json]
24
- indent_size = 2
25
-
26
- [*.{html,js,md}]
27
- block_comment_start = /**
28
- block_comment = *
29
- block_comment_end = */
@@ -1,13 +0,0 @@
1
- /** @type { import('@storybook/web-components-vite').StorybookConfig } */
2
- const config = {
3
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4
- addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
5
- framework: {
6
- name: '@storybook/web-components-vite',
7
- options: {},
8
- },
9
- docs: {
10
- autodocs: 'tag',
11
- },
12
- };
13
- export default config;
@@ -1,14 +0,0 @@
1
- /** @type { import('@storybook/web-components').Preview } */
2
- const preview = {
3
- parameters: {
4
- actions: { argTypesRegex: '^on[A-Z].*' },
5
- controls: {
6
- matchers: {
7
- color: /(background|color)$/i,
8
- date: /Date$/i,
9
- },
10
- },
11
- },
12
- };
13
-
14
- export default preview;
package/demo/index.html DELETED
@@ -1,29 +0,0 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '../pd-page.js';
17
-
18
- const title = 'Hello owc World!';
19
- render(
20
- html`
21
- <pd-page .title=${title}>
22
- some light-dom
23
- </pd-page>
24
- `,
25
- document.querySelector('#demo')
26
- );
27
- </script>
28
- </body>
29
- </html>
package/index.js DELETED
File without changes
package/lit-localize.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
3
- "sourceLocale": "de",
4
- "targetLocales": ["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/pd-contact-us.js DELETED
@@ -1,3 +0,0 @@
1
- import { PdContactUs } from './src/PdContactUs.js';
2
-
3
- window.customElements.define('pd-contact-us', PdContactUs);
package/pd-footer.js DELETED
@@ -1,3 +0,0 @@
1
- import { PdFooter } from './src/PdFooter.js';
2
-
3
- window.customElements.define('pd-footer', PdFooter);
package/pd-menu.js DELETED
@@ -1,3 +0,0 @@
1
- import { PdMenu } from './src/PdMenu.js';
2
-
3
- window.customElements.define('pd-menu', PdMenu);
package/pd-teaser.js DELETED
@@ -1,5 +0,0 @@
1
- import { PdTeaser } from './src/PdTeaser.js';
2
- import { PdTeaserContent } from './src/PdTeaserContent.js';
3
-
4
- window.customElements.define('pd-teaser', PdTeaser);
5
- window.customElements.define('pd-teaser-content', PdTeaserContent);
@@ -1,20 +0,0 @@
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
- 's0830a1e0d2456d9b': `Type uw bericht hier`,
13
- 'sab1114a5f102dedc': `Telefoon Nummer`,
14
- 'sc7dbfe3251f9a8db': `Verzenden`,
15
- 'sd1f44f1a8bc20e67': `Email`,
16
- 'sdd2fffdf86bf5b6e': `Adres`,
17
- 'sef49aec68fd1dc66': `Naam`,
18
- 'sfb4410b48e95fa73': `Contacteer ons`,
19
- };
20
-
@@ -1,20 +0,0 @@
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
- 'sfb4410b48e95fa73': `Kontakt`,
13
- 'sdd2fffdf86bf5b6e': `Adresse`,
14
- 'sef49aec68fd1dc66': `Name`,
15
- 'sd1f44f1a8bc20e67': `Email`,
16
- 'sab1114a5f102dedc': `Telefon`,
17
- 's0830a1e0d2456d9b': `Nachricht`,
18
- 'sc7dbfe3251f9a8db': `Absenden`,
19
- };
20
-
@@ -1,25 +0,0 @@
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 = `de`;
8
-
9
- /**
10
- * The other locale codes that this application is localized into. Sorted
11
- * lexicographically.
12
- */
13
- export const targetLocales = [
14
- `be`,
15
- `en`,
16
- ];
17
-
18
- /**
19
- * All valid project locale codes. Sorted lexicographically.
20
- */
21
- export const allLocales = [
22
- `be`,
23
- `de`,
24
- `en`,
25
- ];