@progressive-development/pd-page 0.0.8 → 0.0.9

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/index.js CHANGED
@@ -1 +0,0 @@
1
-
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Progressive development page helper, teaser, menu, footer.",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.0.8",
6
+ "version": "0.0.9",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "lit": "^2.0.2",
21
21
  "@progressive-development/pd-contact": "0.0.2",
22
- "@progressive-development/pd-forms": "0.0.13",
22
+ "@progressive-development/pd-forms": "0.0.14",
23
23
  "@progressive-development/pd-dialog": "0.0.7",
24
24
  "@progressive-development/pd-icon": "0.0.4"
25
25
  },
package/pd-contact-us.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { PdContactUs } from './src/PdContactUs.js';
2
2
 
3
- window.customElements.define('pd-contact-us', PdContactUs);
3
+ window.customElements.define('pd-contact-us', PdContactUs);
package/pd-footer.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { PdFooter } from './src/PdFooter.js';
2
2
 
3
- window.customElements.define('pd-footer', PdFooter);
3
+ window.customElements.define('pd-footer', PdFooter);
package/pd-menu.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { PdMenu } from './src/PdMenu.js';
2
2
 
3
- window.customElements.define('pd-menu', PdMenu);
3
+ window.customElements.define('pd-menu', PdMenu);
package/pd-teaser.js CHANGED
@@ -2,4 +2,4 @@ import { PdTeaser } from './src/PdTeaser.js';
2
2
  import { PdTeaserContent } from './src/PdTeaserContent.js';
3
3
 
4
4
  window.customElements.define('pd-teaser', PdTeaser);
5
- window.customElements.define('pd-teaser-content', PdTeaserContent);
5
+ window.customElements.define('pd-teaser-content', PdTeaserContent);
@@ -153,53 +153,53 @@ export class PdContactUs extends LitElement {
153
153
  </div>
154
154
 
155
155
  <div class="right-content">
156
- <squi-form-container>
157
- <squi-form-row>
158
- <squi-input
156
+ <pd-form-container>
157
+ <pd-form-row>
158
+ <pd-input
159
159
  id="nameInputId"
160
160
  class="quarter3"
161
161
  placeHolder="Naam"
162
162
  valueName="name"
163
163
  errorMsg="${this._getErrorMsg('name')}"
164
- ></squi-input>
165
- </squi-form-row>
164
+ ></pd-input>
165
+ </pd-form-row>
166
166
 
167
- <squi-form-row>
168
- <squi-input
167
+ <pd-form-row>
168
+ <pd-input
169
169
  id="mailInputId"
170
170
  class="quarter3"
171
171
  placeHolder="Email"
172
172
  valueName="mail"
173
173
  errorMsg="${this._getErrorMsg('mail')}"
174
- ></squi-input>
175
- </squi-form-row>
174
+ ></pd-input>
175
+ </pd-form-row>
176
176
 
177
- <squi-form-row>
178
- <squi-input
177
+ <pd-form-row>
178
+ <pd-input
179
179
  id="phoneInputId"
180
180
  class="quarter3"
181
181
  placeHolder="Telefoon Nummer"
182
182
  valueName="phone"
183
183
  errorMsg="${this._getErrorMsg('phone')}"
184
- ></squi-input>
185
- </squi-form-row>
184
+ ></pd-input>
185
+ </pd-form-row>
186
186
 
187
- <squi-form-row>
188
- <squi-input-area
187
+ <pd-form-row>
188
+ <pd-input-area
189
189
  id="msgInputId"
190
190
  class="quarter3-area"
191
191
  placeHolder="Type uw bericht hier"
192
192
  rows="15"
193
193
  valueName="msg"
194
194
  errorMsg="${this._getErrorMsg('msg')}"
195
- ></squi-input-area>
196
- </squi-form-row>
197
- </squi-form-container>
195
+ ></pd-input-area>
196
+ </pd-form-row>
197
+ </pd-form-container>
198
198
 
199
- <squi-button
199
+ <pd-button
200
200
  text="Verzenden"
201
201
  @click="${this._sendMail}"
202
- ></squi-button>
202
+ ></pd-button>
203
203
  </div>
204
204
  </div>
205
205
  </div>
@@ -264,4 +264,4 @@ export class PdContactUs extends LitElement {
264
264
  const mValid = /^\+?[0-9 ]{7,15}$/.test(phone);
265
265
  return mValid;
266
266
  }
267
- }
267
+ }
package/src/PdFooter.js CHANGED
@@ -110,8 +110,8 @@ export class PdFooter extends LitElement {
110
110
  }
111
111
 
112
112
  static get properties() {
113
- return {
114
- version: { type: String }
113
+ return {
114
+ version: { type: String },
115
115
  };
116
116
  }
117
117
 
@@ -125,7 +125,8 @@ export class PdFooter extends LitElement {
125
125
  render() {
126
126
  return html`
127
127
  <div class="left-content">
128
- <p>© ticomi technics<br/><span class="version">${this.version}</span>
128
+ <p>
129
+ © ticomi technics<br /><span class="version">${this.version}</span>
129
130
  </p>
130
131
  </div>
131
132
 
@@ -173,4 +174,4 @@ export class PdFooter extends LitElement {
173
174
  _policyClicked() {
174
175
  this.shadowRoot.getElementById('privacyPopupId').showPopup();
175
176
  }
176
- }
177
+ }
package/src/PdMenu.js CHANGED
@@ -99,7 +99,7 @@ export class PdMenu extends LitElement {
99
99
  }
100
100
 
101
101
  static get properties() {
102
- return {
102
+ return {
103
103
  menuItems: { type: Array },
104
104
  topMenuItems: { type: Array },
105
105
  teaserClosed: { type: Boolean }, // TODO: Definiert um scroll position anzugleichen, unabhängiger machen...
@@ -149,7 +149,6 @@ export class PdMenu extends LitElement {
149
149
  render() {
150
150
  return html`
151
151
  <ul>
152
-
153
152
  <li @click="${PdMenu._scrollToTop}">
154
153
  <slot name="slotLogo"></slot>
155
154
  </li>
@@ -157,7 +156,9 @@ export class PdMenu extends LitElement {
157
156
  ${this.menuItems.map(
158
157
  (item, index) => html`
159
158
  <li
160
- class="item ${this._activeSecIndex === index + 1 ? 'active' : ''} changevis"
159
+ class="item ${this._activeSecIndex === index + 1
160
+ ? 'active'
161
+ : ''} changevis"
161
162
  data-sec="${item.sec}"
162
163
  data-route="${item.route}"
163
164
  @click="${this._menuItemClicked}"
@@ -230,4 +231,4 @@ export class PdMenu extends LitElement {
230
231
  });
231
232
  }
232
233
  }
233
- }
234
+ }
package/src/PdTeaser.js CHANGED
@@ -269,4 +269,4 @@ export class PdTeaser extends LitElement {
269
269
  this._currentNumber += 1;
270
270
  }
271
271
  }
272
- }
272
+ }
@@ -1,9 +1,9 @@
1
1
  import { html } from 'lit';
2
- import '../pd-page.js';
2
+ import '../pd-menu.js';
3
3
 
4
4
  export default {
5
- title: 'PdPage',
6
- component: 'pd-page',
5
+ title: 'PdMenu',
6
+ component: 'pd-menu',
7
7
  argTypes: {
8
8
  title: { control: 'text' },
9
9
  counter: { control: 'number' },
@@ -13,13 +13,13 @@ export default {
13
13
 
14
14
  function Template({ title = 'Hello world', counter = 5, textColor, slot }) {
15
15
  return html`
16
- <pd-page
16
+ <pd-menu
17
17
  style="--pd-page-text-color: ${textColor || 'black'}"
18
18
  .title=${title}
19
19
  .counter=${counter}
20
20
  >
21
21
  ${slot}
22
- </pd-page>
22
+ </pd-menu>
23
23
  `;
24
24
  }
25
25
 
@@ -0,0 +1,146 @@
1
+ import { html } from 'lit';
2
+
3
+ import '../pd-menu.js';
4
+
5
+ const ticomiLogo = html`
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 298.09 120.94"
9
+ class="logo"
10
+ >
11
+ <g id="Ebene_2" data-name="Ebene 2">
12
+ <!--g style="fill: var(--logo-fill-1,#15a1dc)"-->
13
+ <g id="Ebene_1-2" data-name="Ebene 1">
14
+ <path
15
+ d="M115.21,72.59c-2,0-3.5-1.46-3.5-4.68V48.68h7.2V44h-7.17l.12-9.64h-7l-3.49,9.6-5,.65v4.1h4.44V61.75c0,2.68-.07,4.52-.07,6.91,0,6.78,3.64,9.55,9.87,9.55,5,0,8.23-2,10.05-5.49l-1.68-1.65A6.16,6.16,0,0,1,115.21,72.59Z"
16
+ style="fill:#fff"
17
+ ></path>
18
+ <path
19
+ d="M136.92,62.74V53.63l.21-10L136,42.92l-14.38,4.57v2.7l4.24.62c.14,2.75.21,4.88.21,8.66v3.27c0,2.89,0,7.08-.1,10.43l-3.69.8v3.2h18.22V74L137,73.26C137,69.89,136.92,65.66,136.92,62.74Z"
20
+ style="fill:#fff"
21
+ ></path>
22
+ <ellipse
23
+ cx="131.35"
24
+ cy="32.37"
25
+ rx="5.82"
26
+ ry="5.47"
27
+ style="fill:#fff"
28
+ ></ellipse>
29
+ <path
30
+ d="M163.55,46.46a10.9,10.9,0,0,1,1.29.08l.44,3.46c.33,4.84,2.56,6.51,5.27,6.51,2.47,0,3.89-1.12,4.63-3.58-.5-5.48-5.58-10-12.83-10-10.25,0-18.55,6.51-18.55,17.74,0,11.55,7.74,17.55,17.1,17.55,6.5,0,11.44-2.67,14.09-8.27l-2.39-2.11a9.87,9.87,0,0,1-7.73,3.82c-5.77,0-9.57-4.34-9.57-12.25C155.3,50.11,159.6,46.46,163.55,46.46Z"
31
+ style="fill:#fff"
32
+ ></path>
33
+ <path
34
+ d="M196.07,42.92c-9.83,0-17.44,6.95-17.44,17.51s6.72,17.78,17.44,17.78,17.44-7.07,17.44-17.78S205.86,42.92,196.07,42.92Zm0,31.7c-3.88,0-5.81-4.24-5.81-14s1.93-14.07,5.81-14.07,5.81,4.32,5.81,14.07S199.92,74.62,196.07,74.62Z"
35
+ style="fill:#fff"
36
+ ></path>
37
+ <path
38
+ d="M272.87,62.74V55.07c0-8.16-3.08-12.15-10-12.15-3.92,0-7.26,1.47-11.09,6.12-1.35-4.09-4.39-6.12-9.07-6.12-4.13,0-7.47,1.94-10.76,5.8l-.41-5.06-1.18-.74L216.8,47.49v2.7l4.2.62c.19,2.75.21,4.18.21,8v4c0,2.89,0,7.07-.1,10.43l-3.7.8v3.2h18.07V74l-3.23-.69c-.06-3.37-.1-7.62-.1-10.54V52.07a9.42,9.42,0,0,1,5.68-2.5c3,0,4,1.76,4,6.56v6.61c0,3,0,7.1-.09,10.43l-3.56.8v3.2h17.73V74l-3.23-.7c-.07-3.34-.1-7.52-.1-10.53v-8a22.71,22.71,0,0,0-.15-2.69,9.14,9.14,0,0,1,5.8-2.48c2.82,0,3.91,1.36,3.91,6.52v6.65c0,3,0,7.11-.09,10.44l-3.32.79v3.2H276.4V74L273,73.24C272.9,69.91,272.87,65.74,272.87,62.74Z"
39
+ style="fill:#fff"
40
+ ></path>
41
+ <ellipse
42
+ cx="288.99"
43
+ cy="32.37"
44
+ rx="5.82"
45
+ ry="5.47"
46
+ style="fill:#fff"
47
+ ></ellipse>
48
+ <path
49
+ d="M294.66,73.26c-.06-3.37-.09-7.6-.09-10.52V53.63l.2-10-1.18-.74-14.38,4.57v2.7l4.24.62c.14,2.75.21,4.88.21,8.66v3.27c0,2.89,0,7.08-.1,10.43l-3.69.8v3.2h18.22V74Z"
50
+ style="fill:#fff"
51
+ ></path>
52
+ <path
53
+ d="M100.27,113.34V97.1H96.33V95.29l4-.22.29-7.31h2v7.31h7.32v2H102.6v16.42c0,3.22.81,5.4,4.29,5.4a9.14,9.14,0,0,0,3.17-.8l.61,1.88a14.75,14.75,0,0,1-4.13.94C101.69,120.94,100.27,117.87,100.27,113.34Zm17-5.6c0-8.24,5.36-13.3,11-13.3,6,0,9.67,4.25,9.67,11.68a10.92,10.92,0,0,1-.13,1.89H119.71c.09,6.37,3.82,10.93,9.51,10.93A11.4,11.4,0,0,0,136,116.7l1,1.76a13.84,13.84,0,0,1-8,2.48C122.55,120.94,117.32,116,117.32,107.74Zm18.49-1.64c0-6.45-2.92-9.66-7.46-9.66-4.26,0-8.12,3.62-8.65,9.66Zm10.84,1.64c0-8.44,5.4-13.3,11.54-13.3a10.35,10.35,0,0,1,7.39,3.11l-1.37,1.62a8.57,8.57,0,0,0-6-2.68c-5.16,0-9.15,4.6-9.15,11.25s3.63,11.15,9.12,11.15A10,10,0,0,0,165,116l1.2,1.63a12,12,0,0,1-8.06,3.33C151.59,120.94,146.65,116.09,146.65,107.74Zm29.67-25.25h2.32v11l0,5.56c2.64-2.62,5.26-4.59,8.74-4.59,5.21,0,7.63,3.16,7.63,9.68v16.19h-2.32V104.43c0-5.36-1.69-7.9-5.75-7.9-3,0-5.19,1.59-8.26,4.74v19h-2.32ZM208,95.07h2l.25,3.91h.12c2.57-2.57,5.2-4.54,8.68-4.54,5.22,0,7.64,3.16,7.64,9.68v16.19h-2.32V104.43c0-5.36-1.7-7.9-5.76-7.9-3,0-5.18,1.59-8.25,4.74v19H208Zm31-8.16a2.12,2.12,0,0,1,4.23,0,2.12,2.12,0,0,1-4.23,0Zm.91,8.16h2.32v25.24h-2.32Zm13.85,12.67c0-8.44,5.4-13.3,11.54-13.3a10.35,10.35,0,0,1,7.39,3.11l-1.37,1.62a8.57,8.57,0,0,0-6-2.68c-5.16,0-9.15,4.6-9.15,11.25s3.63,11.15,9.12,11.15a10,10,0,0,0,6.76-2.91l1.2,1.63a12,12,0,0,1-8.06,3.33C258.71,120.94,253.77,116.09,253.77,107.74Zm26.53,9.71,1.34-1.69a11.7,11.7,0,0,0,8,3.2c4,0,6-2.33,6-5,0-3.16-3.27-4.55-6.18-5.6-3.81-1.35-8-2.9-8-7.22,0-3.63,2.88-6.71,8.13-6.71a11.89,11.89,0,0,1,7.22,2.61l-1.25,1.68a9.6,9.6,0,0,0-6-2.31c-3.94,0-5.72,2.27-5.72,4.6,0,2.88,3,4,6,5.11,3.91,1.49,8.24,2.78,8.24,7.7,0,3.8-3,7.11-8.51,7.11A14.39,14.39,0,0,1,280.3,117.45Z"
54
+ style="fill:#fff"
55
+ ></path>
56
+ <path
57
+ d="M74,70.68C74,27.21,29.57,0,29.57,0a121.75,121.75,0,0,1-9,30.61C13.35,46.77,0,57.83,0,76.72c0,24.43,17.1,44.22,37.18,44.22S74,98.27,74,70.68Z"
58
+ style="fill:#db3a34"
59
+ ></path>
60
+ <path
61
+ d="M67.14,78.6C67.14,42,31,19.07,31,19.07a105.49,105.49,0,0,1-7.34,25.78C17.74,58.46,6.86,67.78,6.86,83.7c0,20.57,13.93,37.24,30.29,37.24S67.14,101.84,67.14,78.6Z"
62
+ style="fill:#f7931e"
63
+ ></path>
64
+ <path
65
+ d="M57.92,88.46c0-28.09-25.12-45.67-25.12-45.67a87.16,87.16,0,0,1-5.1,19.78C23.63,73,16.08,80.16,16.08,92.37c0,15.78,9.67,28.57,21,28.57S57.92,106.29,57.92,88.46Z"
66
+ style="fill:#ffc857"
67
+ ></path>
68
+ <path
69
+ d="M47.44,104.74c0-14-12.53-22.77-12.53-22.77a43.35,43.35,0,0,1-2.55,9.86c-2,5.21-5.79,8.77-5.79,14.86,0,7.87,4.82,14.25,10.48,14.25S47.44,113.64,47.44,104.74Z"
70
+ style="fill:#fff"
71
+ ></path>
72
+ </g>
73
+ </g>
74
+ </svg>
75
+ `;
76
+
77
+ export default {
78
+ title: 'Menu',
79
+ component: 'pd-menu',
80
+ argTypes: {
81
+ menuColor: { control: 'color' },
82
+ },
83
+ };
84
+
85
+ function Template({ menuItems, topMenuItems, color, logo, menuColor }) {
86
+ return html`
87
+ <pd-menu
88
+ style="
89
+ --squi-menu-bg-color: ${menuColor || color};
90
+ transition: background-color 1s;"
91
+ .logo="${logo ? { svg: logo } : undefined}"
92
+ .menuItems=${menuItems}
93
+ .topMenuItems=${topMenuItems}
94
+ ?teaserClosed="${true}"
95
+ >
96
+ </pd-menu>
97
+ `;
98
+ }
99
+
100
+ export const BasicColor1 = Template.bind({});
101
+ BasicColor1.args = {
102
+ menuItems: [
103
+ { name: 'Service', sec: 'secServices' },
104
+ { name: 'Over ons', sec: 'secAboutUs' },
105
+ { name: 'Contact', sec: 'secContactUs' },
106
+ ],
107
+ topMenuItems: [],
108
+ color: '#177e89',
109
+ };
110
+
111
+ export const BasicColor2 = Template.bind({});
112
+ BasicColor2.args = {
113
+ menuItems: [
114
+ { name: 'Service', sec: 'secServices' },
115
+ { name: 'Over ons', sec: 'secAboutUs' },
116
+ { name: 'Contact', sec: 'secContactUs' },
117
+ ],
118
+ topMenuItems: [],
119
+ color: '#084c61',
120
+ };
121
+
122
+ // with logo
123
+ export const WithLogo = Template.bind({});
124
+ WithLogo.args = {
125
+ menuItems: [
126
+ { name: 'Service', sec: 'secServices' },
127
+ { name: 'Over ons', sec: 'secAboutUs' },
128
+ { name: 'Contact', sec: 'secContactUs' },
129
+ ],
130
+ topMenuItems: [],
131
+ color: '#084c61',
132
+ logo: ticomiLogo,
133
+ };
134
+
135
+ // with top items
136
+ export const WithTopItems = Template.bind({});
137
+ WithTopItems.args = {
138
+ menuItems: [
139
+ { name: 'Service', sec: 'secServices' },
140
+ { name: 'Over ons', sec: 'secAboutUs' },
141
+ { name: 'Contact', sec: 'secContactUs' },
142
+ ],
143
+ topMenuItems: [{ name: 'Profile', icon: 'userIcon', sec: 'secServices' }],
144
+ color: '#084c61',
145
+ logo: ticomiLogo,
146
+ };
@@ -0,0 +1,41 @@
1
+ import { html } from 'lit';
2
+ import '../pd-teaser.js';
3
+
4
+ export default {
5
+ title: 'Teaser',
6
+ component: 'pd-teaser',
7
+ argTypes: {},
8
+ };
9
+
10
+ function Template() {
11
+ return html`
12
+ <pd-teaser
13
+ .teaserObjects="${[{ name: 't1' }, { name: 't2' }, { name: 't3' }]}"
14
+ >
15
+ <pd-teaser-content
16
+ slot="t1"
17
+ primaryTxt="Boek nu uw goedkoopste serviceafspraak."
18
+ secondaryTxt="Lage kosten met snelle reactietijden."
19
+ style="--squi-teaser-image: url('/images/hero_1.svg');"
20
+ >
21
+ </pd-teaser-content>
22
+ <pd-teaser-content
23
+ slot="t2"
24
+ primaryTxt="Professionele service voor uw verwarmingssysteem."
25
+ secondaryTxt="Ons ervaren team helpt u graag verder."
26
+ style="--squi-teaser-image: url('/images/hero_2.svg');"
27
+ >
28
+ </pd-teaser-content>
29
+ <pd-teaser-content
30
+ slot="t3"
31
+ primaryTxt="Wij bieden u verschillende serviceniveaus en individuele oplossingen."
32
+ secondaryTxt="Warmte en comfort met veiligheid."
33
+ style="--squi-teaser-image: url('/images/hero_3.svg');"
34
+ >
35
+ </pd-teaser-content>
36
+ </pd-teaser>
37
+ `;
38
+ }
39
+
40
+ export const Teaser = Template.bind({});
41
+ Teaser.args = {};
@@ -1,31 +1,31 @@
1
1
  import { html } from 'lit';
2
2
  import { fixture, expect } from '@open-wc/testing';
3
3
 
4
- import '../pd-page.js';
4
+ import '../pd-menu.js';
5
5
 
6
- describe('PdPage', () => {
6
+ describe('PdMenu', () => {
7
7
  it('has a default title "Hey there" and counter 5', async () => {
8
- const el = await fixture(html`<pd-page></pd-page>`);
8
+ const el = await fixture(html`<pd-menu></pd-menu>`);
9
9
 
10
10
  expect(el.title).to.equal('Hey there');
11
11
  expect(el.counter).to.equal(5);
12
12
  });
13
13
 
14
14
  it('increases the counter on button click', async () => {
15
- const el = await fixture(html`<pd-page></pd-page>`);
15
+ const el = await fixture(html`<pd-menu></pd-menu>`);
16
16
  el.shadowRoot.querySelector('button').click();
17
17
 
18
18
  expect(el.counter).to.equal(6);
19
19
  });
20
20
 
21
21
  it('can override the title via attribute', async () => {
22
- const el = await fixture(html`<pd-page title="attribute title"></pd-page>`);
22
+ const el = await fixture(html`<pd-menu title="attribute title"></pd-menu>`);
23
23
 
24
24
  expect(el.title).to.equal('attribute title');
25
25
  });
26
26
 
27
27
  it('passes the a11y audit', async () => {
28
- const el = await fixture(html`<pd-page></pd-page>`);
28
+ const el = await fixture(html`<pd-menu></pd-menu>`);
29
29
 
30
30
  await expect(el).shadowDom.to.be.accessible();
31
31
  });